/* ==========================================================================
   ENTERPRISE DASHBOARD DESIGN SYSTEM - ADBACADABRA LIVE EVENT HUB
   ========================================================================== */

:root {
    /* Color Palette - Dark Slate & Deep Navy Theme */
    --bg-body: #090e17;
    --bg-sidebar: #060a10;
    --bg-topbar: rgba(9, 14, 23, 0.92);
    --bg-card: #111a28;
    --bg-card-hover: #152032;
    --bg-surface: #162235;
    --bg-surface-soft: #1c2b42;
    --bg-surface-hover: #22344f;
    
    /* Legacy aliases for backwards compatibility */
    --ink: #060a10;
    --ink-soft: #162235;
    --paper: #090e17;
    --card: #111a28;
    --surface-soft: #1c2b42;
    --line: #1e2c3f;
    
    /* Borders & Dividers */
    --border-color: #1e2c3f;
    --border-subtle: #152233;
    --border-focus: #38bdf8;
    
    /* Typography Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-subtle: #475569;
    
    /* Accents & Brand */
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --accent-hover: #0ea5e9;
    --accent-ink: #04121d;
    --accent-soft: rgba(56, 189, 248, 0.12);
    
    --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    
    /* State & Semantic Colors */
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --info: #0ea5e9;
    --info-soft: rgba(14, 165, 233, 0.15);

    /* Event & Stats Specific */
    --weekend: #f43f5e;
    --stat-confirmed: #f59e0b;
    --stat-done: #10b981;
    --stat-canceled: #ef4444;
    --heat-red: 239, 68, 68;
    --heat-yellow: 245, 158, 11;
    --heat-green: 16, 185, 129;

    /* Geometry & Effects */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px -4px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 36px -6px rgba(0,0,0,0.6);
    --shadow-dropdown: 0 20px 40px -8px rgba(0,0,0,0.7), 0 0 0 1px var(--border-color);

    /* Fonts */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.5;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--accent-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility */
.is-hidden { display: none !important; }

/* ==========================================================================
   APP SHELL & LAYOUT ARCHITECTURE
   ========================================================================== */
.app-layout, .app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-body);
}

/* ---------- SIDEBAR ---------- */
.app-sidebar, .sidebar {
    width: 260px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
    flex-shrink: 0;
}

.brand-icon {
    width: 20px;
    height: 20px;
}

.brand-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-tag {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-pro {
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.25);
    letter-spacing: 0.04em;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
}

.nav-group {
    margin-bottom: 22px;
}

.nav-group-title {
    display: block;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0 10px 6px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-link, .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}

.nav-link:hover, .nav-item:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.nav-link.is-active, .nav-item.is-active {
    background: var(--bg-surface);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.nav-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-chip {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-chip.is-live {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-sidebar);
    flex-shrink: 0;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.status-indicator.is-online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.btn-sidebar-collapse {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-sidebar-collapse:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}
.btn-sidebar-collapse svg {
    width: 14px;
    height: 14px;
}

/* Collapsed Sidebar State (Desktop) */
.sidebar-collapsed .app-sidebar {
    width: 76px;
}
.sidebar-collapsed .brand-info,
.sidebar-collapsed .badge-pro,
.sidebar-collapsed .nav-group-title,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-chip,
.sidebar-collapsed .sidebar-status {
    display: none;
}
.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}
.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}
.sidebar-collapsed .sidebar-footer {
    justify-content: center;
}
.sidebar-collapsed .btn-sidebar-collapse svg {
    transform: rotate(180deg);
}

/* Backdrop per mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.22s ease;
}

/* ==========================================================================
   APP MAIN & TOPBAR
   ========================================================================== */
.app-main, .main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-body);
}

/* ---------- TOPBAR ---------- */
.app-topbar {
    height: 68px;
    background: var(--bg-topbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.btn-icon-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px;
    color: var(--text-secondary);
    cursor: pointer;
}
.btn-icon-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.btn-icon-toggle svg {
    width: 20px;
    height: 20px;
}

.topbar-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    white-space: nowrap;
}

.crumb-root {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}
.crumb-root svg {
    width: 16px;
    height: 16px;
}
.crumb-root:hover {
    color: var(--accent);
}

.crumb-divider {
    color: var(--text-subtle);
    font-size: 0.75rem;
}

.crumb-category {
    color: var(--text-muted);
    font-weight: 500;
}

.crumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Topbar Center (Search) */
.topbar-center {
    flex: 1;
    max-width: 440px;
}

.topbar-search-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-search-input {
    width: 100%;
    padding: 8px 65px 8px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    transition: all 0.15s ease;
}

.topbar-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-surface);
}

.search-badge-kbd {
    position: absolute;
    right: 10px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    pointer-events: none;
}

/* Topbar Right & Dropdowns */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dropdown-wrap {
    position: relative;
}

.btn-topbar-action {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.btn-topbar-action:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-topbar-action svg {
    width: 18px;
    height: 18px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-body);
}

/* User Profile Button */
.btn-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-user-profile:hover {
    background: var(--bg-surface);
    border-color: var(--border-focus);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    position: relative;
}

.user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-card);
}

.user-meta-summary {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.68rem;
    color: var(--accent);
    font-weight: 500;
}

.chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* ==========================================================================
   DROPDOWNS & SELECT ELEMENTS (ENHANCED STYLING)
   ========================================================================== */

/* Enhanced Native <select> with Custom Modern SVG Chevron */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-card) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px 14px !important;
    padding-right: 38px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

select:hover {
    border-color: var(--accent) !important;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

select option {
    background-color: #111a28;
    color: #f1f5f9;
    padding: 10px;
}

/* Dropdown Menus (Header & Modals) */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dropdown);
    width: 280px;
    display: none;
    z-index: 120;
    animation: dropdown-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.dropdown-menu.is-open {
    display: block;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-title {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dropdown-tag {
    font-size: 0.68rem;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
    cursor: pointer;
}
.notif-item:hover {
    background: var(--bg-surface);
}
.notif-item.is-unread {
    background: rgba(56, 189, 248, 0.04);
}

.notif-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.notif-bullet.is-muted {
    background: var(--text-muted);
}

.notif-text {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* User Menu Details */
.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-surface);
}

.user-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.user-header-text {
    min-width: 0;
}

.user-full-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    margin: 2px 0 6px;
    font-size: 0.74rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

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

.dropdown-links {
    padding: 6px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.dropdown-link:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.dropdown-link svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.dropdown-link:hover svg {
    color: var(--accent);
}

.dropdown-link.is-logout {
    margin: 6px;
    color: var(--danger);
}
.dropdown-link.is-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.dropdown-link.is-logout svg {
    color: var(--danger);
}

/* Combobox (Searchable Select Dropdown) */
.combobox {
    position: relative;
    width: 100%;
}
.combobox input[type="text"] {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 14px 14px;
    color: var(--text-primary);
}
.combobox input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background-color: var(--bg-surface);
}
.combobox-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
    padding: 4px;
}
.combobox-list.is-open { display: block; }
.combobox-option {
    padding: 9px 12px;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all 0.12s ease;
}
.combobox-option:hover,
.combobox-option.is-highlighted {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}
.combobox-empty {
    padding: 12px 14px;
    font-size: 0.86rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- CONTENT WRAPPER ---------- */
.app-content {
    flex: 1;
    padding: 32px 40px 50px;
    max-width: 1750px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- FOOTER ---------- */
.app-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 500;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.footer-sep {
    color: var(--text-subtle);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-link:hover {
    color: var(--accent);
}

/* ==========================================================================
   PAGE ELEMENTS, HEADERS & PLACEHOLDERS
   ========================================================================== */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head-main {
    min-width: 0;
}

.page-eyebrow {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 6px;
    font-weight: 700;
}

.page-head h1, .main-content h1 {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Enterprise Placeholder */
.enterprise-placeholder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    text-align: center;
    max-width: 780px;
    margin: 30px auto;
    box-shadow: var(--shadow-md);
}

.placeholder-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}
.placeholder-icon-wrap svg {
    width: 32px;
    height: 32px;
}

.placeholder-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.placeholder-desc {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
    margin: 0 0 32px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.placeholder-feature {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.placeholder-feature strong {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.placeholder-feature span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-bottom: 6px;
}

.empty-state {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
}

/* ==========================================================================
   GESTIONALE CONCERTI & VIEWS COMPONENT STYLES
   ========================================================================== */

/* ---------- TABS PRINCIPALI ---------- */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 12px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.is-active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.tabs.is-locked .tab-btn {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.tab-panel {
    display: none;
}
.tab-panel.is-active {
    display: block;
    animation: tab-fade 0.18s ease;
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- TOOLBARS & BUTTONS ---------- */
.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Toolbar actions: always align right, even when left items are hidden (e.g. stats view) */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.search-input {
    min-width: 280px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: all 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-surface);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn-link {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}
.btn-link:hover {
    text-decoration: underline;
}

/* ---------- VIEW & YEAR BUTTON GROUPS ---------- */
.view-btn-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.view-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.view-btn + .view-btn { border-left: 1px solid var(--border-color); }
.view-btn:hover { color: var(--text-primary); background: var(--bg-surface); }
.view-btn.is-active { background: var(--accent); color: var(--accent-ink); }

.year-btn-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.year-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-muted);
    padding: 7px 11px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.year-btn + .year-btn { border-left: 1px solid var(--border-color); }
.year-btn:hover { color: var(--text-primary); background: var(--bg-surface); }
.year-btn.is-active { background: var(--accent); color: var(--accent-ink); }

/* ---------- STATUS BADGES ---------- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 600;
}
.badge-online { background: var(--success-soft); color: var(--success); }
.badge-upcoming { background: var(--accent-soft); color: var(--accent); }
.badge-expiring { background: var(--warning-soft); color: var(--warning); }
.badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-offline { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }

/* ---------- ACTION BUTTONS (TABLE ROWS) ---------- */
.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-text-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-text-action:hover {
    background: var(--bg-surface);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-text-action.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-text-action.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* ---------- DATA TABLES ---------- */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table thead {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 13px 18px;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
    background: var(--bg-surface);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.03);
}

.table-loading, .table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 36px 18px !important;
}

.col-actions {
    text-align: right;
}

/* Form inputs & selects within tables (Economics / Spese / Dynamic Rows) */
.data-table input[type="text"],
.data-table input[type="number"],
.data-table input[type="date"],
.data-table select {
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-card);
    color: var(--text-primary);
    width: 100%;
    max-width: 100%;
    transition: all 0.15s ease;
}

.data-table input[type="text"]:focus,
.data-table input[type="number"]:focus,
.data-table input[type="date"]:focus,
.data-table select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background-color: var(--bg-surface);
}

/* ---------- EDIT VIEW & SIDENAV FORM ---------- */
.edit-view {
    width: 100%;
}

.edit-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.edit-header h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.edit-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.edit-sidenav {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.edit-sidenav-item {
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.edit-sidenav-item:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.edit-sidenav-item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.edit-content {
    flex: 1;
    min-width: 0;
}

.edit-panel {
    display: none;
}
.edit-panel.is-active {
    display: block;
    animation: tab-fade 0.15s ease;
}

.edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ---------- FORMS & FIELDS ---------- */
.field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row {
    display: flex;
    gap: 16px;
}
.field-row .field {
    flex: 1;
}
.field-row .field-small {
    flex: 0 0 190px;
}

.field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-surface);
}

/* Dynamic Rows */
.dynamic-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.dynamic-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dynamic-row input[type="text"],
.dynamic-row select {
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
}

.dynamic-row input[type="text"]:focus,
.dynamic-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-row-remove {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-row-remove:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

/* Sostituti Groups */
.sostituti-group { margin-bottom: 22px; }
.sostituti-group:last-child { margin-bottom: 0; }

.sostituti-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.sostituti-group-title {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
}
.sostituti-group-empty {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0 0 10px;
}

/* Stato Presenze Buttons */
.stato-btn-group {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.stato-btn {
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 10px;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}
.stato-btn + .stato-btn { border-left: 1px solid var(--border-color); }
.stato-btn:hover:not(.is-active) { background: var(--bg-surface); color: var(--text-primary); }
.stato-btn.is-active { background: var(--accent); color: var(--accent-ink); }
.stato-btn.is-active[data-stato="attesa"] { background: var(--accent); color: var(--accent-ink); }
.stato-btn.is-active[data-stato="presente"] { background: var(--success); color: #042417; }
.stato-btn.is-active[data-stato="assente"] { background: #94a3b8; color: #0f172a; }
.stato-btn.is-active[data-stato="in_forse"] { background: var(--danger); color: #ffffff; }
.stato-btn.is-active[data-stato="sostituito"] { background: var(--warning); color: #351c00; }

.presenza-stato, .presenza-sostituto, .presenza-note {
    font-family: var(--font-body);
    font-size: 0.86rem;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    width: 100%;
    max-width: 220px;
}
.presenza-note { max-width: 340px; min-width: 220px; }
.presenza-stato:focus, .presenza-sostituto:focus, .presenza-note:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- ACCOUNTING & MOVIMENTI ---------- */
.accounting-toolbar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.accounting-toolbar h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0;
    color: var(--text-primary);
}
.accounting-toolbar #btn-new-movimento { margin-left: 0; }
.accounting-toolbar .accounting-summary { margin-left: auto; }

.accounting-summary {
    display: flex;
    align-items: center;
    gap: 28px;
}
.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.summary-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.summary-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.summary-value.is-positive { color: var(--success); }
.summary-value.is-negative { color: var(--danger); }

.amount-in { color: var(--success); font-weight: 600; }
.amount-out { color: var(--danger); font-weight: 600; }

/* ---------- MODALS (CENTRATO, 580px, BACKDROP NASCOSTO DI DEFAULT) ---------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 8, 15, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 250;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-dropdown);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}
.modal-head h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

/* ---------- TOAST NOTIFICATIONS ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 300;
    max-width: 360px;
    box-shadow: var(--shadow-dropdown);
}
.toast.is-error {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}
.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- CALENDARIO & STATISTICHE ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.month-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.month-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.month-count {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.month-day-label {
    text-align: center;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    padding: 8px 0 6px;
    background: var(--bg-surface-soft);
}

.day-cell {
    text-align: center;
    font-size: 0.78rem;
    padding: 7px 0;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: background 0.12s ease;
}
.day-cell.is-empty { color: transparent !important; background: var(--bg-card); }
.day-cell:not(.is-empty) { cursor: pointer; }
.day-cell:not(.is-empty):hover { background: var(--bg-surface); }
.day-cell.has-gig {
    background: var(--success-soft);
    color: var(--success);
    font-weight: 700;
}
.day-cell.has-gig:hover { background: var(--success); color: #042417; }

.month-grid > *:nth-child(7n+6):not(.has-gig),
.month-grid > *:nth-child(7n):not(.has-gig) {
    color: var(--weekend);
    font-weight: 700;
}

/* Tooltip Riepilogo Concerto */
.calendar-tooltip {
    position: fixed;
    z-index: 150;
    width: 260px;
    max-width: calc(100vw - 24px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 0.82rem;
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.calendar-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.tooltip-entry { padding: 8px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.tooltip-entry:hover { background: var(--bg-surface); }
.tooltip-entry + .tooltip-entry { border-top: 1px solid var(--border-subtle); margin-top: 6px; }
.tooltip-date {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 3px;
}
.tooltip-meta { display: block; color: var(--text-secondary); font-size: 0.76rem; line-height: 1.4; }

.tooltip-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.tooltip-action-btn {
    flex: 1;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}
.tooltip-action-btn.is-confirm { background: var(--success); color: #042417; }
.tooltip-action-btn.is-absent { background: var(--danger); }

/* Stats Table: Default header background aligned with all tables */
.stats-col-anno { width: 90px; }
.stats-head {
    text-align: center;
    font-weight: 700;
    background: var(--bg-surface) !important;
    color: var(--text-secondary) !important;
}

.stats-col-divider { border-left: 2px solid var(--border-color); }

.stats-table td { text-align: center; }
.stats-table td.stats-col-anno { text-align: left; font-weight: 700; }
.stats-table td.stats-col-divider { border-left: 2px solid var(--border-color); }

.stats-cell-confirmed { color: var(--stat-confirmed); font-weight: 700; }
.stats-cell-done { color: var(--stat-done); font-weight: 700; }

.stats-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border-color);
    background: var(--bg-surface);
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM
   ========================================================================== */
@media (max-width: 1200px) {
    .calendar-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-center { max-width: 320px; }
}

@media (max-width: 992px) {
    /* Mobile Sidebar Offcanvas */
    .btn-icon-toggle { display: flex; }
    .btn-sidebar-collapse { display: none; }
    
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 270px;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.6);
    }
    
    .sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
    }
    
    .sidebar-mobile-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    
    .app-topbar { padding: 0 20px; }
    .app-content { padding: 24px 20px 40px; }
    .placeholder-grid { grid-template-columns: 1fr; }
    
    .user-meta-summary { display: none; }
}

@media (max-width: 768px) {
    .topbar-center { display: none; }
    .app-topbar { height: 60px; }
    .page-head h1 { font-size: 1.5rem; }
    
    .calendar-grid { grid-template-columns: 1fr; }
    .field-row { flex-direction: column; }
    .edit-layout { flex-direction: column; }
    .edit-sidenav {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 12px;
        width: 100%;
    }
    .accounting-toolbar { flex-direction: column; align-items: flex-start; }
    .accounting-toolbar .accounting-summary { margin-left: 0; width: 100%; justify-content: space-between; }
}
