:root {
    --bg: #f3f6f8;
    --panel: #ffffff;
    --ink: #152033;
    --muted: #617086;
    --line: #d9e2ea;
    --brand: #0b7f8c;
    --nav: #102f42;
    --accent: #315f87;
    --ok: #258056;
    --warn: #ad6b00;
    --bad: #a53d3d;
    --soft: #edf8f9;
    --shadow: 0 16px 42px rgba(21, 32, 51, .08);
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding-left: 92px;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a { color: inherit; }

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 92px;
    background: var(--nav);
    z-index: 30;
    display: grid;
    grid-auto-rows: min-content;
    gap: 8px;
    padding: 12px 8px;
    overflow-y: auto;
}

.rail-brand,
.rail-link {
    color: #d9ebf0;
    text-decoration: none;
    border-radius: 10px;
}

.rail-brand {
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

.rail-link {
    min-height: 66px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 7px 4px;
    text-align: center;
    border: 1px solid transparent;
}

.rail-link span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    font-weight: 900;
}

.rail-link strong {
    font-size: 11px;
    line-height: 1.1;
}

.rail-link.active,
.rail-link:hover {
    background: #fff;
    color: var(--nav);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 74px;
    display: grid;
    grid-template-columns: auto minmax(360px, 720px) auto;
    gap: 18px;
    align-items: center;
    padding: 12px 22px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.company {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo,
.avatar {
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

.company-logo {
    width: 44px;
    height: 44px;
}

.company h1 {
    margin: 0;
    font-size: 20px;
}

.company p,
.profile span {
    margin: 2px 0 0;
    color: var(--muted);
}

.command {
    position: relative;
}

.command input {
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    width: 100%;
    font: inherit;
    background: #f9fbfc;
}

.command-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
}

.command-results.open {
    display: grid;
    gap: 6px;
}

.command-results a {
    text-decoration: none;
    padding: 10px;
    border-radius: 7px;
    display: grid;
    gap: 2px;
}

.command-results a:hover,
.command-results a.active {
    background: var(--soft);
    color: #075d68;
}

.command-results span {
    color: var(--muted);
    font-size: 12px;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.icon-btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    font-weight: 800;
}

.profile {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 10px 6px 6px;
    background: #fff;
}

.avatar {
    width: 34px;
    height: 34px;
    background: var(--accent);
}

.profile strong,
.profile span {
    display: block;
    white-space: nowrap;
}

.app {
    width: min(1520px, calc(100% - 32px));
    margin: 18px auto 34px;
    display: grid;
    gap: 16px;
}

.hero,
.module-hero,
.panel,
.kpis article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero,
.module-hero {
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: center;
    background: linear-gradient(115deg, rgba(11,127,140,.1), #fff 54%);
}

.eyebrow {
    color: #087180;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 12px;
    margin: 0 0 6px;
}

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

.hero h2,
.module-hero h2 {
    font-size: 34px;
    line-height: 1.08;
}

.hero p:last-child,
.module-hero p:last-child,
.month-card span,
.month-card small,
.kpis p {
    color: var(--muted);
}

.month-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
    padding: 14px;
}

.month-card strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.progress,
.readiness-list i {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: #dce6ee;
    overflow: hidden;
    margin-top: 12px;
}

.progress i,
.readiness-list i::before {
    content: "";
    display: block;
    height: 100%;
    background: var(--brand);
    width: inherit;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.kpis article,
.panel {
    padding: 16px;
}

.kpis span {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 900;
}

.kpis strong {
    display: block;
    margin-top: 7px;
    font-size: 30px;
}

.kpis .warn strong {
    color: var(--warn);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.large {
    grid-column: span 2;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-head a,
.panel-head button,
.panel-head select,
.pill {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--brand);
    text-decoration: none;
    font: inherit;
    font-weight: 800;
}

canvas {
    width: 100%;
    max-width: 100%;
}

.readiness-list,
.action-list,
.timeline,
.menu-map,
.workbench-cards {
    display: grid;
    gap: 10px;
}

.readiness-list div {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    background: #fbfcfd;
}

.readiness-list span,
.readiness-list strong {
    display: flex;
    justify-content: space-between;
}

.readiness-list span {
    color: var(--muted);
}

.action-list a,
.menu-map a,
.workbench-cards a {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    background: #fbfcfd;
    text-decoration: none;
    font-weight: 800;
}

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

.workbench-cards span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 400;
}

.alert {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    display: grid;
    gap: 3px;
    background: #fbfcfd;
}

.alert span {
    color: var(--muted);
}

.alert.warn {
    background: #fff8ed;
    border-color: #e0b56e;
}

.alert.good {
    background: #f1faf4;
    border-color: #95c6aa;
}

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

.module-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}

.mobile-tabs {
    display: none;
}

@media (max-width: 1180px) {
    body { padding-left: 76px; }
    .rail { width: 76px; }
    .rail-link strong { display: none; }
    .topbar { grid-template-columns: auto minmax(260px, 1fr) auto; }
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .large { grid-column: span 2; }
}

@media (max-width: 760px) {
    body {
        padding-left: 0;
        padding-bottom: 70px;
        font-size: 15px;
    }

    .rail { display: none; }

    .topbar {
        grid-template-columns: 1fr auto;
        padding: 10px 12px;
        gap: 10px;
    }

    .company p,
    .icon-btn,
    .profile div:not(.avatar) {
        display: none;
    }

    .command {
        grid-column: 1 / -1;
    }

    .app {
        width: 100%;
        margin: 0;
        padding: 12px;
    }

    .hero,
    .module-hero,
    .kpis,
    .dashboard-grid,
    .module-grid,
    .workbench-cards,
    .menu-map {
        grid-template-columns: 1fr;
    }

    .hero,
    .module-hero,
    .panel,
    .kpis article {
        border-radius: 8px;
    }

    .hero h2,
    .module-hero h2 {
        font-size: 25px;
    }

    .large {
        grid-column: span 1;
    }

    .mobile-tabs {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        background: var(--nav);
        padding: 6px;
        gap: 4px;
    }

    .mobile-tabs a {
        color: #dcebf0;
        text-decoration: none;
        border-radius: 8px;
        text-align: center;
        font-size: 11px;
        padding: 5px 2px;
    }

    .mobile-tabs span {
        display: block;
        font-weight: 900;
        margin-bottom: 2px;
    }

    .mobile-tabs a.active {
        background: #fff;
        color: var(--nav);
    }
}
