:root {
    --bg: #0b1220;
    --surface: #0f1a33;
    --card: #101f3d;
    --text: #e7eefc;
    --muted: #9cb2de;
    --border: rgba(255,255,255,.12);
    --primary: #4f8cff;
    --primary2: #2d6bff;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    background: radial-gradient(1200px 600px at 10% 0%, #12224b 0%, var(--bg) 45%) fixed;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none
}

    a:hover {
        text-decoration: underline
    }

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(90deg, rgba(79,140,255,.20), rgba(45,107,255,.08));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: .3px;
}

.badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.nav a {
    margin-left: 14px;
    padding: 8px 10px;
    border-radius: 10px;
}

    .nav a:hover {
        background: rgba(255,255,255,.06);
        text-decoration: none;
    }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
}

.grid {
    display: grid;
    gap: 14px;
}

    .grid.cols2 {
        grid-template-columns: 1fr 1fr
    }

    .grid.cols3 {
        grid-template-columns: 1fr 1fr 1fr
    }

@media (max-width:980px) {
    .grid.cols2,
    .grid.cols3 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    padding: 14px;
}

.h1 {
    font-size: 22px;
    margin: 0 0 6px 0
}

.sub {
    color: var(--muted);
    margin: 0 0 8px 0
}

hr.sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(79,140,255,.45);
    background: linear-gradient(180deg, rgba(79,140,255,.30), rgba(45,107,255,.18));
    color: var(--text);
    cursor: pointer;
}

    .btn:hover {
        filter: brightness(1.05)
    }

    .btn:active {
        transform: translateY(1px)
    }

    .btn.secondary {
        border-color: var(--border);
        background: rgba(255,255,255,.06);
    }

    .btn.danger {
        border-color: rgba(239,68,68,.55);
        background: rgba(239,68,68,.14);
    }

.input,
select,
textarea {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 10px;
    color: var(--text);
    font-size: 14px;
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 10px 0 6px;
}

/* Native select styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #1e2a3a;
    border: 1px solid #3a4a63;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23a8c0ff' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

    select:focus,
    .input:focus,
    textarea:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(79,140,255,.2);
    }

    select option {
        background-color: #1e2a3a;
        color: #e6edf6;
    }

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(0,0,0,.12);
}

    .table th,
    .table td {
        padding: 10px 10px;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .table th {
        color: var(--muted);
        text-align: left;
        font-weight: 600;
        background: rgba(255,255,255,.05);
    }

    .table tr:last-child td {
        border-bottom: none
    }

.kpi {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

    .kpi .num {
        font-size: 26px;
        font-weight: 800;
    }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    color: var(--muted);
}

    .tag.ok {
        border-color: rgba(34,197,94,.5);
        color: #b9f6cc
    }

    .tag.warn {
        border-color: rgba(245,158,11,.5);
        color: #ffe0a6
    }

    .tag.bad {
        border-color: rgba(239,68,68,.5);
        color: #ffc0c0
    }

.small {
    font-size: 12px;
    color: var(--muted);
}

.footer {
    color: var(--muted);
    font-size: 12px;
    padding: 16px 0;
}

.selected-row {
    background: rgba(79,140,255,.25) !important;
}

/* Select2 base */
.select2-container {
    width: 100% !important;
}

/* Main control */
.select2-container--default .select2-selection--single {
    height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.05);
    color: var(--text);
    display: flex;
    align-items: center; /* fixes vertical alignment */
}

    /* Text inside */
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: var(--text);
        line-height: normal;
        padding-left: 2px;
    }

    /* Arrow */
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 100%;
    }

/* Dropdown panel */
.select2-dropdown {
    background-color: #1e2a3a;
    border: 1px solid #3a4a63;
}

/* Options */
.select2-results__option {
    background-color: #1e2a3a;
    color: #e6edf6;
}

/* Hover */
.select2-results__option--highlighted {
    background-color: #4f8cff !important;
    color: #ffffff !important;
}

/* Selected */
.select2-results__option[aria-selected="true"] {
    background-color: rgba(79,140,255,0.25);
    color: #ffffff;
}

/* Disabled */
.select2-results__option--disabled {
    color: #6b7ea6;
}

/* Search box */
.select2-search--dropdown .select2-search__field {
    background: #0f1a33;
    color: #e6edf6;
    border: 1px solid #3a4a63;
    border-radius: 8px;
}

.row-recommended {
    box-shadow: inset 5px 0 0 var(--primary);
    font-weight: 700;
}

.row-recommended td:first-child {
    color: #b9d0ff;
}

.row-ok {
    background: rgba(34,197,94,.08);
}

.row-warn {
    background: rgba(245,158,11,.08);
}

.row-bad {
    background: rgba(239,68,68,.08);
}