:root {
    --primary: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* === 1. ZÁKLADNÍ RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* === 2. UI KOMPONENTY === */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 32px;
}

.btn-icon-only {
    padding: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-edit {
    background: #e0e7ff;
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: #c7d2fe;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background: #f9fafb;
    min-height: 48px;
    max-width: 100%;
    min-width: 0;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: #fff;
}

/* === 3. MOBILNÍ LAYOUT === */
.app-layout {
    display: block;
    position: relative;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg-card);
    z-index: 1000;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    margin-bottom: 30px;
}

.brand h2 {
    font-size: 20px;
    font-weight: 700;
}

.close-sidebar-btn {
    margin-left: auto;
    font-size: 24px;
    display: block;
}

.mobile-menu-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 50;
    display: flex;
}

/* Profil */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 12px;
    margin-bottom: 30px;
}

.user-profile .avatar {
    width: 36px;
    height: 36px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.user-details .label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.user-details .email-text {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    min-height: 48px;
}

.nav-item.active {
    background: #e0e7ff;
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ef4444;
    font-weight: 600;
}

/* Obsah */
.content-area {
    width: 100%;
    padding: 80px 16px 40px 16px;
}

/* Karty a Panely */
.section-header {
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-split {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row,
.prices-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.panel {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 100%;
    overflow-x: hidden;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card.elec .icon {
    background: #fef3c7;
    color: #d97706;
}

.stat-card.gas .icon {
    background: #ffedd5;
    color: #ea580c;
}

.stat-card.water .icon {
    background: #dbeafe;
    color: #2563eb;
}

.stat-card.sewage .icon {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-card p {
    font-size: 20px;
    font-weight: 800;
}

/* Grafy a Listy */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-header select {
    width: auto;
    min-width: 140px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    background-color: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 10px;
    min-height: 36px;
    cursor: pointer;
    color: var(--text-main);
}

.chart-wrapper {
    position: relative;
    height: 300px !important;
    width: 100%;
    overflow: hidden;
}

.activity-list {
    list-style: none;
    margin-top: 10px;
}

.activity-list li,
.sub-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.sub-item .sub-details {
    display: flex;
    flex-direction: column;
}

.sub-item .sub-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.delete-btn {
    width: 32px;
    height: 32px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #fca5a5;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Flexibilní tlačítka v Rozpočtu */
.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    flex: 1 1 30%;
    min-width: 100px;
    height: 50px;
    font-size: 13px;
    white-space: nowrap;
}

.deposit-btn {
    background: #d1fae5;
    color: #065f46;
}

.expense-btn {
    background: #fee2e2;
    color: #991b1b;
}

.rent-btn {
    background: #e0e7ff;
    color: #3730a3;
}

#budget-form {
    max-width: 100%;
    box-sizing: border-box;
}

/* --- TABULKY (SCROLL & STYLES) --- */
.table-scroll-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
    /* Aby se nedeformovala na mobilu */
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    /* Zarovnání na střed */
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    background: var(--bg-card);
    /* Nutné pro sticky header */
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* NOVÉ: Wrapper pro akční tlačítka v tabulce - aby neodskakovala */
.action-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* === 4. DESKTOP OVERRIDE (PC > 1200px) === */
@media (min-width: 1201px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    .app-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        height: 100%;
    }

    .mobile-menu-btn {
        display: none;
    }

    .close-sidebar-btn {
        display: none;
    }

    .sidebar {
        position: relative;
        transform: none;
        width: auto;
        height: 100%;
        border-right: 1px solid var(--border);
        box-shadow: none;
    }

    .content-area {
        padding: 32px;
        height: 100vh;
        overflow-y: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .dashboard-split {
        display: grid;
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }

    .form-row,
    .prices-grid {
        grid-template-columns: 1fr 1fr;
    }

    .btn-icon-only {
        background: transparent;
    }
}

/* === 5. MOBILNÍ OPRAVY (Malé displeje < 768px) === */
@media (max-width: 768px) {
    .panel {
        padding: 15px !important;
    }

    h1 {
        font-size: 24px;
    }

    h3 {
        font-size: 18px;
    }

    .action-btn {
        flex: 1 1 45%;
    }

    /* 1. Odsune tlačítko menu dolů, aby nebylo pod hodinami/výřezem */
    .mobile-menu-btn {
        top: calc(15px + env(safe-area-inset-top));
    }

    /* 2. Odsune obsah stránky ještě níž, aby začínal až POD tlačítkem menu */
    .content-area {
        /* 80px = místo pro tlačítko + mezera. env() přičte velikost výřezu */
        padding-top: calc(80px + env(safe-area-inset-top));
    }
}

/* === 6. TABLET OPTIMALIZACE (iPad Air a menší laptopy: 769px - 1200px) === */
@media (min-width: 769px) and (max-width: 1200px) {

    /* Sidebar necháme stejný jako na desktopu (vlevo), ale zbytek upravíme */
    body {
        height: 100vh;
        overflow: hidden;
    }

    .app-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        height: 100%;
    }

    .mobile-menu-btn {
        display: none;
    }

    .close-sidebar-btn {
        display: none;
    }

    .sidebar {
        position: relative;
        transform: none;
        width: auto;
        height: 100%;
        border-right: 1px solid var(--border);
        box-shadow: none;
    }

    .content-area {
        padding: 32px;
        height: 100vh;
        overflow-y: auto;
    }

    /* ZMĚNA: Karty 2x2 místo 4 vedle sebe (aby byly větší) */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    /* ZMĚNA: Grafy pod sebe, ne vedle sebe (aby měl graf místo) */
    .dashboard-split {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Vstupní panely taky pod sebe */
    .form-row,
    .prices-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* LOGIN */
.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e0e7ff;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
}

.login-card {
    background: white;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-header .icon-bg {
    width: 60px;
    height: 60px;
    background: #e0e7ff;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.error-msg {
    color: #ef4444;
    margin-bottom: 20px;
}

/* === 7. FIX PRO INPUTY NA IPADU/IOS === */
input[type="date"] {
    /* 1. Reset nativního vzhledu iOS, který nafukuje input */
    -webkit-appearance: none;
    appearance: none;

    /* 2. Vynucení šířky */
    width: 100%;
    min-width: 0;
    /* Dovolí zmenšení pod "přirozenou" šířku textu */
    max-width: 100%;

    /* 3. Aby se padding nepočítal navíc k šířce */
    box-sizing: border-box;
    display: block;

    /* 4. Zarovnání textu a barva pozadí pro jistotu */
    background-color: #f9fafb;
    margin: 0;
}

/* Pojistka pro obal inputu v Gridu */
.form-group {
    min-width: 0;
    /* Kritické pro CSS Grid, aby buňka nepřetekla */
    max-width: 100%;
    position: relative;
    /* Aby input neutíkal */
}

/* --- NÁKUPNÍ SEZNAM --- */
.shopping-list-container {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.shop-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    animation: fadeIn 0.2s;
}

/* Custom Checkbox (Větší pro dotyk) */
.checkbox-wrapper {
    display: block;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 22px;
    user-select: none;
    height: 24px;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-wrapper:hover input~.checkmark {
    border-color: var(--primary);
}

.checkbox-wrapper input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-wrapper input:checked~.checkmark:after {
    display: block;
}

.checkbox-wrapper .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- ZÁRUKOVNÍK STYLY --- */

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.doc-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
}

.doc-card:hover {
    transform: translateY(-2px);
}

.doc-img {
    width: 80px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.doc-img.placeholder {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

.doc-info {
    padding: 12px;
    flex: 1;
}

.doc-info h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
}

.doc-info small {
    color: var(--text-muted);
    font-size: 12px;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.ok {
    background: #dcfce7;
    color: #166534;
}

.status-badge.warning {
    background: #ffedd5;
    color: #9a3412;
}

.status-badge.expired {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 600px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }
}

/* Styl pro PDF zástupce */
.doc-img.pdf-style {
    background: #fee2e2;
    /* Světle červené pozadí */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- MODERNÍ MHD GRID --- */

.mhd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mhd-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
    overflow: hidden;
}

.mhd-card-header {
    padding: 12px 16px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mhd-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #1e293b;
}

.mhd-card-title h3 {
    margin: 0;
    font-size: 15px;
}

.mhd-table-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: #f1f5f9;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
}

.mhd-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.mhd-col-line {
    width: 40px;
}

.mhd-col-dest {
    flex: 1;
    padding: 0 10px;
    font-weight: 500;
    font-size: 13px;
    color: #334155;
}

.mhd-col-time {
    text-align: right;
    min-width: 70px;
}

.mhd-badge {
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 900;
    display: block;
    text-align: center;
}

.mhd-time-val {
    font-weight: 700;
    color: #0f172a;
}

.mhd-delay {
    color: #ef4444;
    font-size: 10px;
    font-weight: 700;
    margin-left: 3px;
}

.mhd-del-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
}

.mhd-del-btn:hover {
    color: #ef4444;
}

/* Kontejner pro F1 karty */
.f1-dashboard {
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* Mezery mezi kartami */
    padding: 20px 0;
    max-width: 800px;
    /* Aby to nebylo roztažené přes celý monitor */
}

.f1-card {
    padding: 20px !important;
    border-radius: 15px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.f1-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.f1-header h4 {
    margin: 0;
    color: #e10600;
    /* F1 Červená */
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.f1-main-layout {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    /* Pro mobily */
}

.race-info-side {
    flex: 1;
    min-width: 250px;
}

.race-map-side {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-img {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.1)) invert(1);
    /* Invert pokud máš tmavý režim, jinak odstraň */
}

.race-timer-box {
    background: #1e293b;
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-around;
    font-size: 24px;
    font-weight: 900;
    margin-top: 15px;
}

/* --- F1 RACE CENTER STYLES --- */
.f1-race-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    /* Levá část širší, pravá (rozpis) užší */
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .f1-race-grid {
        grid-template-columns: 1fr;
    }

    /* Na mobilu pod sebe */
}

.session-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.session-name {
    font-weight: 700;
    color: #64748b;
}

.session-time {
    font-weight: 700;
    color: #1e293b;
}

.session-day {
    font-size: 12px;
    color: #94a3b8;
    margin-right: 8px;
}

.round-badge {
    background: #e10600;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

.circuit-img-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    border: 1px dashed #cbd5e1;
}

/* F1 Map Container */
#f1-circuit-map {
    height: 250px;
    width: 100%;
    border-radius: 12px;
    z-index: 1;
    /* Aby se mapa nepřekrývala s ničím jiným */
    background: #1e293b;
    /* Tmavé pozadí, než se načte mapa */
}

/* --- ÚPRAVA PRO VELKÉ DISPLEJE --- */

/* 1. Povolíme maximální šířku pro F1 sekci */
.f1-dashboard {
    max-width: 100%;
    /* Původně tam bylo asi 800px */
    width: 100%;
}

/* 2. Grid pro Standings (na velkém monitoru 2 sloupce, na mobilu 1) */
.standings-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 15px 30px;
    /* Mezera mezi řádky / sloupci */
}

/* 3. Úprava karty jezdce, aby byla kompaktnější */
.driver-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

/* 4. Roztažení hlavní karty závodu */
.f1-race-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Levá část (mapa) širší než pravá (rozpis) */
    gap: 30px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .f1-race-grid {
        grid-template-columns: 1fr;
    }

    /* Tablet/Mobil pod sebe */
    .standings-list-container {
        grid-template-columns: 1fr;
    }

    /* Jezdci pod sebe */
}

/* --- POČASÍ WIDGET --- */
.weather-widget {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f1f5f9;
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* --- LIVE INDIKÁTOR (BLIKAJÍCÍ) --- */
.live-badge {
    background: #e10600;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    animation: pulse-red 2s infinite;
    margin-left: 10px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(225, 6, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(225, 6, 0, 0);
    }
}

/* --- PŘEPÍNAČ JEZDCI / TÝMY --- */
.standings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
}

.toggle-group {
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 5px;
}

.toggle-btn {
    padding: 6px 15px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- NOVÝ LAYOUT F1 DASHBOARDU --- */
.f1-dashboard-grid {
    display: grid;
    gap: 20px;
    /* Nahoře jedna velká, dole dvě menší */
    grid-template-areas:
        "next next"
        "last standings";
    grid-template-columns: 1fr 1fr;
}

.next-race {
    grid-area: next;
}

.last-race {
    grid-area: last;
}

.standings {
    grid-area: standings;
    margin-top: 0 !important;
}

/* Reset marginu */

@media (max-width: 900px) {
    .f1-dashboard-grid {
        grid-template-areas:
            "next"
            "last"
            "standings";
        grid-template-columns: 1fr;
    }
}

/* Styl pro pódium */
.podium-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.medal {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    margin-right: 10px;
    color: white;
}

.gold {
    background: #FFD700;
}

.silver {
    background: #C0C0C0;
}

.bronze {
    background: #CD7F32;
}

/* --- SKROLOVACÍ TABULKA F1 --- */

/* Omezíme výšku obsahu a povolíme skrolování */
#f1-standings-content {
    max-height: 550px;
    /* Fixní výška - uprav dle potřeby */
    overflow-y: auto;
    /* Povolit svislé posouvání */
    padding-right: 5px;
    /* Aby text nelezl pod posuvník */
}

/* --- DESIGN POSUVNÍKU (SCROLLBAR) --- */
/* Funguje v Chrome, Edge, Safari (Webkit) */

#f1-standings-content::-webkit-scrollbar {
    width: 6px;
    /* Tenký posuvník */
}

#f1-standings-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    /* Barva pozadí dráhy */
    border-radius: 3px;
}

#f1-standings-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    /* Barva samotného posuvníku (šedá) */
    border-radius: 3px;
}

#f1-standings-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    /* Tmavší při najetí myší */
}

/* --- LETECKÝ RADAR --- */
.plane-icon {
    transition: all 1s linear;
    /* Plynulý pohyb mezi aktualizacemi */
}

/* SVG ikonka letadla uvnitř markeru */
.plane-svg {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    /* Barva letadla - žlutá pro dobrou viditelnost */
    fill: #fbbf24;
    stroke: #000;
    stroke-width: 1px;
}

/* Popup bublina s informacemi */
.plane-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.plane-popup .leaflet-popup-content {
    margin: 10px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

/* ========================================= */
/* ✈️ SEKCE CESTOVÁNÍ (TRAVEL CSS)         */
/* ========================================= */

.travel-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 25px;
    align-items: start;
}

@media (max-width: 1000px) {
    .travel-grid {
        grid-template-columns: 1fr;
    }
}

/* ZÁLOŽKY */
.travel-tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.trip-tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.2s;
    font-size: 14px;
}

.trip-tab:hover {
    background: #f8fafc;
    color: #0ea5e9;
}

.trip-tab.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    box-shadow: 0 4px 10px -3px rgba(14, 165, 233, 0.4);
}

/* HLAVNÍ KARTA */
.travel-card-main {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
    padding: 30px !important;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.4);
    margin-bottom: 25px;
}

/* STYLY PRO LETY (TIMELINE) */
.flight-row {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
    gap: 15px;
    margin-bottom: 5px;
}

.flight-type-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.flight-times {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.time-big {
    font-weight: 800;
    font-size: 18px;
}

.time-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    position: relative;
    margin: 0 10px;
}

.time-line::after {
    content: '✈';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: white;
}

/* ODPOČET */
.trip-countdown {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.trip-countdown div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.trip-countdown span {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.trip-countdown small {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* FINANCE WIDGET */
.budget-progress-bg {
    width: 100%;
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.5s ease, background 0.3s;
}

/* HISTORIE TRANSAKCÍ */
.history-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-note {
    font-weight: 600;
    color: #334155;
}

.history-date {
    font-size: 10px;
    color: #94a3b8;
}

.history-amount {
    font-weight: 800;
    color: #ef4444;
}

/* CHECKLIST */
.checklist-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 15px;
    max-height: 400px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.checklist-item:hover {
    background: #f8fafc;
}

.check-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.2s;
}

.checklist-item.checked span {
    text-decoration: line-through;
    color: #94a3b8;
}

.checklist-item.checked .check-circle {
    background: #10b981;
    border-color: #10b981;
}

.checklist-item.checked .check-circle::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 900;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-input {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.input-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* === DARK MODE TOGGLE === */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* === SHOPPING LIST UTILITY CLASSES === */
.shop-empty {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
}

.shop-item-text {
    flex: 1;
    margin-left: 12px;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s;
}

.shop-item-bought {
    text-decoration: line-through;
    color: #9ca3af;
}

/* === MHD UTILITY CLASSES === */
.mhd-empty {
    text-align: center;
    color: #999;
    padding: 40px;
    grid-column: 1/-1;
}

/* === TOAST NOTIFICATIONS === */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification .material-icons-round {
    font-size: 20px;
}

.toast-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.toast-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.toast-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.toast-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* === CONFIRM / PROMPT DIALOG === */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-dialog {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-actions .btn {
    min-height: 40px;
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 10px;
}

/* ======================================== */
/* === UTILITY & COMPONENT CLASSES     === */
/* ======================================== */

/* --- Layout utilities --- */
.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-5 {
    gap: 5px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

.text-center {
    text-align: center;
}

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

/* --- Spacing utilities --- */
.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: 2px;
}

.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-auto {
    margin-top: auto;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.m-0 {
    margin: 0;
}

.pt-5 {
    padding-top: 5px;
}

.pt-10 {
    padding-top: 10px;
}

.pt-15 {
    padding-top: 15px;
}

.p-10 {
    padding: 10px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-50 {
    padding: 50px;
}

/* --- Text & display helpers --- */
.d-none {
    display: none;
}

.d-block {
    display: block;
}

.fw-bold {
    font-weight: bold;
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.fw-900 {
    font-weight: 900;
}

.fs-10 {
    font-size: 10px;
}

.fs-11 {
    font-size: 11px;
}

.fs-12 {
    font-size: 12px;
}

.fs-13 {
    font-size: 13px;
}

.fs-14 {
    font-size: 14px;
}

.fs-16 {
    font-size: 16px;
}

.fs-18 {
    font-size: 18px;
}

.fs-32 {
    font-size: 32px;
}

.fs-36 {
    font-size: 36px;
}

.fs-48 {
    font-size: 48px;
}

.uppercase {
    text-transform: uppercase;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.color-muted {
    color: var(--text-muted);
}

.color-primary {
    color: var(--primary);
}

.color-success {
    color: #10b981;
}

.color-arrow {
    color: #94a3b8;
}

/* --- Price settings panel --- */
.price-settings-panel {
    border: 2px solid var(--primary);
    margin-bottom: 20px;
}

.settings-heading {
    margin-bottom: 10px;
    margin-top: 0;
}

.settings-heading-spaced {
    margin-bottom: 10px;
    margin-top: 10px;
}

/* --- Chart filter row --- */
.chart-filter-row {
    display: flex;
    gap: 10px;
}

.chart-average-text {
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Budget main panel --- */
.budget-panel {
    margin-bottom: 24px;
    border-left: 5px solid #10b981;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-limit-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.alert-badge-style {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 10px;
}

.balance-label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.balance-amount {
    font-size: 32px;
    font-weight: 800;
    color: #10b981;
}

.btn-csv-import {
    background: var(--bg-body, #f3f4f6);
    color: var(--text-main, #374151);
}

/* --- Budget form --- */
.budget-form-container {
    margin-top: 20px;
    background: var(--bg-body, #f9fafb);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border, #e5e7eb);
}

.budget-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* --- Budget doughnut chart --- */
.chart-wrapper-sm {
    height: 250px !important;
}

/* --- Transaction table --- */
.transaction-panel {
    margin-top: 20px;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-search-input {
    width: auto;
    min-width: 200px;
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
}

.table-scroll {
    max-height: 500px;
    overflow-y: auto;
}

.sticky-thead {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

/* --- F1 loading text --- */
.loading-text {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
}

.f1-header-flat {
    margin: 0;
    border: none;
    padding: 0;
}

/* --- Travel section --- */
.travel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-new-trip {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.travel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.trip-title {
    margin: 0;
    font-size: 36px;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.trip-dates-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 5px;
}

.icon-white-sm {
    color: white;
    font-size: 16px;
}

.trip-dates-text {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.flights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.travel-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 15px;
}

.weather-badge {
    background: rgba(255, 255, 255, 0.2);
    width: fit-content;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
}

.btn-delete-trip {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.map-panel {
    padding: 0;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.map-fill {
    width: 100%;
    height: 100%;
}

/* --- Travel finance widget --- */
.finance-panel {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
}

.finance-header-space {
    justify-content: space-between;
    align-items: center;
}

.btn-edit-budget {
    background: var(--bg-body, #f1f5f9);
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 700;
}

.icon-sm-inline {
    font-size: 14px;
    vertical-align: middle;
}

.expense-form-box {
    background: var(--bg-body, #f8fafc);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

.expense-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-compact {
    margin: 0;
}

.input-currency {
    margin: 0;
    width: 70px;
    padding: 0 5px;
}

.btn-add-expense {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.icon-16 {
    font-size: 16px;
}

.split-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 5px;
    color: var(--text-muted, #64748b);
}

.spent-amount {
    color: var(--text-main, #1e293b);
}

.progress-bar-bg {
    height: 8px;
    margin-bottom: 15px;
}

.split-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    background: var(--bg-body, #f8fafc);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border, #e2e8f0);
}

.stat-box-label {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    text-transform: uppercase;
}

.stat-box-value-blue {
    font-size: 16px;
    font-weight: 900;
    color: #0ea5e9;
    margin-top: 2px;
}

.topup-box-ok {
    background: #f0fdf4;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dcfce7;
}

.topup-label-ok {
    font-size: 10px;
    color: #15803d;
    font-weight: 700;
    text-transform: uppercase;
}

.topup-value-ok {
    font-size: 16px;
    font-weight: 900;
    color: #16a34a;
    margin-top: 2px;
}

.transactions-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    border-top: 1px dashed var(--border, #e2e8f0);
    padding-top: 10px;
}

.section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.empty-state {
    text-align: center;
    color: var(--text-muted, #cbd5e1);
    font-size: 12px;
    margin-top: 20px;
}

/* --- Packing list --- */
.packing-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.packing-panel .f1-header {
    margin-bottom: 15px;
}

.packing-add-row {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 10px;
}

.packing-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
}

.btn-add-item {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- No trips placeholder --- */
.no-trips-box {
    text-align: center;
    padding: 50px;
    color: var(--text-muted, #94a3b8);
}

.no-trips-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* --- Trip modal --- */
.trip-modal-content {
    max-width: 650px;
}

.trip-modal-top {
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--border, #e2e8f0);
    padding-bottom: 20px;
}

.date-row {
    display: flex;
    gap: 15px;
}

.flight-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.flight-card {
    background: var(--bg-body, #f8fafc);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
}

.flight-label-out {
    color: #0ea5e9;
    margin-bottom: 8px;
    display: block;
}

.flight-label-back {
    color: #f59e0b;
    margin-bottom: 8px;
    display: block;
}

.flight-time-row {
    display: flex;
    gap: 5px;
    align-items: center;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
    border-top: 1px solid var(--border, #f1f5f9);
    padding-top: 15px;
}

/* --- History list --- */
.history-list-nolimit {
    max-height: none;
}

/* --- Radar --- */
.radar-panel {
    padding: 0;
    overflow: hidden;
    position: relative;
    height: 600px;
}

.radar-status-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.radar-status-text {
    font-weight: bold;
    color: var(--text-main, #1e293b);
}

.radar-refresh-text {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.radar-map {
    width: 100%;
    height: 100%;
    background: #aadaff;
}

/* --- Item add row (shopping, MHD) --- */
.item-add-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.btn-square-add {
    height: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-bought-row {
    margin-top: 20px;
    text-align: center;
}

/* --- Subscriptions --- */
.subs-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subs-total-label {
    font-size: 10px;
    color: #777;
    text-transform: uppercase;
    font-weight: 700;
}

.subs-total-amount {
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
}

/* --- MHD add form --- */
.mhd-add-panel {
    margin-bottom: 20px;
}

/* --- Documents upload --- */
.upload-progress-box {
    margin-bottom: 15px;
}

.upload-bar-bg {
    background: #e5e7eb;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.upload-bar-fill {
    background: var(--primary);
    width: 0%;
    height: 100%;
    transition: width 0.3s;
}

/* ======================================== */
/* ===     DARK MODE THEME             === */
/* ======================================== */
body.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* --- Sidebar --- */
body.dark-mode .sidebar {
    background: #0f172a;
    border-right-color: #1e293b;
}

body.dark-mode .sidebar-btn {
    color: #94a3b8;
}

body.dark-mode .sidebar-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .sidebar-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

/* --- Inputs --- */
body.dark-mode input,
body.dark-mode select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode input:focus,
body.dark-mode select:focus {
    border-color: #6366f1;
    background: #0f172a;
}

body.dark-mode input::placeholder {
    color: #475569;
}

/* --- Buttons --- */
body.dark-mode .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

body.dark-mode .btn-edit {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

body.dark-mode .btn-edit:hover {
    background: rgba(99, 102, 241, 0.3);
}

body.dark-mode .delete-btn {
    color: #ef4444;
}

/* --- Cards + Sections --- */
body.dark-mode .card,
body.dark-mode .sub-item,
body.dark-mode .stat-card,
body.dark-mode .f1-card,
body.dark-mode .doc-card,
body.dark-mode .mhd-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .section-header h2,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode strong {
    color: #e2e8f0;
}

body.dark-mode small,
body.dark-mode .text-muted {
    color: #64748b;
}

/* --- Budget --- */
body.dark-mode .cat-badge {
    opacity: 0.85;
}

body.dark-mode #budget-table-body tr {
    border-bottom-color: #334155;
}

body.dark-mode #budget-table-body td {
    color: #cbd5e1;
}

/* --- Energy --- */
body.dark-mode #shared-list li {
    border-bottom-color: #334155;
}

/* --- Shopping --- */
body.dark-mode .shop-item {
    border-bottom-color: #334155;
}

body.dark-mode .shop-empty {
    color: #475569;
}

/* --- Documents --- */
body.dark-mode .doc-img.placeholder {
    background: #334155;
    color: #64748b;
}

body.dark-mode .doc-img.pdf-style {
    background: #334155;
}

/* --- MHD --- */
body.dark-mode .mhd-card-header {
    border-bottom-color: #334155;
}

body.dark-mode .mhd-table-header {
    color: #64748b;
    border-bottom-color: #334155;
}

body.dark-mode .mhd-row {
    border-bottom-color: #1e293b;
}

/* --- F1 Dashboard --- */
body.dark-mode .race-schedule {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .session-row {
    border-bottom-color: #334155;
}

body.dark-mode .session-name {
    color: #cbd5e1;
}

body.dark-mode .session-day {
    color: #94a3b8;
}

body.dark-mode .driver-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .weather-widget {
    background: #0f172a;
}

body.dark-mode .podium-row {
    background: #0f172a !important;
}

/* --- Travel --- */
body.dark-mode .trip-tab {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .trip-tab.active {
    background: #6366f1;
    color: white;
}

body.dark-mode .travel-main-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .finance-widget {
    background: #0f172a;
}

body.dark-mode .history-item {
    border-bottom-color: #334155;
}

body.dark-mode .checklist-item {
    background: #0f172a;
    border-color: #334155;
}

/* --- Radar --- */
body.dark-mode .plane-popup-custom .leaflet-popup-content-wrapper {
    background: #1e293b;
    color: #e2e8f0;
}

/* --- Login Screen --- */
body.dark-mode .login-card {
    background: #1e293b;
}

body.dark-mode #auth-error {
    color: #fca5a5;
}

/* --- Toast (dark mode) --- */
body.dark-mode .toast-success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
}

body.dark-mode .toast-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

body.dark-mode .toast-warning {
    background: #451a03;
    color: #fde68a;
    border-color: #78350f;
}

body.dark-mode .toast-info {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1e40af;
}

/* --- Confirm dialog (dark) --- */
body.dark-mode .confirm-dialog {
    background: #1e293b;
}

body.dark-mode .confirm-dialog h3 {
    color: #e2e8f0;
}

body.dark-mode .confirm-dialog p {
    color: #94a3b8;
}

body.dark-mode .prompt-input {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

/* --- Modal (dark) --- */
body.dark-mode .modal-overlay .modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .modal-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

/* --- Scrollbar (dark) --- */
body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* --- Tables (dark) --- */
body.dark-mode table th {
    color: #94a3b8;
    border-bottom-color: #334155;
}

body.dark-mode table td {
    border-bottom-color: #1e293b;
}

/* --- Settings/Prices panel (dark) --- */
body.dark-mode #prices-panel {
    background: #1e293b;
    border-color: #334155;
}

/* --- General text color fixes for hardcoded colors --- */
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1e293b"] {
    color: #e2e8f0 !important;
}

body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #64748b"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #374151"] {
    color: #cbd5e1 !important;
}

body.dark-mode [style*="color:#94a3b8"],
body.dark-mode [style*="color: #94a3b8"] {
    color: #64748b !important;
}

body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"] {
    background: #1e293b !important;
}

/* --- Sidebar profile area --- */
body.dark-mode .user-profile {
    background: #1e293b;
}

body.dark-mode .user-profile .avatar {
    background: #334155;
    color: #818cf8;
}

body.dark-mode .user-details .label {
    color: #64748b;
}

body.dark-mode .user-details .email-text {
    color: #cbd5e1;
}

/* --- Sidebar brand & misc --- */
body.dark-mode .brand {
    color: #818cf8;
}

body.dark-mode .close-sidebar-btn {
    color: #94a3b8;
}

body.dark-mode .btn-logout {
    color: #f87171;
}

body.dark-mode .mobile-menu-btn {
    background: #1e293b;
    color: #e2e8f0;
}

/* --- Section headers --- */
body.dark-mode .section-header h1 {
    color: #e2e8f0;
}

body.dark-mode .section-header p {
    color: #94a3b8;
}

/* --- Body text & paragraphs --- */
body.dark-mode p {
    color: #cbd5e1;
}

body.dark-mode label {
    color: #cbd5e1;
}

body.dark-mode .form-group label {
    color: #94a3b8;
}

/* --- Panel text --- */
body.dark-mode .panel {
    color: #e2e8f0;
}

body.dark-mode .panel h2,
body.dark-mode .panel h3,
body.dark-mode .panel h4 {
    color: #e2e8f0;
}

/* --- Budget form overrides --- */
body.dark-mode #budget-form-title {
    color: #818cf8 !important;
}



body.dark-mode #budget-main-panel {
    background: #1e293b;
}

/* --- Budget table header --- */
body.dark-mode .budget-table thead th,
body.dark-mode table thead th {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode #table-search {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

/* --- Energy section --- */
body.dark-mode .stat-card h3 {
    color: #e2e8f0;
}

body.dark-mode #shared-list li {
    color: #cbd5e1;
}

body.dark-mode #monthly-energy-table tr td {
    color: #cbd5e1;
}

body.dark-mode #chart-average {
    color: #94a3b8;
}

/* --- Shopping list text --- */
body.dark-mode .shop-item-text {
    color: #e2e8f0;
}

body.dark-mode .shop-item-bought {
    color: #475569;
}

/* --- Documents --- */
body.dark-mode .doc-info h4 {
    color: #e2e8f0;
}

body.dark-mode .doc-info small {
    color: #94a3b8;
}

/* --- MHD --- */
body.dark-mode .mhd-card h3 {
    color: #e2e8f0;
}

body.dark-mode .mhd-col-dest {
    color: #cbd5e1;
}

body.dark-mode .mhd-col-time {
    color: #e2e8f0;
}

body.dark-mode .mhd-del-btn {
    color: #94a3b8;
}

body.dark-mode .mhd-del-btn:hover {
    color: #f87171;
}

/* --- F1 Dashboard inline overrides --- */
body.dark-mode .f1-card h4 {
    color: #e2e8f0;
}

body.dark-mode .driver-card div {
    color: #e2e8f0;
}

body.dark-mode .driver-card div[style*="color: #94a3b8"] {
    color: #64748b !important;
}

body.dark-mode .standings-list-container .driver-card div[style*="color: #1e293b"] {
    color: #e2e8f0 !important;
}

body.dark-mode .round-badge {
    color: #818cf8;
}

body.dark-mode .race-schedule h4 {
    color: #e2e8f0 !important;
}

body.dark-mode .session-row [style*="border-top"] {
    border-top-color: #334155 !important;
}

body.dark-mode .podium-row div[style*="color:#1e293b"],
body.dark-mode .podium-row div[style*="color: #1e293b"] {
    color: #e2e8f0 !important;
}

body.dark-mode .podium-row div[style*="color:#64748b"],
body.dark-mode .podium-row div[style*="color: #64748b"] {
    color: #94a3b8 !important;
}

/* --- Travel section --- */
body.dark-mode #trip-destination {
    color: #e2e8f0;
}

body.dark-mode #trip-dates {
    color: #94a3b8;
}

body.dark-mode .history-item {
    color: #cbd5e1;
}

body.dark-mode .history-note {
    color: #e2e8f0;
}

body.dark-mode .history-date {
    color: #64748b;
}

body.dark-mode .history-amount {
    color: #f87171;
}

body.dark-mode .checklist-item span {
    color: #cbd5e1;
}

body.dark-mode .checklist-item.checked span {
    color: #475569;
}

body.dark-mode .finance-widget label,
body.dark-mode .finance-widget span {
    color: #94a3b8;
}

body.dark-mode .finance-widget strong,
body.dark-mode .finance-widget b {
    color: #e2e8f0;
}

body.dark-mode .flight-row {
    color: #e2e8f0;
}

body.dark-mode .time-big {
    color: #e2e8f0;
}

body.dark-mode #no-trips-placeholder {
    color: #94a3b8;
}

body.dark-mode .new-trip-modal,
body.dark-mode #new-trip-modal .modal-content,
body.dark-mode #new-trip-modal {
    background: #1e293b;
    color: #e2e8f0;
}

/* --- Price settings panel (dark) --- */
body.dark-mode #price-settings {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode #price-settings h3 {
    color: #e2e8f0;
}

body.dark-mode #price-settings label {
    color: #94a3b8;
}

/* --- Confirm overlay (dark) --- */
body.dark-mode .confirm-overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* --- Alert badge --- */
body.dark-mode .alert-badge {
    background: #ef4444;
    color: white;
}

/* --- General catch-all for common dark text --- */
body.dark-mode td {
    color: #cbd5e1;
}

body.dark-mode th {
    color: #94a3b8;
}

body.dark-mode span {
    color: inherit;
}

/* Chart.js canvas labels */
body.dark-mode canvas {
    filter: none;
}

/* --- Additional inline background overrides --- */
body.dark-mode [style*="background:#f3f4f6"],
body.dark-mode [style*="background: #f3f4f6"] {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode [style*="background:#f9fafb"],
body.dark-mode [style*="background: #f9fafb"] {
    background: #1e293b !important;
}

body.dark-mode [style*="background:#f0f9ff"],
body.dark-mode [style*="background: #f0f9ff"] {
    background: #1e293b !important;
}

body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #f0fdf4"] {
    background: #0f2e1d !important;
}

body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background: #fef2f2"] {
    background: #2e0f0f !important;
}

/* Inline border overrides */
body.dark-mode [style*="border:1px solid #e5e7eb"],
body.dark-mode [style*="border: 1px solid #e5e7eb"] {
    border-color: #334155 !important;
}

body.dark-mode [style*="border:1px solid #e2e8f0"],
body.dark-mode [style*="border: 1px solid #e2e8f0"] {
    border-color: #334155 !important;
}

body.dark-mode [style*="border-top:1px dashed #e2e8f0"],
body.dark-mode [style*="border-top: 1px dashed #e2e8f0"] {
    border-top-color: #334155 !important;
}

/* Inline color overrides for grey labels */
body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #374151"] {
    color: #cbd5e1 !important;
}

body.dark-mode [style*="color:#666"],
body.dark-mode [style*="color: #666"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="color:#999"],
body.dark-mode [style*="color: #999"] {
    color: #64748b !important;
}

body.dark-mode [style*="color:#cbd5e1"],
body.dark-mode [style*="color: #cbd5e1"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="color: black"],
body.dark-mode [style*="color:black"] {
    color: #e2e8f0 !important;
}

/* --- MHD card header fix (inline background in JS) --- */
body.dark-mode .mhd-card-header {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .mhd-card-title h3 {
    color: #e2e8f0 !important;
}

body.dark-mode .mhd-empty,
body.dark-mode .mhd-loading,
body.dark-mode .mhd-error {
    color: #64748b;
}