/* ==========================================================================
   MojeZdraví 2.0 — Modern Desktop Health Cockpit CSS
   Optimalizováno pro PC a notebooky (1080p / 1440p)
   ========================================================================== */

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

:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --accent: #f59e0b;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #10b981;
    --success-light: #ecfdf5;
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px 0 rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
    --nav-h: 68px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Desktop top navigation ──────────────────────────────── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
}

.header-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}

.logo-icon {
    color: #ef4444;
    font-size: 1.35rem;
}

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

.badge-version {
    font-size: 0.7rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.95rem;
    color: var(--text-light);
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-alt);
}
.nav-link:hover i {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.nav-link.active i {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-action-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.15s;
}
.nav-action-link:hover {
    color: var(--text);
    background: var(--border-light);
}

.logout-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.logout-link:hover {
    color: var(--danger);
    border-color: #fca5a5;
    background: var(--danger-light);
}

/* ── Layout Container ────────────────────────────────────── */
.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 32px 28px 48px;
    flex: 1;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── KPI Grid ────────────────────────────────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
}

.kpi-card.red::before    { background: #ef4444; }
.kpi-card.blue::before   { background: #2563eb; }
.kpi-card.green::before  { background: #10b981; }
.kpi-card.purple::before { background: #8b5cf6; }
.kpi-card.yellow::before { background: #f59e0b; }

.kpi-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.kpi-value .unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 3px;
}

.kpi-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.kpi-sub span {
    white-space: nowrap;
}

/* ── Cockpit Grid & Cards ────────────────────────────────── */
.cockpit-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-content {
    padding: 24px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    background: var(--surface-alt);
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

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

.form-control, input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
    width: 100%;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

th {
    padding: 12px 16px;
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

tr:hover td {
    background: rgba(248, 250, 252, 0.7);
}

/* ── Health Pills & Badges ───────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-optimal { background: #dcfce7; color: #15803d; }
.badge-normal  { background: #fef9c3; color: #854d0e; }
.badge-high    { background: #fed7aa; color: #9a3412; }
.badge-hyper   { background: #fee2e2; color: #991b1b; }

.badge-deficit {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}
.badge-surplus {
    background: #fed7aa;
    color: #9a3412;
    font-weight: 700;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-xs);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.page-btn:hover:not(.disabled) {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 700;
}

.page-btn.disabled {
    color: var(--text-light);
    border-color: var(--border-light);
    cursor: not-allowed;
    pointer-events: none;
    background: var(--surface-alt);
}

/* ── Day Status Badges & Recovery Radar ─────────────────── */
.badge-rest {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}
.badge-sick {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.badge-off {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.badge-normal-day {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.recovery-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.recovery-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}
.recovery-banner.status-optimal::before { background: #10b981; }
.recovery-banner.status-fatigue::before { background: #f59e0b; }
.recovery-banner.status-warning::before { background: #ef4444; }
.recovery-banner.status-rest::before    { background: #8b5cf6; }
.recovery-banner.status-sick::before    { background: #dc2626; }
.recovery-banner.status-off::before     { background: #f59e0b; }

.recovery-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 300px;
}
.recovery-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.recovery-banner.status-optimal .recovery-icon { background: #ecfdf5; color: #10b981; }
.recovery-banner.status-fatigue .recovery-icon { background: #fffbeb; color: #f59e0b; }
.recovery-banner.status-warning .recovery-icon { background: #fef2f2; color: #ef4444; }
.recovery-banner.status-rest .recovery-icon    { background: #f5f3ff; color: #8b5cf6; }
.recovery-banner.status-sick .recovery-icon    { background: #fee2e2; color: #dc2626; }
.recovery-banner.status-off .recovery-icon     { background: #fffbeb; color: #d97706; }

.recovery-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.recovery-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.day-mode-group {
    display: inline-flex;
    align-items: center;
    background: var(--surface-alt);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    gap: 4px;
}
.day-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.day-mode-btn:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
}
.day-mode-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.day-mode-btn.active.mode-rest {
    color: #6d28d9;
    background: #ede9fe;
}
.day-mode-btn.active.mode-sick {
    color: #991b1b;
    background: #fee2e2;
}
.day-mode-btn.active.mode-off {
    color: #92400e;
    background: #fef3c7;
}
.day-mode-btn.active.mode-normal {
    color: var(--primary);
    background: var(--surface);
}

/* ── Desktop Footer ──────────────────────────────────────── */
.desktop-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-inner a {
    color: var(--text-muted);
    transition: color 0.15s;
}
.footer-inner a:hover {
    color: var(--primary);
}

/* ── Print Media ─────────────────────────────────────────── */
@media print {
    .no-print { display: none !important; }
    body { background: #ffffff !important; color: #000000 !important; }
    .container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
}
