/* ==========================================================
   OmniBSIC Console: polish layer (loaded after main.css)
   Direction: clean, airy, Google-style. Google Sans throughout,
   a light sidebar with a tonal active pill, white surfaces with
   hairline borders instead of heavy shadows, generous rounding
   (pill buttons, 20px cards), calm motion. Same tokens as main.css,
   so dark mode and every page keep working.
   Fonts are self-hosted (SIL OFL, see fonts/LICENSE-google-sans.txt).
   ========================================================== */

@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-ext-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-ext-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-ext-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-ext-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Google Sans'; src: url('fonts/google-sans-latin-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------------- Tokens ---------------- */
:root {
    --font-sans: 'Google Sans', 'Inter Var', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-serif: var(--font-sans);
    --font-display: var(--font-sans);

    --color-canvas: #F6F7FB;
    --color-surface: #FFFFFF;
    --color-surface-2: #F8F9FD;
    --color-border: #E7E9F2;
    --color-border-soft: #EFF0F7;
    --color-border-strong: #D5D8E6;
    --color-text: #1F2237;
    --color-text-muted: #666A85;
    --color-accent-soft: #EEEDFD;
    --color-hover: rgba(108, 92, 231, 0.06);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-xs: 0 1px 2px rgba(31, 34, 55, 0.04);
    --shadow-sm: 0 1px 2px rgba(31, 34, 55, 0.04), 0 1px 3px rgba(31, 34, 55, 0.04);
    --shadow-md: 0 2px 6px rgba(31, 34, 55, 0.05), 0 8px 24px rgba(31, 34, 55, 0.06);
    --shadow-lg: 0 4px 12px rgba(31, 34, 55, 0.06), 0 16px 40px rgba(31, 34, 55, 0.10);

    --input-h: 44px;
    --input-border: #D9DCEA;
    --input-border-hover: #BFC3D9;

    --btn-primary-from: #6C5CE7;
    --btn-primary-to: #6C5CE7;

    --nav-bg: rgba(246, 247, 251, 0.82);
    --card-glass-bg: #FFFFFF;
    --kpi-glass-bg: #FFFFFF;
    --table-head-bg: #F8F9FD;
    --table-head-bg-to: #F8F9FD;
    --row-stripe-bg: transparent;

    --content-pad: 32px;
    --sidebar-width: 264px;

    /* Light sidebar */
    --sb-bg-from: #FFFFFF;
    --sb-bg-to: #FFFFFF;
    --sb-text: #4B4F69;
    --sb-muted: #8387A3;
    --sb-border: #ECEEF5;
    --sb-hover: #F3F4FA;
    --sb-active: #EEEDFD;
    --sb-icon-active: #6C5CE7;
}
:root[data-theme="dark"] {
    --color-canvas: #0F1020;
    --color-surface: #171829;
    --color-surface-2: #1C1D31;
    --color-border: #2A2B45;
    --color-border-soft: #232439;
    --card-glass-bg: #171829;
    --kpi-glass-bg: #171829;
    --table-head-bg: #1B1C30;
    --table-head-bg-to: #1B1C30;
    --nav-bg: rgba(15, 16, 32, 0.82);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --sb-bg-from: #12132A;
    --sb-bg-to: #12132A;
    --sb-text: #B7B9D6;
    --sb-muted: #8386AE;
    --sb-border: rgba(255, 255, 255, 0.07);
    --sb-hover: rgba(255, 255, 255, 0.06);
    --sb-active: rgba(140, 124, 255, 0.20);
    --sb-icon-active: #B9AEFF;
}

/* ---------------- Base ---------------- */
html { font-family: var(--font-sans); }
body {
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1;
}
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.015em; color: var(--color-text); }
h1 { font-size: 26px; letter-spacing: -0.022em; }
h2 { font-size: 20px; }
h3 { font-size: 16.5px; }
.kpi-value, .kpi-tile .kpi-value, .donut-center strong { font-family: var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
td, th, .stat-chip b { font-variant-numeric: tabular-nums; }
a { color: var(--color-accent); }
.app-main { background-image: none; }

/* ---------------- Sidebar (light) ---------------- */
.sidebar { border-right: 1px solid var(--sb-border); box-shadow: none; }
.sidebar-brand { padding: 18px 18px 14px; }
.brand-name { font-family: var(--font-sans); font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; color: var(--color-text); }
.brand-sub { font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--sb-muted); }
:root[data-theme="dark"] .brand-name { color: #fff; }
.brand-mark { border-radius: 12px; box-shadow: none; }

.sidebar .nav-section-label, .sidebar .nav-group-label {
    text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--sb-muted);
    padding: 12px 14px 6px;
}
.sidebar .nav-section-toggle:hover, .sidebar .nav-group-label:hover { color: var(--color-text); }
:root[data-theme="dark"] .sidebar .nav-section-toggle:hover, :root[data-theme="dark"] .sidebar .nav-group-label:hover { color: #E0DEF5; }

.sidebar a.nav-item {
    color: var(--sb-text); font-size: 14px; font-weight: 500; border-radius: 999px;
    padding: 9px 14px; min-height: 40px; gap: 14px;
}
.sidebar a.nav-item:hover { background: var(--sb-hover); color: var(--color-text); transform: none; }
:root[data-theme="dark"] .sidebar a.nav-item:hover { color: #fff; }
.sidebar a.nav-item.active { background: var(--sb-active); color: var(--color-accent); font-weight: 600; box-shadow: none; }
:root[data-theme="dark"] .sidebar a.nav-item.active { color: #fff; }
.sidebar a.nav-item.active::before { display: none; }
.sidebar a.nav-item .icon { opacity: .85; }
.sidebar a.nav-item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

.nav-filter-wrap { background: #F3F4FA; border: 1px solid transparent; border-radius: 999px; }
.nav-filter-wrap:hover { background: #ECEEF8; border-color: transparent; }
.nav-filter-wrap:focus-within { background: #fff; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--ring-color); }
.nav-filter-input { color: var(--color-text); }
.nav-kbd { background: #fff; color: var(--sb-muted); border-color: var(--color-border-strong); }
:root[data-theme="dark"] .nav-filter-wrap { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .nav-filter-wrap:hover { background: rgba(255,255,255,.09); }
:root[data-theme="dark"] .nav-filter-wrap:focus-within { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .nav-filter-input { color: #fff; }
:root[data-theme="dark"] .nav-kbd { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--color-border-strong); background-clip: content-box; }
.nav-pin-btn:hover { background: var(--sb-hover); }
.sidebar-status, .sidebar-foot { border-radius: 999px; }

/* ---------------- Top bar ---------------- */
.navbar { background: var(--nav-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; }
.navbar.is-scrolled { border-bottom-color: var(--color-border); box-shadow: none; }
.navbar .navbar-title { font-weight: 600; letter-spacing: -0.01em; }

/* ---------------- Page header ---------------- */
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 26px; }
.page-header p { font-size: 14px; }
.page-icon { border-radius: 14px; background: var(--color-accent-soft); color: var(--color-accent); box-shadow: none; border: none; }
.page-icon.success { background: var(--color-success-soft); color: var(--color-success); }

/* ---------------- Cards ---------------- */
.card {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    box-shadow: none; transition: box-shadow .25s var(--ease-out), border-color .25s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header .card-title, .card-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.card-subtitle { color: var(--color-text-muted); }

/* KPI tiles: flat, no gradient wash */
.kpi-tile {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    box-shadow: none; padding: 18px 20px;
    transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out);
}
.kpi-tile::before { display: none; }
.kpi-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.kpi-tile .kpi-value { font-size: 32px; font-weight: 600; }
.kpi-tile .kpi-label { font-size: 13px; font-weight: 500; }
.kpi-tile-link { font-weight: 500; }

/* Dashboard hero: soft tonal card instead of a heavy dark banner */
.dash-hero {
    background: linear-gradient(120deg, #6C5CE7 0%, #8A7BFF 55%, #A99BFF 100%);
    border: none; border-radius: var(--radius-xl); box-shadow: 0 10px 30px -12px rgba(108, 92, 231, .45);
    padding: 26px 30px;
}
.dash-hero h1 { color: #fff; font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.dash-hero p { color: rgba(255,255,255,.85); font-size: 14px; }
.dash-hero-eyebrow { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); }
.dash-hero-meta > *, .dash-hero .stat-chip, .dash-hero .hero-chip {
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); color: #fff; border-radius: 999px; backdrop-filter: blur(6px);
}
:root[data-theme="dark"] .dash-hero { background: linear-gradient(120deg, #3B3394 0%, #4A3FB8 60%, #5B4FD0 100%); box-shadow: none; }

/* ---------------- Buttons: pills ---------------- */
.btn {
    border-radius: 999px; font-weight: 500; font-size: 14px; letter-spacing: 0;
    padding: 10px 20px; min-height: 40px; box-shadow: none;
    transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .18s var(--ease-out), color .18s var(--ease-out);
}
.btn:hover { transform: none; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: #fff; box-shadow: 0 1px 2px rgba(108,92,231,.3); }
.btn-primary:hover { background: var(--color-accent-strong); border-color: var(--color-accent-strong); filter: none; box-shadow: 0 4px 14px -4px rgba(108,92,231,.55); }
:root[data-theme="dark"] .btn-primary { background: #7E6FF3; border-color: #7E6FF3; }
.btn-secondary { background: var(--color-surface); border: 1px solid var(--color-border-strong); color: var(--color-accent); }
.btn-secondary:hover { background: var(--color-accent-soft); border-color: var(--color-accent-soft); }
.btn-ghost { color: var(--color-accent); }
.btn-danger { box-shadow: none; }
.btn-xs, .btn-sm { padding: 6px 14px; min-height: 32px; font-size: 13px; }
.btn-icon, .btn-icon-sm { border-radius: 999px; }

/* ---------------- Form controls ---------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], input[type="url"], input[type="tel"], input[type="datetime-local"], select, textarea, .filter-select {
    border-radius: var(--radius-sm); border: 1px solid var(--input-border); background-color: var(--input-bg);
    transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background-color .16s var(--ease-out);
}
.filter-select, select.filter-select { border-radius: 999px; }
input:focus, select:focus, textarea:focus, .filter-select:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--ring-color); }
input[type="file"] { border-radius: var(--radius-sm); }
.field-label { font-weight: 500; font-size: 13px; color: var(--color-text); }
.field-hint { color: var(--color-text-muted); font-size: 12.5px; }
.form-section { border-radius: var(--radius-lg); border: 1px solid var(--color-border); background: var(--color-surface); box-shadow: none; }
.form-section-title { font-weight: 600; letter-spacing: -0.01em; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-accent); }
.search-input, .table-toolbar .search-input { border-radius: 999px; }

/* ---------------- Tables ---------------- */
table.data-table { border-radius: 0; }
table.data-table th {
    background: var(--table-head-bg); text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600;
    color: var(--color-text-muted); border-bottom: 1px solid var(--color-border);
}
table.data-table td { border-bottom: 1px solid var(--color-border-soft); }
table.data-table tbody tr:hover td { background: var(--color-surface-2); }
.card-flush { overflow: hidden; }
.table-toolbar { border-bottom: 1px solid var(--color-border-soft); }

/* ---------------- Badges and chips ---------------- */
.badge, .stat-chip { border-radius: 999px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.badge { padding: 3px 11px; font-size: 12px; }
.flash { border-radius: var(--radius-md); border-left-width: 0; border: 1px solid transparent; padding: 12px 16px; }
.flash-success { border-color: rgba(23,166,115,.25); }
.flash-error { border-color: rgba(225,73,63,.25); }
.flash-info { border-color: rgba(108,92,231,.22); }
.empty-state-icon { border-radius: 20px; }

/* ---------------- Menus, modals, toasts ---------------- */
.dropdown-menu, .notif-panel, .user-menu, .palette, .modal, .modal-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); }

/* ---------------- Motion ---------------- */
.content { animation: pageIn .32s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------------- Responsive polish ---------------- */
@media (max-width: 900px) {
    :root { --content-pad: 16px; }
    h1, .page-header h1 { font-size: 22px; }
    .dash-hero { padding: 22px 20px; border-radius: 24px; }
    .dash-hero h1 { font-size: 24px; }
    .sidebar { box-shadow: var(--shadow-lg); }
    .kpi-tile { padding: 16px; }
    .kpi-tile .kpi-value { font-size: 28px; }
    .page-header { gap: 12px; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
    .btn { min-height: 44px; }
    .btn-xs, .btn-sm { min-height: 36px; }
    input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
    .card { border-radius: 18px; }
}

/* ---------------- Overrides of late main.css rules ---------------- */
.sidebar {
    background: var(--sb-bg-from);
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
.sidebar a.nav-item.active { background: var(--sb-active); box-shadow: none; }
:root[data-theme="dark"] .sidebar a.nav-item.active { background: var(--sb-active); }
.page-header h1 { background: none; -webkit-text-fill-color: initial; color: var(--color-text); }
.kpi-tile::before, .kpi-tile::after,
.kpi-tile:has(.kpi-value.success)::before, .kpi-tile:has(.kpi-value.success)::after,
.kpi-tile:has(.kpi-value.warning)::before, .kpi-tile:has(.kpi-value.warning)::after,
.kpi-tile:has(.kpi-value.danger)::before, .kpi-tile:has(.kpi-value.danger)::after { display: none !important; }
.kpi-tile { background: var(--color-surface); }
.kpi-tile:hover .kpi-icon-badge { transform: none; }
.kpi-icon-badge { border-radius: 12px; }
.tabs-pill .tab.active, .tabs-pill .tab[aria-selected="true"] { background: var(--color-accent); color: #fff; box-shadow: none; }
.modal-box, .modal-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
:root:not([data-theme="dark"]) .modal-box, :root:not([data-theme="dark"]) .modal-panel { background: #fff; }
.modal-overlay { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { background-color: var(--input-bg); }
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]), :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background-color: var(--input-bg); }
.rc-fmt, dt, .dropdown-head, .rc-group-n, .donut-center small, .donut-label, .kpi-eyebrow, .eyebrow { text-transform: none; letter-spacing: 0; }
h4 { text-transform: none; letter-spacing: -0.005em; }
.donut-center span, .donut-total-label { text-transform: none; letter-spacing: 0; }

/* ---------------- Sign-in and verification ---------------- */
.auth-card-v7 { border-radius: 28px; border: 1px solid var(--color-border); box-shadow: 0 20px 60px -24px rgba(31, 34, 55, 0.25); background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme="dark"] .auth-card-v7 { background: var(--color-surface); }
.auth-card-v7::before { height: 0; }
.auth-card-v7-inner { padding: 44px 40px 36px; }
.auth-left-mark { background: var(--color-accent); color: #fff; border-radius: 14px; width: 44px; height: 44px; }
.auth-left-name { font-family: var(--font-sans); font-weight: 600; font-size: 16.5px; color: var(--color-text); letter-spacing: -0.01em; }
.auth-left-sub { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.auth-form-head h2 { font-size: 26px; letter-spacing: -0.022em; }
.auth-form-head .auth-sub { font-size: 14px; }
.auth-step-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.auth-body .input-with-icon { border-radius: 14px; padding-top: 13px; padding-bottom: 13px; font-size: 15px; }
.otp-box, .otp-input { font-family: var(--font-sans); font-weight: 600; border-radius: 14px; }
.otp-box.is-filled { border-color: var(--color-accent); background: var(--color-accent-soft); }
.auth-submit { padding: 13px; font-size: 15px; }
.auth-checklist { background: var(--color-surface-2); border-radius: 16px; }
@media (max-width: 480px) { .auth-card-v7-inner { padding: 32px 22px 26px; } .auth-card-v7 { border-radius: 24px; } }

/* Quiet, sentence-case labels instead of tracked capitals */
.content dt, .content h4, .cal-weekday { text-transform: none !important; letter-spacing: 0 !important; }
.content dt { font-size: 12.5px; font-weight: 500; color: var(--color-text-muted); }
.content h4 { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.cal-weekday { font-size: 12.5px; font-weight: 500; }
.content .muted { text-transform: none !important; letter-spacing: 0 !important; }

/* Table toolbar and pager stay put while a wide table scrolls sideways */
.table-scroll > .table-toolbar, .table-scroll > .pager-wrap { position: sticky; left: 0; box-sizing: border-box; width: 100%; max-width: 100%; }
.table-toolbar { flex-wrap: nowrap; }
.table-toolbar .search-input-wrap { flex: 1 1 auto; min-width: 0; max-width: 420px; }
.table-toolbar .table-count { flex: 0 0 auto; margin-left: auto; }
.table-toolbar .btn-icon-sm { flex: 0 0 auto; }
.card.card-flush { padding: 0; }
.table-scroll > .table-toolbar, .table-toolbar { flex-direction: row; align-items: center; flex-wrap: nowrap; }
.table-scroll > .table-toolbar .search-input-wrap, .table-toolbar .search-input-wrap { flex: 1 1 0; max-width: 420px; }
@media (max-width: 600px) { .table-scroll > .table-toolbar .search-input-wrap, .table-toolbar .search-input-wrap { max-width: none; flex-basis: 0; } .table-toolbar .table-count { display: none; } }

/* ---------------- Phones: list tables become cards ---------------- */
@media (max-width: 640px) {
    table.data-table.is-stackable, table.data-table.is-stackable tbody { display: block; width: 100%; min-width: 0; }
    table.data-table.is-stackable thead { display: none; }
    table.data-table.is-stackable tbody tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; margin: 0 0 12px; padding: 10px 0;
        border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface);
    }
    table.data-table.is-stackable tbody td.is-wide, table.data-table.is-stackable tbody td.no-label:not(:has(input[type="checkbox"])), table.data-table.is-stackable tbody td:first-child:not(.no-label) { grid-column: 1 / -1; }
    table.data-table.is-stackable tbody tr:hover td { background: transparent; }
    table.data-table.is-stackable tbody td {
        display: block; padding: 6px 16px; border: 0; text-align: left; white-space: normal; min-width: 0; background: transparent;
    }
    table.data-table.is-stackable tbody td[data-label]::before {
        content: attr(data-label); display: block; margin-bottom: 2px;
        font-size: 12px; font-weight: 500; color: var(--color-text-muted);
    }
    table.data-table.is-stackable tbody td:empty { display: none; }
    table.data-table.is-stackable tbody td.no-label:has(input[type="checkbox"]) { position: absolute; top: 8px; right: 6px; padding: 8px 12px; }
    table.data-table.is-stackable tbody td.no-label:not(:has(input[type="checkbox"])) { padding-top: 2px; padding-bottom: 4px; }
    table.data-table.is-stackable tbody td input[type="text"] { width: 100%; min-width: 0; }
    .table-scroll { overflow-x: visible; border: 0; }
    .table-scroll > .table-toolbar, .table-scroll > .pager-wrap { position: static; }
    .table-scroll > .table-toolbar { margin-bottom: 12px; }
    .card.card-flush:has(table.is-stackable) { background: transparent; border: 0; box-shadow: none; }
    .card.card-flush:has(table.is-stackable) .table-toolbar.is-flush { padding: 0; }
    .card.card-flush:has(table.is-stackable) .pager-wrap.is-flush { padding: 4px 0 12px; }
}
.nav-filter-wrap .nav-filter-input { background: transparent; border: 0; box-shadow: none; border-radius: 0; min-height: 0; height: auto; padding-left: 0; }
.nav-filter-wrap .nav-filter-input:hover, .nav-filter-wrap .nav-filter-input:focus { background: transparent; border: 0; box-shadow: none; }
.rc-group-title { font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: -0.005em; color: var(--color-text); margin-bottom: 12px; }
