/* Wienerberger Admin & Customer UI — Modern Shared Styles
   Used by: login, admin dashboards, customer dashboards, detail pages, error handlers.
   Design tokens mirror assets/styles.css for consistency. */

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
    --wb-red:       #dc2626;
    --wb-red-600:   #c81e1e;
    --wb-red-700:   #a61a1a;
    --wb-red-50:    #fef2f2;
    --wb-red-ring:  rgba(220, 38, 38, 0.12);

    --wb-ink:       #0f172a;
    --wb-ink-2:     #334155;
    --wb-ink-3:     #64748b;
    --wb-ink-4:     #94a3b8;
    --wb-border:    #e2e8f0;
    --wb-border-2:  #cbd5e1;
    --wb-surface:   #ffffff;
    --wb-surface-2: #f8fafc;
    --wb-surface-3: #f1f5f9;

    --wb-success:   #16a34a;
    --wb-success-bg:#f0fdf4;
    --wb-warn:      #d97706;
    --wb-warn-bg:   #fffbeb;
    --wb-info:      #0284c7;
    --wb-info-bg:   #f0f9ff;

    --wb-r-sm:      6px;
    --wb-r-md:      10px;
    --wb-r-lg:      14px;
    --wb-r-pill:    999px;

    --wb-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --wb-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --wb-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --wb-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);

    --wb-ease:      cubic-bezier(.4, 0, .2, 1);
    --wb-dur-fast:  120ms;
    --wb-dur:       200ms;

    --wb-input-h:   40px;
}

/* ─── Reset + base ───────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--wb-surface-2);
    color: var(--wb-ink);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Topbar (used by admin + customer) ──────────────────────────── */
.topbar {
    background: var(--wb-surface);
    border-bottom: 1px solid var(--wb-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: var(--wb-shadow-xs);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 17px;
    font-weight: 700;
    color: var(--wb-red);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    gap: 2px;
}

.nav a {
    padding: 8px 14px;
    color: var(--wb-ink-2);
    text-decoration: none;
    border-radius: var(--wb-r-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--wb-dur-fast) var(--wb-ease), color var(--wb-dur-fast) var(--wb-ease);
}

.nav a:hover {
    background: var(--wb-surface-3);
    color: var(--wb-ink);
}

.nav a.active {
    background: var(--wb-red-50);
    color: var(--wb-red);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    font-size: 13px;
    color: var(--wb-ink-3);
    text-align: right;
    line-height: 1.3;
}

.user-info-link {
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--wb-r-sm);
    transition: background var(--wb-dur-fast) var(--wb-ease);
}

.user-info-link:hover {
    background: var(--wb-surface-3);
    text-decoration: none;
}

.user-info strong {
    display: block;
    color: var(--wb-ink);
    font-weight: 600;
    font-size: 13px;
}

.user-info .role {
    font-size: 10px;
    color: var(--wb-red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.logout {
    color: var(--wb-ink-3);
    text-decoration: none;
    font-size: 13px;
    padding: 7px 14px;
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-r-sm);
    font-weight: 500;
    transition: all var(--wb-dur-fast) var(--wb-ease);
    background: var(--wb-surface);
}

.logout:hover {
    color: var(--wb-red);
    border-color: var(--wb-border-2);
    text-decoration: none;
}

/* ─── Page container ─────────────────────────────────────────────── */
.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page h1 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--wb-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.page-subnav {
    color: var(--wb-ink-3);
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 16px;
}

.page-subnav:hover {
    color: var(--wb-red);
    text-decoration: none;
}

/* ─── Card ───────────────────────────────────────────────────────── */
.card {
    background: var(--wb-surface);
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-r-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--wb-shadow-xs);
}

/* Cards that contain action dropdowns need overflow:visible so the
   menu can escape the card box when it's drawn on the last row (the
   menu is position:absolute and gets clipped by the card's rounded-
   corner clip otherwise). :has() is supported in all evergreen browsers. */
.card:has(.action-dropdown) {
    overflow: visible;
}

.card-narrow { max-width: 620px; }
.card-compact { max-width: 520px; }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--wb-border);
    background: var(--wb-surface-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--wb-ink);
    letter-spacing: -0.005em;
    margin: 0;
}

.card-header-count {
    color: var(--wb-ink-3);
    font-size: 13px;
    white-space: nowrap;
}

.card-body { padding: 20px; }

/* ─── Tables ─────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 16px;
    background: var(--wb-surface-2);
    font-size: 11px;
    font-weight: 600;
    color: var(--wb-ink-3);
    border-bottom: 1px solid var(--wb-border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--wb-border);
    font-size: 14px;
    color: var(--wb-ink-2);
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--wb-surface-2); }

.cell-id {
    color: var(--wb-ink-3);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.cell-date {
    color: var(--wb-ink-3);
    font-size: 13px;
    white-space: nowrap;
}

.cell-muted-sub {
    color: var(--wb-ink-3);
    font-size: 12px;
    margin-top: 2px;
}

.cell-actions {
    white-space: nowrap;
    text-align: right;
}

/* ─── Action dropdown (used on tables like Tvrtke) ─────────────────
   A single "Akcije ▾" button reveals a small menu with row actions
   (Save, Delete, etc.). Toggled by admin-common.js via [data-dropdown-toggle].
   The menu is positioned absolutely beneath the toggle; it flows to the
   right edge of the cell so long row content doesn't get covered on the left. */
.action-dropdown {
    position: relative;
    display: inline-block;
}
.action-caret {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.8;
}
.action-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 150px;
    background: var(--wb-surface);
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-r-sm);
    box-shadow: var(--wb-shadow-md);
    z-index: 20;
    padding: 4px 0;
}
.action-dropdown.is-open .action-menu {
    display: block;
}
.action-menu-form {
    margin: 0;
    padding: 0;
    display: block;
}
.action-menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 13px;
    font-family: inherit;
    color: var(--wb-ink);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.action-menu-item:hover,
.action-menu-item:focus {
    background: var(--wb-surface-2);
    outline: none;
}
.action-menu-item--danger {
    color: var(--wb-red);
}
.action-menu-item--danger:hover,
.action-menu-item--danger:focus {
    background: var(--wb-red-50);
}
.action-menu-item--disabled {
    color: var(--wb-ink-3);
    cursor: not-allowed;
    font-style: italic;
}
.action-menu-item--disabled:hover {
    background: transparent;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--wb-red);
    color: var(--wb-surface);
    border: 1px solid transparent;
    border-radius: var(--wb-r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background var(--wb-dur-fast) var(--wb-ease),
                box-shadow var(--wb-dur-fast) var(--wb-ease),
                transform var(--wb-dur-fast) var(--wb-ease);
    min-height: 36px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--wb-shadow-xs);
}

.btn:hover {
    background: var(--wb-red-600);
    text-decoration: none;
    color: var(--wb-surface);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn:active {
    transform: translateY(0);
    background: var(--wb-red-700);
    box-shadow: var(--wb-shadow-xs);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--wb-red-ring), var(--wb-shadow-xs);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 32px;
}

.btn-lg {
    padding: 11px 22px;
    font-size: 15px;
    min-height: 44px;
}

.btn-secondary {
    background: var(--wb-surface);
    color: var(--wb-ink-2);
    border-color: var(--wb-border-2);
}

.btn-secondary:hover {
    background: var(--wb-surface-3);
    color: var(--wb-red);
    border-color: var(--wb-border-2);
}

.btn-secondary:active {
    background: var(--wb-surface-3);
}

.btn-gray {
    background: var(--wb-surface);
    color: var(--wb-ink-3);
    border-color: var(--wb-border);
}

.btn-gray:hover {
    background: var(--wb-surface-3);
    color: var(--wb-ink-2);
    border-color: var(--wb-border-2);
}

.btn-danger {
    background: var(--wb-danger, var(--wb-red));
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-row-spaced {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

/* ─── Forms ──────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--wb-border-2);
    background: var(--wb-surface);
    color: var(--wb-ink);
    border-radius: var(--wb-r-sm);
    font-size: 14px;
    font-family: inherit;
    min-height: var(--wb-input-h);
    transition: border-color var(--wb-dur-fast) var(--wb-ease),
                box-shadow var(--wb-dur-fast) var(--wb-ease);
    box-shadow: var(--wb-shadow-xs);
}

input:hover,
select:hover,
textarea:hover { border-color: var(--wb-ink-4); }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--wb-red);
    box-shadow: 0 0 0 3px var(--wb-red-ring);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--wb-ink-2);
    margin-bottom: 5px;
}

.form-group { margin-bottom: 16px; }

.form-group .hint {
    font-size: 12px;
    color: var(--wb-ink-3);
    margin-top: 4px;
    font-weight: 400;
}

.form-group label .optional {
    color: var(--wb-ink-3);
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    color: var(--wb-ink-2);
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--wb-red);
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-inline-tight {
    display: flex;
    gap: 6px;
    max-width: 360px;
}

.form-row-grow { flex: 1; min-width: 0; }

/* Sold-to party number input on the companies page.
   Narrow fixed-ish width so it reads as a reference number rather than
   a freeform text field. Shown in both the Nova tvrtka form and inline
   in the table row edits. */
.company-stp-input {
    width: 160px;
    max-width: 100%;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* ─── Flash messages / banners ───────────────────────────────────── */
.flash {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--wb-r-sm);
    font-size: 14px;
    border: 1px solid transparent;
    line-height: 1.45;
}

.flash-success {
    background: var(--wb-success-bg);
    color: #166534;
    border-color: #bbf7d0;
}

.flash-error {
    background: var(--wb-red-50);
    color: #991b1b;
    border-color: #fecaca;
}

.flash-info {
    background: var(--wb-info-bg);
    color: #075985;
    border-color: #bae6fd;
}

.flash-warn {
    background: var(--wb-warn-bg);
    color: #92400e;
    border-color: #fde68a;
}

/* ─── Tags / pills ───────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--wb-r-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.tag-admin    { background: #fef2f2; color: var(--wb-red); border: 1px solid #fecaca; }
.tag-customer { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag-active   { background: var(--wb-success-bg); color: #166534; border: 1px solid #bbf7d0; }
.tag-inactive { background: var(--wb-surface-3); color: var(--wb-ink-3); border: 1px solid var(--wb-border); }

/* ─── Empty state ───────────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--wb-ink-3);
    font-size: 14px;
}

.empty svg {
    margin-bottom: 16px;
    opacity: 0.35;
}

.empty p { margin-bottom: 6px; }

/* ─── Login: split layout (image + form) ────────────────────────── */
body.login-split-page {
    background: var(--wb-surface);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
}

.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* Left: hero image rendered as a CSS background so there's no <img>
   to manage fallback for. The background-color below shows if the image
   fails to load. Swap the image by replacing the file on disk. */
.login-split-visual {
    background-color: var(--wb-surface-3);
    background-image: url("/assets/images/login-hero.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100%;
    overflow: hidden;
}

/* Right: form pane */
.login-split-form {
    display: flex;
    flex-direction: column;
    background: var(--wb-surface);
    padding: 48px;
    position: relative;
    min-height: 100vh;
}

.login-split-inner {
    margin: auto 0;
    width: 100%;
    max-width: 380px;
    align-self: center;
}

.login-split-logo {
    height: 44px;
    width: auto;
    margin-bottom: 48px;
    display: block;
}

.login-split-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--wb-ink);
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.login-split-subtitle {
    font-size: 14px;
    color: var(--wb-ink-3);
    margin-bottom: 32px;
}

.login-split-body .form-group {
    margin-bottom: 18px;
}

.login-split-body label {
    font-size: 13px;
    font-weight: 500;
    color: var(--wb-ink-2);
    margin-bottom: 6px;
}

.login-split-body input {
    min-height: 46px;
    font-size: 15px;
}

.login-split-submit {
    width: 100%;
    margin-top: 8px;
    font-size: 15px;
    min-height: 48px;
    padding: 13px;
}

.login-split-footer {
    text-align: left;
    margin-top: 40px;
    font-size: 12px;
    color: var(--wb-ink-4);
}

.login-split-forgot {
    margin-top: 20px;
    font-size: 13px;
    text-align: center;
}

.login-split-forgot a {
    color: var(--wb-ink-3);
    text-decoration: none;
    border-bottom: 1px dotted var(--wb-ink-4);
    padding-bottom: 1px;
    transition: color var(--wb-dur-fast) var(--wb-ease), border-color var(--wb-dur-fast) var(--wb-ease);
}

.login-split-forgot a:hover {
    color: var(--wb-red);
    border-color: var(--wb-red);
    text-decoration: none;
}

/* Password field with reveal toggle */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;  /* leave room for the toggle button */
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--wb-r-sm);
    color: var(--wb-ink-3);
    cursor: pointer;
    transition: color var(--wb-dur-fast) var(--wb-ease),
                background var(--wb-dur-fast) var(--wb-ease);
}

.password-toggle:hover {
    color: var(--wb-ink);
    background: var(--wb-surface-3);
}

.password-toggle:focus-visible {
    outline: none;
    color: var(--wb-ink);
    box-shadow: 0 0 0 2px var(--wb-red-ring);
}

/* Swap eye / eye-off icons based on revealed state */
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-revealed .icon-eye { display: none; }
.password-toggle.is-revealed .icon-eye-off { display: block; }

.login-debug-bar {
    background: var(--wb-warn-bg);
    color: #92400e;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #fde68a;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* Mobile: stack, hide image */
@media (max-width: 900px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-split-visual {
        display: none;
    }

    .login-split-form {
        padding: 32px 24px;
        min-height: 100vh;
    }

    .login-split-logo {
        margin-bottom: 32px;
    }
}

/* ─── Auth-bar (order form when logged in) ───────────────────────── */
.authbar {
    background: var(--wb-surface);
    border-bottom: 1px solid var(--wb-border);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.authbar-left a {
    color: var(--wb-red);
    text-decoration: none;
    font-weight: 600;
}

.authbar-left a:hover { text-decoration: underline; }

.authbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.authbar-user {
    color: var(--wb-ink-3);
}

.authbar-user strong {
    color: var(--wb-ink);
    font-weight: 600;
}

.authbar-user .company {
    color: var(--wb-ink-4);
    margin-left: 8px;
}

/* ─── Detail page ────────────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.detail-grid label {
    color: var(--wb-ink-3);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-grid .value {
    color: var(--wb-ink);
    font-size: 14px;
    font-weight: 500;
}

.item-note {
    background: var(--wb-surface-2);
    color: var(--wb-ink-3);
    font-size: 13px;
    font-style: italic;
    padding: 8px 16px 8px 56px;
}

.file-missing {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--wb-surface-3);
    color: var(--wb-ink-4);
    border-radius: var(--wb-r-sm);
    font-size: 14px;
    border: 1px solid var(--wb-border);
}

.files-missing-note {
    color: var(--wb-ink-3);
    margin-top: 12px;
    font-size: 13px;
}

/* ─── Filter bar (search + select inline) ────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar > select {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
}

.filter-bar > input[type="text"] {
    flex: 1;
    min-width: 160px;
}

.filter-bar .btn {
    flex: 0 0 auto;
}

/* ─── Error page (for set_exception_handler) ─────────────────────── */
.err-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 640px;
    margin: 60px auto;
    padding: 32px;
    background: var(--wb-surface);
    border-radius: var(--wb-r-lg);
    box-shadow: var(--wb-shadow-md);
    border: 1px solid var(--wb-border);
    color: var(--wb-ink);
}

.err-page h1 {
    color: var(--wb-red);
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.err-page p {
    color: var(--wb-ink-2);
    line-height: 1.6;
    margin-bottom: 12px;
}

.err-page code {
    background: var(--wb-surface-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--wb-ink);
}

.err-page pre {
    background: var(--wb-surface-3);
    padding: 16px;
    border-radius: var(--wb-r-sm);
    font-size: 12px;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--wb-ink-2);
    border: 1px solid var(--wb-border);
}

.err-page a {
    color: var(--wb-red);
    text-decoration: none;
    font-weight: 500;
}

.err-page a:hover { text-decoration: underline; }

.err-403 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 500px;
    margin: 80px auto;
    padding: 32px;
    text-align: center;
    background: var(--wb-surface);
    border-radius: var(--wb-r-lg);
    box-shadow: var(--wb-shadow-md);
    border: 1px solid var(--wb-border);
}

.err-403 h1 {
    color: var(--wb-red);
    margin-bottom: 12px;
    font-size: 24px;
}

.err-403 p {
    margin-bottom: 16px;
    color: var(--wb-ink-2);
}

/* ─── Utility helpers ────────────────────────────────────────────── */
.u-muted      { color: var(--wb-ink-3); }
.u-mb-16      { margin-bottom: 16px; }
.u-mb-20      { margin-bottom: 20px; }
.u-mb-24      { margin-bottom: 24px; }
.u-mt-16      { margin-top: 16px; }
.u-mt-20      { margin-top: 20px; }
.u-mt-8       { margin-top: 8px; }
.u-mt-4       { margin-top: 4px; }
.u-nowrap     { white-space: nowrap; }
.u-strong     { font-weight: 600; }
.u-small      { font-size: 12px; }

.dim-disabled { opacity: 0.5; }

/* Regeneration warnings list — compact, scrollable */
.regen-warnings {
    margin-top: 8px;
    padding-left: 20px;
    max-height: 240px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
}
.regen-warnings li { margin-bottom: 2px; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .topbar { padding: 0 14px; }
    .topbar-left { gap: 16px; }
    .nav a { padding: 6px 10px; font-size: 13px; }
    .user-info { display: none; }

    .page { padding: 16px 12px; }

    table { font-size: 13px; }
    th, td { padding: 8px 10px; }

    .detail-grid { grid-template-columns: 1fr; }

    .card-header { flex-direction: column; align-items: stretch; }
}

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