:root {
    --bg: #07101f;
    --panel: #101b2e;
    --panel2: #16243b;
    --line: #263753;
    --text: #eef5ff;
    --muted: #8fa3bf;
    --brand: #4f8cff;
    --green: #34d399;
    --red: #fb7185;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

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

a {
    color: #8eb5ff;
    text-decoration: none;
}

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

.shell aside {
    background: #07101f;
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #30425f #07101f;
}

.shell aside::-webkit-scrollbar {
    width: 8px;
}

.shell aside::-webkit-scrollbar-track {
    background: #07101f;
}

.shell aside::-webkit-scrollbar-thumb {
    background: #30425f;
    border-radius: 999px;
}

.shell aside::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 20px;
    padding: 0 8px 24px;
}

.brand span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f8cff, #7c5cff);
    font-size: 13px;
    font-weight: 800;
}

.shell nav {
    display: grid;
    gap: 6px;
}

.shell nav a {
    color: var(--muted);
    padding: 11px 12px;
    border-radius: 10px;
}

.shell nav a:hover,
.shell nav a.active {
    background: var(--panel2);
    color: white;
}

.account {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 16px 8px 0;
}

.account small,
.account a {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

main {
    min-width: 0;
}

header {
    height: 66px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 30px;
    background: rgba(8, 17, 31, 0.88);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 5;
}

.menu {
    display: none;
}

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

.page-title {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0 0 7px;
    font-size: 30px;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpis article,
.panel {
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

.kpis article {
    padding: 20px;
}

.kpis span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.kpis strong {
    display: block;
    margin-top: 10px;
    font-size: 26px;
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    gap: 20px;
}

.wide-left {
    grid-template-columns: minmax(460px, 1.1fr) minmax(360px, 0.9fr);
}

.narrow {
    max-width: 850px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid label {
    color: #c8d5e8;
    font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    background: #081321;
    border: 1px solid #30425f;
    border-radius: 10px;
    color: white;
    padding: 11px 12px;
    min-height: 43px;
}

.form-grid textarea {
    min-height: 90px;
    resize: vertical;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-grid small,
td small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.check {
    display: flex !important;
    align-items: center;
    gap: 9px;
}

.check input {
    width: auto !important;
    margin: 0 !important;
    min-height: auto !important;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: var(--brand);
    color: white;
}

.inline-form {
    margin-top: 22px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    font-size: 14px;
}

.good {
    color: var(--green) !important;
}

.bad {
    color: var(--red) !important;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    background: #213252;
    color: #cfe0fb;
    font-size: 11px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

.alert {
    padding: 13px 15px;
    border-radius: 11px;
    margin-bottom: 18px;
}

.alert.success {
    background: #103a31;
    color: #94f1d2;
}

.alert.danger {
    background: #431d29;
    color: #ffb5c1;
}

.cards-list {
    display: grid;
    gap: 12px;
}

.cards-list article {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px;
    background: #0c1728;
}

.cards-list article > div:first-child,
.cards-list .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cards-list p {
    color: #c7d3e4;
    font-size: 14px;
}

.cards-list small {
    display: block;
    color: var(--muted);
    margin-top: 8px;
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at top, #172b50, #07101f 55%);
}

.login-card {
    width: min(430px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
    margin: 25px 0 7px;
}

.login-card p {
    color: var(--muted);
    margin: 0 0 22px;
}

.login-card label {
    display: block;
    margin: 15px 0;
    color: #c9d6e8;
}

.login-card input {
    display: block;
    width: 100%;
    margin-top: 7px;
    background: #071321;
    border: 1px solid #30425f;
    border-radius: 10px;
    color: white;
    padding: 12px;
}

.login-card .btn {
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 1000px) {
    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-col,
    .wide-left {
        grid-template-columns: 1fr;
    }

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

    .shell aside {
        position: fixed;
        z-index: 20;
        transform: translateX(-100%);
        transition: 0.2s;
        width: 250px;
    }

    .shell.nav-open aside {
        transform: none;
    }

    .menu {
        display: inline-block;
        margin-right: 16px;
        background: none;
        border: 0;
        color: white;
        font-size: 22px;
    }

    .content {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .kpis,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full {
        grid-column: auto;
    }

    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .content {
        padding: 16px;
    }

    .panel {
        padding: 16px;
    }
}
