@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --space: #12172B;
    --paper: #F1F4F8;
    --ink: #1B2036;
    --beacon: #2BB3A3;
    --amber: #E1A94C;
    --relay: #6C7BC2;
    --moss: #3FA66B;
    --rose: #D2685F;
    --muted: #8B93A7;
    --border: #E5E9EF;
    --border-light: #E9ECF1;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.serif { font-family: 'IBM Plex Serif', Georgia, serif; }
.mono { font-family: 'IBM Plex Mono', 'Courier New', monospace; }

a { color: inherit; }

.wrap { max-width: 1152px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header.top {
    background: var(--space);
}
header.top .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
}
header.top .brand { display: flex; align-items: center; gap: 12px; }
header.top .brand-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
header.top h1 { margin: 0; font-size: 18px; color: #fff; line-height: 1.2; }
header.top p { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,0.5); }
header.top .who { font-size: 12px; color: rgba(255,255,255,0.6); text-align: right; }
header.top .who a { color: #fff; text-decoration: underline; opacity: 0.8; }
header.top .who a:hover { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 500;
    padding: 9px 16px; border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer; text-decoration: none;
    transition: opacity .15s;
}
.btn:hover { opacity: 0.9; }
.btn-dark { background: var(--space); color: #fff; }
.btn-beacon { background: var(--beacon); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: #D5DAE3; }
.btn-outline:hover { background: #f8f9fb; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 999px; }

/* ---------- Stat strip ---------- */
.stat-strip {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    background: rgba(255,255,255,0.12);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
}
@media (min-width: 640px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-cell { background: var(--space); padding: 20px; }
.stat-label {
    display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: rgba(255,255,255,0.55);
}
.stat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.stat-value { font-family: 'IBM Plex Mono', monospace; font-size: 26px; }

/* ---------- Tabs / filter pills ---------- */
.tabs, .pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab, .pill {
    font-size: 14px; padding: 8px 16px; border-radius: 8px;
    border: 1px solid #E0E4EA; background: #fff; color: var(--muted);
    cursor: pointer; text-decoration: none; display: inline-block;
}
.pill { border-radius: 999px; padding: 6px 14px; }
.tab.active, .pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.filters select, .filters input[type=text], .search-box input {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px; padding: 9px 12px; border-radius: 8px;
    border: 1px solid #D5DAE3; color: var(--ink); background: #fff;
}
.filters select:focus, .filters input:focus, .search-box input:focus {
    outline: none; box-shadow: 0 0 0 2px rgba(43,179,163,0.4);
}
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box input { width: 100%; padding-left: 34px; }
.search-box .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }

/* ---------- Table ---------- */
.table-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #F7F9FB; }
th {
    text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
    white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; vertical-align: top; }
tbody tr:hover { background: #F8FAFC; }
tbody tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.data { font-family: 'IBM Plex Mono', monospace; }
.text-right { text-align: right; }

/* ---------- Status pill ---------- */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500; padding: 4px 10px;
    border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
select.status-select {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; border-radius: 999px; padding: 4px 10px; border: 1px solid;
}

/* ---------- Empty state ---------- */
.empty {
    border: 1px dashed #CBD3DE; border-radius: 12px;
    text-align: center; padding: 64px 20px; color: var(--muted);
}
.empty .icon-circle {
    width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 16px;
    background: rgba(43,179,163,0.1); display: flex; align-items: center; justify-content: center;
}
.empty .title { font-family: 'IBM Plex Serif', serif; font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* ---------- Alerts ---------- */
.alert {
    font-size: 14px; margin-bottom: 20px; padding: 10px 16px;
    border-radius: 8px; border: 1px solid;
}
.alert-error { background: rgba(210,104,95,0.08); border-color: rgba(210,104,95,0.3); color: var(--rose); }
.alert-success { background: rgba(63,166,107,0.08); border-color: rgba(63,166,107,0.3); color: var(--moss); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
    width: 100%; font-size: 14px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid #D5DAE3; color: var(--ink); font-family: 'IBM Plex Sans', sans-serif;
}
.field input:focus, .field select:focus { outline: none; box-shadow: 0 0 0 2px rgba(43,179,163,0.4); }
.field .error { display: block; font-size: 12px; color: var(--rose); margin-top: 4px; }

/* ---------- Slide-over panel ---------- */
.overlay {
    position: fixed; inset: 0; background: rgba(18,23,43,0.5);
    display: none; z-index: 50;
}
.overlay.open { display: block; }
.panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 420px;
    background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    z-index: 51; display: none; flex-direction: column;
    transform: translateX(100%); transition: transform .2s ease;
}
.panel.open { display: flex; transform: translateX(0); }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-family: 'IBM Plex Serif', serif; font-size: 18px; margin: 0; }
.panel-head button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 24px; }

/* ---------- Login pages ---------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--space); padding: 20px;
}
.login-card {
    background: #fff; border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 380px;
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-card h1 { font-family: 'IBM Plex Serif', serif; font-size: 20px; margin: 0; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }

.footer-link { font-size: 12px; margin-top: 24px; color: var(--muted); text-decoration: underline; background: none; border: none; cursor: pointer; }
.footer-link:hover { opacity: 0.7; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }

main.content { padding: 32px 0 64px; }
