/* ============================================================
   THEME PALETTES
   Each theme is a full palette — primary, secondary, accent,
   surface and text — not a single accent swap. Applied across
   the topbar, cards, buttons, tables, forms, modals, alerts,
   charts, pagination, dropdowns and badges below.
   ============================================================ */
:root {
    --t-primary: #b8860b;
    --t-primary-rgb: 184, 134, 11;
    --t-primary-dark: #96700a;
    --t-secondary: #7a1128;
    --t-secondary-dark: #59091d;
    --t-accent: #d4af37;
    --t-surface: #fdf6e6;
    --t-surface-strong: #f3e2b8;
    --t-text: #2b1608;
    --t-text-muted: #8a7357;
    --radius: 0.9rem;
}

html[data-theme="pinotage"] {
    --t-primary: #b8860b; --t-primary-rgb: 184, 134, 11; --t-primary-dark: #96700a;
    --t-secondary: #7a1128; --t-secondary-dark: #59091d; --t-accent: #d4af37;
    --t-surface: #fdf6e6; --t-surface-strong: #f3e2b8; --t-text: #2b1608; --t-text-muted: #8a7357;
}
html[data-theme="ocean-blue"] {
    --t-primary: #2563eb; --t-primary-rgb: 37, 99, 235; --t-primary-dark: #1d4ed8;
    --t-secondary: #0891b2; --t-secondary-dark: #0e7490; --t-accent: #38bdf8;
    --t-surface: #eff6ff; --t-surface-strong: #dbeafe; --t-text: #1e293b; --t-text-muted: #64748b;
}
html[data-theme="emerald-green"] {
    --t-primary: #059669; --t-primary-rgb: 5, 150, 105; --t-primary-dark: #047857;
    --t-secondary: #10b981; --t-secondary-dark: #059669; --t-accent: #34d399;
    --t-surface: #ecfdf5; --t-surface-strong: #d1fae5; --t-text: #1f2937; --t-text-muted: #6b7280;
}
html[data-theme="royal-purple"] {
    --t-primary: #7c3aed; --t-primary-rgb: 124, 58, 237; --t-primary-dark: #6d28d9;
    --t-secondary: #db2777; --t-secondary-dark: #be185d; --t-accent: #6366f1;
    --t-surface: #faf5ff; --t-surface-strong: #f3e8ff; --t-text: #2e1a47; --t-text-muted: #7c6f8a;
}
html[data-theme="sunset-amber"] {
    --t-primary: #ea580c; --t-primary-rgb: 234, 88, 12; --t-primary-dark: #c2410c;
    --t-secondary: #d97706; --t-secondary-dark: #b45309; --t-accent: #475569;
    --t-surface: #fff7ed; --t-surface-strong: #ffedd5; --t-text: #431407; --t-text-muted: #78716c;
}
html[data-theme="crimson-rose"] {
    --t-primary: #dc2626; --t-primary-rgb: 220, 38, 38; --t-primary-dark: #b91c1c;
    --t-secondary: #e11d48; --t-secondary-dark: #be123c; --t-accent: #f97316;
    --t-surface: #fef2f2; --t-surface-strong: #ffe4e6; --t-text: #450a0a; --t-text-muted: #78716c;
}
html[data-theme="midnight-slate"] {
    --t-primary: #334155; --t-primary-rgb: 51, 65, 85; --t-primary-dark: #1e293b;
    --t-secondary: #0ea5e9; --t-secondary-dark: #0284c7; --t-accent: #64748b;
    --t-surface: #f1f5f9; --t-surface-strong: #e2e8f0; --t-text: #0f172a; --t-text-muted: #64748b;
}

/* Dark mode: swap surfaces/text for the dark canvas, keep the theme hue for
   primary/secondary/accent so the palette stays recognizable. */
html[data-theme-mode="dark"] {
    --surface-page: #12111a;
    --surface-card: #1c1a2e;
    --surface-border: #2b2843;
    --surface-strong: #23213a;
    --text-body: #e4e4ef;
    --text-muted: #9694ab;
}
html[data-theme-mode="light"], html:not([data-theme-mode]) {
    --surface-page: #f4f5f9;
    --surface-card: #ffffff;
    --surface-border: #e6e7ee;
    --surface-strong: #f8f9fc;
    --text-body: #1e2130;
    --text-muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface-page);
    color: var(--text-body);
    transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--t-primary); }
a:hover { color: var(--t-primary-dark); }

::selection { background: var(--t-primary); color: #fff; }

/* ============ Page loader ============ */
#pageLoader {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--t-primary), var(--t-secondary), var(--t-accent));
    background-size: 200% 100%;
    z-index: 2000;
    width: 0;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.2s ease;
}
#pageLoader.is-active {
    width: 85%;
    opacity: 1;
    animation: loaderShimmer 1.4s linear infinite;
    transition: width 4s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.2s ease;
}
@keyframes loaderShimmer { to { background-position: -200% 0; } }

/* ============ App shell / topbar ============ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(120deg, var(--t-primary), var(--t-secondary));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    border-bottom: 3px solid var(--t-accent);
}

.topbar-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
.topbar-home:hover { background: rgba(255, 255, 255, 0.3); color: #fff; transform: translateY(-1px); }

.topbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
}
.topbar-brand:hover { color: #fff; }
.topbar-brand-logo {
    width: 1.7rem;
    height: 1.7rem;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.topbar-title { font-weight: 600; font-size: 1.05rem; flex: 1 1 auto; }

.topbar-user { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }

.topbar-user .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    transition: background 0.15s ease;
}
.topbar-user .dropdown-toggle:hover,
.topbar-user .dropdown-toggle:focus { background: rgba(255, 255, 255, 0.3); color: #fff; }
.topbar-user .dropdown-toggle::after { display: none; }
.topbar-avatar {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--t-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.app-content {
    padding: 1.5rem;
    flex: 1 1 auto;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    /* fill-mode: backwards (not "both") so the entrance transform doesn't
       linger after the animation ends — a lingering non-"none" transform
       would make this element a containing block for its position:fixed
       descendants (e.g. Bootstrap modals), trapping them inside this box
       instead of the viewport. */
    animation: pageFadeIn 0.35s ease backwards;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-content .breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0.9rem;
    padding: 0.5rem 0.9rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: 0.6rem;
    display: inline-flex;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============ Cards ============ */
.app-card {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
    background: var(--surface-card);
    color: var(--text-body);
    transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.card-title { color: var(--text-body); font-weight: 600; }
.text-muted { color: var(--text-muted) !important; }

.chart-container { position: relative; width: 100%; height: 260px; }
.chart-container.chart-container-sm { height: 220px; }

html[data-card-style="shadow"] .app-card { box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1); border: none; }
html[data-card-style="bordered"] .app-card { border-width: 2px; box-shadow: none; }

.card-fade-in { animation: cardFadeIn 0.45s ease backwards; }
.card-fade-in:nth-child(2) { animation-delay: 0.05s; }
.card-fade-in:nth-child(3) { animation-delay: 0.1s; }
.card-fade-in:nth-child(4) { animation-delay: 0.15s; }
.card-fade-in:nth-child(5) { animation-delay: 0.2s; }
.card-fade-in:nth-child(6) { animation-delay: 0.25s; }
.card-fade-in:nth-child(7) { animation-delay: 0.3s; }
.card-fade-in:nth-child(8) { animation-delay: 0.35s; }
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dashboard nav cards — the primary navigation surface (no sidebar) */
.nav-card { display: block; text-decoration: none; color: inherit; height: 100%; }
.nav-card .app-card {
    height: 100%;
    text-align: center;
    padding: 1.35rem 0.75rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.nav-card:hover .app-card {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(var(--t-primary-rgb), 0.18);
    border-color: var(--t-primary);
}
.nav-card-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.6rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
    box-shadow: 0 6px 16px rgba(var(--t-primary-rgb), 0.35);
    transition: transform 0.18s ease;
}
.nav-card:hover .nav-card-icon { transform: scale(1.08) rotate(-3deg); }
.nav-card-label { font-weight: 600; font-size: 0.92rem; color: var(--text-body); }

/* Stat tiles */
.stat-tile {
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--t-primary), var(--t-secondary));
    box-shadow: 0 10px 24px rgba(var(--t-primary-rgb), 0.25);
    position: relative;
    overflow: hidden;
}
.stat-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent 60%);
}
.stat-tile .stat-label { font-size: 0.8rem; opacity: 0.9; position: relative; z-index: 1; }
.stat-tile .stat-value { font-size: 1.5rem; font-weight: 700; position: relative; z-index: 1; }
.stat-tile.stat-tile-accent { background: linear-gradient(135deg, var(--t-accent), var(--t-secondary)); }

/* ============ Buttons ============ */
.btn { border-radius: 0.6rem; font-weight: 500; transition: all 0.15s ease; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    --bs-btn-bg: var(--t-primary);
    --bs-btn-border-color: var(--t-primary);
    --bs-btn-hover-bg: var(--t-primary-dark);
    --bs-btn-hover-border-color: var(--t-primary-dark);
    --bs-btn-active-bg: var(--t-primary-dark);
    --bs-btn-active-border-color: var(--t-primary-dark);
    box-shadow: 0 2px 8px rgba(var(--t-primary-rgb), 0.3);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(var(--t-primary-rgb), 0.4); transform: translateY(-1px); }

.btn-secondary {
    --bs-btn-bg: var(--t-secondary);
    --bs-btn-border-color: var(--t-secondary);
    --bs-btn-hover-bg: var(--t-secondary-dark);
    --bs-btn-hover-border-color: var(--t-secondary-dark);
}
.btn-outline-primary {
    --bs-btn-color: var(--t-primary);
    --bs-btn-border-color: var(--t-primary);
    --bs-btn-hover-bg: var(--t-primary);
    --bs-btn-hover-border-color: var(--t-primary);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text-muted);
    --bs-btn-border-color: var(--surface-border);
    --bs-btn-hover-bg: var(--surface-strong);
    --bs-btn-hover-color: var(--text-body);
    --bs-btn-hover-border-color: var(--surface-border);
}
.text-primary { color: var(--t-primary) !important; }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem; height: 1rem;
    top: 50%; left: 50%;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}
.btn-outline-primary.btn-loading::after,
.btn-outline-secondary.btn-loading::after,
.btn-link.btn-loading::after { border-color: rgba(var(--t-primary-rgb), 0.35); border-top-color: var(--t-primary); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ============ Badges ============ */
.badge { font-weight: 600; letter-spacing: 0.01em; padding: 0.4em 0.7em; border-radius: 0.5rem; }
.badge.text-bg-soft { background: var(--t-surface); color: var(--t-primary); }
.badge.text-bg-success { background: #16a34a !important; }
.badge.text-bg-danger { background: #dc2626 !important; }
.badge.text-bg-secondary { background: var(--surface-strong) !important; color: var(--text-muted) !important; }

/* ============ Tables ============ */
.table { color: var(--text-body); vertical-align: middle; }
.table thead.table-light,
.table > :not(caption) > * > th {
    background: var(--t-surface);
    color: var(--t-text);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    border-bottom-width: 1px;
}
html[data-theme-mode="dark"] .table thead.table-light,
html[data-theme-mode="dark"] .table > :not(caption) > * > th {
    background: var(--surface-strong);
    color: var(--text-body);
}
.table-hover > tbody > tr:hover > * { background-color: var(--t-surface); }
html[data-theme-mode="dark"] .table-hover > tbody > tr:hover > * { background-color: var(--surface-strong); }
.table > :not(caption) > * > * { border-bottom-color: var(--surface-border); }

/* ============ Forms ============ */
.form-control, .form-select {
    border-radius: 0.6rem;
    border-color: var(--surface-border);
    background-color: var(--surface-card);
    color: var(--text-body);
    padding: 0.55rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--t-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--t-primary-rgb), 0.15);
    background-color: var(--surface-card);
    color: var(--text-body);
}
.form-label { font-weight: 600; font-size: 0.88rem; color: var(--text-body); }
.form-text { color: var(--text-muted); }
.form-check-input:checked { background-color: var(--t-primary); border-color: var(--t-primary); }
.form-check-input:focus { box-shadow: 0 0 0 0.2rem rgba(var(--t-primary-rgb), 0.15); }
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary {
    background: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}

.input-icon-group { position: relative; }
.input-icon-group > i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon-group > .form-control { padding-left: 2.4rem; }
.input-icon-group:has(.toggle-password) > .form-control { padding-right: 2.4rem; }
.input-icon-group > .toggle-password {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0.3rem 0.5rem;
}
.input-icon-group > .toggle-password:hover { color: var(--t-primary); }

/* ============ Modals ============ */
.modal-backdrop {
    --bs-backdrop-opacity: 0.75;
    background-color: #0f172a;
}
.modal-content {
    border-radius: 1rem;
    border: none;
    overflow: hidden;
    background: var(--surface-card);
    color: var(--text-body);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}
.modal-header {
    background: linear-gradient(120deg, var(--t-primary), var(--t-secondary));
    color: #fff;
    border-bottom: none;
    padding: 1.1rem 1.4rem;
}
.modal-header .modal-title { font-weight: 700; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-footer { border-top-color: var(--surface-border); }
.modal.fade .modal-dialog { transition: transform 0.25s ease-out, opacity 0.2s ease; transform: scale(0.96) translateY(10px); opacity: 0; backface-visibility: hidden; }
.modal.show .modal-dialog { transform: none; opacity: 1; }
.ajax-errors { margin-bottom: 1rem; border-radius: 0.6rem; }

/* ============ Alerts ============ */
.alert {
    border: none;
    border-left: 4px solid transparent;
    border-radius: 0.7rem;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}
.alert-success { border-left-color: #16a34a; background: #f0fdf4; color: #166534; }
.alert-danger { border-left-color: #dc2626; background: #fef2f2; color: #991b1b; }
.alert-warning { border-left-color: #d97706; background: #fffbeb; color: #92400e; }
.alert-info { border-left-color: var(--t-primary); background: var(--t-surface); color: var(--t-text); }
html[data-theme-mode="dark"] .alert-success { background: rgba(22,163,74,0.12); color: #4ade80; }
html[data-theme-mode="dark"] .alert-danger { background: rgba(220,38,38,0.12); color: #f87171; }
html[data-theme-mode="dark"] .alert-warning { background: rgba(217,119,6,0.12); color: #fbbf24; }
html[data-theme-mode="dark"] .alert-info { background: rgba(var(--t-primary-rgb),0.12); color: var(--t-accent); }

/* ============ Pagination ============ */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.15rem;
    border-color: var(--surface-border);
    color: var(--text-body);
    background: var(--surface-card);
}
.pagination .page-item.active .page-link {
    background: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}
.pagination .page-link:hover { background: var(--t-surface); color: var(--t-primary); }

/* ============ Dropdowns ============ */
.dropdown-menu {
    border-radius: 0.7rem;
    border-color: var(--surface-border);
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
    padding: 0.4rem;
    background: var(--surface-card);
    animation: dropdownIn 0.15s ease backwards;
}
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item { border-radius: 0.5rem; padding: 0.5rem 0.75rem; color: var(--text-body); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--t-surface); color: var(--t-primary); }
.dropdown-item.text-danger:hover { background: #fef2f2; color: #dc2626 !important; }
.dropdown-divider { border-color: var(--surface-border); }

/* ============ Empty states ============ */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state i { font-size: 2.75rem; color: var(--t-primary); opacity: 0.35; margin-bottom: 0.75rem; display: block; }
.empty-state .empty-state-title { font-weight: 600; color: var(--text-body); margin-bottom: 0.25rem; }

/* ============ Skeleton loaders ============ */
.skeleton {
    background: linear-gradient(90deg, var(--surface-strong) 25%, var(--surface-border) 50%, var(--surface-strong) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.3s ease-in-out infinite;
    border-radius: 0.5rem;
}
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ Tooltips ============ */
.tooltip .tooltip-inner { background: var(--t-text); border-radius: 0.5rem; }

/* ============ Theme: text size / radius / density ============ */
html[data-text-size="small"] .app-content { font-size: 0.875rem; }
html[data-text-size="large"] .app-content { font-size: 1.125rem; }

html[data-radius="none"] { --radius: 0; }
html[data-radius="none"] .app-card, html[data-radius="none"] .btn, html[data-radius="none"] .form-control, html[data-radius="none"] .form-select { border-radius: 0; }
html[data-radius="small"] { --radius: 0.4rem; }
html[data-radius="large"] { --radius: 1.4rem; }

html[data-density="compact"] .app-content { padding: 0.9rem; }
html[data-density="compact"] .card-body { padding: 0.75rem; }
html[data-density="compact"] .table td, html[data-density="compact"] .table th { padding: 0.4rem 0.6rem; }

/* ============================================================
   AUTH PAGES (login / forgot / reset / change password)
   ============================================================ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #0a0806;
}

.auth-visual {
    flex: 1 1 45%;
    background:
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.05) 0 2px, transparent 2px 42px),
        repeating-linear-gradient(-45deg, rgba(212, 175, 55, 0.05) 0 2px, transparent 2px 42px),
        linear-gradient(160deg, #0a0806 0%, #2a0d15 45%, #59091d 78%, #7a1128 100%);
    color: #f5ead0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 3.5rem;
    position: relative;
    overflow: hidden;
    animation: authVisualIn 0.6s ease both;
}
@keyframes authVisualIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.10);
}
.auth-visual::before { width: 22rem; height: 22rem; top: -8rem; right: -6rem; }
.auth-visual::after { width: 16rem; height: 16rem; bottom: -6rem; left: -4rem; background: rgba(212, 175, 55, 0.07); }

.auth-visual-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #d4af37;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
}
.auth-brand-logo {
    width: 2rem;
    height: 2rem;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.5);
}
.auth-hero-image {
    max-width: 320px;
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.25);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    animation: authFeatureIn 0.6s ease both;
    animation-delay: 0.1s;
}
.auth-visual h1 {
    font-family: 'Playfair Display', 'Inter', serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: #f0dfa0;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.auth-visual p { opacity: 0.85; max-width: 26rem; position: relative; z-index: 1; }
.auth-visual-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.85rem; position: relative; z-index: 1; }
.auth-visual-features div {
    display: flex; align-items: center; gap: 0.6rem; opacity: 0;
    animation: authFeatureIn 0.5s ease forwards;
}
.auth-visual-features div:nth-child(1) { animation-delay: 0.15s; }
.auth-visual-features div:nth-child(2) { animation-delay: 0.28s; }
.auth-visual-features div:nth-child(3) { animation-delay: 0.41s; }
.auth-visual-features div:nth-child(4) { animation-delay: 0.54s; }
@keyframes authFeatureIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 0.95; transform: translateY(0); } }
.auth-visual-features i {
    width: 2rem; height: 2rem; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(212, 175, 55, 0.16); color: #d4af37; border-radius: 0.6rem;
}

.auth-form-side {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--t-surface), var(--surface-page) 70%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--surface-card);
    border-radius: 1.1rem;
    border-top: 4px solid var(--t-accent);
    padding: 2.25rem;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.1);
    animation: authCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.1s;
}
@keyframes authCardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--t-primary);
    margin-bottom: 1.5rem;
}

.auth-title { font-family: 'Playfair Display', 'Inter', serif; font-size: 1.7rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text-body); }
.auth-subtitle { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.75rem; }
.auth-links { margin-top: 1.25rem; text-align: center; font-size: 0.9rem; }
.auth-card .form-control { padding-top: 0.7rem; padding-bottom: 0.7rem; padding-left: 2.6rem; }
.auth-card .input-icon-group > i { left: 1rem; }
.auth-card .input-icon-group:has(.toggle-password) > .form-control { padding-right: 2.6rem; }
.auth-card .toggle-password { right: 0.8rem; }
.auth-card .btn-primary {
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    font-size: 0.98rem;
    background: linear-gradient(120deg, var(--t-primary), var(--t-secondary));
    border: none;
}
.auth-card .btn-primary:hover { filter: brightness(1.07); }

@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-mobile-brand { display: flex; }
    .auth-form-side { flex: 1 1 100%; }
}

/* ============ Menu item thumbnails ============ */
.menu-item-thumb { height: 140px; width: 100%; object-fit: cover; }
.menu-item-thumb-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--t-surface), var(--surface-card));
    color: var(--t-primary);
    font-size: 2.2rem;
    opacity: 0.6;
}

/* ============ Misc responsiveness ============ */
@media (max-width: 576px) {
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0.7rem 1rem; }
}
