:root {
    --ink: #0A2540;
    --ink-soft: #48607a;
    --mute: #7488a0;
    --ground: #F6F9FC;
    --card: #fff;
    --line: #E2E9F0;
    --blue: #1476BE;
    --teal: #0B7C74;
    --teal-l: #12B3A8;
    --brand-soft: #EAF2FA;
    --danger: #A11C13;
    --danger-bg: #FBE9E7;
    --shadow: 0 1px 2px rgba(10,37,64,.05), 0 8px 24px -18px rgba(10,37,64,.3);
    --radius: .6rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

/* ---------- přihlášení ---------- */

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--brand-soft), var(--ground));
}
.login-card {
    width: 100%;
    max-width: 22rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    display: grid;
    gap: .85rem;
}
.login-mark { font-size: 2rem; }
.login-card h1 { font-size: 1.2rem; margin: 0; }
.login-card .muted { margin: -.5rem 0 .5rem; color: var(--mute); font-size: .9rem; }
.login-card label { display: grid; gap: .3rem; font-size: .85rem; color: var(--ink-soft); }
.login-card input {
    font: inherit;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
    background: #fff;
    color: var(--ink);
}
.login-card input:focus-visible,
.range input:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}
button {
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: .6rem .9rem;
    border: 0;
    border-radius: .45rem;
    background: var(--blue);
    color: #fff;
}
button:hover { background: #0E5A8A; }
.alert {
    background: var(--danger-bg);
    color: var(--danger);
    padding: .55rem .75rem;
    border-radius: .45rem;
    font-size: .88rem;
}

/* ---------- topbar ---------- */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.25rem;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.range { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.range label { font-size: .8rem; color: var(--ink-soft); display: flex; align-items: center; gap: .35rem; }
.range input {
    font: inherit; padding: .35rem .5rem; border: 1px solid var(--line);
    border-radius: .4rem; background: #fff; color: var(--ink);
}
.range button { padding: .4rem .8rem; }
.range .quick {
    font-size: .8rem; padding: .35rem .6rem; border: 1px solid var(--line);
    border-radius: 999px; text-decoration: none; color: var(--ink-soft); background: #fff;
}
.range .quick:hover { border-color: var(--blue); color: var(--blue); }
.logout { font-size: .85rem; text-decoration: none; color: var(--mute); }
.logout:hover { color: var(--danger); }

/* ---------- layout ---------- */

.wrap { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; display: grid; gap: 1.25rem; }

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: .85rem;
}
.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; margin: .25rem 0; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .78rem; color: var(--mute); }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem 1.4rem;
    box-shadow: var(--shadow);
}
.panel h2 { font-size: 1rem; margin: 0 0 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }

/* ---------- tabulky ---------- */

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--mute); font-weight: 600; padding: .35rem .5rem; border-bottom: 1px solid var(--line);
}
td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
.path { display: block; font-size: .72rem; color: var(--mute); word-break: break-all; }
.muted { color: var(--mute); font-size: .9rem; }

.detail-title { font-size: 1.3rem; margin: 0 0 .2rem; }

.foot {
    font-size: .82rem;
    color: var(--mute);
    max-width: 60rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .range { margin-left: 0; width: 100%; }
}
