:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #73808c;
    --line: #e4e8ed;
    --dark: #14202b;
    --dark2: #1d2c39;
    --accent: #2664d9;
    --good: #16784a;
    --warn: #a26800;
    --bad: #b63838;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        Segoe UI,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at 15% 15%,
            #273b4d,
            transparent 32%
        ),
        #101820;
}

.login-card {
    width: min(410px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 38px;
    box-shadow:
        0 30px 80px rgba(0,0,0,.3);
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--dark);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
    margin: 0;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .14em;
    font-weight: 800;
    color: #85919c;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

h2 {
    margin-bottom: 0;
}

h3 {
    margin: 6px 0 6px;
    font-size: 25px;
}

.muted {
    color: var(--muted);
    margin-bottom: 30px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 7px;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    outline: none;
}

input:focus,
select:focus {
    border-color: #9db8eb;
    box-shadow:
        0 0 0 3px rgba(38,100,217,.08);
}

.primary,
.secondary {
    border: 0;
    border-radius: 10px;
    padding: 11px 15px;
    font-weight: 750;
}

.primary {
    background: var(--dark);
    color: #fff;
}

.primary:hover {
    background: var(--dark2);
}

.secondary {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
}

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

.error-text {
    min-height: 20px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--bad);
}

.app-shell {
    display: grid;
    grid-template-columns: 230px minmax(0,1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--dark);
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 6px 7px 26px;
}

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

.brand strong {
    font-size: 16px;
}

.brand span {
    font-size: 12px;
    opacity: .55;
}

nav {
    display: grid;
    gap: 5px;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #cbd4db;
    border-radius: 9px;
    padding: 10px 11px;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,.09);
    color: #fff;
}

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

.sidebar-bottom {
    margin-top: auto;
}

#userCard {
    padding: 12px 10px;
    border-top:
        1px solid rgba(255,255,255,.1);
    border-bottom:
        1px solid rgba(255,255,255,.1);
    margin-bottom: 5px;
}

#userCard strong,
#userCard span {
    display: block;
}

#userCard strong {
    font-size: 13px;
}

#userCard span {
    margin-top: 3px;
    font-size: 11px;
    opacity: .5;
}

.content {
    min-width: 0;
    padding: 0 30px 36px;
}

.topbar {
    min-height: 86px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.status-chip {
    border-radius: 100px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 750;
}

.status-chip.neutral {
    background: #e8ecf0;
}

.status-chip.good {
    background: #e4f3ec;
    color: var(--good);
}

.status-chip.bad {
    background: #fae7e7;
    color: var(--bad);
}

.page {
    padding-top: 25px;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

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

.cards {
    display: grid;
    grid-template-columns:
        repeat(5,minmax(130px,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 17px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 27px;
    line-height: 1;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}

.filters {
    padding: 13px;
    display: grid;
    grid-template-columns: minmax(260px,1fr) 220px;
    gap: 10px;
    border-bottom: 1px solid var(--line);
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    padding: 11px 14px;
    text-align: left;
    color: var(--muted);
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f2;
}

tr:last-child td {
    border-bottom: 0;
}

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

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10,18,24,.55);
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-card {
    width: min(460px,100%);
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow:
        0 30px 90px rgba(0,0,0,.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
}

.icon-btn {
    border: 0;
    background: transparent;
    font-size: 27px;
    line-height: 1;
}

@media (max-width: 1050px) {
    .cards {
        grid-template-columns:
            repeat(2,minmax(130px,1fr));
    }
}

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

    .sidebar {
        position: static;
        height: auto;
    }

    .content {
        padding: 0 16px 25px;
    }

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