:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --text: #17202a;
    --muted: #64748b;
    --line: #dbe3ec;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --danger: #b42318;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-block;
    margin-right: 12px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0;
}

.topbar nav {
    display: flex;
    gap: 16px;
}

.container {
    width: min(1320px, calc(100% - 40px));
    margin: 28px auto 60px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

p {
    margin: 6px 0 0;
}

.muted,
.hint {
    color: var(--muted);
    font-size: 13px;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: #ccfbf1;
    color: #134e4a;
}

.grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

label {
    display: block;
    margin-bottom: 12px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}

input,
select {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(15, 118, 110, 0.16);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button.secondary {
    border: 1px solid #99f6e4;
    background: #ecfeff;
    color: #155e75;
}

.button.secondary:hover {
    background: #cffafe;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.stats,
.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats div,
.mini-stats div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stats span,
.mini-stats span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stats strong,
.mini-stats strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}

.danger {
    color: var(--danger);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.area-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.area-card + .area-card {
    margin-top: 12px;
}

.area-card strong,
.area-card span {
    display: block;
}

.inline-form {
    display: grid;
    grid-template-columns: 1.1fr 0.7fr 0.7fr 0.5fr auto;
    gap: 8px;
    margin-top: 12px;
}

.inline-form input {
    margin-top: 0;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.link-danger {
    color: var(--danger);
}

code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #eef2f7;
}

@media (max-width: 900px) {
    .topbar,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid.two,
    .stats,
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 24px, 1320px);
    }
}
