:root {
    --bg: #eef2f4;
    --panel: #ffffff;
    --line: #d5dee3;
    --text: #1e2d35;
    --muted: #5d6f78;
    --navy: #1b3a4b;
    --navy-2: #24485c;
    --accent: #2c5f6e;
    --ok: #2e7d4f;
    --warn: #9a6b00;
    --bad: #b42318;
    --radius: 4px;
    font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 48px 24px; background: var(--bg); }
.auth-wrap { width: min(460px, 100%); }
.auth-wrap.auth-wide { width: min(680px, 100%); }
.auth-card {
    background: var(--navy);
    color: #fff;
    border: 1px solid var(--navy);
    border-radius: var(--radius);
    padding: 36px 40px;
}
.auth-head { display: flex; gap: 12px; align-items: stretch; margin-bottom: 28px; }
.auth-head h1 { margin: 0; line-height: 1.2; }
.auth-head .lede { margin: 4px 0 0; }
.brand-mark {
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--navy-2); color: #fff; font-weight: 700;
    border: 1px solid #3a5d6e; border-radius: var(--radius);
}
.auth-head .brand-mark {
    align-self: stretch; width: auto; min-width: 52px; padding: 0 8px;
    font-size: 12px; letter-spacing: .04em;
}
.auth-card h1 { margin: 0 0 8px; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 8px; font-size: 13px; line-height: 1.55; }
.auth-card .lede, .auth-card .hint, .auth-card label { color: #b7c6cc; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card .input { background: #fff; color: var(--text); border-color: transparent; }
.auth-card .input:focus { border-color: #8fb4c2; }

label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.input, select.input {
    width: 100%; padding: 10px 10px; border-radius: var(--radius); margin-bottom: 16px;
    border: 1px solid var(--line); background: #fff; color: var(--text); outline: none; font-size: 13px;
}
.input:focus { border-color: var(--accent); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: var(--radius); padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn-danger { background: #fff; color: var(--bad); border: 1px solid #e4c0bc; }
.btn-sm { width: auto; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
a.btn { text-decoration: none; }
a.btn-primary { color: #fff; }
.msg { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.msg-err { background: #f8e8e6; color: #8a1f18; }
.msg-ok { background: #e7f3ea; color: #215c38; }
.msg-warn { background: #f7efd8; color: #7a5600; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; line-height: 1.55; }
.auth-card .btn { display: block; margin: 8px 0 0; line-height: 1.3; }
.auth-card .btn-primary { background: #fff; color: var(--navy); }
.auth-card .btn-primary:hover { background: #e8eef1; }
.auth-card .hint { display: block; margin: 18px 0 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
    background: var(--navy); color: #fff;
    padding: 18px 12px 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 4px 8px 20px; color: #fff; align-items: stretch; }
.sidebar .brand-mark {
    width: auto; height: auto; min-width: 44px; padding: 0 6px;
    font-size: 10px; letter-spacing: .04em; background: var(--navy-2);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-heading {
    margin: 18px 8px 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: #9fb0b8; font-weight: 650;
}
.side-nav a, .nav-soon {
    display: block; padding: 7px 10px; border-radius: var(--radius); font-size: 12px; color: #c5d2d8;
}
.side-nav a:hover, .side-nav a.is-active { background: var(--navy-2); color: #fff; }
.nav-soon { color: #8a9ea6; opacity: 1; cursor: default; }
.app-body { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px;
    background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.nav-toggle { display: none; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 11px; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; }
.brand small, .who small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.sidebar .brand small { color: #9fb0b8; }
.top-user { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.clock { color: var(--muted); font-size: 12px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar {
    width: 30px; height: 30px; border-radius: var(--radius); display: grid; place-items: center;
    background: var(--navy); color: #fff; font-size: 11px; font-weight: 650;
}
.app-main { width: min(1180px, calc(100% - 48px)); margin: 28px auto 40px; flex: 1; }
.app-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; padding: 16px 24px; display: flex; justify-content: space-between; gap: 16px; line-height: 1.5; }

.banner {
    border: 1px solid #c5d5dc; background: #e8eef1;
    border-radius: var(--radius); padding: 14px 16px; margin-bottom: 22px; color: var(--text);
    line-height: 1.55; font-size: 13px;
}
.phase-now {
    display: flex; justify-content: space-between; gap: 24px; align-items: flex-start;
    border: 1px solid #c5d5dc; background: #e8eef1;
    border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px;
}
.phase-now h2 { margin: 6px 0 10px; font-size: 16px; font-weight: 650; color: var(--text); }
.phase-now p { margin: 0; color: var(--text); line-height: 1.55; font-size: 13px; }
.kicker {
    display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
}
.status {
    display: inline; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.status-now { color: var(--ok); }
.status-done { color: var(--accent); }
.plan-list { margin: 4px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.plan-list li { margin: 0 0 10px; }
.plan-module { margin: 0 0 16px; }
.plan-module:last-child { margin-bottom: 0; }
.plan-module strong { display: block; font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.plan-module p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 22px; }
table.data tr.is-current td { background: #e8eef1; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 20px; font-weight: 650; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi, .card, .module {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.kpi { padding: 18px; }
.kpi span { color: var(--muted); font-size: 11px; }
.kpi strong { display: block; font-size: 22px; margin: 10px 0 4px; font-weight: 650; }
.kpi em { font-style: normal; color: var(--warn); font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.card { padding: 20px 22px; }
.card h2 { margin: 0 0 14px; font-size: 14px; font-weight: 650; }
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module { padding: 18px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; color: inherit; }
.module.soon { opacity: .78; }
.module h3 { margin: 0; font-size: 14px; }
.module p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span-2 { grid-column: span 2; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 30; transform: translateX(-105%); transition: transform .2s ease;
        width: min(280px, 86vw);
    }
    body.nav-open .sidebar { transform: none; }
    .nav-toggle { display: inline-flex; }
    .grid-2, .grid-3, .kpis, .modules, .form-grid { grid-template-columns: 1fr; }
    .page-head, .app-footer, .top-user, .phase-now { flex-wrap: wrap; }
}
