:root {
    /* Color Palette - Modern & Vibrant */
    --primary-50: hsl(220, 100%, 97%);
    --primary-100: hsl(220, 95%, 92%);
    --primary-200: hsl(220, 90%, 85%);
    --primary-300: hsl(220, 85%, 75%);
    --primary-400: hsl(220, 80%, 65%);
    --primary-500: hsl(220, 75%, 55%);
    --primary-600: hsl(220, 70%, 45%);
    --primary-700: hsl(220, 65%, 35%);
    --primary-800: hsl(220, 60%, 25%);
    --primary-900: hsl(220, 55%, 15%);

    /* Accent Colors */
    --accent-blue: hsl(210, 100%, 60%);
    --accent-purple: hsl(270, 80%, 65%);
    --accent-green: hsl(150, 70%, 55%);
    --accent-orange: hsl(30, 95%, 60%);
    --accent-red: hsl(0, 85%, 60%);

    /* Status Colors */
    --status-success: hsl(150, 70%, 55%);
    --status-warning: hsl(40, 95%, 60%);
    --status-error: hsl(0, 85%, 60%);
    --status-info: hsl(210, 100%, 60%);

    /* Neutral Colors */
    --gray-50: hsl(220, 20%, 98%);
    --gray-100: hsl(220, 15%, 95%);
    --gray-200: hsl(220, 13%, 90%);
    --gray-300: hsl(220, 12%, 80%);
    --gray-400: hsl(220, 10%, 60%);
    --gray-500: hsl(220, 8%, 45%);
    --gray-600: hsl(220, 10%, 35%);
    --gray-700: hsl(220, 12%, 25%);
    --gray-800: hsl(220, 15%, 15%);
    --gray-900: hsl(220, 18%, 10%);

    /* Background */
    --bg-primary: hsl(220, 25%, 97%);
    --bg-secondary: hsl(220, 20%, 100%);
    --bg-tertiary: hsl(220, 15%, 95%);

    /* Text */
    --text-primary: hsl(220, 20%, 15%);
    --text-secondary: hsl(220, 10%, 40%);
    --text-tertiary: hsl(220, 8%, 60%);

    /* Borders */
    --border-light: hsl(220, 15%, 90%);
    --border-medium: hsl(220, 12%, 80%);
    --border-dark: hsl(220, 10%, 70%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-primary: hsl(220, 18%, 10%);
    --bg-secondary: hsl(220, 15%, 15%);
    --bg-tertiary: hsl(220, 12%, 20%);

    --text-primary: hsl(220, 20%, 95%);
    --text-secondary: hsl(220, 10%, 75%);
    --text-tertiary: hsl(220, 8%, 55%);

    --border-light: hsl(220, 15%, 20%);
    --border-medium: hsl(220, 12%, 25%);
    --border-dark: hsl(220, 10%, 35%);

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

body {
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.sidebar,
.main-content,
.card,
.stat-card,
.btn,
.nav-item,
.table,
.input,
.select,
.textarea {
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease, color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    flex: 1;
}

.logo-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    line-height: 1.2;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) var(--space-sm);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-icon {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: var(--space-lg) var(--space-sm);
    border-top: 1px solid var(--border-light);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--space-2xl);
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-success {
    background: var(--status-success);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--status-error);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

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

.card-header {
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--accent-blue);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.stat-change {
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-change.positive {
    color: var(--status-success);
}

.stat-change.negative {
    color: var(--status-error);
}

/* Table */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background 0.2s ease;
}

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

.personnel-row {
    cursor: pointer;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.badge-success {
    background: hsla(150, 70%, 55%, 0.1);
    color: var(--status-success);
}

.badge-warning {
    background: hsla(40, 95%, 60%, 0.1);
    color: var(--status-warning);
}

.badge-error {
    background: hsla(0, 85%, 60%, 0.1);
    color: var(--status-error);
}

.badge-info {
    background: hsla(210, 100%, 60%, 0.1);
    color: var(--status-info);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: white;
    flex-shrink: 0;
}

/* Input */
.input {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px hsla(210, 100%, 60%, 0.1);
}

.input::placeholder {
    color: var(--text-tertiary);
}

/* Select */
.select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px hsla(210, 100%, 60%, 0.1);
}

/* Textarea */
.textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px hsla(210, 100%, 60%, 0.1);
}

/* Form Group */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
        padding: var(--space-lg);
    }

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

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.theme-switcher:hover {
    transform: scale(1.1);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-lg);
}

/* Premium Layout Improvements */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: var(--space-xl);
    margin: var(--space-2xl) 0 var(--space-3xl);
    padding: 0 var(--space-md);
}

.podium-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    flex: 1;
    max-width: 280px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-xl);
}

.podium-card.first {
    height: 420px;
    order: 2;
    z-index: 2;
    background: linear-gradient(180deg, hsla(45, 100%, 50%, 0.1) 0%, var(--bg-secondary) 100%);
    border: 1px solid hsla(45, 100%, 50%, 0.3);
}

.podium-card.second {
    height: 360px;
    order: 1;
    z-index: 1;
    background: linear-gradient(180deg, hsla(0, 0%, 75%, 0.1) 0%, var(--bg-secondary) 100%);
    border: 1px solid hsla(0, 0%, 75%, 0.3);
}

.podium-card.third {
    height: 320px;
    order: 3;
    z-index: 1;
    background: linear-gradient(180deg, hsla(30, 60%, 50%, 0.1) 0%, var(--bg-secondary) 100%);
    border: 1px solid hsla(30, 60%, 50%, 0.3);
}

.podium-medal {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.podium-avatar {
    width: 90px !important;
    height: 90px !important;
    font-size: 2.2rem !important;
    margin: 0 auto var(--space-lg);
    border: 4px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.podium-name {
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-stats {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
}

.podium-rank {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 4px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.podium-card.first .podium-rank {
    color: #FFD700;
    border-color: #FFD700;
}

.podium-card.second .podium-rank {
    color: #C0C0C0;
    border-color: #C0C0C0;
}

.podium-card.third .podium-rank {
    color: #CD7F32;
    border-color: #CD7F32;
}

.personnel-list-item {
    transition: all 0.2s ease;
}

.personnel-list-item:hover {
    background: var(--bg-tertiary);
    padding-left: var(--space-xl);
}