/* KISHWOOD admin panel — dashboard look. Layered over admin.css + kw-ui.css. */
body.admin { background:
    radial-gradient(900px 420px at 100% -80px, color-mix(in srgb, var(--g1) 11%, transparent), transparent 70%),
    radial-gradient(700px 380px at 0 30%, color-mix(in srgb, var(--secondary) 8%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
html { font-size: 15px; }
h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.content { max-width: 1440px; margin-inline: auto; padding: 8px 28px 48px; }
.content > .toolbar { margin-bottom: var(--gap); }

/* ---------- sidebar ---------- */
.shell { align-items: stretch; }
.sidebar { --sb-bg: linear-gradient(185deg, color-mix(in srgb, var(--primary) 94%, #000) 0%, color-mix(in srgb, var(--primary) 72%, #000) 100%); --sb-fg: #d9d0c7; --sb-fg-strong: #fff; --sb-hover: rgba(255,255,255,.08); --sb-line: rgba(255,255,255,.08);
    width: 272px; padding: 16px 12px 12px; background: var(--sb-bg); color: var(--sb-fg); display: flex; flex-direction: column; transition: width .25s cubic-bezier(.2,.8,.2,1); overflow-x: hidden; }
[data-sidebar="light"] .sidebar { --sb-bg: var(--surface); --sb-fg: var(--muted); --sb-fg-strong: var(--text); --sb-hover: color-mix(in srgb, var(--g1) 10%, transparent); --sb-line: var(--border); border-inline-end: 1px solid var(--border); }
[data-sidebar="colored"] .sidebar { --sb-bg: var(--grad-btn); --sb-fg: rgba(255,255,255,.82); --sb-fg-strong: #fff; }
[data-theme="dark"][data-sidebar="light"] .sidebar { --sb-bg: var(--surface); }
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; margin-bottom: 10px; border-bottom: 1px solid var(--sb-line); color: var(--sb-fg-strong); font-size: 1.25rem; font-weight: 800; letter-spacing: .03em; }
.logo-mark { width: 40px; height: 40px; flex: none; border-radius: var(--radius); display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 1.25rem; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-bottom: 12px; }
.sidebar .nav-link, .sidebar summary { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius); color: var(--sb-fg); cursor: pointer; list-style: none; font-size: .95rem; font-weight: 500; transition: background .15s, color .15s; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar .nav-link:hover, .sidebar summary:hover { background: var(--sb-hover); color: var(--sb-fg-strong); }
.ni { width: 34px; height: 34px; flex: none; border-radius: var(--radius); display: grid; place-items: center; font-size: 1.1rem; background: rgba(255,255,255,.07); color: inherit; }
[data-sidebar="light"] .ni { background: color-mix(in srgb, var(--muted) 10%, transparent); }
summary .ni.g-0 { background: linear-gradient(135deg, #f59e0b, #ef6a3a); color: #fff; } summary .ni.g-1 { background: linear-gradient(135deg, #34d399, #0d9488); color: #fff; }
summary .ni.g-2 { background: linear-gradient(135deg, #60a5fa, #6366f1); color: #fff; } summary .ni.g-3 { background: linear-gradient(135deg, #f472b6, #c026d3); color: #fff; }
summary .ni.g-4 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; } summary .ni.g-5 { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; }
.sidebar .caret { margin-inline-start: auto; font-size: .9rem; transition: transform .2s; opacity: .6; }
.nav-group[open] > summary .caret { transform: rotate(180deg); }
.nav-group[open] > summary { color: var(--sb-fg-strong); }
.nav-group .sub { display: grid; gap: 2px; padding: 4px 0 6px; margin-inline-start: 22px; border-inline-start: 1px dashed var(--sb-line); padding-inline-start: 8px; }
.nav-group .sub .nav-link { padding: 6px 8px; font-size: .9rem; }
.nav-group .sub .ni { width: 28px; height: 28px; border-radius: var(--radius); font-size: .95rem; background: transparent; }
.sidebar .nav-link.active { color: #fff; background: linear-gradient(135deg, var(--g1d), var(--g2d)); box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.sidebar .nav-link.active .ni { background: rgba(255,255,255,.2); }
.sidebar .nav-link.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--g1); }
[dir="rtl"] .sidebar .nav-link.active::before { border-radius: 4px 0 0 4px; }
[data-sidebar="light"] .sidebar .nav-link.active { color: #fff; }
.rail-toggle { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px; border: 0; border-radius: var(--radius); background: var(--sb-hover); color: var(--sb-fg); font: inherit; cursor: pointer; }
.rail-toggle:hover { color: var(--sb-fg-strong); }
html.rail .sidebar { width: 84px; }
html.rail .sidebar .nl, html.rail .sidebar .caret, html.rail .sidebar .brand-text { display: none; }
html.rail .nav-group .sub { margin-inline-start: 0; padding-inline-start: 0; border: 0; }
html.rail .sidebar .nav-link, html.rail .sidebar summary { justify-content: center; padding: 8px 0; }
html.rail .sidebar .brand { justify-content: center; }
html.rail .rail-toggle { justify-content: center; }
.scrim { display: none; }

/* ---------- topbar ---------- */
.topbar { padding: 14px 28px; gap: 8px; background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); backdrop-filter: saturate(1.5) blur(14px); }
.titles { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.crumbs a { color: var(--muted); display: inline-flex; } .crumbs a:hover { color: var(--primary); }
.crumb-sep { font-size: .75rem; opacity: .6; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchbtn { display: inline-flex; align-items: center; gap: 10px; min-width: 250px; padding: 9px 14px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.searchbtn:hover { border-color: var(--g1); box-shadow: 0 0 0 4px var(--ring); }
.searchbtn span { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: inherit; font-size: .72rem; padding: 1px 7px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.topbar .btn.icon { width: 40px; height: 40px; font-size: 1.1rem; }
.topbar .btn.lang { padding: 6px 10px; font-weight: 700; }
.to-light { display: none; } [data-theme="dark"] .to-light { display: inline-block; } [data-theme="dark"] .to-dark { display: none; }
.bell { position: relative; } .pip { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius); background: var(--grad-btn); color: #fff; font-size: .68rem; font-style: normal; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.notif { min-width: 280px; } .notif a { align-items: flex-start; }
.topbar .user { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 4px 8px 4px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.topbar .user:hover { border-color: var(--g1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; flex: none; }
.uname { display: flex; flex-direction: column; line-height: 1.25; text-align: start; font-weight: 600; font-size: .9rem; }
.uname small { color: var(--muted); font-weight: 400; font-size: .75rem; }
.dropdown .menu form { margin: 0; }

/* ---------- command palette ---------- */
.kw-modal.palette { align-items: start; padding-top: 12vh; }
.pal-box { width: min(620px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--sh-2); overflow: hidden; animation: kwPop .2s ease; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 1.2rem; }
.pal-input input { border: 0; box-shadow: none !important; background: transparent; padding: 0; font-size: 1rem; }
.pal-list { max-height: 55vh; overflow-y: auto; padding: 8px; }
.pal-list .g { padding: 10px 12px 4px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.pal-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--text); }
.pal-list a:hover, .pal-list a.sel { background: color-mix(in srgb, var(--g1) 14%, transparent); }
.pal-list small { color: var(--muted); }

/* ---------- dashboard ---------- */
.dash-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 20px; padding: 30px 34px; margin-bottom: 22px; border-radius: var(--radius-lg); color: #fff; background: var(--grad-btn); box-shadow: 0 24px 50px color-mix(in srgb, var(--g2) 28%, transparent); }
.dash-hero h2 { margin: 0 0 6px; font-size: 1.7rem; font-weight: 800; color: #fff; }
.dash-hero p { margin: 0 0 18px; opacity: .9; }
.dash-hero .btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(6px); }
.dash-hero .btn:hover { background: rgba(255,255,255,.3); }
.dash-hero .btn.primary { background: #fff; color: var(--g2d); box-shadow: none; }
.dash-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-hero .art { max-width: 300px; margin-inline-start: auto; filter: drop-shadow(0 14px 30px rgba(0,0,0,.25)); }
.dash-hero .art .illus { --surface: #fff7ee; }
.dash-hero .o1 { width: 220px; height: 220px; background: #fff; opacity: .16; inset-inline-end: 12%; top: -90px; }
.dash-hero .dots { inset-inline-start: 36%; bottom: 14px; color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; padding: 20px 22px; border-radius: var(--radius-lg); color: #fff; box-shadow: 0 16px 34px color-mix(in srgb, var(--k2) 26%, transparent); background: linear-gradient(135deg, var(--k1), var(--k2)); transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-4px); }
.kpi::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); inset-inline-end: -30px; bottom: -40px; }
.kpi .ico { width: 46px; height: 46px; border-radius: var(--radius); display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 1.4rem; margin-bottom: 14px; backdrop-filter: blur(4px); }
.kpi small { display: block; opacity: .88; font-size: .86rem; }
.kpi strong { display: block; font-size: 1.85rem; line-height: 1.25; letter-spacing: -.02em; }
.kpi .trend { position: absolute; top: 18px; inset-inline-end: 18px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,.2); font-size: .78rem; font-weight: 700; z-index: 1; }
.k-amber { --k1: #f5a524; --k2: #e0592a; } .k-teal { --k1: #2dd4a7; --k2: #0f8a8f; } .k-blue { --k1: #5aa9f7; --k2: #5b5bd6; }
.k-rose { --k1: #f472b6; --k2: #c026d3; } .k-olive { --k1: #9bb86d; --k2: #4f7a4a; } .k-slate { --k1: #7c8aa5; --k2: #3b4a66; }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.dash-grid > .card { margin: 0; min-width: 0; } .span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; border: 0; padding: 0; }
.card-head h3::before { content: none !important; }
.card-head a { font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 5; }
.chart .area { fill: url(#areaG); } .chart .line { fill: none; stroke: var(--g2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: kwDraw 1.6s .15s ease forwards; }
.chart .pt { fill: var(--surface); stroke: var(--g2); stroke-width: 2.5; }
.chart .xl { font-size: 10px; fill: var(--muted); }
@keyframes kwDraw { to { stroke-dashoffset: 0; } }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut circle { fill: none; stroke-width: 18; transition: stroke-dasharray 1s ease; }
.donut .total { font-size: 15px; font-weight: 800; fill: var(--text); text-anchor: middle; }
.legend { display: grid; gap: 8px; flex: 1; min-width: 130px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.legend i { width: 11px; height: 11px; border-radius: var(--radius-sm); flex: none; }
.legend b { margin-inline-start: auto; }
.hbars { display: grid; gap: 14px; }
.hbar .lab { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; }
.hbar .track { height: 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: var(--radius-sm); background: var(--grad); width: 0; animation: kwGrow 1.1s .2s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes kwGrow { to { width: var(--w); } }
.rows { display: grid; gap: 4px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--radius); color: var(--text); transition: background .15s; }
a.row-item:hover { background: var(--surface-2); }
.row-item .av { width: 40px; height: 40px; flex: none; border-radius: var(--radius); display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); font-size: .85rem; }
.row-item .av.alt { background: linear-gradient(135deg, var(--secondary), color-mix(in srgb, var(--secondary) 60%, #000)); }
.row-item .meta { flex: 1; min-width: 0; line-height: 1.4; } .row-item .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-item .meta small { color: var(--muted); }
.row-item .val { font-weight: 700; white-space: nowrap; text-align: end; }
.timeline .row-item .av { width: 34px; height: 34px; border-radius: 50%; font-size: .75rem; }

/* ---------- tables ---------- */
.card.flush { overflow-x: auto; }
.table { border-collapse: separate; border-spacing: 0; }
.table th { position: sticky; top: 0; z-index: 1; padding: var(--row-y) 16px; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); font-size: .8rem; letter-spacing: .01em; text-transform: none; color: var(--muted); }
.table td { padding: var(--row-y) 16px; }
.table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 35%, var(--surface)); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--g1) 8%, var(--surface)); }
.table td img, .table td .thumb { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; background: var(--surface-2); }
.table td.actions .btn { padding: 5px 12px; font-size: .85rem; }
.pagination .btn, .pagination a, .pagination span { border-radius: var(--radius); }

/* ---------- forms / page chrome ---------- */
.toolbar { gap: 10px; }
.toolbar .filters { padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--sh-1); }
.filters input, .filters select { border-width: 1px; }
.alert { border-radius: var(--radius); }
.hint { color: var(--muted); }
.section-nav { position: sticky; top: 72px; z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 8px; margin: 0 0 var(--gap); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--sh-1); }
.section-nav a { flex: none; padding: 7px 16px; border-radius: var(--radius); color: var(--muted); font-weight: 600; font-size: .9rem; }
.section-nav a:hover { color: var(--text); background: var(--surface-2); }
.section-nav a.on { color: #fff; background: var(--grad-btn); }
.card[id] { scroll-margin-top: 140px; }
.settings-group { scroll-margin-top: 90px; }
.chips-nav a { transition: all .15s; } .chips-nav a:hover { background: var(--grad-btn); color: #fff; border-color: transparent; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.preset { cursor: pointer; border: 2px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--surface); text-align: center; font: inherit; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.preset:hover { transform: translateY(-2px); box-shadow: var(--sh-1); }
.preset.on { border-color: var(--g1); box-shadow: 0 0 0 4px var(--ring); }
.preset .sw { display: flex; height: 38px; border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; } .preset .sw i { flex: 1; }

/* ---------- guest / login: split layout ---------- */
body.guest { display: grid; grid-template-columns: 1.05fr 1fr; padding: 0; min-height: 100vh; background: var(--bg); }
.guest-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; color: #fff; background: var(--grad-btn); }
.guest-art .illus { max-width: 440px; --surface: #fff7ee; filter: drop-shadow(0 18px 36px rgba(0,0,0,.25)); }
.guest-art h2 { margin: 22px 0 6px; font-size: 1.7rem; color: #fff; text-align: center; } .guest-art p { opacity: .9; text-align: center; max-width: 380px; margin: 0; }
.guest-art .o1 { width: 340px; height: 340px; background: #fff; opacity: .14; top: -120px; inset-inline-start: -100px; }
.guest-art .o2 { width: 280px; height: 280px; background: var(--g1); opacity: .5; bottom: -100px; inset-inline-end: -80px; }
.guest-art .dots { color: #fff; top: 40px; inset-inline-end: 40px; }
.guest-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 22px; }
.guest-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-2); padding: 34px 32px; }
.guest-card h1 { font-size: 1.5rem; margin: 6px 0 18px; }
.guest-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; color: var(--text); }
.guest-brand .logo-mark { width: 38px; height: 38px; font-size: 1.15rem; }
.guest-links { margin-top: 18px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .dash-hero { grid-template-columns: 1fr; } .dash-hero .art { display: none; } .span-8, .span-4, .span-6 { grid-column: 1 / -1; } .searchbtn span, .searchbtn kbd { display: none; } .searchbtn { min-width: 0; } }
@media (max-width: 900px) {
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 90; width: 290px; transform: translateX(100%); height: 100vh; }
    [dir="ltr"] .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; box-shadow: var(--sh-2); }
    html.rail .sidebar { width: 290px; } html.rail .sidebar .nl, html.rail .sidebar .caret, html.rail .sidebar .brand-text { display: revert; }
    .rail-toggle { display: none; }
    .scrim.show { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(15,10,6,.45); backdrop-filter: blur(2px); }
    .topbar { padding: 10px 14px; } .content { padding: 6px 14px 40px; } .topbar .uname, .topbar .user > .ic { display: none; } .topbar .user { padding: 3px; }
    body.guest { grid-template-columns: 1fr; } .guest-art { display: none; }
}
@media (max-width: 640px) {
    .table.cards-sm thead { display: none; }
    .table.cards-sm, .table.cards-sm tbody, .table.cards-sm tr, .table.cards-sm td { display: block; width: 100%; }
    .table.cards-sm tr { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
    .table.cards-sm td { display: flex; justify-content: space-between; align-items: center; gap: 14px; white-space: normal; border-bottom: 1px solid var(--border); text-align: end; background: transparent !important; }
    .table.cards-sm td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: start; }
    .table.cards-sm td:last-child { border-bottom: 0; }
    .card.flush { overflow: visible; background: transparent; border: 0; box-shadow: none; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
}
@media print { .sidebar, .topbar, .section-nav, .scrim { display: none !important; } body.admin { background: #fff; } }

/* =====================================================================
   ROUND 2 — neutral surfaces, accent only on actions; compact + wide layout; sharp radii
   ===================================================================== */
body.admin { background: var(--bg); }
.round, .avatar, .pip, .steps span, .done-check, .btn-ripple, .donut circle { border-radius: 50%; }
.avatar { border-radius: 50%; }
.pip { border-radius: 9px; }
h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
html { font-size: 14.5px; }

/* ---- layout: narrow sidebar, near full-width fluid content ---- */
.sidebar { width: 240px; padding: 12px 10px 10px; --sb-bg: var(--ink); --sb-fg: #bcc3cd; --sb-fg-strong: #fff; --sb-hover: rgba(255,255,255,.07); --sb-line: rgba(255,255,255,.1); background: var(--sb-bg); }
[data-sidebar="light"] .sidebar { --sb-bg: var(--surface); --sb-fg: var(--text-muted); --sb-fg-strong: var(--text); --sb-hover: var(--surface-2); --sb-line: var(--border); }
[data-sidebar="colored"] .sidebar { --sb-bg: linear-gradient(180deg, var(--primary-600), var(--g2)); --sb-fg: rgba(255,255,255,.86); --sb-fg-strong: #fff; --sb-hover: rgba(255,255,255,.12); --sb-line: rgba(255,255,255,.18); }
[data-theme="dark"][data-sidebar="light"] .sidebar { --sb-bg: var(--surface); }
html.rail .sidebar { width: 68px; }
.sidebar .brand { padding: 4px 6px 12px; margin-bottom: 8px; font-size: 1.05rem; gap: 10px; }
.logo-mark { width: 34px; height: 34px; font-size: 1.05rem; background: var(--grad-btn); box-shadow: none; }
.sidebar nav { gap: 2px; }
.sidebar .nav-link, .sidebar summary { min-height: 38px; padding: 0 10px; gap: 10px; border-radius: var(--radius); font-size: .92rem; }
.ni, summary .ni, summary .ni[class*="g-"] { width: 20px; height: 20px; border-radius: 0; background: none !important; color: inherit; font-size: 18px; box-shadow: none; }
.sidebar summary { font-size: .8rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--sb-fg); opacity: .92; }
.sidebar summary .nl { flex: 1; }
.nav-group[open] > summary { color: var(--sb-fg-strong); }
.nav-group .sub { margin-inline-start: 19px; padding: 2px 0 6px 0; padding-inline-start: 8px; gap: 1px; overflow: hidden; animation: kwOpen .22s ease; }
.nav-group .sub .nav-link { min-height: 34px; padding: 0 8px; font-size: .9rem; }
.nav-group .sub .ni { width: 18px; height: 18px; font-size: 16px; }
@keyframes kwOpen { from { opacity: 0; transform: translateY(-4px); } }
.sidebar .nav-link.active { color: #fff; background: var(--grad-btn); box-shadow: none; }
[data-sidebar="light"] .sidebar .nav-link.active { background: var(--primary-soft); color: var(--primary); }
[data-sidebar="colored"] .sidebar .nav-link.active { background: rgba(255,255,255,.2); }
.sidebar .nav-link.active .ni { background: none !important; }
.sidebar .nav-link.active::before { display: none; }
.rail-toggle { min-height: 36px; padding: 0 10px; border-radius: var(--radius); }
.topbar { min-height: 56px; padding: 0 24px; gap: 6px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border); }
.titles { flex-direction: row; align-items: center; gap: 14px; }
.titles .crumbs { order: 2; font-size: .78rem; padding-inline-start: 14px; border-inline-start: 1px solid var(--border); }
.titles h1 { order: 1; margin: 0; }
.searchbtn { min-width: 220px; padding: 0 12px; height: 38px; border-radius: var(--radius); border-width: 1px; }
.searchbtn:hover { box-shadow: 0 0 0 3px var(--ring); border-color: var(--primary); }
.topbar .btn.icon { width: 38px; height: 38px; border-radius: var(--radius); }
.topbar .user { padding: 3px 8px 3px 10px; border-width: 1px; border-radius: var(--radius); }
.avatar { width: 30px; height: 30px; background: var(--grad-btn); font-size: .85rem; }
.pip { background: var(--grad-btn); box-shadow: 0 0 0 2px var(--bg); }
.content { max-width: 1600px; width: 100%; padding: 20px 24px 40px; }
.card, .kpi { border-radius: var(--radius); }
.card { box-shadow: var(--sh-1); }
.toolbar .filters { border-radius: var(--radius); box-shadow: none; padding: 6px; }

/* ---- tables ---- */
.table { font-size: .9rem; }
.table th { background: var(--surface-2); color: var(--text-muted); font-size: .76rem; font-weight: 700; text-transform: none; padding: 9px 14px; height: 38px; }
.table td { padding: var(--row-y) 14px; height: 46px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:nth-child(even) td { background: transparent; }
.table tbody tr:hover td { background: var(--primary-soft); }
.table td.actions, .table td:last-child:has(.btn, form) { width: 1%; white-space: nowrap; }
.table td img, .table td .thumb { width: 38px; height: 38px; border-radius: var(--radius-sm); }
.num, td[dir="ltr"], th.num { font-variant-numeric: tabular-nums; }

/* ---- dashboard: clean cards, accent gradient on the hero and the first KPI only ---- */
.dash-hero { padding: 24px 28px; border-radius: var(--radius-lg); box-shadow: var(--sh-1); }
.dash-hero h2 { font-size: 1.4rem; }
.dash-hero .art { max-width: 240px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); }
.kpi::after { display: none; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi .ico { width: 38px; height: 38px; border-radius: var(--radius); margin-bottom: 10px; background: var(--primary-soft); color: var(--primary); backdrop-filter: none; font-size: 1.2rem; }
.kpi small { color: var(--text-muted); } .kpi strong { font-size: 1.6rem; }
.kpi .trend { top: 14px; inset-inline-end: 14px; background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-sm); }
.kpi.k-amber { background: var(--grad-btn); color: #fff; border-color: transparent; }
.kpi.k-amber .ico, .kpi.k-amber .trend { background: rgba(255,255,255,.2); color: #fff; } .kpi.k-amber small { color: rgba(255,255,255,.85); }
.dash-grid { gap: 14px; }
.chart .pt { stroke: var(--primary); } .chart .line { stroke: var(--primary); } .chart .xl { fill: var(--text-muted); }
.row-item .av, .row-item .av.alt { border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); }
.timeline .row-item .av { border-radius: 50%; }
.hbar .fill { background: var(--primary); } .hbar .track { border-radius: 3px; height: 8px; }
.legend i { border-radius: 2px; }
.section-nav { top: 64px; border-radius: var(--radius); box-shadow: none; }
.section-nav a { border-radius: var(--radius-sm); } .section-nav a.on { background: var(--primary); }

/* ---- settings: theme cards with live mini preview ---- */
.theme-sec { margin-bottom: 18px; } .theme-sec > h4 { margin: 0 0 8px; font-size: .9rem; }
.presets { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.preset { padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); text-align: start; }
.preset.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.preset .pv { display: grid; grid-template-columns: 22% 1fr; height: 76px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--pb); background: var(--pbg); margin-bottom: 8px; }
.preset .pv .ps { background: var(--ps); padding: 6px 4px; display: grid; gap: 3px; align-content: start; } .preset .pv .ps i { height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); } .preset .pv .ps i:first-child { background: var(--pp); }
.preset .pv .pm { padding: 6px; display: grid; gap: 5px; align-content: start; } .preset .pv .pc { background: var(--psf); border: 1px solid var(--pb); border-radius: 3px; height: 26px; display: flex; align-items: flex-end; gap: 3px; padding: 3px; } .preset .pv .pc b { flex: 1; background: var(--pp); border-radius: 1px; opacity: .85; } .preset .pv .pc b:nth-child(1) { height: 40%; } .preset .pv .pc b:nth-child(2) { height: 70%; } .preset .pv .pc b:nth-child(3) { height: 55%; } .preset .pv .pc b:nth-child(4) { height: 90%; }
.preset .pv .pb { width: 46%; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--pb6), var(--pg2)); }
.preset > span { display: block; font-size: .82rem; font-weight: 600; color: var(--text); }
.neutral-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.neutral-row button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.neutral-row button i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.neutral-row button.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.theme-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }

/* ---- guest / login ---- */
.guest-card { border-radius: var(--radius-lg); box-shadow: var(--sh-2); padding: 30px; }
.guest-art { background: var(--ink); }
.guest-art .illus { filter: none; }
.guest-art h2, .guest-art p { color: #fff; }
.guest-art .o1, .guest-art .o2 { display: none; }
@media (min-width: 1800px) { .content { padding-inline: 32px; } }
