/* ==========================================================================
   Yollda Admin — UI layer (top menu redesign, Nov 2026)
   --------------------------------------------------------------------------
   Loads after every other stylesheet. It owns:
     · the colour/type tokens of the UI/UX spec (light + dark),
     · the older --y-* / --yollda-* tokens, re-pointed at those, so every page
       written against yollda-ds.css follows the new palette unchanged,
     · the top menu, panels, palette and the shared components.
   Grid: 8px. Radii: 6 controls · 10 cards · 14 modals. Weights 400/500/600.
   ========================================================================== */

/* ── 0 · Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --subtle: #F1F3F6;
  --subtle-2: #E9ECF1;
  --border: #E4E7EC;
  --border-strong: #D3D8E0;
  --text: #0F172A;
  --n800: #1E293B;
  --n700: #334155;
  --n600: #475569;
  --muted: #64748B;
  --faint: #94A3B8;

  --brand: #1F6F5C;
  --brand-hover: #185949;
  --brand-ink: #17594A;
  --brand-fg: #FFFFFF;
  --brand-50: #E8F3EF;
  --brand-100: #CFE6DD;
  --brand-300: #8FC2AF;
  --brand-600: #2E8A72;
  --brand-900: #0E3B30;
  --brand-soft: rgba(31, 111, 92, .08);
  --brand-soft-2: rgba(31, 111, 92, .14);
  --focus: rgba(31, 111, 92, .28);

  --success: #16A34A; --success-text: #15803D; --success-bg: #EAF7EF; --success-bd: #BFE6CD;
  --warning: #D97706; --warning-text: #B45309; --warning-bg: #FEF3E2; --warning-bd: #F8D9A8;
  --danger:  #DC2626; --danger-text:  #B91C1C; --danger-bg:  #FDEDED; --danger-bd:  #F6C5C5;
  --info:    #2563EB; --info-text:    #1D4ED8; --info-bg:    #EBF1FE; --info-bd:    #C6D6FB;
  --neutral: #94A3B8;

  --map-water: #CFE2EA;
  --scrim: rgba(15, 23, 42, .32);
  --shadow-pop: 0 16px 40px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .06);
  --shadow-float: 0 8px 24px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .06);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --r-ctl: 6px; --r-card: 10px; --r-modal: 14px;
  --nav-h: 64px;
  --gutter: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D12; --surface: #12151C; --subtle: #1A1E27; --subtle-2: #222733;
    --border: #262B36; --border-strong: #343B49; --text: #E8ECF3;
    --n800: #D9DEE7; --n700: #C3CAD6; --n600: #A3ACBC; --muted: #8A94A6; --faint: #677184;
    --brand: #2FA383; --brand-hover: #38B893; --brand-ink: #6FD3B4; --brand-fg: #05130F;
    --brand-50: #12302A; --brand-100: #18413A; --brand-300: #22594C; --brand-600: #2A7A64; --brand-900: #0B2B26;
    --brand-soft: rgba(47, 163, 131, .12); --brand-soft-2: rgba(47, 163, 131, .2); --focus: rgba(47, 163, 131, .35);
    --success: #22C55E; --success-text: #4ADE80; --success-bg: #0F2A1B; --success-bd: #1C4A30;
    --warning: #F59E0B; --warning-text: #FBBF24; --warning-bg: #2A1F0B; --warning-bd: #4A3714;
    --danger:  #EF4444; --danger-text:  #F87171; --danger-bg:  #2C1416; --danger-bd:  #4E2226;
    --info:    #3B82F6; --info-text:    #60A5FA; --info-bg:    #121D33; --info-bd:    #22365C;
    --neutral: #6B7486;
    --map-water: #0D1820;
    --scrim: rgba(0, 0, 0, .55);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .4);
    --shadow-float: 0 8px 24px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0D12; --surface: #12151C; --subtle: #1A1E27; --subtle-2: #222733;
  --border: #262B36; --border-strong: #343B49; --text: #E8ECF3;
  --n800: #D9DEE7; --n700: #C3CAD6; --n600: #A3ACBC; --muted: #8A94A6; --faint: #677184;
  --brand: #2FA383; --brand-hover: #38B893; --brand-ink: #6FD3B4; --brand-fg: #05130F;
  --brand-50: #12302A; --brand-100: #18413A; --brand-300: #22594C; --brand-600: #2A7A64; --brand-900: #0B2B26;
  --brand-soft: rgba(47, 163, 131, .12); --brand-soft-2: rgba(47, 163, 131, .2); --focus: rgba(47, 163, 131, .35);
  --success: #22C55E; --success-text: #4ADE80; --success-bg: #0F2A1B; --success-bd: #1C4A30;
  --warning: #F59E0B; --warning-text: #FBBF24; --warning-bg: #2A1F0B; --warning-bd: #4A3714;
  --danger:  #EF4444; --danger-text:  #F87171; --danger-bg:  #2C1416; --danger-bd:  #4E2226;
  --info:    #3B82F6; --info-text:    #60A5FA; --info-bg:    #121D33; --info-bd:    #22365C;
  --neutral: #6B7486;
  --map-water: #0D1820;
  --scrim: rgba(0, 0, 0, .55);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .4);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* The older tokens (yollda-ds.css, custom_admin.css and the pages written
   against them) now read the spec's palette. Both selectors are needed:
   yollda-ds.css sets its dark values under :root[data-theme="dark"]. */
:root, :root[data-theme="dark"] {
  --y-g50: var(--bg); --y-g100: var(--subtle); --y-g200: var(--border); --y-g300: var(--border-strong);
  --y-g400: var(--faint); --y-g500: var(--muted); --y-g600: var(--n600); --y-g700: var(--n700);
  --y-g800: var(--n800); --y-g900: var(--text);
  --y-card: var(--surface); --y-sidebar: var(--surface);
  --y-d500: var(--brand-50); --y-d600: var(--brand-100); --y-d650: var(--brand-300); --y-d700: var(--brand-600);
  --y-d800: var(--brand); --y-d900: var(--brand-hover); --y-d1k: var(--brand-900);
  --y-b100: var(--success-bg); --y-b500: var(--success); --y-b700: var(--success); --y-b900: var(--success);
  --y-b-ink: var(--success-text); --y-b-bd: var(--success-bd);
  --y-warn: var(--warning); --y-warn-bg: var(--warning-bg); --y-warn-ink: var(--warning-text); --y-warn-bd: var(--warning-bd); --y-warn-hover: var(--warning);
  --y-dngr: var(--danger); --y-dngr-bg: var(--danger-bg); --y-dngr-ink: var(--danger-text); --y-dngr-bd: var(--danger-bd); --y-dngr-hover: var(--danger);
  --y-info: var(--info); --y-info-bg: var(--info-bg); --y-info-ink: var(--info-text); --y-info-bd: var(--info-bd);
  --y-badge-brand-bg: var(--brand-50); --y-badge-brand-ink: var(--brand-ink);
  --y-focus: var(--focus);
  --y-s1-hover: var(--brand-hover);
  --y-radius: var(--r-card); --y-radius-sm: var(--r-ctl);
  --y-font: var(--font);
  --y-shadow-pop: var(--shadow-pop);
  --yollda-primary: var(--brand); --yollda-secondary: var(--brand-hover); --yollda-accent: var(--brand);
  --yollda-green: var(--success); --yollda-green-hover: var(--success);
  --input-border: var(--border); --input-focus-shadow: 0 0 0 3px var(--focus);
}

/* ── 1 · Base ───────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body, body.y-body {
  font-family: var(--font) !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: var(--text) !important;
  background: var(--bg) !important;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  letter-spacing: -.01em !important;
  text-wrap: balance;
}
.y-body h1, .y-body .h1 { font-size: 20px !important; line-height: 28px !important; }
.y-body h2, .y-body .h2 { font-size: 16px !important; line-height: 24px !important; }
.y-body h3, .y-body .h3 { font-size: 15px !important; }
.y-body h4, .y-body .h4 { font-size: 14px !important; }
.y-body h5, .y-body .h5 { font-size: 14px !important; }
.y-body h6, .y-body .h6 { font-size: 12px !important; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
b, strong, .font-weight-bold, .fw-bold, .font-weight-bolder { font-weight: 600 !important; }
td, .num, .y-num, .kpi-value, .stat-value { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-soft-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.yi { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.y-muted { color: var(--muted) !important; }
.y-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 11px/1 var(--font); padding: 3px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); box-shadow: none; }

/* ── 2 · Shell ──────────────────────────────────────────────────────────── */
/* The Argon sidebar and its margins are gone; nothing reserves room for them. */
.sidenav, #sidenav-main, .navbar-top { display: none !important; }
.main-content, .y-main { margin-left: 0 !important; }

.y-main {
  display: block;
  max-width: 1600px;
  margin: 0 auto;
  padding-block: 24px 40px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  min-height: calc(100vh - var(--nav-h));
}
.y-main.y-main-flush { max-width: none; padding: 0; }

.y-topnav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1030;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font);
}
.y-brand { display: flex; align-items: center; gap: 8px; color: var(--text) !important; text-decoration: none !important; flex: none; }
.y-brand img { width: 30px; height: 30px; display: block; }
.y-brand-name { font-size: 21px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.y-brand-tag { font-size: 11px; font-weight: 600; color: var(--brand-ink); background: var(--brand-50); padding: 3px 6px; border-radius: 5px; line-height: 1; }

.y-menu { display: flex; align-items: stretch; gap: 2px; height: 100%; min-width: 0; }
.y-menu-item { position: relative; display: flex; align-items: stretch; }
.y-menu-btn {
  position: relative; height: 100%; padding: 0 12px;
  border: 0; background: transparent; color: var(--text);
  font: 500 15px/1 var(--font); display: flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap;
}
.y-menu-btn .y-caret { color: var(--muted); transition: transform .15s ease-out; }
/* Hover and open: a quiet grey pill behind the label, text stays dark. */
.y-menu-btn::before { content: ""; position: absolute; inset: 12px 2px; border-radius: 8px; background: transparent; z-index: -1; transition: background-color .15s ease-out; }
.y-menu-btn { z-index: 0; }
.y-menu-btn:hover::before, .y-menu-btn:focus-visible::before, .y-menu-btn[aria-expanded="true"]::before { background: var(--subtle); }
.y-menu-btn:hover .y-caret, .y-menu-btn[aria-expanded="true"] .y-caret { color: var(--text); }
.y-menu-btn[aria-expanded="true"] .y-caret { transform: rotate(180deg); }
.y-menu-btn:focus-visible { outline: none !important; }
.y-menu-btn:focus-visible::before { box-shadow: 0 0 0 2px var(--brand); }
.y-menu-btn.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.y-urgent-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); display: inline-block; flex: none; }

.y-pop {
  position: absolute; top: calc(100% - 4px); left: 0; z-index: 1040;
  min-width: 260px; max-height: min(70vh, 640px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop); padding: 8px;
}
.y-pop[hidden] { display: none !important; }
.y-pop-right { left: auto; right: 0; top: calc(100% + 8px); }
.y-mega.has-cols { display: grid; grid-template-columns: repeat(2, minmax(230px, 1fr)); gap: 0 16px; min-width: 520px; }
.y-mega.has-cols:has(.y-mega-col:nth-child(3)) { grid-template-columns: repeat(3, minmax(220px, 1fr)); min-width: 720px; }
.y-pop-title { margin: 8px 10px 6px !important; font-size: 11px !important; line-height: 16px !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: .06em !important; color: var(--faint) !important; }
.y-pop-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.y-pop-note { margin: 6px 10px 4px; font-size: 12px; color: var(--muted); max-width: 240px; }
.y-pop-note b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.y-mi {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text) !important; text-decoration: none !important;
  font: 400 14px/1.3 var(--font); text-align: left; cursor: pointer;
}
.y-mi .yi { color: var(--muted); }
.y-mi:hover, .y-mi:focus-visible { background: var(--subtle); }
.y-mi.is-on { background: var(--brand-soft); color: var(--brand-ink) !important; font-weight: 500; }
.y-mi.is-on .yi { color: var(--brand); }
.y-mi-label { flex: 1; min-width: 0; }
.y-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--subtle); color: var(--muted); font-variant-numeric: tabular-nums; }
.y-count.urgent { background: var(--danger); color: #fff; }

.y-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.y-ws { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.y-ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.y-ws.is-live .y-ws-dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.y-ws.is-off .y-ws-dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.y-plus { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-fg); display: grid; place-items: center; cursor: pointer; }
.y-plus:hover { background: var(--brand-hover); }
.y-round { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--subtle); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.y-round:hover { background: var(--subtle-2); }
.y-pip { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.y-pip[hidden] { display: none; }
.y-org { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; max-width: 240px; }
.y-org:hover { background: var(--subtle); }
.y-org .y-caret { color: var(--muted); }
.y-org-name { overflow: hidden; text-overflow: ellipsis; }
.y-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-fg); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; letter-spacing: .02em; }
.y-avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.y-profile { min-width: 280px; }
.y-profile-head { display: flex; gap: 12px; align-items: center; padding: 8px 10px 4px; }
.y-profile-who b { display: block; font-weight: 600; }
.y-profile-who small { color: var(--muted); font-size: 12.5px; }
.y-seg { display: inline-flex; background: var(--subtle); border-radius: 999px; padding: 3px; gap: 2px; }
.y-seg button, .y-seg a { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 13px/1 var(--font); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.y-seg button:hover, .y-seg a:hover { color: var(--text); }
.y-seg [aria-pressed="true"], .y-seg .is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.y-theme-switch { display: flex; margin: 0 4px 4px; }
.y-theme-switch button { flex: 1; justify-content: center; }
.y-langs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 4px; }
.y-langs form { margin: 0; }
.y-lang { height: 32px; min-width: 44px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 12.5px/1 var(--font); cursor: pointer; }
.y-lang:hover { background: var(--subtle); }
.y-lang.is-on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

.y-icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.y-icon-btn:hover { background: var(--subtle); color: var(--text); }
.y-burger { display: none; }

/* Mobile menu panel */
.y-mnav { position: fixed; inset: 0 auto 0 0; z-index: 1060; width: min(320px, 86vw); background: var(--surface); box-shadow: var(--shadow-pop); overflow-y: auto; padding: 0 8px max(16px, env(safe-area-inset-bottom, 0px)); padding-top: env(safe-area-inset-top, 0px); }
.y-mnav[hidden] { display: none; }
.y-mnav-head { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); padding: 0 8px; margin: 0 -8px 8px; border-bottom: 1px solid var(--border); padding-left: 16px; }
.y-mnav-sec { border-bottom: 1px solid var(--border); padding: 4px 0 8px; }
.y-mnav-sec summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; font-weight: 600; cursor: pointer; }
.y-mnav-sec summary::-webkit-details-marker { display: none; }
.y-mnav-sec summary .y-caret { margin-left: auto; color: var(--muted); transition: transform .15s; }
.y-mnav-sec[open] summary .y-caret { transform: rotate(180deg); }

/* Right-hand drawers (alerts, details) and the scrim */
.y-scrim { position: fixed; inset: 0; z-index: 1050; background: var(--scrim); }
.y-scrim[hidden] { display: none; }
.y-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1065; width: min(720px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.y-drawer[hidden] { display: none; }
.y-drawer-narrow { width: min(400px, 100vw); }
.y-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); }
.y-drawer-head h2 { margin: 0 !important; font-size: 16px !important; display: flex; align-items: center; gap: 8px; }
.y-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.y-notif { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: 8px; background: var(--surface); }
.y-notif-top { display: flex; gap: 10px; align-items: flex-start; }
.y-notif-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--warning-bg); color: var(--warning-text); }
.y-notif b { display: block; font-weight: 600; font-size: 14px; }
.y-notif p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.y-notif small { color: var(--faint); font-size: 12px; }
.y-notif-acts { display: flex; gap: 6px; padding-left: 42px; }

/* Command palette */
.y-palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); z-index: 1070; width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-modal); box-shadow: var(--shadow-pop); overflow: hidden; }
.y-palette[hidden] { display: none; }
.y-palette-in { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.y-palette-in input { flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; font: 400 16px/1 var(--font) !important; color: var(--text) !important; height: 100% !important; padding: 0 !important; }
.y-palette-list { max-height: min(440px, 60vh); overflow: auto; padding: 6px; }
.y-palette-list .y-mi { min-height: 40px; }
.y-palette-list .y-mi.is-kb { background: var(--subtle); }
.y-palette-list .y-mi small { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.y-palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.y-palette-foot kbd { margin-right: 2px; }

/* ── 3 · Page header, tabs, toolbar ────────────────────────────────────── */
.y-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.y-page-head h1 { margin: 0 !important; }
.y-page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.y-page-head .y-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.y-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.y-eyebrow a { color: var(--muted); }
.y-eyebrow a:hover { color: var(--brand); }

.y-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; }
.y-tabs::-webkit-scrollbar { display: none; }
.y-tab { position: relative; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted) !important; font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none !important; border: 0; background: transparent; cursor: pointer; }
.y-tab:hover { color: var(--text) !important; }
.y-tab.is-on { color: var(--text) !important; }
.y-tab.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.y-tab .y-tab-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.y-tab.is-on .y-tab-count { color: var(--brand); }
.y-tabbar { display: flex; align-items: stretch; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.y-tabbar .y-tabs { border-bottom: 0; margin: 0; flex: 1; min-width: 0; }
.y-tabs-more { flex: none; }
.y-tabs-more .y-pop { top: 100%; }

.y-btn { height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; font: 500 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.y-btn:hover { background: var(--subtle); }
.y-btn.is-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg) !important; }
.y-btn.is-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.y-btn.is-ghost { border-color: transparent; background: transparent; color: var(--muted) !important; }
.y-btn.is-ghost:hover { background: var(--subtle); color: var(--text) !important; }
.y-btn.is-danger { background: var(--danger); border-color: var(--danger); color: #fff !important; }
.y-btn.is-danger-ghost { color: var(--danger-text) !important; }
.y-btn.is-danger-ghost:hover { background: var(--danger-bg); }
.y-btn.is-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.y-btn.is-pill { border-radius: 999px; }
.y-btn[disabled] { opacity: .5; cursor: not-allowed; }

.y-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.y-toolbar .y-spacer { flex: 1; }
.y-search { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--subtle); border: 1px solid transparent; border-radius: 8px; flex: 0 1 340px; min-width: 220px; color: var(--muted); }
.y-search:focus-within { border-color: var(--brand); background: var(--surface); }
.y-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 100% !important; font: 400 14px/1 var(--font) !important; color: var(--text) !important; }
.y-select { position: relative; display: inline-flex; }
.y-select select {
  appearance: none; -webkit-appearance: none;
  height: 36px !important; padding: 0 30px 0 12px !important; border-radius: 999px !important;
  border: 1px solid transparent !important; background: var(--subtle) !important; color: var(--text) !important;
  font: 500 13.5px/1 var(--font) !important; cursor: pointer; max-width: 260px; box-shadow: none !important;
}
.y-select select:hover { background: var(--subtle-2) !important; }
.y-select select.is-set { background: var(--brand-soft) !important; color: var(--brand-ink) !important; border-color: var(--brand-100) !important; }
.y-select .yi { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.y-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -4px 0 12px; }
.y-chip { height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink) !important; font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none !important; }
.y-chip .y-chip-x { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.y-chip:hover .y-chip-x { background: var(--brand-soft-2); }
.y-chip-clear { font-size: 12.5px; font-weight: 500; padding: 0 6px; }

/* ── 4 · Cards, badges, empty and loading states ───────────────────────── */
.y-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.y-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.y-card-head h2 { margin: 0 !important; font-size: 15px !important; }
.y-card-body { padding: 16px 20px 20px; }
.y-st { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--subtle); color: var(--n700); }
.y-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--neutral); }
.y-st.is-success { background: var(--success-bg); color: var(--success-text); } .y-st.is-success::before { background: var(--success); }
.y-st.is-warning { background: var(--warning-bg); color: var(--warning-text); } .y-st.is-warning::before { background: var(--warning); }
.y-st.is-danger { background: var(--danger-bg); color: var(--danger-text); } .y-st.is-danger::before { background: var(--danger); }
.y-st.is-info { background: var(--info-bg); color: var(--info-text); } .y-st.is-info::before { background: var(--info); }
.y-st.is-outline { background: transparent; border: 1px solid var(--border); }
.y-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.y-empty-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--subtle); display: grid; place-items: center; color: var(--muted); }
.y-empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.y-empty p { margin: 0; max-width: 420px; font-size: 13.5px; }
.y-skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--subtle) 0%, var(--subtle-2) 50%, var(--subtle) 100%); background-size: 200% 100%; animation: y-shimmer 1.2s linear infinite; }
@keyframes y-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.y-selector-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; margin: 8px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-card); text-align: center; color: var(--muted); font-size: 13px; }
.y-selector-empty b { color: var(--n700); font-weight: 600; }

/* ── 5 · Bootstrap / Argon components on the new tokens ────────────────── */
.card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--r-card) !important; box-shadow: none !important; }
.card.shadow, .card.shadow-sm, .card.shadow-lg { box-shadow: none !important; }
.card-header, .card-footer { background: transparent !important; border-color: var(--border) !important; }
.btn { border-radius: var(--r-ctl) !important; font-family: var(--font) !important; font-weight: 500 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important; }
.btn-primary, .btn-success { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--brand-fg) !important; }
.btn-primary:hover, .btn-success:hover { background: var(--brand-hover) !important; border-color: var(--brand-hover) !important; }
.btn-secondary, .btn-default, .btn-light, .btn-outline-secondary, .btn-neutral { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.btn-secondary:hover, .btn-default:hover, .btn-light:hover, .btn-outline-secondary:hover, .btn-neutral:hover { background: var(--subtle) !important; }
.btn-danger { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-warning { background: var(--warning) !important; border-color: var(--warning) !important; color: #fff !important; }
.btn-info { background: var(--info) !important; border-color: var(--info) !important; color: #fff !important; }
.badge { border-radius: 999px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; }
.dropdown-menu { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--r-card) !important; box-shadow: var(--shadow-pop) !important; padding: 6px !important; }
.dropdown-item { border-radius: var(--r-ctl) !important; color: var(--text) !important; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--subtle) !important; }
.modal-content { background: var(--surface) !important; border: 0 !important; border-radius: var(--r-modal) !important; box-shadow: var(--shadow-pop) !important; color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border) !important; }
.nav-tabs { border-bottom: 1px solid var(--border) !important; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs .nav-link { border: 0 !important; background: transparent !important; color: var(--muted) !important; font-weight: 500 !important; font-size: 14px !important; padding: 10px 12px !important; position: relative; white-space: nowrap; border-radius: 0 !important; }
.nav-tabs .nav-link:hover { color: var(--text) !important; }
.nav-tabs .nav-link.active { color: var(--text) !important; }
.nav-tabs .nav-link.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px; background: var(--brand); }
.breadcrumb { background: transparent !important; padding: 0 !important; margin: 0 0 4px !important; font-size: 12.5px; }
.breadcrumb-item, .breadcrumb-item a { color: var(--muted) !important; }
.breadcrumb-item.active { color: var(--n700) !important; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--faint) !important; }
.table { color: var(--text) !important; }
.table thead th { background: var(--subtle) !important; color: var(--muted) !important; font-size: 12.5px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; border-color: var(--border) !important; }
.table td { border-color: var(--border) !important; }

/* Form controls */
.y-body input[type="text"], .y-body input[type="email"], .y-body input[type="number"], .y-body input[type="password"],
.y-body input[type="url"], .y-body input[type="tel"], .y-body input[type="search"], .y-body input[type="date"],
.y-body input[type="datetime-local"], .y-body input[type="time"], .y-body textarea, .y-body select,
.y-body .form-control, .y-body .vTextField, .y-body .vLargeTextField, .y-body .vIntegerField, .y-body .vDateField, .y-body .vTimeField {
  font-family: var(--font) !important;
  font-size: 14px !important;
  color: var(--text) !important;
  background-color: var(--subtle) !important;
  border: 1px solid transparent !important;
  border-radius: var(--r-ctl) !important;
  box-shadow: none !important;
  min-height: 40px;
  padding: 8px 12px !important;
  transition: border-color .15s, background-color .15s;
}
.y-body textarea { min-height: 88px; line-height: 1.45 !important; }
.y-body select { padding-right: 32px !important; }
.y-body select[multiple] { padding: 6px !important; }
.y-body input:focus, .y-body textarea:focus, .y-body select:focus, .y-body .form-control:focus {
  border-color: var(--brand) !important;
  background-color: var(--surface) !important;
  box-shadow: 0 0 0 3px var(--focus) !important;
  outline: none !important;
}
.y-body input[type="checkbox"], .y-body input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; min-height: 0; cursor: pointer; }
.y-body input[type="file"] { min-height: 0; padding: 6px !important; background: transparent !important; border: 1px dashed var(--border-strong) !important; }
.y-body input::placeholder, .y-body textarea::placeholder { color: var(--faint) !important; }
.y-body .errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger-text); font-size: 12.5px; }
.y-body .errors input, .y-body .errors select, .y-body .errors textarea { border-color: var(--danger) !important; background-color: var(--danger-bg) !important; }
.y-body .help, .y-body .helptext, .y-body .form-text { color: var(--muted) !important; font-size: 12.5px !important; }

/* Messages from Django */
.messagelist { list-style: none; margin: 0 0 16px !important; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.messagelist li {
  margin: 0 !important; padding: 10px 14px 10px 40px !important; border-radius: var(--r-card) !important;
  border: 1px solid var(--success-bd) !important; background: var(--success-bg) !important; color: var(--success-text) !important;
  font-size: 13.5px !important; position: relative; background-image: none !important;
}
.messagelist li::before { content: ""; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--success); }
.messagelist li.warning { border-color: var(--warning-bd) !important; background: var(--warning-bg) !important; color: var(--warning-text) !important; }
.messagelist li.warning::before { background: var(--warning); }
.messagelist li.error { border-color: var(--danger-bd) !important; background: var(--danger-bg) !important; color: var(--danger-text) !important; }
.messagelist li.error::before { background: var(--danger); }
.messagelist li.info { border-color: var(--info-bd) !important; background: var(--info-bg) !important; color: var(--info-text) !important; }
.messagelist li.info::before { background: var(--info); }

/* ── 6 · Changelist ────────────────────────────────────────────────────── */
.y-cl-table { overflow: auto; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); max-height: calc(100vh - 230px); }
.y-cl-table table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; margin: 0; }
.y-cl-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--subtle); color: var(--muted); text-align: left; white-space: nowrap;
  font-weight: 500; font-size: 12.5px; height: 40px; padding: 0 12px; border-bottom: 1px solid var(--border);
}
.y-cl-table thead th a { color: var(--muted) !important; text-decoration: none !important; display: inline-flex; align-items: center; gap: 4px; }
.y-cl-table thead th a:hover { color: var(--text) !important; }
.y-cl-table thead th.sorted a, .y-cl-table thead th.sorted { color: var(--text) !important; }
.y-cl-table thead th .y-sort-x { color: var(--faint) !important; margin-left: 4px; }
.y-cl-table tbody td, .y-cl-table tbody th {
  height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface);
  color: var(--text); vertical-align: middle; white-space: nowrap; font-weight: 400; text-align: left;
}
.y-cl-table tbody tr:last-child td, .y-cl-table tbody tr:last-child th { border-bottom: 0; }
.y-cl-table tbody tr:hover td, .y-cl-table tbody tr:hover th { background: var(--subtle); }
.y-cl-table tbody tr.selected td, .y-cl-table tbody tr.selected th { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.y-cl-table tbody th a, .y-cl-table tbody td a:not(.btn) { color: var(--text); font-weight: 500; }
.y-cl-table tbody th a:hover, .y-cl-table tbody td a:not(.btn):hover { color: var(--brand); }
.y-cl-table .action-checkbox, .y-cl-table .action-checkbox-column { width: 44px; padding-left: 16px !important; padding-right: 4px !important; }
.y-cl-table td.field-actions, .y-cl-table td:has(> .btn) { white-space: nowrap; }
.y-cl-table td img { border-radius: 6px; max-height: 36px; }
.y-cl-table tbody tr { cursor: pointer; }
.y-cl-table td.field-_actions { width: 44px; text-align: right; padding-right: 12px; }
.y-cl-table .y-row-open { width: 28px; height: 28px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--faint) !important; }
.y-cl-table tbody tr:hover .y-row-open { color: var(--text) !important; background: var(--subtle-2); }
.y-cl-table thead th { text-transform: none !important; letter-spacing: 0 !important; font-size: 12.5px !important; }
/* Composite controls: the base input rules must not fill their inner fields. */
.y-body .y-search input[type], .y-body .y-search input { background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 0 !important; padding: 0 !important; height: 100% !important; }
.y-body .y-select select { height: 36px !important; min-height: 36px !important; padding: 0 30px 0 12px !important; border-radius: 999px !important; border: 1px solid transparent !important; background-color: var(--subtle) !important; font: 500 13.5px/1 var(--font) !important; }
.y-body .y-select select:hover { background-color: var(--subtle-2) !important; }
.y-body .y-select select.is-set { background-color: var(--brand-soft) !important; color: var(--brand-ink) !important; border-color: var(--brand-100) !important; }
.y-body .y-palette-in input { background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 0 !important; padding: 0 !important; height: 100% !important; }
.y-dense .y-cl-table tbody td, .y-dense .y-cl-table tbody th { height: 34px; padding-top: 2px; padding-bottom: 2px; }
.y-cl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px 0; font-size: 13px; color: var(--muted); }
.y-pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.y-pager a, .y-pager span.y-pg { min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-ctl); display: inline-grid; place-items: center; color: var(--text) !important; text-decoration: none !important; font-variant-numeric: tabular-nums; font-size: 13px; border: 1px solid transparent; }
.y-pager a:hover { background: var(--subtle); }
.y-pager .is-on { background: var(--surface); border-color: var(--border-strong); font-weight: 600; }
.y-pager .is-off { color: var(--faint) !important; pointer-events: none; }
.y-pager .y-gap { color: var(--faint); padding: 0 2px; }
.y-cl-count { font-variant-numeric: tabular-nums; }
.y-date-hier { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.y-date-hier a, .y-date-hier span { height: 28px; padding: 0 10px; border-radius: 999px; background: var(--subtle); display: inline-flex; align-items: center; color: var(--n700) !important; font-size: 12.5px; text-decoration: none !important; }
.y-date-hier a:hover { background: var(--subtle-2); }
.y-date-hier .is-back { background: transparent; color: var(--muted) !important; }

/* Bulk action bar: replaces Django's "action + Go" row */
.y-bulk { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, calc(100% + 48px)); visibility: hidden; z-index: 1045; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; background: var(--text); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-pop); transition: transform .2s ease-out, visibility .2s; max-width: calc(100vw - 32px); overflow-x: auto; }
.y-bulk.is-on { transform: translate(-50%, 0); visibility: visible; }
.y-bulk b { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.y-bulk button { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.y-bulk button:hover { background: color-mix(in srgb, var(--bg) 16%, transparent); }
.y-bulk button.is-danger { color: #FCA5A5; }
.y-bulk .y-bulk-sep { width: 1px; height: 20px; background: color-mix(in srgb, var(--bg) 28%, transparent); margin: 0 4px; flex: none; }
.y-bulk .y-bulk-all { font-size: 12.5px; opacity: .85; white-space: nowrap; padding: 0 6px; }
.y-bulk .y-bulk-all a { color: inherit !important; text-decoration: underline !important; }
.y-actions-legacy { display: none !important; }

/* ── 7 · Change form ───────────────────────────────────────────────────── */
.y-form-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.y-form-head h1 { margin: 0 !important; }
.y-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.y-form-card > form > .nav-tabs, .y-form-card .nav-tabs#fieldsets-tabs { padding: 0 12px; margin: 0; position: sticky; top: var(--nav-h); background: var(--surface); z-index: 5; border-radius: var(--r-card) var(--r-card) 0 0; }
.y-form-card .tab-content { padding: 20px 24px 8px; }
.y-form-card fieldset.module { border: 0 !important; padding: 0 !important; margin: 0 0 16px !important; background: transparent !important; box-shadow: none !important; }
.y-form-card .fieldset-name { font-size: 15px !important; margin: 0 0 16px !important; padding: 0 !important; background: transparent !important; color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; }
.y-form-card .description { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }
.yollda-field-row { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; padding: 0 0 16px !important; margin: 0 !important; border: 0 !important; background: transparent !important; }
.yollda-field-row.hidden { display: none !important; }
.yollda-field-inner { display: flex !important; flex-direction: column; gap: 6px; min-width: 0; margin: 0 !important; padding: 0 !important; width: auto !important; }
.yollda-label-col { width: auto !important; max-width: none !important; padding: 0 !important; flex: none !important; }
.yollda-label-col label { font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important; margin: 0 !important; padding: 0 !important; width: auto !important; float: none !important; text-transform: none !important; letter-spacing: 0 !important; }
.yollda-label-col .required-mark { color: var(--danger); margin-left: 2px; }
.yollda-input-col { padding: 0 !important; width: 100% !important; max-width: none !important; flex: 1 !important; min-width: 0; }
.yollda-input-col > input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.yollda-input-col > select, .yollda-input-col > textarea, .yollda-input-col .related-widget-wrapper select { width: 100% !important; max-width: 100% !important; }
.yollda-input-col .related-widget-wrapper { display: flex; align-items: center; gap: 6px; width: 100%; }
.yollda-input-col .related-widget-wrapper > select, .yollda-input-col .related-widget-wrapper > .select2 { flex: 1; min-width: 0; }
.yollda-field-checkbox { flex-direction: row-reverse !important; justify-content: flex-end; align-items: center; gap: 10px !important; }
.yollda-field-checkbox .yollda-input-col { flex: none !important; width: auto !important; }
.yollda-field-checkbox .yollda-label-col label { font-weight: 500 !important; }
.readonly { min-height: 40px; display: flex; align-items: center; padding: 8px 12px; border-radius: var(--r-ctl); background: transparent; border: 1px dashed var(--border); color: var(--n700); font-size: 14px; word-break: break-word; }
.y-submit-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--r-card) var(--r-card); }
.y-submit-bar .y-spacer { flex: 1; }
.cf-error-summary { display: flex; gap: 12px; padding: 12px 16px; margin: 0 0 16px !important; border-radius: var(--r-card); background: var(--danger-bg) !important; border: 1px solid var(--danger-bd) !important; color: var(--danger-text) !important; }
.cf-error-summary ul { margin: 4px 0 0; padding-left: 18px; }

/* Inline formsets */
.y-form-card .inline-group, .y-form-card .tabular { border: 0 !important; background: transparent !important; }
.y-form-card .inline-group table, .y-form-card .tabular table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.y-form-card .inline-group th, .y-form-card .tabular th { background: var(--subtle) !important; color: var(--muted) !important; font-size: 12.5px !important; font-weight: 500 !important; padding: 10px 12px !important; border-bottom: 1px solid var(--border) !important; text-transform: none !important; }
.y-form-card .inline-group td, .y-form-card .tabular td { padding: 8px 12px !important; border-bottom: 1px solid var(--border) !important; background: var(--surface) !important; vertical-align: middle; }
.y-form-card .inline-group h2, .y-form-card .inline-group .module h2 { font-size: 15px !important; background: transparent !important; color: var(--text) !important; padding: 0 0 12px !important; margin: 0 !important; text-transform: none !important; }

/* Django's own pages (delete confirmations, import/export, simple forms) */
.y-dj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 24px; }
.y-dj-head .breadcrumbs { background: transparent !important; color: var(--muted) !important; padding: 0 !important; margin: 0 0 4px !important; font-size: 12.5px; border: 0 !important; }
.y-dj-head .breadcrumbs a { color: var(--muted) !important; }
.y-dj-head .breadcrumbs a:hover { color: var(--brand) !important; }
.y-dj .object-tools { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; float: none; }
.y-dj .object-tools a { height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--border); display: inline-flex; align-items: center; color: var(--text) !important; background: var(--surface); text-decoration: none !important; font-weight: 500; text-transform: none; letter-spacing: 0; }
.y-dj .object-tools a:hover { background: var(--subtle); }
.y-dj > .card, .y-dj .card { border: 0 !important; padding: 0 !important; }
.y-dj > .card > .card-body, .y-dj .card-body { padding: 0 !important; }
.y-dj > :last-child { margin-bottom: 0 !important; }
.y-dj .module { border: 0 !important; background: transparent !important; box-shadow: none !important; margin: 0 0 16px !important; }
.y-dj .module h2, .y-dj fieldset h2 { font-size: 15px !important; background: transparent !important; color: var(--text) !important; padding: 0 0 12px !important; text-transform: none !important; letter-spacing: 0 !important; }
.y-dj .form-row { padding: 0 0 16px !important; border: 0 !important; }
.y-dj .form-row label, .y-dj .aligned label { display: block; float: none !important; width: auto !important; font-weight: 600; font-size: 13px; margin: 0 0 6px; padding: 0 !important; color: var(--text); }
.y-dj .aligned .help, .y-dj .aligned p.help { margin-left: 0 !important; padding-left: 0 !important; }
.y-dj .submit-row, .submit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 0 0 !important; margin: 0 !important; background: transparent !important; border: 0 !important; border-top: 1px solid var(--border) !important; }
.y-dj input[type="submit"], .y-dj button[type="submit"], .submit-row input[type="submit"] { height: 40px; padding: 0 18px !important; border-radius: var(--r-ctl) !important; border: 0 !important; background: var(--brand) !important; color: var(--brand-fg) !important; font: 500 14px/1 var(--font) !important; cursor: pointer; min-height: 0; }
.y-dj input[type="submit"]:hover, .y-dj button[type="submit"]:hover { background: var(--brand-hover) !important; }
.y-dj a.button, .y-dj .cancel-link, .submit-row a.button { height: 40px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; text-decoration: none !important; font-weight: 500; }
.y-dj ul { padding-left: 20px; }
.y-dj table { width: 100%; border-collapse: separate; border-spacing: 0; }
.y-dj table th, .y-dj table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.y-dj table thead th { background: var(--subtle); color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* select2 on the new tokens */
.select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple,
.select2-container--admin-autocomplete .select2-selection--single, .select2-container--admin-autocomplete .select2-selection--multiple {
  min-height: 40px !important; background: var(--subtle) !important; border: 1px solid transparent !important; border-radius: var(--r-ctl) !important; background-image: none !important;
}
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px !important; color: var(--text) !important; padding-left: 12px !important; font-style: normal !important; }
.select2-container .select2-selection--single .select2-selection__arrow { height: 38px !important; }
.select2-dropdown { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--r-card) !important; box-shadow: var(--shadow-pop) !important; overflow: hidden; }
.select2-results__option--highlighted, .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--brand-soft) !important; color: var(--brand-ink) !important; }

/* ── 8 · Live map (home) ───────────────────────────────────────────────── */
.y-live { position: relative; height: calc(100vh - var(--nav-h)); min-height: 520px; }
.y-live-mapwrap { position: absolute; inset: 0; }
.y-live-map { position: absolute; inset: 0; background: var(--map-water); z-index: 1; }
.y-live-map .leaflet-tile-pane { filter: saturate(.55) brightness(1.03); }
:root[data-theme="dark"] .y-live-map .leaflet-tile-pane { filter: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .y-live-map .leaflet-tile-pane { filter: none; } }
.y-live-side { position: absolute; z-index: 500; left: 16px; top: 16px; bottom: 16px; width: 400px; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-modal); box-shadow: var(--shadow-float); overflow: hidden; }
.y-live-side .y-search { margin: 16px 16px 0; height: 44px; flex: none; min-width: 0; border-radius: 10px; }
.y-live-side .y-tabs { padding: 0 8px; margin: 8px 0 0; flex: none; }
.y-live-list { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; min-height: 0; }
.y-live-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; color: var(--text); font-family: var(--font); }
.y-live-row:hover { background: var(--subtle); }
.y-live-row.is-on { background: var(--brand-soft); }
.y-live-av { position: relative; flex: none; }
.y-live-av .y-avatar { width: 44px; height: 44px; font-size: 14px; }
.y-live-av i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface); }
.y-live-nm { flex: 1; min-width: 0; }
.y-live-nm b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y-live-nm small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y-live-foot { flex: none; border-top: 1px solid var(--border); padding: 12px 16px; text-align: center; font-weight: 600; }
.y-live-stats { position: absolute; z-index: 500; top: 16px; left: 432px; right: 200px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.y-mstat { pointer-events: auto; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-float); display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted) !important; text-decoration: none !important; white-space: nowrap; }
.y-mstat:hover { color: var(--text) !important; }
.y-mstat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.y-mstat i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.y-mstat.is-warn b { color: var(--warning-text); }
.y-mstat.is-danger b { color: var(--danger-text); }
.y-live-layers { position: absolute; z-index: 500; top: 16px; right: max(16px, env(safe-area-inset-right, 0px)); }
.y-live-layers > button { height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--font); cursor: pointer; }
.y-live-layers .y-pop { top: calc(100% + 8px); min-width: 240px; }
.y-live-layers label.y-mi { gap: 10px; }
.y-live-ctl { position: absolute; z-index: 500; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.y-live-ctl button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); display: grid; place-items: center; cursor: pointer; }
.y-live-ctl button:hover { background: var(--subtle); }
.y-legend { position: absolute; z-index: 500; left: 432px; bottom: 16px; max-width: calc(100% - 512px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-float); font-size: 12.5px; color: var(--text); }
.y-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.y-lg-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.y-lg-cluster { width: 16px; height: 16px; border-radius: 50%; background: var(--brand); color: var(--brand-fg); font-size: 9px; font-weight: 600; display: grid; place-items: center; flex: none; }
.y-lg-stale { background: var(--neutral); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--neutral); }
.y-live .leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted); }
.y-live .leaflet-control-attribution a { color: var(--muted); }
.y-live .leaflet-control-zoom { display: none; }
.y-marker { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .35); transition: transform .15s; }
.y-marker.is-sel { transform: scale(1.35); box-shadow: 0 0 0 3px var(--text), 0 1px 4px rgba(15, 23, 42, .35); }
.y-cluster { border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 600 14px/1 var(--font); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .3); }
.y-live-card { position: absolute; z-index: 600; width: 320px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.y-live-card[hidden] { display: none; }
.y-live-card .y-lc-top { display: flex; gap: 10px; align-items: center; }
.y-live-card .y-lc-top b { display: block; font-weight: 600; }
.y-live-card .y-lc-top small { color: var(--muted); font-size: 12.5px; }
.y-live-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.y-live-card dt { color: var(--muted); font-weight: 400; }
.y-live-card dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.y-live-card .y-lc-acts { display: flex; gap: 6px; }
.y-live-card .y-lc-acts .y-btn { flex: 1; }
.y-plate { display: inline-flex; align-items: stretch; width: max-content; border: 1.5px solid var(--text); border-radius: 4px; background: var(--surface); color: var(--text); font: 600 12px/1 var(--font); letter-spacing: .04em; overflow: hidden; height: 20px; white-space: nowrap; }
.y-plate .y-plate-az { background: #1D4ED8; color: #fff; font-size: 8px; padding: 0 3px; display: grid; place-items: center; letter-spacing: 0; }
.y-plate .y-plate-n { padding: 0 5px; display: grid; place-items: center; }

/* ── 8b · Finance (earnings cards, money flow, report) ─────────────── */
.y-range { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; color: var(--muted); margin: 0; }
.y-body .y-range input[type="date"] { min-height: 36px; height: 36px; padding: 0 10px !important; border-radius: 999px !important; width: 148px !important; max-width: 148px; flex: none; font-size: 13px !important; }
.y-fin-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.y-fin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.y-fin-card.is-sel { background: var(--subtle); border-color: var(--border-strong); }
.y-fin-card h2 { margin: 0 !important; font-size: 14px !important; line-height: 20px !important; font-weight: 600 !important; }
.y-fin-value { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.y-fin-value small { font-size: 15px; font-weight: 500; margin-left: 4px; color: var(--n700); }
.y-fin-delta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.y-fin-delta .is-up { color: var(--success-text); display: inline-flex; align-items: center; gap: 2px; }
.y-fin-delta .is-down { color: var(--danger-text); display: inline-flex; align-items: center; gap: 2px; }
.y-fin-note { margin: 2px 0 0; color: var(--n700); font-size: 13.5px; }
.y-fin-note a { font-weight: 500; white-space: nowrap; }
.y-tip { position: relative; display: inline-grid; place-items: center; color: var(--faint); cursor: help; }
.y-tip [role="tooltip"] { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 400; padding: 6px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
.y-tip:hover [role="tooltip"], .y-tip:focus [role="tooltip"] { opacity: 1; }
.y-flow { margin-bottom: 24px; }
.y-flow > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; cursor: pointer; }
.y-flow > summary::-webkit-details-marker { display: none; }
.y-flow > summary h2 { margin: 0 !important; font-size: 18px !important; }
.y-flow-toggle { color: var(--muted); display: grid; transition: transform .15s; }
.y-flow:not([open]) .y-flow-toggle { transform: rotate(180deg); }
.y-flow-body { padding: 0 24px 20px; }
.y-flow-scroll { overflow-x: auto; }
.y-sankey { min-width: 900px; }
.y-sankey svg { display: block; width: 100%; height: auto; overflow: visible; }
.y-sk-col { font: 600 11px var(--font); letter-spacing: .08em; fill: var(--muted); }
.y-sk-guide { stroke: var(--border-strong); stroke-dasharray: 2 4; }
.y-sk-link { opacity: .28; transition: opacity .15s; }
.y-sk-link:hover { opacity: .5; }
.y-sk-box rect { fill: var(--surface); stroke: var(--border); }
.y-sk-box.is-hl rect { stroke: var(--success); stroke-width: 1.5; }
.y-sk-box text { fill: var(--n700); font: 400 12px var(--font); }
.y-sk-box text.v { fill: var(--text); font: 600 14px var(--font); font-variant-numeric: tabular-nums; }
.y-fin-report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.y-fin-report-head h2 { margin: 0 !important; font-size: 20px !important; line-height: 28px !important; }
.y-fin-links { font-size: 14px; font-weight: 500; color: var(--muted); }
.y-fin-links button { border: 0; background: transparent !important; color: var(--brand) !important; font: inherit; padding: 0; cursor: pointer; }
.y-fin-links button:hover { text-decoration: underline; }
.y-fin-export .y-pop { min-width: 340px; padding: 4px 10px 10px; }
.y-fin-exp { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.y-body .y-fin-exp input[type="date"], .y-body .y-fin-exp input[type="month"] { flex: 1; min-width: 0; min-height: 32px; height: 32px; padding: 0 10px !important; font: 400 13px var(--font) !important; color: var(--text) !important; background: var(--subtle) !important; border: 1px solid transparent !important; border-radius: var(--r-ctl) !important; }
.y-fin-exp-period { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.y-fin-export .y-pop-note { margin: 4px 0 0; max-width: none; }
.y-fin-report { overflow: hidden; }
.y-fin-group { border-bottom: 1px solid var(--border); }
.y-fin-group:last-child { border-bottom: 0; }
.y-fin-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; cursor: pointer; font-weight: 500; }
.y-fin-group > summary::-webkit-details-marker { display: none; }
.y-fin-group > summary:hover { background: var(--subtle); }
.y-fin-group.is-strong > summary { font-weight: 600; }
.y-fin-caret { color: var(--muted); transition: transform .15s; }
.y-fin-group[open] .y-fin-caret { transform: rotate(90deg); }
.y-fin-label { flex: 1; min-width: 0; }
.y-fin-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.y-fin-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px 10px 46px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--n700); }
.y-fin-days { padding: 0 20px 12px 46px; overflow-x: auto; }
.y-fin-days table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.y-fin-days th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.y-fin-days td { padding: 9px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.y-fin-days .r { text-align: right; }
.y-fin-days tfoot td { font-weight: 600; border-bottom: 0; }

/* ── 9 · Login (base-auth) ─────────────────────────────────────────── */
.y-auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.y-auth-top { position: relative; display: flex; align-items: center; justify-content: center; height: 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.y-auth-mark { display: flex; align-items: center; gap: 8px; color: var(--text) !important; text-decoration: none !important; }
.y-auth-mark span { font-size: 24px; font-weight: 600; letter-spacing: -.035em; }
.y-auth-lang { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); margin: 0; }
.y-body .y-auth-lang select { min-height: 36px !important; height: 36px; border-radius: 999px !important; padding: 0 30px 0 14px !important; font-size: 13.5px !important; font-weight: 500; }
.y-auth-main { flex: 1; }
.y-auth { display: flex; flex-direction: column; align-items: center; padding: 32px 16px 48px; }
.y-auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-modal); padding: 32px; box-shadow: none !important; }
.y-auth-brand { text-align: center; margin: 0 0 24px; }
.y-auth-logo { display: none !important; }
.y-auth-brand h1 { font-size: 24px !important; line-height: 32px !important; margin: 0 0 6px !important; }
.y-auth-brand p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.y-auth-card .y-field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.y-auth-card label { display: block; font-size: 13px !important; font-weight: 600 !important; margin: 0 !important; color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; }
.y-auth-card input.form-control { min-height: 48px !important; width: 100%; }
.y-phone-group { display: flex; gap: 8px; }
.y-body .y-phone-group .y-phone-prefix { flex: none; width: 84px !important; text-align: center; font-weight: 500 !important; }
.y-body .y-otp { text-align: center; font-size: 22px !important; letter-spacing: .5em !important; font-variant-numeric: tabular-nums; }
.y-auth-phone { text-align: center; margin: -8px 0 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.y-auth-card .y-auth-submit { width: 100%; height: 48px; border-radius: 999px; font-size: 15px; margin-top: 8px; }
.y-auth-foot { text-align: center; margin-top: 18px; font-size: 13px; }
.y-auth-foot a { color: var(--muted) !important; }
.y-auth .alert { border-radius: var(--r-card) !important; border: 1px solid var(--danger-bd) !important; background: var(--danger-bg) !important; color: var(--danger-text) !important; font-size: 13.5px; padding: 10px 14px !important; margin-bottom: 16px; }
.y-auth .alert-success, .y-auth .alert-info { border-color: var(--success-bd) !important; background: var(--success-bg) !important; color: var(--success-text) !important; }
.y-auth-foot-bar { text-align: center; color: var(--faint); font-size: 12.5px; padding: 16px 16px max(24px, env(safe-area-inset-bottom, 0px)); }

/* ── 9b · One page edge for the older pages ──────────────────────────
   The shell already gives every page its 24px gutter and top space. The
   Argon-era pages wrap themselves in .header/.container-fluid with their own
   15px padding and 24px top padding, which pushed their content 15-24px in
   from every other page. Those wrappers keep their layout, lose the extra
   space. */
.y-content > .header, .y-content > .header.pb-2 { padding: 0 !important; margin: 0 !important; background: transparent !important; }
.y-content > .header > .container-fluid, .y-content > .container-fluid { padding-left: 0 !important; padding-right: 0 !important; max-width: none; }
.y-content > .header .header-body { padding-top: 0 !important; padding-bottom: 0 !important; }
.y-content > .header .header-body > .row:first-child { margin-bottom: 20px !important; }
.y-content > .header .header-body > .row.py-4 { padding-top: 0 !important; padding-bottom: 20px !important; }
.y-content .breadcrumb { margin-bottom: 4px !important; }
.y-content .card { margin-bottom: 16px; }
/* A row with Bootstrap gutters already spaces its cards; Argon's own card
   margin on top of it doubled the gap between rows. */
.y-content .row[class*="g-"] > * > .card, .y-content .row[class*="g-"] > .card { margin-bottom: 0 !important; }
.y-content .row[class*="g-"] + .row[class*="g-"], .y-content .row[class*="g-"].mt-1 { margin-top: 0 !important; }

/* ── 10 · Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1360px) {
  .y-topnav { gap: 16px; }
  .y-menu-btn { padding: 0 9px; font-size: 14.5px; }
  .y-menu-btn.is-active::after { left: 9px; right: 9px; }
  .y-org-name, .y-ws-text { display: none; }
}
@media (max-width: 1180px) {
  .y-fin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .y-menu { display: none; }
  .y-burger { display: grid; }
  .y-live-stats { right: 200px; }
}
@media (max-width: 1023px) {
  .y-live-stats { display: none; }
  .y-legend { left: 432px; max-width: calc(100% - 512px); }
}
@media (max-width: 900px) {
  .y-legend { left: 16px; right: 72px; max-width: none; bottom: 16px; }
  .y-live-side { bottom: auto; height: min(46vh, 420px); }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; --nav-h: 56px; }
  .y-fin-cards { grid-template-columns: minmax(0, 1fr); }
  .y-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  /* Older pages: wide tables scroll inside their card, toolbars wrap. */
  .y-main .table-responsive { overflow-x: auto !important; max-width: 100%; }
  .y-main table.table:not(.table-responsive table), .y-main table.tbl { display: block; max-width: 100%; overflow-x: auto; }
  .y-main form.d-flex, .y-main .d-flex.align-items-center { flex-wrap: wrap; }
  .y-main .y-filters { flex-wrap: wrap; }
  .y-main .y-dens { overflow-x: auto; max-width: 100%; }
  .y-main .y-dens .y-d-row { min-width: 480px; }
  .y-page-head .y-seg::-webkit-scrollbar { display: none; }
  .y-range { flex-wrap: wrap; }
  .y-body .y-range input[type="date"] { width: calc(50% - 16px) !important; max-width: none; }
  .y-submit-bar button[name="_addanother"], .y-submit-bar button[name="_saveasnew"] { display: none; }
  .y-submit-bar .y-btn { height: 40px; }
  .y-flow > summary, .y-flow-body { padding-left: 16px; padding-right: 16px; }
  .y-topnav { gap: 6px; }
  .y-brand-tag, .y-ws { display: none; }
  .y-brand-name { font-size: 18px; }
  .y-top-actions { gap: 2px; }
  .y-round, .y-plus { width: 36px; height: 36px; }
  .y-org { padding: 0; }
  .y-main { padding-block: 16px 48px; }
  .y-page-head .y-actions { width: 100%; }
  .y-search { flex: 1 1 100%; min-width: 0; }
  .y-cl-table { max-height: none; }
  .y-mega.has-cols { grid-template-columns: 1fr; min-width: 0; }
  .y-form-card .tab-content { padding: 16px 16px 4px; }
  .y-submit-bar { padding-left: 16px; padding-right: 16px; }
  .y-pop-right { position: fixed; left: 8px; right: 8px; top: calc(var(--nav-h) + 4px); min-width: 0; }
  .y-live { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .y-live-mapwrap { position: relative; height: 56vh; order: -1; }
  .y-live-map { position: absolute; inset: 0; }
  .y-live-side { position: static; width: auto; height: auto; border-radius: 0; border: 0; border-top: 1px solid var(--border); box-shadow: none; }
  .y-live-list { max-height: none; overflow: visible; }
  .y-legend { left: 12px; right: 12px; bottom: 12px; padding: 8px 10px; gap: 4px 12px; font-size: 11.5px; }
  .y-live-ctl { top: 72px; bottom: auto; }
  .y-live-card { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
  .y-auth-card { padding: 24px 20px; }
  .y-auth-top { justify-content: flex-start; }
}

/* ── 11 · Guards against the older stylesheets' button fills ──────────── */
.y-topnav button, .y-topnav button:hover, .y-topnav button:focus, .y-topnav button:active { text-transform: none !important; letter-spacing: 0 !important; }
.y-menu-btn, .y-menu-btn:hover, .y-menu-btn:focus, .y-menu-btn:active, .y-menu-btn[aria-expanded="true"] { background: transparent !important; color: var(--text) !important; box-shadow: none !important; }
.y-plus:hover, .y-plus:focus { background: var(--brand-hover) !important; color: var(--brand-fg) !important; }
.y-round:hover, .y-round:focus-visible, .y-round[aria-expanded="true"] { background: var(--subtle-2) !important; color: var(--text) !important; }
.y-org:hover, .y-org[aria-expanded="true"] { background: var(--subtle) !important; color: var(--text) !important; }
.y-icon-btn:hover { background: var(--subtle) !important; color: var(--text) !important; }
button.y-mi:hover, a.y-mi:hover { background: var(--subtle) !important; }
.y-mi.is-on:hover { background: var(--brand-soft-2) !important; }
.y-tab:hover, .y-tab:focus { background: transparent !important; }
.y-btn:hover { background: var(--subtle) !important; }
.y-btn.is-primary:hover { background: var(--brand-hover) !important; }
.y-btn.is-ghost:hover { background: var(--subtle) !important; }
.y-btn.is-danger:hover { background: var(--danger) !important; filter: brightness(.95); }
.y-btn.is-danger-ghost:hover { background: var(--danger-bg) !important; }
.y-seg button:hover { background: transparent !important; }
.y-seg [aria-pressed="true"]:hover { background: var(--surface) !important; }
.y-lang:hover { background: var(--subtle) !important; }
.y-lang.is-on:hover { background: var(--brand-soft-2) !important; }
.y-bulk button:hover { background: color-mix(in srgb, var(--bg) 16%, transparent) !important; }
.y-live-row:hover { background: var(--subtle) !important; }
.y-live-row.is-on, .y-live-row.is-on:hover { background: var(--brand-soft) !important; }
.y-live-ctl button:hover, .y-live-layers > button:hover { background: var(--subtle) !important; }

/* Older sheets style the list's header cells and object tools by id/class
   with !important; these win by matching them. */
#result_list thead th, #result_list thead th a, #result_list thead th span { text-transform: none !important; letter-spacing: 0 !important; font-size: 12.5px !important; font-weight: 500 !important; }
.y-body .y-select select { width: auto !important; max-width: 240px !important; text-overflow: ellipsis; }
.y-page-head .object-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 !important; padding: 0 !important; list-style: none; float: none !important; }
.y-page-head .object-tools li { margin: 0 !important; list-style: none; }
.y-page-head .object-tools a.y-btn:not(.is-primary), .y-page-head a.y-btn:not(.is-primary) { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.y-page-head .object-tools a.y-btn:not(.is-primary):hover, .y-page-head a.y-btn:not(.is-primary):hover { background: var(--subtle) !important; }
.y-page-head .object-tools a.y-btn.is-primary, .y-page-head a.y-btn.is-primary { background: var(--brand) !important; color: var(--brand-fg) !important; border: 1px solid var(--brand) !important; }
.y-page-head .object-tools a.y-btn.is-primary:hover, .y-page-head a.y-btn.is-primary:hover { background: var(--brand-hover) !important; }
.y-page-head .object-tools a { text-transform: none !important; letter-spacing: 0 !important; height: 36px; padding: 0 14px !important; border-radius: var(--r-ctl) !important; }
#result_list tbody td, #result_list tbody th { background: var(--surface) !important; }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: var(--subtle) !important; }
#result_list tbody tr.selected td, #result_list tbody tr.selected th { background: color-mix(in srgb, var(--brand) 9%, var(--surface)) !important; }

/* Change form: two columns of fields; wide widgets (text areas, maps, pickers,
   tables, JSON) take the full row. */
.y-form-card fieldset.module.aligned { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.y-form-card fieldset.module.aligned > .fieldset-name, .y-form-card fieldset.module.aligned > .description,
.y-form-card fieldset.module.aligned > h2, .y-form-card fieldset.module.aligned > h3 { grid-column: 1 / -1; }
.y-form-card .yollda-field-row:has(textarea, .selector, .leaflet-container, .jsoneditor, .json-editor, iframe, table, .m2m-s2-widget, img, video) { grid-column: 1 / -1; }
.y-form-card .yollda-field-row:has(> .yollda-field-inner + .yollda-field-inner) { grid-column: 1 / -1; }
.y-form-card .fieldset-name, .y-form-card fieldset h2 { border: 0 !important; border-left: 0 !important; padding-left: 0 !important; box-shadow: none !important; }
.y-form-card .fieldset-name::before, .y-form-card .fieldset-name::after { display: none !important; }
@media (max-width: 900px) { .y-form-card fieldset.module.aligned { grid-template-columns: minmax(0, 1fr); } }
.y-form-card .yollda-label-col label, .y-form-card .yollda-label-col label:not(.required), .y-form-card .yollda-label-col label.required { font-weight: 600 !important; color: var(--text) !important; font-size: 13px !important; }
.y-form-card .yollda-field-checkbox .yollda-label-col label { font-weight: 500 !important; }
.y-callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card); margin: 0 0 16px; background: var(--subtle); color: var(--n700); }
.y-callout p { margin: 0; }
.y-callout.is-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-bd); }
.y-callout .yi { flex: none; margin-top: 1px; }
.y-dj h2 { font-size: 15px !important; margin: 16px 0 8px !important; }
.y-tree { margin: 0 0 8px; padding-left: 20px; color: var(--n700); }
.y-tree ul { padding-left: 18px; }
.y-tree li { margin: 4px 0; }
.y-dj button.y-btn.is-danger, .y-dj button.y-btn.is-danger:hover { background: var(--danger) !important; color: #fff !important; height: 40px; padding: 0 18px !important; }
.y-dj .submit-row .cancel-link { order: -1; }
.y-dj .submit-row { justify-content: flex-end; }
/* Searchable pickers (autocomplete) take the field's full width. */
.yollda-input-col .select2-container { width: 100% !important; max-width: 100%; }
.yollda-input-col .related-widget-wrapper .select2-container { flex: 1; min-width: 0; }
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { line-height: 38px !important; padding-left: 12px !important; color: var(--text) !important; }
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { height: 38px !important; }

/* ── 12 · Lists: card, row strips, status pills, row buttons ──────────── */
/* Reference: rows as soft rounded strips inside one white card, round row
   buttons, dot-and-text status pills, a pager of round buttons. */
:root { --row: color-mix(in srgb, var(--subtle) 70%, var(--surface)); --row-hover: var(--subtle); }

/* Header: crumbs, a large title with its count */
.y-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.y-crumbs a { color: var(--brand) !important; font-weight: 500; text-decoration: none !important; }
.y-crumbs a:hover { text-decoration: underline !important; }
.y-crumbs .yi { color: var(--faint); }
.y-crumbs [aria-current] { color: var(--text); }
.y-cl-head h1 { display: flex; align-items: center; gap: 10px; font-size: 26px !important; font-weight: 600 !important; letter-spacing: -.01em; }
.y-cl-total { height: 26px; padding: 0 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.y-cl-head .y-btn.is-primary, .y-page-head.y-cl-head .object-tools a.y-btn.is-primary { height: 40px; padding: 0 18px !important; border-radius: 999px !important; }

/* Toolbar: white fields with a hairline, like the card below them */
.y-changelist .y-search { height: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; flex-basis: 360px; }
.y-changelist .y-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.y-body.y-changelist .y-select select, .y-changelist .y-body .y-select select { -webkit-appearance: none !important; appearance: none !important; height: 40px !important; min-height: 40px !important; padding: 0 34px 0 14px !important; background-color: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 999px !important; }
.y-body.y-changelist .y-select select:hover { background-color: var(--subtle) !important; }
.y-body.y-changelist .y-select select.is-set { background-color: var(--brand-soft) !important; border-color: var(--brand-100) !important; }
.y-changelist .y-select .yi { right: 13px; }
.y-changelist [data-y-density] { height: 40px; border-radius: 999px; }

/* The card: table and pager together */
.y-cl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px 12px 0; }
.y-cl-card .y-cl-table { border: 0; border-radius: 0; background: transparent; max-height: calc(100vh - 250px); }
.y-cl-card > .y-empty, .y-cl-card .y-card.y-empty { border: 0; }
.y-cl-table table { border-collapse: separate !important; border-spacing: 0 6px !important; }
#result_list thead th { background: var(--surface) !important; border: 0 !important; height: 44px; padding: 0 14px !important; color: var(--muted) !important; }
#result_list thead th a { gap: 6px !important; border: 0 !important; }
.y-sort-hint { opacity: .45; }
#result_list thead th a:hover .y-sort-hint { opacity: .9; }

/* Rows: rounded strips */
#result_list tbody td, #result_list tbody th { background: var(--row) !important; height: 56px; padding: 8px 14px !important; border: 0 !important; font-size: 13.5px; }
#result_list tbody tr > :first-child { border-radius: 12px 0 0 12px; }
#result_list tbody tr > :last-child { border-radius: 0 12px 12px 0; }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: var(--row-hover) !important; }
#result_list tbody tr.selected td, #result_list tbody tr.selected th {
  background: color-mix(in srgb, var(--brand) 9%, var(--surface)) !important;
  box-shadow: inset 0 1px 0 var(--brand-300), inset 0 -1px 0 var(--brand-300);
}
#result_list tbody tr.selected > :first-child { box-shadow: inset 1px 0 0 var(--brand-300), inset 0 1px 0 var(--brand-300), inset 0 -1px 0 var(--brand-300); }
#result_list tbody tr.selected > :last-child { box-shadow: inset -1px 0 0 var(--brand-300), inset 0 1px 0 var(--brand-300), inset 0 -1px 0 var(--brand-300); }
.y-dense #result_list tbody td, .y-dense #result_list tbody th { height: 40px; padding-top: 2px !important; padding-bottom: 2px !important; }
.y-dense .y-cl-table table { border-spacing: 0 3px !important; }

/* The first data column is the row's name: brand ink, semibold */
#result_list tbody tr > .action-checkbox + td, #result_list tbody tr > .action-checkbox + th,
#result_list tbody tr > td:first-child:not(.action-checkbox), #result_list tbody tr > th:first-child { color: var(--brand-ink) !important; font-weight: 600 !important; }
#result_list tbody tr > .action-checkbox + td a, #result_list tbody tr > .action-checkbox + th a { color: var(--brand-ink) !important; font-weight: 600 !important; }

/* Checkboxes */
#result_list input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px !important; height: 18px !important; margin: 0 !important; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface) center / 12px no-repeat; cursor: pointer; vertical-align: middle; transition: background-color .12s, border-color .12s; }
#result_list input[type="checkbox"]:hover { border-color: var(--brand); }
#result_list input[type="checkbox"]:checked { background-color: var(--brand); border-color: var(--brand); 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"); }
#result_list input[type="checkbox"]:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus); }

/* Status pills in rows */
#result_list .y-st { height: 26px; padding: 0 10px 0 9px; font-size: 12.5px; }
.y-st.is-off { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.y-st.is-off::before { background: var(--faint); }
.y-st.is-live::before { animation: y-pulse 1.6s ease-out infinite; }
@keyframes y-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .y-st.is-live::before { animation: none; } }

/* Row buttons: round, white, quiet until hovered */
#result_list td.field-_actions { width: 1%; text-align: right; padding-right: 10px !important; }
.y-row-acts { display: inline-flex; gap: 6px; }
#result_list .y-row-open, #result_list .y-row-del { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface) !important; border: 1px solid var(--border); color: var(--n600) !important; transition: color .12s, border-color .12s, background-color .12s; }
#result_list .y-row-open:hover, #result_list tbody tr:hover .y-row-open:hover { color: var(--brand) !important; border-color: var(--brand-300); background: var(--brand-50) !important; }
#result_list .y-row-del:hover { color: var(--danger-text) !important; border-color: var(--danger-bd); background: var(--danger-bg) !important; }
#result_list tbody tr:hover .y-row-open { background: var(--surface) !important; color: var(--text) !important; }

/* Pager: round buttons, the current page and "next" filled */
.y-cl-card .y-cl-foot { padding: 10px 6px 14px; }
.y-cl-count b { color: var(--text); font-weight: 600; }
.y-pager { gap: 6px; }
.y-pager a, .y-pager span.y-pg { min-width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.y-pager a:hover { background: var(--subtle) !important; }
.y-pager .is-on { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--brand-fg) !important; }
.y-pager .is-off { opacity: .55; }
.y-pager .y-gap { border: 0; min-width: 0; }
.y-pager a.y-pg-next { background: var(--brand); border-color: var(--brand); color: var(--brand-fg) !important; }
.y-pager a.y-pg-next:hover { background: var(--brand-hover) !important; }
.y-pager .y-showall { border-radius: 999px; padding: 0 14px; }
/* Phones: filters two to a row instead of one per line */
@media (max-width: 640px) {
  .y-changelist .y-toolbar .y-select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .y-body.y-changelist .y-select select { min-width: 0 !important; field-sizing: fixed; }
  .y-body.y-changelist .y-select select { width: 100% !important; max-width: none !important; }
  .y-cl-head h1 { font-size: 22px !important; }
  .y-cl-card { padding: 0 6px; border-radius: 14px; }
}

/* ── 13 · One dropdown arrow everywhere, and list spacing ─────────────── */
/* Native select arrows sat flush against the edge (forms) or doubled up with
   our icon (lists). Every single select now draws one chevron, 12px in. */
:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.y-body select:not([multiple]):not([size]), .y-auth-body select:not([multiple]) {
  -webkit-appearance: none !important; appearance: none !important;
  background-image: var(--chev) !important; background-repeat: no-repeat !important;
  background-position: right 12px center !important; background-size: 16px 16px !important;
  padding-right: 38px !important; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
/* List filters keep their own icon; size to the chosen option, not the longest */
.y-body .y-select select { background-image: none !important; field-sizing: content; min-width: 128px; max-width: 260px !important; width: auto !important; padding-right: 38px !important; }
.y-changelist .y-select .yi { right: 14px; }
.y-body .y-auth-lang select { padding-right: 34px !important; background-position: right 10px center !important; }

/* List spacing on an 8px rhythm */
.y-cl-head { margin-bottom: 24px; align-items: flex-end; }
.y-cl-head .y-crumbs { margin-bottom: 8px; }
.y-changelist .y-tabbar, .y-changelist .y-tabs { margin-bottom: 20px; }
.y-changelist .y-tabbar .y-tabs { margin-bottom: 0; }
.y-changelist .y-toolbar { gap: 10px; margin-bottom: 16px; row-gap: 10px; }
.y-changelist .y-chips { margin: -4px 0 16px; gap: 8px; }
.y-changelist .y-date-hier { margin: -4px 0 16px; }
.y-cl-card { padding: 8px 16px 0; }
#result_list thead th { padding: 0 16px !important; }
#result_list tbody td, #result_list tbody th { padding: 8px 16px !important; }
#result_list .action-checkbox, #result_list .action-checkbox-column { width: 50px; padding-left: 16px !important; padding-right: 0 !important; }
#result_list td.field-_actions { padding-right: 12px !important; }
.y-cl-card .y-cl-foot { padding: 12px 4px 16px; }
.y-cl-card .y-empty { padding: 56px 24px 48px; }
/* Searchable pickers (select2) get the same chevron; an older sheet hid theirs. */
.select2-container .select2-selection--single { position: relative; }
.select2-container .select2-selection--single .select2-selection__rendered { padding-right: 40px !important; }
.select2-container .select2-selection--single .select2-selection__arrow { display: block !important; position: absolute !important; right: 12px !important; top: 50% !important; transform: translateY(-50%); width: 16px !important; height: 16px !important; background: var(--chev) center / 16px 16px no-repeat !important; }
.select2-container .select2-selection--single .select2-selection__arrow b { display: none !important; }
.select2-container--open .select2-selection--single .select2-selection__arrow { transform: translateY(-50%) rotate(180deg); }
.select2-container .select2-selection--single .select2-selection__clear { margin-right: 26px !important; }

/* ── 14 · Forms in the list's look ─────────────────────────────────────── */
/* Same language as the lists: crumbs and a large title, one 16px-radius
   card, white fields with a hairline, soft strips for read-only values,
   pill tabs and pill buttons. */

/* Header: crumbs, avatar, title, kind + id */
.y-form-head.y-cl-head { margin-bottom: 24px; align-items: flex-end; }
.y-fh-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.y-fh-title > div { min-width: 0; }
.y-fh-title h1 { font-size: 24px !important; line-height: 1.25 !important; overflow-wrap: anywhere; }
.y-fh-avatar { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.y-fh-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0 !important; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.y-fh-kind { height: 24px; padding: 0 10px; border-radius: 999px; background: var(--subtle); color: var(--n700); font-weight: 500; display: inline-flex; align-items: center; }
.y-form-head .y-actions .y-btn { height: 40px; padding: 0 16px; }

/* The card */
.y-form-card { border-radius: 16px; }
.y-form-card > form > .nav-tabs, .y-form-card .nav-tabs#fieldsets-tabs {
  display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px !important; border-bottom: 1px solid var(--border) !important; border-radius: 16px 16px 0 0 !important;
}
.y-form-card .nav-tabs#fieldsets-tabs::-webkit-scrollbar { display: none; }
.y-form-card .nav-tabs#fieldsets-tabs .nav-item { margin: 0 !important; }
.y-form-card .nav-tabs#fieldsets-tabs .nav-link {
  height: 36px; padding: 0 14px !important; border: 0 !important; border-radius: 999px !important; margin: 0 !important;
  background: transparent !important; color: var(--muted) !important; font: 500 14px/1 var(--font) !important; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.y-form-card .nav-tabs#fieldsets-tabs .nav-link:hover { background: var(--subtle) !important; color: var(--text) !important; }
.y-form-card .nav-tabs#fieldsets-tabs .nav-link.active { background: var(--brand-soft) !important; color: var(--brand-ink) !important; font-weight: 600 !important; }
.y-form-card .nav-tabs#fieldsets-tabs .nav-link.text-danger { color: var(--danger-text) !important; }
.y-form-card .nav-tabs#fieldsets-tabs .nav-link.active::after { display: none !important; }
.y-form-card .tab-content { padding: 24px 24px 8px; }
.y-form-card .fieldset-name { font-size: 15px !important; font-weight: 600 !important; padding: 0 0 12px !important; margin: 0 0 20px !important; border-bottom: 1px solid var(--border) !important; }
.y-form-card fieldset.module.aligned { column-gap: 24px; }
.y-form-card .yollda-field-row { gap: 20px 24px; padding-bottom: 20px !important; }

/* Labels and fields */
.y-form-card .yollda-field-inner { gap: 8px; }
.y-form-card .yollda-label-col label, .y-form-card .yollda-label-col label:not(.required), .y-form-card .yollda-label-col label.required { font-size: 13px !important; font-weight: 500 !important; color: var(--n700) !important; }
.y-form-card input[type="text"], .y-form-card input[type="email"], .y-form-card input[type="number"], .y-form-card input[type="password"],
.y-form-card input[type="url"], .y-form-card input[type="tel"], .y-form-card input[type="search"], .y-form-card input[type="date"],
.y-form-card input[type="datetime-local"], .y-form-card input[type="time"], .y-form-card textarea, .y-form-card select,
.y-form-card .form-control, .y-form-card .vTextField, .y-form-card .vLargeTextField, .y-form-card .vIntegerField,
.y-form-card .select2-container .select2-selection--single, .y-form-card .select2-container .select2-selection--multiple {
  background-color: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; min-height: 44px;
}
.y-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), .y-form-card select:not([multiple]) { height: 44px; }
.y-form-card input:hover:not(:focus):not([type="checkbox"]):not([type="radio"]), .y-form-card select:hover:not(:focus), .y-form-card textarea:hover:not(:focus) { border-color: var(--border-strong) !important; }
.y-form-card input:focus, .y-form-card select:focus, .y-form-card textarea:focus,
.y-form-card .select2-container--focus .select2-selection, .y-form-card .select2-container--open .select2-selection { border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--focus) !important; }
.y-form-card .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px !important; padding-left: 14px !important; }
.y-form-card .select2-container .select2-selection--single { height: 44px !important; }
.y-form-card .errors input, .y-form-card .errors select, .y-form-card .errors textarea { border-color: var(--danger) !important; background-color: var(--danger-bg) !important; }
.y-form-card .help { margin-top: 2px; line-height: 1.45; }

/* Read-only values: soft strips, like the list rows */
.y-form-card .readonly { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--row); color: var(--text); font-size: 14px; }
.y-form-card .readonly:empty::before { content: "—"; color: var(--faint); }

/* Checkbox fields: a bordered tile with the brand checkbox */
.y-form-card .yollda-field-checkbox { min-height: 44px; padding: 10px 14px !important; border: 1px solid var(--border) !important; border-radius: 12px; background: var(--surface); }
.y-form-card .yollda-field-checkbox:has(input:checked) { border-color: var(--brand-300) !important; background: var(--brand-soft); }
.y-form-card .yollda-field-checkbox label { cursor: pointer; }
.y-form-card input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 18px !important; height: 18px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 1.5px solid var(--border-strong) !important; border-radius: 5px !important; background: var(--surface) center / 12px no-repeat !important; cursor: pointer; vertical-align: middle; }
.y-form-card input[type="checkbox"]:checked { background-color: var(--brand) !important; border-color: var(--brand) !important; 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") !important; }
.y-form-card input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px var(--focus) !important; }

/* Date + time: one row, labels quiet, shortcuts as small pills */
.y-form-card p.datetime { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 !important; font-size: 12.5px; color: var(--muted); }
.y-form-card p.datetime br { display: none; }
.y-form-card p.datetime input.vDateField, .y-form-card p.datetime input.vTimeField { width: 150px !important; }
.y-form-card .datetimeshortcuts, .y-form-card p.datetime .datetimeshortcuts { display: inline-flex !important; align-items: center; gap: 4px; margin: 0 !important; font-size: 0 !important; }
.y-form-card .datetimeshortcuts a { font-size: 12.5px; height: 30px; min-width: 30px; padding: 0 10px; border-radius: 999px; background: var(--subtle); color: var(--brand-ink) !important; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; }
.y-form-card .datetimeshortcuts a:hover { background: var(--subtle-2); }
.y-form-card .datetimeshortcuts a:has(.date-icon, .clock-icon) { padding: 0; }

/* Related-object buttons next to pickers: round, like the row buttons */
.y-form-card .related-widget-wrapper { gap: 6px; }
.y-form-card .related-widget-wrapper-link { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; margin: 0 !important; }
.y-form-card .related-widget-wrapper-link:hover { border-color: var(--brand-300); background: var(--brand-50); }
.y-form-card .related-widget-wrapper-link img { width: 14px; height: 14px; }
.y-form-card .related-widget-wrapper-link:not([href]) { opacity: .4; pointer-events: none; }

/* Inline formsets: header quiet, rows as strips */
.y-form-card .inline-group table, .y-form-card .tabular table { border: 0 !important; border-spacing: 0 6px !important; border-radius: 0 !important; overflow: visible !important; }
.y-form-card .inline-group th, .y-form-card .tabular th { background: transparent !important; border: 0 !important; padding: 8px 12px !important; }
.y-form-card .inline-group td, .y-form-card .tabular td { background: var(--row) !important; border: 0 !important; padding: 8px 12px !important; }
.y-form-card .inline-group tbody tr > td:first-child, .y-form-card .tabular tbody tr > td:first-child { border-radius: 12px 0 0 12px; }
.y-form-card .inline-group tbody tr > td:last-child, .y-form-card .tabular tbody tr > td:last-child { border-radius: 0 12px 12px 0; }
.y-form-card .inline-group tr.add-row td { background: transparent !important; }
.y-form-card .inline-group .add-row a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--brand-ink) !important; font-weight: 500; }

/* Errors */
.cf-error-summary { border-radius: 14px !important; padding: 14px 18px !important; }

/* Bottom bar: pill buttons */
.y-submit-bar { padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 0 0 16px 16px; gap: 10px; }
.y-submit-bar .y-btn { height: 40px; padding: 0 18px; border-radius: 999px !important; }
.y-submit-bar .y-btn.is-primary { padding: 0 22px; }

@media (max-width: 640px) {
  .y-fh-avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
  .y-fh-title h1 { font-size: 20px !important; }
  .y-form-card .tab-content { padding: 16px 16px 4px; }
  .y-form-card p.datetime input.vDateField, .y-form-card p.datetime input.vTimeField { width: 130px !important; }
}
.y-form-card .inline-group > .module, .y-form-card .inline-group .tabular > .module, .y-form-card .inline-group fieldset.module { border: 0 !important; padding: 0 !important; box-shadow: none !important; background: transparent !important; }
.y-form-card p.datetime input.vDateField, .y-form-card p.datetime input.vTimeField { width: 132px !important; }
/* Maps keep their layers to themselves: Leaflet's panes (z 400–1000) drew
   over the sticky tab strip and the bottom bar. */
.y-form-card .leaflet-container { position: relative; z-index: 0; isolation: isolate; border-radius: 12px; }
/* Single pickers: text centred like a plain select (an older rule padded the box). */
.y-form-card .select2-container .select2-selection--single { display: flex !important; align-items: center; padding: 0 !important; }
.y-form-card .select2-container .select2-selection--single .select2-selection__rendered { flex: 1; min-width: 0; line-height: 1.3 !important; padding: 0 40px 0 12px !important; }
.y-form-card .select2-container .select2-selection--single .select2-selection__clear { position: absolute; right: 36px; top: 50%; transform: translateY(-50%); margin: 0 !important; float: none !important; }
/* The select that select2 hides stays hidden (the full-width field rule made it
   375px wide and pushed phones sideways). */
.y-body select.select2-hidden-accessible { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; }

/* ── 15 · Multi-pickers (many-to-many) ─────────────────────────────────── */
/* Chosen items are brand pills with a round ×; the box is a 44px field like
   the rest, with the shared chevron; the "+" add button sits after it. */
.y-form-card .related-widget-wrapper > .select2, .y-form-card .related-widget-wrapper > select { order: 0; }
.y-form-card .related-widget-wrapper > .related-widget-wrapper-link { order: 1; }
.y-form-card .select2-container .select2-selection--multiple {
  display: flex !important; align-items: center; flex-wrap: wrap; gap: 6px; cursor: text;
  min-height: 44px !important; padding: 6px 64px 6px 8px !important; position: relative;
  background-image: var(--chev) !important; background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 16px 16px !important;
}
.y-form-card .select2-selection--multiple .select2-selection__rendered { display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 !important; padding: 0 !important; list-style: none; }
.y-form-card .select2-selection--multiple .select2-selection__choice {
  margin: 0 !important; height: 30px; display: inline-flex !important; align-items: center; gap: 2px; padding: 0 4px 0 12px !important; max-width: 100%;
  border-radius: 999px !important; background: var(--brand-soft) !important; border: 1px solid var(--brand-100) !important; color: var(--brand-ink) !important; font: 500 13px/1 var(--font) !important;
}
.y-form-card .select2-selection--multiple .select2-selection__choice__display { padding: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y-form-card .select2-selection--multiple .select2-selection__choice__remove {
  order: 2; position: static !important; width: 22px; height: 22px; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important;
  display: inline-grid; place-items: center; background: transparent !important; color: var(--brand-ink) !important; font-size: 16px !important; line-height: 1 !important; cursor: pointer;
}
.y-form-card .select2-selection--multiple .select2-selection__choice__remove:hover { background: var(--brand-soft-2) !important; }
.y-form-card .select2-selection--multiple .select2-selection__choice__remove span { line-height: 1; }
.y-form-card .select2-selection--multiple .select2-search--inline { flex: 1; min-width: 120px; margin: 0 !important; display: flex; }
.y-form-card .select2-selection--multiple .select2-search__field {
  margin: 0 !important; height: 30px !important; min-height: 0 !important; width: 100% !important; padding: 0 6px !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important; font: 400 14px/30px var(--font) !important; color: var(--text) !important;
}
.y-form-card .select2-selection--multiple .select2-search__field::placeholder { color: var(--faint) !important; }
.y-form-card .select2-selection--multiple .select2-selection__clear {
  position: absolute !important; right: 36px; top: 50%; transform: translateY(-50%); margin: 0 !important; padding: 0 !important; float: none !important;
  width: 22px; height: 22px; border: 0 !important; border-radius: 50%; background: transparent !important; color: var(--muted) !important; display: grid; place-items: center; font-size: 16px; cursor: pointer;
}
.y-form-card .select2-selection--multiple .select2-selection__clear:hover { background: var(--subtle) !important; color: var(--text) !important; }
.y-form-card .select2-container--open .select2-selection--multiple { background-image: var(--chev) !important; }

/* Every picker's dropdown (it lives at the end of <body>) */
.y-body .select2-dropdown { border: 1px solid var(--border) !important; border-radius: 12px !important; background: var(--surface) !important; box-shadow: var(--shadow-pop) !important; overflow: hidden; margin-top: 4px; }
.y-body .select2-container--open .select2-dropdown--above { margin-top: -4px; }
.y-body .select2-search--dropdown { padding: 8px !important; }
.y-body .select2-search--dropdown .select2-search__field { height: 36px !important; min-height: 0 !important; border-radius: 8px !important; }
.y-body .select2-results__options { padding: 4px !important; max-height: 280px; }
.y-body .select2-results__option { padding: 9px 12px !important; border-radius: 8px; font-size: 14px; color: var(--text) !important; background: transparent !important; }
.y-body .select2-results__option--highlighted, .y-body .select2-results__option--highlighted[aria-selected] { background: var(--subtle) !important; color: var(--text) !important; }
.y-body .select2-results__option[aria-selected="true"], .y-body .select2-results__option--selected { color: var(--brand-ink) !important; font-weight: 600; background: var(--brand-soft) !important; }
.y-body .select2-results__message { color: var(--muted) !important; }
.y-form-card .select2-selection--multiple textarea.select2-search__field { resize: none !important; overflow: hidden !important; }
.y-form-card .select2-container, .y-form-card .select2-container:focus-within { border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; }
.y-form-card .select2-selection:not(:focus):not(.select2-selection--focus) { box-shadow: none !important; }

/* ── 16 · Dashboard: KPI cards, section cards, strip tables ───────────── */
.y-dash { display: flex; flex-direction: column; gap: 0; }
.y-dash .y-cl-head h1 { flex-wrap: wrap; }
.y-dash-sec { margin: 8px 0 12px !important; font-size: 13px !important; font-weight: 600 !important; color: var(--muted) !important; letter-spacing: 0 !important; text-transform: none !important; }

/* KPI cards: icon chip + label, a large number, one line of context */
.y-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.y-kpi { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text) !important; text-decoration: none !important; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.y-kpi:hover { border-color: var(--brand-300); box-shadow: var(--shadow-float); }
a.y-kpi:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus); }
.y-kpi.is-alert { border-color: var(--danger-bd); background: color-mix(in srgb, var(--danger-bg) 45%, var(--surface)); }
.y-kpi-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.y-kpi-label { font-size: 14px; font-weight: 500; color: var(--n700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y-kpi-ico, .y-qs-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.y-kpi-ico.is-success, .y-qs-ico.is-success { background: var(--success-bg); color: var(--success-text); }
.y-kpi-ico.is-info, .y-qs-ico.is-info { background: var(--info-bg); color: var(--info-text); }
.y-kpi-ico.is-warning, .y-qs-ico.is-warning { background: var(--warning-bg); color: var(--warning-text); }
.y-kpi-ico.is-danger, .y-qs-ico.is-danger { background: var(--danger-bg); color: var(--danger-text); }
.y-kpi-value { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.y-kpi-value small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.y-kpi-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); min-height: 24px; }
.y-kpi-sub b { color: var(--text); font-weight: 600; }
.y-trend { height: 24px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; background: var(--subtle); color: var(--n700); font-variant-numeric: tabular-nums; }
.y-trend.is-up { background: var(--success-bg); color: var(--success-text); }
.y-trend.is-down { background: var(--danger-bg); color: var(--danger-text); }

/* Live connection pill next to the title (the script sets its class) */
#ws-label { height: 28px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; background: var(--subtle); color: var(--muted) !important; font: 500 12.5px/1 var(--font) !important; letter-spacing: 0; vertical-align: middle; }
#ws-label #ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin: 0; }
#ws-label.ws-live { background: var(--success-bg); color: var(--success-text) !important; }
#ws-label.ws-live #ws-dot { background: var(--success); animation: y-pulse 1.6s ease-out infinite; color: var(--success); }
#ws-label.ws-connecting #ws-dot { background: var(--warning); }
#ws-label.ws-offline { background: var(--danger-bg); color: var(--danger-text) !important; }
#ws-label.ws-offline #ws-dot { background: var(--danger); }

/* Section cards */
.y-dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px; overflow: hidden; min-width: 0; }
.y-dcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 14px; }
.y-dcard-head h2 { margin: 2px 0 0 !important; font-size: 17px !important; font-weight: 600 !important; }
.y-dcard-eyebrow { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.y-dash-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; }
.y-dash-split > .y-dcard { margin-bottom: 24px; }
.y-dash-chart { height: 300px; margin: 0 20px 20px; padding: 0; position: relative; }
/* The canvas is taken out of the flow so the card's height never depends on it
   (Chart.js resizes it to its parent; in flow, that grows without end). */
.y-dash-chart > canvas { position: absolute; left: 0; top: 0; }

/* Map: filter pills + legend on one strip */
.y-dash-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 0 20px 14px; }
.y-dash .filter-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: none; border: 0; }
.y-dash .chip { height: 34px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; background: var(--surface); color: var(--n700); border: 1px solid var(--border); transition: background .12s, border-color .12s; }
.y-dash .chip:hover { background: var(--subtle); }
.y-dash .chip.on { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-100); font-weight: 600; }
.y-dash .chip [id^="fc-"] { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--subtle); color: var(--n700); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.y-dash .chip.on [id^="fc-"] { background: var(--surface); color: var(--brand-ink); }
.y-dash .chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.y-dash .legend-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; background: none; border: 0; }
.y-dash .legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.y-dash .legend-pin { width: 14px; height: 18px; flex: none; }
.y-dash .legend-pin svg { width: 100%; height: 100%; }
.y-dash-map { margin: 0 12px 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }

/* Quick stats: soft strips */
.y-qstats { list-style: none; margin: 0; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.y-qstats li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px 8px 8px; border-radius: 12px; background: var(--row); font-size: 14px; color: var(--n700); }
.y-qstats li b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.y-qs-ico { width: 34px; height: 34px; }

/* Strip tables (same rows as the lists) */
.y-dash-table { overflow-x: auto; padding: 0 12px 12px; }
.y-strip-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13.5px; margin: -6px 0 0; }
.y-strip-table thead th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 10px 14px 4px; white-space: nowrap; background: none; border: 0; }
.y-strip-table tbody td { background: var(--row); padding: 0 14px; height: 52px; color: var(--text); white-space: nowrap; vertical-align: middle; border: 0; }
.y-strip-table tbody tr > td:first-child { border-radius: 12px 0 0 12px; }
.y-strip-table tbody tr > td:last-child { border-radius: 0 12px 12px 0; }
.y-strip-table tbody tr:hover td { background: var(--subtle); }
.y-strip-table td.is-key { color: var(--brand-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.y-strip-table td.is-muted { color: var(--muted); }
.y-strip-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.y-strip-table .is-neg { color: var(--danger-text); }
.y-strip-table tfoot th { padding: 12px 14px; font-weight: 600; color: var(--text); border-top: 1px solid var(--border); background: none; }
.y-strip-table .y-td-empty { text-align: center; color: var(--muted); height: 72px; border-radius: 12px !important; }
.y-strip-table .truncate { max-width: 200px; display: block; overflow: hidden; text-overflow: ellipsis; }
.y-range-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 !important; color: var(--muted); }
.y-body .y-range-form input[type="date"] { flex: none; height: 40px !important; min-height: 40px; width: 160px !important; max-width: 160px; background-color: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; padding: 0 12px !important; }
.y-range-form .y-btn { height: 40px; }

@media (max-width: 1100px) { .y-dash-split { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (max-width: 640px) {
  .y-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .y-kpi { padding: 14px; gap: 8px; border-radius: 14px; }
  .y-kpi-value { font-size: 24px; }
  .y-kpi-ico { width: 30px; height: 30px; }
  .y-kpi-label { font-size: 12.5px; white-space: normal; }
  .y-dash .y-actions { width: 100%; }
  #driverMap { height: 380px; }
}
@media (min-width: 1180px) { .y-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.y-dash-split > .y-dcard { display: flex; flex-direction: column; }
.y-dash-split .y-dash-chart { flex: 1 1 auto; height: auto; min-height: 300px; }

/* ── Finance › Dövr bağlanışı (templates/pages1/finance_close.html) ─────── */
.y-callout.is-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-bd); }
.y-callout a { color: inherit; text-decoration: underline; }
.y-body .y-range input[type="month"] { min-height: 36px; height: 36px; padding: 0 10px !important; border-radius: 999px !important; width: 160px !important; max-width: 160px; flex: none; font-size: 13px !important; }
.y-close-stamp { margin-bottom: 16px; }
.y-close-stamp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.y-close-export { margin-left: auto; display: inline-flex; gap: 6px; }
.y-close-hash { margin: 10px 0 0; font-size: 12.5px; word-break: break-all; }
.y-close-hash code { font-size: 12px; color: var(--n700); }
.y-close-warn { margin: 8px 0 0; color: var(--danger-text); font-weight: 500; }
.y-close-note { margin: 8px 0 0; }
.y-close-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.y-close-block { margin-top: 16px; }
.y-close-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.y-close-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--border); }
.y-close-table td { padding: 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; vertical-align: top; }
.y-close-table .r { text-align: right; white-space: nowrap; }
.y-close-table tr.is-sub td:first-child { padding-left: 24px; color: var(--muted); }
.y-close-table tr.is-strong td { font-weight: 600; color: var(--text); }
.y-close-table .y-st { white-space: normal; height: auto; min-height: 22px; padding-top: 2px; padding-bottom: 2px; }
.y-close-small { font-size: 12.5px; margin: 8px 0 0; }
.y-close-effects { padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.y-close-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.y-close-form h3 { margin: 0; font-size: 14px; }
.y-close-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.y-close-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.y-close-form label.y-close-check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.y-close-form .y-btn { align-self: flex-start; }
@media (max-width: 980px) {
  .y-close-grid, .y-close-fields { grid-template-columns: minmax(0, 1fr); }
  .y-close-export { margin-left: 0; }
}

/* ── 13 · Lists: people, combined status, rows that open ─────────────── */
/* Sizes on the 8px rhythm: row 56 (dense 40), avatar 36, row buttons 34,
   chevron 28, panel padding 16/20, label 12 / value 13.5. */

/* A person: avatar, name, quiet second line */
.y-person { display: inline-flex; align-items: center; gap: 12px; min-width: 0; max-width: 280px; }
.y-ava { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: .02em; background: var(--brand-50); color: var(--brand-ink); }
.y-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; max-height: none !important; }
.y-ava[data-tone="1"] { background: var(--info-bg); color: var(--info-text); }
.y-ava[data-tone="2"] { background: var(--warning-bg); color: var(--warning-text); }
.y-ava[data-tone="3"] { background: var(--danger-bg); color: var(--danger-text); }
.y-ava[data-tone="4"] { background: var(--success-bg); color: var(--success-text); }
.y-ava[data-tone="5"] { background: var(--subtle-2); color: var(--n700); }
.y-ava-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px var(--row); }
.y-ava-dot.is-on { background: var(--success); }
.y-person-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.y-person-txt b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.y-person-txt small { font-size: 12px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
#result_list tbody td .y-person-txt b { color: var(--text) !important; }

/* The chevron column, right after the checkbox */
#result_list th.column-_expand, #result_list td.field-_expand { width: 36px; padding-left: 0 !important; padding-right: 0 !important; text-align: center; }
#result_list .action-checkbox-column, #result_list td.action-checkbox { width: 40px; padding-right: 0 !important; }
.y-row-exp { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; display: inline-grid; place-items: center; background: transparent; color: var(--n600); cursor: pointer; transition: background-color .12s, color .12s; }
.y-row-exp:hover { background: var(--surface); color: var(--text); }
.y-row-exp:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus); }
.y-row-exp .yi { transition: transform .18s ease; }
.y-row-exp[aria-expanded="true"] { background: var(--brand-50); color: var(--brand-ink); }
.y-row-exp[aria-expanded="true"] .yi { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .y-row-exp .yi { transition: none; } }
/* With the chevron in front, the row's name is the column after it */
#result_list tbody tr > .action-checkbox + td.field-_expand { color: inherit !important; font-weight: 400 !important; }
#result_list tbody tr > .action-checkbox + td.field-_expand + td, #result_list tbody tr > .action-checkbox + td.field-_expand + th,
#result_list tbody tr > td.field-_expand:first-child + td, #result_list tbody tr > td.field-_expand:first-child + th { color: var(--brand-ink) !important; font-weight: 600 !important; }

/* An open row and its panel read as one outlined card */
#result_list tbody tr.is-open > td, #result_list tbody tr.is-open > th { background: var(--surface) !important; box-shadow: inset 0 1px 0 var(--brand-300) !important; }
#result_list tbody tr.is-open > :first-child { border-bottom-left-radius: 0; box-shadow: inset 1px 0 0 var(--brand-300), inset 0 1px 0 var(--brand-300) !important; }
#result_list tbody tr.is-open > :last-child { border-bottom-right-radius: 0; box-shadow: inset -1px 0 0 var(--brand-300), inset 0 1px 0 var(--brand-300) !important; }
#result_list tbody tr.y-row-detail { cursor: default; }
#result_list tbody tr.y-row-detail > td { position: relative; top: -7px; height: auto; padding: 0 !important; white-space: normal; background: var(--surface) !important; border-radius: 0 0 12px 12px !important; box-shadow: inset 1px 0 0 var(--brand-300), inset -1px 0 0 var(--brand-300), inset 0 -1px 0 var(--brand-300) !important; }
#result_list tbody tr.y-row-detail:hover > td { background: var(--surface) !important; }
.y-detail { display: flex; align-items: flex-start; gap: 24px; margin: 0 16px; padding: 16px 4px 18px 60px; border-top: 1px dashed var(--border); }
.y-detail-grid { flex: 1; min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 32px; }
.y-detail-item { min-width: 0; }
.y-detail-item dt { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.y-detail-item dt .yi { color: var(--faint); flex: none; }
.y-detail-item dd { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.y-detail-item dd a { color: var(--brand) !important; font-weight: 500; }
.y-detail-item dd .y-st { vertical-align: middle; }
.y-detail-open { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; font-size: 13px; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
.y-detail-open:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-ink) !important; }
.y-dense .y-detail { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 900px) {
  .y-detail { flex-direction: column; gap: 14px; padding-left: 12px; margin: 0 8px; }
  .y-detail-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 20px; }
}
#result_list tbody tr.y-row-detail > td:first-child { color: var(--text) !important; font-weight: 400 !important; }
/* Wide lists: headings may take two lines, and the row buttons stay in view
   at the right edge while the table scrolls sideways. */
#result_list thead th { white-space: normal !important; line-height: 1.25; vertical-align: middle; }
#result_list thead th a, #result_list thead th > span { display: inline-flex; align-items: center; white-space: normal !important; }
#result_list td.field-_actions, #result_list th.column-_actions { position: sticky; right: 0; z-index: 1; }
#result_list th.column-_actions { z-index: 3; }
#result_list td.field-_actions { box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .18); }
@media (max-width: 640px) {
  /* Phones: the row buttons scroll with the row, and the panel stays the
     width of the screen while the table scrolls sideways. */
  #result_list td.field-_actions, #result_list th.column-_actions { position: static; box-shadow: none; }
  .y-detail { position: sticky; left: 0; box-sizing: border-box; max-width: calc(100vw - 58px); }
  .y-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
