/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════
   TOKENS  —  exact from brand guide
═══════════════════════════════════════════════════════ */
:root {
  /* Kairo Teal — primary accent, CTA, top match */
  --orange:       #2CBFB2;
  --orange-bright:#4DD5CA;
  --orange-deep:  #1FA89D;
  --orange-soft:  color-mix(in srgb, var(--orange) 14%, transparent);
  --glow-o:       color-mix(in srgb, var(--orange) 50%, transparent);
  --glow-o-wide:  color-mix(in srgb, var(--orange) 25%, transparent);

  /* Signal alias — used in templates */
  --signal:       var(--orange);

  /* Secondary blue — kept for info states */
  --blue:         #3E8FA8;
  --blue-bright:  #6DB8CC;
  --blue-soft:    rgba(62,143,168,.14);
  --glow-b:       rgba(62,143,168,.40);

  /* Backgrounds — light / white enterprise theme */
  --bg:       #F4F6F8;
  --bg-2:     #EAECF0;
  --surface:  #FFFFFF;
  --surface-2:#F0F3F6;

  /* Borders */
  --border:        rgba(0,0,0,.09);
  --border-strong: rgba(0,0,0,.14);

  /* Typography */
  --text:  #0F1E28;
  --muted: #5A7284;
  --faint: rgba(0,0,0,.30);

  /* Text aliases used in templates */
  --text-primary:   #0F1E28;
  --text-secondary: #5A7284;
  --text-muted:     #5A7284;

  /* Sidebar — always dark regardless of theme */
  --sidebar-text: rgba(255,255,255,.72);

  /* Semantic */
  --success:      #26C281;
  --success-soft: rgba(38,194,129,.14);
  --warning:      #F5A524;
  --error:        #F0555B;
  --error-soft:   rgba(240,85,91,.14);

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-full: 999px;

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Layout */
  --sidebar-w: 212px;
}

/* ═══════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════ */
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.02em;
}

a { color: var(--orange-bright); text-decoration: none; }
a:hover { color: #7DE8DF; }

/* ═══════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ════════════════ SIDEBAR ════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #080F18;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
}

/* Brand lockup */
.sidebar-brand {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
}
.sidebar-brand a:hover { color: #fff; }
.sidebar-brand svg { flex-shrink: 0; }

/* Custom logo variant — taller area, logo fills width, "tasked" label below */
.sidebar-brand--custom {
  height: auto;
  padding: 14px 12px 10px;
}
.sidebar-brand--custom a {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.sidebar-brand--custom a img {
  width: 100%;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .14s, color .14s;
  position: relative;
  line-height: 1;
}
.sidebar-nav a svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity .14s;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.sidebar-nav a:hover svg { opacity: 0.85; }
.sidebar-nav a.active {
  background: color-mix(in srgb, var(--orange) 10%, transparent);
  color: #fff;
}
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 2px;
  background: var(--orange);
  box-shadow: 0 0 10px var(--glow-o);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 2px;
}

/* Org + user footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 18px;
  flex-shrink: 0;
}
.sidebar-org {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.sidebar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-signout {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: 3px 9px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.sidebar-signout:hover { color: var(--text); background: rgba(255,255,255,.05); }

/* Attribution */
.sidebar-attribution {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(255,255,255,.18);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.auth-attribution {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 18px;
}

/* ════════════════ MAIN ════════════════ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.main-content {
  flex: 1;
  padding: 40px 44px 64px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.15;
}
.page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card + .card { margin-top: 14px; }

/* Card section label — mono, uppercase, muted */
.card-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .count {
  font-size: 11px;
  color: var(--faint);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: var(--r-full);
  text-transform: none;
  letter-spacing: 0;
}

/* Signal card — top recommendation, orange left edge + glow */
.card-signal {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--orange) 32%, transparent);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px color-mix(in srgb, var(--orange) 10%, transparent);
}
.card-signal::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--orange);
  box-shadow: 0 0 14px var(--glow-o);
}
.card-signal + .card { margin-top: 14px; }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 12px;
  color: var(--text-muted, var(--muted));
  font-weight: 500;
}
.info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn,
.btn-signal,
.btn-approve,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: box-shadow .16s, background .16s, opacity .14s, transform .08s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active, .btn-signal:active, .btn-approve:active,
.btn-primary:active, .btn-secondary:active,
.btn-ghost:active, .btn-danger:active { transform: scale(.97); }

.btn:disabled, .btn-signal:disabled, .btn-approve:disabled,
.btn-primary:disabled, .btn-secondary:disabled,
.btn-ghost:disabled, .btn-danger:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
}

/* Signal — orange gradient, reserved for the ONE most important CTA */
.btn-signal {
  background: linear-gradient(135deg, var(--orange-deep), var(--orange));
  color: #fff;
  box-shadow: 0 0 18px var(--glow-o-wide);
}
.btn-signal:hover:not(:disabled) {
  box-shadow: 0 0 28px var(--glow-o);
  color: #fff;
}

/* Approve — green, the one real commitment */
.btn-approve {
  background: var(--success);
  color: #04140C;
  font-weight: 700;
}
.btn-approve:hover:not(:disabled) {
  box-shadow: 0 0 22px rgba(38,194,129,.4);
  color: #04140C;
}

/* Primary — brand accent, everyday interactions */
.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--glow-o);
  color: #fff;
}

/* Secondary — transparent with border */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong) !important;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--muted) !important;
  color: var(--text);
}

/* Ghost — transparent, blue text */
.btn-ghost {
  background: transparent;
  color: var(--blue-bright);
  border: 1px solid var(--border) !important;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: rgba(62,123,250,.35) !important;
  color: var(--blue-bright);
}

/* Danger */
.btn-danger {
  background: var(--error-soft);
  color: var(--error);
  border: 1px solid rgba(240,85,91,.25) !important;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(240,85,91,.22);
  box-shadow: 0 0 14px rgba(240,85,91,.2);
}

/* Sizes */
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; }

/* Outline alias (kept for templates) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--blue-bright);
  border: 1px solid rgba(62,123,250,.35) !important;
  transition: background .16s, box-shadow .16s, transform .08s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn-outline:hover:not(:disabled) { background: var(--blue-soft); }
.btn-outline:active { transform: scale(.97); }
.btn-outline:disabled { opacity: .35; cursor: not-allowed; }
.btn-outline.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-outline.btn-xs { padding: 4px 10px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-2);
  color: var(--text);
  transition: border-color .14s, box-shadow .14s;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft), 0 0 16px var(--glow-o-wide);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); opacity: .6; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  cursor: pointer;
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%235A7284' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
  -webkit-appearance: none;
  appearance: none;
}
.form-input[type="file"] {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ═══════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid transparent;
}
.alert-error   { background: var(--error-soft);   border-color: rgba(240,85,91,.3);   color: #FDA4A7; }
.alert-success { background: var(--success-soft);  border-color: rgba(38,194,129,.3);  color: #6EE7B7; }
.alert-warning { background: rgba(245,165,36,.12); border-color: rgba(245,165,36,.3);  color: #FCD34D; }
.alert-info    { background: var(--orange-soft);   border-color: color-mix(in srgb, var(--orange) 28%, transparent); color: var(--orange-deep); }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }
.alert + * { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover td { background: rgba(0,0,0,.025); }

/* ═══════════════════════════════════════════════════════
   SCORE BADGE  — dot + mono label
   high = orange (the signal), med = blue, low = muted
═══════════════════════════════════════════════════════ */
.score-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.score-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.score-badge.high {
  background: var(--orange-soft);
  color: var(--orange-bright);
}
.score-badge.high::before {
  background: var(--orange);
  box-shadow: 0 0 6px var(--glow-o);
}
.score-badge.med {
  background: var(--blue-soft);
  color: var(--blue-bright);
}
.score-badge.med::before {
  background: var(--blue);
  box-shadow: 0 0 6px var(--glow-b);
}
.score-badge.low {
  background: rgba(0,0,0,.06);
  color: var(--muted);
}
.score-badge.low::before { background: var(--muted); opacity: .5; }

/* ═══════════════════════════════════════════════════════
   STATUS PILL
═══════════════════════════════════════════════════════ */
.status-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill.approved {
  background: var(--success-soft);
  color: var(--success);
}
.status-pill.approved::before {
  background: var(--success);
  box-shadow: 0 0 6px rgba(38,194,129,.6);
}
.status-pill.pending {
  background: var(--orange-soft);
  color: var(--orange-bright);
}
.status-pill.pending::before { background: var(--orange); }
.status-pill.reassigned {
  background: var(--blue-soft);
  color: var(--blue-bright);
}
.status-pill.reassigned::before { background: var(--blue); }
.status-pill.declined {
  background: rgba(0,0,0,.06);
  color: var(--muted);
}
.status-pill.declined::before { background: var(--muted); opacity: .5; }

.status-pill.en_route {
  background: var(--blue-soft);
  color: var(--blue-bright);
}
.status-pill.en_route::before { background: var(--blue); box-shadow: 0 0 6px var(--glow-b); }

.status-pill.completed {
  background: var(--success-soft);
  color: var(--success);
}
.status-pill.completed::before { background: var(--success); box-shadow: 0 0 6px rgba(38,194,129,.6); }

.status-pill.cancelled {
  background: rgba(0,0,0,.04);
  color: var(--muted);
}
.status-pill.cancelled::before { background: var(--faint); opacity: .4; }
.status-pill.tech_declined {
  background: rgba(240,85,91,.08);
  color: #F0555B;
}
.status-pill.tech_declined::before { background: #F0555B; }
.status-pill.tech_accepted {
  background: rgba(62,123,250,.1);
  color: #3E7BFA;
}
.status-pill.tech_accepted::before { background: #3E7BFA; box-shadow: 0 0 6px rgba(62,123,250,.5); }

/* Availability badge */
.avail-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-full);
  letter-spacing: .06em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.avail-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avail-yes {
  background: var(--success-soft);
  color: var(--success);
}
.avail-yes::before { background: var(--success); box-shadow: 0 0 5px rgba(38,194,129,.7); }
.avail-no {
  background: rgba(0,0,0,.05);
  color: var(--muted);
}
.avail-no::before { background: var(--muted); opacity: .5; }

/* ═══════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(0,0,0,.1);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   AUTH PAGES  (standalone — no sidebar)
═══════════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 72% 42%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 60%),
              radial-gradient(900px 500px at 10% 90%, color-mix(in srgb, var(--orange) 6%, transparent), transparent 55%),
              var(--bg);
  padding: 32px 16px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 48px rgba(0,0,0,.11);
}
.auth-card.auth-card-wide { max-width: 520px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo svg { flex-shrink: 0; }
.auth-logo .logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.auth-heading {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: 6px;
  line-height: 1.15;
}
.auth-subtext {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.55;
}

.auth-divider {
  text-align: center;
  margin: 22px 0;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-footer a { font-weight: 600; color: var(--blue-bright); }

/* ═══════════════════════════════════════════════════════
   DASHBOARD — results
═══════════════════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}
.detail-item .dl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-item .dv { font-size: 14px; color: var(--text); font-weight: 500; line-height: 1.4; }

.rec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.rec-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.rec-email { font-size: 13px; color: var(--muted); margin-top: 4px; }

.rec-reasoning {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.alt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.alt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  transition: border-color .16s, box-shadow .16s;
}
.alt-card:hover {
  border-color: var(--orange);
  box-shadow: 0 0 16px var(--glow-o-wide);
}
.alt-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.alt-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.alt-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alt-why   { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }

/* Analyzing state */
.analyzing-wrap {
  text-align: center;
  padding: 72px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.analyzing-wrap .spinner {
  width: 38px; height: 38px;
  border-width: 3px;
  margin-bottom: 22px;
  box-shadow: 0 0 24px var(--glow-o-wide);
}
.analyzing-wrap h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.analyzing-wrap p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state-icon {
  width: 54px; height: 54px;
  background: var(--orange-soft);
  border: 1px solid color-mix(in srgb, var(--orange) 25%, transparent);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 24px;
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
  max-width: 280px;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════════════ */
.settings-section { margin-bottom: 20px; }
.settings-section:last-child { margin-bottom: 0; }

.settings-heading {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.settings-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

.role-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}
.role-badge.admin  { background: var(--orange-soft);  color: var(--orange-bright); }
.role-badge.member { background: rgba(0,0,0,.07); color: var(--muted); }

.role-select {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  outline: none;
  color-scheme: light;
}
.role-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--blue-soft);
  border: 1px solid rgba(62,123,250,.3);
  color: var(--blue-bright);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   TECHNICIAN CARDS
═══════════════════════════════════════════════════════ */
.tech-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color .16s, box-shadow .16s;
}
.tech-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.tech-avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: var(--blue-soft);
  border: 1px solid rgba(62,123,250,.3);
  color: var(--blue-bright);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tech-info { flex: 1; min-width: 0; }
.tech-name  { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }
.tech-email { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tech-meta  { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: .04em; }

.tech-replace { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.replace-status { font-size: 12px; font-weight: 600; }
.replace-status.ok  { color: var(--success); }
.replace-status.err { color: var(--error);   }

.tech-actions { display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   ADD TECHNICIAN PANEL
═══════════════════════════════════════════════════════ */
.add-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.add-panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.add-panel-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ═══════════════════════════════════════════════════════
   MODE TABS
═══════════════════════════════════════════════════════ */
.mode-tabs {
  display: inline-flex;
  gap: 3px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  padding: 3px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.mode-tab {
  padding: 7px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: background .14s, color .14s;
  line-height: 1.4;
}
.mode-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.mode-tab:hover:not(.active) { color: var(--text); background: rgba(0,0,0,.04); }

/* ═══════════════════════════════════════════════════════
   SKILL TAGS
═══════════════════════════════════════════════════════ */
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.skill-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--blue-soft);
  color: var(--blue-bright);
  border: 1px solid rgba(62,123,250,.25);
  padding: 3px 10px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════ */
.text-muted   { color: var(--muted); }
.text-subtle  { color: var(--faint); }
.text-sm      { font-size: 12.5px; }
.text-xs      { font-size: 11.5px; }
.text-danger  { color: var(--error); }
.text-success { color: var(--success); }
.text-brand   { color: var(--orange); }
.font-mono    { font-family: var(--font-mono); }

.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .sidebar { width: 64px; }
  .sidebar-brand a span { display: none; }
  .sidebar-brand--custom { height: 60px; padding: 0 16px; }
  .sidebar-brand--custom a { flex-direction: row; align-items: center; gap: 10px; }
  .sidebar-brand--custom a img { max-width: 32px; max-height: 32px; }
  .sidebar-nav a span   { display: none; }
  .sidebar-nav a        { justify-content: center; padding: 10px; }
  .sidebar-nav a.active::before { top: 10px; bottom: 10px; }
  .sidebar-nav a svg    { width: 20px; height: 20px; opacity: .7; }
  .sidebar-org, .sidebar-username, .sidebar-signout { display: none; }
  .sidebar-footer { padding: 12px 10px; }
  .main-wrapper { margin-left: 64px; }
  .main-content { padding: 28px 24px 48px; }
}

@media (max-width: 600px) {
  .main-content { padding: 22px 18px 40px; }
  .form-row     { flex-direction: column; gap: 0; }
  .alt-cards    { grid-template-columns: 1fr; }
  .detail-grid  { grid-template-columns: 1fr; }
  .page-header  { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tech-card    { flex-wrap: wrap; }
  .tech-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
  .tech-list    { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .auth-card { padding: 32px 22px; }
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD STATS ROW
═══════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 5px;
}
.stat-denom {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ═══════════════════════════════════════════════════════
   ANALYZING STEP TEXT
═══════════════════════════════════════════════════════ */
.analyzing-step-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--orange-bright);
  letter-spacing: .04em;
  margin-top: 4px;
  transition: opacity .3s;
}

/* ═══════════════════════════════════════════════════════
   SCORE RING
═══════════════════════════════════════════════════════ */
.score-ring {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; }
.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   DISPATCHED STATE
═══════════════════════════════════════════════════════ */
.dispatched-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 24px 48px;
  text-align: center;
}
.dispatched-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-soft);
  border: 1px solid rgba(38,194,129,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 20px;
  box-shadow: 0 0 28px rgba(38,194,129,.2);
}
.dispatched-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.dispatched-sub {
  font-size: 14px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   TECHNICIAN CERTIFICATIONS
═══════════════════════════════════════════════════════ */
.tech-certs {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   CONFLICT WARNING
═══════════════════════════════════════════════════════ */
.conflict-warn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #F5A524;
  background: rgba(245,165,36,.1);
  border: 1px solid rgba(245,165,36,.28);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  margin-top: 10px;
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════════════
   UPCOMING SECTION (History page)
═══════════════════════════════════════════════════════ */
.section-mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 10px;
}
.upcoming-section {
  margin-bottom: 28px;
}
.upcoming-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}
.upcoming-row:last-child { border-bottom: none; }
.upcoming-date-col {
  text-align: center;
  flex-shrink: 0;
}
.upcoming-dow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  line-height: 1.2;
}
.upcoming-day {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.3;
}
.upcoming-info { min-width: 0; }
.upcoming-job-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-loc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-tech-col { flex-shrink: 0; }
.upcoming-tech-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   DISPATCH 2-COLUMN LAYOUT
═══════════════════════════════════════════════════════ */
.dispatch-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}
.dispatch-main { min-width: 0; }
.dispatch-sidebar {
  position: sticky;
  top: 28px;
}

/* ── Activity feed ── */
.activity-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background .12s;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--surface-2); }
.activity-row-main { flex: 1; min-width: 0; }
.activity-job {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-tech {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.activity-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}
.status-pill-sm {
  font-size: 10px;
  padding: 2px 7px;
}
.activity-all {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-top: 10px;
  letter-spacing: .04em;
  transition: color .12s;
}
.activity-all:hover { color: var(--orange); }

@media (max-width: 1000px) {
  .dispatch-layout { grid-template-columns: 1fr; }
  .dispatch-sidebar { display: none; }
  .tech-list { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR DARK OVERRIDES
   Sidebar stays dark navy regardless of light page theme.
   These rules must come last to win the cascade.
═══════════════════════════════════════════════════════ */
.sidebar {
  border-right-color: rgba(255,255,255,.08);
}
.sidebar-brand {
  border-bottom-color: rgba(255,255,255,.08);
}
.sidebar-footer {
  border-top-color: rgba(255,255,255,.08);
}
.sidebar-divider {
  background: rgba(255,255,255,.08);
}
.sidebar-org {
  color: rgba(255,255,255,.30);
}
.sidebar-nav a {
  color: rgba(255,255,255,.58);
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}
.sidebar-nav a.active {
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  color: #fff;
}
.sidebar-username {
  color: rgba(255,255,255,.90);
}
.sidebar-signout {
  color: rgba(255,255,255,.52);
  border-color: rgba(255,255,255,.14);
}
.sidebar-signout:hover {
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.06);
}
