/* =========================================================
   COBA KPI & Activity Register — Design System
   Direction: a registrar's ledger, not a generic SaaS panel.
   Serif for record titles, sans for interface, mono for the
   data that reads like a transcript (IDs, dates, codes).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap');

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

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, Arial, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 100% 0%, rgba(62, 79, 166, 0.05), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(244, 192, 62, 0.06), transparent 40%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  animation: page-in 0.35s var(--ease);
}
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

a { color: var(--blue); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--blue-hover); text-decoration: underline; }

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

h1, h2, h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.18rem; font-weight: 600; display: flex; align-items: center; gap: 0.55rem; }
h2::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--gold);
  flex-shrink: 0;
}
h3 { font-size: 1rem; font-weight: 600; }

code, .mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------------------------------------------------------
   Top bar / navigation
   --------------------------------------------------------- */
.topbar {
  background: linear-gradient(135deg, var(--ink) 0%, #202b63 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 2px 14px rgba(27, 37, 89, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.topbar .brand-logo {
  height: 38px;
  width: auto;
  flex-shrink: 0;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.role-switch {
  display: flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.3rem 0.9rem 0.3rem 1rem;
  margin: 0 1rem;
}
.role-switch-label { font-size: 0.72rem; color: #C9CDE8; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.role-switch select {
  background: transparent; color: #fff; border: none; font-size: 0.85rem;
  font-weight: 600; padding: 0.1rem 0; cursor: pointer;
}
.role-switch select option { color: var(--ink); background: #fff; }

.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 0.4rem 0.85rem; font-size: 0.8rem; cursor: pointer; color: var(--slate);
  font-family: inherit;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort-arrow::after { content: '↕'; opacity: 0.4; font-size: 0.72rem; margin-left: 0.2rem; }

.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(27,37,89,0.22); min-width: 210px; padding: 0.4rem; z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 0.55rem 0.7rem; border-radius: 6px; color: var(--ink) !important;
  font-size: 0.85rem; text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--blue-light); }
.topbar .brand-text small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.66rem;
  color: var(--gold-text);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  color: #C7CDE4;
  text-decoration: none;
  margin-left: 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  padding: 0.3rem 0.05rem;
  transition: color 0.15s var(--ease);
}
.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transition: right 0.2s var(--ease);
  border-radius: 2px;
}
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a:hover::after, .topbar nav a.active::after { right: 0; }
.topbar nav a.active { color: #fff; }

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */
.container { max-width: 980px; margin: 2rem auto; padding: 0 1.25rem 3rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  animation: card-in 0.4s var(--ease) backwards;
}
.card:hover { box-shadow: var(--shadow-md); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.card.accent { border-top: 4px solid var(--blue); }

/* ---------------------------------------------------------
   Personal dashboard — profile card
   --------------------------------------------------------- */
.profile-card { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.profile-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--ink) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Source Serif 4', serif;
  font-weight: 700; font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.profile-meta { flex: 1; min-width: 200px; }
.profile-role { margin-left: auto; }

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
input, select, textarea {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  margin-bottom: 1rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #C9C2AC; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px var(--blue-light);
}
input[type="file"] {
  padding: 0.5rem;
  background: var(--bg);
  cursor: pointer;
}
select { cursor: pointer; }
textarea { resize: vertical; }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.btn:hover { background: var(--blue-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background: var(--bg); color: var(--ink); border-color: #C9C2AC; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #C43F2C; }
.btn.small { padding: 0.4rem 0.85rem; font-size: 0.78rem; }

/* ---------------------------------------------------------
   Dashboard stats
   --------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat .label { font-size: 0.68rem; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }
.stat .value { font-family: 'Source Serif 4', serif; font-size: 2.1rem; font-weight: 700; color: var(--ink); line-height: 1.2; }

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--border-soft); }
th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.045em;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}
tbody tr { transition: background 0.12s var(--ease); }
tbody tr:hover { background: var(--blue-light); }
td.mono, td:has(> a[href^="download"]) { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; }

/* ---------------------------------------------------------
   Badges, tags, status pills
   --------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge.submitted { background: var(--slate-light); color: var(--slate); }
.badge.submitted::before { background: var(--slate); animation: pulse 1.8s infinite; }
.badge.approved { background: var(--green-light); color: var(--green); }
.badge.approved::before { background: var(--green); }
.badge.rejected { background: var(--red-light); color: var(--red); }
.badge.rejected::before { background: var(--red); }
.badge.needs_revision { background: var(--amber-light); color: var(--amber); }
.badge.needs_revision::before { background: var(--amber); animation: pulse 1.8s infinite; }
.badge.referred { background: var(--blue-light); color: var(--blue); }
.badge.referred::before { background: var(--blue); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.tag {
  font-size: 0.66rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  background: var(--blue-light);
  color: var(--blue-hover);
}

/* ---------------------------------------------------------
   Flash messages
   --------------------------------------------------------- */
.flash {
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  animation: flash-in 0.3s var(--ease);
  border-left: 3px solid transparent;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.flash::before { font-weight: 800; flex-shrink: 0; }
.flash.success { background: var(--green-light); color: #146B4A; border-left-color: var(--green); }
.flash.success::before { content: "✓"; }
.flash.error { background: var(--red-light); color: #A83B29; border-left-color: var(--red); }
.flash.error::before { content: "!"; }
.flash.info { background: var(--blue-light); color: var(--blue-hover); border-left-color: var(--blue); }
.flash.info::before { content: "i"; }

/* ---------------------------------------------------------
   Auth screens
   --------------------------------------------------------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; animation: card-in 0.45s var(--ease); }
.auth-header { text-align: center; margin-bottom: 1.25rem; }
.auth-header .auth-logo { height: 56px; width: auto; margin-bottom: 0.9rem; }
.auth-header .eyebrow { color: var(--gold-text); text-transform: uppercase; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; }
.muted { color: var(--muted); font-size: 0.85rem; }

/* ---------------------------------------------------------
   Misc utility
   --------------------------------------------------------- */
::selection { background: var(--gold-light); color: var(--ink); }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar nav { margin-top: 0.3rem; }
  .topbar nav a { margin-left: 0; margin-right: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 0.9rem 2rem; margin-top: 1rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.4rem; }
}

/* ---------------------------------------------------------
   Print (used by the "Print / Save as PDF" buttons)
   --------------------------------------------------------- */
@media print {
  .topbar, .role-switch, .btn, .chip-group, #taskSearch, #taskPager, .expand-link { display: none !important; }
  body { background: #fff; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  details { break-inside: avoid; }
  details:not([open]) summary ~ * { display: block !important; }
  summary { list-style: none; }
  a[href]::after { content: ""; }
}

/* =========================================================
   2026 experience refresh
   A role-aware, human-friendly workspace with a persistent
   sidebar, calmer surfaces, clearer hierarchy and mobile UX.
   ========================================================= */

:root {
  --ink: #22304a;
  --ink-soft: #45556d;
  --blue: #405a78;
  --blue-hover: #30465f;
  --blue-light: #eef2f6;
  --gold: #d7a62a;
  --gold-text: #805d0a;
  --gold-light: #fff7dc;
  --green: #16805d;
  --green-light: #e8f7f1;
  --red: #c74343;
  --red-light: #fdecec;
  --amber: #b66c0a;
  --amber-light: #fff3df;
  --slate: #64748b;
  --slate-light: #eef2f6;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #dfe5ee;
  --border-soft: #edf0f5;
  --text: #243047;
  --muted: #5f6a7c;
  --sidebar-width: 286px;
  --topbar-height: 56px;
  --acting-banner-height: 44px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 37, 74, 0.05), 0 1px 5px rgba(20, 37, 74, 0.04);
  --shadow-md: 0 12px 30px rgba(20, 37, 74, 0.09);
  --shadow-lift: 0 18px 44px rgba(20, 37, 74, 0.14);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(64, 90, 120, 0.07), transparent 32rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(1.55rem, 2.2vw, 2.05rem); line-height: 1.2; }
h2 { font-size: 1.06rem; line-height: 1.35; }
h2::before { display: none; }
p { line-height: 1.62; }

/* Application shell */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #dce4f5;
  background:
    radial-gradient(circle at 20% 0%, rgba(108, 128, 154, 0.24), transparent 18rem),
    linear-gradient(180deg, #26364d 0%, #1b2739 100%);
  box-shadow: 8px 0 30px rgba(17, 29, 67, 0.12);
}

.sidebar-brand {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.05rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.sidebar-brand .brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 48px;
  padding: 4px;
  border-radius: 11px;
  background: #fff;
}

.brand-copy { min-width: 0; }
.brand-copy strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.25;
}
.brand-copy span {
  display: block;
  margin-top: 0.22rem;
  color: #aebbd8;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.sidebar-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 0.85rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.55rem 0.9rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: var(--ink);
  background: linear-gradient(145deg, #fff3bc, var(--gold));
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}

.user-copy { min-width: 0; }
.user-copy strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 0.84rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-copy span { display: block; margin-top: 0.12rem; color: #aebbd8; font-size: 0.72rem; }

.workspace-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 75;
  height: var(--topbar-height);
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0 clamp(1.25rem, 3vw, 3rem);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(20, 37, 74, 0.05);
}
.topbar-dropdown { position: relative; display: flex; }
.topbar-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.topbar-dropdown-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.topbar-dropdown-toggle .nav-chevron { width: 13px; height: 13px; margin-left: -0.1rem; transition: transform 0.15s var(--ease); }
.topbar-dropdown.open .topbar-dropdown-toggle .nav-chevron { transform: rotate(180deg); }
.topbar-dropdown-toggle:hover { color: var(--text); }
.topbar-dropdown-toggle.active { color: var(--blue); border-bottom-color: var(--blue); }
.topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d64545;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}
.topbar-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 1px;
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 76;
}
.topbar-dropdown.open .topbar-dropdown-menu { display: flex; }
.topbar-dropdown-menu a {
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}
.topbar-dropdown-menu a:hover { background: var(--surface-subtle); text-decoration: none; }
.topbar-dropdown-menu a.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }
body.has-workspace-topbar .container { padding-top: calc(var(--topbar-height) + 2.25rem); }
.nav-tab-panel.nav-tab-hidden { display: none; }

.quick-create { margin: 0 0.35rem 1.2rem; }
.quick-create > summary {
  display: grid;
  grid-template-columns: 20px 1fr 18px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 0.75rem;
  border-radius: 10px;
  color: #22304a;
  background: linear-gradient(135deg, #f3c94e, #e2aa24);
  box-shadow: 0 7px 18px rgba(215, 166, 42, 0.22);
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 800;
  list-style: none;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.quick-create > summary::-webkit-details-marker { display: none; }
.quick-create > summary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(215, 166, 42, 0.28); }
.quick-create svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-chevron { transition: transform 0.18s var(--ease); }
.quick-create[open] .nav-chevron { transform: rotate(180deg); }
.quick-create-menu {
  margin-top: 0.4rem;
  padding: 0.35rem;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  background: rgba(0,0,0,0.13);
}
.quick-create-menu a {
  display: block;
  padding: 0.48rem 0.65rem;
  border-radius: 7px;
  color: #c7d1e7;
  font-size: 0.74rem;
  text-decoration: none;
}
.quick-create-menu a:hover, .quick-create-menu a.active { color: #fff; background: rgba(255,255,255,0.09); text-decoration: none; }

.nav-section-label {
  margin: 1.2rem 0.7rem 0.42rem;
  color: #8392b4;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}
.management-label { margin-top: 1.65rem; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  margin: 2px 0;
  padding: 0.56rem 0.7rem;
  border-radius: 9px;
  color: #bdc9e1;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.14s var(--ease), background 0.14s var(--ease), transform 0.14s var(--ease);
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.075); text-decoration: none; }
.nav-item.active { color: #fff; background: rgba(112, 134, 160, 0.24); box-shadow: inset 0 0 0 1px rgba(171,187,205,0.13); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.85rem;
  width: 3px;
  height: 23px;
  border-radius: 0 5px 5px 0;
  background: var(--gold);
}
.nav-icon { display: grid; place-items: center; flex: 0 0 20px; }
.nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer { padding: 0.65rem 0.85rem 0.8rem; border-top: 1px solid rgba(255,255,255,0.09); }
.sidebar-footer .nav-item { font-size: 0.75rem; }
.sidebar-footer .sign-out { color: #d8b8b8; }

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.sidebar-close { display: none; margin-left: auto; color: #fff; }
.mobile-header, .sidebar-overlay { display: none; }

.container {
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 var(--sidebar-width);
  padding: 2.25rem clamp(1.25rem, 3vw, 3rem) 4rem;
}
.container > * { max-width: 1380px; margin-left: auto; margin-right: auto; }

/* Page hierarchy and reusable surfaces */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.page-header h1 { margin: 0; }
.page-header p { max-width: 740px; margin: 0.38rem 0 0; color: var(--muted); }
.page-eyebrow {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.page-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card.accent { border-top: 0; border-left: 4px solid var(--blue); }
.card > h1 { font-size: 1.2rem; }
.card > .card {
  margin-top: 0.9rem;
  padding: 1rem;
  border-color: var(--border-soft);
  background: var(--surface-subtle);
  box-shadow: none;
}
.card > .card:hover { box-shadow: none; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.card-header h2 { margin-bottom: 0.2rem; }
.card-header p { margin: 0; }

.notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid #ecd9a0;
  border-radius: 12px;
  color: #6f5214;
  background: linear-gradient(90deg, #fff8e4, #fffdf6);
}
.notice-strip strong { color: #5d430c; }

.stats {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.stat {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 13px;
  background: var(--surface);
}
.stat::after {
  content: '';
  position: absolute;
  inset: auto -28px -35px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(49,86,163,0.05);
}
.stat:hover { transform: none; box-shadow: var(--shadow-sm); }
.stat .label { color: var(--muted); font-size: 0.66rem; letter-spacing: 0.06em; }
.stat .value { margin-top: 0.18rem; font-family: 'Inter', sans-serif; font-size: 1.85rem; line-height: 1.15; }
.stat .context { position: relative; z-index: 1; margin-top: 0.35rem; color: var(--muted); font-size: 0.7rem; }
.stat.success { border-left: 3px solid var(--green); }
.stat.attention { border-left: 3px solid var(--amber); }
.stat.primary { border-left: 3px solid var(--blue); }

.btn { border-radius: 9px; padding: 0.66rem 1rem; box-shadow: 0 4px 10px rgba(49,86,163,0.16); }
.btn:hover { box-shadow: 0 7px 16px rgba(49,86,163,0.2); }
.btn.secondary { background: #fff; }
.btn.ghost { color: var(--blue); background: var(--blue-light); box-shadow: none; }
.btn.ghost:hover { color: var(--blue-hover); background: #e3ecff; box-shadow: none; }

label { color: #536077; font-size: 0.68rem; }
input, select, textarea { min-height: 42px; border-color: #d6deea; background: #fff; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
textarea { min-height: 76px; }

table { font-size: 0.84rem; }
th { padding: 0.72rem; color: #66748a; background: #f8fafc; border-bottom: 1px solid var(--border); }
td { padding: 0.76rem 0.72rem; vertical-align: top; }
tbody tr:hover { background: #f7f9fd; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; }
.table-scroll table { margin: 0; }
.table-scroll th:first-child, .table-scroll td:first-child { padding-left: 0.9rem; }

.badge { padding: 0.25rem 0.62rem; font-size: 0.67rem; }
.tag { border-radius: 999px; font-size: 0.62rem; }
.muted { line-height: 1.55; }

.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e9edf3; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #7188a3); }
.progress-bar.success { background: linear-gradient(90deg, var(--green), #45a984); }
.progress-bar.warning { background: linear-gradient(90deg, var(--gold), #e3bf5b); }

.kpi-accordion { margin-bottom: 0.65rem; }
.kpi-accordion > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.82rem 1rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--ink);
  background: #f7f9fd;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
  list-style: none;
}
.kpi-accordion > summary::-webkit-details-marker { display: none; }
.kpi-accordion > summary::before {
  content: '+';
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-light);
}
.kpi-accordion[open] > summary { border-color: #c9d6f1; background: #f0f4fc; }
.kpi-accordion[open] > summary::before { content: '−'; }
.kpi-summary-title { flex: 1; }
.kpi-summary-meta { color: var(--blue); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.kpi-accordion-body { padding: 0.7rem 0.2rem 0.2rem; }
.kpi-subcategory { padding: 0.7rem 0.55rem 0.35rem; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.72rem;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--surface-subtle);
}
.toolbar input, .toolbar select { margin-bottom: 0; }
.search-field { position: relative; flex: 1; min-width: 230px; }
.search-field::before { content: '⌕'; position: absolute; left: 0.72rem; top: 0.48rem; color: var(--muted); font-size: 1rem; }
.search-field input { padding-left: 2rem; }

.empty-state {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { display: block; margin-bottom: 0.3rem; color: var(--ink); }

/* Authentication */
.center-page {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(215,166,42,0.2), transparent 22rem),
    radial-gradient(circle at 85% 85%, rgba(103,126,153,0.2), transparent 28rem),
    linear-gradient(145deg, #1b2739, #324a67);
}
.center-page::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.auth-card { position: relative; z-index: 1; max-width: 440px; }
.auth-header h1 { color: #fff; font-size: 1.5rem; }
.auth-header .muted { color: #c8d2e7; }
.auth-header .eyebrow { color: #f0c95e; }
.auth-header .auth-logo { height: 64px; padding: 5px; border-radius: 12px; background: #fff; }
.auth-card .card { border: 1px solid rgba(255,255,255,0.45); box-shadow: 0 24px 70px rgba(5,13,36,0.28); }

@media (max-width: 1180px) {
  .charts-row { grid-template-columns: 1fr 1fr !important; }
  .charts-row > .card:last-child:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  body.nav-open { overflow: hidden; }
  .app-sidebar {
    width: min(88vw, 310px);
    transform: translateX(-105%);
    transition: transform 0.24s var(--ease);
  }
  body.nav-open .app-sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    visibility: hidden;
    display: block;
    background: rgba(8, 18, 44, 0.55);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s var(--ease), visibility 0.2s;
  }
  body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 60;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    color: #fff;
    background: rgba(17, 29, 67, 0.96);
    box-shadow: 0 4px 16px rgba(17,29,67,0.16);
    backdrop-filter: blur(10px);
  }
  .mobile-header .icon-button { margin-left: -0.25rem; }
  .mobile-brand-logo { width: 38px; height: 38px; object-fit: contain; padding: 3px; border-radius: 8px; background: #fff; }
  .mobile-brand-copy { min-width: 0; }
  .mobile-brand-copy strong { display: block; font-size: 0.82rem; }
  .mobile-brand-copy span { display: block; color: #b5c1dc; font-size: 0.65rem; }
  .container { width: 100%; margin-left: 0; min-height: calc(100vh - 64px); padding: 1.4rem 1rem 3rem; }
  body.has-workspace-topbar .container { padding-top: 1.4rem; }
  .workspace-topbar {
    position: sticky;
    top: 64px;
    left: 0;
    height: 50px;
    padding: 0 0.5rem;
    z-index: 59;
    overflow-x: auto;
  }
  .topbar-dropdown-toggle { padding: 0 0.65rem; font-size: 0.8rem; white-space: nowrap; }
  .topbar-dropdown-menu { left: auto; right: 0; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .charts-row { grid-template-columns: 1fr !important; }
  .charts-row > .card:last-child:nth-child(3) { grid-column: auto; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .container { padding-left: 0.8rem; padding-right: 0.8rem; }
  .card { padding: 1rem; border-radius: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .stat { min-height: 104px; padding: 0.85rem; }
  .stat .value { font-size: 1.55rem; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .notice-strip { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }
  .profile-card { align-items: flex-start; }
  .profile-role { width: 100%; margin-left: 0; }
  table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; }
  td { white-space: normal; min-width: 110px; }
  .kpi-accordion > summary { align-items: flex-start; flex-wrap: wrap; }
  .kpi-summary-meta { width: 100%; padding-left: 2.45rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; min-width: 0; }
}

@media print {
  .app-sidebar, .mobile-header, .sidebar-overlay, .page-actions, .quick-create { display: none !important; }
  .container { width: 100%; margin: 0; padding: 0; }
  .container > * { max-width: none; }
  .card { border-color: #ccc; }
}

/* =========================================================
   COBA Executive Workspace — premium visual layer
   Deep institutional navy, warm paper surfaces and restrained
   gold accents. This final layer intentionally owns every shared
   component so all existing PHP screens inherit one visual system.
   ========================================================= */

:root {
  --ink: #14213d;
  --ink-soft: #3f4e68;
  --blue: #445b91;
  --blue-hover: #354978;
  --blue-light: #edf1f9;
  --gold: #d2a43e;
  --gold-text: #7a570d;
  --gold-light: #fff6dd;
  --green: #14745f;
  --green-light: #e7f6f1;
  --red: #bd4147;
  --red-light: #fcebed;
  --amber: #ad6c12;
  --amber-light: #fff2dc;
  --slate: #66738a;
  --slate-light: #eef1f5;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-warm: #fbfaf7;
  --border: #dfe3ea;
  --border-soft: #eceef2;
  --text: #26334a;
  --muted: #5f6a7c;
  --sidebar-width: 294px;
  --topbar-height: 64px;
  --acting-banner-height: 44px;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .04), 0 5px 18px rgba(20, 33, 61, .045);
  --shadow-md: 0 14px 36px rgba(20, 33, 61, .095);
  --shadow-lift: 0 24px 58px rgba(20, 33, 61, .15);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { scrollbar-width: thin; scrollbar-color: #aab3c3 transparent; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 78% -5%, rgba(68, 91, 145, .085), transparent 27rem),
    radial-gradient(circle at 98% 34%, rgba(210, 164, 62, .06), transparent 23rem),
    linear-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px);
  background-size: auto, auto, 30px 30px, 30px 30px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.58;
  animation: premium-page-in .42s var(--ease);
}
@keyframes premium-page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

::selection { color: var(--ink); background: #f4dda5; }
a {
  color: var(--blue);
  font-weight: 650;
  text-decoration-color: rgba(68, 91, 145, .28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .18s ease, text-decoration-color .18s ease;
}
a:hover { color: var(--blue-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid rgba(210, 164, 62, .65); outline-offset: 3px; border-radius: 7px; }

h1, h2, h3 {
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -.035em;
}
h1 { font-size: clamp(1.65rem, 2.5vw, 2.3rem); font-weight: 800; line-height: 1.14; }
h2 { font-size: 1.08rem; font-weight: 800; line-height: 1.35; }
h3 { font-size: .96rem; font-weight: 750; }
p { line-height: 1.7; }
code, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* App shell */
.app-sidebar {
  width: var(--sidebar-width);
  color: #d7dfed;
  background:
    radial-gradient(circle at 15% -2%, rgba(96, 118, 179, .44), transparent 19rem),
    radial-gradient(circle at 95% 58%, rgba(210, 164, 62, .09), transparent 18rem),
    linear-gradient(178deg, #182642 0%, #111c31 58%, #0e192b 100%);
  border-right: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 12px 0 44px rgba(14, 25, 43, .16);
}
.app-sidebar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #f0cf77 45%, transparent 94%);
  z-index: 2;
}
.sidebar-brand {
  min-height: 104px;
  gap: .85rem;
  padding: 1.15rem 1rem 1.05rem;
  border-bottom-color: rgba(255, 255, 255, .085);
}
.sidebar-brand .brand-logo {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f6f5f1);
  box-shadow: 0 8px 20px rgba(3, 9, 24, .25);
}
.brand-copy strong {
  color: #fff;
  font-size: .94rem;
  font-weight: 800;
  letter-spacing: -.025em;
}
.brand-copy span {
  margin-top: .28rem;
  color: #aebad2;
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .095em;
}
.sidebar-scroll { padding: 1.05rem .82rem 1.35rem; }
.user-summary {
  margin: 0 .18rem 1rem;
  padding: .72rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.user-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 13px;
  color: #192540;
  background: linear-gradient(145deg, #ffe8a8, #d4a63e);
  box-shadow: 0 6px 16px rgba(3, 9, 24, .22), inset 0 1px 0 rgba(255, 255, 255, .62);
}
.user-copy strong { font-size: .82rem; font-weight: 750; }
.user-copy span { color: #9eacc8; font-size: .68rem; }

.quick-create { margin: 0 .2rem 1.25rem; }
.quick-create > summary {
  min-height: 47px;
  padding: .7rem .78rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 13px;
  color: #1b2741;
  background: linear-gradient(135deg, #f1cf76 0%, #d5a63e 55%, #c5922c 100%);
  box-shadow: 0 10px 25px rgba(6, 14, 32, .23), inset 0 1px 0 rgba(255, 255, 255, .58);
  font-size: .76rem;
  letter-spacing: -.005em;
}
.quick-create > summary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(5, 14, 34, .28), inset 0 1px 0 rgba(255, 255, 255, .65); }
.quick-create-menu {
  margin-top: .55rem;
  padding: .4rem;
  border-color: rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(4, 11, 26, .3);
}
.quick-create-menu a {
  padding: .57rem .68rem;
  border-radius: 9px;
  color: #bec9dc;
  font-size: .71rem;
  font-weight: 600;
}
.quick-create-menu a:hover, .quick-create-menu a.active { background: rgba(255, 255, 255, .09); }

.nav-section-label {
  margin: 1.35rem .7rem .46rem;
  color: #7f8daa;
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .135em;
}
.nav-item {
  min-height: 43px;
  margin: 3px 0;
  padding: .58rem .7rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #b9c4d8;
  font-size: .75rem;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s var(--ease);
}
.nav-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .065);
  transform: translateX(2px);
}
.nav-item.active {
  color: #fff;
  border-color: rgba(179, 194, 229, .14);
  background: linear-gradient(90deg, rgba(93, 113, 170, .35), rgba(72, 87, 132, .16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 5px 14px rgba(3, 9, 24, .12);
}
.nav-item.active::before {
  left: -.84rem;
  width: 4px;
  height: 25px;
  background: linear-gradient(180deg, #f1d27e, var(--gold));
  box-shadow: 0 0 15px rgba(210, 164, 62, .48);
}
.nav-icon { color: #95a6c3; transition: color .16s ease, transform .16s var(--ease); }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: #efd079; transform: scale(1.06); }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-footer {
  padding: .7rem .82rem .9rem;
  border-top-color: rgba(255, 255, 255, .08);
  background: rgba(4, 10, 22, .13);
}
.sidebar-footer .sign-out { color: #d9b8bb; }
.sidebar-footer .sign-out:hover { color: #fff; background: rgba(189, 65, 71, .16); }

/* Management bar */
.workspace-topbar {
  height: var(--topbar-height);
  left: var(--sidebar-width);
  gap: .3rem;
  padding: 0 clamp(1.2rem, 3vw, 3.1rem);
  background: rgba(255, 255, 255, .91);
  border-bottom-color: rgba(20, 33, 61, .09);
  box-shadow: 0 8px 26px rgba(20, 33, 61, .045);
  backdrop-filter: blur(16px) saturate(150%);
}
.workspace-topbar::after {
  content: 'MANAGEMENT WORKSPACE';
  align-self: center;
  margin-left: auto;
  color: #9099aa;
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .13em;
}
.topbar-dropdown-toggle {
  gap: .48rem;
  padding: 0 .92rem;
  color: #69758a;
  border-bottom-width: 3px;
  font-size: .78rem;
  font-weight: 750;
}
.topbar-dropdown-toggle:hover { color: var(--ink); background: rgba(244, 245, 248, .7); }
.topbar-dropdown-toggle.active { color: var(--blue); border-bottom-color: var(--gold); }
.topbar-dropdown-menu {
  min-width: 238px;
  margin-top: 8px;
  padding: .55rem;
  border-color: rgba(20, 33, 61, .1);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}
.topbar-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 24px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(20, 33, 61, .08);
  border-top: 1px solid rgba(20, 33, 61, .08);
  background: #fff;
}
.topbar-dropdown-menu a {
  position: relative;
  z-index: 1;
  padding: .65rem .76rem;
  border-radius: 10px;
  color: var(--text);
  font-size: .76rem;
}
.topbar-dropdown-menu a:hover { color: var(--ink); background: #f5f7fb; transform: translateX(2px); }
.topbar-dropdown-menu a.active { color: var(--blue-hover); background: var(--blue-light); }
.topbar-badge { background: linear-gradient(145deg, #d85459, #aa343b); box-shadow: 0 3px 8px rgba(189, 65, 71, .25); }

/* Main workspace and hierarchy */
.container {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  padding: 2.55rem clamp(1.25rem, 3.2vw, 3.4rem) 4.5rem;
}
body.has-workspace-topbar .container { padding-top: calc(var(--topbar-height) + 2.55rem); }
.container > * { max-width: 1460px; }
.page-header {
  position: relative;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.65rem;
  padding: 0 0 1.35rem;
  border-bottom: 1px solid rgba(20, 33, 61, .09);
}
.page-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 74px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), #ead18e);
}
.page-header h1 { margin: 0; color: var(--ink); }
.page-header p { max-width: 760px; margin-top: .48rem; color: var(--muted); font-size: .86rem; }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .42rem;
  color: var(--blue);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.page-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(210, 164, 62, .14);
}
.page-actions { gap: .6rem; }

/* Surfaces */
.card {
  position: relative;
  margin-bottom: 1.35rem;
  padding: 1.5rem;
  overflow: visible;
  border: 1px solid rgba(20, 33, 61, .09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow-sm);
  animation: premium-card-in .48s var(--ease) backwards;
  transition: border-color .2s ease, box-shadow .2s var(--ease), transform .2s var(--ease);
}
@keyframes premium-card-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:nth-of-type(2) { animation-delay: .035s; }
.card:nth-of-type(3) { animation-delay: .07s; }
.card:hover { border-color: rgba(68, 91, 145, .15); box-shadow: 0 12px 35px rgba(20, 33, 61, .07); }
.card.accent {
  overflow: hidden;
  border-left: 0;
  border-top: 1px solid rgba(20, 33, 61, .09);
}
.card.accent::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--blue));
}
.card > .card {
  border-color: var(--border-soft);
  border-radius: 14px;
  background: var(--surface-subtle);
}
.container > .card.accent:only-child { max-width: 1040px; }
.card > h1 {
  margin-bottom: 1.1rem;
  padding-bottom: .88rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 1.24rem;
  letter-spacing: -.03em;
}
.card-header { margin-bottom: 1.15rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border-soft); }
.card-header h2 { margin: 0 0 .18rem; }
.card-header p { color: var(--muted); font-size: .8rem; }

.profile-card {
  padding: 1.6rem;
  background:
    radial-gradient(circle at 100% 0, rgba(210, 164, 62, .12), transparent 17rem),
    linear-gradient(135deg, #fff, #f8f9fc);
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border: 4px solid #fff;
  border-radius: 18px;
  background: linear-gradient(145deg, #546ba2, #263963);
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  box-shadow: 0 9px 22px rgba(20, 33, 61, .18), 0 0 0 1px rgba(20, 33, 61, .08);
}

/* Buttons and hyperlinks */
.btn {
  min-height: 42px;
  justify-content: center;
  padding: .66rem 1.06rem;
  border: 1px solid rgba(30, 48, 91, .1);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #50679e 0%, #3b5186 58%, #334674 100%);
  box-shadow: 0 7px 16px rgba(53, 73, 120, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: -.005em;
}
.btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #5a71a8, #3a4e81);
  box-shadow: 0 11px 23px rgba(53, 73, 120, .25), inset 0 1px 0 rgba(255, 255, 255, .2);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0) scale(.99); }
.btn.secondary {
  color: var(--ink);
  border-color: #d8dee8;
  background: linear-gradient(180deg, #fff, #f8f9fb);
  box-shadow: 0 3px 9px rgba(20, 33, 61, .06), inset 0 1px 0 #fff;
}
.btn.secondary:hover { color: var(--blue-hover); border-color: #c4cede; background: #fff; box-shadow: 0 8px 18px rgba(20, 33, 61, .09); }
.btn.ghost { color: var(--blue-hover); border-color: transparent; background: var(--blue-light); box-shadow: none; }
.btn.ghost:hover { color: var(--blue-hover); background: #e3e9f6; box-shadow: none; }
.btn.danger { border-color: rgba(142, 33, 41, .12); background: linear-gradient(135deg, #ca5258, #a9363d); box-shadow: 0 7px 16px rgba(189, 65, 71, .2); }
.btn.danger:hover { background: linear-gradient(135deg, #d35b61, #a9363d); box-shadow: 0 10px 21px rgba(189, 65, 71, .25); }
.btn.small { min-height: 36px; padding: .5rem .85rem; font-size: .71rem; }
.btn:disabled { box-shadow: none; filter: grayscale(.25); }

/* Forms */
form { accent-color: var(--blue); }
label {
  margin-bottom: .42rem;
  color: #4d5b72;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .065em;
}
input, select, textarea {
  min-height: 46px;
  margin-bottom: 1.12rem;
  padding: .72rem .84rem;
  border: 1px solid #d5dbe5;
  border-radius: 11px;
  color: var(--text);
  background: linear-gradient(180deg, #fff, #fcfcfd);
  box-shadow: inset 0 1px 2px rgba(20, 33, 61, .025), 0 1px 0 rgba(255, 255, 255, .8);
  font-family: 'Manrope', sans-serif;
  font-size: .84rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:hover, select:hover, textarea:hover { border-color: #bfc8d6; }
input:focus, select:focus, textarea:focus {
  border-color: #667caf;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(68, 91, 145, .105), 0 5px 14px rgba(20, 33, 61, .05);
}
input::placeholder, textarea::placeholder { color: #9aa4b4; }
textarea { min-height: 104px; line-height: 1.55; }
select {
  padding-right: 2.2rem;
  background-color: #fff;
}
input[type='file'] {
  padding: .43rem;
  border-style: dashed;
  background: #fafbfc;
}
input[type='file']::file-selector-button {
  margin-right: .75rem;
  padding: .5rem .78rem;
  border: 0;
  border-radius: 8px;
  color: var(--blue-hover);
  background: var(--blue-light);
  font: inherit;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}
input[type='checkbox'], input[type='radio'] { width: 17px; min-height: 17px; margin: 0 .35rem 0 0; box-shadow: none; }

/* Metrics */
.stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: .95rem; margin-bottom: 1.35rem; }
.stat {
  min-height: 132px;
  padding: 1.1rem 1.15rem;
  border-color: rgba(20, 33, 61, .09);
  border-left: 0 !important;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 249, 252, .98));
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5a70a5, #91a0c4 55%, transparent);
}
.stat.success::before { background: linear-gradient(90deg, var(--green), #64b59f 55%, transparent); }
.stat.attention::before { background: linear-gradient(90deg, var(--gold), #efd480 55%, transparent); }
.stat::after {
  right: -30px;
  bottom: -38px;
  width: 105px;
  height: 105px;
  background: radial-gradient(circle, rgba(68, 91, 145, .075), rgba(68, 91, 145, 0) 68%);
}
.stat:hover { border-color: rgba(68, 91, 145, .18); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.stat .label { color: #707b8e; font-size: .61rem; font-weight: 800; letter-spacing: .095em; }
.stat .value { margin-top: .32rem; color: var(--ink); font-size: 2rem; font-weight: 800; letter-spacing: -.055em; }
.stat .context { margin-top: .42rem; color: var(--muted); font-size: .67rem; line-height: 1.42; }
.stat-block { border-radius: 14px !important; }

/* Tables */
.table-scroll {
  border: 1px solid #e3e6ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}
table { font-size: .77rem; }
th {
  padding: .78rem .8rem;
  color: #5d697d;
  border-bottom: 1px solid #dfe3ea;
  background: linear-gradient(180deg, #fafbfc, #f4f6f8);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .075em;
}
td { padding: .82rem .8rem; border-bottom-color: #eceef2; line-height: 1.52; }
tbody tr { transition: background .16s ease, box-shadow .16s ease; }
tbody tr:hover { background: #f5f7fb; box-shadow: inset 3px 0 0 var(--gold); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 700; }
.zero-row { background: #fafafa; }

/* Status, progress, messages */
.badge {
  gap: .38rem;
  padding: .3rem .68rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .025em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.badge::before { width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }
.badge.approved { border-color: #cce8de; }
.badge.submitted, .badge.referred { border-color: #dbe1eb; }
.badge.rejected { border-color: #f2d0d3; }
.badge.needs_revision { border-color: #efdcb8; }
.tag {
  padding: .28rem .62rem;
  border: 1px solid #d9e0ef;
  border-radius: 999px;
  background: #f1f4fa;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .065em;
}
.progress-track { height: 9px; border: 1px solid rgba(20, 33, 61, .035); background: #e9ecf1; box-shadow: inset 0 1px 2px rgba(20, 33, 61, .05); }
.progress-bar { background: linear-gradient(90deg, #40578e, #7f91bd); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.progress-bar.success { background: linear-gradient(90deg, #14745f, #54a991); }
.progress-bar.warning { background: linear-gradient(90deg, #c18a28, #ebca74); }

.flash {
  padding: .92rem 1rem;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(20, 33, 61, .045);
  font-size: .78rem;
}
.flash::before {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .62);
}
.flash.success { border-color: #cfe9e0; border-left-color: var(--green); }
.flash.error { border-color: #f0d1d4; border-left-color: var(--red); }
.flash.info { border-color: #d7dfef; border-left-color: var(--blue); }
.notice-strip {
  padding: 1rem 1.15rem;
  border-color: #ecd8a6;
  border-radius: 14px;
  background: linear-gradient(100deg, #fff8e8, #fffdf8 72%);
  box-shadow: 0 7px 20px rgba(122, 87, 13, .055);
}

/* Accordions, tools and empty states */
.kpi-accordion { margin-bottom: .75rem; }
.kpi-accordion > summary {
  min-height: 54px;
  padding: .8rem 1rem;
  border-color: #dfe4ec;
  border-radius: 13px;
  background: linear-gradient(180deg, #fafbfc, #f6f7f9);
  font-size: .78rem;
}
.kpi-accordion > summary::before { border-radius: 8px; background: #e9edf7; }
.kpi-accordion > summary:hover { border-color: #cbd4e4; background: #f7f9fc; }
.kpi-accordion[open] > summary { border-color: #cfd8e9; background: linear-gradient(180deg, #f4f7fc, #eef2f9); }
.kpi-summary-meta { font-size: .66rem; }
.kpi-subcategory { color: #68758a; font-size: .61rem; letter-spacing: .09em; }
.toolbar {
  gap: .7rem;
  padding: .82rem;
  border-color: #e3e6ec;
  border-radius: 13px;
  background: linear-gradient(180deg, #fafbfc, #f7f8fa);
  box-shadow: inset 0 1px 0 #fff;
}
.toolbar input, .toolbar select { min-height: 40px; }
.search-field::before { top: .46rem; color: #8a95a7; }
.empty-state {
  margin: .4rem 0;
  padding: 2.6rem 1.2rem;
  border: 1px dashed #d8dee7;
  border-radius: 14px;
  background: #fafbfc;
  font-size: .8rem;
}
.empty-state::before {
  content: '—';
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto .7rem;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-light);
  font-weight: 800;
}
.empty-state strong { font-size: .88rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  min-height: 34px;
  padding: .42rem .78rem;
  border-color: #d9dee7;
  background: #fff;
  font-size: .7rem;
  font-weight: 700;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s var(--ease);
}
.chip:hover { color: var(--blue-hover); border-color: #c5cfdf; background: #f8f9fc; transform: translateY(-1px); }
.chip.active { border-color: #334976; background: linear-gradient(135deg, #4b6094, #334976); box-shadow: 0 5px 12px rgba(53, 73, 120, .17); }
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.matrix-scroll { border: 1px solid var(--border); border-radius: 14px; background: #fff; }

/* Authentication becomes a refined two-panel welcome screen. */
.center-page {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 10% 12%, rgba(210, 164, 62, .24), transparent 22rem),
    radial-gradient(circle at 92% 88%, rgba(99, 123, 183, .25), transparent 30rem),
    linear-gradient(145deg, #111d32 0%, #1e3152 55%, #293d61 100%);
}
.center-page::before {
  opacity: .26;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 38px 38px;
}
.center-page::after {
  content: '';
  position: absolute;
  inset: auto auto -150px -90px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, .018), 0 0 0 96px rgba(255, 255, 255, .014);
}
.auth-card, .auth-card[style] {
  width: 100%;
  max-width: 920px !important;
  display: grid;
  grid-template-columns: minmax(300px, .92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.auth-header { margin: 0; text-align: left; }
.auth-header .auth-logo {
  height: 82px;
  margin-bottom: 1.3rem;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(4, 11, 25, .24);
}
.auth-header .eyebrow { margin-bottom: .55rem; color: #efd177; font-size: .64rem; letter-spacing: .13em; }
.auth-header h1 { max-width: 430px; color: #fff; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.12; }
.auth-header .muted { max-width: 410px; color: #c1cbdd; font-size: .83rem; }
.auth-card .card {
  margin: 0;
  padding: clamp(1.45rem, 3vw, 2.1rem);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 22px;
  background: rgba(255, 255, 255, .975);
  box-shadow: 0 32px 85px rgba(4, 11, 25, .34), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
}
.auth-card .card::before { width: 4px; }
.auth-card form .btn { margin-top: .2rem; }
.auth-card .card > p:first-child { margin-top: 0; }
.auth-form-intro { margin-bottom: 1.25rem; }
.auth-form-intro span {
  display: block;
  margin-bottom: .32rem;
  color: var(--blue);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-form-intro h2 { margin: 0; font-size: 1.35rem; }
.auth-form-intro p { margin: .25rem 0 0; color: var(--muted); font-size: .76rem; }

/* Responsive */
@media (max-width: 1180px) {
  .workspace-topbar::after { display: none; }
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (max-width: 860px) {
  .app-sidebar { width: min(88vw, 316px); }
  .mobile-header {
    min-height: 68px;
    padding: .68rem 1rem;
    background: rgba(17, 29, 50, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 8px 24px rgba(14, 25, 43, .18);
  }
  .mobile-brand-logo { width: 42px; height: 42px; border-radius: 11px; }
  .mobile-brand-copy strong { font-size: .79rem; }
  .mobile-brand-copy span { color: #aebad0; }
  .workspace-topbar { top: 68px; height: 54px; left: 0; padding: 0 .5rem; }
  .topbar-dropdown-toggle { padding: 0 .68rem; }
  .topbar-dropdown-menu::before { left: auto; right: 24px; }
  .container { width: 100%; margin-left: 0; padding: 1.55rem 1rem 3.5rem; }
  body.has-workspace-topbar .container { padding-top: 1.55rem; }
  .page-header { align-items: flex-start; }
  .auth-card, .auth-card[style] { max-width: 520px !important; grid-template-columns: 1fr; gap: 1.6rem; }
  .auth-header { text-align: center; }
  .auth-header .auth-logo { height: 68px; margin-bottom: .8rem; }
  .auth-header h1 { margin-left: auto; margin-right: auto; font-size: 1.72rem; }
  .auth-header .muted { margin-left: auto; margin-right: auto; }
}
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .container { padding-left: .75rem; padding-right: .75rem; }
  .page-header { margin-bottom: 1.15rem; padding-bottom: 1rem; }
  .page-header h1 { font-size: 1.58rem; }
  .card { padding: 1.05rem; border-radius: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .stat { min-height: 118px; padding: .9rem; border-radius: 14px; }
  .stat .value { font-size: 1.62rem; }
  .stat .context { font-size: .62rem; }
  .page-actions .btn { min-width: 0; }
  .topbar-dropdown-menu { position: fixed; top: 119px; left: .7rem; right: .7rem; min-width: 0; }
  .topbar-dropdown-menu::before { display: none; }
  .auth-card, .auth-card[style] { gap: 1.2rem; }
  .auth-header h1 { font-size: 1.45rem; }
  .auth-header .muted { display: none; }
  .auth-card .card { padding: 1.25rem; border-radius: 18px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 390px) {
  .stats { grid-template-columns: 1fr; }
  .stat { min-height: 105px; }
}
@media (prefers-reduced-motion: reduce) {
  body, .card { animation: none !important; }
  .nav-item:hover, .btn:hover, .stat:hover { transform: none; }
}
@media print {
  body { color: #111; background: #fff; }
  .workspace-topbar { display: none !important; }
  body.has-workspace-topbar .container { padding-top: 0; }
  .card, .stat { background: #fff; box-shadow: none; }
  .page-header { border-bottom-color: #aaa; }
}

/* =========================================================
   Precision hover interactions
   Applied only to devices with a real pointing device, keeping
   touch screens calm and fully usable.
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
  /* Soft cursor-following light across useful dashboard surfaces. */
  .card:not(.accent):not(.profile-card),
  .stat {
    --pointer-x: 50%;
    --pointer-y: 0%;
    will-change: transform, box-shadow;
  }

  .card:not(.accent):not(.profile-card):hover {
    border-color: rgba(68, 91, 145, .23);
    background:
      radial-gradient(420px circle at var(--pointer-x) var(--pointer-y), rgba(88, 111, 169, .09), transparent 52%),
      rgba(255, 255, 255, .985);
    box-shadow: 0 18px 44px rgba(20, 33, 61, .105);
    transform: translateY(-3px);
  }

  .charts-row .card:hover { transform: translateY(-5px); }

  .stat:hover {
    border-color: rgba(68, 91, 145, .22);
    background:
      radial-gradient(240px circle at var(--pointer-x) var(--pointer-y), rgba(88, 111, 169, .13), transparent 58%),
      linear-gradient(145deg, #fff, #f8f9fc);
    box-shadow: 0 17px 38px rgba(20, 33, 61, .12);
    transform: translateY(-5px) scale(1.008);
  }

  .stat.success:hover {
    background:
      radial-gradient(240px circle at var(--pointer-x) var(--pointer-y), rgba(20, 116, 95, .12), transparent 58%),
      linear-gradient(145deg, #fff, #f7fbfa);
  }

  .stat.attention:hover {
    background:
      radial-gradient(240px circle at var(--pointer-x) var(--pointer-y), rgba(210, 164, 62, .15), transparent 58%),
      linear-gradient(145deg, #fff, #fdfbf6);
  }

  /* A light sweep gives primary actions a premium tactile response. */
  .btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }

  .btn::before {
    content: '';
    position: absolute;
    top: -60%;
    bottom: -60%;
    left: -38%;
    width: 24%;
    opacity: 0;
    transform: rotate(18deg) translateX(-220%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
    transition: transform .6s var(--ease), opacity .2s ease;
  }

  .btn:hover::before { opacity: 1; transform: rotate(18deg) translateX(650%); }
  .btn.secondary::before { background: linear-gradient(90deg, transparent, rgba(68, 91, 145, .1), transparent); }

  /* Links draw themselves from left to right without moving surrounding text. */
  .container a:not(.btn):not(.chip) {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: color .18s ease, background-size .24s var(--ease);
  }

  .container a:not(.btn):not(.chip):hover { background-size: 100% 1px; }

  /* Navigation responds with depth, color and restrained horizontal motion. */
  .nav-item:hover .nav-icon svg { filter: drop-shadow(0 3px 5px rgba(210, 164, 62, .22)); }
  .quick-create > summary:active { transform: translateY(0) scale(.99); }
  .topbar-dropdown-toggle:hover svg:first-child { color: var(--gold-text); transform: translateY(-1px); }
  .topbar-dropdown-toggle svg:first-child { transition: color .18s ease, transform .18s var(--ease); }

  /* Data rows and controls become easier to scan with the pointer. */
  tbody tr:hover td:first-child { color: var(--ink); }
  tbody tr:hover td { border-bottom-color: #dfe4ec; }
  .table-scroll:hover { border-color: #d2d8e2; box-shadow: 0 8px 22px rgba(20, 33, 61, .055); }

  input:hover, select:hover, textarea:hover {
    border-color: #aeb9ca;
    background: #fff;
    box-shadow: 0 4px 12px rgba(20, 33, 61, .045);
  }

  input[type='file']:hover { border-color: #9dabc0; background: #f7f9fc; }
  input[type='file']::file-selector-button:hover { color: #fff; background: var(--blue); }

  .badge, .tag, .chip, .kpi-accordion > summary, .table-scroll {
    transition: border-color .18s ease, background .18s ease, box-shadow .18s var(--ease), transform .18s var(--ease);
  }

  .badge:hover, .tag:hover { box-shadow: 0 5px 13px rgba(20, 33, 61, .1); transform: translateY(-2px); }
  .kpi-accordion > summary:hover { box-shadow: 0 7px 18px rgba(20, 33, 61, .07); transform: translateX(3px); }
  .kpi-accordion > summary:hover::before { color: #fff; background: var(--blue); transform: rotate(90deg); }
  .kpi-accordion > summary::before { transition: color .18s ease, background .18s ease, transform .22s var(--ease); }
  .empty-state:hover { border-color: #bfc9d8; background: #f8f9fc; }
  .profile-card:hover .profile-avatar { box-shadow: 0 13px 28px rgba(20, 33, 61, .23), 0 0 0 4px rgba(210, 164, 62, .13); transform: translateY(-2px) rotate(-1deg); }
  .profile-avatar { transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
}

@media (prefers-reduced-motion: reduce) {
  .btn::before { display: none !important; }
  .card, .stat, .badge, .tag, .kpi-accordion > summary, .profile-avatar { transform: none !important; transition-duration: .001ms !important; }
}

/* Temporary role coverage ("Acting as") banner */
.acting-as-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--acting-banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem;
  background: var(--amber-light, #fff2dc);
  color: var(--gold-text, #7a570d);
  border-bottom: 1px solid var(--gold, #d2a43e);
  font-size: 0.85rem;
  font-weight: 600;
  flex-wrap: wrap;
  text-align: center;
}
.acting-as-banner-available { background: var(--blue-light); color: var(--blue); border-bottom-color: var(--blue); }
.acting-as-banner form { display: inline; margin: 0; }
.acting-as-banner button {
  padding: 0.3rem 0.8rem;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* Push everything else down by the banner's height when it's present. */
body.has-acting-banner .app-sidebar,
body.has-acting-banner .workspace-topbar {
  top: var(--acting-banner-height);
}
body.has-acting-banner .container {
  padding-top: calc(var(--acting-banner-height) + 2.25rem);
}
body.has-acting-banner.has-workspace-topbar .container {
  padding-top: calc(var(--acting-banner-height) + var(--topbar-height) + 2.25rem);
}
@media (max-width: 860px) {
  body.has-acting-banner .mobile-header { top: var(--acting-banner-height); position: sticky; }
  body.has-acting-banner .container { padding-top: 1.4rem; }
  body.has-acting-banner .workspace-topbar { top: calc(64px + var(--acting-banner-height)); }
}

/* Sidebar search box */
.sidebar-search {
  position: relative;
  margin: 0 0.6rem 0.8rem;
}
.sidebar-search svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.7rem 0.5rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface-subtle);
}

/* Skip link — invisible until focused via keyboard, lets keyboard/screen-reader users jump past the sidebar straight to the page content. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 0.7rem 1.2rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}
