/* ===========================================================================
   Handelskassa - design system
   ===========================================================================
   The visual language of shadcn/ui (new-york style, zinc palette): the same
   design tokens, the same radii, the same component anatomy.

   Why hand written CSS and not Tailwind here: the back office is server
   rendered PHP. Pulling in a Tailwind build step for the PHP templates would
   mean a node toolchain in the critical path of every page, and the cash
   desk - which IS React and DOES use shadcn/ui proper - imports these same
   custom properties, so the two halves cannot drift apart.

   The tokens below are the contract. A view uses .btn, .card, .table; it
   never writes a colour literal. If a component is missing, add it here
   rather than styling inline, or the next screen will look slightly
   different from this one.
   =========================================================================== */

:root {
    /* shadcn/ui token names and values, in HSL components so a token can be
       used with an alpha channel: hsl(var(--primary) / 0.1) */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --destructive: 0 72.2% 50.6%;
    --destructive-foreground: 0 0% 98%;
    --success: 142 71% 35%;
    --success-foreground: 0 0% 98%;
    --warning: 38 92% 42%;
    --warning-foreground: 0 0% 100%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 240 5% 64.9%;
    --radius: 0.5rem;

    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas,
                 "Liberation Mono", monospace;

    --sidebar-width: 15rem;
    --topbar-height: 3.5rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: 240 10% 3.9%;
        --foreground: 0 0% 98%;
        --card: 240 10% 5.5%;
        --card-foreground: 0 0% 98%;
        --popover: 240 10% 5.5%;
        --popover-foreground: 0 0% 98%;
        --primary: 0 0% 98%;
        --primary-foreground: 240 5.9% 10%;
        --secondary: 240 3.7% 15.9%;
        --secondary-foreground: 0 0% 98%;
        --muted: 240 3.7% 15.9%;
        --muted-foreground: 240 5% 64.9%;
        --accent: 240 3.7% 15.9%;
        --accent-foreground: 0 0% 98%;
        --destructive: 0 62.8% 50%;
        --destructive-foreground: 0 0% 98%;
        --success: 142 65% 45%;
        --warning: 38 92% 50%;
        --border: 240 3.7% 15.9%;
        --input: 240 3.7% 18%;
        --ring: 240 4.9% 45%;
    }
}

:root[data-theme="dark"] {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 5.5%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 5.5%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 50%;
    --destructive-foreground: 0 0% 98%;
    --success: 142 65% 45%;
    --warning: 38 92% 50%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 18%;
    --ring: 240 4.9% 45%;
}

/* --- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light dark;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--foreground));
    background: hsl(var(--background));
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

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

[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* --- Application shell --------------------------------------------------- */

.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "sidebar topbar" "sidebar main";
    min-height: 100vh;
}

.sidebar {
    grid-area: sidebar;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: var(--topbar-height);
    padding: 0 1rem;
    border-bottom: 1px solid hsl(var(--border));
    font-weight: 600;
    flex: none;
}

.sidebar-brand .mark {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.8125rem;
    font-weight: 700;
}

.sidebar-nav { padding: 0.75rem; display: grid; gap: 0.125rem; }

.sidebar-group {
    padding: 0.75rem 0.5rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    border-radius: calc(var(--radius) - 2px);
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    transition: background-color .12s, color .12s;
}

.sidebar-link:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    text-decoration: none;
}

.sidebar-link[aria-current="page"] {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    font-weight: 600;
}

.sidebar-link .count {
    margin-left: auto;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--muted-foreground));
}

.topbar {
    grid-area: topbar;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--background) / 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-spacer { flex: 1; }

.main {
    grid-area: main;
    padding: 1.5rem;
    min-width: 0;
}

.container { max-width: 90rem; margin: 0 auto; }

@media (max-width: 60rem) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas: "topbar" "main";
    }
    .sidebar { display: none; }
    .sidebar.is-open {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-width);
        z-index: 40;
    }
    .main { padding: 1rem; }
}

/* --- Page header --------------------------------------------------------- */

.page-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.page-description {
    margin-top: 0.25rem;
    color: hsl(var(--muted-foreground));
}

.page-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}

.breadcrumb .sep { opacity: 0.5; }

/* --- Card ---------------------------------------------------------------- */

.card {
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 2px 0 hsl(var(--foreground) / 0.04);
}

.card + .card { margin-top: 1rem; }

.card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.card-header .card-actions { margin-left: auto; display: flex; gap: 0.5rem; }

.card-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; }

.card-description {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.card-content { padding: 0.75rem 1.25rem 1.25rem; }
.card-header + .card-content { padding-top: 0.25rem; }

.card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-footer .right { margin-left: auto; display: flex; gap: 0.5rem; }

/* A card whose content is a table: the table draws its own edges. */
.card-table { padding: 0; }
.card-table .table-wrap { border: 0; border-radius: 0; }

/* --- Grid --------------------------------------------------------------- */

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); }

@media (max-width: 75rem) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 48rem) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    height: 2.25rem;
    padding: 0 0.875rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, opacity .12s;
}

.btn:hover { background: hsl(var(--primary) / 0.9); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}
.btn-secondary:hover { background: hsl(var(--secondary) / 0.75); }

.btn-outline {
    background: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.btn-outline:hover { background: hsl(var(--accent)); }

.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }

.btn-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover { background: hsl(var(--destructive) / 0.9); }

.btn-sm { height: 2rem; padding: 0 0.625rem; font-size: 0.8125rem; }
.btn-lg { height: 2.75rem; padding: 0 1.25rem; font-size: 0.9375rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 2rem; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; gap: 0.375rem; flex-wrap: wrap; }

/* --- Forms -------------------------------------------------------------- */

.field { display: grid; gap: 0.375rem; }
.field-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }

.label { font-size: 0.8125rem; font-weight: 500; }
.label .req { color: hsl(var(--destructive)); margin-left: 0.125rem; }

.hint { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }

.input, .select, .textarea {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    transition: border-color .12s, box-shadow .12s;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground)); }

.input:disabled, .select:disabled, .textarea:disabled {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
}

.textarea { height: auto; min-height: 5rem; padding: 0.5rem 0.625rem; resize: vertical; }

.select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

/* Amounts and quantities: right aligned, tabular, monospaced digits so a
   column of prices lines up and a wrong figure is visible at a glance. */
.input-num, .num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.input-error, .input[aria-invalid="true"] {
    border-color: hsl(var(--destructive));
}

.field-error {
    font-size: 0.75rem;
    color: hsl(var(--destructive));
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.1875rem;
    accent-color: hsl(var(--primary));
    flex: none;
}

.input-group { display: flex; }
.input-group .input { border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px); }
.input-group .addon {
    display: inline-flex;
    align-items: center;
    padding: 0 0.625rem;
    border: 1px solid hsl(var(--input));
    border-left: 0;
    border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    white-space: nowrap;
}

fieldset { border: 0; padding: 0; }

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 48rem) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* --- Table -------------------------------------------------------------- */

.table-wrap {
    /* Wide tables scroll inside their own box. The page body never scrolls
       sideways - a horizontal scrollbar on the document is how a column
       disappears without anyone noticing. */
    overflow-x: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

.table thead th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.4);
    border-bottom: 1px solid hsl(var(--border));
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody td { padding: 0.5625rem 0.75rem; border-bottom: 1px solid hsl(var(--border)); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: hsl(var(--muted) / 0.35); }

.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.actions, .table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table td.tight { width: 1%; white-space: nowrap; }

.table tfoot td {
    padding: 0.625rem 0.75rem;
    border-top: 1px solid hsl(var(--border));
    font-weight: 600;
    background: hsl(var(--muted) / 0.3);
}

.table-compact tbody td { padding: 0.375rem 0.5rem; }

.row-link { cursor: pointer; }
.row-muted { color: hsl(var(--muted-foreground)); }
.row-danger { background: hsl(var(--destructive) / 0.06); }
.row-warning { background: hsl(var(--warning) / 0.08); }

/* --- Badges ------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-outline {
    background: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--muted-foreground));
}
.badge-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.badge-success { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.badge-warning { background: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }

/* --- Alerts ------------------------------------------------------------- */

.alert {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    margin-bottom: 1rem;
}

.alert-title { font-weight: 600; margin-bottom: 0.125rem; }
.alert-body { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

.alert-destructive {
    border-color: hsl(var(--destructive) / 0.4);
    background: hsl(var(--destructive) / 0.07);
}
.alert-destructive .alert-title { color: hsl(var(--destructive)); }

.alert-warning {
    border-color: hsl(var(--warning) / 0.4);
    background: hsl(var(--warning) / 0.1);
}

.alert-success {
    border-color: hsl(var(--success) / 0.4);
    background: hsl(var(--success) / 0.08);
}

/* The support access banner. Deliberately loud and not dismissible: a guest
   administrator session that looks like a normal one is not auditable. */
.support-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: hsl(var(--warning));
    color: hsl(var(--warning-foreground));
    font-size: 0.8125rem;
    font-weight: 600;
}

.support-banner form { margin-left: auto; }

/* --- Stat tiles --------------------------------------------------------- */

.kpi {
    padding: 1rem 1.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.kpi-value {
    margin-top: 0.375rem;
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.kpi-meta { margin-top: 0.25rem; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.kpi-up { color: hsl(var(--success)); }
.kpi-down { color: hsl(var(--destructive)); }

/* --- Tabs --------------------------------------------------------------- */

.tabs {
    display: inline-flex;
    gap: 0.125rem;
    padding: 0.1875rem;
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--muted));
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.3125rem 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.tab:hover { color: hsl(var(--foreground)); text-decoration: none; }

.tab[aria-current="page"], .tab.is-active {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
}

/* --- Empty state and pagination ----------------------------------------- */

.empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.empty-title { font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 0.25rem; }

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.pagination .spacer { flex: 1; }

/* --- Filter bar --------------------------------------------------------- */

.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toolbar .grow { flex: 1 1 14rem; min-width: 0; }
.toolbar .right { margin-left: auto; display: flex; gap: 0.5rem; }

/* --- Dialog ------------------------------------------------------------- */

dialog {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    padding: 0;
    max-width: min(40rem, calc(100vw - 2rem));
    width: 100%;
    box-shadow: 0 10px 38px hsl(var(--foreground) / 0.15);
}

dialog::backdrop { background: hsl(0 0% 0% / 0.5); }

.dialog-header { padding: 1.25rem 1.25rem 0.5rem; }
.dialog-body { padding: 0.75rem 1.25rem; }
.dialog-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* --- Misc --------------------------------------------------------------- */

.muted { color: hsl(var(--muted-foreground)); }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.small { font-size: 0.75rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.separator { height: 1px; background: hsl(var(--border)); margin: 1rem 0; border: 0; }
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: 0.5rem; }
.inline { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.right { text-align: right; }
.text-destructive { color: hsl(var(--destructive)); }
.text-success { color: hsl(var(--success)); }
.text-warning { color: hsl(var(--warning)); }

/* A value that is below cost, wherever it appears. One class so the warning
   looks identical at the desk, in a quote and in the price matrix. */
.below-cost {
    color: hsl(var(--destructive));
    font-weight: 600;
}

.margin-bar {
    position: relative;
    height: 0.375rem;
    border-radius: 9999px;
    background: hsl(var(--muted));
    overflow: hidden;
    min-width: 4rem;
}

.margin-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    background: hsl(var(--success));
}

.margin-bar.is-low span { background: hsl(var(--warning)); }
.margin-bar.is-negative span { background: hsl(var(--destructive)); }

.skeleton {
    background: linear-gradient(90deg,
        hsl(var(--muted)) 25%, hsl(var(--muted) / 0.5) 50%, hsl(var(--muted)) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
    border-radius: calc(var(--radius) - 2px);
    height: 1rem;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Sign in ------------------------------------------------------------ */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: hsl(var(--muted) / 0.4);
}

.auth-card { width: 100%; max-width: 24rem; }
.auth-card .card-header { text-align: center; display: block; }
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.0625rem;
}

/* --- Print -------------------------------------------------------------- */

@media print {
    .sidebar, .topbar, .page-actions, .btn, .toolbar, .support-banner { display: none !important; }
    .app { display: block; }
    .main { padding: 0; }
    .card { border: 0; box-shadow: none; }
    body { font-size: 10pt; }
}
