/* ==========================================================================
   PLANER — Premium Event Planning Platform
   Design System & Component Library
   ========================================================================== */

/* --- 1. Design Tokens --- */
:root {
    --burgundy: #4a2c2a;
    --burgundy-deep: #3a1f1d;
    --burgundy-light: #6b3d3a;
    --burgundy-muted: #8b5e5a;
    --burgundy-subtle: rgba(74, 44, 42, 0.08);

    --gold: #d4af37;
    --gold-light: #f5e8d3;
    --gold-bright: #e8c547;
    --gold-muted: rgba(212, 175, 55, 0.5);
    --gold-subtle: rgba(212, 175, 55, 0.1);

    --cream: #fdfaf5;
    --cream-mid: #f8f4ed;
    --cream-dark: #f0e8da;

    --text-primary: #2d1f1e;
    --text-secondary: #6b5b58;
    --text-muted: #9a8a86;
    --text-inverse: #fdfaf5;

    --success: #4a7c59;
    --warning: #c4922a;
    --danger: #8b3a3a;
    --info: #4a6b8b;

    --surface-primary: #fdfaf5;
    --surface-secondary: #f8f4ed;
    --surface-elevated: rgba(255, 255, 255, 0.85);
    --surface-sidebar: rgba(58, 31, 29, 0.97);
    --surface-header: rgba(253, 250, 245, 0.88);
    --surface-overlay: rgba(74, 44, 42, 0.4);

    --border-default: rgba(74, 44, 42, 0.1);
    --border-gold: rgba(212, 175, 55, 0.25);
    --border-light: rgba(212, 175, 55, 0.36);

    --shadow-xs: 0 1px 3px rgba(74, 44, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(74, 44, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(74, 44, 42, 0.08);
    --shadow-lg: 0 8px 32px rgba(74, 44, 42, 0.12);
    --shadow-xl: 0 16px 48px rgba(74, 44, 42, 0.16);
    --shadow-gold-glow: 0 0 20px rgba(212, 175, 55, 0.15);

    --glass-blur: 20px;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(212, 175, 55, 0.18);

    --sidebar-w: 272px;
    --header-h: 68px;
    --content-pad: 2rem;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --dur-fast: 0.2s;
    --dur-normal: 0.35s;
    --dur-slow: 0.5s;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
}

/* --- Dark Mode Tokens --- */
html.dark {
    --burgundy: #5c3836;
    --burgundy-deep: #140e0f;
    --burgundy-light: #7d4a47;
    --burgundy-subtle: rgba(212, 175, 55, 0.06);
    --gold-bright: #f0d060;
    --gold-light: #3d3520;
    --gold-subtle: rgba(212, 175, 55, 0.08);
    --cream: #140e0f;
    --cream-mid: #1e1517;
    --cream-dark: #2a1e20;
    --text-primary: #f0e8da;
    --text-secondary: #bfa9a5;
    --text-muted: #7a6560;
    --surface-primary: #140e0f;
    --surface-secondary: #1e1517;
    --surface-elevated: rgba(30, 21, 23, 0.85);
    --surface-sidebar: rgba(20, 14, 15, 0.98);
    --surface-header: rgba(20, 14, 15, 0.92);
    --surface-overlay: rgba(0, 0, 0, 0.6);
    --border-default: rgba(212, 175, 55, 0.1);
    --border-gold: rgba(212, 175, 55, 0.2);
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-gold-glow: 0 0 24px rgba(212, 175, 55, 0.2);
    --glass-bg: rgba(30, 21, 23, 0.6);
    --glass-border: rgba(212, 175, 55, 0.15);
}

/* --- 2. Base Styles --- */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--surface-primary);
    line-height: 1.6;
    overflow-x: hidden;
    margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-top: 0;
}

a {
    color: var(--burgundy-light);
    text-decoration: none;
    transition: color var(--dur-fast) ease;
}
a:hover { color: var(--gold); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--burgundy-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* --- 3. App Layout --- */
.planer-app {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 15% 80%, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(74, 44, 42, 0.04) 0%, transparent 50%),
        var(--surface-primary);
}

html.dark .planer-app {
    background:
        radial-gradient(ellipse at 15% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(90, 40, 38, 0.06) 0%, transparent 50%),
        var(--surface-primary);
}

/* Sidebar Overlay */
.planer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--dur-normal) ease;
}
.planer-overlay.active { display: block; opacity: 1; }

/* --- 4. Sidebar --- */
.planer-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface-sidebar);
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid rgba(212, 175, 55, 0.08);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--dur-normal) var(--ease-out-expo);
    overflow: hidden;
}

.planer-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    position: relative;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700; font-size: 1.25rem;
    color: var(--burgundy-deep);
    flex-shrink: 0;
}
.sidebar-brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem; font-weight: 600;
    color: var(--gold-light);
    line-height: 1; letter-spacing: 0.02em;
}
.sidebar-brand-tagline {
    font-size: 0.65rem;
    color: rgba(245, 232, 211, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
}

/* Sidebar Nav */
.sidebar-nav { padding: 1rem 0.75rem; flex-shrink: 0; }
.sidebar-nav-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(245, 232, 211, 0.3);
    padding: 1rem 0.75rem 0.5rem;
    font-weight: 600;
}
.sidebar-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(245, 232, 211, 0.65);
    font-size: 0.875rem; font-weight: 450;
    transition: all var(--dur-fast) ease;
    cursor: pointer; text-decoration: none;
    margin-bottom: 2px;
}
.sidebar-nav-item:hover {
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-light);
}
.sidebar-nav-item.active {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}
.sidebar-nav-item svg {
    width: 18px; height: 18px;
    stroke: currentColor; stroke-width: 1.75; fill: none;
    flex-shrink: 0; opacity: 0.8;
}
.sidebar-nav-item.active svg,
.sidebar-nav-item:hover svg { opacity: 1; }

/* Sidebar Entity List */
.sidebar-entities {
    flex: 1; overflow: hidden;
    display: flex; flex-direction: column;
    border-top: 1px solid rgba(212, 175, 55, 0.08);
}
.sidebar-search { padding: 0.75rem; flex-shrink: 0; }
.sidebar-search-wrapper { position: relative; }
.sidebar-search-wrapper svg {
    position: absolute; left: 0.65rem; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    stroke: rgba(245, 232, 211, 0.3); stroke-width: 2; fill: none;
    pointer-events: none;
}
.sidebar-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 0.8rem; font-family: inherit; outline: none;
    transition: all var(--dur-fast) ease;
}
.sidebar-search-input::placeholder { color: rgba(245, 232, 211, 0.3); }
.sidebar-search-input:focus {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-entity-list {
    flex: 1; overflow-y: auto;
    padding: 0 0.5rem 1rem;
}
.sidebar-entity-item {
    display: block;
    padding: 0.4rem 0.75rem;
    color: rgba(245, 232, 211, 0.55);
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
    transition: all var(--dur-fast) ease;
    text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-entity-item:hover {
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-light);
}
.sidebar-entity-item.hidden { display: none; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.08);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--dur-fast) ease;
}
.sidebar-user:hover { background: rgba(212, 175, 55, 0.06); }
.sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--gold), var(--burgundy-light));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700; font-size: 0.85rem; color: white;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 0.8rem; font-weight: 500;
    color: var(--gold-light); line-height: 1.2;
}
.sidebar-user-role {
    font-size: 0.65rem;
    color: rgba(245, 232, 211, 0.4);
}
.sidebar-logout-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-sm);
    color: rgba(245, 232, 211, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all var(--dur-fast) ease;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sidebar-logout-btn:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--gold);
    color: var(--gold-light);
}
.sidebar-logout-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* --- 5. Main Area --- */
.planer-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--dur-normal) var(--ease-out-expo);
}

/* --- 6. Header --- */
.planer-header {
    position: sticky; top: 0;
    height: var(--header-h);
    background: var(--surface-header);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-default);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--content-pad);
    z-index: 50; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-menu-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 0.5rem; color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all var(--dur-fast) ease;
}
.header-menu-btn:hover { background: var(--burgundy-subtle); }
.header-menu-btn svg {
    width: 22px; height: 22px;
    stroke: currentColor; stroke-width: 2; fill: none;
}
.header-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.header-right { display: flex; align-items: center; gap: 0.5rem; }
.header-icon-btn {
    background: none; border: 1px solid transparent;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--dur-fast) ease;
    position: relative;
}
.header-icon-btn:hover {
    background: var(--burgundy-subtle);
    color: var(--text-primary);
    border-color: var(--border-gold);
}
.header-icon-btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; stroke-width: 1.75; fill: none;
}
.header-icon-btn .notification-dot {
    position: absolute; top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--gold);
    border-radius: var(--radius-full);
    border: 1.5px solid var(--surface-header);
}
.header-user-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: none;
    border: 1px solid var(--border-default);
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    border-radius: var(--radius-full);
    cursor: pointer; transition: all var(--dur-fast) ease;
    margin-left: 0.25rem;
}
.header-user-btn:hover {
    border-color: var(--border-gold);
    background: var(--gold-subtle);
}
.header-user-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--gold), var(--burgundy-light));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700; font-size: 0.75rem; color: white;
}
.header-user-name {
    font-size: 0.8rem; font-weight: 500; color: var(--text-primary);
}

/* --- 7. Content & Footer --- */
.planer-content {
    flex: 1;
    padding: var(--content-pad);
    width: 100%;
}
.planer-footer {
    padding: 1.25rem var(--content-pad);
    text-align: center;
    font-size: 0.75rem; color: var(--text-muted);
    border-top: 1px solid var(--border-default);
    flex-shrink: 0;
}
.planer-footer a { color: var(--gold); }

/* --- 8. Glass Card --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--dur-normal) var(--ease-out),
        box-shadow var(--dur-normal) var(--ease-out),
        border-color var(--dur-normal) ease;
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none; opacity: 0;
    transition: opacity var(--dur-normal) ease;
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-gold-glow);
    border-color: rgba(212, 175, 55, 0.35);
}
.glass-card:hover::before { opacity: 1; }

.glass-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.glass-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem; font-weight: 600;
    color: var(--text-primary); margin: 0;
    display: flex; align-items: center; gap: 0.5rem;
}
.glass-card-title svg {
    width: 18px; height: 18px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.glass-card-body { padding: 1.5rem; }
.glass-card-badge {
    font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    background: var(--gold-subtle);
    color: var(--gold);
    border: 1px solid var(--border-gold);
}

/* --- 9. Hero Section --- */
.dashboard-hero { margin-bottom: 2rem; }
.hero-card {
    background: linear-gradient(135deg, var(--burgundy-deep) 0%, var(--burgundy) 50%, var(--burgundy-light) 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    color: var(--text-inverse);
    position: relative; overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-lg);
}
.hero-card::before {
    content: '';
    position: absolute; top: -50%; right: -20%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-card::after {
    content: '';
    position: absolute; bottom: -30%; left: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 2rem; flex-wrap: wrap;
}
.hero-greeting h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem; font-weight: 500;
    color: #fff; margin: 0 0 0.35rem; line-height: 1.1;
}
.hero-greeting p {
    color: rgba(245, 232, 211, 0.7);
    font-size: 0.95rem; margin: 0;
}
.hero-event { text-align: right; flex-shrink: 0; }
.hero-event-label {
    font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--gold);
    margin-bottom: 0.35rem; font-weight: 600;
}
.hero-event-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem; font-weight: 600;
    color: #fff; margin-bottom: 0.25rem;
}
.hero-event-date {
    font-size: 0.8rem;
    color: rgba(245, 232, 211, 0.6);
    margin-bottom: 0.75rem;
}
.hero-countdown { display: flex; gap: 0.75rem; }
.countdown-unit {
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem; min-width: 52px;
}
.countdown-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; font-weight: 700;
    color: var(--gold); line-height: 1; display: block;
}
.countdown-label {
    font-size: 0.55rem; text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(245, 232, 211, 0.5);
    margin-top: 2px; display: block;
}

/* --- 10. Stats Row --- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem; margin-bottom: 2rem;
}
.stat-card { padding: 1.25rem; }
.stat-card-inner { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--gold-subtle);
    border: 1px solid var(--border-gold);
}
.stat-icon svg {
    width: 20px; height: 20px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; font-weight: 700;
    color: var(--text-primary); line-height: 1;
}
.stat-label {
    font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}

/* --- 11. Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem; margin-bottom: 2rem;
}

/* Event items */
.event-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-default);
}
.event-item:last-child { border-bottom: none; }
.event-dot {
    width: 8px; height: 8px;
    border-radius: var(--radius-full); flex-shrink: 0;
}
.event-dot.gold { background: var(--gold); }
.event-dot.burgundy { background: var(--burgundy); }
.event-dot.success { background: var(--success); }
.event-dot.info { background: var(--info); }
.event-details { flex: 1; overflow: hidden; }
.event-name {
    font-weight: 500; font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-meta { font-size: 0.75rem; color: var(--text-muted); }
.event-status {
    font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem; border-radius: var(--radius-full);
}
.event-status.planning { background: var(--gold-subtle); color: var(--gold); }
.event-status.confirmed { background: rgba(74, 124, 89, 0.1); color: var(--success); }
.event-status.pending { background: rgba(74, 107, 139, 0.1); color: var(--info); }

/* Budget bars */
.budget-bar-group { margin-bottom: 1rem; }
.budget-bar-group:last-child { margin-bottom: 0; }
.budget-bar-label {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem;
}
.budget-bar-track {
    height: 6px;
    background: var(--border-default);
    border-radius: var(--radius-full); overflow: hidden;
}
.budget-bar-fill {
    height: 100%; border-radius: var(--radius-full);
    transition: width 1s var(--ease-out-expo);
}
.budget-bar-fill.gold { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.budget-bar-fill.burgundy { background: linear-gradient(90deg, var(--burgundy), var(--burgundy-light)); }
.budget-bar-fill.success { background: var(--success); }

/* Vendor items */
.vendor-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-default);
}
.vendor-item:last-child { border-bottom: none; }
.vendor-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--gold-subtle);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.vendor-avatar svg {
    width: 18px; height: 18px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.vendor-info { flex: 1; overflow: hidden; }
.vendor-name { font-weight: 500; font-size: 0.85rem; color: var(--text-primary); }
.vendor-category { font-size: 0.7rem; color: var(--text-muted); }
.vendor-rating { font-size: 0.75rem; color: var(--gold); font-weight: 600; }

/* Guest Progress */
.guest-progress-ring {
    display: flex; align-items: center; justify-content: center;
    gap: 2rem; padding: 1rem 0;
}
.progress-circle { position: relative; width: 100px; height: 100px; }
.progress-circle svg { transform: rotate(-90deg); width: 100px; height: 100px; }
.progress-circle .track { fill: none; stroke: var(--border-default); stroke-width: 6; }
.progress-circle .fill {
    fill: none; stroke: var(--gold); stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s var(--ease-out-expo);
}
.progress-value {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.progress-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--text-primary); line-height: 1;
}
.progress-label {
    font-size: 0.6rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.guest-stats { display: flex; flex-direction: column; gap: 0.75rem; }
.guest-stat-row {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem;
}
.guest-stat-dot {
    width: 8px; height: 8px;
    border-radius: var(--radius-full); flex-shrink: 0;
}
.guest-stat-label { color: var(--text-secondary); flex: 1; }
.guest-stat-count { font-weight: 600; color: var(--text-primary); }

/* --- 12. Dashboard Bottom --- */
.dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Mini Calendar */
.mini-calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 2px; text-align: center;
}
.cal-header {
    font-size: 0.6rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding: 0.5rem 0; font-weight: 600;
}
.cal-day {
    font-size: 0.8rem; padding: 0.4rem;
    border-radius: var(--radius-xs); color: var(--text-secondary);
    cursor: pointer; transition: all var(--dur-fast) ease;
}
.cal-day:hover { background: var(--gold-subtle); color: var(--text-primary); }
.cal-day.today {
    background: var(--gold); color: var(--burgundy-deep); font-weight: 700;
}
.cal-day.has-event { position: relative; }
.cal-day.has-event::after {
    content: '';
    position: absolute; bottom: 3px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border-radius: var(--radius-full); background: var(--gold);
}
.cal-day.other-month { color: var(--text-muted); opacity: 0.4; }
.cal-month-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.75rem;
}
.cal-month-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600; color: var(--text-primary);
}
.cal-nav-btn {
    background: none;
    border: 1px solid var(--border-default);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-xs); cursor: pointer;
    color: var(--text-secondary); transition: all var(--dur-fast) ease;
}
.cal-nav-btn:hover { border-color: var(--border-gold); color: var(--gold); }
.cal-nav-btn svg {
    width: 14px; height: 14px;
    stroke: currentColor; stroke-width: 2; fill: none;
}

/* Activity Feed */
.activity-item {
    display: flex; gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-default);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.activity-icon.gold-bg { background: var(--gold-subtle); }
.activity-icon.burgundy-bg { background: var(--burgundy-subtle); }
.activity-icon.success-bg { background: rgba(74, 124, 89, 0.08); }
.activity-icon svg { width: 14px; height: 14px; stroke-width: 1.75; fill: none; }
.activity-icon.gold-bg svg { stroke: var(--gold); }
.activity-icon.burgundy-bg svg { stroke: var(--burgundy-light); }
.activity-icon.success-bg svg { stroke: var(--success); }
.activity-text {
    flex: 1; font-size: 0.82rem;
    color: var(--text-secondary); line-height: 1.5;
}
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time {
    font-size: 0.7rem; color: var(--text-muted);
    flex-shrink: 0; margin-top: 2px;
}

/* --- 13. Bootstrap Overrides --- */
.table { color: var(--text-primary); border-color: var(--border-default); }
.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--border-default);
    padding: 0.75rem 1rem;
    color: rgba(245, 232, 211, 0.65);
}
.table > thead > tr > th {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom-width: 2px;
    border-bottom-color: var(--border-gold);
}
.table > tbody > tr:hover > td { background: var(--gold-subtle); }
.btn-primary {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
    border-color: var(--burgundy); color: #fff; font-weight: 500;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--burgundy-light), var(--burgundy));
    border-color: var(--burgundy-light);
    box-shadow: var(--shadow-md);
}
.btn-outline-primary { color: var(--burgundy); border-color: var(--burgundy); }
.btn-outline-primary:hover {
    background: var(--burgundy); border-color: var(--burgundy); color: #fff;
}
.form-control, .form-select {
    border-color: var(--border-default);
    border-radius: var(--radius-sm);
    color: rgba(245, 232, 211, 0.65);
    background-color: transparent;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
    background-color: transparent;
    color: rgba(245, 232, 211, 0.65);
}
.form-control:hover, .form-select:hover { color: rgba(245, 232, 211, 0.65); }
.form-control:disabled, .form-control[readonly],
.form-select:disabled, .form-select[readonly] {
    background-color: transparent;
    color: rgba(245, 232, 211, 0.65);
    opacity: 0.6;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.7; }
.form-select option { background-color: var(--surface-secondary); color: var(--text-primary); }
.form-check-input {
    background-color: transparent;
    border-color: rgba(212, 175, 55, 0.3);
    width: 1.15em; height: 1.15em;
}
.form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--gold);
}
.form-check-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
}
.form-check-input:disabled {
    background-color: transparent;
    opacity: 0.5;
}
.form-check-label, label { color: rgb(125, 74, 71); }
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* --- 14. Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}
.anim-fade-up { animation: fadeInUp 0.6s var(--ease-out) both; }
.anim-fade { animation: fadeIn 0.5s ease both; }
.anim-slide-left { animation: slideInLeft 0.5s var(--ease-out) both; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.4s; }
.d5 { animation-delay: 0.5s; }
.d6 { animation-delay: 0.6s; }

/* --- 15. Responsive --- */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-content { flex-direction: column; }
    .hero-event { text-align: left; }
}
@media (max-width: 768px) {
    :root { --content-pad: 1.25rem; }
    .planer-sidebar { transform: translateX(-100%); }
    .planer-sidebar.open { transform: translateX(0); }
    .planer-main { margin-left: 0; }
    .header-menu-btn { display: flex; }
    .header-user-name { display: none; }
    .hero-card { padding: 1.75rem; }
    .hero-greeting h1 { font-size: 1.65rem; }
}
@media (max-width: 480px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .hero-countdown { flex-wrap: wrap; }
    .countdown-unit { min-width: 45px; }
    .guest-progress-ring { flex-direction: column; }
}

/* ==========================================================================
   16. LIST / TABLE PAGE — Premium Entity Browser
   ========================================================================== */

/* --- Page Header --- */
.list-hero { margin-bottom: 1.75rem; }
.list-hero-content {
    display: flex; align-items: flex-end;
    justify-content: space-between; gap: 1.5rem;
    flex-wrap: wrap;
}
.list-hero-text { flex: 1; min-width: 200px; }
.list-breadcrumb {
    font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--text-muted);
    font-weight: 600; margin-bottom: 0.35rem; display: block;
}
.list-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem; font-weight: 600;
    color: var(--text-primary); margin: 0; line-height: 1.1;
}
.list-title .list-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem; font-weight: 600;
    color: var(--gold); background: var(--gold-subtle);
    border: 1px solid var(--border-gold);
    padding: 0.2rem 0.65rem; border-radius: var(--radius-full);
    vertical-align: middle; margin-left: 0.65rem;
    letter-spacing: 0.02em; position: relative; top: -4px;
}
.list-subtitle {
    font-size: 0.85rem; color: var(--text-muted);
    margin: 0.3rem 0 0;
}

/* --- Golden CTA Button --- */
.btn-gold {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: var(--burgundy-deep); font-weight: 600; font-size: 0.85rem;
    border-radius: var(--radius-full); border: none; cursor: pointer;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: all var(--dur-fast) ease;
    box-shadow: var(--shadow-sm), 0 0 0 0 rgba(212, 175, 55, 0);
    position: relative; overflow: hidden;
}
.btn-gold::before {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.35) 50%, transparent 75%);
    transition: left 0.6s ease;
}
.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-gold-glow);
    color: var(--burgundy-deep);
}
.btn-gold:hover::before { left: 100%; }
.btn-gold:active { transform: translateY(0); }
.btn-gold svg {
    width: 16px; height: 16px;
    stroke: currentColor; stroke-width: 2.5; fill: none;
}

.btn-gold-outline {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent; color: var(--gold);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full); font-size: 0.8rem;
    font-weight: 500; cursor: pointer; text-decoration: none;
    transition: all var(--dur-fast) ease; font-family: inherit;
}
.btn-gold-outline:hover {
    background: var(--gold-subtle); color: var(--gold-bright);
    border-color: var(--gold);
}
.btn-gold-outline svg {
    width: 14px; height: 14px;
    stroke: currentColor; stroke-width: 2; fill: none;
}

/* --- Toolbar --- */
.list-toolbar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 1rem; margin-bottom: 1rem;
    flex-wrap: wrap;
}
.list-search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.list-search-icon {
    position: absolute; left: 0.85rem; top: 50%;
    transform: translateY(-50%);
    width: 15px; height: 15px;
    stroke: var(--text-muted); stroke-width: 2; fill: none;
    pointer-events: none; transition: stroke var(--dur-fast) ease;
}
.list-search-input {
    width: 100%; padding: 0.55rem 2.5rem 0.55rem 2.4rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary); font-size: 0.82rem;
    font-family: inherit; outline: none;
    transition: all var(--dur-fast) ease;
}
.list-search-input::placeholder { color: var(--text-muted); }
.list-search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: var(--surface-primary);
}
.list-search-input:focus ~ .list-search-icon { stroke: var(--gold); }
.list-search-clear {
    position: absolute; right: 0.5rem; top: 50%;
    transform: translateY(-50%);
    background: var(--burgundy-subtle); border: none; cursor: pointer;
    width: 22px; height: 22px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.7rem;
    transition: all var(--dur-fast) ease; text-decoration: none;
}
.list-search-clear:hover { background: rgba(139, 58, 58, 0.12); color: var(--danger); }
.list-toolbar-right {
    display: flex; align-items: center; gap: 0.4rem; margin-left: auto;
}
.list-view-btn {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    background: transparent; cursor: pointer; color: var(--text-muted);
    transition: all var(--dur-fast) ease;
}
.list-view-btn:hover, .list-view-btn.active {
    border-color: var(--border-gold); color: var(--gold);
    background: var(--gold-subtle);
}
.list-view-btn svg {
    width: 15px; height: 15px;
    stroke: currentColor; stroke-width: 1.75; fill: none;
}
.list-page-size {
    padding: 0.4rem 0.65rem; border: 1px solid var(--border-default);
    border-radius: var(--radius-sm); background: transparent;
    color: var(--text-secondary); font-size: 0.78rem;
    font-family: inherit; cursor: pointer; outline: none;
    transition: all var(--dur-fast) ease;
}
.list-page-size:hover, .list-page-size:focus {
    border-color: var(--border-gold); color: var(--text-primary);
}
.list-page-size option { background: var(--surface-secondary); color: var(--text-primary); }

/* --- Table Wrapper --- */
.list-table-wrap {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 1.25rem;
    position: relative;
}
.list-table-wrap::before {
    content: ''; position: absolute; inset: 0;
    border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
}

/* --- Table --- */
.list-table { width: 100%; border-collapse: collapse; }
.list-table thead th {
    padding: 0.8rem 1.15rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.78rem; font-weight: 600;
    color: var(--gold); text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--burgundy-deep);
    white-space: nowrap; text-align: left;
    position: sticky; top: 0; z-index: 5;
    border-bottom: 2px solid rgba(212, 175, 55, 0.25);
}
html.dark .list-table thead th { background: rgba(20, 14, 15, 0.95); }
.list-table thead th:first-child { padding-left: 1.5rem; }
.list-table thead th:last-child { padding-right: 1.5rem; }

/* Sortable column link */
.list-sort-link {
    color: var(--gold); text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.3rem;
    transition: color var(--dur-fast) ease;
}
.list-sort-link:hover { color: var(--gold-bright); }
.list-sort-arrow {
    font-size: 0.6rem; opacity: 0.6;
    transition: opacity var(--dur-fast) ease;
}
.list-sort-link:hover .list-sort-arrow { opacity: 1; }
.list-sort-link.active .list-sort-arrow { opacity: 1; color: var(--gold-bright); }

/* Table Body */
.list-table tbody tr {
    border-bottom: 1px solid var(--border-default);
    transition: all var(--dur-fast) ease;
    cursor: pointer;
}
.list-table tbody tr:hover {
    background: var(--gold-subtle);
}
.list-table tbody tr:hover td:first-child {
    border-left: 3px solid var(--gold-bright);
    padding-left: calc(1.5rem - 3px);
}
.list-table tbody tr:last-child { border-bottom: none; }

.list-table tbody td {
    padding: 0.75rem 1.15rem; font-size: 0.85rem;
    color: var(--text-secondary); vertical-align: middle;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-table tbody td:first-child { padding-left: 1.5rem; }
.list-table tbody td:last-child { padding-right: 1.5rem; }

/* Cell content styles */
.list-cell-primary { font-weight: 500; color: var(--text-primary); }
.list-cell-null { color: var(--text-muted); font-style: italic; font-size: 0.8rem; }
.list-cell-id {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.68rem; color: var(--text-muted);
    background: var(--surface-secondary); padding: 0.15rem 0.45rem;
    border-radius: var(--radius-xs);
}
.list-cell-bool {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.list-cell-bool::before {
    content: ''; width: 6px; height: 6px; border-radius: var(--radius-full);
}
.list-cell-bool.yes { color: var(--success); }
.list-cell-bool.yes::before { background: var(--success); }
.list-cell-bool.no { color: var(--text-muted); }
.list-cell-bool.no::before { background: var(--text-muted); }

.list-fk-link {
    color: var(--burgundy-light); text-decoration: none;
    font-weight: 500; transition: color var(--dur-fast) ease;
    display: inline-flex; align-items: center; gap: 0.2rem;
}
html.dark .list-fk-link { color: var(--gold-muted); }
.list-fk-link:hover { color: var(--gold); }
.list-fk-link::after {
    content: '\2192'; font-size: 0.65rem; opacity: 0;
    transform: translateX(-3px); transition: all var(--dur-fast) ease;
}
.list-fk-link:hover::after { opacity: 0.7; transform: translateX(0); }

/* --- Row Actions --- */
.list-actions { text-align: right; white-space: nowrap; width: 1%; }
.list-actions-group {
    display: flex; align-items: center; gap: 0.15rem; justify-content: flex-end;
}
.list-action-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    background: transparent; cursor: pointer;
    color: var(--text-muted); transition: all var(--dur-fast) ease;
}
.list-action-btn svg {
    width: 14px; height: 14px; stroke: currentColor;
    stroke-width: 1.75; fill: none;
}
.list-action-btn:hover {
    background: var(--surface-secondary);
    color: var(--text-primary); border-color: var(--border-default);
}
.list-action-btn.view:hover { color: var(--info); border-color: rgba(74, 107, 139, 0.25); }
.list-action-btn.edit:hover { color: var(--warning); border-color: rgba(196, 146, 42, 0.25); }

/* Row Context Menu */
.list-row-menu { position: relative; }
.list-menu-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    background: transparent; cursor: pointer;
    color: var(--text-muted); transition: all var(--dur-fast) ease;
}
.list-menu-btn:hover {
    background: var(--surface-secondary); color: var(--text-primary);
}
.list-menu-btn svg {
    width: 15px; height: 15px; stroke: currentColor;
    stroke-width: 2; fill: none;
}
.list-dropdown {
    position: absolute; right: 0; top: calc(100% + 4px);
    background: var(--surface-elevated);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 0.35rem; min-width: 170px; z-index: 20;
    opacity: 0; transform: translateY(-6px) scale(0.97);
    pointer-events: none; transition: all var(--dur-fast) var(--ease-out);
}
.list-dropdown.open {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.list-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.75rem; border-radius: var(--radius-xs);
    color: var(--text-secondary); font-size: 0.8rem;
    cursor: pointer; transition: all var(--dur-fast) ease;
    text-decoration: none; border: none; background: none;
    width: 100%; font-family: inherit;
}
.list-dropdown-item:hover { background: var(--gold-subtle); color: var(--text-primary); }
.list-dropdown-item.danger { color: var(--danger); }
.list-dropdown-item.danger:hover { background: rgba(139, 58, 58, 0.1); }
.list-dropdown-item svg {
    width: 14px; height: 14px; stroke: currentColor;
    stroke-width: 1.75; fill: none; flex-shrink: 0;
}
.list-dropdown-divider {
    height: 1px; background: var(--border-default); margin: 0.25rem 0.5rem;
}

/* --- Pagination --- */
.list-pagination {
    display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.list-showing { font-size: 0.78rem; color: var(--text-muted); }
.list-showing strong { color: var(--text-primary); font-weight: 600; }
.list-pages { display: flex; align-items: center; gap: 0.2rem; }
.page-btn {
    display: flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 0.45rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm); background: transparent;
    color: var(--text-secondary); font-size: 0.8rem;
    font-weight: 500; cursor: pointer;
    transition: all var(--dur-fast) ease;
    text-decoration: none; font-family: inherit;
}
.page-btn:hover {
    border-color: var(--border-gold); color: var(--gold);
    background: var(--gold-subtle);
}
.page-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: var(--burgundy-deep); border-color: var(--gold);
    font-weight: 700; box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}
.page-btn.disabled { opacity: 0.3; pointer-events: none; }
.page-btn svg {
    width: 14px; height: 14px; stroke: currentColor;
    stroke-width: 2; fill: none;
}
.page-ellipsis {
    min-width: 28px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.75rem; letter-spacing: 0.1em;
}

/* --- Empty State --- */
.list-empty {
    text-align: center; padding: 4.5rem 2rem 3rem;
}
.list-empty-ornament {
    font-size: 3.5rem; line-height: 1;
    color: var(--gold); opacity: 0.3; margin-bottom: 1.25rem;
    font-family: 'Cormorant Garamond', serif;
}
.list-empty h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.65rem; font-weight: 500;
    color: var(--text-primary); margin: 0 0 0.5rem;
}
.list-empty p {
    color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1.75rem;
    max-width: 340px; margin-inline: auto;
}

/* --- Toast Messages --- */
.list-toast {
    padding: 0.8rem 1.15rem; border-radius: var(--radius-md);
    margin-bottom: 1.15rem; display: flex; align-items: center;
    gap: 0.65rem; animation: fadeInUp 0.4s var(--ease-out) both;
    border: 1px solid;
}
.list-toast svg {
    width: 17px; height: 17px; stroke: currentColor;
    stroke-width: 2; fill: none; flex-shrink: 0;
}
.list-toast-text { flex: 1; font-size: 0.85rem; font-weight: 450; }
.list-toast-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.4; padding: 0.2rem;
    transition: opacity var(--dur-fast) ease;
}
.list-toast-close:hover { opacity: 1; }
.list-toast.success {
    background: rgba(74, 124, 89, 0.07);
    border-color: rgba(74, 124, 89, 0.2); color: var(--success);
}
.list-toast.error {
    background: rgba(139, 58, 58, 0.07);
    border-color: rgba(139, 58, 58, 0.2); color: var(--danger);
}

/* --- Row Stagger Animation --- */
@keyframes listRowIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.list-table tbody tr {
    animation: listRowIn 0.35s var(--ease-out) both;
}
.list-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.list-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.list-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.list-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.list-table tbody tr:nth-child(5) { animation-delay: 0.10s; }
.list-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.list-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.list-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.list-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.list-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.list-table tbody tr:nth-child(n+11) { animation-delay: 0.22s; }

/* --- List Responsive --- */
@media (max-width: 768px) {
    .list-hero-content { flex-direction: column; align-items: flex-start; }
    .list-title { font-size: 1.65rem; }
    .list-toolbar { flex-direction: column; align-items: stretch; }
    .list-search { max-width: none; }
    .list-toolbar-right { justify-content: flex-end; }
    .list-pagination { flex-direction: column; text-align: center; }
    .list-table-wrap { border-radius: var(--radius-md); }
    .list-table tbody td,
    .list-table thead th { padding: 0.6rem 0.75rem; font-size: 0.78rem; }
    .list-table tbody td:first-child,
    .list-table thead th:first-child { padding-left: 1rem; }
}

/* ==========================================================================
   17. FORM PAGE — Premium Create / Edit
   ========================================================================== */

/* --- Form Layout --- */
.form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.75rem;
    align-items: start;
}

/* --- Page Header --- */
.form-hero { margin-bottom: 1.75rem; }
.form-hero-content {
    display: flex; align-items: flex-end;
    justify-content: space-between; gap: 1.5rem;
    flex-wrap: wrap;
}
.form-hero-text { flex: 1; min-width: 200px; }
.form-breadcrumb {
    font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--text-muted);
    font-weight: 600; margin-bottom: 0.35rem; display: block;
}
.form-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem; font-weight: 600;
    color: var(--text-primary); margin: 0; line-height: 1.1;
}
.form-title .form-mode-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.22rem 0.7rem; border-radius: var(--radius-full);
    vertical-align: middle; margin-left: 0.65rem;
    position: relative; top: -4px;
}
.form-mode-badge.create {
    background: rgba(74, 124, 89, 0.1); color: var(--success);
    border: 1px solid rgba(74, 124, 89, 0.2);
}
.form-mode-badge.edit {
    background: var(--gold-subtle); color: var(--gold);
    border: 1px solid var(--border-gold);
}

/* --- Progress Bar --- */
.form-progress {
    margin-bottom: 1.5rem;
}
.form-progress-bar {
    height: 4px; border-radius: var(--radius-full);
    background: var(--border-default); overflow: hidden;
    position: relative;
}
.form-progress-fill {
    height: 100%; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    transition: width 0.5s var(--ease-out-expo);
    min-width: 0;
}
.form-progress-label {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 0.5rem;
}
.form-progress-text {
    font-size: 0.7rem; color: var(--text-muted);
    font-weight: 500; letter-spacing: 0.02em;
}
.form-progress-pct {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem; font-weight: 700;
    color: var(--gold);
}

/* --- Form Card --- */
.form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.form-card::before {
    content: ''; position: absolute; inset: 0;
    border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
}
.form-card-body { padding: 2rem; position: relative; }

/* --- Section Dividers --- */
.form-section { margin-bottom: 2rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}
.form-section-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 50px; height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
.form-section-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--gold-subtle);
    border: 1px solid var(--border-gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.form-section-icon svg {
    width: 16px; height: 16px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.form-section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.form-section-count {
    font-size: 0.65rem; font-weight: 500;
    color: var(--text-muted); margin-left: auto;
}

/* --- Form Groups --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}
.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* --- Floating Label Input --- */
.form-group {
    position: relative; margin-bottom: 1.35rem;
}
.form-group .form-field-label {
    display: block; margin-bottom: 0.4rem;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: color var(--dur-fast) ease;
}
.form-group:focus-within .form-field-label {
    color: var(--gold);
}
.form-group .form-field-required {
    color: var(--gold); margin-left: 0.15rem;
}

/* Premium input styling */
.form-field {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem; font-family: inherit;
    outline: none;
    transition: all var(--dur-fast) ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.form-field::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-field:hover {
    border-color: var(--border-gold);
    background: color-mix(in srgb, var(--surface-secondary) 90%, var(--gold-subtle));
}
.form-field:focus {
    border-color: var(--gold);
    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.1),
        inset 0 1px 2px rgba(0, 0, 0, 0.02),
        var(--shadow-gold-glow);
    background: var(--surface-primary);
}

/* Select dropdown */
select.form-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a8a86' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
}
select.form-field option {
    background: var(--surface-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}
html.dark select.form-field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6560' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Textarea */
textarea.form-field {
    resize: vertical; min-height: 90px;
    line-height: 1.6;
}

/* Read-only / PK field */
.form-field.readonly {
    background: var(--surface-secondary);
    opacity: 0.55; cursor: not-allowed;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.78rem; letter-spacing: 0.01em;
}

/* --- Premium Checkbox/Toggle --- */
.form-toggle-group {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.35rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    transition: all var(--dur-fast) ease;
    cursor: pointer;
}
.form-toggle-group:hover {
    border-color: var(--border-gold);
    background: color-mix(in srgb, var(--surface-secondary) 90%, var(--gold-subtle));
}
.form-toggle {
    position: relative;
    width: 40px; height: 22px;
    flex-shrink: 0;
}
.form-toggle input {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.form-toggle-track {
    position: absolute; inset: 0;
    background: var(--border-default);
    border-radius: var(--radius-full);
    transition: all var(--dur-fast) ease;
    cursor: pointer;
}
.form-toggle-track::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform var(--dur-fast) var(--ease-out);
}
.form-toggle input:checked + .form-toggle-track {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}
.form-toggle input:checked + .form-toggle-track::after {
    transform: translateX(18px);
}
.form-toggle input:focus + .form-toggle-track {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.form-toggle-label {
    font-size: 0.85rem; color: var(--text-secondary);
    font-weight: 450; user-select: none; cursor: pointer;
}
.form-toggle input:checked ~ .form-toggle-label {
    color: var(--text-primary);
}

/* --- Action Bar --- */
.form-actions {
    display: flex; align-items: center; gap: 1rem;
    padding-top: 1.75rem; margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}
.form-actions .btn-gold {
    padding: 0.75rem 2.25rem;
    font-size: 0.92rem; font-weight: 600;
}
.form-actions .btn-gold svg {
    width: 18px; height: 18px;
}
.btn-cancel {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full); font-size: 0.85rem;
    font-weight: 450; cursor: pointer; text-decoration: none;
    transition: all var(--dur-fast) ease; font-family: inherit;
}
.btn-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
    background: var(--surface-secondary);
}

/* --- Sidebar --- */
.form-sidebar { position: sticky; top: calc(var(--header-h) + 2rem); }
.form-sidebar-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 1.25rem;
}
.form-sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 0.6rem;
}
.form-sidebar-icon {
    width: 28px; height: 28px;
    border-radius: var(--radius-xs);
    background: var(--gold-subtle);
    border: 1px solid var(--border-gold);
    display: flex; align-items: center; justify-content: center;
}
.form-sidebar-icon svg {
    width: 14px; height: 14px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.form-sidebar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.form-sidebar-body { padding: 1.25rem; }

/* Sidebar stat items */
.form-info-item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-default);
}
.form-info-item:last-child { border-bottom: none; }
.form-info-dot {
    width: 6px; height: 6px;
    border-radius: var(--radius-full);
    background: var(--gold); flex-shrink: 0;
    opacity: 0.5;
}
.form-info-label {
    font-size: 0.75rem; color: var(--text-muted);
    flex: 1;
}
.form-info-value {
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-primary);
}

/* Sidebar tips */
.form-tips { padding: 0; margin: 0; list-style: none; }
.form-tips li {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.45rem 0;
    font-size: 0.75rem; color: var(--text-muted);
    line-height: 1.45;
}
.form-tips li::before {
    content: '\2727'; color: var(--gold); flex-shrink: 0;
    margin-top: 1px; font-size: 0.8rem;
}

/* Sidebar keyboard shortcut hints */
.form-shortcut {
    display: inline-flex; align-items: center;
    padding: 0.1rem 0.35rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-default);
    border-radius: 3px;
    font-size: 0.6rem; font-weight: 600;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    line-height: 1.4;
}

/* --- Validation --- */
.form-group.has-error .form-field {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(139, 58, 58, 0.1);
}
.form-group.has-error .form-field-label {
    color: var(--danger);
}
.form-error-text {
    font-size: 0.7rem; color: var(--danger);
    margin-top: 0.3rem; display: flex;
    align-items: center; gap: 0.3rem;
}
@keyframes formShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
.form-group.shake { animation: formShake 0.4s ease; }

/* --- Toast (reused from list page) --- */
.form-toast {
    padding: 0.8rem 1.15rem; border-radius: var(--radius-md);
    margin-bottom: 1.15rem; display: flex; align-items: center;
    gap: 0.65rem; animation: fadeInUp 0.4s var(--ease-out) both;
    border: 1px solid;
}
.form-toast svg {
    width: 17px; height: 17px; stroke: currentColor;
    stroke-width: 2; fill: none; flex-shrink: 0;
}
.form-toast-text { flex: 1; font-size: 0.85rem; font-weight: 450; }
.form-toast-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.4; padding: 0.2rem;
    transition: opacity var(--dur-fast) ease;
}
.form-toast-close:hover { opacity: 1; }
.form-toast.success {
    background: rgba(74, 124, 89, 0.07);
    border-color: rgba(74, 124, 89, 0.2); color: var(--success);
}
.form-toast.error {
    background: rgba(139, 58, 58, 0.07);
    border-color: rgba(139, 58, 58, 0.2); color: var(--danger);
}

/* --- Section Animations --- */
@keyframes formSectionIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.form-section {
    animation: formSectionIn 0.5s var(--ease-out) both;
}
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }
.form-section:nth-child(4) { animation-delay: 0.26s; }
.form-section:nth-child(5) { animation-delay: 0.33s; }
.form-section:nth-child(6) { animation-delay: 0.40s; }

/* --- Form Responsive --- */
@media (max-width: 1100px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
    .form-sidebar { position: static; order: -1; }
}
@media (max-width: 768px) {
    .form-hero-content { flex-direction: column; align-items: flex-start; }
    .form-title { font-size: 1.65rem; }
    .form-card-body { padding: 1.25rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn-gold,
    .form-actions .btn-cancel { justify-content: center; }
}

/* ==========================================================================
   18. DETAILS PAGE — Premium Readonly Entity View
   ========================================================================== */

/* --- Details Layout --- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.75rem;
    align-items: start;
}

/* --- Hero / Cover Banner --- */
.detail-hero {
    background: linear-gradient(135deg, var(--burgundy-deep) 0%, var(--burgundy) 50%, var(--burgundy-light) 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.75rem 2.25rem;
    color: var(--text-inverse);
    position: relative; overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.75rem;
}
.detail-hero::before {
    content: '';
    position: absolute; top: -50%; right: -15%;
    width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.detail-hero::after {
    content: '';
    position: absolute; bottom: -40%; left: -8%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.detail-hero-inner { position: relative; z-index: 1; }
.detail-hero-breadcrumb {
    font-size: 0.62rem; text-transform: uppercase;
    letter-spacing: 0.14em; font-weight: 600;
    color: rgba(245, 232, 211, 0.45);
    margin-bottom: 1rem; display: block;
}
.detail-hero-breadcrumb a {
    color: rgba(245, 232, 211, 0.55);
    text-decoration: none; transition: color var(--dur-fast) ease;
}
.detail-hero-breadcrumb a:hover { color: var(--gold); }
.detail-hero-top {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 1.5rem;
    flex-wrap: wrap;
}
.detail-hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem; font-weight: 500;
    color: #fff; margin: 0 0 0.4rem; line-height: 1.1;
    letter-spacing: -0.01em;
}
.detail-hero-subtitle {
    display: flex; align-items: center; gap: 0.6rem;
    flex-wrap: wrap;
}
.detail-hero-type-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    padding: 0.25rem 0.7rem; border-radius: var(--radius-full);
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold);
}
.detail-hero-meta {
    font-size: 0.8rem; color: rgba(245, 232, 211, 0.55);
    display: flex; align-items: center; gap: 0.35rem;
}
.detail-hero-meta-sep {
    width: 3px; height: 3px; border-radius: 50%;
    background: rgba(245, 232, 211, 0.3); flex-shrink: 0;
}
.detail-hero-actions {
    display: flex; align-items: center; gap: 0.5rem;
    flex-shrink: 0;
}
.detail-hero-stat-row {
    display: flex; gap: 1.5rem; margin-top: 1.35rem;
    flex-wrap: wrap;
}
.detail-hero-stat {
    display: flex; flex-direction: column;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: var(--radius-sm);
    min-width: 90px;
}
.detail-hero-stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem; font-weight: 700;
    color: var(--gold); line-height: 1;
}
.detail-hero-stat-label {
    font-size: 0.58rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(245, 232, 211, 0.45);
    margin-top: 3px;
}

/* --- Detail Main Content --- */
.detail-main { min-width: 0; }

/* --- Detail Section (reuses form-section-header styling) --- */
.detail-section { margin-bottom: 1.75rem; }
.detail-section-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.15rem; padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}
.detail-section-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 50px; height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
.detail-section-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--gold-subtle);
    border: 1px solid var(--border-gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.detail-section-icon svg {
    width: 16px; height: 16px;
    stroke: var(--gold); stroke-width: 1.75; fill: none;
}
.detail-section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem; font-weight: 600;
    color: var(--text-primary); margin: 0;
}
.detail-section-count {
    font-size: 0.65rem; font-weight: 500;
    color: var(--text-muted); margin-left: auto;
}

/* --- Key-Value Property Display --- */
.detail-props-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; position: relative;
}
.detail-props-card::before {
    content: ''; position: absolute; inset: 0;
    border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
}
.detail-props-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    position: relative;
}
.detail-prop {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-default);
    transition: background var(--dur-fast) ease;
}
.detail-prop:hover { background: var(--gold-subtle); }
.detail-props-grid .detail-prop:nth-child(odd) {
    border-right: 1px solid var(--border-default);
}
/* Remove bottom border on last row */
.detail-props-grid .detail-prop:nth-last-child(1),
.detail-props-grid .detail-prop:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}
.detail-prop.full-width {
    grid-column: 1 / -1;
    border-right: none !important;
}
.detail-prop-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.84rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-bottom: 0.25rem;
    line-height: 1;
}
.detail-prop-value {
    font-size: 0.9rem; color: var(--text-primary);
    font-weight: 450; word-break: break-word;
}
.detail-prop-value.mono {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.72rem; color: var(--text-muted);
    background: var(--surface-secondary); padding: 0.15rem 0.45rem;
    border-radius: var(--radius-xs); display: inline-block;
}
.detail-prop-value.null {
    color: var(--text-muted); font-style: italic; font-size: 0.82rem;
}
.detail-prop-value .detail-bool {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.detail-bool::before {
    content: ''; width: 7px; height: 7px;
    border-radius: var(--radius-full);
}
.detail-bool.yes { color: var(--success); }
.detail-bool.yes::before { background: var(--success); }
.detail-bool.no { color: var(--text-muted); }
.detail-bool.no::before { background: var(--text-muted); }
.detail-prop-value .detail-enum-badge {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.55rem; border-radius: var(--radius-full);
    background: var(--gold-subtle); color: var(--gold);
    border: 1px solid var(--border-gold);
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* --- Reference Navigation Cards --- */
.detail-ref-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.detail-ref-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    position: relative; overflow: hidden;
    text-decoration: none; display: block;
    transition: all var(--dur-normal) var(--ease-out);
}
.detail-ref-card::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-bright));
    transform: scaleY(0);
    transition: transform var(--dur-fast) var(--ease-out);
    border-radius: 0 2px 2px 0;
}
.detail-ref-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-gold-glow);
    border-color: rgba(212, 175, 55, 0.3);
}
.detail-ref-card:hover::before { transform: scaleY(1); }
.detail-ref-card-header {
    display: flex; align-items: center;
    justify-content: space-between; gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.detail-ref-card-name {
    font-weight: 600; font-size: 0.92rem;
    color: var(--text-primary);
    transition: color var(--dur-fast) ease;
}
.detail-ref-card:hover .detail-ref-card-name { color: var(--gold); }
.detail-ref-card-type {
    font-size: 0.55rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem; border-radius: var(--radius-full);
    background: var(--burgundy-subtle); color: var(--burgundy-light);
    border: 1px solid var(--border-default);
    flex-shrink: 0;
}
html.dark .detail-ref-card-type {
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-muted);
    border-color: var(--border-gold);
}
.detail-ref-card-preview {
    display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem;
}
.detail-ref-card-field {
    font-size: 0.72rem; color: var(--text-muted);
    line-height: 1.6;
}
.detail-ref-card-field strong {
    color: var(--text-secondary); font-weight: 600;
}
.detail-ref-card-arrow {
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%) translateX(-4px);
    opacity: 0; transition: all var(--dur-fast) ease;
    color: var(--gold); font-size: 0.85rem;
}
.detail-ref-card:hover .detail-ref-card-arrow {
    opacity: 0.7; transform: translateY(-50%) translateX(0);
}
.detail-ref-null {
    padding: 0.75rem 1rem;
    color: var(--text-muted); font-style: italic;
    font-size: 0.82rem;
}

/* --- Collection Tables --- */
.detail-coll-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; position: relative;
    margin-bottom: 0;
}
.detail-coll-card::before {
    content: ''; position: absolute; inset: 0;
    border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
}
.detail-coll-empty {
    padding: 2.5rem 1.5rem; text-align: center;
    position: relative;
}
.detail-coll-empty-icon {
    font-size: 2rem; color: var(--gold); opacity: 0.25;
    font-family: 'Cormorant Garamond', serif; margin-bottom: 0.5rem;
}
.detail-coll-empty p {
    font-size: 0.82rem; color: var(--text-muted);
    font-style: italic; margin: 0;
}

/* --- Detail Sidebar --- */
.detail-sidebar { position: sticky; top: calc(var(--header-h) + 2rem); }

/* --- Toast (shared pattern) --- */
.detail-toast {
    padding: 0.8rem 1.15rem; border-radius: var(--radius-md);
    margin-bottom: 1.15rem; display: flex; align-items: center;
    gap: 0.65rem; animation: fadeInUp 0.4s var(--ease-out) both;
    border: 1px solid;
}
.detail-toast svg {
    width: 17px; height: 17px; stroke: currentColor;
    stroke-width: 2; fill: none; flex-shrink: 0;
}
.detail-toast-text { flex: 1; font-size: 0.85rem; font-weight: 450; }
.detail-toast-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.4; padding: 0.2rem;
    transition: opacity var(--dur-fast) ease;
}
.detail-toast-close:hover { opacity: 1; }
.detail-toast.success {
    background: rgba(74, 124, 89, 0.07);
    border-color: rgba(74, 124, 89, 0.2); color: var(--success);
}
.detail-toast.error {
    background: rgba(139, 58, 58, 0.07);
    border-color: rgba(139, 58, 58, 0.2); color: var(--danger);
}

/* --- Section Animations --- */
@keyframes detailSectionIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.detail-section {
    animation: detailSectionIn 0.5s var(--ease-out) both;
}
.detail-section:nth-child(1) { animation-delay: 0.05s; }
.detail-section:nth-child(2) { animation-delay: 0.12s; }
.detail-section:nth-child(3) { animation-delay: 0.19s; }
.detail-section:nth-child(4) { animation-delay: 0.26s; }
.detail-section:nth-child(5) { animation-delay: 0.33s; }
.detail-section:nth-child(6) { animation-delay: 0.40s; }
.detail-section:nth-child(7) { animation-delay: 0.47s; }
.detail-section:nth-child(8) { animation-delay: 0.54s; }

/* --- Details Responsive --- */
@media (max-width: 1100px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .detail-ref-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .detail-hero { padding: 1.75rem; border-radius: var(--radius-lg); }
    .detail-hero-title { font-size: 1.85rem; }
    .detail-hero-top { flex-direction: column; }
    .detail-hero-actions { width: 100%; }
    .detail-hero-stat-row { gap: 0.75rem; }
    .detail-hero-stat { min-width: 75px; padding: 0.45rem 0.75rem; }
    .detail-props-grid { grid-template-columns: 1fr; }
    .detail-props-grid .detail-prop:nth-child(odd) { border-right: none; }
    .detail-ref-grid { grid-template-columns: 1fr; }
    .list-table tbody td,
    .list-table thead th { font-size: 0.75rem; padding: 0.5rem 0.75rem; }
}
