:root {
    --bg: #f6f7f4;
    --panel: #ffffff;
    --ink: #18211f;
    --muted: #6a736f;
    --line: #dde3de;
    --teal: #0f9f8e;
    --teal-dark: #08776d;
    --amber: #b98309;
    --red: #c94343;
    --soft-teal: #e4f7f3;
    --soft-amber: #fff4d7;
    --soft-red: #ffe8e6;
    --shadow: 0 14px 34px rgba(22, 34, 30, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}

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

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(120deg, rgba(15, 159, 142, .14), transparent 38%),
        linear-gradient(280deg, rgba(185, 131, 9, .12), transparent 34%),
        var(--bg);
}

.login-card {
    width: min(440px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 26px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--teal);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 6px;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.15;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

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

label {
    display: grid;
    gap: 7px;
    font-weight: 650;
    font-size: 14px;
}

input, select, textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

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

.button {
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--teal);
    color: white;
}

.button.secondary {
    background: #edf1ee;
    color: var(--ink);
}

.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.error {
    background: var(--soft-red);
    color: var(--red);
    border: 1px solid #f4c3bf;
    padding: 12px;
    border-radius: 8px;
    font-weight: 650;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: #14201d;
    color: #edf5f2;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand {
    margin-bottom: 30px;
}

.sidebar .brand-mark {
    background: var(--teal);
}

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

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd8d3;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 650;
}

.nav a.active, .nav a:hover {
    background: rgba(255, 255, 255, .1);
    color: white;
}

.main {
    padding: 28px;
}

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

.topbar h1 {
    font-size: 30px;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 16px;
}

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

.two-cols {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(25, 36, 32, .04);
    padding: 18px;
}

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

.metric strong {
    font-size: 28px;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

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

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

.service-card {
    display: grid;
    gap: 14px;
}

.service-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: start;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.running {
    background: var(--soft-teal);
    color: var(--teal-dark);
}

.warning {
    background: var(--soft-amber);
    color: var(--amber);
}

.error-status {
    background: var(--soft-red);
    color: var(--red);
}

.progress {
    height: 9px;
    border-radius: 999px;
    background: #edf1ee;
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--teal);
}

.progress > span.warn {
    background: var(--amber);
}

.progress > span.danger {
    background: var(--red);
}

.meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.chart {
    height: 220px;
    display: flex;
    align-items: end;
    gap: 10px;
    padding-top: 20px;
}

.bar {
    flex: 1;
    min-width: 24px;
    display: grid;
    align-items: end;
    gap: 8px;
}

.bar span {
    display: block;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #12b8a5, #08776d);
}

.bar small {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th, td {
    text-align: left;
    padding: 13px 11px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 14px;
}

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

.alert {
    padding: 14px;
    border-radius: 8px;
    background: var(--soft-amber);
    color: #725207;
    border: 1px solid #f0d083;
    font-weight: 650;
}

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

.tabs a {
    padding: 9px 12px;
    background: #edf1ee;
    border-radius: 8px;
    font-weight: 700;
    color: var(--muted);
}

.tabs a.active {
    background: var(--teal);
    color: white;
}

.integration-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.api-output {
    min-height: 120px;
    white-space: pre-wrap;
    overflow: auto;
    background: #101816;
    color: #dff7ee;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

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

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

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

    .stats, .service-grid, .two-cols {
        grid-template-columns: 1fr;
    }
}

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

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .toolbar {
        display: grid;
    }
}
