:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --border: #e3e3e7;
    --text: #1c1c1f;
    --muted: #6b6b76;
    --accent: #2f5bd6;
    --ok-bg: #e7f5ec;
    --ok-text: #1c6b3c;
    --warn-bg: #fdf3e0;
    --warn-text: #8a5a05;
    --bad-bg: #fdeaea;
    --bad-text: #a32020;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}








h1 {
    font-size: 22px;
    margin: 0 0 20px;
}

h2 {
    font-size: 15px;
    margin: 32px 0 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.banner {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.banner.warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.banner.error {
    background: var(--bad-bg);
    color: var(--bad-text);
}

.banner.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 12px;
}

.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tile-value {
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tile-label {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.actions form {
    margin: 0;
}

.btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 7px;
    padding: 8px 14px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: var(--muted);
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.small {
    padding: 4px 10px;
    font-size: 13px;
}

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

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

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

thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
}

tbody tr:last-child td {
    border-bottom: none;
}

table.kv th {
    width: 280px;
    font-weight: 500;
    color: var(--muted);
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pill.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.pill.warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.pill.bad {
    background: var(--bad-bg);
    color: var(--bad-text);
}

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.chip {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
}

.chip.active {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}

.pager {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

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

.small {
    font-size: 12px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.empty {
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
}

.nowrap {
    white-space: nowrap;
}

pre.body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 480px;
    overflow: auto;
    font-size: 13px;
    margin: 0;
}

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

td a:hover {
    text-decoration: underline;
}

/* ---- sign-in ---- */

body.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-decor .shape {
    position: absolute;
    border-radius: 22px;
    pointer-events: none;
}

.auth-decor .shape-solid {
    width: 240px;
    height: 200px;
    left: -80px;
    top: 26%;
    background: #e9e9f6;
}

.auth-decor .shape-outline {
    width: 230px;
    height: 230px;
    left: 12%;
    top: 16%;
    border: 1px solid #dededf;
}

.auth-decor .shape-dashed {
    width: 320px;
    height: 220px;
    right: 8%;
    bottom: 14%;
    border: 1px dashed #d8d8e4;
    background: #eeeef8;
}

.auth-main {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(20, 20, 40, 0.10);
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--text);
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.auth-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-tagline {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    margin: 6px 0 26px;
}

.auth-lead {
    color: var(--text);
    font-size: 15px;
    margin: 0 0 20px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-card input {
    width: 100%;
    padding: 11px 13px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 91, 214, 0.12);
}

.btn.block {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
}

.auth-alert,
.auth-note {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 7px;
    margin-bottom: 16px;
}

.auth-alert {
    background: var(--bad-bg);
    color: var(--bad-text);
}

.auth-note {
    background: var(--ok-bg);
    color: var(--ok-text);
}




/* ---- app shell ---- */

body.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 8px 22px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--text);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-name {
    font-weight: 650;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a,
.sidebar-foot button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.sidebar-nav a svg,
.sidebar-foot button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-nav a:hover,
.sidebar-foot button:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
}

.sidebar-nav a.active {
    background: rgba(47, 91, 214, 0.10);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.content {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 64px;
    max-width: 1140px;
}

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

.content-head h1 {
    margin: 0;
}

@media (max-width: 760px) {
    body.shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-brand {
        padding: 0 10px 0 0;
    }

    .sidebar-brand .brand-name {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
    }

    .sidebar-foot {
        margin: 0 0 0 auto;
        padding: 0;
        border: none;
    }

    .content {
        padding: 20px 16px 48px;
    }
}
