/* Enterprise Base — design system
   Modern work-OS look: compact professional density, floating rounded panels,
   soft layered shadows, tinted pill statuses, subtle motion.
   Scale: 13px body · 32px controls · 40px rows · radii 8 / 12 / 16 / pill. */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/figtree.woff2") format("woff2");
}

:root {
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --canvas: #EEF1F7;
  --surface: #FFFFFF;
  --fill: #F5F6FA;
  --fill-hover: #EBEDF3;
  --selected: #E8F1FF;
  --text: #1F2033;
  --text-2: #4A4C5E;
  --text-3: #6E7183;
  --border: #E6E8EF;
  --border-2: #D3D6E0;

  --accent: #0A6CFF;
  --accent-hover: #005AE0;
  --accent-text: #0058D6;
  --accent-soft: #EAF2FF;
  --on-accent: #FFFFFF;

  --green: #00B76A;  --green-soft: #E6F8EF;  --green-ink: #0A7A4B;
  --orange: #F59E0B; --orange-soft: #FFF4E0; --orange-ink: #A15C00;
  --red: #E5484D;    --red-soft: #FDECEC;    --red-ink: #C02D33;
  --purple: #8B5CF6; --purple-soft: #F1ECFE; --purple-ink: #6D3FD9;
  --grey: #8A8FA3;   --grey-soft: #F0F1F5;   --grey-ink: #555A6E;

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.06), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-md: 0 4px 12px rgb(16 24 40 / 0.08), 0 2px 4px rgb(16 24 40 / 0.04);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / 0.14), 0 4px 8px rgb(16 24 40 / 0.06);
  --ring: 0 0 0 3px rgb(10 108 255 / 0.18);

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

  --topbar-h: 52px;
  --sidebar-w: 228px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0E1020; --surface: #171A2E; --fill: #1E2238; --fill-hover: #262A44; --selected: #17284A;
  --text: #ECEEF6; --text-2: #C3C6D6; --text-3: #8F93A8; --border: #262A42; --border-2: #343957;
  --accent: #3D8BFF; --accent-hover: #5C9DFF; --accent-text: #7CB0FF; --accent-soft: #17284A;
  --green-soft: #0F2E23; --green-ink: #4ADE9B; --orange-soft: #33270F; --orange-ink: #FBBF4A;
  --red-soft: #3A1619; --red-ink: #FF8A8E; --purple-soft: #261C44; --purple-ink: #B79BFF;
  --grey-soft: #23263D; --grey-ink: #A9ADC0;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.3); --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.35);
  --shadow-md: 0 6px 16px rgb(0 0 0 / 0.4); --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.5);
  --ring: 0 0 0 3px rgb(61 139 255 / 0.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E1020; --surface: #171A2E; --fill: #1E2238; --fill-hover: #262A44; --selected: #17284A;
    --text: #ECEEF6; --text-2: #C3C6D6; --text-3: #8F93A8; --border: #262A42; --border-2: #343957;
    --accent: #3D8BFF; --accent-hover: #5C9DFF; --accent-text: #7CB0FF; --accent-soft: #17284A;
    --green-soft: #0F2E23; --green-ink: #4ADE9B; --orange-soft: #33270F; --orange-ink: #FBBF4A;
    --red-soft: #3A1619; --red-ink: #FF8A8E; --purple-soft: #261C44; --purple-ink: #B79BFF;
    --grey-soft: #23263D; --grey-ink: #A9ADC0;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.3); --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.35);
    --shadow-md: 0 6px 16px rgb(0 0 0 / 0.4); --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.5);
    --ring: 0 0 0 3px rgb(61 139 255 / 0.3);
    color-scheme: dark;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 13px/1.5 var(--font);
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a, button, summary, label.check, [data-action], [data-copy] { cursor: pointer; }
code { font: 11.5px/1.4 var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.icon { width: 16px; height: 16px; flex: none; }
.muted { color: var(--text-3); }

/* ───────── Frame ───────── */
.app-body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

.topbar {
  flex: none; position: relative; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 12px 0 16px;
}
.brand { display: flex; align-items: center; gap: 8px; width: calc(var(--sidebar-w) - 8px); color: var(--text); font-weight: 600; font-size: 14px; }
.brand:hover { text-decoration: none; }
.logo {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #5B5BF6 0%, #0A6CFF 100%); color: #FFFFFF;
  box-shadow: 0 2px 6px rgb(10 108 255 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.logo .icon { width: 15px; height: 15px; stroke-width: 2; }

.search {
  display: flex; align-items: center; gap: 8px;
  width: min(380px, 36vw); height: 32px; padding: 0 6px 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-3); box-shadow: var(--shadow-xs);
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease), width 300ms var(--ease-out);
}
.search .icon { width: 15px; height: 15px; }
.search:hover { border-color: var(--border-2); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); width: min(460px, 42vw); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; cursor: text; }
.search input::placeholder { color: var(--text-3); }
.search kbd {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  font: 600 10.5px var(--font); color: var(--text-3); background: var(--fill); border-radius: 6px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.topbar-divider { width: 1px; height: 20px; margin: 0 8px; background: var(--border-2); }
.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-2);
  transition: background 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.icon-btn:hover { background: var(--fill-hover); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 17px; height: 17px; }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: contents; }
:root[data-theme="dark"] .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-dark { display: contents; }
  :root:not([data-theme="light"]) .when-light { display: none; }
}

[data-tip]::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%;
  translate: -50% -3px; padding: 4px 8px; border-radius: var(--r-sm);
  background: #1F2033; color: #FFFFFF; font: 500 11.5px var(--font); white-space: nowrap;
  opacity: 0; pointer-events: none; box-shadow: var(--shadow-md);
  transition: opacity 150ms var(--ease), translate 150ms var(--ease);
}
[data-tip]:hover::after { opacity: 1; translate: -50% 0; transition-delay: 350ms; }

.avatar {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, #F472B6 0%, #8B5CF6 100%); color: #FFFFFF;
  transition: box-shadow 150ms var(--ease);
}
summary.avatar:hover { box-shadow: 0 0 0 3px var(--fill-hover); }
.menu[open] summary.avatar { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.avatar-lg { width: 36px; height: 36px; font-size: 13px; }

.workspace { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 0 8px 8px; }

.sidebar {
  flex: none; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 10px 8px 8px;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  transition: transform 300ms var(--ease-out);
}
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-heading { padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.nav-link {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.nav-icon { display: grid; place-items: center; color: var(--text-3); transition: color 150ms var(--ease); }
.nav-icon .icon { width: 16px; height: 16px; }
.nav-link:hover { background: var(--fill); color: var(--text); text-decoration: none; }
.nav-link:hover .nav-icon { color: var(--text-2); }
.nav-link[aria-current="page"] { background: var(--selected); color: var(--accent-text); font-weight: 600; }
.nav-link[aria-current="page"] .nav-icon { color: var(--accent); }

.status {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md); color: var(--text-2);
  transition: background 150ms var(--ease);
}
.status:hover { background: var(--fill); text-decoration: none; }
.status-dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--grey); }
.status[data-state="ok"] .status-dot { background: var(--green); }
.status[data-state="down"] .status-dot { background: var(--orange); }
.status[data-state="ok"] .status-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2.6); opacity: 0; } }
.status-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.status-label { font-size: 12px; font-weight: 600; color: var(--text); }
.status-meta { font-size: 11px; color: var(--text-3); }

.panel {
  flex: 1; min-width: 0; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  padding: 16px 28px 48px;
}
.panel > * { animation: rise 320ms var(--ease-out) both; }
.panel > .page-header { animation-delay: 30ms; }
.panel > .page-body { animation-delay: 70ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--text-3); }
.crumbs a { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); padding: 2px 6px; border-radius: var(--r-sm); transition: background 150ms var(--ease), color 150ms var(--ease); }
.crumbs a:first-child { margin-left: -6px; }
.crumbs a .icon { width: 13px; height: 13px; }
.crumbs a:hover { color: var(--text); background: var(--fill); text-decoration: none; }
.crumbs > .icon { width: 12px; height: 12px; color: var(--border-2); }
.crumbs [aria-current] { color: var(--text-2); font-weight: 500; padding: 2px 6px; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 20px; }
.page-header h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.subtitle { margin-top: 2px; color: var(--text-3); }
.page-actions { display: flex; gap: 8px; }
.page-body { display: flex; flex-direction: column; gap: 20px; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-md);
  font: 500 13px/1 var(--font); border: 1px solid transparent; white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease), transform 100ms var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 1px 2px rgb(10 108 255 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 3px 10px rgb(10 108 255 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--fill); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--fill-hover); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--red-ink); border-color: var(--border-2); box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-block { width: 100%; height: 38px; font-size: 14px; }
button.btn { font-family: inherit; }

/* ───────── Cards ───────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  min-width: 0; overflow: hidden; box-shadow: var(--shadow-xs);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 13.5px; font-weight: 600; }
.card-actions { display: flex; gap: 4px; }
.card-actions .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.card-body { padding: 20px; }
.card-body:has(.table-wrap), .card-body:has(.dt) { padding: 0; }

/* ───────── KPI cards ───────── */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat {
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.stat-success { --tone-soft: var(--green-soft); --tone-ink: var(--green-ink); }
.stat-warning { --tone-soft: var(--orange-soft); --tone-ink: var(--orange-ink); }
.stat-danger  { --tone-soft: var(--red-soft); --tone-ink: var(--red-ink); }
.stat-info    { --tone-soft: var(--accent-soft); --tone-ink: var(--accent-text); }
.stat-neutral { --tone-soft: var(--purple-soft); --tone-ink: var(--purple-ink); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--text-3); font-weight: 500; font-size: 12px; }
.stat-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-md); background: var(--tone-soft); color: var(--tone-ink); }
.stat-icon .icon { width: 15px; height: 15px; }
.stat-value { margin-top: 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-hint { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--text-3); font-size: 12px; }
.dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.dot.tone-neutral { color: var(--grey); }
.dot.tone-success { color: var(--green); }
.dot.tone-warning { color: var(--orange); }
.dot.tone-danger  { color: var(--red); }
.dot.tone-info    { color: var(--accent); }

/* ───────── Pills ───────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--grey-soft); color: var(--grey-ink);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge-success { background: var(--green-soft); color: var(--green-ink); }
.badge-warning { background: var(--orange-soft); color: var(--orange-ink); }
.badge-danger  { background: var(--red-soft); color: var(--red-ink); }
.badge-info    { background: var(--accent-soft); color: var(--accent-text); }
.badge-info .badge-dot { display: none; }
.badge-info { padding: 0 8px; border-radius: var(--r-sm); }

/* ───────── Tables ───────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  height: 34px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: var(--text-3);
  background: var(--fill); border-bottom: 1px solid var(--border);
}
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 120ms var(--ease); }
.table tbody tr:hover { background: var(--fill); }
.cell-strong { display: block; font-weight: 500; color: var(--text); }
.cell-sub { display: block; color: var(--text-3); font-size: 12px; }
.table code { color: var(--text-2); background: var(--fill); padding: 2px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.table tbody tr .row-actions { opacity: 0.75; transition: opacity 150ms var(--ease); }
.table tbody tr:hover .row-actions { opacity: 1; }
.inline-badges { display: flex; flex-wrap: wrap; gap: 4px; }

/* ───────── Data table (toolbar · sort · pagination) ───────── */
.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dt-search {
  display: flex; align-items: center; gap: 8px; width: 260px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--text-3);
  box-shadow: var(--shadow-xs); transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.dt-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.dt-search .icon { width: 15px; height: 15px; }
.dt-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; cursor: text; }
.dt-select {
  height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7183' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--text); font: 500 12.5px var(--font); appearance: none; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.dt-select:hover { border-color: var(--text-3); }
.dt-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.dt-select[data-active] { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent-text); }
.dt-date { height: 32px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: 500 12.5px var(--font); box-shadow: var(--shadow-xs); }
.dt-date:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.dt-range { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.dt-clear { height: 32px; color: var(--text-3); }
.dt-clear .icon { width: 14px; height: 14px; }
.dt-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dt-actions .btn { height: 32px; }
.dt-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; margin: 0 -4px; padding: 2px 4px; border-radius: var(--r-sm); transition: color 150ms var(--ease), background 150ms var(--ease); }
.dt-sort:hover { color: var(--text); background: var(--fill-hover); text-decoration: none; }
.dt-sort.active { color: var(--text); }
.dt-arrow { display: inline-grid; opacity: 0.45; }
.dt-sort.active .dt-arrow { opacity: 1; color: var(--accent); }
.dt-arrow .icon { width: 12px; height: 12px; }
.table th.num, .table td.num { text-align: right; }
.table th.num .dt-sort { flex-direction: row-reverse; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dt:has(.htmx-request) .table-wrap, .dt.htmx-request .table-wrap { opacity: 0.55; transition: opacity 150ms var(--ease); }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.dt-count strong { color: var(--text-2); font-weight: 600; }
.dt-pages { display: flex; align-items: center; gap: 2px; }
.dt-page {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: var(--r-md); color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.dt-page:hover { background: var(--fill-hover); color: var(--text); text-decoration: none; }
.dt-page[aria-current] { background: var(--accent); color: #FFFFFF; }
.dt-page.disabled { opacity: 0.35; cursor: default; }
.dt-page .icon { width: 14px; height: 14px; }
.dt-gap { padding: 0 4px; }

/* ───────── Styled dropdown (enhanced <select>) ───────── */
.dd { position: relative; display: inline-flex; }
.dd-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 11px;
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface);
  color: var(--text); font: 500 12.5px var(--font); white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: border-color 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}
.dd-btn:hover { border-color: var(--text-3); }
.dd-btn:focus-visible, .dd-btn[aria-expanded="true"] { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.dd-btn .icon { width: 14px; height: 14px; color: var(--text-3); transition: transform 200ms var(--ease-out); }
.dd-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.dd-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dd-btn.active .icon { color: var(--accent); }
.dd-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.dd-menu {
  position: fixed; z-index: 90; max-width: 320px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: dd-in 140ms var(--ease-out); outline: none;
}
@keyframes dd-in { from { opacity: 0; transform: scale(0.97) translateY(-2px); } to { opacity: 1; transform: none; } }
.dd-filter { display: flex; align-items: center; gap: 6px; height: 32px; margin: 0 0 4px; padding: 0 8px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.dd-filter .icon { width: 14px; height: 14px; }
.dd-filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 13px var(--font); }
.dd-list { max-height: 280px; overflow-y: auto; }
.dd-opt {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none;
}
.dd-opt.focus { background: var(--fill-hover); color: var(--text); }
.dd-opt[aria-selected="true"] { color: var(--accent-text); font-weight: 600; }
.dd-check { display: grid; place-items: center; width: 16px; flex: none; visibility: hidden; color: var(--accent); }
.dd-check .icon { width: 14px; height: 14px; stroke-width: 2.25; }
.dd-opt[aria-selected="true"] .dd-check { visibility: visible; }
.dd-reset { color: var(--text-3); }
.dd-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── Date-range picker ───────── */
.dt-range.dp-enhanced { gap: 0; }
.dt-range.dp-enhanced > input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.dt-range.dp-enhanced { position: relative; }
.dt-range.dp-enhanced > :not(input):not(.dp-btn) { display: none; }
.dp-btn .icon:first-child { color: var(--text-3); transform: none !important; }
.dp-btn.active .icon:first-child { color: var(--accent); }
.dp-menu { max-width: none; padding: 0; overflow: hidden; }
.dp-body { display: flex; }
.dp-presets { display: flex; flex-direction: column; gap: 2px; padding: 8px; min-width: 132px; border-right: 1px solid var(--border); background: var(--fill); }
.dp-preset { height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font: 500 12.5px var(--font); text-align: left; cursor: pointer; transition: background 120ms var(--ease), color 120ms var(--ease); }
.dp-preset:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.dp-cal { padding: 10px 12px 8px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-month { font-weight: 600; }
.dp-nav { width: 28px; height: 28px; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 34px); }
.dp-week span { display: grid; place-items: center; height: 26px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.dp-day {
  position: relative; height: 32px; border: 0; background: transparent; color: var(--text);
  font: 500 12.5px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; border-radius: var(--r-md);
  transition: background 100ms var(--ease), color 100ms var(--ease);
}
.dp-day:hover { background: var(--fill-hover); }
.dp-day.out { color: var(--text-3); opacity: 0.55; }
.dp-day.future { color: var(--text-3); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent-border, var(--accent)); color: var(--accent-text); font-weight: 700; }
.dp-day.in { background: var(--accent-soft); color: var(--accent-text); border-radius: 0; }
.dp-day.start, .dp-day.end { background: var(--accent); color: #FFFFFF; font-weight: 700; }
.dp-day.start:not(.end) { border-radius: var(--r-md) 0 0 var(--r-md); }
.dp-day.end:not(.start) { border-radius: 0 var(--r-md) var(--r-md) 0; }
.dp-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.dp-summary { margin-right: auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.dp-foot .btn { height: 30px; }

/* ───────── Confirmation dialog ───────── */
.modal { padding: 0; border: 0; background: transparent; max-width: calc(100vw - 32px); color: var(--text); }
.modal::backdrop { background: rgb(14 16 32 / 0.45); backdrop-filter: blur(2px); animation: fade-in 160ms var(--ease); }
.modal[open] .modal-card { animation: modal-in 220ms var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-card { width: 400px; max-width: 100%; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.modal-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.modal-icon .icon { width: 20px; height: 20px; }
.modal-card h2 { font-size: 16px; }
.modal-card p { margin-top: 6px; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.btn-danger-solid { background: var(--red); color: #FFFFFF; box-shadow: 0 1px 2px rgb(229 72 77 / 0.3); }
.btn-danger-solid:hover { background: #CC3A3F; }

/* ───────── Native control polish ───────── */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--border-2); border-radius: 5px;
  background: var(--surface) no-repeat center / 11px 11px; cursor: pointer;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  animation: check-pop 180ms var(--ease-out);
}
@keyframes check-pop { 0% { transform: scale(0.85); } 100% { transform: scale(1); } }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--ring); }
input[type="checkbox"]:disabled { cursor: default; opacity: 0.6; }
.check input { margin-top: 1px; }

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer; opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E7183' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }

input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 40px var(--surface) inset; transition: background-color 9999s ease-out;
}

::selection { background: rgb(10 108 255 / 0.18); }

* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }

/* ───────── Side drawer ───────── */
.drawer {
  position: fixed; z-index: 70; top: 8px; right: 8px; bottom: 8px; width: min(520px, calc(100vw - 16px));
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  transform: translateX(calc(100% + 24px)); transition: transform 280ms var(--ease-out); overflow: hidden;
}
.drawer:not(:empty) { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 65; background: rgb(14 16 32 / 0.25); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); }
body:has(.drawer:not(:empty)) .drawer-scrim { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 15px; }
.drawer-head p { margin-top: 2px; color: var(--text-3); font-size: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-section h3 { margin-bottom: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.json { margin: 0; padding: 12px; border-radius: var(--r-md); background: var(--fill); border: 1px solid var(--border); font: 11.5px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.diff { width: 100%; border-collapse: collapse; font-size: 12px; }
.diff th { text-align: left; font-weight: 500; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.diff td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-word; font-family: var(--mono); font-size: 11.5px; }
.diff td:first-child { font-family: var(--font); font-weight: 600; color: var(--text); width: 28%; }
.diff .old { color: var(--red-ink); background: var(--red-soft); }
.diff .new { color: var(--green-ink); background: var(--green-soft); }

/* ───────── Tabs ───────── */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--fill); border-radius: var(--r-lg); width: fit-content; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; transition: background 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease); }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab .icon { width: 15px; height: 15px; }
.tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fill-hover); color: var(--text-3); font-size: 11px; display: inline-grid; place-items: center; }

/* ───────── Empty state ───────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 24px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px;
  border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-soft) 50%, transparent);
}
.empty-icon .icon { width: 18px; height: 18px; }
.empty h3 { font-size: 13.5px; }
.empty p { max-width: 44ch; color: var(--text-3); }
.empty .btn { margin-top: 14px; }

/* ───────── Key/value ───────── */
.kv { margin: 0; display: flex; flex-direction: column; }
.kv-row { display: grid; grid-template-columns: minmax(150px, 2fr) 3fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-row:first-child { padding-top: 0; }
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--text-3); }
.kv dt code { color: var(--text-2); background: var(--fill); padding: 2px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.kv dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }

/* ───────── Forms ───────── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text); }
.req { color: var(--red); }
.input {
  height: 34px; padding: 0 11px; width: 100%;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-xs);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input[readonly] { background: var(--fill); color: var(--text-3); border-color: var(--border); box-shadow: none; }
.input[aria-invalid="true"] { border-color: var(--red); }
textarea.input { height: auto; min-height: 112px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
textarea.input.mono { font: 12px/1.55 var(--mono); word-break: break-all; }
.hint { font-size: 12px; color: var(--text-3); }

/* Chips: compact read-only token lists (licensed modules, features…) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--text-2); font: 500 12px/1 var(--mono); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }

/* Meter: usage against a limit */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter + .meter { margin-top: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 12.5px; }
.meter-head span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }
.meter-track { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.meter-fill.warn { background: var(--orange); }
.meter-fill.full { background: var(--red); }

/* Licence page */
.license-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.license-head strong { font-size: 15px; }

/* Platform banner (licence state) above page content */
.platform-banner { margin-bottom: 14px; }
.platform-banner .alert a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-left: 6px; }
.field-error { font-size: 12px; color: var(--red-ink); font-weight: 500; }

.check {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}
.check:hover { border-color: var(--border-2); box-shadow: var(--shadow-xs); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check:has(input:disabled) { cursor: default; opacity: 0.65; }
.check:has(input:focus-visible) { box-shadow: var(--ring); }
.check input { margin: 1px 0 0; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.check-label { font-weight: 600; color: var(--text); }
.check-desc { font-size: 12px; color: var(--text-3); }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.check-group + .check-group { margin-top: 16px; }
.check-group-title { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: capitalize; }

.form-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.form-section:first-child { padding-top: 0; }
.form-section:has(+ .form-actions) { border-bottom: 0; padding-bottom: 4px; }
.form-section-intro h3 { font-size: 13.5px; }
.form-section-intro p { margin-top: 2px; color: var(--text-3); max-width: 34ch; }
.form-section-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; max-width: 640px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }

.alert {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-md); line-height: 1.45; border: 1px solid transparent;
  background: var(--fill); color: var(--text);
}
.alert .icon { margin-top: 1px; width: 15px; height: 15px; }
.alert-success { background: var(--green-soft); color: var(--green-ink); }
.alert-danger  { background: var(--red-soft); color: var(--red-ink); }
.alert-warning { background: var(--orange-soft); color: var(--orange-ink); }
.alert-info    { background: var(--accent-soft); color: var(--accent-text); }

.copy-row { display: flex; gap: 8px; }
.copy-row .input { font: 12px/1 var(--mono); }

.identity { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #FFFFFF;
  background: linear-gradient(135deg, #60A5FA 0%, #6366F1 100%);
}
tr:nth-child(3n+2) .avatar-sm { background: linear-gradient(135deg, #34D399 0%, #0EA5A4 100%); }
tr:nth-child(3n+3) .avatar-sm { background: linear-gradient(135deg, #FBBF24 0%, #F97316 100%); }

/* ───────── Account menu ───────── */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 240px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform-origin: top right; animation: pop 160ms var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.menu-name { font-weight: 600; }
.menu-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2);
  font: 500 13px var(--font); text-align: left;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.menu-item:hover { background: var(--fill-hover); color: var(--text); text-decoration: none; }
.menu-item .icon { width: 15px; height: 15px; color: var(--text-3); }
.menu-danger:hover { background: var(--red-soft); color: var(--red-ink); }
.menu-danger:hover .icon { color: var(--red-ink); }

/* ───────── Notification bell ───────── */
.bell summary { position: relative; }
.bell-count {
  position: absolute; top: -2px; left: 20px; display: grid; place-items: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; pointer-events: none;
  background: var(--red); color: #FFFFFF; font-size: 10px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--canvas);
  animation: pop 220ms var(--ease-out);
}
.bell-count[data-n="0"] { display: none; }
.bell-panel { width: 360px; padding: 0; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-title { font-weight: 600; font-size: 13.5px; }
.link-btn { border: 0; background: none; padding: 2px 4px; border-radius: var(--r-sm); color: var(--accent-text); font: 500 12px var(--font); }
.link-btn:hover { background: var(--accent-soft); }
.bell-list { max-height: 380px; overflow-y: auto; padding: 4px; }
.inbox-list { max-height: none; padding: 6px; }
.notif {
  position: relative; display: flex; gap: 10px; padding: 10px 12px 10px 10px; border-radius: var(--r-md);
  color: var(--text); transition: background 120ms var(--ease);
}
.notif:hover { background: var(--fill); text-decoration: none; }
.notif[data-unread]::after { content: ""; position: absolute; top: 16px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--fill); color: var(--text-3); }
.notif[data-unread] .notif-icon { background: var(--accent-soft); color: var(--accent); }
.notif-icon .icon { width: 15px; height: 15px; }
.notif-text { display: flex; flex-direction: column; min-width: 0; padding-right: 14px; line-height: 1.4; }
.notif-title { font-weight: 500; }
.notif[data-unread] .notif-title { font-weight: 600; }
.notif-body { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-list .notif-body { white-space: normal; }
.notif-time { margin-top: 2px; color: var(--text-3); font-size: 11px; }
.bell-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--text-3); }
.bell-empty .icon { width: 22px; height: 22px; }
.bell-foot { display: block; padding: 10px; text-align: center; font-weight: 500; border-top: 1px solid var(--border); }
.bell-foot:hover { background: var(--fill); text-decoration: none; }

/* ───────── Toasts ───────── */
.toast-stack { position: fixed; top: 64px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 400px;
  padding: 10px 8px 10px 12px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toast-in 380ms var(--ease-out) both;
}
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tone, var(--accent)); opacity: 0.6; transform-origin: left; animation: toast-timer 5s linear forwards; }
.toast-success { --tone: var(--green); --tone-soft: var(--green-soft); }
.toast-danger { --tone: var(--red); --tone-soft: var(--red-soft); }
.toast-warning { --tone: var(--orange); --tone-soft: var(--orange-soft); }
.toast-info { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--tone-soft); color: var(--tone); }
.toast-icon .icon { width: 15px; height: 15px; }
.toast-text { flex: 1; font-weight: 500; }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); }
.toast-close:hover { background: var(--fill-hover); color: var(--text); }
.toast-close .icon { width: 14px; height: 14px; }
.toast.leaving { animation: toast-out 200ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ───────── Sign-in ───────── */
.auth-body { min-height: 100vh; background: var(--surface); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 28px;
  margin: 10px; padding: 32px 40px; border-radius: 20px; color: #FFFFFF;
  background:
    radial-gradient(36rem 26rem at 110% 110%, rgb(52 211 153 / 0.45), transparent 60%),
    radial-gradient(26rem 20rem at -10% -5%, rgb(244 114 182 / 0.4), transparent 60%),
    linear-gradient(135deg, #5B5BF6 0%, #0A6CFF 100%);
}
.auth-brand { display: flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; font-size: 14px; }
.auth-brand:hover { text-decoration: none; }
.auth-aside .logo { background: rgb(255 255 255 / 0.2); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25); }
.auth-hero { margin-top: 24px; }
.auth-hero h2 { font-size: 30px; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; max-width: 15ch; }
.auth-hero p { margin-top: 10px; font-size: 14px; color: rgb(255 255 255 / 0.82); max-width: 38ch; }
.float-stage { position: relative; flex: 1; min-height: 260px; }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px;
  width: min(320px, 84%); padding: 10px 12px; border-radius: var(--r-lg);
  background: #FFFFFF; color: #1F2033; box-shadow: 0 14px 30px rgb(16 18 60 / 0.22);
  animation: float 7s ease-in-out infinite;
}
.fc-1 { top: 6%; left: 0; }
.fc-2 { top: 38%; left: 12%; animation-delay: -2.3s; }
.fc-3 { top: 70%; left: 3%; animation-delay: -4.6s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.fc-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; color: #FFFFFF; font-size: 10.5px; font-weight: 700; }
.fc-avatar.c1 { background: linear-gradient(135deg, #F472B6, #8B5CF6); }
.fc-avatar.c2 { background: linear-gradient(135deg, #60A5FA, #6366F1); }
.fc-avatar.c3 { background: linear-gradient(135deg, #34D399, #0EA5A4); }
.fc-lines { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.fc-title { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-sub { font-size: 11px; color: #6E7183; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-done { background: #E6F8EF; color: #0A7A4B; }
.pill-working { background: #FFF4E0; color: #A15C00; }
.pill-stuck { background: #FDECEC; color: #C02D33; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 12px;
  background: rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.3);
  backdrop-filter: blur(8px); animation: float 8s ease-in-out infinite;
}
.float-chip .icon { width: 14px; height: 14px; }
.fc-4 { top: 24%; right: 4%; animation-delay: -1.2s; }
.fc-5 { top: 57%; right: 8%; animation-delay: -3.7s; }
.auth-legal { font-size: 12px; color: rgb(255 255 255 / 0.7); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 360px; animation: rise 400ms var(--ease-out) both; }
.auth-card h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.auth-card .subtitle { margin: 4px 0 24px; }
.auth-card .alert { margin-bottom: 14px; }
.auth-mobile-brand { display: none; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--text-3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ───────── Responsive ───────── */
.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: flex; margin-bottom: 28px; color: var(--text); }
}
@media (max-width: 960px) {
  .brand { width: auto; }
  .sidebar { position: fixed; z-index: 50; top: 8px; bottom: 8px; left: 8px; transform: translateX(calc(-100% - 16px)); box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(14 16 32 / 0.4); }
  .only-mobile { display: inline-grid; }
  .search { display: none; }
  .panel { padding: 14px 14px 36px; }
  .crumbs > :not(:last-child) { display: none; }
  .toast-stack { left: 12px; right: 12px; }
  .toast { min-width: 0; max-width: none; }
}

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