:root {
    --bg: #0d1117;
    --sidebar: #101722;
    --panel: #151d29;
    --panel-2: #1c2634;
    --line: #2b3747;
    --text: #eef5f8;
    --muted: #91a3b2;
    --cyan: #00b8ff;
    --green: #8bea26;
    --yellow: #ffd233;
    --red: #ff5871;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    padding: 22px 16px;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
}

.brand {
    display: grid;
    min-height: 92px;
    margin-bottom: 18px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #171218;
}

.brand img {
    width: 100%;
    max-width: 226px;
    height: auto;
}

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

nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

nav a:hover {
    background: var(--panel-2);
    color: var(--text);
}

.main {
    margin-left: 260px;
    padding: 26px;
}

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

.kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: 34px;
    line-height: 1.1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.user-menu span {
    color: var(--text);
    font-weight: 800;
}

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

.metric, .panel, .login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.metric {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

.metric strong {
    font-size: 38px;
    line-height: 1;
}

.metric strong.metric-text {
    font-size: 24px;
}

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

.panel.narrow {
    max-width: 760px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin-bottom: 0;
}

.table-wrap {
    overflow-x: auto;
}

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

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.actions {
    width: 1%;
    text-align: right;
}

.actions form {
    display: inline;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--green);
    font-weight: 900;
}

.summary {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.summary strong {
    font-size: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.button.primary {
    background: var(--green);
    color: #071007;
}

.button.secondary {
    background: var(--panel-2);
    color: var(--text);
}

.button.danger {
    background: rgba(255, 88, 113, .16);
    color: var(--red);
}

.form-grid {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f151f;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

small {
    color: var(--muted);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 440px);
}

.login-card {
    padding: 26px;
}

.login-logo {
    display: block;
    width: 100%;
    margin-bottom: 18px;
}

.alert {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 88, 113, .45);
    border-radius: 8px;
    color: #ffdbe1;
    background: rgba(255, 88, 113, .12);
}

.alert.success {
    border-color: rgba(139, 234, 38, .45);
    color: #efffd9;
    background: rgba(139, 234, 38, .12);
}

.alert span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: 18px;
    min-height: 18px;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .main {
        margin-left: 0;
        padding: 18px;
    }

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

@media (max-width: 640px) {
    .topbar, .user-menu, .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

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