/* ==========================================================================
   ACME Admin — Stylesheet
   Single-file, hand-authored CSS. No build step required.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Type */
  --font-sans: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  /* Spacing — 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Layout */
  --sidebar-w: 280px;
  --header-h: 56px;

  /* Light palette (default) */
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-surface-2: #f0f2f5;
  --c-border: #e3e6ea;
  --c-border-strong: #cdd2d8;
  --c-text: #1c1f24;
  --c-text-soft: #5a6270;
  --c-text-mute: #8b93a0;

  --c-primary: #2d5bd6;
  --c-primary-soft: #e6edfb;
  --c-primary-text: #ffffff;

  --c-success: #1e9e6a;
  --c-success-soft: #e2f5ec;
  --c-warning: #c87b00;
  --c-warning-soft: #fbf0d8;
  --c-error: #c8362b;
  --c-error-soft: #fbe6e3;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] {
  --c-bg: #0e1014;
  --c-surface: #161a20;
  --c-surface-2: #1d222a;
  --c-border: #262c36;
  --c-border-strong: #353c48;
  --c-text: #e6e9ee;
  --c-text-soft: #a4abb6;
  --c-text-mute: #6b7280;

  --c-primary: #6b8df0;
  --c-primary-soft: #1c2742;
  --c-primary-text: #0e1014;

  --c-success: #45c08c;
  --c-success-soft: #14352a;
  --c-warning: #e6a437;
  --c-warning-soft: #3a2a10;
  --c-error: #e26a60;
  --c-error-soft: #3a1a16;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--c-text); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--s-3); }

small { font-size: var(--fs-xs); color: var(--c-text-mute); }

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: var(--s-5) 0;
}

img { max-width: 100%; display: block; }

::selection { background: var(--c-primary-soft); color: var(--c-text); }

/* --------------------------------------------------------------------------
   3. Layout: shell, sidebar, header, main
   -------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar ---------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebarBrand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--header-h);
  padding: 0 var(--s-5);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--c-text);
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.sidebarBrand .brandMark {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--c-primary);
  color: var(--c-primary-text);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--fs-sm);
}
.sidebarBrand .brandSub { color: var(--c-text-mute); font-weight: 500; }

.sidebarNav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-4) var(--s-3);
}

.navGroup { margin-bottom: var(--s-5); }
.navGroupLabel {
  display: block;
  text-transform: uppercase;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: var(--c-text-mute);
  font-weight: 600;
  padding: 0 var(--s-3) var(--s-2);
}

.navItem {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 7px var(--s-3);
  margin: 1px 0;
  border-radius: var(--r-md);
  color: var(--c-text-soft);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.navItem:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.navItem.isActive {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}
[data-theme="dark"] .navItem.isActive { color: #c4d2f6; }
.navItem .navIcon {
  width: 16px;
  flex: 0 0 16px;
  display: inline-flex; justify-content: center;
  font-size: var(--fs-sm);
  color: inherit;
}
.navItem .navArrow {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}
.navSub {
  padding-left: var(--s-6);
  display: none;
}
.navGroup.isOpen .navSub { display: block; }
.navGroup.isOpen > .navItem .navArrow { transform: rotate(90deg); }

.sidebarFoot {
  flex: 0 0 auto;
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.sidebarFoot .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-surface-2);
  display: grid; place-items: center;
  font-weight: 600;
  color: var(--c-text-soft);
  font-size: var(--fs-sm);
}
.sidebarFoot .meta { display: flex; align-items: center; line-height: 1.3; min-width: 0; flex: 1; }
.sidebarFoot .meta strong { font-size: var(--fs-md); color: var(--c-text); }
.sidebarFoot .meta .unselectUser {
  padding-left: var(--s-3);
  color: var(--c-text-soft);
  cursor: pointer;
}
.sidebarFoot .meta .unselectUser:hover { color: var(--c-text); }

/* Header ----------------------------------------------------------------- */
.shell { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-6);
}
.topbar .menuToggle { margin-right: auto; }

.topbar .crumbs {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--c-text-mute);
}
.topbar .crumbs .sep { color: var(--c-border-strong); }
.topbar .crumbs .now { color: var(--c-text); font-weight: 500; }

.topbar #topMenu a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar .search {
  position: relative;
  width: 280px;
  min-width: 240px;
  max-width: 35vw;
}
.topbar .search:empty { display: none; }
.topbar .search form { display: flex; gap: var(--s-2); }
.topbar .search input {
  width: 100%;
  height: 28px;
  padding: 0 var(--s-3) 0 32px;
  background: var(--c-surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  outline: none;
}
.topbar .search input:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
}
.topbar .search .icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
}

.topbar .actions { display: flex; align-items: center; gap: var(--s-2); }

.iconBtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-text-soft);
  cursor: pointer;
  font-size: var(--fs-md);
}
.iconBtn:hover { background: var(--c-surface-2); color: var(--c-text); }
.iconBtn.isActive { background: var(--c-surface-2); color: var(--c-text); }

/* Main ------------------------------------------------------------------- */
main#mainContent {
  flex: 1;
  padding: var(--s-6) var(--s-8);
  min-width: 0;
}
.row.rowPageHead {
  align-items: flex-end;
  justify-content: space-between;
}
.row.rowPageHead h1 {
  font-size: var(--fs-2xl);
  margin-bottom: 0;
  letter-spacing: -0.01em;
}
.row.rowPageHead p { color: var(--c-text-soft); margin: 0; font-size: var(--fs-sm); }
.row.rowPageHead .actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.footerNote {
  padding: var(--s-3) var(--s-8);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-mute);
  font-size: var(--fs-md);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--c-surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btnPrimary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-primary-text);
}
.btnPrimary:hover { background: color-mix(in srgb, var(--c-primary) 88%, #000); border-color: color-mix(in srgb, var(--c-primary) 88%, #000); }

.btnDanger {
  background: var(--c-error);
  border-color: var(--c-error);
  color: #fff;
}
.btnDanger:hover { background: color-mix(in srgb, var(--c-error) 88%, #000); border-color: color-mix(in srgb, var(--c-error) 88%, #000); }

.btnGhost {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-soft);
}
.btnGhost:hover { background: var(--c-surface-2); color: var(--c-text); }

.btnSm { height: 28px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btnXs { height: 24px; padding: 0 var(--s-2); font-size: var(--fs-xs); border-radius: var(--r-sm); }

.btnGroup { display: inline-flex; gap: var(--s-2); flex-wrap: wrap; }

.btn .icon { font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: var(--s-5); }
.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}
@media (max-width: 720px) { .formGrid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.colSpan2 { grid-column: 1 / -1; }
.field > label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
}
.field > .hint {
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}
.field.isError > label { color: var(--c-error); }
.field.isError .input,
.field.isError .textarea,
.field.isError .select {
  border-color: var(--c-error);
}
.fieldError {
  font-size: var(--fs-xs);
  color: var(--c-error);
}

.input, .textarea, .select {
  width: 100%;
  height: 36px;
  padding: 0 var(--s-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea { height: auto; padding: var(--s-3); min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-soft) 50%),
                    linear-gradient(135deg, var(--c-text-soft) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-mute); }
.input[readonly] { background: var(--c-surface-2); color: var(--c-text-soft); }
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--c-surface-2);
  color: var(--c-text-soft);
  cursor: default;
}

/* checkbox / radio */
.check, .radio {
  display: inline-flex; align-items: center; gap: var(--s-2);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.check input, .radio input { width: 16px; height: 16px; accent-color: var(--c-primary); }

/* form footer */
.formActions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-start;
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border);
}
.formActions.end { justify-content: flex-end; }

/* inline form (search) */
.formInline {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  flex-wrap: wrap;
}
.formInline .input, .formInline .select { width: auto; min-width: 200px; }

/* --------------------------------------------------------------------------
   6. Cards / panels
   -------------------------------------------------------------------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.cardHead {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.cardHead h3 { font-size: var(--fs-lg); }
.cardHead .sub { font-size: var(--fs-xs); color: var(--c-text-mute); }
.cardBody { padding: var(--s-5); }
.terminalFrame {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 480px;
  border-radius: var(--r-lg);
  background: #000;
  overflow: hidden;
}
.terminalFrame .termStatus {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 4px 12px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c8c8c8; background: rgba(20, 20, 20, 0.85);
  border-bottom: 1px solid #333;
}
.cardFoot {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

/* stat card */
.statGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
@media (max-width: 1100px) { .statGrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .statGrid { grid-template-columns: 1fr; } }

.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat .label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-mute);
  font-weight: 600;
}
.stat .value {
  font-size: var(--fs-3xl);
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .delta {
  font-size: var(--fs-xs);
  color: var(--c-text-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat .delta.up { color: var(--c-success); }
.stat .delta.down { color: var(--c-error); }

/* --------------------------------------------------------------------------
   7. Tables
   -------------------------------------------------------------------------- */
.tableWrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tableWrap .tableToolbar {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.tableWrap .tableToolbar .input,
.tableWrap .tableToolbar .select { width: auto; min-width: 200px; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.table th, table.table td {
  text-align: left;
  padding: 10px var(--s-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
table.table thead th {
  background: var(--c-surface-2);
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--c-border);
}
table.table tbody th { width: 1px; white-space: nowrap; }

@keyframes copiedFlash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
.copiedFlash {
  display: inline-block;
  animation: copiedFlash 1300ms ease-out forwards;
}
@keyframes iconFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.iconFadeIn {
  animation: iconFadeIn 300ms ease-in;
}
table.table tbody tr:hover { background: var(--c-surface-2); }
table.table .right { text-align: right; }
table.table .num { font-variant-numeric: tabular-nums; }
table.table .mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
table.table .muted { color: var(--c-text-mute); }
table.table .rowActions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 720px) {
  table.table .cellDescription, table.table .cellLastSeen { display: none; }
  table.table th, table.table td { padding-left: var(--s-2); padding-right: var(--s-2); }
  .topbar #topMenu { font-size: var(--fs-xs); }
}

/* table empty placeholder */
.tableEmpty {
  padding: var(--s-10);
  text-align: center;
  color: var(--c-text-mute);
}

/* --------------------------------------------------------------------------
   8. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
  flex-wrap: wrap;
}
.pagination .pages {
  display: inline-flex;
  gap: 2px;
}
.pagination .pages a {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 var(--s-2);
  border-radius: var(--r-sm);
  color: var(--c-text-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.pagination .pages a:hover { background: var(--c-surface-2); color: var(--c-text); }
.pagination .pages a.isActive {
  background: var(--c-primary);
  color: var(--c-primary-text);
}

/* --------------------------------------------------------------------------
   9. Badges, alerts
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--c-surface-2);
  color: var(--c-text-soft);
  white-space: nowrap;
}
.badge.isSuccess { background: var(--c-success-soft); color: var(--c-success); }
.badge.isWarning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge.isError   { background: var(--c-error-soft);   color: var(--c-error); }
.badge.isPrimary { background: var(--c-primary-soft); color: var(--c-primary); }
[data-theme="dark"] .badge.isPrimary { color: #b6c5ee; }
.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.alert {
  position: relative;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  padding-right: var(--s-8);
  background: var(--c-surface);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--c-text);
}
.alert .icon { font-size: var(--fs-md); margin-top: 1px; }
.alert .buttonClose {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  border-radius: var(--r-sm);
}
.alert .buttonClose:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.alert.isSuccess { background: var(--c-success-soft); border-color: transparent; color: var(--c-success); }
.alert.isWarning { background: var(--c-warning-soft); border-color: transparent; color: var(--c-warning); }
.alert.isError   { background: var(--c-error-soft); border-color: transparent; color: var(--c-error); }
.alert.isInfo    { background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary); }
[data-theme="dark"] .alert.isInfo { color: #b6c5ee; }

/* --------------------------------------------------------------------------
   10. Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--s-5);
}
.tabs a {
  padding: 10px var(--s-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
}
.tabs a:hover { color: var(--c-text); text-decoration: none; }
.tabs a.isActive {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

/* --------------------------------------------------------------------------
   11. Auth (login) layout
   -------------------------------------------------------------------------- */
.authShell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-bg);
}
@media (max-width: 920px) { .authShell { grid-template-columns: 1fr; } }

.authAside {
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--c-primary) 30%, transparent), transparent 60%),
    radial-gradient(circle at 80% 75%, color-mix(in srgb, var(--c-primary) 20%, transparent), transparent 55%),
    var(--c-surface);
  padding: var(--s-12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--c-border);
}
@media (max-width: 920px) { .authAside { display: none; } }

.authAside .brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--fs-xl);
}
.authAside h2 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
  max-width: 22ch;
  line-height: 1.15;
}
.authAside p { color: var(--c-text-soft); max-width: 38ch; font-size: var(--fs-md); }
.authAside .quote {
  border-left: 2px solid var(--c-primary);
  padding-left: var(--s-3);
  font-size: var(--fs-md);
  color: var(--c-text);
}

.authMain {
  display: grid;
  place-items: center;
  padding: var(--s-8);
}
.authCard {
  width: 100%;
  max-width: 380px;
}
.authCard h1 { font-size: var(--fs-2xl); margin-bottom: 4px; letter-spacing: -0.01em; }
.authCard .lede { color: var(--c-text-soft); margin-bottom: var(--s-6); font-size: var(--fs-sm); }
.authCard .form { gap: var(--s-3); }
.authCard .row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm);
}
.authCard .btnPrimary { width: 100%; height: 40px; }
.authCard .foot { margin-top: var(--s-5); text-align: center; color: var(--c-text-mute); font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   12. Utilities
   -------------------------------------------------------------------------- */
.row {
  display: flex;
  flex-wrap: wrap;
  row-gap: var(--s-4);
  margin-left: calc(-0.5 * var(--s-4));
  margin-right: calc(-0.5 * var(--s-4));
}
.row > * {
  padding-left: calc(0.5 * var(--s-4));
  padding-right: calc(0.5 * var(--s-4));
}
.row + .row { margin-top: var(--s-4); }
.row.between { justify-content: space-between; }
.col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.col1  { flex: 0 0 auto; width: 8.3333%; }
.col2  { flex: 0 0 auto; width: 16.6666%; }
.col3  { flex: 0 0 auto; width: 25%; }
.col4  { flex: 0 0 auto; width: 33.3333%; }
.col5  { flex: 0 0 auto; width: 41.6666%; }
.col6  { flex: 0 0 auto; width: 50%; }
.col7  { flex: 0 0 auto; width: 58.3333%; }
.col8  { flex: 0 0 auto; width: 66.6666%; }
.col9  { flex: 0 0 auto; width: 75%; }
.col10 { flex: 0 0 auto; width: 83.3333%; }
.col11 { flex: 0 0 auto; width: 91.6666%; }
.col12 { flex: 0 0 auto; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.flex.gap2 { gap: var(--s-2); }
.flex.gap3 { gap: var(--s-3); }
.flex.center { align-items: center; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.muted { color: var(--c-text-mute); }
.soft { color: var(--c-text-soft); }
.right { text-align: right; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt0 { margin-top: 0; }
.mt2 { margin-top: var(--s-2); }
.mt3 { margin-top: var(--s-3); }
.mt4 { margin-top: var(--s-4); }
.mt5 { margin-top: var(--s-5); }
.mt6 { margin-top: var(--s-6); }
.mb2 { margin-bottom: var(--s-2); }
.mb3 { margin-bottom: var(--s-3); }
.mb4 { margin-bottom: var(--s-4); }
.mb5 { margin-bottom: var(--s-5); }
.mb6 { margin-bottom: var(--s-6); }

/* --------------------------------------------------------------------------
   13. Responsive collapse
   -------------------------------------------------------------------------- */
.topbar .menuToggle { display: none; font-size: var(--fs-xl); width: auto; padding: 0 var(--s-3); }
.sidebarClose { display: none; margin-left: auto; font-size: var(--fs-xl); }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 30;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.18s ease-out;
  }
  .app.isOpen .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .topbar { padding-left: var(--s-4); padding-right: var(--s-4); }
  main#mainContent { padding: var(--s-5); }
  .topbar .menuToggle { display: grid; }
  .sidebarClose { display: grid; }
}

/* Scrollbar tweaks */
.sidebarNav::-webkit-scrollbar { width: 6px; }
.sidebarNav::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 6px; }
