/* ============================================================================
   Connect B — Healthcare Premium design system (v2.5)
   Brand:  #202080 navy · #c4ad84 gold · #4780cd blue · #dedee3 mist
   Vibe:   Cerner-refreshed / Oracle Health. Data-dense but breathing.
   ============================================================================ */

:root {
  /* Brand */
  --lothan-navy:        #202080;
  --lothan-navy-2:      #16164d;
  --lothan-navy-3:      #2e2eaa;
  --lothan-navy-tint:   #ebebf6;
  --lothan-gold:        #c4ad84;
  --lothan-gold-2:      #a8916a;
  --lothan-gold-tint:   #faf6ee;
  --lothan-blue:        #4780cd;
  --lothan-blue-2:      #305f9d;
  --lothan-blue-tint:   #e8f0fa;
  --lothan-mist:        #dedee3;

  /* Neutrals (slightly warm) */
  --ink-1:   #0f172a;
  --ink-2:   #334155;
  --ink-3:   #64748b;
  --ink-4:   #94a3b8;
  --ink-5:   #cbd5e1;

  --line:        #e5e7ec;
  --line-2:      #eef0f4;
  --line-strong: #d1d5db;
  --surface:     #ffffff;
  --surface-2:   #fafbfd;
  --bg:          #f6f8fb;

  --ok:    #059669;   --ok-tint:    #ecfdf5;
  --warn:  #b45309;   --warn-tint:  #fff7ed;
  --bad:   #dc2626;   --bad-tint:   #fef2f2;
  --info:  #2563eb;   --info-tint:  #eff6ff;

  --s-1:  4px;  --s-2:  8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-7: 32px; --s-8: 40px; --s-10: 64px;

  --r-sm:  6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

  --sh-xs: 0 1px 1px rgba(15,23,42,.04);
  --sh-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.05);
  --sh-md: 0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --sh-lg: 0 16px 40px rgba(15,23,42,.10);
  --sh-focus: 0 0 0 3px rgba(32,32,128,.18);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --topbar-h: 60px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-1);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

a { color: var(--lothan-blue-2); text-decoration: none; }
a:hover { color: var(--lothan-navy); }

h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--ink-1); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.018em; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
h4 { font-size: .875rem; }
::selection { background: var(--lothan-navy-tint); color: var(--lothan-navy); }

.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-lg { vertical-align: -5px; }

/* Layout */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
.topbar  { grid-area: topbar; }
.sidebar { grid-area: sidebar; }
.main    { grid-area: main; padding: var(--s-6) var(--s-7) var(--s-8); max-width: 1440px; }

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas: "topbar" "sidebar" "main";
  }
  .sidebar { display: none; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  .sidebar.is-open { display: block; }
  .main { padding: var(--s-4); }
}

/* Topbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s-6);
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: var(--s-4); }
.topbar-brand {
  display: flex; align-items: center; gap: var(--s-3);
  font-weight: 700; font-size: .95rem; color: var(--ink-1);
  letter-spacing: -.01em;
}
.topbar-brand-img {
  /* Display only the L-mark portion (top ~63%) of the full 168×252 Lothan logo */
  display: inline-block;
  width: 38px;
  height: 38px;
  background: url('/assets/img/lothan-hospital.jpg') no-repeat center top;
  background-size: auto 60px;  /* image scaled to 60px tall, container 38px shows top 63% */
  flex-shrink: 0;
}
.topbar-brand .sep { color: var(--ink-4); font-weight: 400; margin: 0 4px; }
.topbar-brand .sub { color: var(--ink-3); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: var(--s-3); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-md);
  color: var(--ink-2); background: transparent;
  border: 1px solid transparent; cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--bg); color: var(--ink-1); }

.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-full);
  background: var(--bg); border: 1px solid var(--line);
  color: var(--ink-1); font-size: .82rem; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.user-menu-trigger:hover { background: var(--surface); border-color: var(--line-strong); }
.user-menu-trigger .name { line-height: 1.1; text-align: left; }
.user-menu-trigger .meta { display: block; font-size: .7rem; color: var(--ink-3); margin-top: 2px; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 6px;
  z-index: 50;
  opacity: 0; transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.user-menu.is-open .user-menu-panel {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.user-menu-header { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.user-menu-header .name { font-weight: 600; color: var(--ink-1); }
.user-menu-header .email { font-size: .75rem; color: var(--ink-3); margin-top: 2px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: .85rem; color: var(--ink-2);
  cursor: pointer; transition: background .1s;
  width: 100%; text-align: left;
  background: none; border: none; font-family: inherit;
}
.user-menu-item:hover { background: var(--bg); color: var(--ink-1); text-decoration: none; }
.user-menu-item.danger { color: var(--bad); }
.user-menu-item.danger:hover { background: var(--bad-tint); }

.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--lothan-navy) 0%, var(--lothan-navy-3) 100%);
  color: var(--lothan-gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.avatar-lg { width: 48px; height: 48px; font-size: 1.05rem; }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: var(--s-4) var(--s-3) var(--s-6);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--ink-4);
  padding: var(--s-5) var(--s-3) var(--s-2);
}
.sidebar-section:first-child { padding-top: var(--s-2); }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .85rem; font-weight: 500;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar-link:hover { background: var(--bg); color: var(--ink-1); text-decoration: none; }
.sidebar-link.is-active {
  background: var(--lothan-navy-tint); color: var(--lothan-navy); font-weight: 600;
}
.sidebar-link.is-active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: var(--lothan-navy);
}
.sidebar-link.is-active .icon { color: var(--lothan-navy); }
.sidebar-link .icon { color: var(--ink-3); }
.sidebar-link:hover .icon { color: var(--ink-1); }
.sidebar-foot {
  margin-top: auto;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-2);
  font-size: .72rem;
  color: var(--ink-4);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* Page header */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.page-head h1 { margin: 0; line-height: 1.2; }
.page-head-sub { font-size: .875rem; color: var(--ink-3); margin-top: 4px; max-width: 64ch; }
.page-actions { display: flex; gap: var(--s-2); align-items: center; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--ink-3); margin-bottom: var(--s-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink-1); }
.breadcrumb .sep { color: var(--ink-4); }
.breadcrumb .current { color: var(--ink-2); font-weight: 500; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--sh-xs);
}
.card-tight { padding: var(--s-4); }
.card-flush { padding: 0; }
.card-title { margin: 0 0 var(--s-4); font-size: 1rem; font-weight: 600; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { margin: 0; }
.card-body { padding: var(--s-5); }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--sh-xs);
  transition: box-shadow .15s, border-color .15s;
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
}
.kpi:hover { box-shadow: var(--sh-md); border-color: var(--line-strong); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.kpi-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--ink-3);
}
.kpi-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lothan-navy-tint);
  color: var(--lothan-navy);
}
.kpi-value { font-size: 1.875rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.kpi-foot { font-size: .75rem; color: var(--ink-3); }
.kpi.is-gold .kpi-icon { background: var(--lothan-gold-tint); color: var(--lothan-gold-2); }
.kpi.is-blue .kpi-icon { background: var(--lothan-blue-tint); color: var(--lothan-blue-2); }
.kpi.is-warn .kpi-icon { background: var(--warn-tint); color: var(--warn); }
.kpi.is-bad  .kpi-icon { background: var(--bad-tint); color: var(--bad); }
.kpi.is-ok   .kpi-icon { background: var(--ok-tint); color: var(--ok); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: .85rem; font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  text-decoration: none; line-height: 1.2;
}
.btn:focus-visible { outline: none; box-shadow: var(--sh-focus); }
.btn-primary { background: var(--lothan-navy); border-color: var(--lothan-navy); color: #fff; }
.btn-primary:hover { background: var(--lothan-navy-2); border-color: var(--lothan-navy-2); color: #fff; text-decoration: none; }
.btn-gold { background: var(--lothan-gold); border-color: var(--lothan-gold); color: var(--lothan-navy); }
.btn-gold:hover { background: var(--lothan-gold-2); border-color: var(--lothan-gold-2); color: var(--lothan-navy); text-decoration: none; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink-1); }
.btn-secondary:hover { background: var(--bg); border-color: var(--ink-4); color: var(--ink-1); text-decoration: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); color: var(--ink-1); text-decoration: none; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; text-decoration: none; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-tint); color: var(--bad); text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 11px 20px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

/* Forms */
.form-row { margin-bottom: var(--s-4); }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-1); margin-bottom: 5px; }
.form-label .req { color: var(--bad); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: inherit; font-size: .9rem; color: var(--ink-1);
  transition: border-color .12s, box-shadow .12s;
}
.form-input:hover, .form-select:hover { border-color: var(--ink-4); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--lothan-navy); box-shadow: var(--sh-focus);
}
.form-input::placeholder { color: var(--ink-4); }
.form-help { font-size: .75rem; color: var(--ink-3); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--bad); margin-top: 4px; font-weight: 500; }
.form-actions { display: flex; gap: var(--s-2); margin-top: var(--s-6); }
.form-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .875rem; color: var(--ink-1); cursor: pointer;
}
.form-check input { accent-color: var(--lothan-navy); width: 16px; height: 16px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.input-group .form-input { padding-left: 38px; }

/* Tables */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--ink-3);
  padding: 11px var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td {
  padding: 12px var(--s-4);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .row-primary { font-weight: 600; color: var(--ink-1); }
.table .row-sub { font-size: .75rem; color: var(--ink-3); margin-top: 2px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 4px; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.4;
  white-space: nowrap;
}
.pill .icon { width: 11px; height: 11px; }
.pill-navy { background: var(--lothan-navy-tint); color: var(--lothan-navy); }
.pill-gold { background: var(--lothan-gold-tint); color: var(--lothan-gold-2); }
.pill-blue { background: var(--lothan-blue-tint); color: var(--lothan-blue-2); }
.pill-ok   { background: var(--ok-tint);   color: var(--ok); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-bad  { background: var(--bad-tint);  color: var(--bad); }
.pill-mute { background: var(--bg);        color: var(--ink-3); border: 1px solid var(--line); }

/* Flash */
.flash {
  padding: 12px 14px; border-radius: var(--r-md); margin-bottom: var(--s-4);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .875rem; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
}
.flash .icon { margin-top: 1px; flex-shrink: 0; }
.flash-success { background: var(--ok-tint);   border-color: rgba(5,150,105,.22);   color: #065f46; }
.flash-success .icon { color: var(--ok); }
.flash-error   { background: var(--bad-tint);  border-color: rgba(220,38,38,.22);   color: #7f1d1d; }
.flash-error .icon { color: var(--bad); }
.flash-warning { background: var(--warn-tint); border-color: rgba(180,83,9,.22);    color: #78350f; }
.flash-warning .icon { color: var(--warn); }
.flash-info    { background: var(--info-tint); border-color: rgba(37,99,235,.22);   color: #1e3a8a; }
.flash-info .icon { color: var(--info); }

/* Empty state */
.empty-state {
  padding: var(--s-8) var(--s-6);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty-state-icon {
  width: 56px; height: 56px; border-radius: var(--r-xl);
  background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); margin-bottom: var(--s-4);
}
.empty-state-title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.empty-state-body { font-size: .875rem; color: var(--ink-3); margin: 0 auto var(--s-5); max-width: 48ch; }
.empty-state-actions { display: inline-flex; gap: var(--s-2); }

/* Auth split layout */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) 1fr;
}
@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
.auth-form-pane {
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-7);
  background: var(--surface);
}
.auth-form-inner { width: 100%; max-width: 380px; }
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--s-7);
  text-align: center;
}
.auth-brand-logo {
  height: 88px;
  width: auto;
  display: block;
}
.auth-brand-text { line-height: 1.2; }
.auth-brand-product {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink-1);
  letter-spacing: -.012em;
}
.auth-brand-sub {
  font-size: .78rem;
  color: var(--ink-3);
  margin-top: 4px;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-weight: 600;
}
.auth-heading { font-size: 1.5rem; font-weight: 700; letter-spacing: -.018em; margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: .9rem; color: var(--ink-3); margin: 0 0 var(--s-6); text-align: center; }
.auth-side {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(196,173,132,.30), transparent 60%),
    radial-gradient(100% 100% at 0% 100%, rgba(71,128,205,.30), transparent 55%),
    linear-gradient(135deg, var(--lothan-navy) 0%, var(--lothan-navy-2) 100%);
  color: #fff;
  padding: var(--s-7);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .6; pointer-events: none;
}
.auth-side-top { position: relative; }
.auth-side-quote {
  position: relative;
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.012em; line-height: 1.35;
  max-width: 30ch;
  margin-bottom: var(--s-3);
}
.auth-side-quote-sub { color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 400; max-width: 38ch; }
.auth-side-foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  color: rgba(255,255,255,.6); font-size: .75rem;
}
.auth-side-feature { position: relative; display: grid; gap: var(--s-3); margin-top: var(--s-7); max-width: 360px; }
.auth-side-feature-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .85rem; color: rgba(255,255,255,.86);
}
.auth-side-feature-row .icon { color: var(--lothan-gold); margin-top: 2px; }
.auth-notice {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px;
  font-size: .75rem; color: var(--ink-3);
  margin-top: var(--s-4);
  display: flex; gap: 8px; align-items: flex-start;
}
.auth-notice .icon { color: var(--lothan-gold-2); flex-shrink: 0; margin-top: 1px; }

/* Permission matrix */
.perm-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-4);
}
.perm-group {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-4); background: var(--surface);
}
.perm-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-3); padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-2);
}
.perm-group-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--lothan-navy); margin: 0;
}
.perm-group .toggle-all { font-size: .72rem; color: var(--ink-3); cursor: pointer; font-weight: 500; }
.perm-group .toggle-all:hover { color: var(--ink-1); }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .85rem; }
.perm-row input { accent-color: var(--lothan-navy); }
.perm-row .name { flex: 1; color: var(--ink-2); }
.perm-row .code { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-4); }

/* Country cell helpers */
.country-cell { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.country-cell .flag { font-size: 1rem; filter: drop-shadow(0 1px 1px rgba(0,0,0,.08)); }
.country-cell .country-code {
  font-family: var(--font-mono);
  font-size: .68rem; color: var(--ink-4);
  background: var(--bg); padding: 1px 5px; border-radius: 4px;
  letter-spacing: .03em;
}

/* Helpers */
.muted { color: var(--ink-3); }
.text-xs { font-size: .72rem; }
.text-sm { font-size: .8rem; }
.text-md { font-size: .875rem; }
.text-lg { font-size: 1rem; }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 40px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none; }
.divider { height: 1px; background: var(--line-2); margin: var(--s-4) 0; }

@media (max-width: 600px) {
  body { font-size: 13px; }
  .kpi-value { font-size: 1.5rem; }
  .topbar { padding: 0 var(--s-3); }
  .user-menu-trigger .name { display: none; }
}
