:root {
    --command-ink: #17202a;
    --command-muted: #5f6f7f;
    --command-line: #d9e1e8;
    --command-bg: #f4f7f9;
    --command-panel: #ffffff;
    --command-accent: #1f6f8b;
    --command-accent-dark: #144a5e;
    --command-good: #26734d;
    --command-warn: #996d13;
    --command-bad: #a33b31;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--command-ink);
    background: var(--command-bg);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--command-accent);
    text-decoration: none;
}

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

.command-sidebar {
    background: #111b24;
    color: #fff;
    padding: 22px 18px;
}

.command-brand {
    display: grid;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 28px;
}

.command-brand img {
    width: 150px;
    height: auto;
}

.command-sidebar nav {
    display: grid;
    gap: 6px;
}

.command-sidebar nav a {
    color: #c8d3dc;
    padding: 11px 12px;
    border-radius: 6px;
}

.command-sidebar nav a.active,
.command-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.command-main {
    min-width: 0;
    padding: 28px;
}

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

.command-topbar h1 {
    margin: 4px 0 0;
    font-size: 30px;
    line-height: 1.15;
}

.eyebrow {
    margin: 0;
    color: var(--command-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--command-muted);
    white-space: nowrap;
}

.admin-identity a {
    font-weight: 700;
}

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

.metric-card,
.panel {
    background: var(--command-panel);
    border: 1px solid var(--command-line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(23, 32, 42, 0.05);
}

.metric-card {
    display: grid;
    gap: 7px;
    min-height: 126px;
    padding: 18px;
}

.metric-card span {
    color: var(--command-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-card strong {
    font-size: 30px;
    line-height: 1.1;
}

.metric-card small,
.panel-header span,
.event-row small {
    color: var(--command-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 18px;
}

.panel {
    padding: 18px;
}

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

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

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

.placeholder-panel p:last-child,
.empty-copy {
    color: var(--command-muted);
    line-height: 1.55;
}

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

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

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--command-line);
    vertical-align: top;
}

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

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

.event-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--command-line);
}

.severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e9f1f5;
    color: var(--command-accent-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-warning {
    background: #fff4d6;
    color: var(--command-warn);
}

.severity-error,
.severity-critical {
    background: #fde8e5;
    color: var(--command-bad);
}

.command-error-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.error-shell {
    width: min(460px, calc(100vw - 32px));
    padding: 28px;
    background: #fff;
    border: 1px solid var(--command-line);
    border-radius: 8px;
    text-align: center;
}

.error-shell img {
    width: 180px;
    height: auto;
}

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

    .command-sidebar {
        position: static;
    }

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

    .metric-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .command-main {
        padding: 18px;
    }

    .command-topbar,
    .admin-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .command-sidebar nav {
        grid-template-columns: 1fr;
    }
}


.command-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--command-bg);
}

.login-shell {
    width: min(460px, calc(100vw - 32px));
}

.login-panel {
    background: #fff;
    border: 1px solid var(--command-line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
    padding: 30px;
}

.login-panel img {
    width: 178px;
    height: auto;
    margin-bottom: 22px;
}

.login-panel h1 {
    margin: 6px 0 22px;
    font-size: 30px;
}

.command-login-form {
    display: grid;
    gap: 10px;
}

.command-login-form label {
    color: var(--command-muted);
    font-size: 13px;
    font-weight: 700;
}

.command-login-form input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--command-line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--command-ink);
    font: inherit;
}

.command-login-form input:focus {
    border-color: var(--command-accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.14);
    outline: none;
}

.command-login-form button {
    min-height: 46px;
    border: 0;
    border-radius: 6px;
    background: var(--command-accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.command-login-form button:disabled {
    cursor: progress;
    opacity: 0.75;
}

.form-message {
    min-height: 20px;
    color: var(--command-muted);
    font-size: 14px;
}

.form-message.error {
    color: var(--command-bad);
}

.form-message.success {
    color: var(--command-good);
}