:root {
    color-scheme: light;
    --bg: #f4f7f9;
    --surface: #ffffff;
    --surface-soft: #edf4f5;
    --text: #17252b;
    --muted: #607179;
    --primary: #087f8c;
    --primary-dark: #05616b;
    --border: #d9e3e6;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(20, 52, 61, .09);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #eef6f6 0%, var(--bg) 42%, #f8f5ed 100%);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--primary-dark); }

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { background: rgba(255,255,255,.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.topbar__inner, .main, .footer__inner { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar__inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: white; background: var(--primary); }
.context { color: var(--muted); font-size: .9rem; }
.navigation { display: flex; align-items: center; gap: 18px; }
.navigation a { color: var(--text); text-decoration: none; font-weight: 700; }
.navigation a:hover { color: var(--primary); }
.main { padding: 56px 0 72px; }
.hero { margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--primary-dark); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -.04em; }
.lead { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card { padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 700; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #17a673; box-shadow: 0 0 0 4px #dcf7eb; }
.notice { margin: 24px 0; padding: 15px 18px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--border); }
.notice--error { color: var(--danger); background: #fff2f0; border-color: #f4c7c3; }
.login { width: min(440px, 100%); margin: 20px auto; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 700; }
.field input { width: 100%; padding: 12px 13px; border: 1px solid #bdcbd0; border-radius: 10px; background: white; color: var(--text); font: inherit; }
.field input:focus { outline: 3px solid rgba(8,127,140,.18); border-color: var(--primary); }
.button { width: 100%; padding: 12px 18px; border: 0; border-radius: 10px; color: white; background: var(--primary); font: inherit; font-weight: 750; cursor: pointer; }
.button:hover { background: var(--primary-dark); }
.button--secondary { width: auto; background: #334155; }
.button--link { display: inline-block; width: auto; text-decoration: none; }
.notice--success { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-color: #86efac; background: #f0fdf4; }
.inline-form { display: inline; margin: 0; }
.page-heading { margin-bottom: 28px; }
.admin-grid { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(360px, 1.3fr); gap: 18px; margin-top: 18px; }
.admin-section { overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; }
.count { min-width: 34px; padding: 5px 10px; border-radius: 999px; text-align: center; background: var(--surface-soft); font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #edf1f2; color: #53636a; font-size: .72rem; font-weight: 800; }
.badge--active { color: #08633f; background: #dcf7eb; }
.plain-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list strong, .plain-list small { display: block; }
.plain-list small { margin-top: 2px; color: var(--muted); }
.footer { border-top: 1px solid var(--border); color: var(--muted); }
.footer__inner { padding: 20px 0; font-size: .85rem; }

@media (max-width: 620px) {
    .topbar__inner { align-items: flex-start; flex-direction: column; padding: 14px 0; gap: 4px; }
    .main { padding-top: 38px; }
    .navigation { align-items: flex-start; flex-wrap: wrap; gap: 8px 14px; }
    .admin-grid { grid-template-columns: 1fr; }
    .notice--success { align-items: flex-start; flex-direction: column; }
}
