/* ==========================================================================
   MOS Sentinel — admin theme
   ==========================================================================
   Server-rendered Razor + Bootstrap 5. This stylesheet provides design tokens
   and a sidebar/topbar shell + KPI / chart / feed / alert components matching
   the "Sentinel Enterprise — Executive Protocol" mock. Bootstrap utility
   classes still work; this file retints them through CSS variables.
   ========================================================================== */

:root {
  /* surfaces */
  --s-bg:           #F5F2EB;
  --s-bg-soft:      #EFEBE2;
  --s-surface:      #FFFFFF;
  --s-surface-2:    #FAF8F2;
  --s-sidebar:      #EEEAE0;
  --s-sidebar-hov:  #E3DED1;
  --s-sidebar-act:  #1F2937;
  --s-border:       #E2DCCB;
  --s-border-soft:  #EDE7D8;

  /* ink */
  --s-ink:          #1F2937;
  --s-ink-soft:     #4B5563;
  --s-muted:        #6B7280;
  --s-muted-2:      #9CA3AF;

  /* accents */
  --s-accent:       #1F2937;
  --s-accent-ink:   #FFFFFF;
  --s-accent-soft:  #E5E7EB;

  --s-green:        #047857;
  --s-green-bg:     #D6F1E2;
  --s-blue:         #1D4ED8;
  --s-blue-bg:      #DBE4F8;
  --s-red:          #B91C1C;
  --s-red-bg:       #FBE3DE;
  --s-red-soft-bg:  #FCEFEB;
  --s-amber:        #B45309;
  --s-amber-bg:     #FBE6BE;

  /* radii / shadows */
  --s-radius-sm: 10px;
  --s-radius:    14px;
  --s-radius-lg: 20px;
  --s-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --s-shadow:    0 4px 18px rgba(15, 23, 42, .06);
  --s-shadow-lg: 0 18px 40px rgba(15, 23, 42, .08);

  /* typography */
  --s-font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  background: var(--s-bg);
  color: var(--s-ink);
  font-family: var(--s-font);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  height: 100vh;
  overflow: hidden;       /* page is fixed — only the inner content scrolls */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--s-ink); }
a:hover { color: var(--s-accent); }

/* ---------- App shell --------------------------------------------------- */
.s-app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  transition: grid-template-columns .18s ease;
}
.s-app.collapsed { grid-template-columns: 72px 1fr; }

/* ---------- Sidebar ----------------------------------------------------- */
.s-sidebar {
  background: var(--s-sidebar);
  border-right: 1px solid var(--s-border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  height: 100vh;
  overflow-y: auto;       /* sidebar scrolls when nav overflows */
  overflow-x: hidden;
  position: relative;
}
.s-sidebar::-webkit-scrollbar { width: 8px; }
.s-sidebar::-webkit-scrollbar-thumb { background: rgba(31,41,55,.18); border-radius: 8px; }
.s-sidebar::-webkit-scrollbar-track { background: transparent; }
.s-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 6px 8px;
  line-height: 1.1;
  border-radius: var(--s-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.s-brand:hover { background: var(--s-sidebar-hov); color: inherit; }
.s-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--s-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.s-brand-text { min-width: 0; }
.s-brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .1px;
  color: var(--s-ink);
}
.s-brand-sub {
  font-size: 10.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--s-muted);
  margin-top: 2px;
}
/* Topbar hamburger (the ONE toggle — always visible, works when collapsed too) */
.s-topbar-toggle {
  background: transparent;
  border: 1px solid var(--s-border);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--s-ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 38px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  position: relative;
  z-index: 10;
}
.s-topbar-toggle:hover {
  color: var(--s-ink);
  background: var(--s-surface);
  border-color: var(--s-muted-2);
}
.s-topbar-toggle:active { transform: translateY(1px); }
.s-topbar-toggle[aria-pressed="true"] {
  background: var(--s-accent);
  color: var(--s-accent-ink);
  border-color: var(--s-accent);
}

/* Collapsed sidebar: hide labels + nav-heading; icons centered. */
.s-app.collapsed .s-brand-text,
.s-app.collapsed .s-nav-heading,
.s-app.collapsed .s-user-meta { display: none; }
.s-app.collapsed .s-sidebar { padding: 18px 10px 14px; align-items: stretch; }
.s-app.collapsed .s-brand { justify-content: center; padding: 6px 0; }
.s-app.collapsed .s-user-card {
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}
.s-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.s-nav-heading {
  font-size: 11px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--s-muted-2);
  padding: 12px 12px 4px;
}

/* ---- Standalone nav link (Overview, etc.) ----------------------------- */
.s-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--s-radius-sm);
  color: var(--s-ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.s-nav-link:hover { background: var(--s-sidebar-hov); color: var(--s-ink); }
.s-nav-link.active {
  background: var(--s-surface);
  color: var(--s-ink);
  box-shadow: var(--s-shadow-sm);
  border: 1px solid var(--s-border);
  font-weight: 600;
}
.s-nav-link .s-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--s-muted);
}
.s-nav-link.active .s-ico { color: var(--s-ink); }
/* ---- Collapsible group (Team / HR / Security / Admin / My data) ------- */
.s-group {
  border-radius: var(--s-radius-sm);
  margin-bottom: 2px;
}
.s-group-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--s-radius-sm);
  color: var(--s-ink-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background .15s ease, color .15s ease;
}
.s-group-summary::-webkit-details-marker { display: none; }
.s-group-summary::marker { content: ""; }
.s-group-summary:hover { background: var(--s-sidebar-hov); color: var(--s-ink); }
.s-group-summary > .s-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--s-muted);
}
.s-group-summary .s-label { flex: 1 1 auto; }
.s-group-summary .s-chevron {
  flex: 0 0 12px;
  color: var(--s-muted-2);
  transition: transform .2s ease;
}
.s-group[open] > .s-group-summary .s-chevron { transform: rotate(180deg); color: var(--s-ink-soft); }
.s-group[open] > .s-group-summary { color: var(--s-ink); }
.s-group[open] > .s-group-summary > .s-ico { color: var(--s-ink); }

.s-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0 6px 0;
  margin: 2px 0 4px 19px;        /* aligns the indent line under the group icon center */
  border-left: 1px solid var(--s-border);
  position: relative;
}
.s-group-items .s-nav-link {
  padding: 7px 10px 7px 16px;     /* extra left padding pulls items past the indent line */
  font-size: 13.5px;
  font-weight: 500;
  margin-left: 2px;
  gap: 10px;
  color: var(--s-ink-soft);
}
.s-group-items .s-nav-link > .s-ico {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}
.s-group-items .s-nav-link.active {
  background: var(--s-surface);
  box-shadow: var(--s-shadow-sm);
  border: 1px solid var(--s-border);
  color: var(--s-ink);
  font-weight: 600;
}
.s-group-items .s-nav-link.active > .s-ico { color: var(--s-ink); }

/* When the whole sidebar is collapsed, hide group items + chevrons + labels.
   The group summary still works as a click-through to the group's first item. */
.s-app.collapsed .s-group-items,
.s-app.collapsed .s-group-summary .s-chevron,
.s-app.collapsed .s-group-summary .s-label,
.s-app.collapsed .s-nav-link .s-label,
.s-app.collapsed .s-nav-link .s-dot { display: none; }
.s-app.collapsed .s-group-summary {
  justify-content: center;
  padding: 10px 0;
}
.s-app.collapsed .s-nav-link {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
/* ---- Sidebar footer: user card with email + sign-out icon ----------- */
.s-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--s-border);
}
.s-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--s-radius-sm);
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  transition: background .15s ease;
}
.s-user-card:hover { background: var(--s-surface-2); }
.s-user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--s-accent);
  color: var(--s-accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .3px;
  text-decoration: none;
  cursor: pointer;
}
.s-user-avatar:hover { color: var(--s-accent-ink); }
.s-user-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.s-user-email {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--s-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.s-user-roles {
  font-size: 10.5px;
  color: var(--s-muted);
  letter-spacing: .3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.s-user-logout {
  margin: 0;
  flex: 0 0 auto;
}
.s-logout-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--s-border);
  background: transparent;
  color: var(--s-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.s-logout-btn:hover {
  background: var(--s-red-bg);
  color: var(--s-red);
  border-color: var(--s-red-bg);
}

/* ---------- Main area --------------------------------------------------- */
.s-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;       /* only the inner <main> scrolls */
}
.s-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--s-border);
  background: var(--s-bg);
  flex-shrink: 0;
  z-index: 5;
}
.s-topbar-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .1px;
  white-space: nowrap;
}
.s-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  border-radius: 999px;
  padding: 8px 16px;
  max-width: 520px;
  color: var(--s-muted);
}
.s-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--s-ink);
}
.s-tabs {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 14px;
  color: var(--s-muted);
}
.s-tabs a {
  text-decoration: none;
  padding: 6px 2px;
  color: var(--s-muted);
}
.s-tabs a.active {
  color: var(--s-ink);
  font-weight: 600;
  border-bottom: 2px solid var(--s-ink);
}
.s-icon-btn {
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--s-ink-soft);
  cursor: pointer;
}
.s-icon-btn:hover { background: var(--s-surface-2); color: var(--s-ink); }
.s-cta {
  background: var(--s-accent);
  color: var(--s-accent-ink);
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 18px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.s-cta:hover { background: #0F172A; color: #fff; }
.s-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--s-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

/* ---------- Main gutter (applies to legacy views too) ------------------ */
.s-main > main {
  padding: 22px 32px 28px;
  flex: 1 1 auto;
  overflow-y: auto;       /* page is fixed; only this region scrolls */
  overflow-x: hidden;
}
.s-main > main::-webkit-scrollbar { width: 10px; }
.s-main > main::-webkit-scrollbar-thumb { background: rgba(31,41,55,.15); border-radius: 8px; }
.s-main > main::-webkit-scrollbar-track { background: transparent; }
.s-main > main > .alert { margin-bottom: 18px; }

/* Bootstrap container overrides — legacy views often wrap themselves in
   .container / .container-fluid which would compound the gutter. Strip
   their own padding so we get a single, consistent inset. */
.s-main > main > .container,
.s-main > main > .container-fluid { padding-left: 0; padding-right: 0; max-width: none; }

/* ---------- Page header (Operational Overview etc.) -------------------- */
.s-page {
  padding: 6px 0 14px;
}
.s-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
.s-page-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -.3px;
}
.s-page-sub {
  color: var(--s-muted);
  font-size: 14px;
  margin: 0;
  max-width: 56ch;
}
.s-page-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.s-btn-soft {
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  color: var(--s-ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.s-btn-soft:hover { background: var(--s-surface-2); color: var(--s-ink); }

/* ---------- KPI tiles --------------------------------------------------- */
.s-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin-bottom: 16px;
}
@media (max-width: 1280px) { .s-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .s-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.s-kpi {
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  padding: 18px 18px 16px;
  box-shadow: var(--s-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.s-kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.s-kpi-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--s-bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--s-ink-soft);
}
.s-kpi-ico--red    { background: var(--s-red-bg);   color: var(--s-red); }
.s-kpi-ico--green  { background: var(--s-green-bg); color: var(--s-green); }
.s-kpi-ico--blue   { background: var(--s-blue-bg);  color: var(--s-blue); }
.s-kpi-ico--amber  { background: var(--s-amber-bg); color: var(--s-amber); }
.s-delta {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--s-accent-soft);
  color: var(--s-ink-soft);
  white-space: nowrap;
}
.s-delta--green { background: var(--s-green-bg); color: var(--s-green); }
.s-delta--blue  { background: var(--s-blue-bg);  color: var(--s-blue); }
.s-delta--red   { background: var(--s-red-bg);   color: var(--s-red); }
.s-kpi-label {
  font-size: 11px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--s-muted);
  font-weight: 600;
}
.s-kpi-value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -.5px;
}

/* ---------- Generic card + grid ---------------------------------------- */
.s-card {
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow-sm);
  padding: 22px 22px 18px;
}
.s-card--soft { background: var(--s-surface-2); }
.s-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.s-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.s-card-sub {
  font-size: 13px;
  color: var(--s-muted);
  margin: 0;
}
.s-toggle {
  display: inline-flex;
  background: var(--s-bg-soft);
  border-radius: 999px;
  padding: 4px;
}
.s-toggle button, .s-toggle a {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--s-muted);
  cursor: pointer;
  text-decoration: none;
}
.s-toggle .active { background: var(--s-accent); color: #fff; }

.s-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 0;
  margin-bottom: 16px;
}
@media (max-width: 980px) { .s-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Charts ------------------------------------------------------ */
.s-chart-wrap { position: relative; height: 240px; }

/* ---------- Donut central label ---------------------------------------- */
.s-donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 18px;
}
.s-donut-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}
.s-donut-center .num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.s-donut-center .lbl {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--s-muted);
  text-transform: uppercase;
}
.s-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.s-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.s-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
}

/* ---------- Activity feed ---------------------------------------------- */
.s-feed { display: flex; flex-direction: column; gap: 14px; }
.s-feed-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 14px;
  align-items: flex-start;
}
.s-feed-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--s-bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--s-ink-soft);
}
.s-feed-title { font-weight: 600; font-size: 14px; }
.s-feed-meta  { color: var(--s-muted); font-size: 13px; }
.s-feed-time  { color: var(--s-muted); font-size: 12px; white-space: nowrap; }
.s-feed-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--s-border-soft);
  font-size: 13px;
}
.s-feed-foot a { color: var(--s-ink); font-weight: 600; text-decoration: none; }

/* ---------- Priority alerts -------------------------------------------- */
.s-alerts-panel {
  background: var(--s-red-soft-bg);
  border: 1px solid #F4CFC6;
  border-radius: var(--s-radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.s-alerts-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}
.s-alerts-head .s-ico-warn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--s-red);
  color: #fff;
  font-size: 13px;
}
.s-alert-card {
  background: #fff;
  border: 1px solid #F1D9D2;
  border-radius: 12px;
  padding: 14px 16px;
}
.s-alert-kind {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--s-red);
  font-weight: 700;
}
.s-alert-title { font-weight: 700; font-size: 14px; margin-top: 4px; }
.s-alert-desc  { color: var(--s-muted); font-size: 13px; margin-top: 4px; }
.s-alert-actions { display: flex; gap: 8px; margin-top: 12px; }
.s-btn-danger {
  background: var(--s-red);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
}
.s-btn-ghost {
  background: transparent;
  color: var(--s-ink-soft);
  border: 1px solid #E2D5D1;
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Inline meta card ------------------------------------------ */
.s-meta-card {
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.s-meta-card .lbl { font-weight: 700; }
.s-meta-card .sub { color: var(--s-muted); font-size: 13px; }
.s-meta-shield {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--s-bg-soft);
  color: var(--s-ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Footer ----------------------------------------------------- */
.s-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 28px;
  color: var(--s-muted);
  font-size: 12.5px;
  border-top: 1px solid var(--s-border-soft);
  flex-shrink: 0;
  background: var(--s-bg);
}
.s-foot a { color: var(--s-muted); text-decoration: none; margin-left: 18px; }
.s-foot a:hover { color: var(--s-ink); }

/* ==========================================================================
   Bootstrap retint — keep utility classes working under the new look
   ========================================================================== */

.bg-light { background-color: var(--s-bg) !important; }

.card {
  border: 1px solid var(--s-border) !important;
  border-radius: var(--s-radius) !important;
  background: var(--s-surface);
  box-shadow: var(--s-shadow-sm) !important;
}
.card .card-body { padding: 1.1rem 1.25rem; }
.card .card-header {
  background: var(--s-surface-2);
  border-bottom: 1px solid var(--s-border);
  font-weight: 600;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}
.btn-primary {
  background: var(--s-accent) !important;
  border-color: var(--s-accent) !important;
}
.btn-primary:hover { background: #0F172A !important; border-color: #0F172A !important; }
.btn-outline-secondary {
  border-color: var(--s-border) !important;
  color: var(--s-ink) !important;
  background: var(--s-surface);
}
.btn-outline-secondary:hover { background: var(--s-surface-2) !important; color: var(--s-ink) !important; }
.btn-danger {
  background: var(--s-red) !important;
  border-color: var(--s-red) !important;
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--s-border);
  background: var(--s-surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--s-ink-soft);
  box-shadow: 0 0 0 .15rem rgba(31,41,55,.12);
}

.table {
  --bs-table-bg: var(--s-surface);
  --bs-table-border-color: var(--s-border-soft);
  border-radius: var(--s-radius);
  overflow: hidden;
}
.table thead th {
  background: var(--s-surface-2);
  font-weight: 600;
  color: var(--s-ink-soft);
  border-bottom-color: var(--s-border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.table tbody td { vertical-align: middle; }

.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.badge.bg-success { background-color: var(--s-green) !important; }
.badge.bg-danger  { background-color: var(--s-red)   !important; }
.badge.bg-warning { background-color: var(--s-amber) !important; color: #fff !important; }
.badge.bg-info    { background-color: var(--s-blue)  !important; }

.alert {
  border-radius: var(--s-radius);
  border: 1px solid transparent;
}
.alert-info {
  background: var(--s-blue-bg);
  border-color: #BFD2F2;
  color: var(--s-blue);
}
.alert-success { background: var(--s-green-bg); border-color: #BDE5CD; color: var(--s-green); }
.alert-warning { background: var(--s-amber-bg); border-color: #F2D689; color: var(--s-amber); }
.alert-danger  { background: var(--s-red-bg);   border-color: #F1C5BC; color: var(--s-red); }

.text-muted { color: var(--s-muted) !important; }
.text-uppercase { letter-spacing: .8px; }

/* nav-pills / nav-tabs subtle retint */
.nav-tabs { border-bottom-color: var(--s-border); }
.nav-tabs .nav-link {
  color: var(--s-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-weight: 600;
}
.nav-tabs .nav-link.active {
  color: var(--s-ink);
  border-bottom-color: var(--s-ink);
  background: transparent;
}

/* dropdowns */
.dropdown-menu {
  border-radius: var(--s-radius-sm);
  border: 1px solid var(--s-border);
  box-shadow: var(--s-shadow);
  padding: 6px;
}
.dropdown-item {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.dropdown-item:hover { background: var(--s-bg-soft); }

/* ---------- Legacy view polish ----------------------------------------
   Most existing Razor views use bare Bootstrap (h1/h3 titles, btn-group
   filter rails, card tiles with .display-6 numbers). These rules tune
   them to fit the new design language without touching the view markup. */

.s-main > main h1.h3,
.s-main > main h2.h3 { font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.s-main > main h1.h2 { font-size: 30px; font-weight: 700; letter-spacing: -.3px; }
.s-main > main .display-6 { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }

/* page-section breathing room */
.s-main > main > .row { row-gap: 16px; }
.s-main > main > .row + .row { margin-top: 8px; }

.text-success { color: var(--s-green) !important; }
.text-danger  { color: var(--s-red) !important; }
.text-info    { color: var(--s-blue) !important; }
.text-warning { color: var(--s-amber) !important; }

.bg-primary { background-color: var(--s-accent) !important; }

.btn-group .btn {
  border-radius: 8px;
  border-color: var(--s-border);
  background: var(--s-surface);
  color: var(--s-ink-soft);
}
.btn-group .btn:hover { background: var(--s-surface-2); color: var(--s-ink); }
.btn-group .btn.btn-secondary,
.btn-group .btn.btn-primary {
  background: var(--s-accent) !important;
  color: #fff !important;
  border-color: var(--s-accent) !important;
}
.btn-group > .btn + .btn { margin-left: 6px; }

.list-group-item { border-color: var(--s-border-soft); background: var(--s-surface); }

.shadow-sm { box-shadow: var(--s-shadow-sm) !important; }
.border-0 { border: 0 !important; }
.card.h-100 { display: flex; flex-direction: column; }

/* small responsive collapse for sidebar on narrow screens */
@media (max-width: 900px) {
  .s-app { grid-template-columns: 1fr; }
  .s-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 12px; padding: 16px; }
  .s-sidebar-foot { width: 100%; flex-direction: row; }
  .s-nav { flex-direction: row; flex-wrap: wrap; }
}

/* ==========================================================================
   Stat tile (.s-stat) — locked-dimension stat tile used by Manager Dashboard
   and other secondary pages. NOTE: This is intentionally separate from the
   richer .s-kpi tile (with icon + delta badge) used on the Operational
   Overview — that tile's design is preserved.
   ========================================================================== */
.s-stat {
  height: 110px;                /* every tile in a row matches */
  display: flex;
  flex-direction: column;
}
.s-stat .s-stat-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  text-align: center;
  gap: 4px;
  min-width: 0;
}
.s-stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--s-muted);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.s-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.3px;
  color: var(--s-ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.s-stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--s-muted);
  margin-left: 2px;
}

/* ==========================================================================
   VISUAL POLISH — applies to all forms/lists/cards across the admin panel
   ========================================================================== */

/* Page-content card — lift on hover, soft shadow, rounded */
.s-main > main .card {
  border: 1px solid var(--s-border) !important;
  border-radius: var(--s-radius) !important;
  background: var(--s-surface);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.s-main > main .card:hover {
  box-shadow: var(--s-shadow) !important;
  border-color: var(--s-muted-2) !important;
}
.s-main > main .card.no-lift:hover { transform: none; box-shadow: var(--s-shadow-sm) !important; }
.s-main > main .card-header {
  background: var(--s-surface-2);
  border-bottom: 1px solid var(--s-border-soft);
  font-weight: 600;
  padding: 14px 18px;
  border-top-left-radius: var(--s-radius);
  border-top-right-radius: var(--s-radius);
}
.s-main > main .card-body { padding: 18px; }
.s-main > main .card-footer {
  background: var(--s-surface-2);
  border-top: 1px solid var(--s-border-soft);
  padding: 12px 18px;
}

/* Forms — bigger touch targets, smooth focus, no jarring red borders */
.s-main > main .form-control,
.s-main > main .form-select {
  border: 1px solid var(--s-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--s-surface);
  color: var(--s-ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.s-main > main .form-control:focus,
.s-main > main .form-select:focus {
  border-color: var(--s-accent);
  box-shadow: 0 0 0 3px rgba(31, 41, 55, .12);
  background: var(--s-surface);
  outline: none;
}
.s-main > main .form-control::placeholder { color: var(--s-muted-2); }
.s-main > main .form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--s-ink);
  margin-bottom: 6px;
  letter-spacing: .1px;
}
.s-main > main .form-text { color: var(--s-muted); font-size: 12.5px; }
.s-main > main .input-group .input-group-text {
  background: var(--s-surface-2);
  border-color: var(--s-border);
  color: var(--s-muted);
}

/* Buttons — softer, larger, with lift */
.s-main > main .btn {
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .1px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.s-main > main .btn:active { transform: translateY(1px); }
.s-main > main .btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.s-main > main .btn-primary {
  background: var(--s-accent);
  border-color: var(--s-accent);
  color: var(--s-accent-ink);
}
.s-main > main .btn-primary:hover { background: #0F172A; border-color: #0F172A; box-shadow: 0 4px 12px rgba(15,23,42,.18); }
.s-main > main .btn-outline-secondary {
  border-color: var(--s-border);
  color: var(--s-ink-soft);
  background: var(--s-surface);
}
.s-main > main .btn-outline-secondary:hover {
  background: var(--s-surface-2);
  border-color: var(--s-muted-2);
  color: var(--s-ink);
}
.s-main > main .btn-outline-danger {
  border-color: var(--s-red-bg);
  color: var(--s-red);
  background: var(--s-red-soft-bg);
}
.s-main > main .btn-outline-danger:hover {
  background: var(--s-red);
  border-color: var(--s-red);
  color: #fff;
}
.s-main > main .btn-outline-success {
  border-color: var(--s-green-bg);
  color: var(--s-green);
  background: rgba(214, 241, 226, .35);
}
.s-main > main .btn-outline-success:hover {
  background: var(--s-green);
  border-color: var(--s-green);
  color: #fff;
}
.s-main > main .btn-outline-primary {
  border-color: var(--s-border);
  color: var(--s-accent);
  background: var(--s-surface);
}
.s-main > main .btn-outline-primary:hover {
  background: var(--s-accent);
  border-color: var(--s-accent);
  color: var(--s-accent-ink);
}

/* Tables — striped hover, sticky header, padded cells */
.s-main > main .table {
  --bs-table-bg: var(--s-surface);
  --bs-table-color: var(--s-ink);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.s-main > main .table thead th {
  background: var(--s-surface-2);
  color: var(--s-muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--s-border);
  padding: 12px 14px;
}
.s-main > main .table tbody td {
  padding: 12px 14px;
  border-top: 1px solid var(--s-border-soft);
  vertical-align: middle;
  color: var(--s-ink);
}
.s-main > main .table tbody tr {
  transition: background .12s ease;
}
.s-main > main .table tbody tr:hover { background: var(--s-surface-2); }
.s-main > main .table tbody tr:last-child td { border-bottom: 1px solid var(--s-border); }
.s-main > main .table-borderless tbody td,
.s-main > main .table-borderless thead th { border: 0 !important; }

/* Badges — softer pill style */
.s-main > main .badge {
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .2px;
}
.s-main > main .badge.text-bg-secondary { background: var(--s-accent-soft) !important; color: var(--s-ink) !important; }
.s-main > main .badge.text-bg-info { background: var(--s-blue-bg) !important; color: var(--s-blue) !important; }
.s-main > main .badge.text-bg-success { background: var(--s-green-bg) !important; color: var(--s-green) !important; }
.s-main > main .badge.text-bg-warning { background: var(--s-amber-bg) !important; color: var(--s-amber) !important; }
.s-main > main .badge.text-bg-danger { background: var(--s-red-bg) !important; color: var(--s-red) !important; }
.s-main > main .badge.text-bg-light { background: var(--s-surface-2) !important; color: var(--s-muted) !important; }

/* Alerts — softer pastel, accent left bar */
.s-main > main .alert {
  border-radius: 12px;
  border: 0;
  padding: 14px 18px 14px 22px;
  position: relative;
  font-size: 14px;
}
.s-main > main .alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: currentColor;
  opacity: .6;
}
.s-main > main .alert-info {
  background: var(--s-blue-bg);
  color: var(--s-blue);
}
.s-main > main .alert-success { background: var(--s-green-bg); color: var(--s-green); }
.s-main > main .alert-warning { background: var(--s-amber-bg); color: var(--s-amber); }
.s-main > main .alert-danger  { background: var(--s-red-bg); color: var(--s-red); }

/* Nav tabs — underline style instead of bordered boxes */
.s-main > main .nav-tabs {
  border-bottom: 1px solid var(--s-border);
  gap: 4px;
}
.s-main > main .nav-tabs .nav-link {
  border: 0;
  color: var(--s-muted);
  padding: 10px 16px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  background: transparent;
  border-radius: 0;
  transition: color .15s ease, border-color .15s ease;
}
.s-main > main .nav-tabs .nav-link:hover { color: var(--s-ink); }
.s-main > main .nav-tabs .nav-link.active {
  color: var(--s-ink);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--s-accent);
}

/* Modals — rounded, soft shadow */
.modal-content {
  border: 0;
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--s-border-soft); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--s-border-soft); padding: 14px 22px; }

/* Pagination — softer */
.s-main > main .pagination .page-link {
  border-color: var(--s-border);
  color: var(--s-ink-soft);
  border-radius: 8px;
  margin: 0 2px;
}
.s-main > main .pagination .page-item.active .page-link {
  background: var(--s-accent);
  border-color: var(--s-accent);
  color: var(--s-accent-ink);
}

/* Form check / switch */
.s-main > main .form-check-input:checked {
  background-color: var(--s-accent);
  border-color: var(--s-accent);
}
.s-main > main .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(31,41,55,.12);
  border-color: var(--s-accent);
}

/* Page H1 / H2 sizing */
.s-main > main h1,
.s-main > main .h1 { font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.s-main > main h2,
.s-main > main .h2 { font-size: 22px; font-weight: 700; }
.s-main > main h3,
.s-main > main .h3 { font-size: 19px; font-weight: 700; }

/* Empty state — used when lists return zero rows */
.s-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--s-border);
  border-radius: var(--s-radius);
  background: var(--s-surface-2);
  color: var(--s-muted);
}
.s-empty .s-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--s-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--s-muted-2);
  border: 1px solid var(--s-border);
}

/* Code chips inside body text */
.s-main > main code {
  background: var(--s-surface-2);
  color: var(--s-ink);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  border: 1px solid var(--s-border-soft);
}

/* Dropdown menu — rounded with shadow */
.dropdown-menu {
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius-sm);
  box-shadow: var(--s-shadow);
  padding: 6px;
  margin-top: 6px;
}
.dropdown-item {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--s-ink-soft);
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--s-surface-2);
  color: var(--s-ink);
}
.dropdown-divider { margin: 4px -2px; border-color: var(--s-border-soft); }

/* Auth pages (Login / Forgot / Reset / MFA) — center card */
body:not(:has(.s-app)) main.container { padding: 40px 16px; }
.s-auth-card {
  max-width: 580px;
  margin: 36px auto;
  background: var(--s-surface);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow);
  padding: 32px 40px;
}
.s-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.s-auth-brand-logo {
  width: 48px;
  height: 48px;
  background: var(--s-accent);
  color: #fff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.s-auth-brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.1px;
}
.s-auth-brand-sub {
  font-size: 10.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--s-muted);
  margin-top: 4px;
}

/* ---------- Auth-card form fields ------------------------------------ */
/* Taller, roomier inputs to match the reference proportions — colours
   stay as the global .form-control rule sets them; only size changes. */
.s-auth-card .form-control {
  padding: 14px 16px;
  border-radius: 12px;
}
/* The password field's show/hide button shares the input-group; round its
   outer corners to match the 12px inputs. */
.s-auth-card .input-group > .btn {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Leading icon inside a field (envelope / padlock) — matches the reference. */
.s-auth-card .s-input-icon { position: relative; }
.s-auth-card .s-input-icon > .s-input-icon-svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--s-muted);
  pointer-events: none;
  z-index: 6;
}
.s-auth-card .s-input-icon .form-control { padding-left: 44px; }

/* ---------- Auth-card primary action --------------------------------- */
/* The sign-in button — the bare Bootstrap .btn-primary rendered flat with
   6px corners while every input around it is 10px, which read as "off".
   Match the input radius, give it height + a subtle shadow and a hover
   lift. Background / hover colour still come from the global .btn-primary
   !important rule, so only shape and depth are tuned here. */
.s-auth-card .btn-primary {
  padding: 15px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .14);
  transition: box-shadow .15s ease, transform .04s ease;
}
.s-auth-card .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, .24);
}
.s-auth-card .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .2);
}
.s-auth-card .btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .22);
}

/* ==========================================================================
   Responsive layer  — added 2026-05-28
   ==========================================================================
   Breakpoints (mobile-first cascade):
     <= 767.98px → mobile  (sidebar becomes off-canvas drawer, body scrolls)
     768-1023.98 → tablet  (sidebar auto-collapsed to icon rail)
     >= 1024     → desktop (full sidebar — current behaviour)

   The desktop shell uses `html,body { height:100vh; overflow:hidden }` with
   `.s-main > main` providing the inner scroll. That pattern is great on a
   true desktop monitor but hostile on mobile (rubber-banding broken, no
   address-bar collapse, viewport-lock prevents pinch-zoom recovery). We
   un-lock at <=767 and let the page scroll naturally.
   ========================================================================== */

/* ---------- Mobile (≤767px) ----------------------------------------------- */
@media (max-width: 767.98px) {
    html, body {
        height: auto;
        overflow: visible;
        min-height: 100vh;
        min-height: 100dvh;            /* dvh = dynamic viewport height (no address-bar jump) */
        font-size: 16px;               /* iOS won't auto-zoom an <input> with 16px+ */
    }

    .s-app { display: block; height: auto; min-height: 100vh; min-height: 100dvh; }
    .s-app.collapsed { grid-template-columns: none; }    /* neutralise desktop rule */

    .s-sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        padding-top: 14px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .25);
        will-change: transform;
    }
    .s-app.drawer-open .s-sidebar { transform: translateX(0); }

    /* Sidebar collapse rules don't apply on mobile — always show full labels */
    .s-app.collapsed .s-label,
    .s-app.collapsed .s-brand-text,
    .s-app.collapsed .s-chevron { display: initial; }

    /* Scrim behind the drawer */
    .s-app::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        z-index: 900;
    }
    .s-app.drawer-open::before { opacity: 1; pointer-events: auto; }

    .s-main {
        min-width: 0;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .s-main > main { overflow: visible; height: auto; padding: 16px 14px 24px; }

    .s-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 10px 12px;
    }
    .s-topbar-title { font-size: 15px; }

    /* Hide the chunky "Reports" button on small screens — it's available
       from the side drawer instead. */
    .s-topbar .s-btn-soft { display: none; }

    .s-foot {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 14px 12px 22px;
    }
    .s-foot > div { text-align: center; }

    /* KPI grid: 1 column on phones. The existing media at 720 already does 2;
       this overrides it for true small screens to keep cards readable. */
    .s-kpi-grid { grid-template-columns: 1fr; }

    /* Cards: tighter radius on small screens */
    .card { border-radius: var(--s-radius-sm); }

    /* Tables on mobile — let them scroll horizontally without breaking the page */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.table th, table.table td { white-space: nowrap; }
}

/* ---------- Tablet (768–1023px) ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .s-app:not(.user-expanded) { grid-template-columns: 72px 1fr; }
    .s-app:not(.user-expanded) .s-label,
    .s-app:not(.user-expanded) .s-brand-text,
    .s-app:not(.user-expanded) .s-chevron { display: none; }
    .s-app:not(.user-expanded) .s-sidebar { align-items: center; }
}

/* ---------- Larger touch targets on coarse pointers ----------------------- */
@media (hover: none) and (pointer: coarse) {
    .btn-sm, .s-nav-link, .s-icon-btn, .s-topbar-toggle, .s-logout-btn {
        min-height: 44px;
    }
    .form-control, .form-select { min-height: 44px; }
}

/* ---------- Tabular numerics for data tables ------------------------------ */
.table td, .table th,
.s-kpi-value, .s-stat-num, code, .small.text-muted {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ---------- Accessibility: visible keyboard focus everywhere -------------- */
:focus-visible {
    outline: 2px solid var(--s-accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 41, 55, .22);
}

/* ---------- Reduced motion ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Polish layer — added 2026-05-28
   ==========================================================================
   Global, low-risk refinements. No per-page changes; the design tokens
   in :root + the existing class structure do all the lifting.
   ========================================================================== */

/* ---------- Brand-tinted text selection ---------------------------------- */
::selection      { background: rgba(31, 41, 55, .18); color: var(--s-ink); }
::-moz-selection { background: rgba(31, 41, 55, .18); color: var(--s-ink); }

/* ---------- Card hover lift (only on interactive cards) ------------------ */
.card.s-card-interactive {
    transition: box-shadow .18s ease, transform .18s ease;
    cursor: pointer;
}
.card.s-card-interactive:hover {
    box-shadow: var(--s-shadow-lg);
    transform: translateY(-1px);
}
.card.s-card-interactive:active { transform: translateY(0); }

/* ---------- Sticky table headers for long lists -------------------------- */
.table-responsive { max-height: none; }
.table > thead.table-light th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--s-bg-soft);
    border-bottom: 1px solid var(--s-border);
}

/* ---------- Button: tactile press + loading state ------------------------ */
.btn { transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease; }
.btn:active:not(:disabled):not(.disabled) { transform: translateY(1px); }
.btn[aria-busy="true"] {
    pointer-events: none;
    opacity: .75;
    position: relative;
}
.btn[aria-busy="true"]::after {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: s-spin .7s linear infinite;
    vertical-align: -3px;
}
@keyframes s-spin { to { transform: rotate(360deg); } }

/* ---------- Form input: cleaner focus + error state ---------------------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--s-ink);
    box-shadow: 0 0 0 3px rgba(31, 41, 55, .12);
}
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--s-red);
    background-image: none;
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--s-red);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .18);
}
.invalid-feedback { color: var(--s-red); }

/* ---------- Better link affordance --------------------------------------- */
a:not(.btn):not(.s-nav-link):not(.s-brand):not(.s-avatar):not(.dropdown-item) {
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
a:not(.btn):not(.s-nav-link):not(.s-brand):not(.s-avatar):hover {
    text-decoration: underline;
}

/* ---------- Badges: keep them readable at small sizes -------------------- */
.badge {
    font-weight: 500;
    letter-spacing: .01em;
    padding: 0.35em 0.6em;
}

/* ---------- Scrollbars: brand-tinted on Webkit + Firefox ----------------- */
* { scrollbar-color: rgba(31, 41, 55, .22) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar           { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb     { background: rgba(31, 41, 55, .18); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(31, 41, 55, .32); }
*::-webkit-scrollbar-track     { background: transparent; }

/* ---------- Empty state primitive ---------------------------------------- */
.s-empty {
    text-align: center;
    padding: 36px 18px;
    color: var(--s-muted);
}
.s-empty .s-empty-title { color: var(--s-ink); font-weight: 600; margin-bottom: 4px; }
.s-empty .s-empty-sub { font-size: .92em; }

/* ---------- Skeleton loader (use class="s-skel" on a block) -------------- */
.s-skel {
    background: linear-gradient(90deg, var(--s-bg-soft) 0%, var(--s-surface-2) 50%, var(--s-bg-soft) 100%);
    background-size: 200% 100%;
    animation: s-skel-pulse 1.4s ease-in-out infinite;
    border-radius: var(--s-radius-sm);
    min-height: 14px;
}
@keyframes s-skel-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Print styles: hide chrome, keep content ---------------------- */
@media print {
    .s-sidebar, .s-topbar, .s-foot, .s-app::before { display: none !important; }
    .s-app { display: block; }
    .s-main { display: block; }
    .s-main > main { overflow: visible; height: auto; padding: 0; }
    .card { box-shadow: none !important; border: 1px solid var(--s-border) !important; }
    @page { margin: 18mm; }
}

/* ==========================================================================
   Login & auth-card refresh  - added 2026-05-28
   ==========================================================================
   Aesthetic direction: refined editorial / executive protocol. Builds on
   the existing warm-cream + slate-ink palette; preserves the .s-auth-*
   markup contract. Pure additive - no existing rules removed; the cascade
   means the rules below override the earlier .s-auth-card / brand-logo /
   btn-primary blocks.

   Pillars:
     1) Atmosphere - radial gradient mesh + dot texture on the page
     2) Depth - layered shadows on the card, gradient on the brand badge
     3) Hierarchy - display-scale headline with editorial tracking
     4) Motion - gentle staggered entrance on load (respects reduced-motion)
   ========================================================================== */

/* 1. Page background - atmosphere via radial-mesh + dot texture --------- */
.s-auth-main {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(900px 500px at 8% -8%, rgba(31, 41, 55, .07), transparent 60%),
        radial-gradient(720px 420px at 100% 108%, rgba(180, 83, 9, .055), transparent 60%),
        var(--s-bg);
}
.s-auth-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 30%, rgba(31, 41, 55, .045) 1px, transparent 1.5px),
        radial-gradient(circle at 70% 70%, rgba(31, 41, 55, .03) 1px, transparent 1.5px);
    background-size: 80px 80px, 120px 120px;
    background-position: 0 0, 40px 40px;
    pointer-events: none;
    z-index: 0;
    opacity: .8;
}
.s-auth-main > .s-auth-card { position: relative; z-index: 1; }

/* 2. The card itself - layered depth + refined geometry ----------------- */
.s-auth-card {
    max-width: 460px;
    padding: 40px 44px 36px;
    border-radius: 18px;
    border: 1px solid var(--s-border);
    background: var(--s-surface);
    box-shadow:
        0 1px 1px rgba(15, 23, 42, .04),
        0 8px 22px rgba(15, 23, 42, .06),
        0 36px 64px -28px rgba(15, 23, 42, .18);
    animation: s-auth-card-in .55s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes s-auth-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 3. Brand badge - gradient ink + inner highlight + hover lift ---------- */
.s-auth-card .s-auth-brand { margin-bottom: 28px; }
.s-auth-card .s-auth-brand-logo {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #1F2937 0%, #0F172A 100%);
    border-radius: 14px;
    box-shadow:
        0 4px 12px rgba(15, 23, 42, .22),
        inset 0 1px 0 rgba(255, 255, 255, .10);
    transition: transform .28s cubic-bezier(.2, .7, .2, 1), box-shadow .28s ease;
}
.s-auth-card .s-auth-brand-logo:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, .30),
        inset 0 1px 0 rgba(255, 255, 255, .14);
}
.s-auth-card .s-auth-brand-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
}
.s-auth-card .s-auth-brand-sub {
    font-size: 10px;
    letter-spacing: 1.6px;
    margin-top: 3px;
    color: var(--s-muted);
}

/* 4. Headline + subtitle - editorial scale ------------------------------ */
.s-auth-card h1,
.s-auth-card .h4 {
    font-size: 28px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.6px;
    margin-bottom: 6px;
    color: var(--s-ink);
}
.s-auth-card > p.text-muted {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 26px;
    color: var(--s-ink-soft);
}

/* 5. Inputs - softer rest state, deeper focus glow ---------------------- */
.s-auth-card .form-label {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--s-ink-soft);
}
.s-auth-card .form-control {
    background: var(--s-surface-2);
    border: 1px solid var(--s-border-soft);
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 12px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.s-auth-card .form-control::placeholder { color: var(--s-muted-2); }
.s-auth-card .form-control:hover { border-color: var(--s-border); }
.s-auth-card .form-control:focus {
    background: var(--s-surface);
    border-color: var(--s-ink);
    box-shadow: 0 0 0 4px rgba(31, 41, 55, .10);
    outline: none;
}
.s-auth-card .s-input-icon > .s-input-icon-svg { color: var(--s-muted); }
.s-auth-card .s-input-icon:focus-within > .s-input-icon-svg { color: var(--s-ink); }

/* "Forgot?" link - subtle, refined */
.s-auth-card a[href*="ForgotPassword"] {
    color: var(--s-ink-soft);
    font-size: 13px;
    font-weight: 500;
    transition: color .15s ease;
}
.s-auth-card a[href*="ForgotPassword"]:hover { color: var(--s-ink); text-decoration: underline; }

/* 6. Sign-in button - vertical gradient, deeper feel -------------------- */
.s-auth-card .btn-primary,
.s-auth-card input[type="submit"].btn-primary {
    background: linear-gradient(180deg, #1F2937 0%, #0F172A 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: .25px;
    padding: 15px 16px;
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .18),
        inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: box-shadow .18s ease, transform .08s ease, filter .18s ease;
    margin-top: 10px;
}
.s-auth-card .btn-primary:hover {
    box-shadow:
        0 10px 22px rgba(15, 23, 42, .28),
        inset 0 1px 0 rgba(255, 255, 255, .10);
    filter: brightness(1.05);
}
.s-auth-card .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
    filter: brightness(.98);
}

/* 7. Error alert - restrained, no coral --------------------------------- */
.s-auth-card .alert-danger {
    background: #FCF1ED;
    border: 1px solid rgba(185, 28, 28, .22);
    border-left: 3px solid var(--s-red);
    border-radius: 10px;
    color: #7F1D1D;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    box-shadow: 0 1px 0 rgba(185, 28, 28, .04);
}
.s-auth-card .alert-danger > div + div { margin-top: 4px; }

/* 8. Footer signoff - calm, confident ------------------------------------ */
.s-auth-card > div:last-child {
    margin-top: 28px !important;
    padding-top: 18px !important;
    border-top: 1px solid var(--s-border-soft);
}
.s-auth-card > div:last-child p {
    color: var(--s-muted-2);
    font-size: 11.5px;
    letter-spacing: .35px;
    margin: 0;
}

/* 9. Staggered entrance - content cascades after the card lands --------- */
.s-auth-card > .s-auth-brand,
.s-auth-card > h1,
.s-auth-card > .h4,
.s-auth-card > p,
.s-auth-card > .alert,
.s-auth-card > .mb-3,
.s-auth-card > input[type="submit"],
.s-auth-card > .btn-primary,
.s-auth-card > div:last-child {
    opacity: 0;
    animation: s-auth-in .5s ease both;
}
.s-auth-card > .s-auth-brand        { animation-delay: .08s; }
.s-auth-card > h1,
.s-auth-card > .h4                  { animation-delay: .14s; }
.s-auth-card > p                    { animation-delay: .18s; }
.s-auth-card > .alert               { animation-delay: .22s; }
.s-auth-card > .mb-3                { animation-delay: .26s; }
.s-auth-card > .mb-3 ~ .mb-3        { animation-delay: .32s; }
.s-auth-card > input[type="submit"],
.s-auth-card > .btn-primary         { animation-delay: .38s; }
.s-auth-card > div:last-child       { animation-delay: .46s; }
@keyframes s-auth-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 10. Mobile tweaks - keep proportions on small screens ----------------- */
@media (max-width: 480px) {
    .s-auth-card {
        padding: 28px 22px 24px;
        border-radius: 16px;
        margin: 16px;
    }
    .s-auth-card h1,
    .s-auth-card .h4 { font-size: 24px; }
    .s-auth-main::before { background-size: 60px 60px, 90px 90px; }
}

/* 11. Reduced motion - disable all the entrance choreography ------------ */
@media (prefers-reduced-motion: reduce) {
    .s-auth-card,
    .s-auth-card > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
