/* =========================================================
   PODIUM DESIGN SYSTEM v2.0
   A modern, polished design for Taylor Insurance Services
   ========================================================= */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors - TIS Navy */
    --primary: #1B3A6D;
    --primary-light: #264A85;
    --primary-dark: #122647;
    
    /* Accent Colors - TIS Gold */
    --accent: #C9A227;
    --accent-light: #D4B23A;
    --accent-dark: #B8931F;
    --accent-glow: rgba(201, 162, 39, 0.25);
    
    /* Status Colors */
    --success: #10B981;
    --success-light: #34D399;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #F87171;
    --danger-bg: #FEF2F2;
    --info: #3B82F6;
    --info-light: #60A5FA;
    --info-bg: #EFF6FF;
    
    /* Neutral Colors - ENHANCED CONTRAST */
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #334155;  /* Darkened from #475569 for better readability */
    --text-muted: #64748B;      /* Darkened from #94A3B8 for better readability */
    --text-inverse: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-focus: #C9A227;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-full: 9999px;
    
    /* Shadows - Enhanced depth system */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
    --shadow-inner: inset 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 20px rgba(0, 191, 166, 0.15);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-card-hover: 0 10px 40px -10px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Gradients - TIS Brand */
    --gradient-primary: linear-gradient(135deg, #1B3A6D 0%, #264A85 100%);
    --gradient-accent: linear-gradient(135deg, #C9A227 0%, #D4B23A 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    --gradient-blue: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --gradient-pink: linear-gradient(135deg, #EC4899 0%, #F472B6 100%);
    --gradient-dark: linear-gradient(180deg, rgba(12, 32, 63, 0.98) 0%, rgba(12, 32, 63, 1) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --gradient-subtle: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== TYPOGRAPHY - ENHANCED READABILITY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.9rem; font-weight: 600; }

p { 
    color: var(--text-secondary); 
    font-size: 0.95rem;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ===== SIDEBAR - POLISHED ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gradient-primary);
    color: var(--text-inverse);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), width var(--transition-slow);
    box-shadow: 4px 0 24px rgba(12, 32, 63, 0.15);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 191, 166, 0.3);
}

.sidebar-logo svg {
    width: 20px;
    height: 20px;
    color: white;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 16px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--border-radius);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 191, 166, 0.2) 0%, rgba(0, 191, 166, 0.05) 100%);
    color: white;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 191, 166, 0.25);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
    background: var(--bg-primary);
}

/* ===== HEADER ===== */
.main-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

/* ===== CARDS - ENHANCED ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient-subtle);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .icon {
    font-size: 1.1rem;
}

.card-body {
    padding: 24px;
}

/* Card variants */
.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== STAT CARDS - ENHANCED ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-value.accent { color: var(--accent-dark); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: #B45309; }  /* Darker warning for better contrast */
.stat-value.danger { color: var(--danger); }

.stat-change {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive { color: #059669; }  /* Darker green for contrast */
.stat-change.negative { color: var(--danger); }

/* ===== BUTTONS - POLISHED ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 191, 166, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 191, 166, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-outline:hover {
    background: rgba(0, 191, 166, 0.08);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.badge-accent {
    background: rgba(0, 191, 166, 0.12);
    color: var(--accent-dark);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #B45309;
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: #1D4ED8;
}

.badge-neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Stage badges */
.stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.stage-badge.discovery { background: #E0E7FF; color: #3730A3; }
.stage-badge.quoting { background: #FEF3C7; color: #92400E; }
.stage-badge.proposal { background: #DBEAFE; color: #1E40AF; }
.stage-badge.negotiating { background: #FCE7F3; color: #9D174D; }
.stage-badge.verbal { background: #D1FAE5; color: #065F46; }
.stage-badge.won { background: #10B981; color: white; }
.stage-badge.lost { background: #FEE2E2; color: #B91C1C; }

/* Product badges */
.product-badge {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.product-badge.spectrum { background: #DBEAFE; color: #1E40AF; }
.product-badge.voluntary { background: #F3E8FF; color: #6D28D9; }

/* ===== DATA TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.data-table th {
    text-align: left;
    padding: 14px 18px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

/* ===== PROGRESS BARS ===== */
.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--border-radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.green { background: var(--gradient-success); }
.progress-fill.yellow { background: var(--gradient-warning); }
.progress-fill.red { background: var(--gradient-danger); }
.progress-fill.accent { background: var(--gradient-accent); }

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    border-left: 4px solid var(--accent);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
    animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    animation: modal-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

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

/* ===== PREVIEW BANNER ===== */
.preview-banner {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.preview-icon {
    font-size: 1.1rem;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gradient-primary);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(0, 191, 166, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.login-screen::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 191, 166, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo img {
    height: 48px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 14px 18px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== SECTION CONTENT ===== */
.section-content {
    display: none;
    animation: section-fade-in 0.35s ease;
}

.section-content.active {
    display: block;
}

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

/* ===== RESOURCE CARDS ===== */
.resource-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.resource-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
}

.resource-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.resource-desc {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
    display: none;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .main-header {
        padding: 0 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px 20px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .card-header .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .btn {
        padding: 12px 18px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* ===== UTILITY CLASSES ===== */
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-accent { background: var(--accent) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-full { border-radius: var(--border-radius-full) !important; }

.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }
.gap-3 { gap: 24px !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

.hidden { display: none !important; }
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* ===== SVG ICONS (Heroicons) ===== */
.icon-svg {
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    flex-shrink: 0;
}

.icon-svg.icon-sm {
    width: 1em;
    height: 1em;
}

.icon-svg.icon-lg {
    width: 1.5em;
    height: 1.5em;
}

/* Icon color utilities */
.icon-accent { color: var(--accent); }
.icon-success { color: var(--success); }
.icon-warning { color: var(--warning); }
.icon-danger { color: var(--danger); }
.icon-info { color: var(--info); }
.icon-muted { color: var(--text-muted); }
