/* ==========================================================================
   Rhema People — design system
   Benchmark: Rhema People Perplexity prototype ("warm, professional,
   data-dense but calm — pine green + warm amber on cream").
   Type: Satoshi (display/UI/body) via Fontshare, tabular numerals for data.
   ========================================================================== */

:root {
  /* --- surfaces & text --- */
  --paper: #FAF7F1;
  --surface: #FFFFFF;
  --surface-sunk: #F5F1E9;
  --ink: #1A211E;
  --ink-soft: #40514B;
  --ink-faint: #6E8079;
  --line: #E5DED1;
  --line-strong: #D8CFBC;

  /* --- brand & status accents ---
     Pine is the primary brand colour (buttons, active nav, headings that
     need weight); accent (warm amber-orange) is the secondary/decorative
     colour (eyebrows, dots, badges, focus rings). Status colours are a
     distinct semantic set: ok/warn/bad/info, not to be confused with the
     brand colours even where a hue is close. */
  --signal: #C9762F;        /* alias: accent */
  --signal-dark: #134E46;   /* alias: pine */
  --signal-darker: #18604F; /* alias: pine-600 */
  --signal-tint: #E3EEEA;   /* alias: pine-100 */
  --pine-50: #F1F7F4;
  --accent-tint: #FBEEE0;   /* alias: accent-100 */
  --teal: #2A5F8F;          /* alias: info (manager role, secondary data) */
  --teal-tint: #E8F0F8;
  --amber: #A9700B;         /* alias: warn */
  --amber-tint: #FBF0DA;
  --red: #A93B33;           /* alias: bad */
  --red-tint: #FAE9E7;
  --gold: #134E46;          /* repointed to pine — no distinct gold in the benchmark */
  --gold-tint: #E3EEEA;
  --ok: #2F7D5B;
  --ok-tint: #E7F3EC;
  --mute-tint: #EFEBE3;

  /* --- scale --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 33, 30, 0.05), 0 1px 3px rgba(26, 33, 30, 0.05);
  --shadow-md: 0 4px 12px rgba(26, 33, 30, 0.07), 0 1px 3px rgba(26, 33, 30, 0.05);
  --shadow-lg: 0 18px 46px rgba(26, 33, 30, 0.16);
  --shadow-signal: 0 8px 22px rgba(19, 78, 70, 0.22);

  --font-display: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Bespoke Serif', 'Satoshi', Georgia, serif;

  /* --- shell geometry --- */
  --nav-w: 250px;
  --top-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2.5px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------------------------------------------------------------------- */
/* Icons                                                                   */
/* ---------------------------------------------------------------------- */

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: -0.2em;
}

/* ---------------------------------------------------------------------- */
/* Top bar                                                                */
/* ---------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top-h);
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--signal-dark);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  color: var(--signal-dark);
  flex-shrink: 0;
  display: flex;
}
.brand-mark .icon { width: 30px; height: 30px; }

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.brand-text strong { font-weight: 900; color: var(--signal-dark); }
.brand-text em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-top: 2px;
}

.topbar-spacer { flex: 1; }

.who { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.who-meta { display: flex; flex-direction: column; line-height: 1.15; }
.who-meta b { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.who-meta span { font-size: 11.5px; color: var(--ink-faint); text-transform: capitalize; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-sunk); color: var(--signal-dark); }
.nav-toggle { display: none; }

/* ---------------------------------------------------------------------- */
/* Shell / sidebar                                                        */
/* ---------------------------------------------------------------------- */

.app-shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--top-h)); }

.sidebar {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px 40px;
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
}

.nav { display: flex; flex-direction: column; }

.nav-group { margin-bottom: 18px; }

.nav-group-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link .icon { opacity: 0.8; transition: opacity 0.15s ease; }
.nav-link:hover { background: var(--pine-50); color: var(--signal-dark); text-decoration: none; }
.nav-link:hover .icon { opacity: 1; }
.nav-link.active { background: var(--signal-dark); color: #fff; font-weight: 700; }
.nav-link.active .icon { opacity: 1; }

.nav-count {
  margin-left: auto;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  line-height: 1.5;
}
.nav-link.active .nav-count { background: rgba(255, 255, 255, 0.25); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-signal { background: var(--signal-dark); }
.avatar-teal { background: var(--teal); }

.avatar-photo { padding: 0; overflow: hidden; background: var(--surface-sunk); }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1180px; }

/* ---------------------------------------------------------------------- */
/* Page header                                                            */
/* ---------------------------------------------------------------------- */

.page-header { margin-bottom: 20px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 6px;
}
.eyebrow .icon { width: 0.95em; height: 0.95em; color: var(--signal); }

h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--ink);
}
h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
h2 .icon { color: var(--ink-faint); width: 1em; height: 1em; }
h3 { font-family: var(--font-display); font-size: 12.5px; font-weight: 700; margin: 18px 0 8px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }

.page-subtitle { color: var(--ink-soft); font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-subtitle .icon { width: 0.9em; height: 0.9em; color: var(--ink-faint); }
.page-subtitle-divider { color: var(--line-strong); }

/* ---------------------------------------------------------------------- */
/* Cards / dividers                                                       */
/* ---------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  animation: card-rise 0.4s ease both;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.signal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 16px;
  color: var(--ink-faint);
}
.signal-divider::before, .signal-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signal-divider .icon { width: 14px; height: 14px; color: var(--signal); }

/* ---------------------------------------------------------------------- */
/* Stat tiles                                                             */
/* ---------------------------------------------------------------------- */

.grid-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  flex: 1;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-chip {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-chip .icon { width: 20px; height: 20px; }
.stat-chip-signal { background: var(--signal-tint); color: var(--signal-dark); }
.stat-chip-teal { background: var(--teal-tint); color: var(--teal); }
.stat-chip-amber { background: var(--amber-tint); color: var(--amber); }

.stat .value { font-family: var(--font-display); font-size: 28px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; color: var(--signal-dark); font-variant-numeric: tabular-nums; }
.stat .label { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* Tables                                                                 */
/* ---------------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-faint); font-family: var(--font-display); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; background: var(--surface); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--pine-50); }

.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person .name { font-weight: 700; color: var(--ink); }
.cell-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------- */
/* Badges / pills                                                        */
/* ---------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--mute-tint);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }

.badge-role-hr_admin { background: var(--signal-tint); color: var(--signal-dark); }
.badge-role-manager { background: var(--teal-tint); color: var(--teal); }
.badge-role-staff { background: var(--surface-sunk); color: var(--ink-soft); }

.badge-status-pending { background: var(--amber-tint); color: var(--amber); }
.badge-status-approved { background: var(--ok-tint); color: var(--ok); }
.badge-status-denied { background: var(--red-tint); color: var(--red); }
.badge-status-none { background: var(--surface-sunk); color: var(--ink-faint); }

/* Forms & Templates: template lifecycle + submission progress. */
.badge-status-draft { background: var(--amber-tint); color: var(--amber); }
.badge-status-published { background: var(--ok-tint); color: var(--ok); }
.badge-status-archived { background: var(--surface-sunk); color: var(--ink-faint); }

.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ok);
  transition: width 0.2s ease;
}

.checklist-item { margin-bottom: 12px; }
.checklist-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.checklist-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--signal-dark); flex-shrink: 0; }

/* Checklist tri-state row: the main "done" checkbox plus a separate,
   visually de-emphasized "N/A" toggle alongside it (main + na are mutually
   exclusive at the JS layer in app.js). */
.checklist-item-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.checklist-item-main > label:first-child { flex: 1 1 auto; min-width: 0; align-items: flex-start; padding-top: 1px; }
.na-toggle {
  flex: 0 0 auto;
  font-size: 12.5px !important;
  color: var(--ink-faint) !important;
  gap: 6px !important;
}
.na-toggle input[type="checkbox"] { width: 15px !important; height: 15px !important; accent-color: var(--ink-faint) !important; }

/* Small structured caption under a field/task label naming who is
   responsible for it — informational only, not an access control. */
.field-owner {
  margin-left: 28px;
  margin-top: -4px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* Plain divider/heading field within a form or checklist — no input. */
.section-divider {
  margin: 22px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--surface-sunk);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--signal-dark);
}
.section-divider:first-child { margin-top: 0; }

/* Signature pad: a plain canvas the user draws on (mouse/touch), wired up
   in app.js. Kept visually close to a bordered input so it reads as a
   field, not a random box on the page. */
.sig-pad-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sig-pad {
  width: 100%;
  max-width: 400px;
  height: 150px;
  border: 1.5px solid var(--surface-sunk);
  border-radius: var(--radius-sm);
  background: var(--surface);
  touch-action: none;
  cursor: crosshair;
}
.sig-pad[data-readonly] { cursor: not-allowed; opacity: 0.7; }

.badge-kind-form { background: var(--teal-tint); color: var(--teal); }
.badge-kind-checklist { background: var(--signal-tint); color: var(--signal-dark); }

.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.badge-live .badge-dot { animation: pulse-dot 1.6s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--signal-dark);
  color: #fff;
  border: 1px solid var(--signal-dark);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: var(--shadow-signal);
}
.btn:hover { background: var(--signal-darker); border-color: var(--signal-darker); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 15px; height: 15px; }

.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-secondary:hover { background: var(--surface-sunk); border-color: var(--ink-faint); transform: none; }

/* Used in views for positive/confirming actions (Approve, Upload) — kept
   as its own accent tier, repointed to the success colour (--ok) rather
   than --teal/info so it doesn't clash with the green "approved" badge
   the same action produces. */
.btn-teal { background: var(--ok); border-color: var(--ok); box-shadow: 0 8px 22px rgba(47, 125, 91, 0.22); }
.btn-teal:hover { background: #26694C; border-color: #26694C; }

.btn-danger { background: var(--surface); color: var(--red); border: 1px solid #EBC7C3; box-shadow: none; }
.btn-danger:hover { background: var(--red-tint); border-color: var(--red); transform: none; }

.btn-sm { padding: 6px 12px; min-height: 30px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                  */
/* ---------------------------------------------------------------------- */

.form-row { margin-bottom: 14px; }
.form-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--ink-soft);
}
.form-row label .icon { width: 0.95em; height: 0.95em; color: var(--ink-faint); }

.form-row input[type="text"],
.form-row input[type="file"],
.form-row input:not([type]),
.form-row select,
.form-row textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--signal-tint);
  outline-offset: 0;
  border-color: var(--signal-dark);
}

.checkbox-row { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--ink); cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--signal-dark); cursor: pointer; }

.form-inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.form-inline .form-row { margin-bottom: 0; flex: 1; min-width: 160px; }

.field-static { padding: 9px 0; color: var(--ink); }
.helper-text { color: var(--ink-faint); font-size: 12.5px; margin-top: 6px; }

/* ---------------------------------------------------------------------- */
/* Filter bars / search (People Directory)                               */
/* ---------------------------------------------------------------------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .form-row { margin-bottom: 0; min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search-wrap input { padding-left: 34px; }

/* ---------------------------------------------------------------------- */
/* Tabs                                                                   */
/* ---------------------------------------------------------------------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: none;
  background: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn .icon { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--signal-dark); }
.tab-btn.active { color: var(--signal-dark); border-bottom-color: var(--signal); }
.tab-count {
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
}
.tab-btn.active .tab-count { background: var(--signal-tint); color: var(--signal-dark); }

.tab-panel { animation: card-rise 0.35s ease both; }
.tab-panel[hidden] { display: none; }

/* ---------------------------------------------------------------------- */
/* Flash / empty states                                                   */
/* ---------------------------------------------------------------------- */

.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash .icon { width: 17px; height: 17px; flex-shrink: 0; }
.flash-success { background: var(--ok-tint); border-color: #C9E4D5; color: #1F5C41; }
.flash-error { background: var(--red-tint); border-color: #EBC7C3; color: var(--red); }
.flash-info { background: var(--teal-tint); border-color: #CBDCEB; color: var(--teal); align-items: flex-start; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 13px;
  padding: 38px 18px;
}
.empty-state .icon { width: 30px; height: 30px; color: var(--line); }

.muted { color: var(--ink-faint); font-size: 13px; }

/* ---------------------------------------------------------------------- */
/* Org Chart                                                              */
/* ---------------------------------------------------------------------- */

.org-tree { font-size: 14px; }
.org-node { margin-left: 0; }
.org-children { margin-left: 26px; padding-left: 16px; border-left: 2px dashed var(--line); margin-top: 6px; }
.org-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.org-card:hover { border-color: var(--signal-dark); box-shadow: var(--shadow-md); text-decoration: none; }
.org-card .oc-meta { min-width: 0; flex: 1; }
.org-card .oc-meta b { display: block; font-size: 13.5px; color: var(--ink); font-family: var(--font-display); }
.org-card .oc-meta span { display: block; font-size: 11.5px; color: var(--ink-faint); }
.org-card .oc-tail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------------- */
/* Audit log                                                              */
/* ---------------------------------------------------------------------- */

.audit-row td { font-size: 13px; }
.audit-diff { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.audit-time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------- */
/* Login screen                                                           */
/* ---------------------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--signal-dark), #1B6157 55%, #25705F);
  padding: 24px;
}
.login-shell::after {
  content: "";
  position: absolute;
  right: -130px;
  top: -130px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 118, 47, 0.35), transparent 70%);
}
.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 38px 34px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: card-rise 0.5s ease both;
}
.login-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: var(--radius-md);
  background: var(--signal-tint);
  color: var(--signal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-mark .icon { width: 30px; height: 30px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 24px; }
.btn-microsoft {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 11px 16px;
}
.btn-microsoft:hover { background: var(--surface-sunk); border-color: var(--ink-faint); transform: none; }
.btn-microsoft .icon { width: 17px; height: 17px; }
.login-foot { margin-top: 20px; font-size: 12px; color: var(--ink-faint); }

/* ---------------------------------------------------------------------- */
/* Floating feedback widget (Comments & Suggestions)                     */
/* ---------------------------------------------------------------------- */

.feedback-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--signal-dark);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: var(--shadow-signal);
  transition: background 0.15s ease, transform 0.1s ease;
}
.feedback-fab:hover { background: var(--signal-darker); transform: translateY(-1px); }
.feedback-fab .icon { width: 16px; height: 16px; }

.feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 33, 30, 0.4);
  z-index: 39;
}
.feedback-overlay[hidden] { display: none; }

.feedback-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
  animation: card-rise 0.2s ease both;
}
.feedback-panel[hidden] { display: none; }

.feedback-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.feedback-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.feedback-panel-title .icon { color: var(--signal-dark); }
.feedback-panel-close {
  background: none;
  border: none;
  padding: 5px;
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
}
.feedback-panel-close:hover { background: var(--surface-sunk); color: var(--ink); }
.feedback-panel-sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }

@media (max-width: 480px) {
  .feedback-fab { right: 16px; bottom: 16px; padding: 11px 16px; }
  .feedback-panel { right: 12px; left: 12px; bottom: 16px; max-width: none; }
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 860px) {
  .main { padding: 20px 20px 48px; }
  .grid-stats { flex-direction: column; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: var(--top-h);
    left: 0;
    bottom: 0;
    height: auto;
    z-index: 35;
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .scrim {
    display: none;
    position: fixed;
    inset: var(--top-h) 0 0;
    background: rgba(26, 33, 30, 0.4);
    z-index: 30;
  }
  .scrim.open { display: block; }
}
@media (min-width: 901px) {
  .scrim { display: none; }
}

@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-text em { display: none; }
  .who-meta { display: none; }
  .who { padding-left: 0; border-left: 0; }
}

@media (max-width: 720px) {
  .form-inline { flex-direction: column; align-items: stretch; }
  .form-inline .form-row { min-width: 0; }
}
