:root {
    --ink: #183126;
    --muted: #60766c;
    --line: #dcebe2;
    --paper: #fbfffc;
    --pink: #dff7e8;
    --lilac: #d6f0e0;
    --mint: #c9f2d8;
    --blue: #d8f4ec;
    --yellow: #edf7c9;
    --accent: #2f8f5b;
    --danger: #c94f64;
    --ok: #1f7f4f;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(135deg, #f5fff7 0%, #effbf4 45%, #f8fff0 100%);
}
a { color: inherit; }
.shell { min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.desktop-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mobile-menu { display: none; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
details.foldout summary { list-style: none; }
details.foldout summary::-webkit-details-marker { display: none; }
details.foldout summary.button { width: fit-content; }
.menu-trigger {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    border-color: #b8ddc5;
    background: #e6f5eb;
    color: var(--accent);
    font-size: 0;
    gap: 0;
}
.menu-trigger::before {
    content: "";
    width: 20px;
    height: 14px;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 6px / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 12px / 100% 2px no-repeat;
}
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    display: grid;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,.98);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(28, 82, 53, .14);
}
.menu-panel .button { justify-content: flex-start; width: 100%; }
.menu-panel .button {
    border-color: transparent;
    background: #f1faf4;
}
.menu-panel .button:hover, .desktop-nav .button:hover, .menu-trigger:hover {
    background: #dcefe4;
}
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 20px 16px 28px; }
.grid { display: grid; gap: 18px; }
.grid.cols { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.section-title { margin: 4px 0 0; font-size: 15px; color: var(--ink); }
.card {
    background: rgba(255,255,255,.88);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(28, 82, 53, .08);
}
.wrap > .card + .card,
.wrap > .card + h1,
.wrap > .card + h2,
.wrap > h1 + .card,
.wrap > h2 + .card {
    margin-top: 18px;
}
.hero {
    display: grid;
    gap: 14px;
    grid-template-columns: 1.2fr .8fr;
    align-items: center;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 6vw, 48px); letter-spacing: 0; }
.hero p { margin: 0; color: var(--muted); }
.logo-large { width: min(260px, 70vw); justify-self: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tab, button, .button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #eef8f1;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 40px;
}
.tab.active, button.primary, .button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.danger, .button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.pastel-pink { background: var(--pink); }
.pastel-lilac { background: var(--lilac); }
.pastel-mint { background: var(--mint); }
.pastel-blue { background: var(--blue); }
.pastel-yellow { background: var(--yellow); }
.stat { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.stat b { font-size: 28px; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.danger { color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
form { display: grid; gap: 10px; }
form button, form .button { justify-self: start; }
.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid button, .form-grid .button { align-self: end; }
label { display: grid; gap: 5px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    background: white;
    color: var(--ink);
    font: inherit;
}
.notice { padding: 11px 12px; border-radius: 8px; background: var(--blue); border: 1px solid #b9e6d8; }
.notice.error { background: #ffe1e8; border-color: #ffc2d0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
.check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfffc;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: #eef8f1;
    color: var(--ink);
}
.check-row input { width: auto; margin-top: 3px; }
.check-row small { color: var(--muted); font-weight: 600; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login .card { width: min(420px, 100%); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 800; background: var(--mint); }
@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; }
    .topbar { align-items: center; }
    .topbar .actions { justify-content: flex-end; }
    .desktop-nav { display: none; }
    .mobile-menu { display: block; }
    th, td { white-space: nowrap; }
}
