@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Instrument+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,600&display=swap');

/* ============================================================
   Heartfulness Asset Management
   CSS Variables + Full Layout
   ============================================================ */

:root {
  /* Core backgrounds */
  --bg-primary:      #ffffff;
  --bg-secondary:    #f1f5f9;
  --bg-tertiary:     #e2e8f0;
  --bg-sidebar:      #0f172a;
  --bg-sidebar-hover:#1e293b;
  --bg-sidebar-active:#334155;
  --bg-card:         #ffffff;
  --bg-overlay:      rgba(0,0,0,.55);

  /* Text */
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;
  --text-sidebar:    #94a3b8;
  --text-sidebar-active: #f8fafc;

  /* Borders */
  --border:          #e2e8f0;
  --border-focus:    #3b82f6;

  /* Brand accent */
  --accent:          #3b82f6;
  --accent-dark:     #2563eb;
  --accent-light:    #eff6ff;

  /* Status colours */
  --success:         #22c55e;
  --success-bg:      #f0fdf4;
  --success-border:  #86efac;
  --success-text:    #15803d;

  --warning:         #f59e0b;
  --warning-bg:      #fffbeb;
  --warning-border:  #fde68a;
  --warning-text:    #92400e;

  --danger:          #ef4444;
  --danger-bg:       #fef2f2;
  --danger-border:   #fca5a5;
  --danger-text:     #b91c1c;

  --info:            #06b6d4;
  --info-bg:         #ecfeff;
  --info-border:     #a5f3fc;
  --info-text:       #155e75;

  --purple:          #8b5cf6;
  --purple-bg:       #f5f3ff;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,.07);
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1);

  /* Radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  /* Sidebar */
  --sidebar-w: 248px;
  --topbar-h:  58px;

  /* ── Design System v2 Tokens ─────────────────────────────── */

  /* Typography scale (6-step ramp, px values for precision) */
  --font-xs:   11px;
  --font-sm:   12px;
  --font-base: 13px;
  --font-md:   14px;
  --font-lg:   16px;
  --font-xl:   18px;
  --font-2xl:  22px;

  /* Aliases matching audit spec */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  24px;

  /* Line heights */
  --line-height-tight:   1.3;
  --line-height-base:    1.5;
  --line-height-relaxed: 1.65;

  /* 8px spacing grid */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Elevation tokens (replaces competing shadow definitions) */
  --elevation-0: none;
  --elevation-1: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --elevation-2: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --elevation-3: 0 12px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --elevation-4: 0 24px 48px rgba(0,0,0,.18);

  /* Missing color tokens (fixes broken rgba(var(--accent-rgb)...) references) */
  --accent-rgb:    59, 130, 246;
  --color-muted:   #f1f5f9;
  --surface:       #ffffff;
  --surface-raised: #f8fafc;
  --placeholder-color: #9ca3af;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Instrument Sans', 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.sidebar-brand .brand-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
  margin-bottom: 10px;
}

.sidebar-brand .brand-name {
  font-size: 13px; font-weight: 700; color: #f8fafc;
  line-height: 1.3; letter-spacing: .2px;
}

.sidebar-brand .brand-sub {
  font-size: 11px; color: #94a3b8; margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0 16px;
}

.nav-group-label {
  padding: 10px 20px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  margin: 1px 8px;
  color: var(--text-sidebar);
  font-size: var(--font-base);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #e2e8f0;
}

.nav-link.active {
  background: rgba(59,130,246,0.2);
  color: #f8fafc;
  border-left-color: var(--accent);
  border-left-width: 4px;
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 18px; text-align: center;
  font-size: 13px; flex-shrink: 0;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  border-top: 1px solid #1e293b;
  padding: 12px 20px;
  flex-shrink: 0;
}

.session-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 6px 0;
}

.session-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.session-name { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.session-role { font-size: 11px; color: #94a3b8; }

/* ── Main Area ───────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  /* Allow the flex item to shrink below its content's intrinsic width so wide
     tables scroll inside their own .table-wrap instead of stretching the whole
     page and forcing horizontal page scroll. */
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex; align-items: center; gap: 12px;
}

.topbar-title {
  font-size: var(--font-lg); font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}

.topbar-actions {
  display: flex; align-items: center; gap: 8px;
}

.page-content {
  flex: 1;
  padding: 24px;
  /* Keep content (and its scroll containers) within the viewport width. */
  min-width: 0;
  max-width: 100%;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header > * {
  min-width: 0;
}

.card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-title .card-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

.card-body { padding: 20px; }
.card-body-sm { padding: 14px 20px; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12px; color: var(--text-muted);
}

/* ── Summary Cards ───────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}

.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.blue::before   { background: var(--accent); }
.stat-card.green::before  { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.purple::before { background: var(--purple); }

.stat-card .stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  margin-bottom: 12px;
}

.stat-card.blue   .stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-card.green  .stat-icon { background: var(--success-bg);   color: var(--success); }
.stat-card.orange .stat-icon { background: var(--warning-bg);   color: var(--warning); }
.stat-card.red    .stat-icon { background: var(--danger-bg);    color: var(--danger); }
.stat-card.purple .stat-icon { background: var(--purple-bg);    color: var(--purple); }

.stat-value {
  font-size: 30px; font-weight: 900; line-height: 1;
  color: var(--text-primary); margin-bottom: 4px;
}

.stat-card.red .stat-value { color: var(--danger); }

.stat-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary   { background: var(--accent);   color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-success   { background: var(--success);  color: white; border-color: var(--success); }
.btn-success:hover { background: #16a34a; }

.btn-danger    { background: var(--danger);   color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-warning   { background: var(--warning);  color: white; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; }

.btn-secondary { background: var(--bg-primary); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-secondary); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-secondary); }

.btn-outline-primary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent-light); }

.btn-xs  { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-sm  { padding: 6px 12px; font-size: 12.5px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-xl  { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
  width: 34px; height: 34px; padding: 0;
  justify-content: center;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-label {
  display: block;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 11.5px; color: var(--danger-text); margin-top: 5px; font-weight: 600; }

/* Input with icon */
.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: 13px;
}

.input-group .form-control { padding-left: 36px; }

.input-group .input-icon-right {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; max-width: 100%; }

/* Report tables: compact cells that WRAP instead of forcing wide horizontal
   scroll, so the many-column reports fit the page cleanly. Any residual
   overflow scrolls inside the card (.table-wrap), never the whole page. */
.report-table { font-size: 12.5px; }
.report-table thead th { padding: 8px 12px; }
.report-table tbody td {
  padding: 8px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}
/* Keep transaction-reference / id-like values readable but breakable */
.report-table tbody td:last-child { font-variant-numeric: tabular-nums; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  background: var(--bg-secondary);
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table thead th.sortable { cursor: pointer; }
.table thead th.sortable:hover { color: var(--accent); }

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td {
  background: var(--bg-secondary);
}

.table tbody tr.row-overdue td {
  background: var(--danger-bg) !important;
}

/* ── Data tables (desktop base; mobile card layout handled in @media) ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--bg-secondary);
  padding: 11px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr:nth-child(even) td { background: var(--bg-secondary); }
.data-table tbody tr:hover td { background: var(--accent-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Audit trail: scrollable body with sticky header + readable diff cells */
.audit-table-wrap { max-height: 66vh; overflow: auto; border-radius: var(--radius); }
.audit-table thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--border); }
.audit-diff { display: flex; flex-direction: column; gap: 3px; }
.audit-diff-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.audit-diff-key { font-weight: 600; color: var(--text-secondary); }
.audit-diff-old { color: var(--text-muted); text-decoration: line-through; }
.audit-diff-new { color: var(--success-text); font-weight: 600; }
.audit-diff-arrow { color: var(--text-muted); font-size: 10px; }
.audit-chip {
  display: inline-block; padding: 1px 8px; border-radius: 12px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.audit-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 700; flex: 0 0 auto;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}

.badge-blue   { background: var(--accent-light); color: var(--accent); }
.badge-green  { background: var(--success-bg);   color: var(--success-text); }
.badge-red    { background: var(--danger-bg);    color: var(--danger-text); }
.badge-orange { background: var(--warning-bg);   color: var(--warning-text); }
.badge-gray   { background: var(--bg-tertiary);  color: var(--text-secondary); }
.badge-purple { background: var(--purple-bg);    color: var(--purple); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}

.alert-icon { margin-top: 1px; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger-text); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.alert-info    { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-text); }

/* ── Overdue Banner ──────────────────────────────────────── */
.overdue-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.overdue-banner-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--danger-border);
}

.overdue-banner-title {
  font-size: 14px; font-weight: 800;
  color: var(--danger-text);
  display: flex; align-items: center; gap: 8px;
}

.overdue-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--danger-border);
  gap: 12px; flex-wrap: wrap;
}

.overdue-item:last-child { border-bottom: none; }
.overdue-item-info { font-size: 13px; color: var(--danger-text); }
.overdue-item-info strong { font-weight: 700; }
.overdue-item-info.clickable-info { cursor: pointer; }
.overdue-item-info.clickable-info:hover { text-decoration: underline; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.page-header-left h1 {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary); line-height: 1.2;
}

.page-header-left p {
  font-size: 13px; color: var(--text-muted);
  margin-top: 3px;
}

.page-header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; margin-bottom: 16px;
}

.filter-bar .form-control {
  flex: 1; min-width: 140px; max-width: 200px;
}

.filter-bar .search-wrap {
  flex: 2; min-width: 220px;
}

/* ── Search Dropdown ─────────────────────────────────────── */
.search-wrap { position: relative; }

.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  /* Use up to 60% of the viewport height so large screens show many more
     results, while staying scrollable when matches overflow. */
  max-height: min(60vh, 460px); overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
}

.search-dropdown.open { display: block; }

/* .wizard-card / .card use overflow:hidden for rounded-corner clipping, which
   cut the absolutely-positioned search dropdown down to ~one visible row.
   While a dropdown is open, let it escape its card. */
.wizard-card:has(.search-dropdown.open),
.card:has(.search-dropdown.open) { overflow: visible; }

/* ── Clickable org/department cards (open detail dashboard) ── */
.department-admin-card--clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.department-admin-card--clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.department-admin-card--clickable::after {
  content: 'View details →'; display: block; margin-top: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent);
  opacity: .65;
}

/* ── Department → Users hierarchy grouping ──────────────── */
.dept-user-groups { display: flex; flex-direction: column; gap: 18px; }
.dept-user-group { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--bg-primary); }
.dept-user-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--text-primary); }
.dept-user-group__head .badge { margin-left: auto; }

/* ── Permission checkbox grid (user form) ───────────────── */
#user-perms { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.perm-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.perm-item input { flex-shrink: 0; }

.search-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: var(--accent-light); }

.search-dropdown-item .sdi-name { font-weight: 600; color: var(--text-primary); }
.search-dropdown-item .sdi-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── Cart / Selected Items ───────────────────────────────── */
.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; color: var(--text-primary); font-size: 13.5px; }
.cart-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.qty-control {
  display: flex; align-items: center; gap: 6px;
}

.qty-btn {
  width: 28px; height: 28px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; color: var(--text-secondary);
  transition: all .1s;
}

.qty-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.qty-display {
  min-width: 32px; text-align: center;
  font-weight: 700; font-size: 14px;
}

/* ── Wizard ──────────────────────────────────────────────── */
.wizard-container {
  max-width: 760px;
  margin: 0 auto;
}

.wizard-steps-bar {
  display: flex; align-items: center;
  margin-bottom: 28px;
  overflow-x: auto; padding-bottom: 4px;
}

.wstep {
  display: flex; align-items: center;
  flex-shrink: 0;
}

.wstep-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-muted);
  transition: all .2s;
}

.wstep.active .wstep-circle {
  border-color: var(--accent); background: var(--accent); color: white;
}

.wstep.done .wstep-circle {
  border-color: var(--success); background: var(--success); color: white;
}

.wstep-label {
  margin-top: 4px; font-size: 11px;
  color: var(--text-muted); text-align: center;
  max-width: 72px; line-height: 1.2;
}

.wstep.active .wstep-label { color: var(--accent); font-weight: 700; }
.wstep.done  .wstep-label  { color: var(--success-text); font-weight: 600; }

.wstep-inner { display: flex; flex-direction: column; align-items: center; }

.wstep-connector {
  flex: 1; min-width: 24px; max-width: 60px;
  height: 2px; background: var(--border);
  margin: 0 4px 18px;
  transition: background .2s;
}

.wstep-connector.done { background: var(--success); }

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.wizard-card-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.wizard-card-header h2 {
  font-size: 16px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 2px;
}

.wizard-card-header p {
  font-size: 12.5px; color: var(--text-muted);
}

.wizard-card-body { padding: 24px; }

.wizard-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-secondary);
  position: sticky; bottom: 0; z-index: 10;
}

/* ── Movement Type Cards ─────────────────────────────────── */
.movement-type-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

.movement-type-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.movement-type-card:hover { border-color: var(--accent); background: var(--accent-light); }
.movement-type-card.selected { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

.mtc-emoji { font-size: 30px; margin-bottom: 8px; }
.mtc-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.mtc-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Photo Upload Zone ───────────────────────────────────── */
.photo-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg-secondary);
  position: relative;
}

.photo-zone:hover, .photo-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.photo-zone-icon { font-size: 36px; color: var(--text-muted); margin-bottom: 10px; }
.photo-zone-text { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.photo-zone-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.photo-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

.photo-zone-buttons {
  display: flex; gap: 10px; justify-content: center; margin-top: 14px;
}

.photo-required-label {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--danger-bg); color: var(--danger-text);
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  margin-bottom: 12px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px; margin-top: 12px;
}

.photo-thumb {
  position: relative; aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; cursor: zoom-in;
}

.photo-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.65); color: white;
  border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}

.photo-thumb:hover .photo-thumb-remove { opacity: 1; }

.photo-label-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,.65); color: white;
  font-size: 9px; padding: 2px 5px; border-radius: 3px;
}

/* ── Review Table ────────────────────────────────────────── */
.review-grid {
  display: grid; grid-template-columns: minmax(120px, 168px) minmax(0, 1fr);
  gap: 0;
  font-size: 13.5px;
}

.review-row {
  display: contents;
}

.review-row > * {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.review-row:last-child > * { border-bottom: none; }

.review-label { font-weight: 700; color: var(--text-muted); }
.review-value { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow-y: auto;
  width: 100%; max-width: 520px;
  animation: slideUp .2s ease;
}

@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-sm { max-width: 380px; }
.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 800; color: var(--text-primary); }

.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Camera Modal ────────────────────────────────────────── */
.camera-modal {
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  width: 100%; max-width: 540px;
  position: relative;
}

.camera-header {
  padding: 14px 18px;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: space-between;
  color: white; font-weight: 700;
}

.camera-header button {
  background: none; border: none;
  color: rgba(255,255,255,.7); font-size: 18px; cursor: pointer;
}

#camera-video {
  width: 100%; display: block;
  max-height: 380px; object-fit: cover;
}

.camera-footer {
  padding: 14px 18px;
  background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s ease;
  pointer-events: auto;
  border-left: 4px solid rgba(255,255,255,.3);
}

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { background: #166534; border-left-color: var(--success); }
.toast.toast-error   { background: #991b1b; border-left-color: var(--danger); }
.toast.toast-warning { background: #92400e; border-left-color: var(--warning); }
.toast.toast-info    { background: #155e75; border-left-color: var(--info); }

.toast.fade-out { animation: toastOut .25s ease forwards; }
@keyframes toastOut {
  to { transform: translateX(20px); opacity: 0; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-muted);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Photo Lightbox ──────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain; border-radius: var(--radius);
}

/* ── Receipt Type Cards ──────────────────────────────────── */
.receipt-type-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}

.receipt-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  cursor: pointer; text-align: center;
  transition: all .2s;
}

.receipt-card:hover { border-color: var(--accent); }
.receipt-card.selected { border-color: var(--accent); background: var(--accent-light); }
.receipt-card .rc-emoji { font-size: 24px; margin-bottom: 6px; }
.receipt-card .rc-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.receipt-card .rc-desc  { font-size: 11px; color: var(--text-muted); }

/* ── Report Cards ────────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow);
  display: flex; gap: 14px;
}

.report-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.report-card.active { border-color: var(--accent); background: var(--accent-light); }

.report-card-icon {
  width: 42px; height: 42px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.report-card-body h3 { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.report-card-body p  { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Location map ────────────────────────────────────────── */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.loc-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
}

.loc-stat-name { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.loc-stat-count { font-size: 16px; font-weight: 900; color: var(--accent); }

/* ── Activity Feed ───────────────────────────────────────── */
.activity-list { }

.activity-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}

.activity-row:last-child { border-bottom: none; }

.activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; margin-top: 1px;
}

.ai-out  { background: #fef3c7; color: #d97706; }
.ai-in   { background: var(--success-bg); color: var(--success-text); }

.activity-text { flex: 1; font-size: 13px; color: var(--text-secondary); }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ── Stock bar ───────────────────────────────────────────── */
.stock-bar {
  height: 5px; background: var(--bg-tertiary);
  border-radius: 3px; overflow: hidden; margin-top: 4px; min-width: 60px;
}

.stock-fill { height: 100%; border-radius: 3px; background: var(--success); transition: width .3s; }
.stock-fill.warn { background: var(--warning); }
.stock-fill.crit { background: var(--danger); }

/* ── Conditions ──────────────────────────────────────────── */
.cond-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%; margin-right: 5px;
}

.cond-excellent { background: var(--success); }
.cond-good      { background: #84cc16; }
.cond-fair      { background: var(--warning); }
.cond-repair    { background: var(--danger); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 52px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 46px; margin-bottom: 14px;
  color: var(--bg-tertiary);
}

.empty-state h3 {
  font-size: 16px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* ── Session modal ───────────────────────────────────────── */
.session-modal-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.session-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.session-card .sc-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white;
  margin: 0 auto 16px;
}

.session-card h1 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.session-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

/* ── Utilities ───────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm   { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-text); }
.text-success { color: var(--success-text); }
.fw-700 { font-weight: 700; }
.w-100  { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.text-right { text-align: right; }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 20px;
}

.login-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  padding: 32px 32px 28px;
  text-align: center;
  color: white;
}

.login-logo {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
}

.login-header h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.login-header p  { font-size: 13px; opacity: .85; margin: 0; }

.login-body { padding: 28px 32px 24px; }

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

.login-input-wrap { position: relative; }
.login-input-wrap .form-control {
  padding-right: 42px;
  height: 48px; font-size: 15px;
}
.login-input-wrap .toggle-pw {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 4px;
}

.login-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  margin-top: 4px;
}

.login-footer {
  text-align: center;
  padding: 0 32px 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.forgot-pw-view { display: none; }
.forgot-pw-view.active { display: block; }
.login-view.hidden { display: none; }

.change-pw-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--warning-text);
  display: flex; align-items: flex-start; gap: 8px;
}

/* ── Reset password page ─────────────────────────────────── */
.reset-pw-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 20px;
}

/* ══════════════════════════════════════════════════════════
   GLOBAL SEARCH OVERLAY
   ══════════════════════════════════════════════════════════ */
.global-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.global-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-secondary);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.global-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: var(--bg-primary);
}

.global-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.global-search-results.open { display: block; }

.gs-section-title {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-top: 1px solid var(--border);
}
.gs-section-title:first-child { border-top: none; }

.gs-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
}
.gs-result-item:hover { background: var(--accent-light); }
.gs-result-icon {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--accent); flex-shrink: 0;
}
.gs-result-main { flex: 1; min-width: 0; }
.gs-result-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-result-sub   { font-size: 11px; color: var(--text-muted); }
.gs-empty        { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   BOTTOM NAVIGATION (mobile only)
   ══════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  min-height: 64px;
  height: 64px;
  background: var(--bg-sidebar);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 150;
  padding: 0 2px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-items {
  display: flex;
  height: 100%;
  align-items: center;
  width: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
  padding: 6px 3px 7px;
  border-radius: var(--radius);
  transition: background .15s;
  color: #64748b;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active { background: rgba(255,255,255,.08); }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item .bn-icon { font-size: 16px; line-height: 1; }
.bottom-nav-item .bn-label {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
}

.bottom-nav-item .bn-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 2px);
  background: var(--danger);
  color: white; font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Hamburger / menu toggle ─────────────────────────────── */
.hamburger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.hamburger-btn:active { background: var(--bg-tertiary); }

/* Sidebar drawer on mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
}
.sidebar-overlay.open { display: block; }

/* ══════════════════════════════════════════════════════════
   SETTINGS EMAIL TAB
   ══════════════════════════════════════════════════════════ */
.email-config-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.email-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.email-status-badge.configured  { background: var(--success-bg); color: var(--success-text); }
.email-status-badge.unconfigured { background: var(--warning-bg); color: var(--warning-text); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – TABLET (≤ 1024px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-260px);
    width: 260px !important;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .main-area { margin-left: 0 !important; }

  .hamburger-btn { display: flex; }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .topbar-actions .btn span { display: none; }  /* hide btn text on tablet */
  .topbar-actions .btn i    { margin: 0; }

  .form-row-3 { grid-template-columns: 1fr 1fr; }

  .bottom-nav { display: flex; }
  .main-area { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0)); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – MOBILE (≤ 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html { font-size: 14px; }

  /* Push content above bottom nav — already set in ≤1024px block; kept here for specificity */
  .page-content { padding: 12px 14px 20px; }

  /* Topbar */
  .topbar {
    height: 54px;
    padding: 0 14px;
    gap: 8px;
  }
  .topbar-title { font-size: 15px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { height: 36px; padding: 0 10px; font-size: 12px; }

  /* Hide sidebar nav actions in topbar since we have bottom nav */
  .topbar-actions { display: none; }

  /* Grids → single column */
  .summary-grid     { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row-2,
  .form-row-3       { grid-template-columns: 1fr; gap: 12px; }
  .movement-type-options { grid-template-columns: 1fr; }
  .receipt-type-grid     { grid-template-columns: 1fr; }
  .location-grid    { grid-template-columns: 1fr; }

  /* Forms – larger touch targets */
  .form-control,
  .form-select {
    height: 48px;
    font-size: 16px;  /* prevents iOS zoom on focus */
    border-radius: var(--radius);
  }
  textarea.form-control { height: auto; min-height: 80px; }

  /* Buttons */
  .btn { height: 44px; font-size: 14px; border-radius: var(--radius); }
  .btn-sm { height: 36px; font-size: 13px; }
  .btn-xs { height: 28px; font-size: 12px; }

  /* Tables → card view */
  .table-wrap { overflow-x: visible; border-radius: 0; border: none; box-shadow: none; background: transparent; }

  .data-table thead { display: none; }

  .data-table tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
  }

  .data-table tbody tr.overdue-row {
    border-color: var(--danger-border);
    background: var(--danger-bg);
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border: none;
    font-size: 13px;
    gap: 8px;
  }
  .data-table tbody td:first-child { padding-top: 0; }
  .data-table tbody td:last-child  { padding-bottom: 0; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

  .data-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
    min-width: 90px;
    padding-top: 2px;
  }
  /* Cells that shouldn't show a label (action cells) */
  .data-table tbody td.no-label::before { display: none; }
  .data-table tbody td.no-label { justify-content: flex-end; }

  /* Stat cards 2-up */
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 26px; }

  /* Dashboard activity feed */
  .two-col-grid { grid-template-columns: 1fr; }

  /* Search bar in filter row */
  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .filter-bar .form-control,
  .filter-bar .form-select { height: 40px; font-size: 14px; }

  /* Wizard steps – compact */
  .wizard-steps { padding: 14px 10px; gap: 0; overflow-x: auto; }
  .wstep-label  { display: none; }  /* hide labels on small screen */
  .wstep-circle { width: 28px; height: 28px; font-size: 11px; }
  .wstep-connector { min-width: 16px; max-width: 30px; }

  /* Wizard body */
  .wizard-card-body { padding: 16px; }
  .wizard-card-footer { padding: 14px 16px; flex-direction: column-reverse; gap: 8px; }
  .wizard-card-footer .btn { width: 100%; justify-content: center; }
  .wiz-actions-right { width: 100%; flex-direction: column; gap: 8px; }
  .step-counter { display: none; }

  /* Modal */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    animation: slideUp .25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Camera modal */
  .camera-modal { width: 100%; max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

  /* Photo gallery */
  .photo-gallery { grid-template-columns: repeat(3, 1fr); }

  /* Tab list scroll */
  .tab-list { overflow-x: auto; white-space: nowrap; }
  .tab-item  { flex-shrink: 0; }

  /* Report cards */
  .report-cards-grid { grid-template-columns: 1fr; }

  /* Global search full-width */
  .global-search-wrap { max-width: none; }
  .global-search-results { left: -14px; right: -14px; border-radius: var(--radius-lg); }

  /* Cart items */
  .cart-item { flex-wrap: wrap; }

  /* Overdue banner */
  .overdue-banner { padding: 12px 14px; }

  /* Page headers */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header .btn { align-self: stretch; justify-content: center; }

  /* Login card */
  .login-body  { padding: 24px 20px 20px; }
  .login-footer { padding: 0 20px 20px; }
}

@media (max-width: 480px) {
  .bottom-nav {
    height: 64px;
    padding-inline: 1px;
  }

  .main-area {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }

  .bottom-nav-item {
    padding: 5px 1px;
  }

  .bottom-nav-item .bn-icon {
    font-size: 15px;
  }

  .bottom-nav-item .bn-label {
    font-size: 10px;
  }

  .bottom-nav-item .bn-badge {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
    top: 2px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .bottom-nav-item .bn-label {
    font-size: 11px;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – SMALL MOBILE (≤ 400px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .summary-grid  { grid-template-columns: 1fr; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
  .login-header  { padding: 24px 20px 20px; }
  .login-header h1 { font-size: 17px; }
}

/* ── Camera overlay helpers (replaces inline styles) ────── */
.camera-overlay-hidden { display: none; }
.camera-canvas-hidden  { display: none; }
.camera-label-select   { width: 160px; }

/* ══════════════════════════════════════════════════════════
   ASSET FORM SECTIONS (inventory add/edit modal)
   ══════════════════════════════════════════════════════════ */
.asset-section { border-bottom: 1px solid var(--border); }
.asset-section:last-child { border-bottom: none; }
.asset-section-title {
  padding: 14px 20px 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.asset-section-body { padding: 16px 20px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media (max-width: 768px) { .form-row-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .form-row-3 { grid-template-columns: 1fr; } }

/* ── Asset detail grid ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 0; margin-bottom: 12px; }
.detail-row  { display: flex; flex-direction: column; padding: 7px 12px; background: var(--bg-secondary); border-radius: var(--radius); }
.detail-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 13.5px; color: var(--text-primary); }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }
.form-hint-text { font-size: 12px; color: var(--text-muted); margin-top: -2px; margin-bottom: 8px; }

/* ── Request status badges ── */
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-issued   { background: #dbeafe; color: #1e40af; }

/* ── Request cards ── */
.req-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; }
.req-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.req-card-title  { font-weight: 700; font-size: 14.5px; color: var(--text-primary); }
.req-card-meta   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.req-card-body   { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.req-detail      { font-size: 13px; }
.req-detail-label{ font-size: 11px; color: var(--text-muted); font-weight: 600; }
.req-card-footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) { .req-card-body { grid-template-columns: 1fr; } }

/* ── Login role selector ── */
.role-selector { display: grid; grid-template-columns: 1fr; gap: 10px; }
.role-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s; width: 100%;
}
.role-btn:hover { border-color: var(--accent); background: var(--bg-card); }
.role-icon { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; flex-shrink: 0; }
.role-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.role-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ================================================================
   CHEQROOM-LEVEL UPGRADE — New Component Styles
   ================================================================ */

/* ── Asset Status Badges ── */
.asset-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.status-available  { background: #d1fae5; color: #065f46; }
.status-issued     { background: #fef3c7; color: #92400e; }
.status-reserved   { background: #dbeafe; color: #1e40af; }
.status-maintenance{ background: #fed7aa; color: #9a3412; }
.status-repair     { background: #fee2e2; color: #991b1b; }
.status-retired    { background: #f1f5f9; color: #64748b; }

/* ── Kit Cards ── */
.kits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kit-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.kit-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.kit-card-name   { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.kit-card-meta   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.kit-card-desc   { font-size: 12px; color: var(--text-secondary); }
.kit-items-list  { background: var(--bg-secondary); border-radius: var(--radius); padding: 10px 12px; }
.kit-item-row    { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.kit-item-qty    { font-weight: 700; color: var(--accent); margin-left: auto; }
.kit-item-avail  { font-size: 11px; }
.kit-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

/* ── Digital Acknowledgment Box ── */
.ack-box {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac; border-radius: var(--radius-lg);
  padding: 16px 18px; margin-top: 12px;
}
.ack-label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; color: #166534;
}

/* ── Section divider label (asset detail) ── */
.section-divider-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 6px;
  margin-bottom: 8px;
}

/* ── Asset lifecycle timeline (Asset Details history) ── */
.asset-timeline { position: relative; padding: 6px 0 2px; }
.atl-row { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.atl-row:not(:last-child)::before {
  content: ''; position: absolute; left: 13px; top: 26px; bottom: -2px;
  width: 2px; background: var(--border);
}
.atl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; z-index: 1;
}
.atl-main { flex: 1; min-width: 0; }
.atl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.atl-head strong { font-size: 13.5px; color: var(--text-primary); }
.atl-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.atl-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.atl-det { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* ── Smart Dashboard grid-3 ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* ── Maintenance page filter pills ── */
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  font-size: 12px; font-weight: 600; transition: all 0.15s;
}
.filter-pill:hover  { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Nav badge warning color ── */
.nav-badge-warn { background: var(--warning) !important; color: #fff !important; }

/* ── Btn outline ── */
.btn-outline {
  background: transparent; border: 1.5px solid var(--accent);
  color: var(--accent); border-radius: var(--radius);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ── QR Code modal ── */
#qr-canvas-wrap img, #qr-canvas-wrap canvas { display: block; }

/* ================================================================
   UI/UX Enhancement – Profile Dropdown + Cards + Settings Redesign
   ================================================================ */

/* ── Topbar action buttons ── */
.topbar-action-btn { display: inline-flex; align-items: center; gap: 6px; }
.topbar-btn-label  { display: none; }
@media (min-width: 640px) { .topbar-btn-label { display: inline; } }

/* ── Pending Returns Cards ── */
.pr-section { margin-top: 28px; }
.pr-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.pr-section-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.pr-section-title .fa-clock { color: var(--warning); }
.pr-section-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.pr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.pr-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.pr-card:hover { box-shadow: var(--shadow-md); }
.pr-card--overdue {
  border-color: var(--danger-border);
  background: linear-gradient(135deg, #fff, var(--danger-bg));
}
.pr-card--today {
  border-color: var(--warning-border);
  background: linear-gradient(135deg, #fff, var(--warning-bg));
}

.pr-card-top    { display: flex; align-items: flex-start; gap: 12px; }
.pr-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.pr-card--overdue .pr-avatar { background: linear-gradient(135deg, var(--danger), #f97316); }
.pr-card--today   .pr-avatar { background: linear-gradient(135deg, var(--warning), #f97316); }

.pr-card-info   { flex: 1; min-width: 0; }
.pr-card-name   { font-weight: 700; font-size: 13.5px; color: var(--text-primary); line-height: 1.3; }
.pr-card-meta   { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.pr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.pr-badge--overdue { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.pr-badge--today   { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.pr-badge--ok      { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }

.pr-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.pr-date { font-size: 12px; color: var(--text-muted); }
.pr-date strong { color: var(--text-primary); }
.pr-return-btn  { flex-shrink: 0; }

/* ── Settings redesign ── */
.settings-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.settings-count { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.settings-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 10px;
}
.settings-empty {
  text-align: center; padding: 28px; color: var(--text-muted);
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  font-size: 13px;
}

.settings-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}

.settings-item-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.settings-item-card:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }

.settings-item-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.settings-item-body  { flex: 1; min-width: 0; }
.settings-item-name  { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.settings-item-meta  { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.settings-item-tag   {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg-secondary); color: var(--text-muted);
  font-weight: 500; text-transform: capitalize;
}
.settings-item-tag--sys  { background: #f0fdf4; color: #166534; }
.settings-item-tag--used { background: var(--accent-light); color: var(--accent); }
.settings-item-tag--count{ background: var(--purple-bg); color: var(--purple); }
.settings-item-icon--brand {
  background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309;
  font-weight: 700; font-size: 16px; border-radius: var(--radius);
}

.settings-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Small settings buttons ── */
.sett-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius); font-size: 12px;
  font-weight: 600; border: 1.5px solid; cursor: pointer;
  transition: all 0.15s; background: transparent;
}
.sett-btn--edit { border-color: var(--border); color: var(--text-secondary); }
.sett-btn--edit:hover  { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.sett-btn--del  { border-color: transparent; color: var(--text-muted); }
.sett-btn--del:hover   { border-color: var(--danger-border); color: var(--danger-text); background: var(--danger-bg); }
.sett-btn--del:disabled{ opacity: 0.4; cursor: not-allowed; }
.sett-btn--warn { border-color: var(--warning-border); color: var(--warning-text); }
.sett-btn--warn:hover  { background: var(--warning-bg); }

/* ── User cards in Settings ── */
.user-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.user-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow 0.15s;
}
.user-card:hover { box-shadow: var(--shadow-md); }
.user-card--me   { border-color: var(--accent); }

.user-card-top   { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.user-card-top   { flex-wrap: wrap; }
.user-card-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.user-card-info  { flex: 1; min-width: 0; }
.user-card-name  { font-weight: 700; font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-card-you   { font-size: 10px; padding: 2px 7px; background: var(--accent); color: #fff; border-radius: 10px; font-weight: 700; }
.user-card-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-mobile{ font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.user-card-role-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 12px;
  white-space: normal; flex-shrink: 0; max-width: 100%;
}
.user-card-pw-warn {
  margin: 0 16px 10px; padding: 7px 10px; font-size: 11px;
  background: var(--warning-bg); color: var(--warning-text);
  border-radius: var(--radius); border: 1px solid var(--warning-border);
}
.user-card-actions {
  display: flex; gap: 8px; padding: 10px 16px 14px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}

/* ── Change password section in Settings ── */
.change-pw-section {
  margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--border);
}
.change-pw-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.change-pw-form  {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; max-width: 480px;
}

/* ============================================================
   DESIGN POLISH – Premium SaaS Look
   ============================================================ */

/* ── Inter / system font upgrade ─────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.01em;
}

/* ── Topbar polish ────────────────────────────────────────── */
.topbar {
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid rgba(226,232,240,0.8);
}

.topbar-title {
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em;
}

/* ── Sidebar polish ───────────────────────────────────────── */
.sidebar {
  background: #0f172a;
  border-right: none;
}

.sidebar-brand .brand-name {
  font-size: 13px; font-weight: 800; letter-spacing: -0.02em;
}

.nav-link {
  border-radius: 0 8px 8px 0;
  margin-right: 12px;
  padding: 9px 16px 9px 20px;
  font-size: 13px; font-weight: 500;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%);
  color: #e2e8f0;
  border-left-color: var(--accent);
}

.nav-link:hover:not(.active) {
  background: rgba(255,255,255,0.04);
}

/* ── Page content breathing room ─────────────────────────── */
.page-content {
  padding: 28px 28px 40px;
  max-width: 1400px;
  margin-right: auto;
}

/* ── Card polish ──────────────────────────────────────────── */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow 0.2s;
}

.card-header {
  padding: 16px 20px;
  background: transparent;
}

.card-title {
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226,232,240,0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform 0.2s, box-shadow 0.2s;
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:disabled { opacity: 1; }
.stat-card--interactive { cursor: pointer; }

.inventory-row { cursor: pointer; }
.inventory-row td { transition: background 0.15s ease; }

.inventory-detail-gallery {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.inventory-detail-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.inventory-detail-hero img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.inventory-detail-thumbs {
  margin-bottom: 0;
}

.dashboard-quick-modal {
  max-height: 62vh;
  overflow-y: auto;
}

.dashboard-quick-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-quick-item:last-child {
  border-bottom: none;
}

.import-preview-summary {
  display: grid;
  gap: 8px;
  padding: 16px 20px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.import-error-list {
  display: grid;
  gap: 10px;
}

.import-error-item {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  font-size: 13px;
}

.stat-value {
  font-size: 28px; font-weight: 900; letter-spacing: -0.03em;
}

.stat-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ── Button polish ────────────────────────────────────────── */
.btn {
  letter-spacing: -0.01em; font-weight: 600;
  transition: all 0.15s ease;
}
.btn:active { transform: translateY(1px); box-shadow: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 1px 3px rgba(59,130,246,0.3), 0 1px 2px rgba(59,130,246,0.2);
  border: none;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

/* ── Form controls ────────────────────────────────────────── */
.form-control {
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-primary);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}

.form-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.01em;
}

/* ── Table polish ─────────────────────────────────────────── */
.table thead th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-secondary);
}

.table tbody tr {
  transition: background 0.1s;
}
.table tbody tr:hover { background: rgba(59,130,246,0.03); }

/* ── Modal polish ─────────────────────────────────────────── */
.modal-wrap {
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.5);
}

.modal-box {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(226,232,240,0.7);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 8px 20px rgba(0,0,0,0.12);
}

.modal-header {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
}

.modal-body  { padding: 20px 22px; }
.modal-footer { padding: 14px 22px 18px; }

/* ── Page header polish ───────────────────────────────────── */
.page-header-left h1 {
  font-size: 20px; font-weight: 800; letter-spacing: -0.03em;
}

.page-header-left p {
  font-size: 12.5px; color: var(--text-muted);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 20px;
}

/* ── Tab list polish ──────────────────────────────────────── */
.tab-item {
  font-size: 13px; font-weight: 600;
  transition: color 0.15s;
  letter-spacing: -0.01em;
}

/* ── Section labels polish ────────────────────────────────── */
.section-divider-label {
  font-size: 10.5px; letter-spacing: 0.08em;
  font-weight: 700; text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Dashboard: due today banner polish ───────────────────── */
.due-today-banner {
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}

/* ── PR cards hover refinement ────────────────────────────── */
.pr-card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.pr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Settings cards hover refinement ─────────────────────── */
.settings-item-card {
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.settings-item-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

/* ── User cards hover refinement ─────────────────────────── */
.user-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Kit cards hover refinement ──────────────────────────── */
.kit-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.kit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Filter pills polish ──────────────────────────────────── */
.filter-pill {
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  transition: all 0.15s;
}
.filter-pill:hover:not(.active) {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

/* ── Empty states ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-state p { font-size: 13px; }

/* ── Scrollbar refinement ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Focus ring accessibility ─────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Smooth page transitions ──────────────────────────────── */
#app > * {
  animation: pageIn 0.18s ease-out;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography scale ─────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 13px; font-weight: 700; }

/* ── Gradient text accent (page section headers) ──────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Alert polish ─────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  padding: 10px 14px;
}

/* ── Input group polish ───────────────────────────────────── */
.input-group { border-radius: var(--radius); overflow: hidden; }
.input-group .form-control { border-radius: 0; }
.input-group-text {
  font-size: 13px; font-weight: 500;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
}

/* ── Toast polish ─────────────────────────────────────────── */
.toast {
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
  font-size: 13px; font-weight: 600;
  backdrop-filter: blur(8px);
}

/* ============================================================
   Equipment Request — Multi-item form
   ============================================================ */

/* Event/Program highlight box */
.req-event-highlight {
  background: linear-gradient(135deg, var(--accent-light), #f0f9ff);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.req-event-highlight .form-label {
  color: var(--accent); font-weight: 700; font-size: 13px;
}

/* Item builder row */
.req-item-builder {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.req-item-builder:focus-within { border-color: var(--accent); }
.req-item-builder-main {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.req-item-builder-main .form-control { height: 36px; }
.req-item-builder-main .search-wrap { flex: 1; min-width: 180px; }

/* Items list on request card */
.req-items-list {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.req-item-row {
  font-size: 13px; color: var(--text-primary);
  display: flex; align-items: center; gap: 6px;
}

@media (max-width: 600px) {
  .req-item-builder-main { flex-direction: column; align-items: stretch; }
  .req-item-builder-main .search-wrap { min-width: 0; width: 100%; }
  .req-item-builder-main .form-control { width: 100% !important; }
}

/* ── Pending returns — staff read-only badge ── */
.pr-readonly-badge {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 10px;
  display: inline-flex; align-items: center; gap: 5px;
}

/* ── Dashboard location scope badge ── */
.dash-scope-badge {
  background: var(--accent-light); color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-lg);
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  margin-bottom: 16px; display: inline-flex; align-items: center; gap: 7px;
}

/* ============================================================
   Public Landing + Super Admin Refinement
   ============================================================ */

.login-hero-card--homepage {
  justify-content: flex-start;
  gap: 24px;
}

.login-visual-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
  gap: 18px;
  margin-top: 8px;
  align-items: stretch;
}

.login-visual-frame {
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  min-height: 320px;
}

.login-visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-hero-note-grid {
  display: grid;
  gap: 12px;
}

.login-hero-note {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(148,163,184,0.2);
}

.login-hero-note__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.06);
  color: var(--text-primary);
  font-size: 18px;
}

.login-hero-note__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.login-hero-note__text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.settings-shell {
  display: grid;
  gap: 20px;
}

.settings-page-head {
  padding: 28px 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
}

.settings-page-head__copy {
  max-width: 740px;
  min-width: 0;
}

.settings-page-head__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,0.08);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.settings-page-head h1 {
  margin: 0;
}

.settings-page-head p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.settings-tab-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  background: rgba(255,255,255,0.86);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(15,23,42,0.04);
  white-space: normal;
  text-align: left;
  max-width: 100%;
}

.settings-tab-item.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: rgba(37,99,235,0.22);
}

.settings-tab-content {
  display: grid;
  gap: 18px;
}

.settings-toolbar--panel {
  align-items: flex-start;
  padding: 24px 26px;
  border-radius: 24px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 12px 30px rgba(15,23,42,0.06);
}

.settings-toolbar-copy p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-toolbar-copy,
.settings-toolbar-actions {
  min-width: 0;
}

.settings-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.department-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.department-admin-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 14px 30px rgba(15,23,42,0.06);
  position: relative;
  overflow: hidden;
}

.department-admin-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--dept-accent);
}

.department-admin-card::after {
  content: '';
  position: absolute;
  top: -42px;
  right: -42px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--dept-soft);
  pointer-events: none;
}

.department-admin-card__hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.department-admin-card__copy {
  min-width: 0;
}

.department-admin-card__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dept-soft);
  color: var(--dept-accent);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.department-admin-card__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dept-accent);
}

.department-admin-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.department-admin-card__title-row h3 {
  font-size: 21px;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.department-admin-card__copy p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 34ch;
}

.department-admin-card__pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
  max-width: 100%;
  text-align: center;
}

.department-admin-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.department-admin-card__metric {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(148,163,184,0.16);
}

.department-admin-card__metric span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.department-admin-card__metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-primary);
}

.department-admin-card__stores {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.department-store-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.department-admin-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.department-admin-card--selected {
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.department-profile-card {
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 16px 34px rgba(15,23,42,0.08);
}

.department-profile-card__hero {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 26px 28px 22px;
  background:
    radial-gradient(circle at top right, var(--dept-soft), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.9));
  border-bottom: 1px solid rgba(148,163,184,0.16);
}

.department-profile-card__copy {
  min-width: 0;
}

.department-profile-card__copy h3 {
  overflow-wrap: anywhere;
}

.department-profile-card__icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dept-soft);
  color: var(--dept-accent);
  font-size: 24px;
}

.department-profile-card__copy p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.department-profile-card__body {
  padding: 24px 28px 28px;
}

.platform-overview-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  padding: 30px 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.15), transparent 28%),
    radial-gradient(circle at bottom left, rgba(217,119,6,0.12), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 16px 38px rgba(15,23,42,0.08);
}

.platform-overview-hero__copy {
  flex: 1 1 480px;
  min-width: 0;
}

.platform-overview-hero__copy h1 {
  overflow-wrap: anywhere;
  line-height: 1.06;
}

.platform-overview-hero__eyebrow {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.platform-overview-hero__copy p {
  margin-top: 8px;
  max-width: 56ch;
  color: var(--text-secondary);
  line-height: 1.65;
}

.platform-overview-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: flex-start;
  flex: 0 1 420px;
  min-width: 0;
}

.admin-focus-card {
  margin-bottom: 24px;
  overflow: hidden;
}

.admin-focus-card__header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-focus-card__header h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.admin-focus-card__header p {
  margin: 0;
  max-width: 64ch;
  color: var(--text-secondary);
  line-height: 1.65;
}

.admin-focus-card__header > div:first-child {
  min-width: 0;
  flex: 1 1 340px;
}

.admin-focus-card__stats {
  margin-bottom: 20px;
}

.admin-focus-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-focus-tab {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.admin-focus-tab.is-active {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.24);
}

.admin-focus-card__activity {
  margin-top: 20px;
}

.admin-role-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-panel-stack {
  overflow: hidden;
  min-width: 0;
}

.admin-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 14px;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  max-width: 100%;
  white-space: normal;
}

.admin-chip--success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.16);
}

.admin-chip--danger {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.14);
}

.admin-chip--muted {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.18);
}

.admin-mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-mini-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.admin-mini-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(248,250,252,0.94));
}

.admin-empty-state h3 {
  margin-top: 12px;
  margin-bottom: 6px;
}

.admin-empty-state p {
  color: var(--text-secondary);
  max-width: 48ch;
  line-height: 1.6;
}

.admin-org-table-wrap {
  overflow-x: auto;
}

.admin-org-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.admin-org-table th {
  padding: 0 14px 6px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-org-table td {
  padding: 16px 14px;
  background: #fff;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  vertical-align: middle;
}

.admin-org-table td:first-child {
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px 0 0 16px;
}

.admin-org-table td:last-child {
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0 16px 16px 0;
}

.admin-org-table tr.is-selected td {
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
  border-color: rgba(15, 118, 110, 0.26);
}

.admin-org-name-btn {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  padding: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

.admin-org-name-btn:hover {
  color: var(--accent);
}

.admin-org-table__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.platform-admin-directory {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.platform-admin-directory__group {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.platform-admin-directory__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.platform-admin-directory__head > div {
  min-width: 0;
  flex: 1 1 260px;
}

.platform-admin-directory__head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.platform-admin-directory__head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.settings-create-card {
  border-radius: 24px;
  overflow: hidden;
}

.platform-overview-hero__actions .btn,
.department-admin-card__actions .sett-btn,
.admin-table-actions .sett-btn,
.card-header .btn,
.settings-toolbar-actions .btn {
  white-space: normal;
}

.admin-activity-card {
  margin-top: 24px;
}

.dept-health-card--platform {
  background:
    radial-gradient(circle at top right, var(--dept-soft), transparent 36%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(148,163,184,0.18);
}

.dept-health-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 920px) {
  .login-visual-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .admin-panel-grid {
    grid-template-columns: 1fr;
  }

  .platform-overview-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .platform-overview-hero__actions {
    width: 100%;
    justify-content: flex-start;
    flex-basis: auto;
  }

  .department-profile-card__hero {
    grid-template-columns: 1fr;
  }

  .admin-focus-card__header {
    flex-direction: column;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .review-row {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .review-row:last-child {
    border-bottom: none;
  }

  .review-row > * {
    border-bottom: none;
    padding: 0;
  }

  .review-label {
    margin-bottom: 4px;
  }
}

@media (max-width: 768px) {
  .settings-page-head,
  .settings-toolbar--panel,
  .platform-overview-hero {
    padding: 22px 20px;
    border-radius: 22px;
  }

  .platform-overview-hero,
  .department-profile-card__hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-panel-grid {
    grid-template-columns: 1fr;
  }

  .admin-focus-card__header {
    flex-direction: column;
  }

  .department-profile-card__hero {
    grid-template-columns: 1fr;
  }

  .department-admin-card {
    padding: 18px;
  }

  .department-admin-card__title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .department-admin-card__metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .login-visual-frame {
    min-height: 220px;
  }

  .department-admin-grid {
    grid-template-columns: 1fr;
  }

  .department-admin-card__metrics {
    grid-template-columns: 1fr;
  }

  .department-admin-card__actions,
  .settings-toolbar-actions,
  .platform-overview-hero__actions {
    width: 100%;
  }

  .user-card-email {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .admin-focus-tabs,
  .platform-admin-directory__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-mini-item {
    flex-direction: column;
  }

  .department-admin-card__actions .sett-btn,
  .settings-toolbar-actions .btn,
  .platform-overview-hero__actions .btn {
    justify-content: center;
    flex: 1 1 100%;
  }
}

/* ============================================================
   Theme System Overrides
   ============================================================ */

:root {
  --accent-soft: #dbeafe;
  --accent-rgb: 59, 130, 246;
}

.sidebar-brand .brand-logo,
.session-avatar,
.user-card-avatar,
.role-icon {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.2) 0%, rgba(var(--accent-rgb), 0.08) 100%);
}

.nav-link:hover:not(.active) {
  background: rgba(var(--accent-rgb), 0.08);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 1px 3px rgba(var(--accent-rgb), 0.32), 0 1px 2px rgba(var(--accent-rgb), 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-dark) 100%);
  box-shadow: 0 6px 14px rgba(var(--accent-rgb), 0.26);
}

.form-control:focus,
.global-search-input:focus,
.movement-type-card.selected,
.movement-type-card:hover,
.receipt-card.selected,
.receipt-card:hover {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-control:focus,
.global-search-input:focus {
  border-color: var(--accent);
}

.table thead th {
  background: linear-gradient(180deg, #f8fafc, #eef4ff);
}

.table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.018);
}

.table tbody tr:hover td {
  background: rgba(var(--accent-rgb), 0.05);
}

.card-header {
  padding: 20px 24px 18px;
}

.card-body,
.card-body-sm {
  padding: 24px;
}

.login-page-ksv {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 24%),
    radial-gradient(circle at bottom center, rgba(55, 48, 163, 0.1), transparent 28%),
    linear-gradient(135deg, #f7f3ea 0%, #f4fbf8 48%, #eef4ff 100%);
}

.login-hero-card,
.login-panel-card {
  border-radius: 30px;
}

.login-hero-card--homepage {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.68), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88));
}

.login-logo--ashram {
  background: linear-gradient(135deg, #0F766E, #D97706);
}

.login-highlight {
  background: rgba(255,255,255,0.9);
  box-shadow: 0 10px 24px rgba(15,23,42,0.04);
}

.login-highlight i {
  background: rgba(15,118,110,0.1);
  color: #0F766E;
}

.department-login-card {
  position: relative;
  padding-left: 24px;
}

.department-login-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 999px;
  background: var(--dept-accent);
}

.settings-static-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--text-primary);
  font-weight: 600;
}

.org-settings-card {
  margin-top: 20px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
}

.org-settings-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.org-settings-card__head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--text-primary);
}

.org-settings-card__head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.asset-id-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.asset-id-preview-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.18);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  display: grid;
  gap: 6px;
}

.asset-id-preview-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.asset-id-preview-card strong {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.platform-export-card {
  margin-bottom: 24px;
}

.platform-export-panel {
  display: grid;
  gap: 18px;
}

.platform-export-preview {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  border: 1px solid rgba(148,163,184,0.18);
}

.platform-export-preview__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform-export-stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
}

.platform-export-stat span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.platform-export-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-primary);
}

.platform-export-preview__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.platform-export-preview__meta > div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.16);
}

.platform-export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dept-health-card__header .sett-btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .card-header,
  .card-body,
  .card-body-sm {
    padding: 20px;
  }

  .platform-export-preview__stats,
  .platform-export-preview__meta {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Platform Login + Dashboard Additions
   ============================================================ */

.login-page-ksv {
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.2), transparent 32%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(135deg, #f6f3ea 0%, #eef4ff 45%, #f9fafb 100%);
}

/* ============================================================
   Mobile Navigation + Profile Fix
   ============================================================ */

.topbar-left {
  flex: 1;
  min-width: 0;
}

.topbar-left > div {
  min-width: 0;
}

.topbar-title,
.topbar-breadcrumb {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.topbar-right .global-search-wrap {
  flex: 0 1 420px;
}

.topbar-quick-actions,
.topbar-utility-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-utility-group {
  flex-shrink: 0;
}

.topbar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.86);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.topbar-icon-btn:hover,
.topbar-icon-btn.active {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: var(--accent-light);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.12);
}

.topbar-icon-badge {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.utility-dropdown-wrap {
  position: relative;
}

.utility-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 22px;
  box-shadow: 0 24px 48px rgba(15,23,42,0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.16s, transform 0.16s;
  z-index: 1200;
  backdrop-filter: blur(14px);
}

.utility-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.utility-dropdown-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(148,163,184,0.16);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.09), rgba(255,255,255,0.72));
}

.utility-dropdown-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.utility-dropdown-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.utility-dropdown-pill {
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  transition: background 0.12s;
}

.notification-item:hover {
  background: rgba(var(--accent-rgb), 0.06);
}

.notification-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.notification-item__copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-item__copy strong {
  font-size: 13px;
  color: var(--text-primary);
}

.notification-item__copy small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.notification-item__count {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.notification-empty {
  padding: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.session-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.sidebar-footer {
  padding-top: 16px;
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,0.24));
}

.sidebar-footer-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-footer-btn {
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.12s, border-color 0.12s;
}

.sidebar-footer-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}

.sidebar-footer-btn--danger {
  color: #fecaca;
  border-color: rgba(248,113,113,0.24);
  background: rgba(127,29,29,0.18);
}

.profile-shell {
  display: grid;
  gap: 22px;
}

.profile-card {
  border-radius: 24px;
}

.profile-detail-list {
  display: grid;
  gap: 14px;
}

.profile-detail {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.16);
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.profile-detail span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-detail strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-word;
}

.profile-security-copy h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.profile-security-copy p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.profile-password-action {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .topbar {
    height: 60px;
    padding: 0 14px;
  }

  .topbar-right {
    flex: 0 0 auto;
    gap: 8px;
  }

  .topbar-right .global-search-wrap,
  .topbar-quick-actions,
  .topbar-breadcrumb {
    display: none;
  }

  .utility-dropdown {
    position: fixed;
    top: calc(var(--topbar-h) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 92px);
  }

  .main-area {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
  }

  .page-content {
    padding: 16px 14px 28px;
  }

  .profile-password-action .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .notification-item {
    grid-template-columns: 36px 1fr;
  }

  .notification-item__count {
    grid-column: 2;
    justify-self: flex-start;
  }
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: stretch;
}

.login-hero-card,
.login-panel-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.12);
  backdrop-filter: blur(12px);
}

.login-hero-card {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 680px;
}

.login-hero-card--loading {
  min-height: 320px;
  text-align: center;
}

.login-logo--ashram {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  margin: 0 0 18px;
  background: linear-gradient(135deg, #d97706, #1d4ed8);
  color: #fff;
  font-size: 28px;
}

.login-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.login-hero-card h1 {
  font-size: 40px;
  line-height: 1.08;
  margin-bottom: 12px;
  color: #111827;
}

.login-hero-card p {
  font-size: 15px;
  color: #475569;
  max-width: 54ch;
}

.login-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.login-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(148,163,184,0.2);
  color: var(--text-primary);
  font-weight: 600;
}

.login-highlight i {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
}

.login-panel-card {
  padding: 28px;
}

.login-panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.login-panel-header h2 {
  font-size: 24px;
  line-height: 1.15;
  color: var(--text-primary);
}

.login-panel-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.department-card-grid {
  display: grid;
  gap: 12px;
}

.department-login-card {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 52px 1fr 20px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.24);
  background: #fff;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.department-login-card:hover {
  transform: translateY(-1px);
  border-color: var(--dept-accent);
  box-shadow: 0 16px 30px rgba(15,23,42,0.08);
}

.department-login-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--dept-accent) 14%, white);
  color: var(--dept-accent);
  font-size: 20px;
}

.department-login-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.department-login-card__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.department-login-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.department-login-card__arrow {
  color: var(--text-muted);
}

/* Organization selection card */
.org-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.org-login-card {
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.org-login-card:hover {
  border-color: var(--org-accent, var(--accent));
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  background: color-mix(in srgb, var(--org-accent, var(--accent)) 6%, white);
}

.org-login-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.org-login-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.org-login-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.org-login-card__arrow {
  font-size: 14px;
}

.login-selected-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-back-btn {
  width: fit-content;
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  padding: 0;
}

.login-selected-dept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.login-selected-dept__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.oauth-btn {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.oauth-btn:hover {
  background: var(--bg-secondary);
}

.login-or-divider {
  position: relative;
  text-align: center;
  margin: 0 0 18px;
}

.login-or-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.login-or-divider span {
  position: relative;
  background: rgba(255,255,255,0.92);
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.login-footer-links {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
}

.dept-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dept-health-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.dept-health-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.dept-health-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dept-health-card__stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-actions--platform {
  min-width: 1px;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero-card {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .login-page-ksv {
    padding: 14px;
  }

  .login-panel-card,
  .login-hero-card {
    padding: 22px;
    border-radius: 22px;
  }

  .login-hero-card h1 {
    font-size: 30px;
  }

  .department-login-card {
    grid-template-columns: 44px 1fr 16px;
    padding: 14px;
  }

  .department-login-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 18px;
  }
}

/* ============================================================
   Maintenance Module
   ============================================================ */

/* Tab navigation */
.maint-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.maint-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.maint-tab:hover { color: var(--accent); }
.maint-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Overdue row highlight */
.row-danger { background: var(--danger-bg) !important; }
.row-danger:hover { background: #fde8e8 !important; }

/* Work notes */
.work-notes-list { display: flex; flex-direction: column; gap: 8px; }
.work-note-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
}
.work-note-item .text-muted { display: block; margin-bottom: 3px; }

/* Detail grid for view modals */
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; }
.detail-value { color: var(--text-primary); }

/* External request cards */
.ext-request-list { display: flex; flex-direction: column; gap: 12px; }

.ext-request-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: box-shadow 0.15s;
}
.ext-request-card:hover { box-shadow: var(--shadow-md); }

.ext-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ext-card-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.ext-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ext-card-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.ext-rejection {
  font-size: 12px;
  color: var(--danger-text);
  background: var(--danger-bg);
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.ext-card-actions { display: flex; gap: 8px; }

/* Status badge colours */
.ext-status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.ext-status-submitted  { background: var(--accent-light); color: var(--accent); }
.ext-status-ack        { background: var(--bg-tertiary);  color: var(--text-secondary); }
.ext-status-approved   { background: var(--purple-bg);    color: var(--purple); }
.ext-status-inprog     { background: var(--warning-bg);   color: var(--warning-text); }
.ext-status-done       { background: var(--success-bg);   color: var(--success-text); }
.ext-status-rejected   { background: var(--danger-bg);    color: var(--danger-text); }

/* Maintenance overdue card accent */
.maint-overdue-card { border-left: 4px solid var(--danger); }

/* Dashboard maintenance panel */
.maint-dash-section { margin-top: 12px; }
.maint-dash-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.maint-dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-secondary);
  margin-bottom: 4px;
}
.maint-dash-item.row-danger { background: var(--danger-bg); }

/* Photo strip */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-strip .photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--border); }

/* Ghost action buttons */
.btn-success-ghost { color: var(--success); }
.btn-success-ghost:hover { background: var(--success-bg); }
.btn-danger-ghost  { color: var(--danger); }
.btn-danger-ghost:hover  { background: var(--danger-bg); }

/* Maint schedule badge on overdue rows in the schedule tab */
.badge-teal { background: #ccfbf1; color: #0f766e; }

/* ============================================================
   Maintenance Module v2 – Ticket Cards, Timeline, Dashboard
   ============================================================ */

/* Ticket number badge (small, inline in card) */
.ticket-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Large ticket number in detail modal header */
.ticket-num-big {
  font-size: 18px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

/* Ticket card */
.ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 14px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  border-color: var(--accent);
}
.ticket-card.ticket-overdue {
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, var(--danger-bg) 0%, var(--bg-card) 60px);
}
.ticket-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ticket-asset {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ticket-asset i {
  font-size: 14px;
}
.ticket-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
  line-height: 1.5;
}
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-bottom: 8px;
}
.ticket-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ticket-meta span i {
  color: var(--text-muted);
}
.ticket-last-update {
  font-size: 11.5px;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: var(--radius);
  margin-top: 8px;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.ticket-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Status badges for v2 statuses */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: capitalize;
}
.status-submitted   { background: #eff6ff; color: #2563eb; }
.status-pending     { background: #fef9c3; color: #854d0e; }
.status-acknowledged{ background: #f0fdf4; color: #16a34a; }
.status-approved    { background: #f3e8ff; color: #7c3aed; }
.status-rejected    { background: #fef2f2; color: #dc2626; }
.status-in_progress { background: #fff7ed; color: #c2410c; }
.status-completed   { background: #f0fdf4; color: #15803d; }
.status-closed      { background: var(--bg-tertiary); color: var(--text-muted); }
.status-scheduled   { background: #eff6ff; color: #2563eb; }

/* Urgency badges */
.urgency-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.urgency-low      { background: #f0fdf4; color: #15803d; }
.urgency-medium   { background: #fef9c3; color: #854d0e; }
.urgency-high     { background: #fff7ed; color: #c2410c; }
.urgency-critical { background: #fef2f2; color: #dc2626; }

/* Track label */
.track-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.track-a-badge { background: #eff6ff; color: #1d4ed8; }
.track-b-badge { background: #fdf4ff; color: #7c3aed; }

/* Track selector in raise modal */
.track-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.track-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.track-option:hover { border-color: var(--accent); background: var(--accent-light); }
.track-option.selected { border-color: var(--accent); background: var(--accent-light); }
.track-option i { font-size: 22px; color: var(--accent); margin-bottom: 6px; display: block; }
.track-option-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.track-option-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

/* Ticket Timeline */
.ticket-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 16px;
  position: relative;
  padding-bottom: 20px;
}
.timeline-entry:last-child { padding-bottom: 0; }
.timeline-entry:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-entry:hover .timeline-dot {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

/* Color schemes for action dots */
.timeline-dot.dot-submitted { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }
.timeline-dot.dot-comment { background: #fdf4ff; border-color: #a855f7; color: #a855f7; }
.timeline-dot.dot-read { background: #ecfeff; border-color: #06b6d4; color: #06b6d4; }
.timeline-dot.dot-accepted { background: #f0fdf4; border-color: #22c55e; color: #22c55e; }
.timeline-dot.dot-rejected { background: #fef2f2; border-color: #ef4444; color: #ef4444; }
.timeline-dot.dot-assigned { background: #eff6ff; border-color: #2563eb; color: #2563eb; }
.timeline-dot.dot-scheduled { background: #f5f3ff; border-color: #8b5cf6; color: #8b5cf6; }
.timeline-dot.dot-progress { background: #fff7ed; border-color: #f97316; color: #f97316; }
.timeline-dot.dot-completed { background: #f0fdf4; border-color: #16a34a; color: #16a34a; }
.timeline-dot.dot-closed { background: #f1f5f9; border-color: #64748b; color: #64748b; }
.timeline-dot.dot-updated { background: #f8fafc; border-color: #94a3b8; color: #94a3b8; }

.timeline-body { min-width: 0; }
.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.timeline-action {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.timeline-meta {
  font-size: 12px;
  color: var(--text-secondary);
}
.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.timeline-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 6px 10px;
  margin-top: 6px;
  font-style: italic;
  display: inline-block;
}
.timeline-rejection-note {
  font-size: 12.5px;
  color: var(--danger-text);
  background: var(--danger-bg);
  border: 1px dashed var(--danger-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  margin-top: 6px;
  font-weight: 500;
  display: inline-block;
}
.timeline-comment-bubble {
  font-size: 12.5px;
  color: var(--text-primary);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  padding: 8px 12px;
  margin-top: 6px;
  max-width: 85%;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* Team Dashboard – stat cards (clickable) */
.maint-dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.maint-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-align: center;
}
.maint-stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.maint-stat-card.active { border-color: var(--accent); background: var(--accent-light); }
.maint-stat-card.stat-danger { border-left: 3px solid var(--danger); }
.maint-stat-card.stat-warn   { border-left: 3px solid var(--warning); }
.maint-stat-card.stat-ok     { border-left: 3px solid var(--success); }
.maint-stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.maint-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Priority bar (urgency breakdown) */
.priority-breakdown {
  margin: 16px 0;
}
.priority-breakdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.priority-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 30px;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.priority-bar-label { color: var(--text-secondary); font-weight: 600; text-transform: capitalize; }
.priority-bar-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.priority-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.priority-bar-fill.fill-critical { background: var(--danger); }
.priority-bar-fill.fill-high     { background: #f97316; }
.priority-bar-fill.fill-medium   { background: var(--warning); }
.priority-bar-fill.fill-low      { background: var(--success); }
.priority-bar-count { color: var(--text-muted); font-weight: 600; text-align: right; }

/* Department breakdown table */
.dept-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dept-breakdown-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.dept-breakdown-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.dept-breakdown-table tr:last-child td { border-bottom: none; }

/* Activity feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-text { color: var(--text-primary); line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Inline drill-down panel */
.dash-drilldown {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.dash-drilldown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dash-drilldown-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Maintenance module section header row */
.maint-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.maint-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.filter-pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Empty state for maintenance */
.maint-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.maint-empty i { font-size: 36px; display: block; margin-bottom: 12px; opacity: 0.4; }
.maint-empty-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.maint-empty-sub { font-size: 13px; }

/* Asset section inside inventory modal */
.asset-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg-secondary);
}
.asset-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 600px) {
  .track-selector { grid-template-columns: 1fr; }
  .maint-dash-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .priority-bar-row { grid-template-columns: 60px 1fr 28px; }
}

/* ============================================================
   Heartfulness Public Landing + Unified Login
   ============================================================ */

.haf-public-page {
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: #1b1c19;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 50% 20%, rgba(232, 224, 208, 0.82), rgba(232, 224, 208, 0) 20%),
    linear-gradient(180deg, #fbf9f4 0%, #f6f2e9 38%, #f4f0e8 100%);
}

.haf-public-page *,
.haf-public-page *::before,
.haf-public-page *::after {
  box-sizing: border-box;
}

.haf-landing-shell {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 0 clamp(40px, 4vw, 72px) 56px;
}

.haf-hero-stage {
  position: relative;
  overflow: hidden;
  min-height: 920px;
  padding: 82px 0 104px;
}

.haf-hero-stage::before,
.haf-hero-stage::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.haf-hero-stage::before {
  inset: 0;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 61% 27%, rgba(231, 223, 209, 0.86), rgba(231, 223, 209, 0) 18%),
    radial-gradient(circle at 78% 21%, rgba(218, 210, 195, 0.38), rgba(218, 210, 195, 0) 20%);
}

.haf-hero-stage::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(191, 200, 200, 0.32);
}

.haf-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(360px, 420px);
  gap: 92px;
  align-items: center;
  min-height: 732px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(10px, 1.4vw, 28px);
}

.haf-copy-column {
  max-width: 760px;
  padding-top: 18px;
}

.haf-display-title {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(3.9rem, 7vw, 5.8rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: #111111;
}

.haf-display-title span {
  color: #003534;
  font-style: italic;
  font-weight: 400;
}

.haf-display-copy {
  max-width: 690px;
  margin: 34px 0 0;
  font-size: clamp(1.1rem, 1.5vw, 1.55rem);
  line-height: 1.55;
  font-weight: 400;
  color: #303431;
}

.haf-proof-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
}

.haf-proof-row p {
  margin: 0;
  font-size: 14px;
  color: #4e5351;
}

.haf-avatar-cluster {
  display: flex;
  align-items: center;
}

.haf-avatar-chip {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -10px;
  border: 2px solid #fbf9f4;
  font-size: 15px;
  color: #23312f;
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.06);
}

.haf-avatar-chip:first-child {
  margin-left: 0;
}

.haf-avatar-chip--teal {
  background: linear-gradient(145deg, #0f766e, #d8ece5);
  color: #fff;
}

.haf-avatar-chip--sand {
  background: linear-gradient(145deg, #efe0cb, #fff8ef);
}

.haf-avatar-chip--stone {
  background: linear-gradient(145deg, #d8ddd7, #ffffff);
}

.haf-avatar-chip--count {
  width: auto;
  min-width: 42px;
  padding: 0 12px;
  background: #ded9cf;
  font-size: 12px;
  font-weight: 600;
}

.haf-login-column {
  width: 100%;
  justify-self: end;
}

.haf-auth-card,
.haf-loading-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 32px 28px 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  box-shadow:
    0 28px 60px rgba(27, 28, 25, 0.06),
    0 10px 20px rgba(27, 28, 25, 0.04);
}

.haf-auth-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #076968 0%, #0d6e6c 48%, #3f8c87 100%);
}

.haf-auth-view.hidden {
  display: none;
}

.haf-auth-brand,
.haf-auth-brand--subtle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #003534;
}

.haf-auth-brand {
  margin-bottom: 20px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  font-style: italic;
}

.haf-auth-brand i {
  font-size: 18px;
}

.haf-auth-brand--subtle {
  margin-bottom: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  font-style: normal;
  color: #4d635f;
}

.haf-auth-header {
  margin-bottom: 22px;
}

.haf-auth-header--compact {
  margin-bottom: 20px;
}

.haf-auth-header h2,
.haf-governance-head h2,
.haf-feature-card h3,
.haf-loading-card h1 {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  color: #111111;
}

.haf-auth-header h2 {
  font-size: 2.25rem;
  line-height: 1.08;
}

.haf-auth-header p {
  margin: 10px 0 0;
  color: #66615a;
  font-size: 14px;
  line-height: 1.7;
}

.haf-auth-card .alert {
  margin-bottom: 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.haf-public-page .login-field {
  margin-bottom: 14px;
}

.haf-public-page .login-field label {
  display: block;
  margin-bottom: 7px;
  color: #111111;
  font-size: 13px;
  font-weight: 600;
}

.haf-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}

.haf-inline-link,
.haf-inline-back {
  color: #4d635f;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.haf-inline-link:hover,
.haf-inline-back:hover {
  color: #003534;
  text-decoration: underline;
}

.haf-input-shell {
  position: relative;
}

.haf-input-icon,
.haf-visibility-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #6f7978;
  z-index: 1;
}

.haf-input-icon {
  left: 14px;
  font-size: 14px;
}

.haf-visibility-btn {
  right: 12px;
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.haf-auth-input.form-control {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 42px;
  border: none;
  border-radius: 9px;
  background: #dedad2;
  color: #2f3633;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  box-shadow: none;
}

.haf-auth-input.form-control::placeholder {
  color: #76726b;
}

.haf-auth-input.form-control:focus {
  background: #f8f6f1;
  box-shadow: 0 0 0 2px rgba(7, 105, 104, 0.18);
}

.haf-submit-btn.login-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 11px;
  margin-top: 18px;
  background: linear-gradient(90deg, #003534 0%, #004d4c 100%);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(0, 53, 52, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.haf-submit-btn.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 53, 52, 0.22);
}

.haf-submit-btn.login-btn:disabled,
.haf-public-page .oauth-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.haf-divider.login-or-divider {
  margin: 24px 0 18px;
}

.haf-divider.login-or-divider::before {
  background: rgba(191, 200, 200, 0.5);
}

.haf-divider.login-or-divider span {
  background: rgba(255, 255, 255, 0.78);
  padding: 0 12px;
  color: #6f7978;
  font-size: 12px;
}

.haf-public-page .oauth-btn.haf-workspace-btn {
  height: 48px;
  margin-bottom: 0;
  border: 1px solid rgba(191, 200, 200, 0.42);
  border-radius: 12px;
  background: #f1ede5;
  box-shadow: none;
  color: #1b1c19;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
}

.haf-public-page .oauth-btn.haf-workspace-btn:hover:not(:disabled) {
  background: #f7f4ee;
}

.haf-google-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.haf-google-mark__g {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(45deg, #ea4335 0 24%, #fbbc05 24% 50%, #34a853 50% 74%, #4285f4 74% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.haf-auth-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(7, 105, 104, 0.08);
  color: #355955;
  font-size: 12px;
  line-height: 1.55;
}

.haf-change-banner {
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(0, 53, 52, 0.08);
  color: #003534;
}

.haf-governance-section {
  padding: 68px 0 52px;
}

.haf-governance-head {
  max-width: 840px;
  display: grid;
  justify-items: center;
  gap: 20px;
  margin: 0 auto 56px;
  text-align: center;
}

.haf-loading-card {
  max-width: 460px;
  margin: 120px auto 0;
  text-align: center;
}

.haf-loading-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #003534, #076968);
  color: #ffffff;
  font-size: 24px;
}

.haf-loading-eyebrow {
  margin-top: 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4d635f;
}

.haf-loading-card h1 {
  margin-top: 14px;
  font-size: 2.4rem;
  line-height: 1.08;
}

.haf-loading-card p {
  margin-top: 14px;
  color: #66615a;
  font-size: 14px;
  line-height: 1.7;
}

.haf-governance-head h2 {
  max-width: 700px;
  font-size: clamp(3rem, 4.9vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.haf-governance-head p {
  max-width: 760px;
  margin: 0;
  color: #66615a;
  font-size: 18px;
  line-height: 1.7;
}

.haf-governance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.haf-feature-card {
  position: relative;
  min-height: 212px;
  padding: 28px 24px 26px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(27, 28, 25, 0.04);
  overflow: hidden;
}

.haf-feature-card--wide {
  grid-column: span 2;
  min-height: 228px;
}

.haf-feature-mark {
  position: absolute;
  top: 34px;
  right: 34px;
  font-size: 70px;
  color: rgba(207, 214, 214, 0.62);
}

.haf-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.haf-feature-icon--teal {
  background: #076968;
  color: #ffffff;
}

.haf-feature-icon--sand {
  background: #ece0d7;
  color: #6a3a21;
}

.haf-feature-icon--mint {
  background: #d7ebe5;
  color: #355955;
}

.haf-feature-icon--stone {
  background: #e6e2db;
  color: #454744;
}

.haf-feature-card h3 {
  margin-top: 18px;
  max-width: 520px;
  font-size: clamp(2rem, 2.7vw, 2.35rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.haf-feature-card:not(.haf-feature-card--wide) h3 {
  font-size: 1.9rem;
}

.haf-feature-card p {
  max-width: 520px;
  margin: 14px 0 0;
  color: #4e5351;
  font-size: 15px;
  line-height: 1.62;
}

.haf-landing-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 64px 0 24px;
  color: #6d6962;
}

.haf-footer-brand {
  display: grid;
  gap: 10px;
}

.haf-footer-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.6rem;
  font-style: italic;
  color: #003534;
}

.haf-footer-brand p {
  margin: 0;
  max-width: 640px;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.haf-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 28px;
}

.haf-footer-nav a {
  color: #6d6962;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.haf-footer-nav a:hover {
  color: #003534;
  text-decoration: underline;
  text-decoration-color: rgba(0, 53, 52, 0.28);
  text-underline-offset: 4px;
}

@media (max-width: 1180px) {
  .haf-landing-shell {
    padding: 0 18px 48px;
  }

  .haf-hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    min-height: auto;
    padding: 0;
  }

  .haf-copy-column,
  .haf-login-column {
    max-width: 100%;
  }

  .haf-login-column {
    justify-self: start;
    max-width: 520px;
  }

  .haf-governance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .haf-feature-card--wide {
    grid-column: span 2;
  }

  .haf-landing-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .haf-footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .haf-public-page {
    background:
      radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 32%),
      linear-gradient(180deg, #fbf9f4 0%, #f4f0e8 100%);
  }

  .haf-landing-shell {
    padding: 0 14px 36px;
  }

  .haf-hero-stage {
    min-height: auto;
    padding: 38px 0 58px;
  }

  .haf-auth-card,
  .haf-loading-card {
    padding: 24px 20px 20px;
    border-radius: 18px;
  }

  .haf-display-title {
    font-size: clamp(3rem, 14vw, 4.3rem);
    line-height: 0.96;
  }

  .haf-display-copy {
    margin-top: 24px;
    font-size: 1.02rem;
  }

  .haf-proof-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .haf-auth-header h2 {
    font-size: 2rem;
  }

  .haf-governance-section {
    padding: 54px 0 28px;
  }

  .haf-governance-head {
    margin-bottom: 36px;
  }

  .haf-governance-head h2 {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }

  .haf-governance-head p {
    font-size: 15px;
  }

  .haf-governance-grid {
    grid-template-columns: 1fr;
  }

  .haf-feature-card,
  .haf-feature-card--wide {
    min-height: 0;
    grid-column: auto;
  }

  .haf-feature-mark {
    font-size: 50px;
    top: 24px;
    right: 24px;
  }

  .haf-feature-card h3,
  .haf-feature-card:not(.haf-feature-card--wide) h3 {
    max-width: none;
    font-size: 2rem;
  }

  .haf-landing-footer {
    padding: 48px 0 16px;
  }

  .haf-footer-brand p,
  .haf-footer-nav a {
    letter-spacing: 0.08em;
  }

  .haf-footer-nav {
    gap: 12px 18px;
  }
}

/* ── Inactive Organization Cards ─────────────────────────── */
.inactive-orgs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inactive-org-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  opacity: 0.9;
}

.inactive-org-card__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.inactive-org-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.inactive-org-card__info {
  flex: 1;
  min-width: 0;
}

.inactive-org-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.inactive-org-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.inactive-org-card__stat {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.inactive-org-card__deact {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
}

.inactive-org-card__deact span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inactive-org-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – SMALL LAPTOP (1025px – 1279px)
   MacBook Air 11", older 13" models, 1366px laptops at 125% DPI.
   Sidebar stays visible at 240px; tighten padding so content
   doesn't feel cramped in the remaining ~785–1030px.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1025px) and (max-width: 1279px) {
  :root { --sidebar-w: 240px; }

  .page-content {
    padding: 16px 20px 28px;
  }

  .card-header {
    padding: 14px 18px 12px;
  }

  .summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .topbar {
    padding: 0 20px;
  }

  /* Prevent filter-bar from overflowing */
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* form-row-3: two columns to avoid overflow at ~800px content width */
  .form-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Smooth transitions for sidebar/content reflow */
  .sidebar,
  .main-area,
  .page-content {
    transition: margin 0.25s cubic-bezier(.4,0,.2,1),
                padding 0.25s cubic-bezier(.4,0,.2,1),
                width 0.25s cubic-bezier(.4,0,.2,1);
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – STANDARD LAPTOP (1280px – 1439px)
   MacBook Pro 13" native 1280px. Sidebar 240px leaves ~1040px
   usable content. Intermediate adjustments prevent cramping.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1280px) and (max-width: 1439px) {
  :root { --sidebar-w: 240px; }

  .page-content {
    padding: 20px 24px 32px;
    max-width: 1200px;
  }

  .summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .topbar {
    padding: 0 28px;
  }

  /* Constrain global search so topbar-left has breathing room */
  .topbar-right .global-search-wrap {
    flex: 0 1 320px;
  }

  /* filter-bar wraps gracefully */
  .filter-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* form-row-3: keep three columns but guard against overflow */
  .form-row,
  .form-row-3 {
    gap: 14px;
  }

  /* Smooth transitions for sidebar/content reflow */
  .sidebar,
  .main-area,
  .page-content {
    transition: margin 0.25s cubic-bezier(.4,0,.2,1),
                padding 0.25s cubic-bezier(.4,0,.2,1),
                width 0.25s cubic-bezier(.4,0,.2,1);
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – LARGE SCREENS (≥ 1440px)
   Constrain content width so it doesn't stretch uncomfortably
   across ultra-wide monitors or high-DPI displays.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1440px) {
  :root { --sidebar-w: 272px; }

  .page-content {
    max-width: 1440px;
    /* margin-left intentionally omitted — sidebar offset handled by .main-area */
    margin-right: auto;
  }

  .topbar {
    padding: 0 36px;
  }

  .summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  /* Larger screens → more generous padding, not less */
  .card-body { padding: 24px 28px; }
  .card-body-sm { padding: 16px 24px; }
}

@media (min-width: 1920px) {
  :root { --sidebar-w: 288px; }

  .page-content {
    max-width: 1600px;
  }

  html { font-size: 16px; }

  .topbar { padding: 0 48px; }

  .card { border-radius: 14px; }

  /* Use em units so buttons scale naturally with the 16px root */
  .btn { padding: 0.55em 1.25em; font-size: 0.875rem; }
  .btn-sm { padding: 0.44em 0.875rem; font-size: 0.8125rem; }

  .summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

@media (min-width: 2560px) {
  /* 320px sidebar is ~12.5% of 2560px — more proportional than 300px */
  :root { --sidebar-w: 320px; }

  .page-content {
    max-width: 1920px;
    margin-right: auto;
    padding: 32px 40px 56px;
  }

  html { font-size: 17px; }
}

/* ── Inventory table / grid doesn't over-stretch ── */
@media (min-width: 1440px) {
  .inventory-table-wrap,
  .inv-table-scroll {
    overflow-x: auto;
  }

  .filter-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ── Modal max-widths scale with screen ── */
@media (min-width: 1440px) {
  .modal-lg { max-width: 820px; }
  .modal-xl { max-width: 1100px; }
}

@media (min-width: 1920px) {
  .modal-lg { max-width: 960px; }
  .modal-xl { max-width: 1280px; }
}

/* ══════════════════════════════════════════════════════════
   FULL-WIDTH CONTENT (override) — 2026-06
   Previously .page-content was capped (max-width 1200–1920px)
   AND left-pinned via `margin-right: auto`, which stranded a
   large empty band on the right of laptop/desktop/ultrawide
   monitors. Content now fills the available width on every
   breakpoint; the generous side-padding set by the breakpoint
   rules above still provides comfortable breathing room.
   This block is intentionally last so it overrides the
   per-breakpoint caps regardless of viewport size.
   ══════════════════════════════════════════════════════════ */
.page-content {
  max-width: none;
  margin-right: 0;
  width: 100%;
}

/* ── Preventive Maintenance & Notifications Styles ── */
.root-maint-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 3px solid var(--border-color, #e2e8f0);
}

.root-tab {
  font-size: var(--font-size-md, 14px) !important;
  padding: 12px 24px !important;
  font-weight: 700 !important;
}

.notif-history-card {
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.notif-history-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.unread-item {
  border-left: 4px solid var(--accent, #3b82f6) !important;
}

.pm-ticket-details img:hover {
  opacity: 0.9;
}

/* ── Super Admin monitoring (maintenance + organization overview) ── */
.mon-bar { display:flex; height:14px; border-radius:999px; overflow:hidden; background:var(--bg-secondary); border:1px solid var(--border); }
.mon-seg { display:block; height:100%; }
.mon-seg--ok     { background:var(--success); }
.mon-seg--warn   { background:var(--warning); }
.mon-seg--accent { background:var(--accent); }
.mon-seg--muted  { background:var(--text-muted, #94a3b8); }
.mon-legend { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:10px; font-size:.85rem; color:var(--text-secondary); }
.mon-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.mon-clickable tbody tr { cursor:pointer; }
.mon-clickable tbody tr:hover td { background:var(--accent-light); }
.mon-rows { display:grid; gap:10px; }
.mon-row { display:grid; grid-template-columns:minmax(90px,170px) 1fr auto; gap:10px; align-items:center; font-size:.9rem; }
.mon-row__track { height:10px; border-radius:999px; background:var(--bg-secondary); border:1px solid var(--border); overflow:hidden; }
.mon-row__fill { display:block; height:100%; background:var(--accent); }
.mon-grid-2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.mon-people { display:flex; flex-direction:column; gap:2px; }
.org-pick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px; }
.org-pick { text-align:left; border:1px solid var(--border); background:var(--bg-card, var(--bg-primary)); border-radius:12px; padding:14px; cursor:pointer; display:flex; flex-direction:column; gap:8px; color:inherit; font:inherit; }
.org-pick:hover { border-color:var(--accent); box-shadow:var(--shadow-md); }
.org-pick.is-selected { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-light); }
.org-pick__name { font-weight:700; font-size:1.02rem; }
.org-pick__meta { display:flex; gap:14px; font-size:.82rem; color:var(--text-secondary); }

/* ── Brand logo & icon (HFN Asset) ── */
.haf-brandbar { margin: 0 0 34px; }
.haf-brand-logo { display: block; width: 340px; max-width: 100%; height: auto; }
.haf-auth-icon { display: block; height: 28px; width: auto; }
.haf-loading-mark--logo { background: #fff; box-shadow: 0 10px 30px rgba(0, 53, 52, .18); }
.haf-loading-mark--logo img { display: block; height: 42px; width: auto; }
.sidebar-logo-plate { display: flex; justify-content: center; margin: 2px 0 14px; }
.sidebar-logo-plate img { display: block; width: 190px; max-width: 100%; height: auto; }
@media (max-width: 640px) { .haf-brand-logo { width: 240px; } }

/* ── Show / hide password (eye) ── */
.pw-field { position: relative; display: block; width: 100%; }
.pw-field > input { width: 100%; padding-right: 44px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text-muted, #94a3b8); cursor: pointer; border-radius: 8px; font-size: 15px; }
.pw-toggle:hover { color: var(--text-primary, #0f172a); background: var(--bg-secondary, #f1f5f9); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 1px; }
