:root {
    --bg: #f3f6f8;
    --bg-accent: #e7eef3;
    --surface: #ffffff;
    --ink: #1c2a33;
    --muted: #5b6b76;
    --line: #d4dee6;
    --blue: #1d4f7c;
    --blue-dark: #153a5c;
    --blue-soft: #dbeafe;
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --red: #b91c1c;
    --red-soft: #fee2e2;
    --green: #15803d;
    --green-soft: #dcfce7;
    --shadow: 0 10px 28px rgba(28, 42, 51, 0.08);
    --radius: 12px;
    --font: "IBM Plex Sans", "Segoe UI", sans-serif;
    --display: "IBM Plex Serif", Georgia, serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(29, 79, 124, 0.12), transparent 55%),
        radial-gradient(ellipse 50% 35% at 100% 0%, rgba(180, 83, 9, 0.07), transparent 50%),
        linear-gradient(180deg, var(--bg-accent), var(--bg));
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 18px 64px;
}

.brand { margin-bottom: 22px; }
.brand-mark {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 650;
    margin-bottom: 8px;
}
.brand h1 {
    margin: 0 0 8px;
    font-family: var(--display);
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}
.brand p {
    margin: 0;
    color: var(--muted);
    max-width: 680px;
    line-height: 1.5;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.nav a {
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 560;
}
.nav a.active, .nav a:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}
.card h2 {
    margin: 0 0 6px;
    font-family: var(--display);
    font-size: 1.25rem;
}
.card .hint {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.92rem;
}
.field { margin-bottom: 14px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 720px) {
    .field-row { grid-template-columns: 1fr; }
}

input[type=text], input[type=password], input[type=search], select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; }
input[type=file] {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fafcfd;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 620;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.45;
}
.alert-success { background: var(--green-soft); border-color: #bbf7d0; color: #14532d; }
.alert-error { background: var(--red-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-warn { background: var(--amber-soft); border-color: #fde68a; color: #78350f; }
.alert-info { background: var(--blue-soft); border-color: #bfdbfe; color: #1e3a5f; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
th, td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
th { color: var(--muted); font-weight: 650; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 650;
}
.badge-ok { background: var(--green-soft); color: #14532d; }
.badge-warn { background: var(--amber-soft); color: #78350f; }
.badge-bad { background: var(--red-soft); color: #7f1d1d; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; }
.muted { color: var(--muted); }
.sample {
    max-height: 140px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.stat {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}
.stat .n { font-size: 1.4rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.82rem; }

.login-wrap {
    max-width: 420px;
    margin: 80px auto;
}
