* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7f8;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --border: #e5ebea;
    --text: #172320;
    --muted: #6b7c77;
    --brand: #145f57;
    --brand-deep: #0c4943;
    --brand-soft: #e6f2ef;
    --danger: #a83d37;
    --danger-soft: #fbefee;
    --warning: #8a641d;
    --warning-soft: #fbf5e6;
    --blue: #315f87;
    --blue-soft: #edf4fa;
    --shadow: 0 10px 30px rgba(23, 35, 32, .06);
    --sidebar-width: 252px;
}

html,
body {
    min-height: 100%;
}

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

button,
input {
    font: inherit;
}

/* Auth */

.auth-page {
    background:
        radial-gradient(circle at 15% 15%, rgba(20, 95, 87, .12), transparent 32%),
        linear-gradient(135deg, #eff6f4 0%, #f7f9fa 55%, #eef3f4 100%);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.login-panel {
    width: min(460px, 100%);
    padding: 36px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.brand-mark,
.sidebar-logo {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .06em;
}

.login-heading {
    margin: 28px 0 28px;
}

.login-heading h1,
.topbar h1,
.welcome-strip h2,
.panel h3 {
    margin: 0;
}

.login-heading h1 {
    margin-top: 6px;
    font-size: 29px;
    letter-spacing: -.03em;
}

.login-heading p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-block;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.login-form label {
    display: block;
    margin: 17px 0 7px;
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cfd9d6;
    border-radius: 10px;
    background: #fff;
    outline: none;
    transition: .15s ease;
}

.login-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(20, 95, 87, .10);
}

.btn {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 750;
    transition: .15s ease;
}

.btn-primary {
    padding: 13px 16px;
    background: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-deep);
}

.btn-block {
    width: 100%;
    margin-top: 24px;
}

.btn-ghost {
    padding: 9px 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #f1d4d1;
}

.login-footer {
    margin-top: 24px;
    color: #91a09c;
    font-size: 12px;
    text-align: center;
}

/* App shell */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: #102c29;
    color: #dce7e4;
    transition: transform .2s ease;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #e9f4f2;
    color: #123d38;
    flex: 0 0 auto;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    color: #fff;
    font-size: 15px;
}

.sidebar-brand span {
    margin-top: 3px;
    color: #8fb0aa;
    font-size: 11px;
}

.sidebar-nav {
    padding: 18px 12px;
    flex: 1;
}

.nav-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    padding: 10px 11px;
    border-radius: 9px;
    color: #bfd1cd;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.nav-item:hover:not(.disabled) {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.nav-item.active {
    background: #e7f3f0;
    color: #123d38;
}

.nav-item.disabled {
    opacity: .58;
    cursor: default;
}

.nav-item small {
    margin-left: auto;
    color: #7fa29b;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    margin: 16px 8px;
    background: rgba(255,255,255,.08);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 20px;
    color: #86a8a2;
    font-size: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #57bd87;
    box-shadow: 0 0 0 3px rgba(87,189,135,.12);
}

.main-panel {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left .2s ease;
}

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

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h1 {
    margin-top: 3px;
    font-size: 20px;
    letter-spacing: -.02em;
}

.sidebar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
}

.user-meta strong,
.user-meta span {
    display: block;
}

.user-meta strong {
    font-size: 12px;
}

.user-meta span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.welcome-strip {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 26px;
    border: 1px solid #dbe8e5;
    border-radius: 16px;
    background:
        linear-gradient(120deg, rgba(232,244,241,.95), rgba(255,255,255,.95));
}

.welcome-strip h2 {
    margin-top: 6px;
    font-size: 24px;
    letter-spacing: -.03em;
}

.welcome-strip p {
    max-width: 760px;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.system-badge {
    min-width: max-content;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255,255,255,.8);
    border: 1px solid #d6e6e2;
    font-size: 11px;
    font-weight: 800;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.metric-card {
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(24,42,37,.035);
}

.metric-card.attention {
    border-top: 3px solid #a97924;
}

.metric-card.decision {
    border-top: 3px solid #a64b45;
}

.metric-card.administration {
    border-top: 3px solid #315f87;
}

.metric-card.transformation {
    border-top: 3px solid var(--brand);
}

.metric-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.metric-value {
    margin-top: 17px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.metric-meta {
    margin-top: 13px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    gap: 16px;
    margin-top: 18px;
}

.panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf1f0;
}

.panel h3 {
    margin-top: 5px;
    font-size: 16px;
}

.pill {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.empty-state {
    padding: 36px 10px;
    text-align: center;
}

.empty-state strong {
    display: block;
    font-size: 14px;
}

.empty-state p {
    max-width: 520px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.status-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.status-list li {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f1;
    font-size: 12px;
}

.status-list li:last-child {
    border-bottom: 0;
}

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

.status-list strong {
    color: var(--brand);
}

@media (max-width: 1060px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-panel {
        margin-left: 0;
    }

    body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(0);
        box-shadow: 12px 0 32px rgba(0,0,0,.16);
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 12px 16px;
    }

    .user-meta {
        display: none;
    }

    .content {
        padding: 18px 14px;
    }

    .welcome-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .login-panel {
        padding: 28px 22px;
    }
}
