/* =====================================================================
   WISEPAQ Help Desk — design system
   โทน: ฟ้าอ่อน → น้ำเงินอ่อน บนพื้นขาว · ฟอนต์ IBM Plex Sans Thai Looped
   ===================================================================== */

:root {
    --font: "IBM Plex Sans Thai Looped", "Sarabun", "Leelawadee UI", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    /* brand */
    --blue-50:  #F1F6FF;
    --blue-100: #E2ECFE;
    --blue-200: #C5D8FC;
    --blue-300: #9BBCF8;
    --blue-400: #5E93F2;
    --blue-500: #2F6FEB;
    --blue-600: #1E5AD6;
    --blue-700: #1848B0;
    --blue-800: #163B8C;
    --sky-400:  #48A9F8;

    /* surfaces */
    --bg:        #F4F8FE;
    --surface:   #FFFFFF;
    --surface-2: #F7FAFF;
    --line:      #E4ECF7;
    --line-2:    #D3DFF0;

    /* text */
    --ink:   #13254A;
    --ink-2: #3C4E70;
    --muted: #7586A3;

    /* semantic */
    --amber:     #F08C1A;  --amber-bg:  #FFF3E4;
    --green:     #1AA66F;  --green-bg:  #E5F7EF;
    --red:       #E5484D;  --red-bg:    #FDECEC;
    --teal:      #0EA5A4;  --teal-bg:   #E3F6F6;
    --violet:    #7C5CE0;  --violet-bg: #F0ECFD;
    --slate:     #64748B;  --slate-bg:  #EEF2F7;

    --radius-lg: 18px;
    --radius:    14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(19, 37, 74, .04), 0 1px 3px rgba(19, 37, 74, .05);
    --shadow:    0 2px 4px rgba(19, 37, 74, .03), 0 8px 24px rgba(30, 90, 214, .07);
    --shadow-lg: 0 12px 40px rgba(30, 90, 214, .16);
    --ring:      0 0 0 4px rgba(47, 111, 235, .16);

    --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.icon     { width: 20px; height: 20px; flex: none; }
.icon-sm  { width: 16px; height: 16px; }
.icon-brand { color: var(--blue-500); }

/* ------------------------------------------------------------ layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w);
    display: flex; flex-direction: column; gap: 28px;
    padding: 22px 16px 18px;
    color: #fff;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(120, 190, 255, .35) 0%, transparent 60%),
        linear-gradient(180deg, #2A74F0 0%, #1E5AD6 45%, #1848B0 100%);
    box-shadow: 4px 0 24px rgba(24, 72, 176, .18);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; color: #fff; }
.brand:hover { color: #fff; }
.brand-logo { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 17px; letter-spacing: .02em; }
.brand-text small { font-size: 12px; opacity: .78; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 12px; white-space: nowrap;
    color: rgba(255, 255, 255, .86); font-weight: 500;
    transition: background .15s, color .15s, transform .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-link.is-active {
    background: rgba(255, 255, 255, .2); color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 6px 16px rgba(12, 40, 110, .18);
}
.nav-link.is-disabled { opacity: .5; cursor: not-allowed; }
.nav-link em {
    margin-left: auto; font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
    padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .16);
}

.sidebar-help {
    margin-top: auto; display: flex; align-items: center; gap: 12px;
    padding: 14px; border-radius: 14px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
}
.sidebar-help-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.sidebar-help strong { display: block; font-size: 13.5px; }
.sidebar-help small { font-size: 12px; opacity: .8; }

.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    height: 68px; padding: 0 28px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.icon-btn.topbar-menu { display: none; }
.topbar-search {
    position: relative; margin-left: auto; width: min(360px, 100%);
}
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.topbar-search input {
    width: 100%; height: 40px; padding: 0 14px 0 38px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
    font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus { outline: none; border-color: var(--blue-300); box-shadow: var(--ring); background: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--blue-50); color: var(--blue-600); }

.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 5px; border: 0; border-radius: 14px; background: transparent; cursor: pointer;
}
.user-chip:hover { background: var(--blue-50); }
.avatar {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--sky-400), var(--blue-600)); color: #fff; font-weight: 700;
}
.user-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: left; }
.user-chip-text strong { font-size: 14px; }
.user-chip-text small { font-size: 12px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
[data-dropdown].is-open .dropdown { opacity: 1; transform: none; pointer-events: auto; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: 0; border-radius: 10px; background: none;
    color: var(--ink-2); font-size: 14px; text-align: left; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--blue-50); color: var(--blue-700); }
.dropdown .danger:hover { background: var(--red-bg); color: var(--red); }
.dropdown .icon { width: 18px; height: 18px; }
.dropdown form { margin: 0; }

.content { padding: 28px; display: flex; flex-direction: column; gap: 20px; max-width: 1440px; width: 100%; min-width: 0; }
.content > * { min-width: 0; max-width: 100%; }

/* ------------------------------------------------------------ page */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.greeting { display: flex; align-items: center; gap: 14px; }
.greeting-wave {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 26px;
    background: linear-gradient(135deg, #FFF6E0, #FFE9C2);
}
.greeting h1 { font-size: 26px; }
.greeting p { color: var(--muted); font-size: 14px; }
.page-date { color: var(--muted); font-size: 14px; }
.page-narrow { max-width: 520px; }

.section-caption { color: var(--muted); font-size: 13.5px; margin-bottom: -8px; }
.section-caption strong { color: var(--ink); }

/* ------------------------------------------------------------ cards */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); min-width: 0;
}
.card-pad { padding: 22px 24px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.card-head-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16.5px; }
.card-sub { color: var(--muted); font-size: 13px; }

.tile-icon {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--blue-100);
}

.filter-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.filter-reset { margin-left: auto; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
    padding: 7px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
    color: var(--ink-2); background: #fff; border: 1px solid var(--line-2);
    transition: all .15s;
}
.pill:hover { border-color: var(--blue-300); color: var(--blue-600); background: var(--blue-50); }
.pill.is-active {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    box-shadow: 0 6px 14px rgba(47, 111, 235, .28);
}

.range-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.range-sep { padding-bottom: 10px; color: var(--muted); }

/* ------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
    display: flex; align-items: center; gap: 16px; padding: 20px 22px;
    border-radius: var(--radius-lg); border: 1px solid var(--line); color: var(--ink);
    background: var(--surface); box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.stat-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; flex: none; }
.stat-icon .icon { width: 26px; height: 26px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 14px; font-weight: 600; }
.stat-value { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat-trend { font-size: 12.5px; font-weight: 600; }
.stat-trend small { font-weight: 400; color: var(--muted); }
.stat-trend.is-up { color: var(--green); }
.stat-trend.is-down { color: var(--red); }
.stat-trend.is-flat { color: var(--muted); font-weight: 400; }

.stat-blue  { background: linear-gradient(135deg, #EEF4FF, #E1EBFF); border-color: #D5E3FD; }
.stat-blue  .stat-icon { background: #fff; color: var(--blue-500); box-shadow: 0 4px 12px rgba(47,111,235,.15); }
.stat-blue  .stat-label, .stat-blue .stat-value { color: var(--blue-700); }
.stat-amber { background: linear-gradient(135deg, #FFF7EC, #FFEFD9); border-color: #FDE3C0; }
.stat-amber .stat-icon { background: #fff; color: var(--amber); box-shadow: 0 4px 12px rgba(240,140,26,.15); }
.stat-amber .stat-label, .stat-amber .stat-value { color: #C26A06; }
.stat-green { background: linear-gradient(135deg, #EDFAF4, #DFF5EA); border-color: #C9EDDA; }
.stat-green .stat-icon { background: #fff; color: var(--green); box-shadow: 0 4px 12px rgba(26,166,111,.15); }
.stat-green .stat-label, .stat-green .stat-value { color: #13865A; }
.stat-plain .stat-icon { background: var(--blue-50); color: var(--blue-600); }

/* ------------------------------------------------------------ charts */
.chart-wrap { padding: 18px 22px 14px; }
.chart { width: 100%; height: 280px; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-bar { transition: opacity .15s; }
.chart-bar:hover { opacity: .8; }
.chart-bar.is-total, .dot.is-total   { fill: var(--blue-500); background: var(--blue-500); }
.chart-bar.is-open, .dot.is-open     { fill: var(--amber);    background: var(--amber); }
.chart-bar.is-closed, .dot.is-closed { fill: var(--green);    background: var(--green); }
.dot.is-teal { background: var(--teal); }

.legend { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.donut-wrap { display: grid; place-items: center; padding: 20px 22px 6px; }
.donut { width: 200px; height: 200px; }
.donut-track { fill: none; stroke: var(--blue-50); }
.donut-seg { fill: none; transition: opacity .15s; }
.donut-seg:hover { opacity: .85; }
.donut-seg.is-total  { stroke: var(--blue-500); }
.donut-seg.is-open   { stroke: var(--amber); }
.donut-seg.is-teal   { stroke: var(--teal); }
.donut-seg.is-closed { stroke: var(--green); }
.donut-value { font-size: 40px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.donut-label { font-size: 13px; fill: var(--muted); font-family: var(--font); }
.donut-legend { list-style: none; margin: 0; padding: 8px 22px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.donut-legend li { display: flex; align-items: center; gap: 10px; }
.donut-legend span { flex: 1; color: var(--ink-2); }
.donut-legend small { width: 42px; text-align: right; color: var(--muted); }

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

/* ------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 11px 16px; text-align: left; white-space: nowrap;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--blue-50); }
.cell-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cell-muted { color: var(--ink-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.cell-date { white-space: nowrap; color: var(--ink-2); }
.ticket { font-family: var(--mono); font-size: 13px; font-weight: 500; white-space: nowrap; }

/* ------------------------------------------------------------ badges */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-blue   { color: var(--blue-600); background: var(--blue-100); }
.badge-amber  { color: #C26A06;        background: var(--amber-bg); }
.badge-green  { color: #13865A;        background: var(--green-bg); }
.badge-red    { color: #C9353A;        background: var(--red-bg); }
.badge-teal   { color: #0B8584;        background: var(--teal-bg); }
.badge-violet { color: #6243C9;        background: var(--violet-bg); }
.badge-slate  { color: var(--slate);   background: var(--slate-bg); }

/* ------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { min-width: 180px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input {
    width: 100%; height: 44px; padding: 0 14px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff;
    font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--blue-200); }
.input:focus { outline: none; border-color: var(--blue-400); box-shadow: var(--ring); }
.input-sm { height: 36px; font-size: 13.5px; padding: 0 10px; }
select.input { padding-right: 32px; }
.input-group { position: relative; display: block; }
.input-group .input { padding-right: 46px; }
.input-addon {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted); cursor: pointer;
}
.input-addon:hover { color: var(--blue-600); background: var(--blue-50); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: transform .12s, box-shadow .15s, background .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
    color: #fff; background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    box-shadow: 0 6px 16px rgba(47, 111, 235, .28);
}
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(47, 111, 235, .36); }
.btn-ghost { color: var(--blue-600); background: #fff; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue-200); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--blue-600); }

/* ------------------------------------------------------------ alerts / empty */
.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; border: 1px solid transparent;
}
.alert .icon { width: 18px; height: 18px; margin-top: 2px; }
.alert-success { background: var(--green-bg); color: #106E4A; border-color: #C9EDDA; }
.alert-danger  { background: var(--red-bg);   color: #B12B30; border-color: #F8D0D1; }
.alert-warning { background: var(--amber-bg); color: #9A5405; border-color: #FDE3C0; }
.alert-info    { background: var(--blue-50);  color: var(--blue-700); border-color: var(--blue-100); }
.alert-list { margin: 0; padding-left: 18px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--blue-50); color: var(--blue-400); }
.empty-icon .icon { width: 28px; height: 28px; }

/* ------------------------------------------------------------ auth */
.auth { min-height: 100vh; background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero {
    position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px; color: #fff;
    background:
        radial-gradient(70% 50% at 15% 10%, rgba(140, 205, 255, .55) 0%, transparent 60%),
        radial-gradient(60% 60% at 100% 100%, rgba(12, 40, 120, .5) 0%, transparent 60%),
        linear-gradient(160deg, #3B8BF5 0%, #1E5AD6 50%, #163B8C 100%);
}
.auth-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-hero-logo { width: 64px; height: 64px; margin-bottom: 22px; }
.auth-hero h2 { font-size: 34px; letter-spacing: .01em; }
.auth-hero p { margin-top: 10px; font-size: 17px; opacity: .9; line-height: 1.7; }
.auth-hero-points { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-hero-points li {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px);
}
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 24px; }
.auth-card {
    width: 100%; max-width: 420px; padding: 36px 34px;
    background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
}
.auth-card .form { margin-top: 8px; }
.auth-card .alert { margin-bottom: 4px; }
.auth-title { font-size: 26px; }
.auth-sub { margin: 6px 0 22px; color: var(--muted); font-size: 14.5px; }
.auth-note { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.auth-alt { margin-top: 16px; text-align: center; }
.auth-foot { color: var(--muted); font-size: 12.5px; }

.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.error-code {
    font-size: 88px; font-weight: 700; line-height: 1; letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--sky-400), var(--blue-700)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page h1 { font-size: 24px; }
.error-page p { color: var(--muted); max-width: 460px; }
.error-page .btn { margin-top: 12px; }
.error-ref code { padding: 2px 8px; border-radius: 6px; background: var(--blue-50); color: var(--blue-700); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(19, 37, 74, .35); }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .icon-btn.topbar-menu { display: grid; }
    .content { padding: 20px 16px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 640px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .topbar-search { display: none; }
    .page-date { width: 100%; }
    .legend { gap: 10px; font-size: 12px; }
    .topbar-actions { margin-left: auto; }
    .user-chip-text { display: none; }
    .greeting h1 { font-size: 22px; }
    .card-pad { padding: 18px; }
    .range-form .field-inline { flex: 1 1 100%; }
    .range-sep { display: none; }
    .range-form .btn { width: 100%; }
    .chart { height: 220px; }
    .auth-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
