/* =========================================================================
   Omer Gateway — dashboard theme
   Light, Stripe/Linear-inspired. Built on Bootstrap 5.3 (vendor/), which
   supplies the grid, utilities and component behaviour; everything visual
   is defined here through the tokens below.
   ========================================================================= */

:root {
  /* brand */
  --brand: #2b6edc;
  --brand-600: #245fc2;
  --brand-50: #eef4fe;
  --brand-100: #dbe7fd;
  --brand-ring: rgba(43, 110, 220, .28);
  --accent: #ea6418;

  /* neutrals */
  --ink: #0a2540;        /* headings */
  --text: #30313d;       /* body */
  --text-2: #596171;     /* secondary */
  --text-3: #87909f;     /* tertiary / placeholders */
  --line: #ebeef1;       /* hairlines */
  --line-2: #d8dee4;     /* control borders */
  --canvas: #ffffff;
  --subtle: #f6f8fa;
  --subtle-2: #f0f3f6;
  --hover: #f5f7fa;

  /* status */
  --ok: #0f7b45;    --ok-bg: #d7f7e4;    --ok-line: #a8e8c3;
  --bad: #b3093c;   --bad-bg: #ffe7ef;   --bad-line: #ffc2d3;
  --warn: #9b4a00;  --warn-bg: #fff1d6;  --warn-line: #fbd79a;
  --info: #0055bc;  --info-bg: #dcecff;  --info-line: #b3d4ff;
  --neutral: #545969; --neutral-bg: #ebeef1;

  /* type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .04);
  --shadow-btn: 0 0 0 1px rgba(64, 68, 82, .16), 0 1px 1px rgba(0, 0, 0, .06), 0 2px 5px rgba(64, 68, 82, .06);
  --shadow-btn-hover: 0 0 0 1px rgba(64, 68, 82, .24), 0 1px 1px rgba(0, 0, 0, .06), 0 3px 8px rgba(64, 68, 82, .1);
  --shadow-pop: 0 0 0 1px rgba(64, 68, 82, .08), 0 4px 12px rgba(64, 68, 82, .08), 0 16px 40px -8px rgba(64, 68, 82, .22);
  --shadow-card: 0 0 0 1px rgba(64, 68, 82, .06), 0 1px 2px rgba(64, 68, 82, .06);

  --sidebar-w: 236px;
  --sidebar-w-min: 64px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Bootstrap bridge */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 14px;
  --bs-body-line-height: 1.43;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--canvas);
  --bs-border-color: var(--line);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 43, 110, 220;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 43, 110, 220;
  --bs-link-hover-color: var(--brand-600);
  --bs-secondary-color: var(--text-2);
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
  --bs-focus-ring-color: var(--brand-ring);
  --bs-border-radius: var(--r);
  color-scheme: light;
}

/* ------------------------------- Base -------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.43;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-weight: 650; letter-spacing: -.011em; margin-top: 0; }
h1, .h1 { font-size: 28px; line-height: 36px; letter-spacing: -.022em; font-weight: 700; }
h2, .h2 { font-size: 18px; line-height: 26px; }
h3, .h3 { font-size: 15px; line-height: 22px; }
h4, h5, h6, .h4, .h5, .h6 { font-size: 14px; line-height: 20px; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
b, strong { font-weight: 600; }
hr { border-color: var(--line); opacity: 1; }
code { color: var(--ink); background: var(--subtle-2); padding: 1px 5px; border-radius: var(--r-xs); font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
small, .small { font-size: 12.5px; }
.text-muted, .text-secondary { color: var(--text-2) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.mono, .font-monospace { font-family: var(--mono) !important; font-size: 12.5px; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
svg.feather { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
kbd {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-xs);
  background: var(--canvas); color: var(--text-2); font-family: var(--font); font-size: 11px; font-weight: 500;
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2);
}

/* ------------------------------ Shell -------------------------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--sidebar-w);
  background: var(--subtle);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width .18s var(--ease), transform .2s var(--ease);
}
.sidebar__brand {
  display: flex; align-items: center; height: var(--topbar-h); padding: 0 18px; flex-shrink: 0;
  color: var(--ink);
}
.sidebar__brand:hover { color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand__word { font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; line-height: 1; }
.brand__sub { font-weight: 500; color: var(--text-3); margin-left: 5px; letter-spacing: -.01em; }
.brand__logo { max-height: 30px; max-width: 170px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; scrollbar-width: thin; }
.nav-group { margin-bottom: 14px; }
.nav-group__title { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; margin: 1px 0; border-radius: var(--r-sm);
  color: var(--text); font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav-item svg { color: var(--text-3); transition: color .12s; }
.nav-item:hover { background: var(--subtle-2); color: var(--ink); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.is-active { background: var(--canvas); color: var(--brand); box-shadow: var(--shadow-card); }
.nav-item.is-active svg { color: var(--brand); }

.sidebar__foot { padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.env-note { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--warn); font-weight: 500; white-space: nowrap; }
.env-note__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(234, 100, 24, .18); flex-shrink: 0; }
.sidebar__collapse {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; width: 100%;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500;
}
.sidebar__collapse:hover { background: var(--subtle-2); color: var(--ink); }

.main { margin-left: var(--sidebar-w); min-width: 0; transition: margin-left .18s var(--ease); }

@media (min-width: 992px) {
  html.sidebar-collapsed .sidebar { width: var(--sidebar-w-min); }
  html.sidebar-collapsed .main { margin-left: var(--sidebar-w-min); }
  html.sidebar-collapsed .sidebar__brand { padding: 0; justify-content: center; }
  html.sidebar-collapsed .brand__word, html.sidebar-collapsed .brand__logo,
  html.sidebar-collapsed .nav-item span, html.sidebar-collapsed .sidebar__collapse span,
  html.sidebar-collapsed .env-note__text { display: none; }
  html.sidebar-collapsed .nav-group__title { visibility: hidden; height: 8px; padding: 0; }
  html.sidebar-collapsed .nav-item, html.sidebar-collapsed .sidebar__collapse, html.sidebar-collapsed .env-note { justify-content: center; padding: 0; }
  html.sidebar-collapsed .sidebar__collapse svg { transform: scaleX(-1); }
}
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-pop); }
  .main { margin-left: 0; }
  html.sidebar-open .sidebar { transform: none; }
  html.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(10, 37, 64, .28); }
  .sidebar__collapse { display: none; }
}

.topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn.topbar__menu { display: none; }
@media (max-width: 991.98px) { .topbar { padding: 0 16px; } .icon-btn.topbar__menu { display: inline-flex; } }
.topbar__spacer { flex: 1; }

.search-trigger {
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 100%); height: 34px; padding: 0 8px 0 12px;
  border: 0; border-radius: var(--r-sm);
  background: var(--subtle); color: var(--text-3); font-size: 14px; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .12s, background .12s;
}
.search-trigger:hover { background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line-2); }
.search-trigger__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .search-trigger__kbd { display: none; } }

.env-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line);
}
.env-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 0;
  background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--subtle); color: var(--ink); }

.user-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 3px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--subtle); }
.user-btn svg { color: var(--text-3); width: 14px; height: 14px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(140deg, #3f86f5, #2353b8); color: #fff;
  font-size: 12px; font-weight: 650; letter-spacing: .02em;
}
.avatar--lg { width: 38px; height: 38px; font-size: 14px; }
.user-menu { min-width: 240px; }
.user-menu__head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 6px; }
.user-menu__name { font-weight: 600; color: var(--ink); }
.user-menu__role { font-size: 12.5px; color: var(--text-2); }

.content { padding: 20px 32px 64px; max-width: 1520px; }
@media (max-width: 767.98px) { .content { padding: 16px 16px 48px; } }

.crumbs .breadcrumb { margin: 0 0 6px; font-size: 13px; --bs-breadcrumb-divider: "›"; }
.crumbs .breadcrumb svg { width: 14px; height: 14px; margin-top: -2px; }
.breadcrumb-item, .breadcrumb-item a { color: var(--text-2); }
.breadcrumb-item a:hover { color: var(--brand); }
.breadcrumb-item.active { color: var(--text-2); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-3); }

.turbo-progress-bar { height: 2px; background: var(--brand); }

@media (prefers-reduced-motion: no-preference) {
  .content { animation: page-in .2s var(--ease); }
  @keyframes page-in { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}

/* --------------------------- Page header ----------------------------- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  margin: 0 0 24px;
}
.page-header h1 { margin: 0; }
.page-header__sub { margin-top: 4px; color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------ Cards -------------------------------- */
.card {
  --bs-card-bg: var(--canvas);
  background: var(--canvas);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
  margin-bottom: 24px;
}
.row > * > .card { margin-bottom: 0; }
.row.g-3 > * > .card, .row.g-4 > * > .card { height: 100%; }
.card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
}
.card-header:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.card-title, .card-header h2, .card-header h3, .card-header h5 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 12px 20px; }

/* KPI tiles */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 13px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.kpi__value { font-size: 26px; line-height: 34px; font-weight: 650; letter-spacing: -.022em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi__value .text-muted, .kpi__value .cur { font-size: 15px; font-weight: 500; color: var(--text-3) !important; letter-spacing: 0; margin-right: 2px; }
.kpi__meta { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kpi__dot { width: 8px; height: 8px; border-radius: 2px; }
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); margin-bottom: 24px; overflow: hidden; }
.kpi-strip > .kpi { padding: 18px 20px; border-left: 1px solid var(--line); margin-left: -1px; min-width: 0; }
@media (max-width: 991.98px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-strip > .kpi { border-top: 1px solid var(--line); margin-top: -1px; } }
@media (max-width: 479.98px) { .kpi-strip { grid-template-columns: 1fr; } }
.spark { height: 36px; margin-top: 6px; }

/* ----------------------------- Buttons ------------------------------- */
.btn {
  --bs-btn-font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  font-size: 14px; font-weight: 500; line-height: 1;
  border: 0; border-radius: var(--r-sm);
  white-space: nowrap;
  transition: box-shadow .12s, background-color .12s, color .12s;
}
.btn svg { width: 15px; height: 15px; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--brand-ring) !important; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-icon { width: 30px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }

.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 1px var(--brand-600), 0 1px 1px rgba(0, 0, 0, .1), 0 2px 5px rgba(43, 110, 220, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); color: #fff; }
.btn-primary:active, .btn-primary.active { background: #1f55b3 !important; color: #fff !important; }
.btn-primary:disabled { background: var(--brand); color: #fff; opacity: .55; }

.btn-secondary, .btn-light, .btn-outline-secondary, .btn-outline-primary, .btn-outline-dark {
  background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-btn);
}
.btn-secondary:hover, .btn-light:hover, .btn-outline-secondary:hover, .btn-outline-primary:hover, .btn-outline-dark:hover,
.btn-secondary:focus, .btn-light:focus {
  background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-btn-hover);
}
.btn-secondary:active, .btn-secondary.active { background: var(--subtle) !important; color: var(--ink) !important; }
.btn-secondary svg { color: var(--text-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover, .btn-ghost:focus { background: var(--subtle); color: var(--ink); }

.btn-danger { background: #df1b41; color: #fff; box-shadow: 0 0 0 1px #c4122f, 0 2px 5px rgba(223, 27, 65, .2); }
.btn-danger:hover { background: #c4122f; color: #fff; }
.btn-outline-danger { background: var(--canvas); color: var(--bad); box-shadow: var(--shadow-btn); }
.btn-outline-danger:hover, .btn-outline-danger:focus { background: var(--bad-bg); color: var(--bad); box-shadow: 0 0 0 1px var(--bad-line); }
.btn-success { background: #13a35b; color: #fff; box-shadow: 0 0 0 1px #0f8a4c; }
.btn-success:hover { background: #0f8a4c; color: #fff; }
.btn-warning { background: #f5a524; color: #3b2300; }
.btn-link { color: var(--brand); padding: 0; height: auto; box-shadow: none; }

/* segmented control */
.segmented, .btn-group {
  display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px;
  background: var(--subtle-2); box-shadow: inset 0 0 0 1px var(--line);
}
.segmented > .btn, .btn-group > .btn {
  height: 28px; padding: 0 11px; font-size: 13px; border-radius: 6px !important;
  background: transparent !important; color: var(--text-2) !important; box-shadow: none !important;
}
.segmented > .btn:hover, .btn-group > .btn:hover { color: var(--ink) !important; }
.segmented > .btn.active, .btn-group > .btn.active {
  background: var(--canvas) !important; color: var(--ink) !important; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(64, 68, 82, .1), 0 1px 2px rgba(64, 68, 82, .12) !important;
}

/* ------------------------------ Forms -------------------------------- */
.form-label { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.form-label b { font-weight: 500; }
.form-text { color: var(--text-2); font-size: 12.5px; margin-top: 5px; }
.form-control, .form-select {
  height: 34px; padding: 6px 10px;
  font-size: 14px; color: var(--ink);
  background-color: var(--canvas);
  border: 0; border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 1px rgba(0, 0, 0, .03);
  transition: box-shadow .12s;
}
textarea.form-control { height: auto; min-height: 88px; line-height: 1.5; }
select[multiple].form-select { height: auto; }
.form-control::placeholder { color: var(--text-3); }
.form-control:hover, .form-select:hover { box-shadow: 0 0 0 1px #c3cad3, 0 1px 1px rgba(0, 0, 0, .03); }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-ring); color: var(--ink); }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--subtle); color: var(--text-2); }
.form-control-sm, .form-select-sm { height: 30px; font-size: 13px; padding: 4px 9px; }
.form-control-lg { height: 42px; font-size: 15px; padding: 8px 12px; }
.form-select { padding-right: 30px; background-position: right 10px center; background-size: 12px 10px; }
.form-check { min-height: 20px; }
.form-check-input { width: 16px; height: 16px; margin-top: 2px; border: 0; box-shadow: 0 0 0 1px #b6bec9; background-color: var(--canvas); }
.form-check-input:checked { background-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-ring); }
.form-switch .form-check-input { width: 32px; height: 18px; margin-top: 1px; border-radius: 999px; background-color: #d5dbe1; box-shadow: none;
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-color: var(--brand); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-check-label { color: var(--text); }
.input-group-text { background: var(--subtle); border: 0; box-shadow: 0 0 0 1px var(--line-2); color: var(--text-2); font-size: 13px; }
.input-group > .form-control { position: relative; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 20px; }
.form-grid > .mb-3 { margin-bottom: 0 !important; }
.form-section { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 8px 40px; padding: 24px 0; }
.form-section:first-child { padding-top: 4px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section > .form-section__title, .form-section > .form-section__desc { grid-column: 1; }
.form-section > :not(.form-section__title):not(.form-section__desc) { grid-column: 2; }
.form-section > .form-section__title { grid-row: 1; }
.form-section > .form-section__desc { grid-row: 2; }
.form-section > :nth-child(3) { grid-row: 1 / span 6; }
.form-section__title { font-size: 15px; font-weight: 650; color: var(--ink); margin: 0; }
.form-section__desc { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.5; }
@media (max-width: 991.98px) {
  .form-section { grid-template-columns: 1fr; }
  .form-section > * { grid-column: 1 !important; grid-row: auto !important; }
  .form-section > .form-section__desc { margin-bottom: 10px; }
}
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 20px; margin-top: 4px; border-top: 1px solid var(--line); }
.req { color: var(--bad); margin-left: 1px; }
.form-label .badge.bg-secondary { font-size: 0; padding: 0; background: none !important; box-shadow: none; }
.form-label .badge.bg-secondary::after { content: "*"; font-size: 13px; color: var(--bad); }
.invalid-feedback { font-size: 12.5px; color: var(--bad); }

/* Tom Select */
.ts-wrapper { min-height: 34px; }
.ts-wrapper.form-select, .ts-wrapper.form-control { height: auto; padding: 0; box-shadow: none; background: none; }
.ts-control {
  min-height: 34px; padding: 4px 30px 4px 8px !important; gap: 4px;
  border: 0 !important; border-radius: var(--r-sm) !important;
  background: var(--canvas) !important;
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 1px rgba(0, 0, 0, .03) !important;
  font-size: 14px; color: var(--ink);
}
.ts-wrapper.single .ts-control { padding-left: 10px !important; }
.ts-wrapper.focus .ts-control { box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-ring) !important; }
.ts-control > input { font-size: 14px !important; color: var(--ink); }
.ts-control > input::placeholder { color: var(--text-3); }
.ts-wrapper.multi .ts-control > div {
  margin: 0 !important; padding: 1px 4px 1px 8px !important; border-radius: var(--r-xs) !important;
  background: var(--subtle-2) !important; color: var(--ink) !important; border: 0 !important;
  font-size: 12.5px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line);
}
.ts-wrapper.plugin-remove_button .item .remove { border: 0 !important; color: var(--text-3); padding: 0 5px; margin-left: 2px; border-radius: 3px; }
.ts-wrapper.plugin-remove_button .item .remove:hover { background: var(--bad-bg); color: var(--bad); }
.ts-dropdown {
  border: 0 !important; border-radius: var(--r) !important; margin-top: 6px !important;
  box-shadow: var(--shadow-pop) !important; overflow: hidden; z-index: 1070; font-size: 14px;
}
.ts-dropdown .option { padding: 7px 10px; color: var(--ink); }
.ts-dropdown .active { background: var(--brand-50) !important; color: var(--ink) !important; }
.ts-dropdown .option.selected { color: var(--brand); font-weight: 500; }
.ts-dropdown .dropdown-input-wrap { padding: 6px; }
.ts-dropdown .dropdown-input { border: 0; box-shadow: 0 0 0 1px var(--line-2); border-radius: var(--r-sm); height: 30px; }

/* ------------------------------ Tables ------------------------------- */
.table-card { overflow: hidden; }
.table-card > .table-wrap:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.table-wrap { overflow-x: auto; }
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--hover);
  --bs-table-border-color: var(--line);
  margin: 0; font-size: 14px; color: var(--text); border-color: var(--line);
}
.table > :not(caption) > * > * { padding: 10px 16px; border-bottom: 1px solid var(--line); background: transparent; box-shadow: none; vertical-align: middle; color: inherit; }
.table > thead > tr > th {
  padding-top: 9px; padding-bottom: 9px;
  font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: none; letter-spacing: 0;
  background: var(--subtle); white-space: nowrap; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.table > :not(:first-child) { border-top: 0; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table > tbody > tr > * { transition: background .08s; }
.table > tbody > tr:hover > * { background: var(--hover); }
.table > tbody > tr[data-href] { cursor: pointer; }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; width: 1%; }
.table td.actions .btn-ghost { opacity: .7; }
.table tr:hover td.actions .btn-ghost { opacity: 1; }
.table .cell-sub { display: block; color: var(--text-2); font-size: 13px; margin-top: 1px; }
.table .cell-strong { font-weight: 500; color: var(--ink); }
.table td .num, .table td .pill, .table td .badge { white-space: nowrap; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--ink); }
.table th[data-sort]::after { content: ""; display: inline-block; width: 8px; height: 10px; margin-left: 6px; vertical-align: -1px; opacity: .35;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 0l3 4H1zM4 10L1 6h6z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 0l3 4H1zM4 10L1 6h6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.table th[aria-sort]::after { opacity: 1; color: var(--brand); }
.table th[aria-sort="ascending"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 2l3 4H1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 2l3 4H1z'/%3E%3C/svg%3E"); }
.table th[aria-sort="descending"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 8L1 4h6z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 8L1 4h6z'/%3E%3C/svg%3E"); }
.table-empty { padding: 64px 20px !important; text-align: center; color: var(--text-2); }
.table-empty svg { display: block; width: 36px; height: 36px; margin: 0 auto 12px; padding: 8px; border-radius: 10px; background: var(--subtle-2); color: var(--text-3); box-sizing: content-box; }
.table-responsive { border-radius: var(--r); }
.table-sm > :not(caption) > * > * { padding: 7px 12px; }

/* mobile: stacked rows */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack > tbody > tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack > tbody > tr:last-child { border-bottom: 0; }
  .table-stack > tbody > tr > td {
    border: 0 !important; padding: 3px 0 !important; text-align: left !important;
    display: grid; grid-template-columns: 100px minmax(0, 1fr); column-gap: 12px; row-gap: 1px; justify-items: start; align-items: center;
  }
  .table-stack > tbody > tr > td > * { grid-column: 2; }
  .table-stack > tbody > tr > td::before {
    content: attr(data-label); grid-column: 1; grid-row: 1 / span 6; align-self: start;
    font-family: var(--font); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--text-2); padding-top: 1px;
  }
  .table-stack > tbody > tr > td.actions { display: flex; justify-content: flex-end; width: 100% !important; padding-top: 8px !important; }
  .table-stack > tbody > tr > td.actions::before, .table-stack > tbody > tr > td[data-label=""]::before { display: none; }
  .table-stack > tbody > tr > td.table-empty { display: block; }
  .table-stack > tbody > tr > td.table-empty::before { display: none; }
  .table-stack > tbody > tr[data-href] > td.actions:has(> .btn-icon:only-child) { display: none; }
}

/* toolbar above tables */
.table-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.table-toolbar__search { position: relative; flex: 0 1 280px; }
.table-toolbar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.table-toolbar__search .form-control { padding-left: 32px; height: 30px; font-size: 13.5px; }
.table-toolbar__spacer { flex: 1; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2);
}
.table-footer b { color: var(--ink); font-weight: 600; }
.per-page { display: inline-flex; align-items: center; gap: 8px; }
.per-page .form-select { width: auto; height: 28px; padding: 2px 26px 2px 8px; font-size: 13px; }

/* legacy filter panel (shown only without JS) and chips */
.filter-panel { display: none; padding: 16px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.filter-panel.is-open { display: block; }
.filter-panel__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.filter-chips:empty { display: none; }

/* ------------------------- Stripe-style filters ----------------------- */
.filterbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 7px; border-radius: 999px;
  background: var(--canvas); color: var(--text-2);
  border: 1px dashed #c0c8d2; font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-pill:hover { background: var(--subtle); color: var(--ink); border-color: #a3acb9; }
.filter-pill svg { width: 14px; height: 14px; }
.filter-pill.is-active { border-style: solid; border-color: var(--line-2); color: var(--ink); padding-right: 4px; box-shadow: var(--shadow-xs); }
.filter-pill__label { color: var(--text-2); }
.filter-pill.is-active .filter-pill__label::after { content: ""; display: inline-block; width: 1px; height: 12px; background: var(--line-2); margin: 0 7px; vertical-align: -1px; }
.filter-pill__value { color: var(--brand); font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.filter-pill__clear {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 2px;
  border-radius: 50%; color: var(--text-3);
}
.filter-pill__clear:hover { background: var(--bad-bg); color: var(--bad); }
.filter-pill__clear svg { width: 12px; height: 12px; }
.filter-reset { font-size: 13px; font-weight: 500; color: var(--brand); padding: 0 6px; height: 26px; display: inline-flex; align-items: center; }
.filter-reset:hover { color: var(--brand-600); }

.filter-pop { width: 300px; padding: 0 !important; }
.filter-pop__head { padding: 12px 14px 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.filter-pop__body { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.filter-pop__body > div > .form-label { display: none; }
.filter-pop__foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.filter-pop__foot .btn { flex: 1; }
.filter-pop__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pop__presets .btn { height: 26px; padding: 0 9px; font-size: 12.5px; }
.filter-pop__range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-pop__range .form-label { display: block !important; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }

.checklist { max-height: 248px; overflow-y: auto; margin: 0 -6px; }
.checklist__item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; color: var(--ink); }
.checklist__item:hover { background: var(--subtle); }
.checklist__item .form-check-input { margin: 0; flex-shrink: 0; }
.checklist__item[hidden] { display: none; }
.checklist__empty { padding: 10px 8px; color: var(--text-3); font-size: 13px; }

/* --------------------------- Pagination ------------------------------ */
.pagination { margin: 0; gap: 2px; flex-wrap: wrap; --bs-pagination-border-width: 0; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 8px; border: 0 !important;
  border-radius: var(--r-sm) !important; background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.page-link:hover { background: var(--subtle); color: var(--ink); }
.page-link:focus { box-shadow: 0 0 0 3px var(--brand-ring); background: transparent; color: var(--ink); }
.page-item.active .page-link { background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-btn); font-weight: 600; }
.page-item.disabled .page-link { background: transparent; color: var(--text-3); opacity: .5; }

/* --------------------------- Badges / pills -------------------------- */
.pill, .badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 6px; border-radius: var(--r-xs);
  font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1; text-transform: none; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral);
}
.pill svg { width: 12px; height: 12px; stroke-width: 2.4; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--info { background: var(--info-bg); color: var(--info); }
.badge.bg-secondary { background: var(--neutral-bg) !important; color: var(--neutral); }
.badge.bg-success { background: var(--ok-bg) !important; color: var(--ok); }
.badge.bg-danger { background: var(--bad-bg) !important; color: var(--bad); }
.badge.bg-warning { background: var(--warn-bg) !important; color: var(--warn); }
.badge.bg-info, .badge.bg-primary { background: var(--info-bg) !important; color: var(--info); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-2);
  background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line-2);
}

/* copyable identifiers */
.copy {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; white-space: nowrap; vertical-align: middle;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  border-radius: var(--r-xs); padding: 1px 4px; margin: -1px -4px; cursor: pointer;
}
.copy__text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.table .copy { max-width: 172px; }
.kv .copy { max-width: 100%; }
.copy:hover { background: var(--subtle-2); color: var(--ink); }
.copy::after {
  content: ""; width: 12px; height: 12px; flex-shrink: 0; opacity: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.copy:hover::after { opacity: .6; }
.copy.is-copied::after { opacity: 1; background: var(--ok); }

/* -------------------------- Key / value ------------------------------ */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); margin: 0; }
.kv > dt, .kv > dd { padding: 8px 0; margin: 0; font-size: 14px; line-height: 20px; }
.kv > dt { color: var(--text-2); font-weight: 400; padding-right: 16px; }
.kv > dd { color: var(--ink); min-width: 0; word-break: break-word; }
.card-body > .kv { margin: -8px 0; }

/* ------------------------------ Alerts ------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  border: 0; border-radius: var(--r); padding: 12px 40px 12px 14px; font-size: 14px; margin-bottom: 20px;
}
.alert svg { margin-top: 1px; }
.alert-success { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.alert-danger { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.alert-warning { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.alert-info { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px var(--info-line); }
.alert .btn-close { padding: 14px; font-size: 10px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }

.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1090; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.app-toast {
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
  max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r);
  background: #1a1f36; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px -6px rgba(10, 37, 64, .45);
  animation: toast-in .22s var(--ease);
}
.app-toast svg { width: 16px; height: 16px; }
.app-toast--success svg { color: #5ee09a; }
.app-toast--error svg { color: #ff8aa8; }
.app-toast .mono { color: #c9d4e3; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* --------------------------- Dropdowns / modal ------------------------ */
.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--brand-50);
  border: 0; border-radius: var(--r); box-shadow: var(--shadow-pop);
  padding: 6px; font-size: 14px; min-width: 200px; color: var(--text);
}
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink); }
.dropdown-item svg { color: var(--text-3); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--subtle); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-50); color: var(--ink); }
.dropdown-divider { border-color: var(--line); margin: 6px -6px; opacity: 1; }
.dropdown-header { color: var(--text-2); font-size: 12.5px; padding: 6px 10px; }

.modal-backdrop { --bs-backdrop-bg: #0a2540; --bs-backdrop-opacity: .3; }
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); color: var(--text); }
.modal-header { border-bottom: 1px solid var(--line); padding: 16px 20px; }
.modal-title { font-size: 16px; font-weight: 650; color: var(--ink); }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 20px; gap: 8px; background: var(--subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal-footer > * { margin: 0; }
.btn-close { width: 12px; height: 12px; opacity: .45; }
.btn-close:hover { opacity: .8; }

/* tabs */
.nav-tabs { border-bottom: 1px solid var(--line); gap: 20px; margin-bottom: 20px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 0; color: var(--text-2); font-weight: 500; background: none; }
.nav-tabs .nav-link:hover { color: var(--ink); }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }

.list-group-item { border-color: var(--line); color: var(--text); }
.progress { --bs-progress-bg: var(--subtle-2); border-radius: 999px; overflow: hidden; }

/* ------------------------------ Charts ------------------------------- */
.chart { position: relative; }
.chart-sm { min-height: 280px; }
.chart-lg { min-height: 300px; }
.apexcharts-tooltip.apexcharts-theme-light { border: 0 !important; box-shadow: var(--shadow-pop) !important; border-radius: var(--r) !important; font-family: var(--font) !important; }
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title { background: var(--subtle) !important; border-bottom: 1px solid var(--line) !important; font-weight: 600; }
.apexcharts-legend-text { font-family: var(--font) !important; color: var(--text-2) !important; }

/* ------------------------- Command palette --------------------------- */
.palette { position: fixed; inset: 0; z-index: 1080; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(10, 37, 64, .28); animation: fade-in .15s ease; }
.palette__dialog {
  position: relative; width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--canvas); border-radius: var(--r-lg); box-shadow: var(--shadow-pop), 0 30px 80px -20px rgba(10, 37, 64, .45);
  overflow: hidden; animation: pop-in .16s var(--ease);
}
.palette__search { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette__search > svg { width: 18px; height: 18px; color: var(--text-3); }
.palette__input { flex: 1; height: 56px; border: 0; outline: 0; font-size: 16px; color: var(--ink); background: transparent; }
.palette__input::placeholder { color: var(--text-3); }
.palette__list { overflow-y: auto; padding: 6px; }
.palette__group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; font-size: 14px; }
.palette__item svg { width: 16px; height: 16px; color: var(--text-3); }
.palette__item small { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.palette__item.is-active { background: var(--brand-50); }
.palette__item.is-active svg { color: var(--brand); }
.palette__empty { padding: 28px 12px; text-align: center; color: var(--text-3); }
.palette__foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--subtle); font-size: 12px; color: var(--text-2); }
.palette__foot kbd { margin-right: 3px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

/* ------------------------------ Empty -------------------------------- */
.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty svg { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--subtle-2); color: var(--text-3); margin-bottom: 12px; box-sizing: content-box; }
.empty__title { color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ------------------------------ Summary ------------------------------ */
.summary { display: flex; flex-wrap: wrap; gap: 0; margin: -4px 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary__item { padding: 14px 24px 14px 0; margin-right: 24px; border-right: 1px solid var(--line); min-width: 0; }
.summary__item:last-child { border-right: 0; }
.summary__label { font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.summary__value { color: var(--ink); font-weight: 500; }

/* ------------------------------ Login -------------------------------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--subtle); position: relative; overflow: hidden; }
.auth-page::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 70%;
  background:
    radial-gradient(closest-side, rgba(43, 110, 220, .16), transparent),
    radial-gradient(closest-side at 80% 60%, rgba(234, 100, 24, .12), transparent);
  transform: skewY(-8deg); pointer-events: none;
}
.auth-wrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-brand { margin-bottom: 28px; }
.auth-brand .brand__mark { width: 36px; height: 36px; }
.auth-brand .brand__word { font-size: 22px; }
.auth-card { width: 100%; max-width: 420px; background: var(--canvas); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 36px 40px; }
@media (max-width: 480px) { .auth-card { padding: 28px 22px; } }
.auth-title { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-sub { color: var(--text-2); margin: 0 0 24px; }
.auth-foot { margin-top: 20px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* ------------------------------ Misc --------------------------------- */
.footer { display: none; }
.gap-1 { gap: 4px !important; } .gap-2 { gap: 8px !important; } .gap-3 { gap: 16px !important; }
.section-title { font-size: 18px; font-weight: 650; color: var(--ink); margin: 32px 0 12px; letter-spacing: -.01em; }
.money { color: var(--ink); font-weight: 500; white-space: nowrap; }
.money .cur { color: var(--text-3); font-weight: 400; font-size: .86em; margin-left: 1px; }
.home-filters { margin: -8px 0 20px; }
.home-filters > .table-toolbar { padding: 0; border: 0; }
.page-header__sub svg { width: 14px; height: 14px; color: var(--text-3); }

/* ---------------------------- Detail pages ---------------------------- */
.detail-head__eyebrow { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.detail-head__eyebrow svg { width: 14px; height: 14px; }
.detail-head .page-header { margin-bottom: 20px; }
.detail-head__title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.money-xl { font-variant-numeric: tabular-nums; }
.money-xl span { color: var(--text-3); font-weight: 500; font-size: 22px; letter-spacing: 0; }
.detail-head__title .pill { height: 24px; font-size: 13px; padding: 0 8px; }
.detail-section { margin-bottom: 36px; }
.detail-section__head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.detail-section__head h2 { font-size: 17px; margin: 0; }
.detail-section__head > :last-child:not(h2) { margin-left: auto; }
.detail-section > .card { margin-top: 12px; }
.kv--2 { grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); }
@media (min-width: 1200px) {
  .kv--2 { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) minmax(120px, 160px) minmax(0, 1fr); column-gap: 24px; }
}
.kv--2 > dt, .kv--2 > dd { border-bottom: 1px solid var(--line); padding: 10px 0; }
.kv--stack { grid-template-columns: 1fr; }
.kv--stack > dt { padding: 10px 0 0; font-size: 13px; }
.kv--stack > dd { padding: 2px 0 10px; border-bottom: 1px solid var(--line); }
.kv--stack > dd:last-child { border-bottom: 0; }
.filter-pill--more { border-style: solid; border-color: transparent; color: var(--text-2); }
.filter-pill--more:hover { border-color: transparent; }
.cell-sub .money { color: var(--text-2); font-weight: 400; }
.summary__item:last-child { margin-right: 0; padding-right: 0; }
