/* === CopyArt — Base Styles === */

:root {
    --brand: #E65100;
    --brand-light: #FF8A50;
    --brand-dark: #AC1900;
    --success: #2E7D32;
    --success-bg: #E8F5E9;
    --error: #C62828;
    --error-bg: #FFEBEE;
    --info: #1565C0;
    --info-bg: #E3F2FD;
    --text: #212121;
    --text-light: #757575;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --border: #E0E0E0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --radius: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* === Navigation === */

.navbar {
    background: var(--brand);
    color: var(--white);
    padding: 0 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    color: var(--white);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.nav-link-logout {
    margin-left: 0.5rem;
    opacity: 0.7;
}

.nav-link-logout:hover {
    opacity: 1;
}

/* === Container === */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === Cards === */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

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

/* === Stats Row === */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 16px;
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-card-alert .stat-value {
    color: var(--error);
}

.stat-card-alert {
    border-left: 4px solid var(--error);
}

/* === Alerts / Flash Messages === */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border-left: 4px solid var(--error);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* === Forms === */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.15s;
    background: var(--white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(230, 81, 0, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* === Buttons === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

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

.btn-primary {
    background: var(--brand);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--brand-dark);
}

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

.btn-success:hover {
    background: #1B5E20;
}

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

.btn-info:hover {
    background: #0D47A1;
}

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

.btn-secondary:hover {
    background: #BDBDBD;
}

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

.btn-danger:hover {
    background: #8E0000;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* === Tables === */

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: var(--bg);
}

th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: #FFF3E0;
}

/* === Login Page === */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* === Utility === */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-brand { color: var(--brand); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

/* === Správa page === */

.sprava-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.card-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.sprava-link {
    display: block;
    padding: 14px 12px;
    margin: 0 -12px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
    border-radius: 4px;
    transition: background 0.1s;
}

.sprava-link:hover {
    background: var(--bg);
    color: var(--brand);
}

.sprava-link + .sprava-link {
    border-top: 1px solid var(--border);
}

/* === Toner bar === */

.toner-bar-container {
    width: 50px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 2px auto;
}

.toner-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* === Monthly table === */

.monthly-table {
    font-size: 0.8rem;
    margin-top: 8px;
}

.monthly-table th,
.monthly-table td {
    padding: 0.3rem 0.5rem;
    text-align: center;
}

.monthly-table th {
    font-size: 0.7rem;
}

.monthly-table td.val-positive {
    color: var(--success);
    font-weight: 600;
}

.monthly-table td.val-negative {
    color: var(--error);
    font-weight: 600;
}

/* === Responsive === */

@media (max-width: 640px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 0.5rem 0;
        gap: 0.25rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .card {
        padding: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }
}
