/* Reset a zakladne styly */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ===================== */
/* Prihlasovacia stranka */
/* ===================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-form {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-form h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #16213e;
}

.login-form label {
    display: block;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: #444;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.15);
}

.login-form button {
    width: 100%;
    padding: 0.75rem;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-form button:hover {
    background: #16213e;
}

.error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* ========= */
/* Dashboard */
/* ========= */

.dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    color: #16213e;
}

.btn-logout {
    background: none;
    border: 1px solid #d0d5dd;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    color: #444;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #f5f5f5;
}

/* Statisticke karty */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.8125rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-current .stat-value {
    color: #0f3460;
}

.stat-min .stat-value {
    color: #1976d2;
}

.stat-max .stat-value {
    color: #d32f2f;
}

/* Ovladacie prvky - vyber obdobia */
.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.date-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 180px;
}

.date-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #444;
}

.date-field input {
    padding: 0.5rem 0.625rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 0.875rem;
}

.date-field input:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.15);
}

.quick-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-quick {
    padding: 0.5rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick:hover {
    background: #e8edf3;
    border-color: #0f3460;
}

.btn-quick.active {
    background: #0f3460;
    color: #fff;
    border-color: #0f3460;
}

.btn-show {
    padding: 0.5rem 1.5rem;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-show:hover {
    background: #16213e;
}

/* Kontajner pre graf */
.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
}

/* ================= */
/* Responzivne styly */
/* ================= */

@media (max-width: 600px) {
    .dashboard {
        padding: 0.75rem;
    }

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

    .stat-value {
        font-size: 1.5rem;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .date-inputs {
        flex-direction: column;
    }

    .quick-buttons {
        justify-content: stretch;
    }

    .btn-quick,
    .btn-show {
        flex: 1;
        text-align: center;
    }
}
