/* =====================================================================
   NapiPay UI — design tokens, layout, components.
   Mobile-first; everything scales up at 720 / 960 / 1200.
   ===================================================================== */

:root {
    --brand:        #305d8c;
    --brand-dark:   #244769;
    --brand-tint:   #e6edf5;

    --ok:           #2e7d32;
    --warn:         #c95b0a;
    --err:          #c0392b;
    --danger:       #e74c3c;
    --danger-dark:  #c0392b;

    --ink:          #1f2937;
    --ink-2:        #2d3748;
    --muted:        #6b7280;
    --muted-2:      #9aa3ad;

    --bg:           #f3f5f7;
    --surface:      #ffffff;
    --surface-2:    #f7f9fb;
    --line:         #e2e6ea;
    --line-2:       #eef0f3;

    --radius:       6px;
    --radius-sm:    4px;
    --shadow-1:     0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
    --shadow-2:     0 4px 14px rgba(15,23,42,.10);

    --topbar-h:     56px;
    --content-pad-x: 24px;
    --content-pad-y: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* =====================================================================
   Top bar
   ===================================================================== */
.topbar {
    background: var(--brand);
    color: #fff;
    height: var(--topbar-h);
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.10);
    position: sticky; top: 0; z-index: 60;
}
.topbar .brand {
    color: #fff; text-decoration: none;
    font-size: 17px; font-weight: 700;
    padding: 0 12px 0 4px;
    border-right: 1px solid rgba(255,255,255,.18);
    margin-right: 4px;
    display: inline-flex; align-items: center; gap: 8px;
}
.brand-logo { height: 26px; width: 26px; object-fit: contain; }

/* hamburger — visible only on narrow screens */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    width: 38px; height: 38px;
    line-height: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.12); }

.top-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.top-nav::-webkit-scrollbar { height: 4px; }
.top-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }
.top-nav a {
    color: #fff; text-decoration: none;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.top-nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.top-nav a.active { background: rgba(255,255,255,.22); }

.top-nav .ico, .side-nav .nav-ico, .topbar-user .btn-link .ico, .topbar .brand .ico {
    font-family: "Segoe UI Symbol", "Segoe UI", system-ui, sans-serif;
    font-variant-emoji: text;
    filter: grayscale(1) brightness(2);
}
.side-nav .nav-ico { filter: grayscale(1); }
.top-nav .ico { font-size: 16px; line-height: 1; }

.topbar-user {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-size: 13px;
    margin-left: auto;
}
.topbar-user a { color: #fff; text-decoration: none; }
.user-name { opacity: .8; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-link {
    background: none; border: 0; color: #fff;
    cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: 13.5px;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-link:hover { background: rgba(255,255,255,.15); }

/* =====================================================================
   Main shell
   ===================================================================== */
.main {
    /* All inner pages keep their own padding via .content / .page-pad,
       so the shell stays a 0-padding container. */
}

/* For pages WITHOUT the sidebar workspace (Companies, Employees,
   BankAccounts, Institutions, Settings, etc.) we wrap their content
   into a uniform padded container by targeting the immediate children
   of .main. */
.main > .page-header,
.main > .table-wrap,
.main > .entity-form,
.main > form.entity-form,
.main > .filter-bar,
.main > h1,
.main > h2,
.main > p,
.main > .card,
.main > .toolbar,
.main > div:not(.workspace):not(.content) {
    /* fallback only — actual page templates wrap in .page-pad */
}

.page-pad { padding: var(--content-pad-y) var(--content-pad-x); }

/* Pages without a .workspace or full-bleed .filter-bar at the top
   get uniform padding for free, so indexes/forms aren't glued to the edge. */
.main:not(:has(> .workspace)):not(:has(> .filter-bar)):not(:has(> .content)) {
    padding: var(--content-pad-y) var(--content-pad-x);
}

/* =====================================================================
   Filter bar — desktop & mobile
   ===================================================================== */
.filter-bar {
    background: #fff;
    padding: 10px var(--content-pad-x);
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    position: sticky; top: var(--topbar-h); z-index: 50;
}
.filter-bar label { font-size: 12px; color: var(--muted); }
.filter-bar select,
.filter-bar input[type="number"],
.filter-bar input[type="text"] {
    padding: 7px 10px;
    border: 1px solid #ccd2d8; border-radius: var(--radius-sm);
    font-size: 13px; background: #fff; min-width: 110px;
    height: 34px;
}
.filter-bar .grow { flex: 1; min-width: 160px; }
.filter-bar .btn-load {
    background: var(--brand); color: #fff; border: 0;
    padding: 0 16px; height: 34px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
}
.filter-bar .btn-load:hover { background: var(--brand-dark); }
.filter-bar .btn-load .caret { font-size: 10px; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: 100%; margin-top: 4px;
    background: #fff; border: 1px solid #d0d6dc; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
    list-style: none; min-width: 220px; z-index: 50; padding: 4px 0;
}
.dropdown-item {
    display: block; width: 100%; text-align: left;
    background: none; border: 0; padding: 9px 14px;
    cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.dropdown-item:hover { background: var(--surface-2); }

/* =====================================================================
   Workspace (sidebar + content)
   ===================================================================== */
.workspace {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - var(--topbar-h));
}

.side-nav {
    background: #fff;
    border-right: 1px solid var(--line);
}
.side-nav-title {
    padding: 14px 18px;
    font-size: 12.5px; font-weight: 600;
    color: #fff; background: var(--brand);
    letter-spacing: .3px;
}
.side-nav ul { list-style: none; }
.side-nav a {
    display: block;
    padding: 11px 18px;
    color: var(--ink-2); text-decoration: none;
    border-bottom: 1px solid var(--line-2);
    font-size: 13.5px;
}
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-nav .nav-ico { font-size: 16px; margin-right: 8px; vertical-align: middle; }
.side-nav .nav-label { font-weight: 600; display: block; }
.side-nav .nav-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.side-nav a.active .nav-sub { color: rgba(255,255,255,.75); }

.content {
    padding: var(--content-pad-y) var(--content-pad-x);
    overflow-x: hidden;
    min-width: 0;
}
.content-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.content-header h1 { color: var(--ink-2); font-size: 19px; font-weight: 700; }

/* =====================================================================
   Stats / cards
   ===================================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.stat-pill { padding: 14px 16px; border-radius: var(--radius); }
.stat-pill .top { display: flex; justify-content: space-between; align-items: center; }
.stat-pill h3 { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-pill .label { font-size: 12.5px; }
.stat-pill .card-sub { font-size: 11.5px; opacity: .8; margin-top: 2px; }
.stat-pill.red { background: #fdecea; border: 1px solid #f7c4be; color: #b71c1c; }
.stat-pill.orange { background: #fff4e0; border: 1px solid #ffd6a0; color: #c95b0a; }
.stat-pill.green { background: #e8f5e9; border: 1px solid #b6dcb7; color: #1b5e20; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.card {
    background: #fff; border-radius: var(--radius);
    padding: 14px 16px;
    border-left: 4px solid var(--brand);
    box-shadow: var(--shadow-1);
}
.card.blue { border-left-color: #4a90e2; background: #ebf3fc; }
.card.dark { border-left-color: var(--brand); background: #d8e3f0; }
.card .card-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card .card-value { font-size: 22px; font-weight: 700; color: var(--ink-2); margin-top: 4px; }
.card .card-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* =====================================================================
   Anonymous pages
   ===================================================================== */
.anon-page { background: linear-gradient(135deg, var(--brand) 0%, #1e3d5c 100%);
    min-height: 100vh; display: grid; place-items: center; margin: 0; }
.anon-main { width: 100%; max-width: 420px; padding: 20px; }
.auth-card { background: #fff; padding: 28px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.20); }
.auth-card h1 { color: var(--brand); margin-bottom: 20px; text-align: center; }

/* =====================================================================
   Forms — base
   ===================================================================== */
.form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-row.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form-row label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-row input,
.form-row select,
.form-row textarea {
    padding: 8px 10px;
    border: 1px solid #ccd2d8;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    background: #fff;
    font-family: inherit;
    color: var(--ink);
    width: 100%;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(48,93,140,.14);
}
.form-row small { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.error { color: var(--err); font-size: 12px; }
.error-summary {
    background: #fde8e6; border: 1px solid #f5c2bd; color: #9c2317;
    padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 14px;
    font-size: 13px;
}

/* =====================================================================
   Buttons — one consistent system, with or without icons.
   .btn-icon-only is a square 34px button (no label).
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(48,93,140,.30);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-secondary { background: #fff; color: var(--ink-2); border-color: #d0d6dc; }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #a8b3bd; color: var(--ink-2); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-dark); border-color: var(--danger-dark); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon-only { width: 34px; padding: 0; }
.btn-icon-only.btn-sm { width: 28px; }

/* Common page action group */
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* =====================================================================
   Tables — compact, neat, scroll-on-mobile
   Padding 6px 10px keeps rows low and density high.
   ===================================================================== */
.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: auto;          /* horizontal scroll on narrow screens */
    box-shadow: var(--shadow-1);
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}
.data-table thead {
    background: var(--surface-2);
    position: sticky; top: 0; z-index: 1;
}
.data-table th,
.data-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
.data-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: #f9fafc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table input[type="checkbox"] { vertical-align: middle; }
.data-table tfoot td { font-weight: 700; background: var(--surface-2); }

/* Status colours mirror the dashboard stat-pills, but only for the
   actionable transitions: orange = ordered (sent to bank, waiting),
   green = paid. Unordered rows keep the default surface — red was
   too noisy because most rows start unordered. */
.row-ordered      { background: #fff4e0; }
.row-ordered:hover { background: #fce4bd; }
.row-paid         { background: #e8f5e9; }
.row-paid:hover   { background: #d8edd9; }
.row-unselected   { opacity: .5; }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions a,
.row-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.row-actions a:hover,
.row-actions button:hover { background: var(--surface-2); color: var(--ink-2); }

/* Sortable headers (added by table-enhance.js) */
.data-table th.th-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px;
}
.data-table th.th-sortable:hover { color: var(--ink-2); }
.data-table th.th-sortable::after {
    content: "▴▾";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: var(--muted-2);
    letter-spacing: -1px;
    opacity: .55;
}
.data-table th.th-sortable[data-sort-dir="asc"]::after  { content: "▴"; color: var(--brand); opacity: 1; font-size: 11px; }
.data-table th.th-sortable[data-sort-dir="desc"]::after { content: "▾"; color: var(--brand); opacity: 1; font-size: 11px; }
.data-table th.th-sortable:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(48,93,140,.35); }

/* Table toolbar — search + per-table actions */
.table-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.table-search-wrap {
    position: relative;
    flex: 1 1 240px;
    max-width: 340px;
    display: inline-flex;
    align-items: center;
}
.table-search-wrap::before {
    content: "🔍";
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: .55;
    pointer-events: none;
    filter: grayscale(1);
}
.table-search {
    width: 100%;
    height: 32px;
    padding: 0 28px 0 28px;
    border: 1px solid #ccd2d8;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    font-family: inherit;
}
.table-search:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(48,93,140,.14);
}
.table-search-count {
    font-size: 11.5px;
    color: var(--muted);
    margin-left: 4px;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .table-search-wrap { max-width: none; flex: 1 1 100%; }
}

/* =====================================================================
   Page header (used on non-workspace pages — Companies, Employees, …)
   ===================================================================== */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.page-header h1 { color: var(--ink-2); font-size: 20px; font-weight: 700; }
.page-header h1 .muted { color: var(--muted-2); font-weight: 400; font-size: 13px; margin-left: 4px; }
.muted { color: var(--muted); }

.form-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inline { display: inline; }
.details dt { font-weight: 600; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.details dd { margin-left: 0; }

/* =====================================================================
   Entity forms (Companies, Employees, BankAccounts, Transfers, …)
   Anchored at the left (no auto centering), capped at 880px.
   ===================================================================== */
.entity-form {
    background: #fff;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    max-width: 880px;
    margin: 0;            /* left-anchored, never auto-centered */
}
.entity-form fieldset { border: 0; border-top: 1px solid var(--line); padding: 14px 0 4px; margin-top: 8px; }
.entity-form fieldset:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.entity-form legend {
    font-size: 11.5px; font-weight: 700;
    color: var(--brand);
    padding: 0 6px 8px 0;
    text-transform: uppercase; letter-spacing: .5px;
}
.entity-form .form-row { margin-bottom: 10px; }
.entity-form .form-row input,
.entity-form .form-row select,
.entity-form .form-row textarea {
    padding: 7px 10px;
    border: 1px solid #ccd2d8;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}
.entity-form .form-row label {
    font-weight: 600;
    color: var(--ink-2);
    font-size: 12.5px;
}
.entity-form .form-row.checkbox label { font-weight: 500; color: var(--ink-2); font-size: 13px; }
.entity-form .form-row small { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.entity-form .form-actions {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }

/* Inline panel that toggles open above tables (Create new entity etc.) */
.create-panel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}

/* =====================================================================
   Import-style card grid
   ===================================================================== */
.import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.import-card {
    background: #fff; padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.import-card h3 { color: var(--brand); margin-bottom: 8px; font-size: 15px; }
.import-card form { display: flex; flex-direction: column; gap: 8px; }

/* =====================================================================
   Pager
   ===================================================================== */
.pager {
    display: flex; gap: 4px; flex-wrap: wrap;
    justify-content: center; margin: 14px 0;
}
.pager .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* =====================================================================
   Responsive — phones
   ===================================================================== */
@media (max-width: 960px) {
    :root { --content-pad-x: 16px; --content-pad-y: 16px; }
    .workspace { grid-template-columns: 200px 1fr; }
    .stats-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    :root { --content-pad-x: 12px; --content-pad-y: 12px; }

    /* Topbar collapses to brand + hamburger; nav becomes a drawer */
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .topbar .brand span { display: none; }   /* keep just the logo to save room */
    .topbar .brand { padding-right: 8px; margin-right: 0; border-right: 0; }

    .top-nav {
        position: absolute;
        top: var(--topbar-h);
        left: 0; right: 0;
        background: var(--brand);
        flex-direction: column;
        gap: 0;
        padding: 6px 0;
        box-shadow: 0 6px 14px rgba(0,0,0,.18);
        max-height: 0; overflow: hidden;
        transition: max-height .18s ease;
    }
    .top-nav.open { max-height: 70vh; overflow-y: auto; }
    .top-nav a {
        padding: 12px 18px; border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        font-size: 14px;
    }
    .top-nav a.active { background: rgba(255,255,255,.18); }
    .topbar-user .user-name { display: none; }

    /* Workspace: sidebar becomes a collapsible top strip */
    .workspace { grid-template-columns: 1fr; }
    .side-nav { border-right: 0; border-bottom: 1px solid var(--line); }
    .side-nav ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(46%, 1fr));
    }
    .side-nav a {
        padding: 9px 12px;
        font-size: 12.5px;
        border-bottom: 1px solid var(--line-2);
    }
    .side-nav .nav-sub { display: none; }
    .side-nav-title { padding: 10px 12px; }

    /* Filter bar wraps & stacks */
    .filter-bar { padding: 10px 12px; gap: 6px; }
    .filter-bar select,
    .filter-bar input[type="number"],
    .filter-bar input[type="text"] { min-width: 0; flex: 1 1 46%; }
    .filter-bar .grow { flex: 1 1 100%; }

    /* Page header stacks */
    .page-header { align-items: stretch; }
    .page-header .toolbar { width: 100%; }
    .page-header .toolbar .btn { flex: 1 1 auto; }

    /* Compact buttons on phone */
    .btn { height: 34px; padding: 0 12px; font-size: 13px; }
    .btn-sm { height: 28px; padding: 0 8px; }

    /* Form grid collapses to single column */
    .form-grid-2 { grid-template-columns: 1fr; }
    .entity-form { padding: 14px 14px; max-width: none; }

    /* Tables: keep horizontal scroll, slightly tighter on touch */
    .data-table { font-size: 12.5px; }
    .data-table th, .data-table td { padding: 6px 8px; }
}

@media (max-width: 480px) {
    .topbar { padding: 0 8px; }
    .stat-pill h3 { font-size: 24px; }
    .card .card-value { font-size: 20px; }
    .content-header h1, .page-header h1 { font-size: 17px; }
}

/* Print: hide chrome, full-bleed content */
@media print {
    .topbar, .side-nav, .filter-bar, .toolbar, .pager, .form-actions { display: none !important; }
    .workspace { display: block; }
    .content, .page-pad { padding: 0; }
    .table-wrap { border: 0; box-shadow: none; overflow: visible; }
}
