* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #12213f;
    --muted: #68758d;
    --primary: #1769ff;
    --primary-dark: #0e4fc5;
    --border: #dfe7f3;
    --success: #087a45;
    --danger: #b42318;
    --warning: #9a6700;
    --shadow: 0 18px 55px rgba(21, 44, 91, .11);
}

html {
    min-height: 100%;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(23, 105, 255, .13), transparent 36%),
        radial-gradient(circle at bottom right, rgba(23, 184, 166, .12), transparent 34%),
        var(--bg);
}

.auth-card {
    width: min(100%, 470px);
    padding: 34px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
}

.installer-card {
    width: min(100%, 560px);
}

.auth-brand,
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand {
    margin-bottom: 28px;
}

.auth-brand h1 {
    margin: 0 0 5px;
    font-size: 1.75rem;
}

.auth-brand p,
.auth-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-note {
    margin-top: 20px;
    font-size: .9rem;
    text-align: center;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #16a7d9);
    box-shadow: 0 9px 25px rgba(23,105,255,.28);
}

.brand-mark.large {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    border-radius: 18px;
}

label {
    display: block;
    margin-bottom: 17px;
    font-weight: 700;
}

label small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 500;
}

input {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: .18s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23,105,255,.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #0c81df);
}

.button-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #096cae);
}

.button-block {
    width: 100%;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 12px;
    line-height: 1.45;
}

.alert-success {
    color: var(--success);
    background: #e8fff2;
}

.alert-danger {
    color: var(--danger);
    background: #fff0ef;
}

.alert-warning {
    color: var(--warning);
    background: #fff7df;
}

.alert-info {
    color: #175cd3;
    background: #eff6ff;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(9,24,54,.97), rgba(11,39,73,.98)),
        #0b2141;
}

.brand {
    color: #fff;
    padding: 0 8px 23px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 3px;
    color: #aebbd0;
}

.nav {
    display: grid;
    gap: 7px;
}

.nav a,
.nav-disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 13px;
    border-radius: 11px;
    color: #eaf1ff;
}

.nav a:hover {
    background: rgba(255,255,255,.09);
}

.nav-disabled {
    color: #8e9bb0;
}

.nav-disabled small {
    font-size: .68rem;
}

.sidebar-user {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 15px;
    background: rgba(255,255,255,.05);
}

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

.sidebar-user span {
    margin: 4px 0 13px;
    color: #aebbd0;
    font-size: .85rem;
}

.sidebar-user a {
    color: #fff;
    font-weight: 700;
}

.main {
    min-width: 0;
}

.topbar {
    height: 74px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(12px);
}

.topbar strong,
.topbar span {
    display: block;
}

.topbar span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .82rem;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

.content {
    padding: 30px;
}

.welcome {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 25px;
    padding: 28px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(23,105,255,.08), rgba(22,167,217,.06)),
        var(--surface);
    box-shadow: 0 10px 30px rgba(21,44,91,.06);
}

.welcome h1,
.panel h2 {
    margin: 5px 0 8px;
}

.welcome p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.eyebrow {
    color: var(--primary);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.status-pill {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--success);
    background: #e8fff2;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card,
.panel {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 9px 24px rgba(21,44,91,.045);
}

.stat-card {
    padding: 20px;
    border-radius: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
}

.stat-card strong {
    display: block;
    margin-top: 7px;
    font-size: 2rem;
}

.panel {
    padding: 25px;
    border-radius: 20px;
}

.panel-heading {
    margin-bottom: 18px;
}

.roadmap {
    display: grid;
    gap: 12px;
}

.roadmap-item {
    display: flex;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.roadmap-item > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface-soft);
    font-weight: 900;
}

.roadmap-item strong {
    display: block;
    margin-bottom: 4px;
}

.roadmap-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.roadmap-item.done > span {
    color: var(--success);
    background: #e8fff2;
}

.roadmap-item.active {
    border-color: rgba(23,105,255,.35);
    background: #f7faff;
}

.roadmap-item.active > span {
    color: #fff;
    background: var(--primary);
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #edf2f8;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        width: 270px;
        transform: translateX(-105%);
        transition: transform .22s ease;
    }

    .menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-button {
        display: inline-block;
    }

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

@media (max-width: 600px) {
    .content,
    .topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .content {
        padding-top: 20px;
    }

    .welcome {
        display: block;
        padding: 22px;
    }

    .status-pill {
        display: inline-block;
        margin-top: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .auth-shell {
        padding: 15px;
    }

    .auth-card {
        padding: 24px;
        border-radius: 19px;
    }
}
