:root {
    color-scheme: dark;
    --bg: #0f172a;
    --card: #1e293b;
    --field: #0f172a;
    --line: rgba(148, 163, 184, 0.28);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --teal: #2dd4bf;
    --teal-strong: #14b8a6;
    --ok: #34d399;
    --danger: #fca5a5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #0f172a;
    color: var(--text);
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

a {
    color: #38bdf8;
}

.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-card,
.panel,
.action-card,
.table-wrap {
    background: #1e293b;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.45);
}

.panel,
.action-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.brand {
    margin: 0 0 0.35rem;
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-intro,
.hint,
.empty,
.sidebar-note {
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 0 1.15rem;
    color: #cbd5e1;
    font-size: 0.92rem;
    font-weight: 650;
}

.field input,
.field select {
    display: block;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    color: #f8fafc;
    font: inherit;
    font-weight: 500;
}

.field input:hover,
.field select:hover,
.field input:focus,
.field select:focus {
    border-color: var(--teal);
    outline: 2px solid rgba(45, 212, 191, 0.4);
    outline-offset: 1px;
}

.button-primary,
.link-button,
.menu-button {
    font: inherit;
    cursor: pointer;
}

.button-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.95rem 1rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--teal), var(--teal-strong));
    color: #042f2e;
    font-weight: 750;
    text-decoration: none;
}

.toolbar .button-primary,
.card-grid .button-primary {
    width: auto;
    margin-top: 0;
}

.button-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 10px 28px rgba(45, 212, 191, 0.35);
}

.alert {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(252, 165, 165, 0.4);
    border-radius: 12px;
    background: rgba(252, 165, 165, 0.12);
    color: var(--danger);
    font-weight: 700;
}

.alert-ok {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.12);
    color: var(--ok);
}

.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shell {
    min-height: 100vh;
}

.sidebar {
    display: none;
    padding: 1.25rem 1rem;
    background: #0b1220;
    border-bottom: 1px solid var(--line);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.brand-mark {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 12px;
    background: var(--teal);
    color: #042f2e;
    font-weight: 800;
}

.brand-lockup .brand {
    margin: 0;
    color: #ffffff;
}

.sidebar nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar a,
.link-button {
    display: block;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-align: left;
    text-decoration: none;
}

.sidebar a.is-active,
.sidebar a:hover,
.link-button:hover {
    border-color: rgba(45, 212, 191, 0.35);
    background: rgba(45, 212, 191, 0.12);
    color: #ffffff;
}

.sidebar form {
    margin-top: 1.5rem;
}

.menu-button {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
}

.nav-toggle:checked ~ .shell .sidebar {
    display: block;
}

.content {
    width: min(100%, 76rem);
    padding: 1.25rem 1rem 2.5rem;
}

.card-grid {
    display: grid;
    gap: 1rem;
}

.action-card h2 {
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.metric {
    margin: 0.15rem 0 0.35rem;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 750;
    letter-spacing: -0.04em;
}

.toolbar {
    margin: 0.25rem 0 0;
}

.table-wrap {
    overflow-x: auto;
    padding: 0.35rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem 1rem;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

tbody tr + tr td {
    border-top: 1px solid var(--line);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 750;
}

.badge-ok {
    background: var(--ok);
    color: #042f2e;
}

.badge-muted {
    background: #334155;
    color: #e2e8f0;
}

@media (max-width: 40rem) {
    thead {
        display: none;
    }

    tbody tr {
        display: block;
        margin: 0.65rem;
        padding: 0.4rem 0 0.75rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--bg);
    }

    tbody tr + tr td {
        border-top: 0;
    }

    td {
        display: block;
        padding: 0.45rem 0.9rem;
    }

    td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

@media (min-width: 64rem) {
    .shell {
        display: grid;
        grid-template-columns: 17.5rem minmax(0, 1fr);
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .sidebar form {
        margin-top: auto;
    }

    .menu-button {
        display: none;
    }

    .content {
        padding: 2rem 2.25rem 3rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-form.panel,
    form.panel.auth-form {
        max-width: 440px;
    }
}
