/* ==========================================================================
   GuruFix CRM — Design System
   Display: Sora  ·  Body: Inter  ·  Data/mono: IBM Plex Mono
   Primary: Indigo/Blue field-service palette
   ========================================================================== */

:root {
  --ink: #161A2E;
  --ink-soft: #4B5170;
  --muted: #868CAB;
  --line: #E4E6F2;
  --surface: #FFFFFF;
  --bg: #F4F5FB;
  --bg-tint: #EEF0FA;

  --indigo: #4338CA;
  --indigo-600: #4F46E5;
  --indigo-500: #6366F1;
  --indigo-100: #E7E6FB;
  --indigo-50: #F3F2FE;
  --blue: #2563EB;
  --blue-100: #DCE8FE;

  --teal: #0D9488;
  --teal-100: #D8F3EF;
  --amber: #D97706;
  --amber-100: #FDECD1;
  --rose: #DC2626;
  --rose-100: #FCE0E0;
  --green: #16A34A;
  --green-100: #DCF5E4;
  --violet: #7C3AED;
  --violet-100: #EDE4FD;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22, 26, 46, 0.05);
  --shadow: 0 4px 16px rgba(38, 41, 84, 0.07);
  --shadow-lg: 0 16px 40px rgba(38, 41, 84, 0.14);

  --sidebar-w: 248px;
  --topbar-h: 68px;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0; }
button { font-family: var(--font-body); cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: var(--font-body); }
::selection { background: var(--indigo-100); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D6D9EC; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

*:focus-visible { outline: 2px solid var(--indigo-500); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.hidden { display: none !important; }
.icon { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* LOGIN SCREEN                                                           */
/* ---------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
}
.login-visual {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.12), transparent 40%),
    linear-gradient(160deg, #3730A3 0%, #4338CA 45%, #2563EB 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-visual::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 70% 30%, black, transparent 70%);
}
.login-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.login-brand .brandmark { width: 38px; height: 38px; }
.login-brand span { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.login-hero { position: relative; z-index: 1; max-width: 460px; }
.login-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase;
  background: rgba(255,255,255,0.14); padding: 6px 12px; border-radius: 100px;
  margin-bottom: 22px; font-weight: 600;
}
.login-hero h1 { font-size: 40px; line-height: 1.15; font-weight: 700; margin-bottom: 16px; }
.login-hero p { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,0.82); }
.route-ticker {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 14px;
  font-family: var(--font-mono); font-size: 12.5px;
}
.route-ticker .row { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.75); }
.route-ticker .dot { width: 7px; height: 7px; border-radius: 50%; background: #86EFAC; box-shadow: 0 0 0 4px rgba(134,239,172,0.18); }
.route-ticker .dot.b { background: #FDE68A; box-shadow: 0 0 0 4px rgba(253,230,138,0.18); }
.route-ticker .dot.c { background: #93C5FD; box-shadow: 0 0 0 4px rgba(147,197,253,0.18); }

.login-form-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form { width: 100%; max-width: 380px; }
.login-form .mobile-brand { display: none; }
.login-form h2 { font-size: 26px; margin-bottom: 6px; }
.login-form .sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-100); outline: none;
}
.field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; font-size: 13.5px; }
.field-row .remember { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.field-row a { color: var(--indigo-600); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; font-weight: 600; font-size: 14px;
  padding: 11px 18px; transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--indigo-600), var(--indigo)); color: #fff; box-shadow: 0 6px 16px rgba(67,56,202,0.28); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(67,56,202,0.36); }
.btn-block { width: 100%; }
.btn-secondary { background: var(--indigo-50); color: var(--indigo); border: 1.5px solid var(--indigo-100); }
.btn-secondary:hover { background: var(--indigo-100); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--bg-tint); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-danger { background: var(--rose-100); color: var(--rose); border: 1.5px solid #F6C6C6; }
.btn-danger:hover { background: #F9D3D3; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { padding: 9px; border-radius: 9px; background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }
.btn-icon:hover { background: var(--bg-tint); }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 12.5px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-foot { margin-top: 26px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* APP SHELL                                                              */
/* ---------------------------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: #191C34;
  color: #C8CBE8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; }
.sidebar-brand .brandmark { width: 30px; height: 30px; }
.sidebar-brand strong { font-family: var(--font-display); color: #fff; font-size: 16.5px; }
.sidebar-brand small { display: block; font-size: 10px; color: #8E93BC; letter-spacing: 0.06em; text-transform: uppercase; }

.nav-group { padding: 4px 12px; margin-top: 6px; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: #6C71A0; padding: 12px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; font-size: 13.6px; font-weight: 500;
  color: #B7BADC; margin-bottom: 2px; position: relative;
  transition: background 0.14s, color 0.14s;
}
.nav-item .icon { width: 17px; height: 17px; color: #8B90BE; transition: color 0.14s; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item:hover .icon { color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,0.28), rgba(99,102,241,0.05)); color: #fff; }
.nav-item.active .icon { color: #A5B4FC; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: #818CF8; border-radius: 0 4px 4px 0;
}
.nav-item .count { margin-left: auto; font-size: 10.5px; background: rgba(255,255,255,0.1); color: #C8CBE8; padding: 1px 7px; border-radius: 100px; font-family: var(--font-mono); }

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.sidebar-user .who strong { display: block; color: #fff; font-size: 13px; }
.sidebar-user .who span { font-size: 11.5px; color: #8E93BC; }
.sidebar-collapse-btn { display: none; }

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  background: rgba(244,245,251,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.hamburger { display: none; background: none; border: none; padding: 8px; border-radius: 8px; }
.hamburger:hover { background: var(--bg-tint); }
.page-title { font-size: 19px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.topbar-search {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 14px; width: 300px;
  color: var(--muted); font-size: 13.5px;
}
.topbar-search input { border: none; outline: none; background: transparent; width: 100%; font-size: 13.5px; color: var(--ink); }
.topbar-search .icon { width: 16px; height: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn { position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px; display: flex; }
.topbar-btn:hover { background: var(--bg-tint); }
.topbar-btn .badge-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; background: var(--rose); border: 2px solid var(--bg); border-radius: 50%; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 100px; border: 1.5px solid var(--line); background: var(--surface); }
.topbar-user img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.topbar-user span { font-size: 13px; font-weight: 600; }

.content { padding: 26px; flex: 1; }
.view { display: none; animation: fadeUp 0.32s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------- */
/* GENERIC LAYOUT / CARDS                                                 */
/* ---------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(6, 1fr); }
.grid-charts { grid-template-columns: 1.5fr 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-widgets { grid-template-columns: 1fr 1fr 1fr; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head .link { font-size: 12.5px; font-weight: 600; color: var(--indigo-600); }

.kpi-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi-icon .icon { width: 17px; height: 17px; }
.kpi-value { font-family: var(--font-display); font-size: 25px; font-weight: 700; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-delta { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; width: fit-content; padding: 2px 7px; border-radius: 100px; }
.kpi-delta.up { color: var(--green); background: var(--green-100); }
.kpi-delta.down { color: var(--rose); background: var(--rose-100); }

.section-title { font-size: 20px; margin-bottom: 4px; }
.section-desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-head-actions { display: flex; gap: 10px; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 100px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-indigo { background: var(--indigo-100); color: var(--indigo); }
.badge-blue { background: var(--blue-100); color: var(--blue); }
.badge-teal { background: var(--teal-100); color: var(--teal); }
.badge-amber { background: var(--amber-100); color: var(--amber); }
.badge-rose { background: var(--rose-100); color: var(--rose); }
.badge-green { background: var(--green-100); color: var(--green); }
.badge-violet { background: var(--violet-100); color: var(--violet); }
.badge-gray { background: #EEF0F6; color: var(--ink-soft); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 9px; background: var(--bg-tint); color: var(--ink-soft); }
.chip .icon { width: 13px; height: 13px; }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.priority-Low { background: #9CA3AF; }
.priority-Medium { background: var(--blue); }
.priority-High { background: var(--amber); }
.priority-Urgent { background: var(--rose); }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.data-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1.5px solid var(--line);
  position: sticky; top: 0; background: var(--surface);
}
.data-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-soft); }
.data-table tbody tr { transition: background 0.12s; cursor: pointer; }
.data-table tbody tr:hover { background: var(--indigo-50); }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-strong { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 13px; min-width: 220px; }
.search-box input { border: none; outline: none; font-size: 13.5px; width: 100%; background: transparent; }
.search-box .icon { width: 15px; height: 15px; color: var(--muted); }
.select-filter { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; background: var(--surface); color: var(--ink-soft); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-stack { display: flex; align-items: center; gap: 9px; }
.avatar-stack .who strong { display: block; font-size: 13px; }
.avatar-stack .who span { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; }
.tab-btn { padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn.active { color: var(--indigo-600); border-color: var(--indigo-600); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pagination .btns { display: flex; gap: 6px; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-state .icon-wrap { width: 56px; height: 56px; border-radius: 16px; background: var(--indigo-50); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.empty-state .icon-wrap .icon { width: 26px; height: 26px; color: var(--indigo); }
.empty-state h4 { color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 320px; }

/* Skeletons */
.skel { background: linear-gradient(90deg, #ECEEF7 25%, #F5F6FB 37%, #ECEEF7 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-row { height: 44px; border-radius: 10px; margin-bottom: 8px; }
.skel-card { height: 108px; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------------- */
/* KANBAN                                                                 */
/* ---------------------------------------------------------------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 268px; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kanban-col { background: var(--bg-tint); border-radius: var(--radius-lg); padding: 12px; min-height: 200px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.kanban-col-head .title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.kanban-col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-head .count { font-size: 11px; font-family: var(--font-mono); color: var(--muted); background: var(--surface); padding: 1px 7px; border-radius: 100px; }
.kanban-drop { min-height: 60px; display: flex; flex-direction: column; gap: 10px; transition: background 0.15s; border-radius: 12px; }
.kanban-drop.drag-over { background: var(--indigo-100); outline: 2px dashed var(--indigo-500); outline-offset: 4px; }
.kanban-card {
  background: var(--surface); border-radius: 12px; padding: 13px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow 0.15s, transform 0.15s;
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .kc-id { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.kanban-card .kc-cust { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.kanban-card .kc-service { font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.kanban-card .kc-foot { display: flex; align-items: center; justify-content: space-between; }
.kanban-card .kc-tech { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-soft); }
.kanban-card .kc-tech img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------------- */
/* MODALS / DRAWERS                                                       */
/* ---------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(20,22,42,0.44); backdrop-filter: blur(2px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.overlay.show { opacity: 1; pointer-events: all; }

.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-46%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 101; width: 520px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.modal.show { opacity: 1; pointer-events: all; transform: translate(-50%,-50%); }
.modal.modal-lg { width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-close { background: var(--bg-tint); border: none; border-radius: 8px; padding: 7px; display: flex; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 92vw; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 101; transform: translateX(100%); transition: transform 0.28s ease; display: flex; flex-direction: column; }
.drawer.show { transform: translateX(0); }
.drawer-head { padding: 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }

.detail-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .icon { width: 16px; height: 16px; color: var(--muted); margin-top: 1px; }
.detail-row .k { color: var(--muted); width: 118px; flex-shrink: 0; }
.detail-row .v { color: var(--ink); font-weight: 500; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1.5px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--indigo-500); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--indigo-100); }
.timeline-item .t-label { font-size: 13px; font-weight: 600; }
.timeline-item .t-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* PROGRESS TRACKER                                                       */
/* ---------------------------------------------------------------------- */
.progress-tracker { display: flex; align-items: center; margin: 8px 0 4px; }
.progress-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.progress-step .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-tint); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; z-index: 1; }
.progress-step .icon { width: 13px; height: 13px; color: var(--muted); }
.progress-step .lbl { font-size: 10.5px; color: var(--muted); margin-top: 8px; max-width: 74px; }
.progress-step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.progress-step:first-child::before { display: none; }
.progress-step.done .dot { background: var(--indigo-600); border-color: var(--indigo-600); }
.progress-step.done .icon { color: #fff; }
.progress-step.done .lbl { color: var(--ink); font-weight: 600; }
.progress-step.done::before { background: var(--indigo-600); }
.progress-step.current .dot { background: var(--surface); border-color: var(--indigo-600); box-shadow: 0 0 0 4px var(--indigo-100); }
.progress-step.current .icon { color: var(--indigo-600); }
.progress-step.current .lbl { color: var(--indigo-600); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* PROFILE / TECH CARDS                                                   */
/* ---------------------------------------------------------------------- */
.tech-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.tech-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tech-card-top { display: flex; gap: 12px; align-items: center; }
.tech-card-top img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.tech-card-top h4 { font-size: 14.5px; }
.tech-card-top .role { font-size: 12px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-Available { background: var(--green); }
.status-Busy { background: var(--amber); }
.status-Offline { background: #9CA3AF; }
.status-On_Leave { background: var(--rose); }
.tech-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 14px; }
.tech-stats .stat { text-align: center; background: var(--bg-tint); border-radius: 10px; padding: 8px 4px; }
.tech-stats .stat strong { display: block; font-size: 14px; }
.tech-stats .stat span { font-size: 10px; color: var(--muted); }

.match-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.match-card:hover { border-color: var(--indigo-300, var(--indigo-500)); background: var(--indigo-50); }
.match-card.selected { border-color: var(--indigo-600); background: var(--indigo-50); box-shadow: 0 0 0 3px var(--indigo-100); }
.match-card img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; }
.match-card .info { flex: 1; }
.match-card .info strong { font-size: 13.5px; display: block; }
.match-card .info .meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; margin-top: 3px; }

/* ---------------------------------------------------------------------- */
/* TOASTS                                                                 */
/* ---------------------------------------------------------------------- */
.toast-stack { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff;
  padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px;
  min-width: 260px; transform: translateX(120%); transition: transform 0.28s ease;
}
.toast.show { transform: translateX(0); }
.toast .icon { width: 17px; height: 17px; flex-shrink: 0; }
.toast.success .icon { color: #4ADE80; }
.toast.error .icon { color: #F87171; }
.toast.info .icon { color: #93C5FD; }

/* ---------------------------------------------------------------------- */
/* NOTIFICATIONS PANEL                                                    */
/* ---------------------------------------------------------------------- */
.notif-panel { position: absolute; top: 60px; right: 26px; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 90; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity 0.16s, transform 0.16s; max-height: 460px; display: flex; flex-direction: column; }
.notif-panel.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.notif-panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.notif-panel-head h4 { font-size: 14px; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--indigo-50); }
.notif-item .n-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--indigo-100); color: var(--indigo); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item .n-icon .icon { width: 15px; height: 15px; }
.notif-item p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.notif-item span { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* INVENTORY LOW-STOCK / MISC                                             */
/* ---------------------------------------------------------------------- */
.stock-bar { height: 6px; background: var(--bg-tint); border-radius: 100px; overflow: hidden; width: 90px; }
.stock-bar-fill { height: 100%; border-radius: 100px; }
.alert-banner { display: flex; align-items: center; gap: 12px; background: var(--amber-100); border: 1px solid #F6D9A8; color: #92400E; padding: 12px 16px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; }
.alert-banner .icon { width: 18px; height: 18px; flex-shrink: 0; }
.alert-banner strong { font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* MOBILE / RESPONSIVE                                                    */
/* ---------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-kpi { grid-template-columns: repeat(3, 1fr); }
  .grid-charts { grid-template-columns: 1fr; }
  .grid-widgets { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .topbar-search { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; color: var(--indigo); }
  .login-form .mobile-brand strong { font-family: var(--font-display); font-size: 18px; }
}
@media (max-width: 680px) {
  .grid-kpi, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .drawer, .modal { width: 100vw; max-width: 100vw; }
}

/* ==========================================================================
   TECHNICIAN PORTAL SYSTEMS STYLES
   ========================================================================== */
.login-role-tabs {
  display: flex;
  background: var(--bg-tint);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.role-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}
.role-tab.active {
  background: var(--surface);
  color: var(--indigo-600);
  box-shadow: var(--shadow-sm);
}

.tech-dashboard-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 20px;
}
@media (max-width: 980px) {
  .tech-dashboard-grid { grid-template-columns: 1fr; }
}

.tech-job-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  padding: 16px 20px;
  margin-bottom: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.tech-job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tech-job-card.active-job {
  border-color: var(--indigo-500);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(99, 102, 241, 0.04) 100%);
}
.tech-job-card .priority-badge {
  position: absolute;
  top: 16px;
  right: 20px;
}
.tech-job-card .job-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 8px;
  color: var(--ink);
}
.tech-job-card .customer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.tech-job-card .customer-info div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tech-job-card .actions {
  display: flex;
  gap: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.leave-form-container {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 24px;
}
@media (max-width: 980px) {
  .leave-form-container { grid-template-columns: 1fr; }
}

.leave-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leave-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.leave-card .details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.leave-card .type {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.leave-card .dates {
  font-size: 12px;
  color: var(--muted);
}
.leave-card .reason {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.toolbox-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.toolbox-card .part-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.toolbox-card .part-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.toolbox-card .stock-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 6px;
}

.ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.rating-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  padding: 18px;
}
.rating-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.rating-card .customer {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}
.rating-card .comment {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.status-indicator-wrap {
  position: relative;
  display: inline-block;
}
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--line);
  transition: background 0.15s;
}
.status-indicator:hover {
  background: var(--bg);
}
.status-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 100;
  min-width: 140px;
  overflow: hidden;
}
.status-dropdown.show {
  display: flex;
}
.status-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.status-dropdown-item:hover {
  background: var(--bg);
  color: var(--ink);
}

.part-qty-input {
  width: 60px !important;
  padding: 6px 8px !important;
  text-align: center;
}

.parts-used-selector {
  max-height: 180px;
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.part-used-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-tint);
}
.part-used-row:last-child {
  border-bottom: none;
}
.part-used-row select {
  width: auto !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
}

