/**
 * GT7 League Manager - Main Design System Stylesheet
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #121216;
    --bg-panel: rgba(26, 26, 32, 0.85);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 24, 73, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-dim: #6b7280;
    
    --accent: #ff1849; /* GT Red */
    --accent-hover: #e00d3a;
    --accent-glow: rgba(255, 24, 73, 0.4);
    
    --cyan: #00e5ff;
    --cyan-glow: rgba(0, 229, 255, 0.4);
    
    --gold: #ffbe1a;
    --silver: #b5c1d6;
    --bronze: #cd7f32;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Orbitron', sans-serif;
    
    --sidebar-width: 260px;
    --header-height: 80px;
    --card-blur: blur(16px);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}
.font-secondary {
    font-family: var(--font-secondary);
    letter-spacing: 0.05em;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.pr-md { padding-right: 1.5rem; }
.mb-md { margin-bottom: 1rem; }
.ml-sm { margin-left: 0.5rem; }

/* Main Layout Structure */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

#content-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    background-color: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Sidebar Styling */
.sidebar-logo {
    padding: 0.75rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    min-height: 96px;
}
.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}
.sidebar-logo span {
    font-family: var(--font-secondary);
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    cursor: pointer;
}
.sidebar-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.sidebar-item a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}
.sidebar-item.active a {
    color: #fff;
    background-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
}

/* Header Content styling */
.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-title-wrapper {
    display: flex;
    flex-direction: column;
}
.header-pre {
    font-family: var(--font-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    font-weight: 700;
}
.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}
.active-season-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 24, 73, 0.1);
    border: 1px solid rgba(255, 24, 73, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Page Screen Container */
.screen {
    display: none;
    animation: fadeIn var(--transition-normal);
}
.screen.active {
    display: block;
}

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

/* Action Header */
.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.action-header h2 {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}
.btn-primary {
    background-color: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}
.btn-outline-primary {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}
.btn-outline-primary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(255, 24, 73, 0.05);
}
.btn-outline-danger {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}
.btn-outline-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}
.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Badge styling */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-secondary);
}
.badge.warning {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* Card & Panels */
.panel {
    background: var(--bg-panel);
    backdrop-filter: var(--card-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}
.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h4 {
    font-family: var(--font-secondary);
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05rem;
}
.panel-body {
    padding: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-panel);
    backdrop-filter: var(--card-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.card.active {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 24, 73, 0.15);
}
.season-card {
    cursor: pointer;
}
.card-ribbon {
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 0.65rem;
    font-weight: 900;
    padding: 0.25rem 2rem;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.card-header {
    margin-bottom: 1rem;
}
.card-subtitle {
    font-family: var(--font-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
}
.card-header h3 {
    font-size: 1.25rem;
    margin-top: 0.25rem;
}
.card-body {
    flex: 1;
}
.card-body p.description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Season Stats in card */
.season-stats {
    display: flex;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-item i {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}
.stat-val {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 0.95rem;
}
.stat-lbl {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Event Card Summaries */
.event-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.summary-item:last-child {
    border-bottom: none;
}
.summary-lbl {
    color: var(--text-secondary);
}
.summary-val {
    font-weight: 500;
}

/* Dashboard Summary Cards */
.dash-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.summary-icon.red {
    background: rgba(255, 24, 73, 0.1);
    color: var(--accent);
}
.summary-icon.cyan {
    background: rgba(0, 229, 255, 0.1);
    color: var(--cyan);
}
.summary-icon.gold {
    background: rgba(255, 190, 26, 0.1);
    color: var(--gold);
}
.summary-details {
    display: flex;
    flex-direction: column;
}
.summary-count {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
}
.summary-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
}
.table th, .table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-family: var(--font-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    background-color: rgba(255,255,255,0.01);
}
.table.hoverable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.driver-info-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.flag-icon {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.flag-icon .fi,
.podium-flag .fi {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.driver-name {
    font-weight: 600;
}

/* Trophy icons */
.trophy {
    font-size: 1.1rem;
    text-shadow: 0 0 8px currentColor;
}
.trophy.gold { color: var(--gold); }
.trophy.silver { color: var(--silver); }
.trophy.bronze { color: var(--bronze); }
.rank-number {
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Constructor standings design */
.team-standings-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.team-standing-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.team-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.team-rank {
    font-weight: 700;
    color: var(--text-dim);
    margin-right: 0.5rem;
}
.team-name {
    font-weight: 600;
    flex: 1;
}
.team-progress-bar-wrapper {
    height: 8px;
    background-color: rgba(255,255,255,0.03);
    border-radius: 4px;
    overflow: hidden;
}
.team-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 24, 73, 0.3);
    transition: width 1s ease-out;
}
.team-substats {
    display: flex;
    gap: 0.75rem;
}

/* Podium pedestal design */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0 3rem;
    height: 240px;
    padding-bottom: 10px;
}
.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.podium-spot.empty {
    visibility: hidden;
}
.podium-driver {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0.75rem;
    min-height: 90px;
    justify-content: flex-end;
}
.podium-flag {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-team {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.crown-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    animation: float 2s infinite ease-in-out;
}

.podium-pedestal {
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}
.podium-pedestal .rank {
    font-family: var(--font-secondary);
    font-size: 2.2rem;
    font-weight: 900;
}
.podium-pedestal .points {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.spot-1 { order: 2; }
.spot-1 .podium-pedestal {
    height: 120px;
    background: linear-gradient(180deg, rgba(255, 190, 26, 0.15) 0%, rgba(10, 10, 12, 0.8) 100%);
    border-color: rgba(255, 190, 26, 0.3);
    box-shadow: 0 0 20px rgba(255, 190, 26, 0.1);
}
.spot-1 .podium-pedestal .rank { color: var(--gold); text-shadow: 0 0 10px rgba(255, 190, 26, 0.3); }

.spot-2 { order: 1; }
.spot-2 .podium-pedestal {
    height: 90px;
    background: linear-gradient(180deg, rgba(181, 193, 214, 0.12) 0%, rgba(10, 10, 12, 0.8) 100%);
    border-color: rgba(181, 193, 214, 0.25);
}
.spot-2 .podium-pedestal .rank { color: var(--silver); }

.spot-3 { order: 3; }
.spot-3 .podium-pedestal {
    height: 70px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.1) 0%, rgba(10, 10, 12, 0.8) 100%);
    border-color: rgba(205, 127, 50, 0.2);
}
.spot-3 .podium-pedestal .rank { color: var(--bronze); }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* Modals design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 6, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}
.modal.large {
    max-width: 1250px;
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-family: var(--font-secondary);
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}
.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-close:hover {
    color: var(--accent);
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Forms controls */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 24, 73, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}
select.form-control {
    background-color: #2a2a32;
    color: var(--text-primary);
}
select.form-control option {
    background-color: #2a2a32;
    color: var(--text-primary);
}
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
.custom-select-option {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transition: background 0.15s ease;
}
.custom-select-option:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grid Entry Form Styling */
.grid-form-table {
    font-size: 0.85rem;
}
.grid-form-table th {
    vertical-align: middle;
}
.header-group {
    background-color: rgba(255,255,255,0.015);
}
.header-qualy { border-bottom: 2px solid var(--cyan) !important; }
.header-h1 { border-bottom: 2px solid var(--accent) !important; }
.header-h2 { border-bottom: 2px solid var(--gold) !important; }
.th-sub {
    padding: 0.5rem !important;
    font-size: 0.7rem !important;
}
.input-flat {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
}
.input-flat:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(255,255,255,0.05);
}
.input-flat.input-qualy-time { border-color: rgba(0, 229, 255, 0.15); }
.input-flat.input-qualy-time:focus { border-color: var(--cyan); }

/* Custom check boxes inside tables */
.custom-checkbox {
    display: inline-block;
    position: relative;
    padding-left: 20px;
    cursor: pointer;
    font-size: 0;
    user-select: none;
}
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: -8px;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 3px;
}
.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent);
}
.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--danger);
    border-color: var(--danger);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}
.custom-checkbox .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Selection list inside drivers registration */
.registration-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}
.registration-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}
.registration-item:last-child {
    border-bottom: none;
}
.registration-item:hover {
    background-color: rgba(255,255,255,0.02);
}

/* Empty State styling */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Scoring Config Rules Input List */
.points-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.point-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.point-input-wrapper span {
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    width: 35px;
    color: var(--text-secondary);
}

/* Utilities classes */
.flex-2-col {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.flex-2-col > div {
    flex: 1;
    min-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #sidebar {
        width: 70px;
    }
    .sidebar-logo span, .sidebar-footer, .sidebar-item a span {
        display: none;
    }
    #content-area {
        margin-left: 70px;
    }
    .sidebar-logo {
        padding: 1.5rem 0.5rem;
        justify-content: center;
    }
    .sidebar-item a {
        justify-content: center;
        padding: 0.75rem;
    }
    .podium-container {
        gap: 0.5rem;
    }
    .podium-spot {
        width: 120px;
    }
    .podium-name {
        max-width: 110px;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    .action-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    header {
        padding: 0 1rem;
    }
    .podium-container {
        height: auto;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    .podium-spot {
        width: 100%;
        order: unset !important;
    }
    .podium-pedestal {
        height: auto !important;
        padding: 1rem 0;
    }
}

/* Administrative visibility toggles */
.admin-only {
    display: none !important;
}

body.is-admin .admin-only {
    display: inline-flex !important;
}

/* Ensure buttons inside button groups or tables display properly */
body.is-admin button.admin-only,
body.is-admin a.admin-only {
    display: inline-flex !important;
}

body.is-admin div.admin-only,
body.is-admin li.admin-only {
    display: block !important;
}

body.is-admin span.admin-only {
    display: inline !important;
}

/* Red overlay badge or sidebar highlight for active admin mode */
.sidebar-item.admin-indicator a {
    border-left: 3px solid transparent;
}
body.is-admin .sidebar-item.admin-indicator a {
    border-left-color: var(--accent);
    color: var(--accent);
    background-color: rgba(255, 24, 73, 0.05);
}

/* Custom logo branding rules */
.sidebar-logo.has-custom-logo {
    padding: 0;
    min-height: auto;
    border-bottom: none;
}
.sidebar-logo.has-custom-logo .custom-brand-logo {
    max-height: none;
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

/* Hide number input spinners (up/down arrows) */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Real-time fastest lap telemetry highlight (Purple) */
.fastest-lap-highlight {
    background-color: rgba(168, 85, 247, 0.25) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4) !important;
    color: #d8b4fe !important;
    font-weight: 700 !important;
}

/* DNR (Did Not Race) row disabling visual effects */
.result-entry-row.row-dnr td {
    opacity: 0.35;
    transition: opacity 0.25s ease;
}
/* Keep the DNR checkbox itself clear */
.result-entry-row.row-dnr td:nth-child(2) {
    opacity: 1 !important;
}
.result-entry-row.row-dnr .driver-name {
    text-decoration: line-through;
    color: var(--text-dim) !important;
}

/* Compact Table Layout rules to prevent dashboard standings horizontal overflow */
.compact-table th,
.compact-table td {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.82rem !important;
}
.compact-table td .flag-icon {
    margin-right: 0.25rem !important;
}
.compact-table td .text-bold {
    font-size: 0.85rem !important;
}

/* Standings page Category Stats Cards Grid styling */
.standings-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.stat-category-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.stat-category-header i {
    font-size: 1.1rem;
    color: var(--accent);
}
.stat-category-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.stat-category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
}
.stat-category-item .rank {
    width: 25px;
    font-weight: 700;
    color: var(--text-dim);
    font-family: var(--font-secondary);
}
.stat-category-item .flag {
    display: inline-flex;
    align-items: center;
}
.stat-category-item .name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.stat-category-item .value {
    font-weight: 700;
    color: var(--accent);
    min-width: 20px;
    text-align: right;
    font-family: var(--font-secondary);
}

/* Driver profile link hover states */
.driver-profile-trigger:hover {
    color: var(--accent) !important;
    text-decoration-color: var(--accent) !important;
}

/* Driver Performance Form Circle Badges */
.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-family: var(--font-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.05);
}
.form-badge.gold-badge { background: linear-gradient(135deg, #ffd700, #ffae00); color: #000; box-shadow: 0 0 6px rgba(255, 190, 26, 0.4); border-color: rgba(255, 190, 26, 0.3); }
.form-badge.silver-badge { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #000; }
.form-badge.bronze-badge { background: linear-gradient(135deg, #d97706, #78350f); color: #fff; }
.form-badge.green-badge { background: linear-gradient(135deg, #34d399, #059669); }
.form-badge.dim-badge { background: linear-gradient(135deg, #6b7280, #374151); color: #d1d5db; }
.form-badge.red-badge { background: linear-gradient(135deg, #f87171, #dc2626); font-weight: bold; }
.form-badge.gray { background: #1f2937; color: var(--text-dim); }

/* ================= SCREEN: CALENDAR ================= */
.calendar-day-cell {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}
.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 24, 73, 0.25);
}
.calendar-day-cell.other-month {
    opacity: 0.3;
}
.calendar-day-cell.today {
    border-color: var(--accent);
    background: rgba(255, 24, 73, 0.03);
}
.calendar-day-cell.today .day-number {
    color: var(--accent);
    font-weight: 700;
}
.calendar-day-cell .day-number {
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    color: var(--text-secondary);
    align-self: flex-start;
}
.calendar-event-badge {
    background: rgba(255, 24, 73, 0.08);
    border: 1px solid rgba(255, 24, 73, 0.2);
    border-radius: 4px;
    padding: 0.35rem;
    font-size: 0.72rem;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}
.calendar-event-badge:hover {
    transform: translateY(-2px);
    background: rgba(255, 24, 73, 0.15);
}
.calendar-event-badge.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}
.calendar-event-badge.completed:hover {
    background: rgba(16, 185, 129, 0.15);
}
.calendar-event-badge.practice {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.2);
}
.calendar-event-badge.practice:hover {
    background: rgba(0, 229, 255, 0.15);
}
.calendar-event-badge.community {
    background: rgba(192, 132, 252, 0.08);
    border-color: rgba(192, 132, 252, 0.2);
}
.calendar-event-badge.community:hover {
    background: rgba(192, 132, 252, 0.15);
}
.text-violet {
    color: #c084fc !important;
}
.text-cyan {
    color: var(--cyan) !important;
}
.text-success {
    color: var(--success) !important;
}
.text-accent {
    color: var(--accent) !important;
}
.text-xs {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
}
.calendar-event-badge .event-name {
    font-family: var(--font-primary);
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.calendar-event-badge .event-track {
    font-family: var(--font-secondary);
    font-size: 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.calendar-add-btn {
    opacity: 0;
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: var(--accent);
    border: none;
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.calendar-day-cell:hover .calendar-add-btn {
    opacity: 1;
}
.calendar-add-btn:hover {
    transform: scale(1.15);
}

