/* =============================================================
   Uredno  -  Global stylesheet
   Light mode is the default. Dark mode toggles via [data-theme="dark"]
   on <html>. Theme is persisted in a cookie called "theme".
   ============================================================= */

:root {
    --ink:           #1d4ed8;
    --ink-hover:     #1e40af;
    --ink-soft:      #eff4ff;
    --bg:            #f7f8fa;
    --surface:       #ffffff;
    --surface-alt:   #fafbfc;
    --border:        #e3e6eb;
    --border-soft:   #eef0f3;
    --text:          #111827;
    --muted:         #6b7280;
    --muted-2:       #9ca3af;
    --red:           #b91c1c;
    --red-bg:        #fef2f2;
    --green:         #047857;
    --green-bg:      #ecfdf5;
    --yellow:        #b45309;
    --yellow-bg:     #fffbeb;
    --shadow-xs:     0 1px 2px rgba(17,24,39,0.04);
    --shadow-sm:     0 1px 3px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.04);
    --shadow:        0 4px 12px rgba(17,24,39,0.06), 0 1px 3px rgba(17,24,39,0.04);
    --shadow-lg:     0 12px 32px rgba(17,24,39,0.08), 0 2px 6px rgba(17,24,39,0.05);
    --radius-sm:     6px;
    --radius:        8px;
    --radius-lg:     12px;
}

[data-theme="dark"] {
    --ink:           #60a5fa;
    --ink-hover:     #93c5fd;
    --ink-soft:      #16223a;
    --bg:            #0b0d11;
    --surface:       #14171c;
    --surface-alt:   #1a1e25;
    --border:        #262b33;
    --border-soft:   #2a2f37;
    --text:          #f1f3f5;
    --muted:         #9aa1ac;
    --muted-2:       #6b7280;
    --red:           #f87171;
    --red-bg:        #2a1414;
    --green:         #34d399;
    --green-bg:      #0e2a1f;
    --yellow:        #fbbf24;
    --yellow-bg:     #2a1f0e;
    --shadow-xs:     0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
    --shadow:        0 4px 12px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg:     0 12px 32px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ------- Typography ------- */
.title-xl { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); }
.title-lg { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2;  color: var(--text); }
.title    { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.muted    { color: var(--muted); }
.muted-2  { color: var(--muted-2); }
.tabular  { font-variant-numeric: tabular-nums; }

.label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
}
.label-soft {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ------- Form fields ------- */
.field { margin-bottom: 16px; }
/* The field() helper wraps inputs in <div class="mt-16"> — override the gap to
   a tighter spacing that suits an 11px uppercase label. */
.field label + div { margin-top: 6px; }
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
textarea,
select {
    width: 100%;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
[data-theme="dark"] .input:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(96,165,250,0.18);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--muted-2); }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}
.check input {
    width: 16px; height: 16px;
    accent-color: var(--ink);
    cursor: pointer;
}

/* ------- Buttons ------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: var(--muted-2); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); box-shadow: none; }

.btn-primary {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, var(--shadow-sm);
}
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: #ffffff; }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }

.btn-secondary { background: var(--surface-alt); }
.btn-secondary:hover { background: var(--bg); }

.btn-danger { color: var(--red); border-color: var(--border); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }

.btn-block { width: 100%; height: 40px; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }

.btn-link {
    background: transparent;
    border: none;
    color: var(--ink);
    padding: 0;
    height: auto;
    font-weight: 500;
    box-shadow: none;
}
.btn-link:hover { background: transparent; text-decoration: underline; box-shadow: none; }

/* ------- Cards / surfaces ------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card-pad { padding: 20px 22px; }
.card-pad-lg { padding: 28px 32px; }

/* Card header bar — replaces the repeated inline padding+border-bottom+font-weight pattern */
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.divider { height: 1px; background: var(--border); }

/* ------- Flash messages ------- */
.flash {
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 3px solid;
    background: var(--surface-alt);
}
.flash-error   { background: var(--red-bg);    border-left-color: var(--red);    color: var(--red); }
.flash-success { background: var(--green-bg);  border-left-color: var(--green);  color: var(--green); }
.flash-warn    { background: var(--yellow-bg); border-left-color: var(--yellow); color: var(--yellow); }

/* ------- Tables ------- */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* Inside a .card the card itself provides the border, shadow, and radius —
   strip them from the table to avoid the double-border artifact. */
.card > .table {
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 100ms ease; }
.table tbody tr:hover td { background: var(--surface-alt); }

/* Utility classes need to win over .table th/.table td baseline alignment.
   Without this, headers stay left-aligned even if you tag them text-right. */
.table th.text-right,
.table td.text-right { text-align: right; }
.table th.text-center,
.table td.text-center { text-align: center; }

/* ------- Status pills ------- */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--muted);
}
.pill-ok    { color: var(--green);  border-color: rgba(4,120,87,0.25);  background: var(--green-bg); }
.pill-warn  { color: var(--yellow); border-color: rgba(180,83,9,0.25);  background: var(--yellow-bg); }
.pill-fail  { color: var(--red);    border-color: rgba(185,28,28,0.25); background: var(--red-bg); }
.pill-ink   { color: var(--ink);    border-color: rgba(29,78,216,0.25); background: var(--ink-soft); }
.pill-mute  { color: var(--muted);  border-color: var(--border);        background: var(--surface-alt); }

/* ------- Shell: topbar -> module bar -> (sidebar | main) ------- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.layout { display: grid; grid-template-columns: 224px 1fr; flex: 1; min-height: 0; }
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; } }

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 14px 0 0 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 100px;
    align-self: start;
    height: calc(100vh - 100px);
    overflow-y: auto;
}
.sidebar-head {
    padding: 6px 18px 10px 18px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-group { padding: 4px 0 12px 0; }
.nav-link {
    display: block;
    margin: 1px 8px;
    padding: 7px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 100ms ease, color 100ms ease;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--ink-soft); color: var(--ink); font-weight: 600; }

.ro-pill {
    margin: 4px 12px 8px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--yellow-bg);
    color: var(--yellow);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.03em;
    border: 1px solid rgba(180,83,9,0.2);
}

.sidebar-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: var(--muted-2); border-top: 1px solid var(--border-soft); }

/* ------- Top chrome bar (brand, breadcrumbs, theme/lang/user) ------- */
.topbar {
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 6;
}
.topbar .left  { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); flex: 1; min-width: 0; }
.topbar .right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar .who   { color: var(--text); font-weight: 600; font-size: 13px; }
.topbar .who-role { color: var(--muted); font-size: 10px; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    padding-right: 16px;
    border-right: 1px solid var(--border-soft);
    height: 36px;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(29,78,216,0.28));
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand:hover .brand-mark { transform: scale(1.04); }
.brand-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
    text-transform: lowercase;
}

/* ------- Icon button (theme toggle, etc.) ------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); border-color: var(--muted-2); text-decoration: none; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { display: block; }

/* ------- User menu (avatar + dropdown via <details>) ------- */
.user-menu {
    position: relative;
}
.user-menu summary {
    list-style: none;
    cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary::marker { display: none; }

.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: background 100ms ease, border-color 100ms ease;
    height: 32px;
}
.user-trigger:hover { background: var(--bg); border-color: var(--muted-2); }
.user-menu[open] .user-trigger { background: var(--bg); border-color: var(--muted-2); }
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-caret { color: var(--muted); transition: transform 120ms ease; flex-shrink: 0; }
.user-menu[open] .user-caret { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 50;
    animation: user-dropdown-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes user-dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user-info {
    padding: 10px 12px 8px 12px;
}
.user-info-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-info-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-info-role {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    background: var(--ink-soft);
    color: var(--ink);
    border: 1px solid rgba(29,78,216,0.2);
}
.user-divider { height: 1px; background: var(--border); margin: 6px -6px; }
.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    transition: background 80ms ease;
}
.user-item:hover { background: var(--bg); text-decoration: none; }
.user-item svg { color: var(--muted); flex-shrink: 0; }

/* Click-outside-to-close: native <details> doesn't auto-close. We add a tiny
   bit of JS-free behavior via a click overlay when [open] using a sibling
   trick. (Optional polish — modern browsers support :focus-within on details
   so user moving focus elsewhere closes it.) */
.user-menu[open] summary::before {
    content: '';
    position: fixed; inset: 0;
    z-index: 49;
}

/* ------- Module bar (top tabs: Fakturisanje | Nabavke | Magacin | …) ------- */
.modulebar {
    height: 44px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: stretch;
    padding: 0 16px;
    gap: 2px;
    position: sticky; top: 56px; z-index: 5;
    overflow-x: auto;
}
.modulebar .mod-link {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 100ms ease, border-color 100ms ease;
    white-space: nowrap;
}
.modulebar .mod-link:hover { color: var(--text); text-decoration: none; }
.modulebar .mod-link.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.main { padding: 24px 28px; min-height: calc(100vh - 56px - 44px); }
.main h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; color: var(--text); }
.main .lede { color: var(--muted); margin-bottom: 22px; font-size: 13px; }

/* ------- Breadcrumbs in topbar (overrides defaults from inline styling) ------- */
.bc { display: flex; align-items: center; font-size: 12px; }
.bc-back {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted); text-decoration: none;
    font-size: 12px; font-weight: 500;
    background: var(--surface);
    margin-right: 14px;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.bc-back:hover { background: var(--bg); color: var(--text); border-color: var(--muted-2); text-decoration: none; }
.bc-link { color: var(--muted); text-decoration: none; }
.bc-link:hover { color: var(--ink); text-decoration: none; }
.bc-current { color: var(--text); font-weight: 600; }
.bc-sep { color: var(--muted-2); margin: 0 7px; opacity: 0.7; }

/* ------- Chip toggle (theme + lang) ------- */
.chip-group {
    display: inline-flex;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.chip {
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    border-right: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 100ms ease, background 100ms ease;
}
.chip:last-child { border-right: none; }
.chip:hover { color: var(--text); text-decoration: none; background: var(--bg); }
.chip.active { background: var(--ink); color: #ffffff; }
.chip.active:hover { background: var(--ink-hover); color: #ffffff; }

/* ------- Stat tile ------- */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
a:has(> .stat):hover .stat,
.stat:hover { border-color: var(--muted-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 6px;
}
.stat .stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .stat-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ------- Grid helpers ------- */
.grid       { display: grid; gap: 14px; }
.grid-2     { grid-template-columns: repeat(2, 1fr); }
.grid-3     { grid-template-columns: repeat(3, 1fr); }
.grid-4     { grid-template-columns: repeat(4, 1fr); }
.grid-5     { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 880px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}
.flex   { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mt-32  { margin-top: 32px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mb-32  { margin-bottom: 32px; }

/* ------- Login (two-column shell) ------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 880px) { .login-shell { grid-template-columns: 1fr; } .login-brand { display: none; } }

.login-brand {
    background: #0f172a;
    color: #ffffff;
    padding: 36px 44px;
    display: flex;
    flex-direction: column;
}
.login-brand .pad-top  { display: flex; align-items: center; gap: 12px; }
.login-brand .pad-mark {
    width: 36px; height: 36px; background: var(--ink);
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; padding: 4px;
}
.login-brand .pad-mark span { background: #ffffff; }
.login-brand .pad-mark span.off { background: transparent; }

.login-brand .word { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.login-brand .word-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.login-brand .hero { margin-top: auto; }
.login-brand .kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #c0c8d4;
    margin-bottom: 16px;
}
.login-brand .tag { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.login-brand .tag-sub { font-size: 13px; color: #9ca3af; margin-top: 14px; max-width: 460px; line-height: 1.55; }

.login-brand .foot {
    margin-top: 36px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6b7280;
}
.login-brand .foot a { color: #9ca3af; text-decoration: none; }
.login-brand .foot a:hover { color: #ffffff; }

.login-form {
    background: var(--surface);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
}
@media (max-width: 600px) { .login-form { padding: 32px 24px; } }

.login-form .top   { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.login-form .wrap  { margin: auto 0; max-width: 360px; width: 100%; }
.login-form .h-eyebrow {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 8px;
}
.login-form h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 6px; }
.login-form .sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.login-form .foot {
    margin-top: auto;
    padding-top: 32px;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

/* ------- Code input (2FA) ------- */
.code-input {
    width: 100%;
    height: 56px;
    text-align: center;
    font-size: 28px;
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
}

/* ------- Diagnostics rows ------- */
.diag {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 14px 18px;
    margin-bottom: 8px;
}
.diag-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.diag-name { font-weight: 600; font-size: 14px; color: var(--text); }
.diag-status { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.diag-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-soft);
    font-size: 12px;
    color: var(--muted);
    white-space: pre-wrap;
}

/* ------- Utility ------- */
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.shrink-0 { flex-shrink: 0; }
.hidden { display: none; }

/* ------- Print ------- */
.print-only { display: none; }

@media print {
    /* White paper, black ink, no chrome */
    html, body { background: #ffffff !important; color: #000000 !important; }
    body { font-size: 11pt; }

    /* Hide app chrome and any controls */
    .sidebar, .topbar, .no-print, button, .btn, form button { display: none !important; }
    .print-only { display: block !important; }

    /* Push the main content to the full page */
    .layout { display: block !important; }
    .layout > div, main, .main { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }

    /* Cards become flat sections, no border-shadow chrome on paper */
    .card, .stat {
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    /* Tables look clean */
    .table { border: 1px solid #cccccc !important; }
    .table th { background: #f5f5f5 !important; color: #333333 !important; }
    .table td, .table th { color: #000000 !important; }

    /* Status pill stays subtle */
    .pill { border: 1px solid #999999 !important; background: #ffffff !important; color: #000000 !important; }

    /* Stat values readable in black ink */
    .stat-value { color: #000000 !important; }
    .stat-label, .label-soft, .muted { color: #555555 !important; }

    /* Page margins */
    @page { margin: 16mm 14mm; }
}
