/* ═══════════════════════════════════════════════════════════════════════════
   BRAINOSYS WORKFORCE PORTAL — STYLESHEET
   Desktop only · Light theme · System font stack
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Color tokens */
  --c-bg:           #f5f6f8;
  --c-surface:      #ffffff;
  --c-surface-alt:  #fafbfc;
  --c-border:       #e5e7eb;
  --c-border-strong:#d1d5db;
  --c-text:         #111827;
  --c-text-muted:   #6b7280;
  --c-text-subtle:  #9ca3af;

  /* v2.5 — Brand colors switched to logo blue */
  --c-accent:       #1a4fa0;
  --c-accent-hover: #143f80;
  --c-accent-soft:  #e8eef9;

  /* Primary aliases — used by newer components */
  --c-primary:       #1a4fa0;
  --c-primary-hover: #143f80;
  --c-primary-soft:  #e8eef9;

  --c-success:      #10b981;
  --c-success-soft: #ecfdf5;
  --c-warn:         #f59e0b;
  --c-warn-soft:    #fffbeb;
  --c-danger:       #ef4444;
  --c-danger-soft:  #fef2f2;
  --c-info:         #3b82f6;
  --c-info-soft:    #eff6ff;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(17,24,39,.04), 0 1px 1px rgba(17,24,39,.03);
  --sh-md: 0 2px 6px rgba(17,24,39,.05), 0 4px 12px rgba(17,24,39,.04);
  --sh-lg: 0 6px 20px rgba(17,24,39,.08), 0 2px 6px rgba(17,24,39,.04);
  --sh-xl: 0 18px 50px rgba(17,24,39,.16);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.text-muted { color: var(--c-text-muted); }
.text-subtle { color: var(--c-text-subtle); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOOT LOADER
   ═══════════════════════════════════════════════════════════════════════════ */
.boot-loader {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; gap: var(--sp-4);
  align-items: center; justify-content: center;
  background: var(--c-bg);
  z-index: 100;
}
.boot-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.boot-text { color: var(--c-text-muted); font-size: 13px; letter-spacing: .3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8eef9 0%, #f5f6f8 50%, #eff6ff 100%);
  padding: var(--sp-6);
}
.login-card {
  width: 420px; max-width: 100%;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
  box-shadow: var(--sh-xl);
}
.login-brand { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-8); }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--c-accent), #2d6cd5);
  color: #fff; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(232,96,10,.25);
}
.brand-mark.sm { width: 32px; height: 32px; font-size: 16px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.brand-sub { font-size: 11px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }
.login-title { margin: 0 0 var(--sp-1); font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.login-sub { margin: 0 0 var(--sp-6); color: var(--c-text-muted); font-size: 13px; }
.login-meta { display: flex; justify-content: flex-end; padding-top: var(--sp-3); }
.login-meta a { font-size: 13px; }
.login-footer { margin-top: var(--sp-6); color: var(--c-text-subtle); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field-label { font-size: 12px; font-weight: 600; color: var(--c-text); letter-spacing: .2px; }
.field-hint { color: var(--c-text-muted); font-size: 11px; }
.field input, .field select, .field textarea,
.input-date, .input-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: inherit; font-size: 14px;
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.input-date:focus, .input-select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  background: transparent; color: var(--c-text);
  letter-spacing: .1px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--c-accent); color: #fff;
  box-shadow: 0 1px 2px rgba(232,96,10,.2);
}
.btn-primary:hover:not(:disabled) { background: var(--c-accent-hover); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0ea271; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { background: transparent; border-color: var(--c-border-strong); color: var(--c-text); }
.btn-ghost:hover:not(:disabled) { background: var(--c-surface-alt); }
.btn-link { background: none; border: none; color: var(--c-accent); padding: 4px 8px; }
.btn-link:hover { text-decoration: underline; }
.btn-lg { padding: 13px 28px; font-size: 14px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; }

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

/* ─── Topbar (row 1) — brand · search · clock/bell/profile/logout ────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: 10px var(--sp-6);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.topbar-brand { display: flex; gap: var(--sp-3); align-items: center; }
.topbar-titles { line-height: 1.2; }
.topbar-name { font-size: 15px; font-weight: 700; }
.topbar-sub { font-size: 11px; color: var(--c-text-muted); letter-spacing: .4px; text-transform: uppercase; margin-top: 1px; }

/* Search now takes the central flex space */
.topbar-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}
.topbar-search input {
  width: 100%;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--c-text);
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.topbar-user { display: flex; gap: 10px; align-items: center; }
.topbar-clock {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 600;
  color: var(--c-text);
  padding: 6px 12px;
  background: var(--c-surface-alt);
  border-radius: 6px;
  min-width: 72px; text-align: center;
}
.topbar-profile { text-align: right; line-height: 1.2; }
.profile-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-role { font-size: 10px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ─── Navbar (row 2) — tabs only, no other elements ────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 var(--sp-6);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  /* v2.6.1: grouped nav fits without scrolling; visible overflow so the
     dropdown menus aren't clipped. Wraps to a second line on narrow screens. */
  flex-wrap: wrap;
  overflow: visible;
  position: sticky; top: 0; z-index: 49;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.navbar::-webkit-scrollbar { height: 6px; }
.navbar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.navbar .tab {
  position: relative;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar .tab:hover { color: var(--c-text); }
.navbar .tab.active {
  color: var(--c-primary);
  font-weight: 600;
  border-bottom-color: var(--c-primary);
}

/* Legacy support — the old .topbar-nav rule is no longer used because we
 * moved the nav out of the topbar, but keep these so older releases don't
 * lose styling if someone partial-deploys.                              */
.topbar-nav { display: none; }

.main {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.view-header h1 {
  margin: 0;
  font-size: 22px; font-weight: 700; letter-spacing: -.3px;
}
.view-date {
  color: var(--c-text-muted); font-size: 14px;
}
.view-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.view-actions .input-select { min-width: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   GRID + CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.grid { display: grid; gap: var(--sp-5); margin-bottom: var(--sp-5); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-tight { gap: var(--sp-3); margin-bottom: 0; }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-5);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}
.card-header h2 {
  margin: 0;
  font-size: 14px; font-weight: 700; letter-spacing: .1px;
  text-transform: uppercase; color: var(--c-text-muted);
}

/* Status card */
.status-card {
  background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
  border-color: #fbe5d6;
}
.status-label { font-size: 11px; font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .8px; }
.status-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin: 6px 0 4px; color: var(--c-text); }
.status-time { color: var(--c-text-muted); font-size: 13px; }
.status-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }
.status-bar {
  margin-top: var(--sp-4); padding-top: var(--sp-3);
  border-top: 1px dashed var(--c-border);
  font-size: 12px; color: var(--c-text-muted);
  min-height: 18px;
}

/* Stats card */
.stats-card { display: flex; flex-direction: column; }
.stats-row { display: flex; gap: var(--sp-6); flex: 1; }
.stat { flex: 1; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .8px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.status-meta { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px dashed var(--c-border); font-size: 13px; color: var(--c-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; margin: calc(var(--sp-5) * -1); margin-top: 0; padding: 0 var(--sp-5) var(--sp-5); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.data-table th {
  font-weight: 600; color: var(--c-text-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  background: var(--c-surface-alt);
  position: sticky; top: 0;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table-zebra tbody tr:nth-child(even) { background: var(--c-surface-alt); }
.data-table tbody tr:hover { background: var(--c-accent-soft); }

/* ═══════════════════════════════════════════════════════════════════════════
   SESSIONS LIST + STATUS PILLS
   ═══════════════════════════════════════════════════════════════════════════ */
.sessions-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.session-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 12px;
  background: var(--c-surface-alt);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.session-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.session-row .dot.active { background: var(--c-success); box-shadow: 0 0 0 4px rgba(16,185,129,.15); animation: pulse 2s infinite; }
.session-row .dot.closed { background: var(--c-text-subtle); }
.session-row .dot.flagged { background: var(--c-warn); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.session-time { font-family: var(--font-mono); font-weight: 600; }
.session-meta { color: var(--c-text-muted); font-size: 12px; margin-left: auto; }

.empty-state { text-align: center; padding: var(--sp-8); color: var(--c-text-subtle); font-style: italic; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.pill-present { background: var(--c-success-soft); color: #047857; }
.pill-halfday { background: var(--c-warn-soft); color: #b45309; }
.pill-absent  { background: var(--c-danger-soft); color: #b91c1c; }
.pill-leave   { background: var(--c-info-soft); color: #1e40af; }
.pill-incomplete { background: #f3f4f6; color: var(--c-text-muted); }
.pill-pending { background: #f3f4f6; color: var(--c-text-muted); }
.pill-approved { background: var(--c-success-soft); color: #047857; }
.pill-rejected { background: var(--c-danger-soft); color: #b91c1c; }
.pill-cancelled { background: #f3f4f6; color: var(--c-text-muted); }
.pill-late { background: var(--c-warn-soft); color: #b45309; }

.flag-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--c-warn-soft); color: #b45309;
  font-size: 11px; font-weight: 600;
  margin-right: 4px; margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6);
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: 480px; max-width: 100%;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--sh-xl);
  max-height: 90vh; overflow-y: auto;
}
.modal-card h2 { margin: 0 0 var(--sp-2); font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.modal-card.modal-lg { width: 640px; }
.modal-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-5); }
.info-box {
  background: var(--c-surface-alt);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  margin: var(--sp-3) 0;
  font-size: 13px;
  border-left: 3px solid var(--c-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-top: var(--sp-2);
  border: 1px solid transparent;
}
.alert-error   { background: var(--c-danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-success { background: var(--c-success-soft); color: #047857; border-color: #a7f3d0; }
.alert-warn    { background: var(--c-warn-soft); color: #b45309; border-color: #fde68a; }
.alert-info    { background: var(--c-info-soft); color: #1e40af; border-color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-2);
  z-index: 300; pointer-events: none;
}
.toast {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-info);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
  font-size: 13px;
  min-width: 280px; max-width: 380px;
  animation: toast-in .25s ease-out;
  pointer-events: auto;
}
.toast.success { border-left-color: var(--c-success); }
.toast.error   { border-left-color: var(--c-danger); }
.toast.warn    { border-left-color: var(--c-warn); }
.toast.fade-out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in  { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }

/* ═══════════════════════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════════════════════ */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-subtle); }

/* ═══════════════════════════════════════════════════════════════════════════
   HR + SALARY-SPECIFIC
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-card-hr { padding: var(--sp-5); }
.stat-card-hr .stat-meta { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }
.stat-warn { color: var(--c-accent); }

.role-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-3);
}
.role-breakdown-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    background: var(--c-surface-alt);
    border-radius: var(--r-sm);
    border-left: 3px solid var(--c-accent);
}
.role-breakdown-item .role-name { font-size: 13px; color: var(--c-text); }
.role-breakdown-item .role-count { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.pill-eligible { background: var(--c-warn-soft); color: #b45309; }
.pill-overdue  { background: var(--c-danger-soft); color: #b91c1c; }
.pill-soon     { background: var(--c-info-soft); color: #1e40af; }
.pill-ok       { background: var(--c-success-soft); color: #047857; }
.pill-nopay    { background: #f3f4f6; color: var(--c-text-muted); }

.note-item {
    padding: var(--sp-4);
    border-bottom: 1px solid var(--c-border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--sp-3);
    align-items: start;
}
.note-item:last-child { border-bottom: none; }
.note-meta { font-size: 12px; color: var(--c-text-muted); }
.note-author { font-weight: 600; color: var(--c-text); }
.note-text { font-size: 14px; line-height: 1.5; margin-top: 4px; white-space: pre-wrap; }
.note-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
    margin-left: 6px;
}
.note-cat.performance  { background: #eff6ff; color: #1e40af; }
.note-cat.behaviour    { background: #fef3eb; color: #b45309; }
.note-cat.attendance   { background: #f3f4f6; color: #4b5563; }
.note-cat.appreciation { background: #ecfdf5; color: #047857; }
.note-cat.warning      { background: #fef2f2; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════════
   PROJECTS / TASKS / SUBMISSIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.task-header {
    display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--c-border);
}

.pill-urgent       { background: var(--c-danger-soft); color: #b91c1c; }
.pill-medium       { background: var(--c-warn-soft); color: #b45309; }
.pill-low          { background: #f3f4f6; color: #6b7280; }
.pill-open         { background: #f3f4f6; color: #4b5563; }
.pill-in_progress  { background: var(--c-info-soft); color: #1e40af; }
.pill-submitted    { background: var(--c-warn-soft); color: #b45309; }
.pill-rework       { background: var(--c-danger-soft); color: #b91c1c; }
.pill-archived     { background: #f3f4f6; color: #6b7280; }
.pill-paused       { background: var(--c-warn-soft); color: #b45309; }

.priority-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.priority-dot.urgent { background: #ef4444; }
.priority-dot.medium { background: #f59e0b; }
.priority-dot.low    { background: #9ca3af; }

.due-overdue { color: var(--c-danger); font-weight: 600; }
.due-soon    { color: var(--c-warn); font-weight: 600; }
.due-future  { color: var(--c-text-muted); }

.task-comment {
    padding: 12px 14px;
    background: var(--c-surface-alt);
    border-radius: var(--r-sm);
    margin-bottom: var(--sp-2);
    font-size: 13px;
}
.task-comment-meta { font-size: 11px; color: var(--c-text-muted); margin-bottom: 4px; }
.task-comment-text { white-space: pre-wrap; line-height: 1.5; }
.task-comment-author { font-weight: 600; color: var(--c-text); }

.task-decision-comment {
    background: var(--c-info-soft);
    border-left: 3px solid var(--c-info);
}

.link-list {
    font-size: 12px;
    color: var(--c-text-muted);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.link-list a {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.link-count { font-weight: 600; color: var(--c-accent); }

.cat-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--c-surface-alt);
    color: var(--c-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.3 — TASK PROJECT MODE TOGGLE / ACTIVITY TIMELINE / IMPORTS
   ═══════════════════════════════════════════════════════════════════════════ */
.project-mode-toggle {
    display: inline-flex;
    background: var(--c-surface-alt);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 2px;
    margin-bottom: var(--sp-3);
}
.project-mode-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--c-text-muted);
    cursor: pointer;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.15s;
}
.project-mode-btn.active {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.project-mode-btn:hover:not(.active) { color: var(--c-text); }

.timeline-event {
    display: grid;
    grid-template-columns: 130px 28px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
}
.timeline-event:last-child { border-bottom: none; }
.timeline-when { color: var(--c-text-muted); font-size: 12px; padding-top: 2px; }
.timeline-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.tl-task_assigned   { background: #8b5cf6; }
.tl-task_received   { background: #3b82f6; }
.tl-task_submitted  { background: #f59e0b; }
.tl-submission      { background: #10b981; }
.tl-comment         { background: #6b7280; }
.tl-leave           { background: #ef4444; }
.timeline-title { font-weight: 600; color: var(--c-text); }
.timeline-detail { color: var(--c-text-muted); font-size: 12px; margin-top: 2px; }

.import-preview-table { font-size: 12px; }
.import-preview-table th, .import-preview-table td { padding: 4px 8px; }
.import-action-create { color: #047857; font-weight: 600; }
.import-action-update { color: #1e40af; font-weight: 600; }
.import-action-reuse  { color: var(--c-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   v2.4 — Global search results, duplicates, vault, attachments, counters
   ═══════════════════════════════════════════════════════════════════════════ */
/* (.topbar-search styles moved to the topbar block above; intentionally absent here) */
.gsr-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    font-size: 13px;
}
.gsr-item:hover { background: var(--c-surface-alt); }
.gsr-item:last-child { border-bottom: none; }
.gsr-type {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
    font-weight: 700;
    margin-right: 6px;
    letter-spacing: 0.5px;
}
.gsr-type-task       { background: #ede9fe; color: #5b21b6; }
.gsr-type-submission { background: #d1fae5; color: #065f46; }
.gsr-type-project    { background: #dbeafe; color: #1e40af; }
.gsr-type-employee   { background: #fef3c7; color: #92400e; }
.gsr-type-client     { background: #fce7f3; color: #9d174d; }
.gsr-title { font-weight: 600; color: var(--c-text); }
.gsr-subtitle { color: var(--c-text-muted); font-size: 12px; margin-top: 2px; }

/* Submission link list with duplicate badges */
.submission-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
    align-items: center;
}
.submission-link-row:last-child { border-bottom: none; }
.submission-link-row a {
    color: var(--c-primary);
    word-break: break-all;
    text-decoration: none;
}
.submission-link-row a:hover { text-decoration: underline; }
.dup-badge {
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dup-banner {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
}

/* Attachments list */
.attachment-row {
    display: grid;
    grid-template-columns: 24px 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
}
.attachment-row:last-child { border-bottom: none; }
.attachment-icon {
    width: 22px; height: 22px;
    border-radius: 4px;
    background: var(--c-surface-alt);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
}
.attachment-name { color: var(--c-text); }
.attachment-meta { color: var(--c-text-muted); font-size: 11px; }
.attachment-pending { background: var(--c-surface-alt); padding: 4px 8px; border-radius: 4px; font-size: 12px; color: var(--c-text-muted); margin: 4px 4px 0 0; display: inline-block;}

/* Vault credentials */
.vault-cred-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
    align-items: start;
    font-size: 13px;
}
.vault-cred-row:last-child { border-bottom: none; }
.vault-cred-label { font-weight: 600; color: var(--c-text); }
.vault-cred-cat {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    background: var(--c-surface-alt);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    color: var(--c-text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.vault-cred-field { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }
.vault-cred-field code {
    background: var(--c-surface-alt);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--c-text);
    font-family: monospace;
    user-select: all;
}
.copy-btn {
    background: none;
    border: none;
    color: var(--c-primary);
    cursor: pointer;
    font-size: 11px;
    padding: 0 4px;
}
.copy-btn:hover { text-decoration: underline; }

/* Project counter strip */
.role-breakdown {
    padding: 4px 0;
}
.role-bd-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
}
.role-bd-row:last-child { border-bottom: none; }
.role-bd-row strong { color: var(--c-text); }

/* Status pills (extended) */
.pill-paused    { background: #fef3c7; color: #92400e; }
.pill-completed { background: #d1fae5; color: #065f46; }
.pill-lost      { background: #fee2e2; color: #991b1b; }
.pill-inactive  { background: #e5e7eb; color: #4b5563; }

/* Topbar search stays visible at all widths in the new two-row layout */
@media (max-width: 720px) {
    .topbar-search { max-width: 220px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.5 — Notification bell, drawer, mention autocomplete, search panel
   Simpler dashboard cards, blue theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* Bell in topbar */
.bell-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all .15s;
}
.bell-btn:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-soft); }
.bell-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--c-surface);
}

/* Notification drawer (right side) */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.25);
    z-index: 1100;
}
.notif-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(420px, 90vw);
    background: var(--c-surface);
    z-index: 1101;
    box-shadow: -8px 0 32px rgba(17,24,39,.16);
    display: flex; flex-direction: column;
    transform: translateX(0);
    transition: transform .22s ease;
}
.notif-drawer.hidden { transform: translateX(100%); pointer-events: none; }
.notif-overlay.hidden { display: none; }

.notif-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
}
.notif-header h3 { margin: 0 0 12px; font-size: 17px; }
.notif-tabs {
    display: flex;
    background: var(--c-surface-alt);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}
.notif-tab {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--c-text-muted);
    cursor: pointer;
    font-weight: 500;
}
.notif-tab.active {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.notif-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.notif-item:hover { background: var(--c-surface-alt); }
.notif-item.unread { background: #f0f6ff; }
.notif-item.unread:hover { background: #e6f0ff; }
.notif-item.mention { border-left: 3px solid #f59e0b; }
.notif-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.notif-icon.kind-mention       { background: #fef3c7; color: #92400e; }
.notif-icon.kind-task_assigned { background: #ede9fe; color: #5b21b6; }
.notif-icon.kind-task_submitted{ background: #fef3c7; color: #92400e; }
.notif-icon.kind-task_approved { background: #d1fae5; color: #065f46; }
.notif-icon.kind-task_rework   { background: #fee2e2; color: #991b1b; }
.notif-icon.kind-task_commented{ background: #dbeafe; color: #1e40af; }
.notif-icon.kind-submission_dup{ background: #fee2e2; color: #991b1b; }
.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    line-height: 1.35;
}
.notif-body {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 2px;
    line-height: 1.4;
}
.notif-when {
    font-size: 11px;
    color: var(--c-text-subtle);
    margin-top: 4px;
}

/* @-mention autocomplete dropdown */
.mention-dropdown {
    position: absolute;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 240px;
    max-width: 320px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1200;
}
.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--c-border);
}
.mention-item:last-child { border-bottom: none; }
.mention-item:hover, .mention-item.active {
    background: var(--c-primary-soft);
}
.mention-item strong { color: var(--c-text); display: block; }
.mention-item small { color: var(--c-text-muted); font-size: 11px; }

/* Render @mentions inside displayed text */
.mention-chip {
    background: var(--c-primary-soft);
    color: var(--c-primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.92em;
}

/* Global search results panel */
.search-results-panel {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    width: min(880px, 92vw);
    max-height: 60vh;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.20);
    z-index: 1050;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.search-results-panel.hidden { display: none; }
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-alt);
}
.search-results-header h3 { margin: 0; font-size: 15px; }
.search-results-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
}
.search-results-section:last-child { border-bottom: none; }
.search-section-title {
    padding: 8px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--c-text-muted);
    letter-spacing: 0.5px;
}
.search-row {
    padding: 8px 20px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    transition: background .12s;
}
.search-row:hover { background: var(--c-primary-soft); }
.search-row .search-title { font-weight: 600; color: var(--c-text); font-size: 13px; }
.search-row .search-subtitle { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.search-row .search-meta {
    font-size: 11px;
    color: var(--c-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#search-results-body {
    overflow-y: auto;
    flex: 1;
}

/* Grouped submissions row */
.grouped-sub-row {
    cursor: pointer;
}
.grouped-sub-row:hover { background: var(--c-primary-soft) !important; }
.expand-icon {
    display: inline-block;
    transition: transform .15s;
    color: var(--c-text-muted);
    font-size: 10px;
    margin-right: 4px;
}
.expand-icon.open { transform: rotate(90deg); }
.sub-detail-tr td {
    background: var(--c-surface-alt) !important;
    padding: 0 !important;
}
.sub-detail-box {
    padding: 12px 20px;
    border-left: 3px solid var(--c-primary);
}
.sub-detail-entry {
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}
.sub-detail-entry:last-child { border-bottom: none; }

/* Simpler stat cards (de-emphasize gradients) */
.stat-card-hr {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 16px 18px;
}

/* Make sure orange-themed pills look right on blue theme */
.pill-active { background: #d1fae5; color: #065f46; }

/* v2.5.1 — Search filter chips + recency timestamps */
.search-filter-chips {
    display: flex;
    gap: 6px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
    background: var(--c-surface-alt);
}
.search-chip {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.search-chip:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}
.search-chip.active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.search-chip-count {
    background: rgba(0,0,0,.10);
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}
.search-chip.active .search-chip-count {
    background: rgba(255,255,255,.25);
}
.search-when {
    font-size: 11px;
    color: var(--c-text-subtle);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.6 — Access tracker dots, access modal, team workload
   ═══════════════════════════════════════════════════════════════════════════ */
.dots { display: inline-flex; gap: 5px; align-items: flex-start; vertical-align: middle; }
.dot-col { display: inline-flex; flex-direction: column; align-items: center; }
.dot {
    width: 12px; height: 12px; border-radius: 50%;
    display: inline-block;
}
.dot-have      { background: #10b981; }
.dot-missing   { background: #ef4444; }
.dot-requested { background: #f59e0b; }
.dot-stopped   { background: #9ca3af; }
.dot-label { font-size: 8.5px; color: var(--c-text-subtle); margin-top: 2px; letter-spacing: .2px; }
.access-chip {
    background: var(--c-primary-soft); color: var(--c-primary);
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px; margin-left: 8px;
    vertical-align: middle;
}

.access-item {
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.access-item-head { margin-bottom: 8px; }
.access-item-form {
    display: grid;
    grid-template-columns: 130px 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}
@media (max-width: 720px) {
    .access-item-form { grid-template-columns: 1fr 1fr; }
}

.workload-row:hover { background: var(--c-primary-soft) !important; }
.workload-total td {
    background: var(--c-surface-alt) !important;
    border-top: 2px solid var(--c-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.6.1 — Grouped navigation dropdowns
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-group { position: relative; flex-shrink: 0; }
.nav-group-btn {
  position: relative;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .12s;
}
.nav-group-btn:hover { color: var(--c-text); }
.nav-group-btn.group-active {
  color: var(--c-primary);
  font-weight: 600;
  border-bottom-color: var(--c-primary);
}
.nav-group-btn .caret { font-size: 9px; margin-left: 4px; opacity: .7; }

.nav-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 200px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(17,24,39,.14);
  padding: 6px;
  display: none;
  z-index: 80;
}
.nav-group.open .nav-menu { display: block; }

.nav-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--c-text);
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.nav-menu-item:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.nav-menu-item.current {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}
.nav-menu-item.current::after { content: " \2713"; font-size: 11px; }
