/* ==========================================================================
   LevNé letenky — dashboard
   Plain CSS, no external fonts or frameworks.
   ========================================================================== */

:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --line-strong: #d1d5db;
    --accent: #0f766e;
    --accent-ink: #ffffff;
    --accent-soft: #ccfbf1;
    --gold: #b45309;
    --gold-soft: #fef3c7;
    --green: #15803d;
    --green-soft: #dcfce7;
    --red: #b91c1c;
    --red-soft: #fee2e2;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
    --shadow-lg: 0 12px 28px rgba(16, 24, 40, .08);
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0f14;
        --card: #131a22;
        --ink: #e5e7eb;
        --ink-soft: #cbd5e1;
        --muted: #94a3b8;
        --line: #243040;
        --line-strong: #334155;
        --accent: #2dd4bf;
        --accent-ink: #042f2e;
        --accent-soft: #0f3532;
        --gold: #fbbf24;
        --gold-soft: #3a2a08;
        --green: #4ade80;
        --green-soft: #0f2e1c;
        --red: #f87171;
        --red-soft: #3a1414;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-lg: 0 12px 28px rgba(0, 0, 0, .45);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.15rem; }
h2 { font-size: .95rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--mono);
    font-size: .86em;
    background: rgba(127, 127, 127, .12);
    padding: .12em .38em;
    border-radius: 5px;
}

pre {
    margin: .6rem 0;
    padding: .8rem 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.wrap {
    width: min(1280px, 100% - 2.5rem);
    margin-inline: auto;
}

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.num { text-align: right; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- top bar ---------------------------------------------------- */

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: .85rem 0;
}

.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 1.15rem;
    flex: none;
}

.brand-sub {
    margin: .1rem 0 0;
    color: var(--muted);
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.runbox {
    display: flex;
    align-items: center;
    gap: .85rem;
    font-size: .8rem;
    color: var(--muted);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.status .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--muted);
}
.status.ok .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status.err .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.status.warn .dot { background: var(--gold); }

/* ---------- buttons ---------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: .82rem;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }

.btn-small { padding: .3rem .6rem; font-size: .76rem; }
.btn-ghost { background: transparent; }

/* ---------- cards & KPI ------------------------------------------------ */

main { padding: 1.4rem 0 2.5rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .95rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .18rem;
    min-width: 0;
}

.kpi-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.kpi-value-sm { font-size: 1.15rem; }
.kpi-sub { font-size: .76rem; color: var(--muted); }

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

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 1.1rem;
    align-items: start;
}

.side { display: grid; gap: 1.1rem; }

.main-card { padding-bottom: .4rem; }

/* ---------- filters ---------------------------------------------------- */

.filters {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) 130px 140px;
    align-items: end;
    gap: .65rem .75rem;
    padding: .85rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.filters .checks {
    grid-column: 1 / span 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1.1rem;
}

.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field > span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.field-grow { flex: 1 1 200px; }
.field-narrow { flex: 0 1 120px; }

input[type="search"],
input[type="number"],
select {
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: .84rem;
}
input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.filter-actions {
    grid-column: 3 / span 2;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

/* ---------- table ------------------------------------------------------ */

.table-scroll {
    overflow-x: auto;
    margin: 0 -1.2rem;
    padding: 0 1.2rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

.offers {
    width: 100%;
    border-collapse: collapse;
    font-size: .86rem;
    min-width: 700px;
}

.offers thead th {
    background: var(--card);
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 650;
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}
.offers thead th a { color: inherit; }
.offers thead th a:hover { color: var(--accent); }

.offers tbody td {
    padding: .6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.offers tbody tr:hover { background: rgba(127, 127, 127, .045); }

.offers tr.deal td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.offers tr.deal .price strong { color: var(--accent); }

.dest { display: flex; align-items: center; gap: .55rem; }
.dest-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dest-text strong { font-weight: 600; white-space: nowrap; }
.cc {
    display: inline-block;
    font-family: var(--mono);
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.5;
    padding: .08rem .28rem;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
    vertical-align: middle;
}

.price strong { font-variant-numeric: tabular-nums; font-size: .95rem; }

.badge {
    display: inline-block;
    padding: .12rem .45rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 650;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-deal { background: var(--accent-soft); color: var(--accent); }
.badge-verified { background: var(--green-soft); color: var(--green); }
.badge-discount { background: var(--gold-soft); color: var(--gold); }
.badge-new { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.empty {
    color: var(--muted);
    padding: 1.4rem .4rem;
    text-align: center;
}

/* ---------- alerts & sparklines ---------------------------------------- */

.alerts, .sparks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .1rem;
}

.alerts li {
    padding: .55rem 0 .55rem .7rem;
    border-left: 2px solid var(--accent-soft);
    display: grid;
    gap: .12rem;
}
.alerts li:hover { border-left-color: var(--accent); }

.alert-head {
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    align-items: baseline;
}
.alert-price { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.alert-reason {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sparks { gap: .7rem; }
.sparks li { display: grid; gap: .15rem; }
.spark-head {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .82rem;
    align-items: baseline;
}
.spark { color: var(--accent); display: block; width: 100%; height: 40px; }

/* ---------- runs table ------------------------------------------------- */

.runs { width: 100%; border-collapse: collapse; font-size: .8rem; }
.runs th {
    text-align: left;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    padding: 0 .3rem .35rem;
    font-weight: 650;
}
.runs td { padding: .3rem; border-top: 1px solid var(--line); }
.runs .num { text-align: right; font-variant-numeric: tabular-nums; }

.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-right: .3rem;
    vertical-align: middle;
}
.status-dot.ok { background: var(--green); }
.status-dot.err { background: var(--red); }

/* ---------- notices ---------------------------------------------------- */

.notice { padding: 1.6rem; }
.notice h2 { margin-bottom: .6rem; }
.notice p { margin: .5rem 0; max-width: 70ch; }
.notice-error { border-color: var(--red-soft); background: var(--red-soft); }
.notice-error h2 { color: var(--red); }

/* ---------- footer ----------------------------------------------------- */

.footer {
    border-top: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    font-size: .76rem;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .85rem 0;
}

/* ---------- responsive ------------------------------------------------- */

@media (max-width: 1100px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .wrap { width: min(1280px, 100% - 1.5rem); }
    .kpis { grid-template-columns: minmax(0, 1fr); }
    .topbar-inner { flex-direction: column; align-items: flex-start; gap: .6rem; }
    .runbox { justify-content: flex-start; }
    .filters { padding: .7rem; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .checks { grid-column: 1 / -1; }
    .filter-actions { grid-column: 1 / -1; }
    .filter-actions .btn { flex: 1; }
    .card { padding: .9rem; }
    .table-scroll { margin: 0 -.9rem; padding: 0 .9rem; }
}

/* ==========================================================================
   Webhosting v2: navigace, formulář, přihlášení, tabulka watchí
   ========================================================================== */

/* ---------- navigace --------------------------------------------------- */

.nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

.nav-link {
    padding: .4rem .65rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: .85rem;
    font-weight: 550;
}
.nav-link:hover { color: var(--ink); background: var(--bg); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.nav-user {
    font-size: .8rem;
    color: var(--muted);
    padding-left: .6rem;
    border-left: 1px solid var(--line);
    margin-left: .2rem;
}

.brand-link { color: inherit; }
.brand-link:hover { text-decoration: none; }
.inline-form { display: inline; }

/* ---------- flash zprávy ------------------------------------------------ */

.flash {
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-size: .87rem;
    font-weight: 500;
}
.flash-ok { background: var(--green-soft); color: var(--green); }
.flash-err { background: var(--red-soft); color: var(--red); }
.flash-warn { background: var(--gold-soft); color: var(--gold); }

/* ---------- toolbar ----------------------------------------------------- */

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.toolbar h2 { font-size: 1.1rem; margin-bottom: .15rem; }

/* ---------- tabulka watchí ---------------------------------------------- */

.watch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    min-width: 820px;
}
.watch-table th {
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 650;
    padding: .5rem .55rem;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}
.watch-table td { padding: .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.watch-table tbody tr:hover { background: rgba(127, 127, 127, .045); }
.watch-table td.actions { white-space: nowrap; }
.watch-table td.actions .btn { margin-right: .2rem; }

.badge-on { background: var(--green-soft); color: var(--green); }
.badge-off { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.btn-danger { color: var(--red); border-color: var(--line-strong); background: transparent; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red-soft); }

/* ---------- formulář ---------------------------------------------------- */

.form-card { margin-top: 1.1rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem 1rem;
    align-items: start;
}
.form-grid .field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field > span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.form-grid input, .form-grid select { width: 100%; }

.form-grid .checks {
    display: flex;
    align-items: center;
    gap: .6rem 1.1rem;
    flex-wrap: wrap;
}
.form-grid .check span { white-space: nowrap; }
.field-inline { flex-direction: row !important; align-items: center; }
.field-inline select { width: auto; min-width: 190px; }

.field-help { font-size: .72rem; color: var(--muted); font-style: normal; line-height: 1.35; }
.field-error { font-size: .75rem; color: var(--red); font-style: normal; font-weight: 600; }

.form-actions { display: flex; gap: .6rem; padding-top: .3rem; }

.is-hidden { display: none !important; }

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

.auth-wrap { display: grid; place-items: center; min-height: 55vh; padding: 1rem 0; }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { margin-bottom: .2rem; }
.auth-card .form-grid { grid-template-columns: minmax(0, 1fr); margin-top: 1rem; }
.auth-card form button { justify-self: start; }

@media (max-width: 720px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .toolbar { flex-direction: column; }
    .nav { gap: .2rem; }
    .nav-user { display: none; }
}
