:root {
    /* Brand */
    --brand: #00AFE6;
    --brand-dark: #0090c5;
    --brand-soft: #e0f5fc;
    --primary-0: var(--brand);
    --primary-1: var(--brand-dark);
    --accent: #57BCA5;

    /* Backgrounds */
    --bg: #f0f8fd;
    --bg-0: #f0f8fd;
    --bg-1: #e3f2f9;

    /* UI */
    --panel: #ffffff;
    --ink: #0a2436;
    --muted: #4a7a91;
    --line: #b8e3f3;
    --radius: 14px;
    --shadow: 0 16px 38px rgba(0, 100, 160, 0.14);

    /* Status */
    --ok: #0b7a42;
    --ok-border: #73d5ab;
    --ok-bg: #ecfdf3;
    --warn: #b45309;
    --danger: #b42318;
}

/* ── Global reset ──────────────────────────────────── */
* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 520px at 0% -20%, #ceeef8, transparent 55%),
        radial-gradient(900px 430px at 100% 0%, #daf2ec, transparent 58%),
        var(--bg);
}

/* ── Material Symbols ──────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0;
    font-optical-sizing: auto;
    font-size: var(--icon-size, 20px);
    vertical-align: middle;
    line-height: 1;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    box-sizing: border-box;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 100, 160, 0.08);
}

.topbar-inner {
    width: min(1440px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 100%;
}

/* ── Brand ──────────────────────────────────────────── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--ink);
}

/* ── Ghost button ───────────────────────────────────── */
button.ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent !important;
    border: 1px solid #8ecde5 !important;
    border-radius: 10px !important;
    color: #1a5068;
    font-size: 13px !important;
    font-weight: 600;
    padding: 9px 14px !important;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

button.ghost:hover {
    background: #e0f5fc !important;
}

/* ── Last-refreshed chip ────────────────────────────── */
.last-refreshed-chip {
    font-size: 11px;
    color: var(--muted);
    background: #f0f8fd;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Shared card / panel ────────────────────────────── */
.card, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Shared label ───────────────────────────────────── */
label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* ── Shared form controls ───────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]), select, textarea, button {
    width: 100%;
    border: 1px solid #c4d5de !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--ink);
    font: inherit;
    padding: 9px 10px !important;
    font-size: 14px !important;
    box-sizing: border-box;
}

button {
    width: auto;
    cursor: pointer;
    background: #e8f5fc !important;
    border-color: #c4d5de !important;
    font-size: 13px !important;
    font-weight: 600;
    padding: 9px 14px !important;
}

button:hover { background: #d8f0fb !important; }

button.primary {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}

button.primary:hover { background: var(--brand-dark) !important; }

button.danger {
    background: #fef3f2 !important;
    border-color: #fda29b !important;
    color: var(--danger) !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus, select:focus-visible,
textarea:focus, textarea:focus-visible {
    outline: 2px solid var(--brand-soft) !important;
    outline-offset: 1px;
    border-color: var(--brand) !important;
    box-shadow: none !important;
}

button:focus-visible {
    outline: 2px solid var(--brand) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

/* ── Shared status badges ───────────────────────────── */
.status {
    display: inline-flex;
    align-items: center;
    border: 1px solid;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.status.ok    { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }
.status.warn  { color: var(--warn); border-color: #f7b27c; background: #fff4ed; }
.status.info  { color: #1d4ed8; border-color: #93c5fd; background: #eff6ff; }
.status.danger{ color: var(--danger); border-color: #fda29b; background: #fef3f2; }

/* ── Shared inline row ──────────────────────────────── */
.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Shared message box ─────────────────────────────── */
.msg {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    border: 1px solid #a8d9ee;
    background: #eaf6fc;
}

.msg.error {
    border-color: #fda29b;
    background: #fef3f2;
    color: var(--danger);
}

/* ── Shared muted / hint text ───────────────────────── */
.muted { color: var(--muted); font-size: 12px; }
.hint  { color: var(--muted); font-size: 12px; line-height: 1.35; }
.hidden { display: none !important; }

/* ── Shared subtitle ───────────────────────────────── */
.sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

/* ── Shared form field spacing ─────────────────────── */
.field {
    margin-bottom: 12px;
}

/* ── Shared table styles ───────────────────────────── */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

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

th, td {
    text-align: left;
    border-bottom: 1px solid #c5e9f8;
    padding: 8px;
    font-size: 12px;
    vertical-align: top;
}

th {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f0f8fd;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:hover {
    background: #f0f8fd;
}

/* ── Shared monospace ──────────────────────────────── */
.mono {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
}

/* ── Shared details / summary ──────────────────────── */
details {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: #f8fcff;
}

summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
}
