:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f2f5f4;
    --green-950: #09281f;
    --green-900: #10382c;
    --green-700: #246b52;
    --green-500: #3f9a76;
    --lime: #d9e56c;
    --line: #e4e9e7;
    --muted: #68756f;
    --white: #ffffff;
    --danger: #bb3d4a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f3f6f5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.root-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.root-sidebar {
    position: sticky; top: 0; height: 100vh; padding: 24px 18px;
    display: flex; flex-direction: column; background: var(--green-950); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    background: var(--lime); color: var(--green-950); font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: #9fb8ad; }
.root-nav { display: grid; gap: 6px; }
.root-nav a {
    display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px;
    border-radius: 12px; color: #bad0c7; font-weight: 650;
}
.root-nav a:hover, .root-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.root-nav a.active { box-shadow: inset 3px 0 0 var(--lime); }
.root-nav a.disabled { opacity: .42; cursor: default; }
.sidebar-user {
    margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.1);
    display: flex; align-items: center; gap: 11px;
}
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user small { color: #9fb8ad; margin-top: 2px; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--lime); color: var(--green-950); font-weight: 850;
}
.avatar.soft { background: #e8f1ed; color: var(--green-700); }

.root-content { min-width: 0; }
.root-topbar {
    min-height: 82px; padding: 14px 28px; display: flex; align-items: center; gap: 16px;
    background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.root-topbar h1 { margin: 0; font-size: 20px; }
.root-topbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.root-topbar form { margin-left: auto; }
.logout-button, .secondary-button {
    min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px;
    background: #fff; color: #34413c; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.menu-toggle { display: none; border: 0; background: transparent; font-size: 24px; }
.root-main { padding: 28px; max-width: 1500px; margin: 0 auto; }

.hero-panel {
    padding: 30px; border-radius: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
    color: #fff; background: linear-gradient(120deg, var(--green-950), var(--green-700));
    box-shadow: 0 18px 50px rgba(13, 56, 43, .16);
}
.hero-panel h2 { margin: 7px 0 9px; font-size: clamp(24px, 3vw, 37px); max-width: 760px; }
.hero-panel p { margin: 0; color: #cfe2da; max-width: 720px; }
.eyebrow { font-size: 11px; letter-spacing: .14em; font-weight: 900; color: var(--green-500); }
.hero-panel .eyebrow { color: var(--lime); }

.primary-button {
    min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--lime); color: var(--green-950); font-weight: 850;
}
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.stat-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 9px 0 5px; font-size: 31px; color: var(--green-950); }
.stat-card.danger strong { color: var(--danger); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; margin-top: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel-head, .page-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-head h3, .page-actions h2 { margin: 5px 0 0; }
.panel-head a { color: var(--green-700); font-weight: 800; }
.page-actions { margin-bottom: 20px; }
.page-actions p { margin: 7px 0 0; color: var(--muted); }

.user-list { margin-top: 15px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.user-main { min-width: 0; flex: 1; }
.user-main strong, .user-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.status-badge {
    display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px;
    background: #eef2f0; color: #52605a; font-size: 12px; font-weight: 800; text-transform: capitalize;
}
.status-badge.active { background: #e1f4ea; color: #21704e; }
.status-badge.suspended, .status-badge.passive { background: #fbe7e9; color: #9d3440; }
.checklist { display: grid; gap: 11px; margin-top: 15px; }
.checklist > div { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 12px; background: #f7f9f8; }
.checklist > div > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e5eae8; font-weight: 850; }
.checklist .done > span { background: #ddf1e7; color: #247052; }
.checklist .current { outline: 2px solid var(--lime); }
.checklist strong, .checklist small { display: block; }
.checklist small { color: var(--muted); margin-top: 2px; }

.alert { margin-bottom: 16px; padding: 13px 16px; border-radius: 12px; font-weight: 650; }
.alert.success { background: #e3f4eb; color: #246a4e; }
.alert.error { background: #fae8ea; color: #963742; }
.table-panel { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8faf9; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
td small, td span { display: block; }
td small { color: var(--muted); margin-top: 3px; }
.table-user { display: flex; align-items: center; gap: 11px; }

.form-panel { max-width: 900px; }
.admin-form { display: grid; gap: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.field input {
    width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #ccd6d1; border-radius: 11px; outline: none;
}
.field input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(63,154,118,.12); }
.field-error { color: var(--danger); }
.form-note { padding: 15px; border-radius: 12px; background: #f1f6f3; }
.form-note p { margin: 4px 0 0; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; }

.login-card {
    width: min(100%, 420px); margin: 10vh auto 0; padding: 28px; background: #fff;
    border: 1px solid var(--line); border-radius: 18px;
}
.login-card label { display: grid; gap: 8px; margin-top: 16px; font-weight: 700; }
.login-card input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #ccd6d1; border-radius: 10px; }
.login-card button { width: 100%; min-height: 46px; margin-top: 20px; border: 0; border-radius: 10px; font-weight: 800; background: var(--green-900); color: #fff; }
.login-error { padding: 12px; background: #fae8ea; color: #963742; border-radius: 10px; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .root-shell { display: block; }
    .root-sidebar {
        position: fixed; left: 0; top: 0; width: 270px; z-index: 100; transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar-open .root-sidebar { transform: translateX(0); }
    .menu-toggle { display: block; }
    .root-main { padding: 18px; }
    .content-grid { grid-template-columns: 1fr; }
    .hero-panel { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 650px) {
    .root-topbar { padding: 12px 15px; }
    .root-topbar p { display: none; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-actions { align-items: flex-start; flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions > * { width: 100%; }
}
