/* ============================================================
   Design tokens
   Deep indigo accent (not Bootstrap's default blue) - reads as
   professional/trustworthy for a finance tool without being
   generic. Inter for UI text; tabular numbers on financial
   figures so amounts line up cleanly in table columns.
   ============================================================ */
:root {
    --ink: #14161c;
    --surface: #ffffff;
    --canvas: #f4f5f8;
    --border: #e3e5ea;
    --border-soft: #edeef2;
    --text: #1e2129;
    --text-muted: #6b7280;

    --accent: #4338ca;
    --accent-dark: #372ea3;
    --accent-soft: #eef0ff;
    --accent-soft-border: #d9dbfb;

    --success: #16a34a;
    --success-soft: #e9f9ef;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --warning: #d97706;
    --warning-soft: #fef3e2;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --table-header-bg: #fafafc;

    /* Now follows the theme like everything else, per explicit feedback -
       previously always dark regardless of light/dark mode. Light-mode
       values here; dark-mode values are set again under
       [data-bs-theme="dark"] below. */
    --sidebar-bg: #0f766e;
    --sidebar-text: #e0f2f1;
    --sidebar-text-muted: #99d8d1;
    --sidebar-border: rgba(255,255,255,0.14);
    --sidebar-hover-bg: rgba(255,255,255,0.1);
    --sidebar-brand-color: #fff;
    /* A brighter teal, not the app's main indigo accent - that clashed
       visibly against the teal sidebar background once it stopped being
       fixed-dark. */
    --sidebar-active-bg: #14b8a6;

    /* Bootstrap 5.3 variable overrides - reskins every existing
       .btn, .card, .form-control, .table, .badge etc. globally,
       no need to touch individual view files. */
    --bs-primary: var(--accent);
    --bs-primary-rgb: 67, 56, 202;
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 67, 56, 202;
    --bs-link-hover-color: var(--accent-dark);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-color: var(--border);
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--canvas);
    --bs-secondary-color: var(--text-muted);
    --bs-success: var(--success);
    --bs-danger: var(--danger);
    --bs-warning: var(--warning);
}

/* Dark theme - overrides the same variable names used everywhere else, so
   every custom .card/.table/.sidebar rule already built on top of them
   adapts automatically. Uses Bootstrap 5.3's own data-bs-theme="dark"
   attribute (not a custom one) so Bootstrap's OWN components - alerts,
   badges, .table-warning rows, etc, used throughout this app - also get
   their proper dark-mode colors from Bootstrap's own built-in dark palette,
   rather than staying stuck with light-mode colors that would look broken
   against a dark background. */
[data-bs-theme="dark"] {
    --ink: #e6e8ec;
    --surface: #1a1d27;
    --canvas: #0e1015;
    --border: #2e3340;
    --border-soft: #262a35;
    --text: #e6e8ec;
    --text-muted: #9aa1b0;

    --accent: #7c6ef0;
    --accent-dark: #9b8ffa;
    --accent-soft: #262a4d;
    --accent-soft-border: #3d3785;

    --success: #22c55e;
    --success-soft: #12331f;
    --danger: #f87171;
    --danger-soft: #3a1418;
    --warning: #fbbf24;
    --warning-soft: #3a2a0a;

    --table-header-bg: #20242f;

    --sidebar-bg: #0a3d38;
    --sidebar-text: #c8e6e2;
    --sidebar-text-muted: #6fa39c;
    --sidebar-border: rgba(255,255,255,0.1);
    --sidebar-hover-bg: rgba(255,255,255,0.08);
    --sidebar-brand-color: #fff;
    --sidebar-active-bg: #14b8a6;
}

/* Light mode's card shadow (a near-black tint at 4% opacity) reads as
   nothing against an already-dark background - dark mode gets its own,
   using a touch of the accent color for a subtle "raised panel" glow
   instead of a shadow that would just disappear. */
[data-bs-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 110, 240, 0.04);
}
[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* Smooth transition on theme switch, rather than an instant jarring flip */
body, .card, .table, .navbar, .sidebar {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body {
    background: var(--canvas);
    color: var(--text);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--ink);
}

/* Financial figures align cleanly when digits are equal-width */
table.table td, table.table th {
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-weight: 550;
    border-radius: var(--radius-sm);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}
.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent-soft-border);
}
.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-link { color: var(--accent); }

/* ============================================================
   Cards - subtle border instead of heavy shadow, refined header
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(20, 22, 28, 0.04);
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
    color: var(--ink);
    padding: 0.9rem 1.1rem;
    border-top-left-radius: var(--radius) !important;
    border-top-right-radius: var(--radius) !important;
}
.card-body { padding: 1.1rem; }
.shadow-sm { box-shadow: 0 1px 3px rgba(20, 22, 28, 0.06) !important; }

/* Bootstrap's .alert-light is deliberately very low-contrast/subtle by
   design in both its light AND dark mode variants - fine for a barely-there
   accent, wrong for instructional body text that needs to stay clearly
   readable (used across several Upload/Import pages for exactly that).
   Overridden here once, centrally, rather than switching every page to a
   different class. */
.alert-light {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* ============================================================
   Dashboard stat cards - icon badges, sparklines, trend badges
   ============================================================ */
.stat-card .card-body { padding-top: 1rem; padding-bottom: 0.85rem; }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
}
.stat-icon-purple  { background: var(--accent-soft); }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Global page-loading bar - fixed at the very top, width grows via JS on
   any navigation/form submit and naturally resets when the new page loads. */
#pageLoadingBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent);
    z-index: 2000;
    opacity: 0;
    transition: width 4s ease-out;
}
.stat-icon-indigo  { background: #e0e3ff; }
.stat-icon-green   { background: var(--success-soft); }
.stat-icon-red     { background: var(--danger-soft); }
.stat-icon-blue    { background: #dbeafe; }
.stat-icon-orange  { background: var(--warning-soft); }

[data-bs-theme="dark"] .stat-icon-indigo { background: #2a2f5c; }
[data-bs-theme="dark"] .stat-icon-blue   { background: #1e3a5f; }

/* Quick Actions - solid gradient buttons with white text. Switched from an
   earlier soft-pastel-tint version per explicit feedback that it didn't
   look good - these also work consistently in both light/dark mode without
   needing separate dark-mode overrides, since a solid saturated background
   with white text stays legible regardless of the page's own theme (unlike
   the pastel tints before, which needed explicit adjustment per theme). */
.quick-action-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(20, 22, 28, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(20, 22, 28, 0.2);
    color: #fff !important;
}
.quick-action-purple { background: linear-gradient(135deg, #818cf8, #4338ca); }
.quick-action-purple:hover { background: linear-gradient(135deg, #818cf8, #4338ca); }
.quick-action-green  { background: linear-gradient(135deg, #4ade80, #15803d); }
.quick-action-green:hover { background: linear-gradient(135deg, #4ade80, #15803d); }
.quick-action-blue   { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.quick-action-blue:hover { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.quick-action-orange { background: linear-gradient(135deg, #fbbf24, #b45309); }
.quick-action-orange:hover { background: linear-gradient(135deg, #fbbf24, #b45309); }
.quick-action-indigo { background: linear-gradient(135deg, #a5b4fc, #4338ca); }
.quick-action-indigo:hover { background: linear-gradient(135deg, #a5b4fc, #4338ca); }
.quick-action-teal   { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.quick-action-teal:hover { background: linear-gradient(135deg, #2dd4bf, #0f766e); }

/* .btn-outline-dark/.btn-dark use a fixed dark color for text/border,
   which reads fine in light mode but is nearly invisible against an
   already-dark page background - flipped to light-appropriate colors here
   rather than switching every filter-pill/button across the app to a
   different Bootstrap variant. */
[data-bs-theme="dark"] .btn-outline-dark {
    color: var(--text);
    border-color: var(--border);
}
[data-bs-theme="dark"] .btn-outline-dark:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--text-muted);
}
[data-bs-theme="dark"] .btn-dark {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
[data-bs-theme="dark"] .btn-dark:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.sparkline {
    width: 100%;
    height: 32px;
    display: block;
    margin-top: 6px;
}

.trend-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}
.trend-badge.trend-up { color: var(--success); }
.trend-badge.trend-down { color: var(--danger); }
.trend-badge .text-muted { font-size: 0.75rem; }

/* ============================================================
   Tables - quiet header, soft row dividers, hover highlight
   ============================================================ */
.table {
    border-color: var(--border-soft);
    margin-bottom: 0;
    /* border-collapse: collapse (Bootstrap's table default) is a
       well-documented reason position: sticky doesn't work reliably on
       <th>/<td> in most browsers - this is what was actually breaking the
       "frozen" table headers below, not the sticky rule itself. Since
       this app only ever uses border-bottom (not all four sides) on
       cells, border-spacing: 0 keeps the visual result essentially
       identical to collapse. */
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
    /* Sticks just below the sticky top bar (see .app-topbar) rather than
       overlapping it - applies to every table in the app through this one
       shared rule, not something set per-page. */
    position: sticky;
    top: 57px;
    z-index: 10;
}
.table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-soft);
}
.table-hover tbody tr:hover {
    background: var(--accent-soft);
}
.table tbody tr:last-child td { border-bottom: none; }

/* Wrap bare tables in a card-like container automatically.
   Deliberately no overflow:hidden here - several pages (Invoices/Create,
   PurchaseOrders/Create, WhatsAppOrder/Review) put an absolutely-positioned
   search-suggestion dropdown inside a table row, and overflow:hidden would
   clip it - most severely for the LAST row, since it has no further table
   content below it to provide clipping buffer, so its dropdown gets cut off
   entirely (this was a real bug, not hypothetical - a row's search box
   simply stopped working once it was the last/only row in the table). */
.table {
    background: var(--surface);
    border-radius: var(--radius);
}

.low-stock-row { background: var(--warning-soft) !important; }

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
    /* Explicit white, not inherited from --bs-body-bg (which is set to the
       gray page canvas color) - without this, every control on every page
       was gray-on-gray against the gray page background. This is the
       default for controls sitting directly on the page (list-page search/
       filter boxes etc.) - POST forms below flip this to gray, since they
       get a white card background and need the opposite contrast. */
    background: #fff;
    border-color: var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.925rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

.list-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.6;
    pointer-events: none;
}
.list-search-input {
    padding-left: 34px;
}

/* Create/Edit forms (Customer, Product, Supplier, Tax, etc.) - centered,
   white-card styling. Targets POST forms specifically (method="post"),
   NOT GET forms with the same col-md-* width class (e.g. Products/Index's
   search box), which should stay as plain inline controls, not become a
   centered card themselves. */
form[method="post"][class*="col-md-"] {
    margin-left: auto;
    margin-right: auto;
    float: none;
    background: var(--surface);
    padding: 24px 28px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(20, 22, 28, 0.06);
}
/* Inside a now-white form card, controls flip to gray for contrast -
   the opposite of the page-level default above. */
form[method="post"][class*="col-md-"] .form-top-actions {
    border-bottom: 1px solid var(--border-soft);
}

form[method="post"][class*="col-md-"] .form-control,
form[method="post"][class*="col-md-"] .form-select {
    background: var(--canvas);
}
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    margin-bottom: 0.35rem;
}
.form-text { color: var(--text-muted); }

/* ============================================================
   Search / type-ahead suggestion dropdowns
   (Invoices/Create, WhatsAppOrder/Review, PurchaseOrders/Create)
   ============================================================ */
.list-group {
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(20, 22, 28, 0.12);
    border: 1px solid var(--border);
}
/* Bootstrap's default list-group-item background reads as an unwanted gray
   fill against this app's card backgrounds - flush lists (Best sellers, Low
   stock products) should look like clean rows with just a divider, not
   filled tiles. */
.list-group-flush .list-group-item {
    background: transparent;
    border-color: var(--border-soft);
}

.list-group-item-action {
    border: none;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
}
.list-group-item-action:last-child { border-bottom: none; }
.list-group-item-action:hover, .list-group-item-action:focus {
    background: var(--accent-soft);
    color: var(--ink);
}

/* ============================================================
   Status badges - refined semantic colors matching the new palette
   ============================================================ */
.badge { font-weight: 600; letter-spacing: 0.01em; padding: 0.4em 0.7em; border-radius: 999px; }
.badge-paid, .bg-success { background: var(--success) !important; }
.badge-partial, .bg-warning { background: var(--warning) !important; }
.badge-overdue { background: var(--danger) !important; }
.badge-issued, .bg-primary { background: var(--accent) !important; }
.badge-draft, .bg-secondary { background: #9497a3 !important; }
.badge-void { background: #495057 !important; }

.alert { border-radius: var(--radius); border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: #0f6b31; border-color: #c8ecd6; }
.alert-danger { background: var(--danger-soft); color: #a11d1d; border-color: #f5c9c9; }
.alert-warning { background: var(--warning-soft); color: #92600a; border-color: #f6ddb1; }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft-border); }
.alert-light { background: #fafafc; border-color: var(--border-soft); color: var(--text); }

/* ============================================================
   Dashboard summary numbers - larger, bolder, tabular
   ============================================================ */
.fs-4 { font-variant-numeric: tabular-nums; }

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

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    font-size: 0.9rem;
    transition: width 0.18s ease;
}

/* Collapsed state - icon-only rail. Icon/text are separate spans (see
   _Layout.cshtml) specifically so this can hide just the text while
   keeping icons visible, rather than hiding entire links. Driven by a
   data-attribute on <html> (not a class on .sidebar directly) so the
   pre-render script in <head> can apply it before the sidebar even
   exists in the DOM yet - same pattern as dark mode, avoids a flash of
   the expanded sidebar on load for a user who left it collapsed. */
[data-sidebar-collapsed="true"] .sidebar {
    width: 64px;
}
[data-sidebar-collapsed="true"] .link-text,
[data-sidebar-collapsed="true"] .sidebar-section-title,
[data-sidebar-collapsed="true"] .sidebar-brand-text {
    display: none;
}
[data-sidebar-collapsed="true"] .sidebar-link {
    text-align: center;
    padding: 8px 0;
}
[data-sidebar-collapsed="true"] .sidebar-brand {
    flex-direction: column;
    gap: 8px;
    padding: 14px 8px;
}
[data-sidebar-collapsed="true"] .sidebar-collapse-btn {
    transform: rotate(180deg);
}

.sidebar-collapse-btn {
    background: transparent;
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.18s ease;
}
.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover-bg);
}

.sidebar-brand {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand a { color: var(--sidebar-brand-color); text-decoration: none; }

.sidebar-section {
    padding: 8px 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-section-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--sidebar-text-muted);
    padding: 2px 10px 4px;
}

.sidebar-business, .sidebar-business-form button.sidebar-business {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.sidebar-business:hover, .sidebar-business-form button.sidebar-business:hover {
    background: var(--sidebar-hover-bg);
}
.sidebar-business.active {
    background: rgba(99, 91, 232, 0.22);
    border: 1px solid rgba(129, 121, 245, 0.4);
    /* Not a fixed white - this tint is semi-transparent, so on a light
       sidebar it stays light overall and white text would have poor
       contrast. Matches whatever the sidebar's base text color is instead. */
    color: var(--sidebar-text);
}
.sidebar-business-logo {
    height: 22px;
    width: 22px;
    object-fit: contain;
    border-radius: 5px;
    background: #fff;
}
.sidebar-business-form { margin: 0; }

.sidebar-add-business {
    display: block;
    padding: 9px 10px;
    color: var(--sidebar-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}
.sidebar-add-business:hover { color: var(--sidebar-text); }

.sidebar-link {
    display: block;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1px;
    transition: background 0.12s ease;
}
.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text);
}
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    /* Deliberately still a fixed white, unlike the variables used above -
       this sits on a fully opaque accent-colored background (not a
       transparent tint), so white text stays safely high-contrast
       regardless of theme. */
    color: #fff;
    font-weight: 600;
}
.sidebar-link.active:hover {
    background: var(--sidebar-active-bg);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
}

.app-content {
    flex-grow: 1;
    min-width: 0;
    background: var(--canvas);
}

.app-topbar {
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.quick-search-input {
    /* Explicit white, not the theme's default form-control background,
       which reads as light gray - requested specifically. */
    background: #fff !important;
    color: #1a1d27 !important;
    padding-right: 55px;
}
.quick-search-kbd {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.68rem;
    padding: 1px 5px;
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 5;
}
.quick-search-input:focus + .quick-search-kbd { display: none; }
.quick-search-btn {
    background: #fff;
    border-color: var(--border);
    color: var(--text-muted);
}
.quick-search-btn:hover {
    background: var(--canvas);
    color: var(--text);
}

.quick-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(20, 22, 28, 0.15);
    max-height: 360px;
    overflow-y: auto;
    z-index: 200;
}
.quick-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
}
.quick-search-item:last-child { border-bottom: none; }
.quick-search-item:hover { background: var(--canvas); }
.quick-search-icon { font-size: 1rem; }
.quick-search-label { display: block; font-size: 0.88rem; font-weight: 600; }
.quick-search-sublabel { display: block; font-size: 0.76rem; color: var(--text-muted); }
.quick-search-type {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
}
.quick-search-empty {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1050;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

@media (max-width: 991.98px) {
    .sidebar-toggle { display: block; }
    .sidebar {
        position: fixed;
        left: -270px;
        z-index: 1040;
        transition: left 0.2s ease;
    }
    .app-shell.sidebar-open .sidebar {
        left: 0;
    }
}

.sidebar-user {
    font-size: 0.82rem;
    color: var(--sidebar-text-muted);
    border-top: 1px solid var(--sidebar-border);
    padding-top: 10px;
    margin-top: 10px;
}

/* Print support - applies globally to any list/report page, not set up
   per-page. Hides the sidebar/top bar/buttons/forms/pagination so what
   prints is just the page title and table content, not the app chrome
   around it. A page opts in simply by having a print button that calls
   printCurrentPage() (see _Layout.cshtml) - no other setup needed. */
@media print {
    .sidebar, .sidebar-toggle, .app-topbar, .btn, .pagination, form:not(.printable-form),
    .list-search-icon, .dropdown, .modal, #uploadProgress, .alert .btn-close, #pageLoadingBar {
        display: none !important;
    }
    .app-content { margin: 0 !important; }
    .table { font-size: 11px; }
    .table thead th { position: static !important; } /* sticky positioning has no meaning on paper */
    a { color: inherit !important; text-decoration: none !important; }
    body { background: #fff !important; }
}
