﻿/* Font loaded via <link> in head.php for non-blocking rendering */

/* ===========================
   DESIGN TOKENS
   =========================== */
:root {
    --bg: #f5f1ea;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #fffdf8;
    --surface-ink: #1a2332;
    --text: #1a2332;
    --muted: #556070;
    --line: rgba(100, 80, 50, 0.12);
    --line-strong: rgba(100, 80, 50, 0.22);
    --primary: #0d9488;
    --primary-strong: #0f766e;
    --primary-deep: #115e59;
    --accent: #d97706;
    --accent-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.08);
    --shadow-xl: 0 32px 72px rgba(30, 20, 8, 0.18);
    --shadow-lg: 0 20px 50px rgba(30, 20, 8, 0.12);
    --shadow-md: 0 12px 32px rgba(30, 20, 8, 0.08);
    --shadow-sm: 0 4px 16px rgba(30, 20, 8, 0.06);
    --radius-2xl: 32px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --nav-height: 64px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================
   RESET
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

/* Sembunyikan <style> yang muncul di dalam <body> (mobile webkit quirk) */
body style { display: none !important; }

/* Touch: hapus delay 300ms pada mobile */
a, button, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background:
        radial-gradient(ellipse at 10% 0%, rgba(13, 148, 136, 0.09), transparent 40%),
        radial-gradient(ellipse at 90% 0%, rgba(217, 119, 6, 0.08), transparent 35%),
        linear-gradient(175deg, #faf7f0, #f0ebe2 50%, #eae4d9);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
textarea { min-height: 110px; resize: vertical; }

.container {
    width: min(1600px, calc(100% - 2rem));
    margin-inline: auto;
}

/* ===========================
   TOP NAVBAR (lives inside hero)
   =========================== */
.topnav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-left: 0.4rem;
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.topnav-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.16);
    font-size: 1rem;
}

.topnav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topnav-link {
    padding: 0.48rem 0.78rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.93);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s var(--ease), color 0.15s;
}

.topnav-link:hover,
.topnav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.topnav-link.logout-link {
    background: rgba(255, 90, 90, 0.12);
    color: rgba(255, 200, 200, 0.88);
}

.topnav-link.logout-link:hover {
    background: rgba(255, 90, 90, 0.26);
    color: #fff;
}

/* Topnav dropdown */
.topnav-dropdown {
    position: relative;
}

.topnav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.topnav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 180px;
    padding: 0.35rem 0;
    margin-top: 0.25rem;
    background: var(--surface, #fff);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.topnav-dropdown:hover .topnav-dropdown-menu,
.topnav-dropdown:focus-within .topnav-dropdown-menu {
    display: block;
}

.topnav-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--surface-ink, #1e293b);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s;
}

.topnav-dropdown-item:hover,
.topnav-dropdown-item.active {
    background: rgba(13, 148, 136, 0.08);
    color: var(--accent, #0d9488);
}

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s var(--ease);
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.24);
}

.hamburger-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}

.hamburger-bar::before,
.hamburger-bar::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: absolute;
    left: 0;
}

.hamburger-bar::before { top: -6px; }
.hamburger-bar::after  { top: 6px; }

/* ===========================
   MOBILE DRAWER (right side)
   =========================== */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    width: min(320px, 88vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(105%);
    transition: transform 0.32s var(--ease-spring);
    will-change: transform;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer.open {
    transform: translateX(0);
}

/* Header with gradient banner */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 1rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #166534 0%, #16a34a 60%, #15803d 100%);
    position: relative;
    overflow: hidden;
}

.drawer-header::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -8%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}

.drawer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.drawer-brand strong {
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: #fff;
    font-weight: 800;
}

.drawer-brand small {
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
}

.drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    transition: background 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.drawer-close:hover {
    background: rgba(255,255,255,0.28);
}

.drawer-nav {
    flex: 1;
    padding: 0.75rem 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.drawer-link {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text, #1e293b);
    font-weight: 600;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    text-decoration: none;
}

.drawer-link:hover {
    background: rgba(13, 148, 136, 0.07);
    border-left-color: rgba(13, 148, 136, 0.4);
    color: var(--primary-deep, #0f766e);
}

.drawer-link.active {
    background: rgba(13, 148, 136, 0.1);
    border-left-color: var(--primary, #0d9488);
    color: var(--primary-deep, #0f766e);
}

.drawer-link small {
    color: var(--muted, #64748b);
    font-size: 0.7rem;
    font-weight: 400;
}

.drawer-link.active small {
    color: var(--primary, #0d9488);
    opacity: 0.75;
}

/* Group section */
.drawer-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.85rem 0.3rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #94a3b8);
}

.drawer-group-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line, #e5e7eb);
}

/* Nested items */
.drawer-link-nested {
    padding-left: 1.4rem;
    font-size: 0.86rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin-left: 0.4rem;
}

.drawer-link-nested:hover {
    border-left-color: rgba(13, 148, 136, 0.35);
}

.drawer-link-nested.active {
    border-left-color: var(--primary, #0d9488);
    background: rgba(13, 148, 136, 0.08);
    color: var(--primary-deep, #0f766e);
}

/* Logout */
.drawer-link.logout {
    margin-top: 0.5rem;
    color: var(--danger, #dc2626);
    font-weight: 700;
    border-top: 1px solid var(--line, #e5e7eb);
    border-radius: 0;
    border-left: 3px solid transparent;
    padding-top: 0.9rem;
}

.drawer-link.logout:hover {
    background: rgba(220, 38, 38, 0.06);
    border-left-color: var(--danger, #dc2626);
    color: #b91c1c;
}

.drawer-footer {
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--line, #e5e7eb);
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted, #94a3b8);
    flex-shrink: 0;
    background: #fafaf9;
}

/* ===========================
   Legacy sidebar/overlay/menu-toggle — disabled
   =========================== */
.sidebar, .overlay, .menu-toggle {
    display: none !important;
}

/* ===========================
   HERO / PAGE HEADER
   =========================== */
.hero,
header:not(.login-page header) {
    position: relative;
    margin: 0;
    padding: 1.35rem 0 2.75rem;
    color: #fff;
}

.hero::before,
header:not(.login-page header)::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(148deg,
            rgba(15, 118, 110, 0.97) 0%,
            rgba(13, 148, 136, 0.93) 38%,
            rgba(170, 115, 38, 0.82) 100%);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

.hero::after,
header:not(.login-page header)::after {
    content: '';
    position: absolute;
    top: -35%;
    right: -18%;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.hero > *,
header:not(.login-page header) > * {
    position: relative;
    z-index: 2;
}

.hero-topbar {
    margin-bottom: 1.5rem;
}

.hero-content,
.page-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.hero-copy,
.hero-text,
.page-title > div:first-child {
    max-width: 680px;
}

.hero h1,
.hero-text h1,
.page-title h1 {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(1.7rem, 5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #fff;
}

.meta,
.hero-text .meta,
.page-title p {
    margin-top: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-kicker {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.9);
}

.eyebrow {
    background: var(--accent-soft);
    border: 1px solid rgba(217, 119, 6, 0.12);
    color: var(--accent);
}

.hero-actions,
.button-group,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

/* ===========================
   BUTTONS
   =========================== */
.btn,
.btn-login,
.btn-custom,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.72rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s;
}

.btn:hover, .btn-login:hover, .btn-custom:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0) scale(0.97);
}

.btn-primary,
.btn-login,
.btn-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: #fff;
    box-shadow: 0 10px 28px rgba(13, 148, 136, 0.22);
}

.btn-primary:hover, .btn-login:hover, .btn-custom:hover {
    box-shadow: 0 14px 36px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.32);
    color: var(--surface-ink);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.9); }

.btn-light {
    background: #fff;
    color: var(--primary-deep);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.btn-outline-primary {
    color: var(--primary-strong);
    border-color: rgba(13, 148, 136, 0.55);
    background: rgba(255, 255, 255, 0.55);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-outline-primary:hover {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--primary-strong);
    color: var(--primary-deep);
    cursor: pointer;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.16);
    background: rgba(255, 255, 255, 0.55);
}

.btn-outline-danger:hover { background: var(--danger-soft); }

.btn-outline-success {
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.16);
    background: rgba(255, 255, 255, 0.55);
}

.btn-link {
    border: none;
    background: transparent;
    color: var(--primary-strong);
    padding-inline: 0;
    min-height: auto;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    min-height: 52px;
    padding: 0.85rem 1.4rem;
    font-size: 0.92rem;
}

/* ===========================
   LAYOUT
   =========================== */
.page-body,
main.container,
.page-wrapper,
.container.mt-4.mb-5 {
    position: relative;
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
}

.page-body { margin-top: -0.75rem; contain: layout style; }

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
    gap: 1.15rem;
}

/* ===========================
   CARD / SURFACE
   =========================== */
.card,
.section-card,
.auth-container,
.modal-content,
.docx-preview,
.quick-card,
.stat,
.table-wrap {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-sm);
}

.card, .auth-container, .modal-content, .docx-preview, .table-wrap {
    border-radius: var(--radius-xl);
}

.card {
    padding: 1.35rem;
}

.panel, .section-card { border-radius: var(--radius-lg); }

.section-card {
    padding: 1.25rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow-sm);
}

.card-header,
.header-gradient {
    margin: -1.35rem -1.35rem 1.15rem;
    padding: 1.15rem 1.35rem;
    border: none;
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(160, 105, 33, 0.86));
}

.card-header h4,
.header-gradient h4 {
    color: #fff;
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

/* ===========================
   TABLE
   =========================== */
.table-wrap, .table-responsive {
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: var(--text);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.82rem 0.95rem;
    background: rgba(225, 238, 236, 0.95);
    color: #2e4050;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 0.82rem 0.95rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(100, 80, 50, 0.07);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: rgba(255, 248, 237, 0.5);
}

/* ===========================
   FORM
   =========================== */
label, .form-label {
    display: inline-block;
    margin-bottom: 0.38rem;
    color: #2c3d50;
    font-size: 0.88rem;
    font-weight: 700;
}

input, select, textarea, .form-control {
    width: 100%;
    border-radius: var(--radius-md) !important;
    border: 1px solid rgba(100, 80, 50, 0.18);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    padding: 0.76rem 0.9rem;
    font-size: 0.92rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: rgba(13, 148, 136, 0.42);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.09);
    background: #fff;
    outline: none;
}

input[readonly], textarea[readonly] {
    background: rgba(241, 237, 230, 0.82);
    color: var(--muted);
}

.form-text, .text-muted, .text-small, small {
    color: var(--muted) !important;
    font-size: 0.8rem;
}

/* ===========================
   ALERTS
   =========================== */
.alert {
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.86rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-soft);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.1);
}

.alert-danger, .alert-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.1);
}

/* ===========================
   STATS
   =========================== */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    margin-top: 1rem;
}

.stat {
    padding: 0.85rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat strong {
    display: block;
    font-family: 'Fraunces', serif;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--primary-deep);
}

.stat small { display: block; margin-top: 0.25rem; }

/* ===========================
   QUICK LINKS
   =========================== */
.quick-links { display: grid; gap: 0.55rem; }

.quick-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}

.quick-card:hover {
    border-color: rgba(13, 148, 136, 0.16);
    background: rgba(255, 255, 255, 0.82);
    transform: translateY(-1px);
}

.quick-card strong { font-size: 0.9rem; }
.quick-card span { font-size: 0.8rem; color: var(--muted); }

/* ===========================
   FEATURE GRID
   =========================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

.feature-card {
    padding: 0.85rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 248, 0.5);
    border: 1px solid var(--line);
}

.feature-card strong { display: block; margin-bottom: 0.25rem; font-size: 0.86rem; }

/* ===========================
   STATUS BADGE
   =========================== */
.status-badge, .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-weight: 700;
}

/* ===========================
   PAGE WRAPPER (processing)
   =========================== */
.page-wrapper {
    min-height: calc(100vh - 100px);
    min-height: calc(100dvh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.page-wrapper .card { width: min(680px, 100%); }

.processing-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.processing-card::before {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -15%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.1), transparent 70%);
    pointer-events: none;
}

/* ===========================
   DOCX PREVIEW
   =========================== */
.docx-preview {
    padding: 1.15rem;
    overflow: auto;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    -webkit-overflow-scrolling: touch;
}

/* ===========================
   LOGIN / AUTH
   =========================== */
.login-page {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    background: #fff;
}

.login-page .topnav,
.login-page .hamburger,
.auth-page .topnav,
.auth-page .hamburger {
    display: none !important;
}

/* Split Layout */
.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---- Brand Panel (left) ---- */
.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    background:
        radial-gradient(ellipse at 10% 90%, rgba(217, 119, 6, 0.18), transparent 55%),
        radial-gradient(ellipse at 90% 10%, rgba(13, 148, 136, 0.22), transparent 55%),
        linear-gradient(145deg, #0f3d38 0%, #0d5c55 45%, #1a6b5a 100%);
    color: #fff;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    flex: 1;
    justify-content: center;
    padding-block: 2rem;
}

.login-brand-logo {
    width: 88px;
    height: 88px;
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
}

.login-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.login-brand-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.6rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.login-brand-sub {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-brand-divider {
    width: 48px;
    height: 3px;
    background: rgba(255,255,255,0.35);
    border-radius: 99px;
    margin-bottom: 1.5rem;
}

.login-brand-desc {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.7;
    max-width: 340px;
    margin-bottom: 2.5rem;
}

.login-brand-dots {
    display: flex;
    gap: 0.5rem;
}

.login-brand-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
}

.login-brand-dots span:first-child {
    background: rgba(255,255,255,0.75);
    width: 22px;
    border-radius: 4px;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.4);
}

/* ---- Form Panel (right) ---- */
.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fafaf9;
}

.login-form-inner {
    width: min(400px, 100%);
    display: flex;
    flex-direction: column;
}

.login-form-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-form-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--surface-ink);
    margin-bottom: 0.4rem;
}

.login-form-sub {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.55;
}

/* Alerts */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.login-alert svg { flex-shrink: 0; margin-top: 1px; }

.login-alert-error {
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.login-alert-success {
    background: rgba(13, 148, 136, 0.07);
    color: #0f766e;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

/* Form fields */
.login-form .lf-group {
    margin-bottom: 1.1rem;
}

.login-form .lf-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--surface-ink);
    margin-bottom: 0.4rem;
}

.login-form .lf-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1.5px solid rgba(100, 80, 50, 0.13);
    border-radius: var(--radius-md);
    padding: 0 0.5rem 0 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form .lf-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.login-form .lf-icon {
    color: var(--muted);
    opacity: 0.5;
    flex-shrink: 0;
}

.login-form .lf-input-wrap input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.65rem 0;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--surface-ink);
}

.login-form .lf-input-wrap input:focus {
    outline: none;
    box-shadow: none !important;
}

.login-form .lf-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    flex-shrink: 0;
}

.login-form .lf-eye:hover { background: rgba(0,0,0,0.05); }

/* Submit button */
.login-form .lf-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.login-form .lf-submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.login-form .lf-submit:active {
    transform: translateY(0);
}

.login-form-copy {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.76rem;
    color: var(--muted);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2.5rem 1.75rem 2rem;
        min-height: auto;
    }

    .login-brand-inner {
        padding-block: 0;
        gap: 0;
    }

    .login-brand-logo {
        width: 64px;
        height: 64px;
        border-radius: 14px;
        margin-bottom: 1.25rem;
    }

    .login-brand-title { font-size: 2.2rem; }

    .login-brand-desc { display: none; }
    .login-brand-dots { display: none; }

    .login-form-panel {
        padding: 2rem 1.25rem 2.5rem;
    }
}

/* Legacy auth-container kept for other auth pages */
.auth-container {
    width: min(420px, 100%);
    padding: 2rem 1.85rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    box-shadow:
        0 24px 60px rgba(30, 20, 8, 0.1),
        0 2px 8px rgba(30, 20, 8, 0.04);
}

.spinner-border {
    width: 3.25rem;
    height: 3.25rem;
    border-width: 0.28rem;
    color: var(--primary);
}

/* ===========================
   MODAL
   =========================== */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-xl);
}

/* hero-mini: just topnav, no hero content */
.hero-mini {
    padding-bottom: 1rem !important;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero animations */
.hero-kicker, .eyebrow {
    animation: fadeInUp 0.5s var(--ease) both;
}

.hero h1, .hero-text h1, .page-title h1 {
    animation: fadeInUp 0.55s var(--ease) 0.08s both;
}

.meta, .hero-text .meta, .page-title p {
    animation: fadeInUp 0.5s var(--ease) 0.16s both;
}

.hero-actions, .button-group, .inline-actions {
    animation: fadeInUp 0.5s var(--ease) 0.22s both;
}

/* Page content animations */
.page-body,
main.container,
.page-wrapper {
    animation: fadeIn 0.4s var(--ease) both;
}

.card,
.section-card,
.table-wrap,
.docx-preview {
    animation: fadeInUp 0.45s var(--ease) both;
}

/* Stagger cards in grids */
.feature-grid > *:nth-child(1) { animation: fadeInUp 0.4s var(--ease) 0.05s both; }
.feature-grid > *:nth-child(2) { animation: fadeInUp 0.4s var(--ease) 0.12s both; }
.feature-grid > *:nth-child(3) { animation: fadeInUp 0.4s var(--ease) 0.19s both; }
.feature-grid > *:nth-child(4) { animation: fadeInUp 0.4s var(--ease) 0.26s both; }
.feature-grid > *:nth-child(5) { animation: fadeInUp 0.4s var(--ease) 0.33s both; }
.feature-grid > *:nth-child(6) { animation: fadeInUp 0.4s var(--ease) 0.40s both; }

.stats > *:nth-child(1) { animation: fadeInUp 0.4s var(--ease) 0.05s both; }
.stats > *:nth-child(2) { animation: fadeInUp 0.4s var(--ease) 0.12s both; }
.stats > *:nth-child(3) { animation: fadeInUp 0.4s var(--ease) 0.19s both; }

.quick-links > *:nth-child(1) { animation: fadeInUp 0.4s var(--ease) 0.04s both; }
.quick-links > *:nth-child(2) { animation: fadeInUp 0.4s var(--ease) 0.10s both; }
.quick-links > *:nth-child(3) { animation: fadeInUp 0.4s var(--ease) 0.16s both; }
.quick-links > *:nth-child(4) { animation: fadeInUp 0.4s var(--ease) 0.22s both; }

/* Auth / Login */
.auth-container {
    animation: scaleIn 0.5s var(--ease-spring) both;
}

/* Alerts */
.alert {
    animation: slideDown 0.35s var(--ease) both;
}

/* Table rows stagger */
.table tbody tr {
    animation: fadeIn 0.3s var(--ease) both;
}
.table tbody tr:nth-child(1)  { animation-delay: 0.03s; }
.table tbody tr:nth-child(2)  { animation-delay: 0.06s; }
.table tbody tr:nth-child(3)  { animation-delay: 0.09s; }
.table tbody tr:nth-child(4)  { animation-delay: 0.12s; }
.table tbody tr:nth-child(5)  { animation-delay: 0.15s; }
.table tbody tr:nth-child(6)  { animation-delay: 0.18s; }
.table tbody tr:nth-child(7)  { animation-delay: 0.21s; }
.table tbody tr:nth-child(8)  { animation-delay: 0.24s; }
.table tbody tr:nth-child(9)  { animation-delay: 0.27s; }
.table tbody tr:nth-child(10) { animation-delay: 0.30s; }

/* Card/surface hover lift */
.card:hover,
.section-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card,
.section-card {
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.feature-card {
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: rgba(13, 148, 136, 0.18);
}

/* Stat number counter feel */
.stat strong {
    transition: transform 0.2s var(--ease-spring);
}
.stat:hover strong {
    transform: scale(1.08);
}

/* Form focus glow */
.form-group,
.auth-page .form-group {
    animation: fadeInUp 0.35s var(--ease) both;
}

/* Smooth badge pulse on appear */
.status-badge, .pill {
    animation: scaleIn 0.3s var(--ease-spring) both;
}

/* Modal backdrop */
.modal-content {
    animation: scaleIn 0.3s var(--ease-spring) both;
}

/* Spinner pulse */
.spinner-border {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ===========================
   MISC
   =========================== */
.app-shell { display: grid; gap: 1.15rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
hr { border: none; border-top: 1px solid var(--line); margin: 0.45rem 0; }

/* ===========================
   RESPONSIVE: TABLET
   =========================== */
@media (max-width: 992px) {
    .topnav-links { display: none; }
    .hamburger { display: inline-flex; }

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

    .feature-grid, .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================
   RESPONSIVE: MOBILE
   =========================== */
@media (max-width: 640px) {
    body { font-size: 15px; }

    .container { width: calc(100% - 1rem); }

    /* Hero */
    .hero, header:not(.login-page header) {
        padding: 0.75rem 0 1.5rem;
    }
    .hero::before, header:not(.login-page header)::before {
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }
    .topnav {
        padding: 0.4rem 0.45rem;
        margin-bottom: 0.85rem;
        border-radius: var(--radius-sm);
    }
    .topnav-brand { font-size: 0.82rem; padding-left: 0.15rem; }
    .topnav-brand-icon { width: 30px; height: 30px; font-size: 0.85rem; }

    /* Hero text */
    .hero h1, .hero-text h1, .page-title h1 {
        font-size: 1.45rem;
        line-height: 1.25;
    }
    .meta, .hero-text .meta, .page-title p {
        font-size: 0.85rem;
        line-height: 1.55;
    }
    .hero-kicker, .eyebrow {
        font-size: 0.65rem;
    }

    /* Page title (inner pages with back button) */
    .page-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .page-title .btn {
        align-self: flex-start;
        width: auto;
    }

    /* Cards */
    .card {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }
    .auth-container {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-lg);
    }
    .card-header, .header-gradient {
        margin: -1rem -1rem 0.85rem;
        padding: 0.9rem 1rem;
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
    }
    .section-card { padding: 0.85rem; }

    /* Layouts */
    .grid-2 { grid-template-columns: 1fr; gap: 0.75rem; }
    .stats, .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }

    /* Hero actions */
    .hero-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-actions,
    .button-group,
    .actions-row,
    .inline-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* Buttons — only full-width inside hero/actions, not everywhere */
    .hero-actions .btn,
    .hero-actions .btn-login,
    .hero-actions .btn-custom,
    .button-group .btn,
    .inline-actions .btn,
    .auth-page .btn-login {
        width: 100%;
        justify-content: center;
    }

    /* Table */
    .table-wrap {
        border-radius: var(--radius-md);
    }
    .table thead th {
        padding: 0.6rem 0.65rem;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }
    .table td {
        padding: 0.6rem 0.65rem;
        font-size: 0.82rem;
    }

    /* Forms */
    label, .form-label {
        font-size: 0.85rem;
    }
    input, select, textarea, .form-control {
        font-size: 0.9rem;
        padding: 0.7rem 0.8rem;
    }
    .row.g-2 { --bs-gutter-x: 0.5rem; }

    /* Alerts */
    .alert {
        font-size: 0.84rem;
        padding: 0.75rem 0.9rem;
    }

    /* Page body spacing */
    .page-body,
    main.container {
        padding-top: 1.25rem;
        padding-bottom: 2rem;
    }

    /* Drawer full screen on tiny phones */
    .drawer {
        width: 100vw;
        border-left: none;
        border-radius: 0;
    }

    .page-wrapper { padding: 1rem 0.5rem; }

    /* Section card h2 */
    .section-card h2 {
        font-size: 1.05rem;
    }

    /* Search/filter rows */
    .search-filter-row {
        flex-direction: column;
    }
    .search-filter-row select {
        max-width: 100% !important;
    }
    .search-filter-row .btn {
        width: 100%;
    }

    /* Pagination — smaller buttons */
    .d-flex .btn-sm {
        min-height: 34px;
        padding: 0.38rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Bulk bar */
    .bulk-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .bulk-bar form,
    .bulk-bar button {
        width: 100%;
    }
}

/* notch / safe-area */
@supports (padding-top: env(safe-area-inset-top)) {
    .hero, header:not(.login-page header) {
        padding-top: calc(1.35rem + env(safe-area-inset-top));
    }
    .drawer {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    @media (max-width: 640px) {
        .hero, header:not(.login-page header) {
            padding-top: calc(0.85rem + env(safe-area-inset-top));
        }
    }
}

/* ===========================
   THEMES
   =========================== */

/* ---- DARK ---- */
[data-theme="dark"] {
    --bg: #0f1117;
    --surface: rgba(26, 29, 41, 0.97);
    --surface-strong: #1a1d29;
    --surface-ink: #e2e8f0;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --accent-soft: rgba(217, 119, 6, 0.16);
    --danger-soft: rgba(220, 38, 38, 0.14);
    --success-soft: rgba(22, 163, 74, 0.14);
}

[data-theme="dark"] body {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(13, 148, 136, 0.1), transparent 40%),
        radial-gradient(ellipse at 90% 0%, rgba(217, 119, 6, 0.07), transparent 35%),
        linear-gradient(175deg, #0d1117, #111827 50%, #0f1117);
    color: var(--text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: rgba(30, 33, 46, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: rgba(36, 40, 56, 0.95);
    border-color: var(--primary);
    color: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22);
}

[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
    background-color: rgba(20, 22, 33, 0.7);
    color: var(--muted);
}

[data-theme="dark"] .card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .menu-group,
[data-theme="dark"] .dash-stat,
[data-theme="dark"] .chart-card {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

[data-theme="dark"] .table {
    color: var(--text);
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    border-color: var(--line);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

[data-theme="dark"] .drawer { background: #1a1d29; }
[data-theme="dark"] .drawer-footer { background: #14161f; color: var(--muted); border-color: var(--line); }
[data-theme="dark"] .topnav-dropdown-menu {
    background: #1e2134;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .topnav-dropdown-item { color: #e2e8f0; }
[data-theme="dark"] .topnav-dropdown-item:hover,
[data-theme="dark"] .topnav-dropdown-item.active {
    background: rgba(13, 148, 136, 0.14);
}
[data-theme="dark"] .menu-group-label { background: rgba(20, 22, 33, 0.6); color: var(--muted); }
[data-theme="dark"] .modal-content { background: #1a1d29; color: var(--text); }
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: var(--line); }
[data-theme="dark"] .btn-outline-primary { background: rgba(20, 22, 33, 0.6); }
[data-theme="dark"] .btn-secondary { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: var(--line); }
[data-theme="dark"] .dash-stat-admin { background: rgba(30, 58, 138, 0.2); border-color: rgba(30, 58, 138, 0.3); }
[data-theme="dark"] label { color: var(--text); }

/* ---- OCEAN ---- */
[data-theme="ocean"] {
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-deep: #1e40af;
    --accent: #7c3aed;
    --accent-soft: rgba(124, 58, 237, 0.10);
    --bg: #f0f4ff;
}

[data-theme="ocean"] body {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(37, 99, 235, 0.09), transparent 40%),
        radial-gradient(ellipse at 90% 0%, rgba(124, 58, 237, 0.07), transparent 35%),
        linear-gradient(175deg, #f0f6ff, #e8effd 50%, #dce8fb);
}

[data-theme="ocean"] .hero::before,
[data-theme="ocean"] header:not(.login-page header)::before {
    background: linear-gradient(148deg,
        rgba(30, 64, 175, 0.97) 0%,
        rgba(37, 99, 235, 0.93) 38%,
        rgba(124, 58, 237, 0.82) 100%);
}

[data-theme="ocean"] .drawer-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #1d4ed8 100%);
}

[data-theme="ocean"] .welcome-panel {
    background: linear-gradient(135deg,
        rgba(30, 64, 175, 0.95) 0%,
        rgba(37, 99, 235, 0.88) 55%,
        rgba(124, 58, 237, 0.78) 100%);
}

[data-theme="ocean"] .welcome-panel-admin {
    background: linear-gradient(135deg,
        rgba(15, 23, 76, 0.95) 0%,
        rgba(30, 64, 175, 0.9) 55%,
        rgba(124, 58, 237, 0.82) 100%);
}

[data-theme="ocean"] .eyebrow { color: var(--primary-deep); border-color: rgba(37, 99, 235, 0.18); }

/* ---- ROSE ---- */
[data-theme="rose"] {
    --primary: #e11d48;
    --primary-strong: #be123c;
    --primary-deep: #9f1239;
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.12);
    --bg: #fff1f2;
}

[data-theme="rose"] body {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(225, 29, 72, 0.09), transparent 40%),
        radial-gradient(ellipse at 90% 0%, rgba(245, 158, 11, 0.08), transparent 35%),
        linear-gradient(175deg, #fff1f5, #ffe4e6 50%, #fecdd3);
}

[data-theme="rose"] .hero::before,
[data-theme="rose"] header:not(.login-page header)::before {
    background: linear-gradient(148deg,
        rgba(159, 18, 57, 0.97) 0%,
        rgba(225, 29, 72, 0.93) 38%,
        rgba(245, 158, 11, 0.82) 100%);
}

[data-theme="rose"] .drawer-header {
    background: linear-gradient(135deg, #9f1239 0%, #e11d48 60%, #be123c 100%);
}

[data-theme="rose"] .welcome-panel {
    background: linear-gradient(135deg,
        rgba(159, 18, 57, 0.95) 0%,
        rgba(225, 29, 72, 0.88) 55%,
        rgba(245, 158, 11, 0.78) 100%);
}

[data-theme="rose"] .welcome-panel-admin {
    background: linear-gradient(135deg,
        rgba(100, 10, 38, 0.95) 0%,
        rgba(159, 18, 57, 0.9) 55%,
        rgba(245, 158, 11, 0.82) 100%);
}

[data-theme="rose"] .eyebrow { color: var(--primary-deep); border-color: rgba(225, 29, 72, 0.18); }

/* ===========================
   THEME PICKER WIDGET
   =========================== */
.theme-picker-wrap {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.theme-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease), background 0.2s;
    flex-shrink: 0;
}

.theme-fab:hover { transform: scale(1.1); background: var(--primary-strong); }
.theme-fab.open  { transform: rotate(30deg); }

.theme-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--line, rgba(100,80,50,0.12));
    border-radius: var(--radius-lg, 18px);
    box-shadow: var(--shadow-lg);
    padding: 0.85rem 1rem 0.9rem;
    min-width: 170px;
    animation: fadeSlideUp 0.2s var(--ease) both;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.theme-panel[hidden] { display: none; }

.theme-panel-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.theme-swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.theme-swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.theme-swatch:hover { background: var(--accent-soft); }

.theme-swatch.active {
    border-color: var(--sw, #0d9488);
    background: rgba(0, 0, 0, 0.04);
}

.theme-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--sw, #0d9488);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

@media (max-width: 640px) {
    .theme-picker-wrap { bottom: 1rem; right: 1rem; }
}

