:root {
    /* Layout & Structure */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Variable Default Fallbacks (will be overridden by themes) */
    --bg-dark: #0f1115;
    --bg-surface: #16191e;
    --bg-card: rgba(22, 25, 30, 0.7);
    --bg-sidebar: #0f1115;
    --primary: var(--primary);
    --primary-light: #e6c152;
    --primary-rgb: var(--primary-rgb);
    --accent: var(--danger);
    --accent-rgb: 255, 77, 77;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(var(--white-rgb), 0.08);
    --glass-bg: rgba(var(--white-rgb), 0.03);
    --glass-border: rgba(var(--white-rgb), 0.1);
    --calendar-filter: invert(1) brightness(1.2);
    
    /* Shadow tokens */
    --card-shadow: 0 10px 30px -10px rgba(var(--black-rgb),0.5);
    --card-hover-shadow: 0 15px 40px -10px rgba(var(--black-rgb),0.6);

    /* Helper Colors */
    --success: var(--success);
    --warning: var(--warning);
    --danger: var(--danger);
    --info: var(--info);
    --white: #ffffff;
    --white-rgb: 255, 255, 255;
    --black: #000000;
    --black-rgb: 0, 0, 0;
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6, .stat-value-premium {
    font-family: 'Outfit', sans-serif;
}

/* --- App Skeleton & Layout --- */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-dark);
    position: relative;
    transition: var(--transition);
}

.page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    -webkit-overflow-scrolling: touch;
}

.page-header {
    margin-bottom: 40px !important;
}

.page-header h2 {
    color: var(--primary) !important;
    font-weight: 800 !important;
}

.section-full-width {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 3.5rem !important;
    margin-bottom: 3rem;
    width: 100%;
    box-shadow: var(--card-shadow);
}

/* --- Generic Components --- */

/* Glassmorphism */
.glassmorphism {
    background: var(--glass-bg, rgba(15, 17, 21, 0.45)) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border, rgba(var(--white-rgb), 0.1)) !important;
    box-shadow: 0 8px 32px 0 rgba(var(--black-rgb), 0.37);
}

/* Cards */
.card {
    margin-bottom: 24px !important;
}

.item-grid-card {
    text-decoration: none;
    border-radius: 20px;
    background: rgba(var(--black-rgb),0.2);
    border: 1px solid var(--border);
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
}

.item-grid-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-5px);
    background: rgba(var(--primary-rgb), 0.05) !important;
    box-shadow: 0 10px 30px rgba(var(--black-rgb),0.3);
}

/* Info Blocks */
.info-block {
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
}

.info-block:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

/* Icon Boxes */
.icon-circle-box {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(var(--black-rgb),0.1);
    border: 1px solid var(--border);
}

.icon-circle-box-sm {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon-box {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    border-radius: 16px;
    background: rgba(var(--primary-rgb), 0.12) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--primary);
    flex-shrink: 0;
    margin-right: 4px;
    transition: var(--transition, all 0.3s ease);
}

.header-icon-box.sm { width: 40px; height: 40px; border-radius: 10px; }
.header-icon-box.md { width: 52px; height: 52px; border-radius: 16px; }
.header-icon-box.lg { width: 80px; height: 80px; border-radius: 24px; }

/* Timeline */
.timeline-container {
    position: relative;
    padding-left: 50px;
}

.timeline-line {
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
}

.timeline-marker {
    position: absolute;
    left: -47px;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 6px solid var(--bg-card);
    z-index: 2;
    box-shadow: 0 0 15px rgba(var(--black-rgb),0.2);
}

.timeline-item-card {
    background: rgba(var(--white-rgb),0.02);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 16px;
    transition: var(--transition);
}

.timeline-item-card:hover {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.02) !important;
}

/* Badges & Overlays */
.badge-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

.status-badge-premium {
    color: var(--text-on-primary);
    padding: 6px 15px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 10px;
    box-shadow: 0 4px 10px rgba(var(--black-rgb),0.2);
}

/* Search Box Generic */
.search-input-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 15px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    width: 100%;
}

.search-input-box .form-control {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 10px 0 !important;
    flex: 1;
    margin: 0 !important;
}

/* Action Dropdown Portal */
#action-dropdown-portal {
    position: fixed;
    z-index: 999999;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(var(--black-rgb),0.4);
    min-width: 190px;
    display: none;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

#action-dropdown-portal.show {
    display: block;
}

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

#action-dropdown-portal a, 
#action-dropdown-portal button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    text-decoration: none;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    transition: 0.15s;
    cursor: pointer;
}

#action-dropdown-portal a:last-child, 
#action-dropdown-portal button:last-child {
    border-bottom: none;
}

#action-dropdown-portal a:hover, 
#action-dropdown-portal button:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

#action-dropdown-portal a.text-danger:hover, 
#action-dropdown-portal button.text-danger:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--danger);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Scrollbar customization --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.3);
}

/* --- TICKER (MARQUEE) --- */
.ticker-wrapper {
    width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    position: relative !important;
    padding: 12px 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
}

.ticker-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: 100% !important;
    animation: ticker-loop 40s linear infinite !important;
}

.ticker-item {
    padding: 0 40px !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

@keyframes ticker-loop {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.ticker-wrapper:hover .ticker-content {
    animation-play-state: paused !important;
}

/* Dashboard Specific Helpers */
.label-caps-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--primary);
}

.company-logo-dashboard {
    width: 65px;
    height: 65px;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.next-event-card-premium {
    margin-top: 20px;
    background: rgba(var(--primary-rgb), 0.03);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.next-event-card-premium:hover {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: var(--primary);
}

.icon-box-bell {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .page-content-wrapper {
        padding: 20px 15px !important;
    }
    
    .card, .section-full-width {
        margin-left: 4px !important;
        margin-right: 4px !important;
        border-radius: 16px !important;
        width: calc(100% - 8px) !important;
    }
    
    .section-full-width {
        padding: 1.5rem !important;
    }
    
    .main-content {
        width: 100%;
        overflow-x: hidden;
    }
}

