/* ============================================================
   Orion - dashboard design system
   ============================================================ */

:root {
    --bg: #0a0a0b;
    --surface: #131316;
    --surface-2: #1a1a1e;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);

    --text: #ececf1;
    --text-dim: #9a9aa5;
    --text-faint: #6b6b76;

    --accent: #6e7bff;
    --accent-soft: rgba(110, 123, 255, 0.14);

    --ok: #3fb950;
    --warn: #d29922;
    --err: #f85149;
    --unknown: #6b6b76;

    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --display: "Orbitron", "Inter", sans-serif;

    --r: 10px;
    --r-sm: 7px;
    --sidebar-w: 236px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mono {
    font-family: var(--mono);
}
.dim {
    color: var(--text-faint);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border: 3px solid var(--bg);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   App shell
   ============================================================ */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 12px;
    background: #0d0d0f;
    border-right: 1px solid var(--line);
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 10px 18px;
}

.brand-word {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 11px;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 2;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-soft);
    color: #fff;
}

.nav-item-muted {
    color: var(--text-faint);
}

.sidebar-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.health {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--line);
}

.health-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.health-text strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.health-text span {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-faint);
}

.sidebar-scrim {
    display: none;
}

/* ---- Main ---- */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 32px;
    background: rgba(10, 10, 11, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.topbar-titles h1 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.topbar-titles p {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 1px;
}

.topbar .sidebar-toggle {
    display: none;
}

.view-wrap {
    padding: 24px 32px 56px;
    flex: 1;
}

/* ============================================================
   Orion logo (identity mark)
   ============================================================ */
.orion-logo {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.orion-logo.small {
    width: 28px;
    height: 28px;
}
.orion-logo .orion-track {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.orion-logo.small .orion-track {
    inset: 2px;
}
.orion-logo .planet-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0e0e0;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.15), 0 0 4px rgba(255, 255, 255, 0.3);
}
.orion-logo.small .planet-core {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.12), 0 0 2px rgba(255, 255, 255, 0.2);
}
.orion-logo .orion-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    animation: orion-spin 2.4s linear infinite;
}
.orion-logo.small .orion-ring {
    inset: 2px;
}
.orion-logo .orion-ring::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 50%;
    height: 1px;
    transform-origin: right center;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.2), transparent);
}
.orion-logo .moon {
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}
.orion-logo.small .moon {
    width: 3px;
    height: 3px;
    margin-top: -1.5px;
    margin-left: -1.5px;
}

@keyframes orion-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .orion-logo .orion-ring {
        animation: none;
    }
}

/* ============================================================
   Controls
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.button svg {
    width: 14px;
    height: 14px;
}

.button:hover {
    background: var(--surface-2);
    border-color: var(--text-faint);
}

.button-ghost {
    background: transparent;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}

.switch input {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Segmented control (repo filters, periods, modes) */
.segmented,
.aggregate-nav,
.chart-mode-nav,
.stream-period-nav {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    flex-wrap: wrap;
}

.segmented button,
.actions-filter,
.period-button,
.aggregate-button,
.chart-mode-button,
.tab-button {
    padding: 6px 13px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.segmented button:hover,
.actions-filter:hover,
.period-button:hover,
.aggregate-button:hover,
.chart-mode-button:hover,
.tab-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.segmented button.active,
.actions-filter.active,
.period-button.active,
.aggregate-button.active,
.chart-mode-button.active,
.tab-button.active {
    background: var(--accent-soft);
    color: #fff;
}

.refresh-button {
    padding: 7px 13px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.refresh-button:hover {
    background: var(--surface-2);
}

/* ============================================================
   Cards
   ============================================================ */
.card,
.service-card,
.stream-card,
.chart-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.card-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.card-head h3 {
    font-size: 14px;
    font-weight: 600;
}

.card-head p {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 3px;
}

.settings-card {
    margin-bottom: 20px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 18px;
}

/* ============================================================
   Status indicators
   ============================================================ */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    background: var(--unknown);
}

.status-indicator.operational,
.status-indicator.ok,
.status-indicator.success {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16);
}
.status-indicator.degraded,
.status-indicator.warn {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.16);
}
.status-indicator.down,
.status-indicator.err,
.status-indicator.failure {
    background: var(--err);
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.16);
}
.status-indicator.unknown {
    background: var(--unknown);
}

/* ---- Overall status banner ---- */
.overall-status {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 20px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.overall-status h2 {
    font-size: 16px;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--line-strong);
}

.status-badge.operational {
    color: var(--ok);
    border-color: rgba(63, 185, 80, 0.35);
    background: rgba(63, 185, 80, 0.1);
}
.status-badge.degraded {
    color: var(--warn);
    border-color: rgba(210, 153, 34, 0.35);
    background: rgba(210, 153, 34, 0.1);
}
.status-badge.down {
    color: var(--err);
    border-color: rgba(248, 81, 73, 0.35);
    background: rgba(248, 81, 73, 0.1);
}

.status-count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-faint);
}

/* ---- Infrastructure metric tiles ---- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.metric-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.metric-value {
    font-family: var(--mono);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 10px 0 12px;
}

.metric-bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--ok);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.metric-fill.degraded {
    background: var(--warn);
}
.metric-fill.down {
    background: var(--err);
}
.metric-fill.unknown {
    background: var(--unknown);
}

/* ---- Service blocks ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
    gap: 14px;
}

.service-card {
    overflow: hidden;
}

.service-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.service-info h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
}

.service-info h3 svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.block-glyph {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.action-meta {
    flex-shrink: 0;
    justify-content: flex-end;
}

.service-info p {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 3px;
}

.endpoints {
    display: flex;
    flex-direction: column;
}

.endpoint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
}

.endpoint:last-child {
    border-bottom: none;
}

.endpoint-name {
    font-size: 13px;
    color: var(--text);
}

.endpoint-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.response-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.last-updated {
    margin-top: 18px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

/* ============================================================
   Stream (revenue)
   ============================================================ */
.stream-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stream-card {
    padding: 16px 18px;
}

.stream-card-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.stream-card-value {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 8px;
}

.stream-card-sub {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 4px;
}

.stream-controls,
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.period-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
}

.period-arrow:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.period-arrow:disabled {
    pointer-events: none;
    opacity: 0.35;
}

.period-text {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    padding: 0 8px;
    white-space: nowrap;
}

.period-date-input {
    padding: 6px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
}

/* Multiselect dropdowns */
.multiselect {
    position: relative;
    display: inline-block;
}

.multiselect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}

.ms-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.ms-arrow {
    font-size: 9px;
    color: var(--text-faint);
}

.multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 260px;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.multiselect.open .multiselect-dropdown {
    display: block;
}

.ms-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    cursor: pointer;
}

.ms-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ms-check {
    accent-color: var(--accent);
}

.ms-meta {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.multiselect-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    margin-top: 6px;
}

.multiselect-actions button,
.multiselect-confirm,
.ms-done,
.ms-cancel {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
}

.multiselect-confirm,
.ms-done {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Chart */
.chart-container {
    padding: 18px;
    margin-bottom: 20px;
}

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

.chart-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#chart-tooltip {
    display: none;
    white-space: nowrap;
    position: absolute;
    z-index: 60;
    padding: 9px 11px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    font-size: 12px;
}

.tt-label {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--text-faint);
    margin-bottom: 4px;
}

.tt-value {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
}

.tt-detail {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 3px;
}

#retention-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 12px;
}

/* Tables (stream + generic) */
.stream-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    font-size: 13px;
}

.stream-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.stream-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.stream-table tr:last-child td {
    border-bottom: none;
}

.stream-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.stream-product {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.stream-product-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    object-fit: contain;
    flex-shrink: 0;
}

.stream-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    white-space: nowrap;
}

.stream-badge.new-sub {
    color: var(--ok);
    border-color: rgba(63, 185, 80, 0.35);
    background: rgba(63, 185, 80, 0.1);
}
.stream-badge.renewal {
    color: var(--accent);
    border-color: rgba(110, 123, 255, 0.35);
    background: var(--accent-soft);
}
.stream-badge.refunded {
    color: var(--err);
    border-color: rgba(248, 81, 73, 0.35);
    background: rgba(248, 81, 73, 0.1);
}
.stream-badge.one-time {
    color: var(--warn);
    border-color: rgba(210, 153, 34, 0.35);
    background: rgba(210, 153, 34, 0.1);
}

/* ============================================================
   Actions (CI runs)
   ============================================================ */
.actions-list {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.action-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--unknown);
}

.action-status-dot.success {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16);
}
.action-status-dot.failure,
.action-status-dot.timed_out {
    background: var(--err);
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.16);
}
.action-status-dot.in_progress,
.action-status-dot.queued {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.16);
}
.action-status-dot.cancelled,
.action-status-dot.skipped {
    background: var(--unknown);
}

.action-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-item:last-child {
    border-bottom: none;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.025);
}

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

.action-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.action-repo {
    font-family: var(--mono);
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
}

.action-commit {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-details,
.action-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.action-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-left: auto;
    white-space: nowrap;
}

/* Pagination */
.pagination,
.actions-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    padding: 6px 13px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--surface-2);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination-info {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-faint);
}

/* ============================================================
   Notifications
   ============================================================ */
.notif-list {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.notif-title {
    font-size: 13.5px;
    font-weight: 600;
}

.notif-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-left: auto;
    white-space: nowrap;
}

.notif-message {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}

/* ============================================================
   States
   ============================================================ */
.loading {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}

.error {
    padding: 24px;
    background: rgba(248, 81, 73, 0.06);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: var(--r);
    text-align: center;
}

.error h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--err);
    margin-bottom: 6px;
}

.error p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 14px;
}

/* ============================================================
   Login
   ============================================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(60% 45% at 50% 0%, rgba(110, 123, 255, 0.1), transparent 70%),
        var(--bg);
}

.login-box {
    width: 100%;
    max-width: 360px;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
}

.login-brand h1 {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 12px;
}

.login-brand p {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 5px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.field input {
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error {
    display: none;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--err);
    font-size: 12.5px;
}

.login-submit {
    padding: 11px 16px;
    border-radius: var(--r-sm);
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.login-submit:hover {
    background: #7d89ff;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .app {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(0, 0, 0, 0.6);
    }

    .sidebar-scrim[hidden] {
        display: none;
    }

    .topbar .sidebar-toggle {
        display: inline-flex;
    }

    .topbar {
        padding: 14px 18px;
    }

    .view-wrap {
        padding: 18px 18px 48px;
    }

    .services-grid,
    .metrics-grid,
    .stream-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .action-time,
    .notif-time {
        margin-left: 0;
    }

    .stream-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
