:root {
    --bg: #e7f6f8;
    --bg-2: #f4fbfc;
    --ink: #123238;
    --muted: #4d6870;
    --line: #c9e3e8;
    --card: #ffffff;
    --brand: #00a0b4;
    --accent: #007887;
    --accent-dark: #005e6b;
    --accent-soft: #e5f7f9;
    --ok: #0f6b45;
    --ok-bg: #e8f7ef;
    --err: #8d2b2b;
    --err-bg: #fdecec;
    --warn: #8a5a12;
    --warn-bg: #fff6e8;
    --shadow: 0 16px 40px rgba(0, 90, 105, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 10% -10%, #d4f1f5 0%, transparent 60%),
        radial-gradient(700px 380px at 110% 0%, #e7f3fb 0%, transparent 55%),
        var(--bg);
}

a { color: var(--accent-dark); }

.top {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 120, 135, 0.06);
}

.top::before {
    content: "";
    display: block;
    height: 5px;
    background: var(--brand);
}

.top-inner, .wrap, .foot {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
}

.top-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    display: block;
    height: 54px;
    width: auto;
}

.nav { display: flex; gap: 8px; }

.nav a {
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.95rem;
}

.wrap { padding: 28px 0 40px; }

.narrow { width: min(520px, 100%); margin: 0 auto; }

.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.hero h1, .card h1, .card h2 {
    margin: 0 0 8px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hero h1 { font-size: clamp(1.45rem, 3.6vw, 1.85rem); }

.lead, .help, .muted { color: var(--muted); }

.lead { margin: 0 0 18px; font-size: 1.05rem; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.field span, .check { font-weight: 650; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="file"] {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--bg-2);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 14px 14px;
    min-height: 52px;
}

input[type="file"] { padding: 12px; background: #fff; }

input:focus {
    outline: 3px solid rgba(0, 160, 180, 0.22);
    border-color: var(--accent);
}

.row-actions, .split, .pager, .stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn, button {
    font: inherit;
    cursor: pointer;
    border: 0;
    border-radius: 14px;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover, button:hover { background: var(--accent-dark); }

.btn.secondary, button.secondary {
    background: #e5f7f9;
    color: var(--accent-dark);
}

.btn.ghost, button.ghost {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn.danger, button.danger {
    background: var(--err);
}

.btn.full { width: 100%; }

.msg {
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 650;
}

.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.err { background: var(--err-bg); color: var(--err); }

.result {
    margin-top: 16px;
    border: 1px solid #b7e4eb;
    background: linear-gradient(180deg, #f3fcfd 0%, #fff 42%);
}

.result.missing {
    border-color: #f0dfc4;
    background: var(--warn-bg);
    color: var(--warn);
}

.who {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.who b { font-size: 1.25rem; }

.sentence {
    margin: 0 0 14px;
    font-size: 1.15rem;
    line-height: 1.45;
}

.facts { display: grid; gap: 10px; }

.fact {
    background: var(--accent-soft);
    border-radius: 16px;
    padding: 14px 16px;
}

.fact span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.fact strong {
    display: block;
    font-size: clamp(1.45rem, 4vw, 1.9rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 14px 0;
}

.stats {
    margin-bottom: 14px;
}

.stat {
    background: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
}

.stat b { display: block; font-size: 1.4rem; }

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; min-width: 680px; }

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th { font-size: 0.85rem; color: var(--muted); font-weight: 700; }

.actions { display: flex; gap: 6px; }

.actions form { margin: 0; }

.actions .btn, .actions button {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search input { flex: 1; }

.check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 600;
    margin: 8px 0 14px;
}

.check input { margin-top: 3px; }

.help { margin: 8px 0 0; font-size: 0.95rem; }

details {
    background: #fff;
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    margin-top: 14px;
}

details summary { cursor: pointer; font-weight: 750; }

.foot {
    padding: 8px 0 28px;
    color: var(--muted);
    font-size: 0.95rem;
}

.pager a, .pager span {
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
}

@media (min-width: 800px) {
    .grid-2 { grid-template-columns: 1.1fr 0.9fr; }
    .card { padding: 26px; }
}

@media (max-width: 720px) {
    .logo { height: 42px; }
    .table-wrap table { min-width: 0; }
    table, thead, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--line);
    }
    td {
        border: 0;
        padding: 6px 14px;
    }
    td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        margin-bottom: 2px;
    }
    .search { flex-direction: column; }
}

@media print {
    body { background: #fff; }
    .top, .foot, .no-print { display: none !important; }
    .card { box-shadow: none; }
}
