/* ============================================================
   MSALBSA DASHBOARD — "Sun & Moon" theme
   Sun-gold accent · Moon-blue secondary · Twilight indigo base
   ============================================================ */

:root {
    /* Backgrounds — deep black with slight warmth */
    --bg-deep: #0d1424;
    --bg-surface: #111a2e;
    --bg-card: rgba(19, 29, 51, 0.94);
    --bg-card-hover: rgba(24, 36, 65, 0.96);
    --bg-elevated: rgba(26, 38, 66, 0.97);
    --bg-input: rgba(15, 23, 41, 0.92);
    --bg-sidebar: rgba(15, 23, 41, 0.98);

    /* Borders — cool structure on indigo */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-active: rgba(224, 160, 42, 0.38);
    --border-panel: rgba(255, 255, 255, 0.09);

    /* Primary accent — sun gold (the sun) */
    --red: #e0a02a;
    --red-dim: rgba(224, 160, 42, 0.14);
    --red-glow: rgba(224, 160, 42, 0.18);
    --red-bright: #f5c04a;
    --red-muted: #b8842a;

    /* Secondary accent — moon blue (the moon) */
    --steel: #7d879c;
    --steel-dim: rgba(125, 135, 156, 0.12);
    --ice: #6aa8d8;
    --ice-dim: rgba(106, 168, 216, 0.14);

    /* Status — olive hill green / sun orange */
    --online: #7fae4f;
    --online-dim: rgba(127, 174, 79, 0.14);
    --offline: #3a4356;
    --warn: #e0782a;
    --warn-dim: rgba(224, 120, 42, 0.14);

    /* Danger — warm terracotta (errors) */
    --danger: #d4573a;
    --danger-dim: rgba(212, 87, 58, 0.14);

    /* Text — parchment over indigo */
    --text-primary: #f0e8d6;
    --text-secondary: #b6c0d4;
    --text-tertiary: #7e88a0;
    --text-inverse: #0d1424;

    /* Typography */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Spacing */
    --sidebar-width: 220px;
    --gap: 14px;
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;

    /* Shadows — minimal, precise */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 12px rgba(224, 160, 42, 0.06);

    /* Legacy aliases — older JS/CSS references these names */
    --emerald: var(--online);
    --amber: var(--warn);
    --violet: #7b6ca6;
    --bg-base: var(--bg-surface);
    --font-sans: var(--font-ui);
    --accent: var(--red-muted);
    --text-dim: var(--text-secondary);
}

/* --- Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Subtle top vignette — replaces the old scanline texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.015) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
}

/* --- Boot Screen --- */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.boot-content {
    text-align: center;
}

.boot-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 14px;
}

.boot-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Layout --- */
.app-layout {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: var(--red);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--text-primary);
    display: block;
}

.brand-version {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
    display: block;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    position: relative;
    letter-spacing: 0.3px;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: var(--red-bright);
    background: var(--red-dim);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--red);
    border-radius: 0 1px 1px 0;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--online);
    box-shadow: 0 0 4px var(--online);
    animation: pulse-dot 2.5s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--red);
    box-shadow: 0 0 4px rgba(224, 160, 42, 0.3);
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.sidebar-clock {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--gap);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.04) transparent;
}

.main-content::-webkit-scrollbar {
    width: 4px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap);
    padding-bottom: var(--gap);
    border-bottom: 1px solid var(--border-subtle);
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.page-title i {
    color: var(--red);
    font-size: 14px;
}

.page-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.header-badges {
    display: flex;
    gap: 8px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
}

.header-badge i {
    font-size: 9px;
}

.header-badge .badge-val {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-medium);
}

.card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.card-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-title i {
    color: var(--red-muted);
    font-size: 10px;
}

.card-body {
    padding: 14px;
}

.card-body.no-pad {
    padding: 0;
}

/* --- KPI Cards --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.kpi-card {
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

/* Left accent stripe */
.kpi-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
}

.kpi-card.cyan::after {
    background: var(--red);
}

.kpi-card.emerald::after {
    background: var(--online);
}

.kpi-card.amber::after {
    background: var(--warn);
}

.kpi-card.violet::after {
    background: var(--ice);
}

.kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-card.cyan .kpi-value {
    color: var(--red-bright);
}

.kpi-card.emerald .kpi-value {
    color: var(--online);
}

.kpi-card.amber .kpi-value {
    color: var(--warn);
}

.kpi-card.violet .kpi-value {
    color: var(--ice);
}

.kpi-trend {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: 600;
}

.kpi-trend.up {
    background: var(--online-dim);
    color: var(--online);
}

.kpi-trend.down {
    background: var(--red-dim);
    color: var(--red);
}

.kpi-spark {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 40%;
    height: 50px;
    opacity: 0.08;
    pointer-events: none;
}

/* --- Grids --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--gap);
}

.grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.grid-span-2 {
    grid-column: span 2;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto auto;
    gap: var(--gap);
}

.overview-map {
    grid-row: span 2;
}

/* --- Map --- */
.map-container {
    height: 100%;
    min-height: 380px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.map-container .leaflet-container {
    background: #08080a !important;
}

.leaflet-control-attribution {
    display: block !important;
    background: rgba(8, 8, 10, 0.55) !important;
    color: var(--text-tertiary) !important;
    font-size: 9px !important;
    line-height: 1.4 !important;
    padding: 1px 6px !important;
    border-radius: 4px 0 0 0;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}

.leaflet-control-zoom {
    display: none !important;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(224, 160, 42, 0.12) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: rgba(224, 160, 42, 0.5) !important;
    color: #c8ccd4 !important;
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    font-size: 11px !important;
}

.pulse-marker {
    width: 7px;
    height: 7px;
    background: var(--online);
    border-radius: 50%;
    box-shadow: 0 0 3px var(--online);
    position: relative;
}

.pulse-marker::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid var(--online);
    opacity: 0;
    animation: map-pulse 2.5s ease-out infinite;
}

@keyframes map-pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.offline-marker {
    width: 4px;
    height: 4px;
    background: var(--offline);
    border-radius: 50%;
    opacity: 0.35;
}

.leaflet-tooltip {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-panel) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
}

.leaflet-tooltip::before {
    border-top-color: var(--border-panel) !important;
}

/* --- Charts --- */
.chart-container {
    position: relative;
    padding: 8px;
}

.chart-container canvas {
    max-width: 100%;
}

/* --- Tables --- */
.data-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead th {
    padding: 9px 12px;
    text-align: left;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-medium);
    background: #15171c;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table thead th:hover {
    color: var(--text-secondary);
}

.data-table thead th.sort-asc::after {
    content: ' ▲';
    color: var(--red);
    font-size: 8px;
}

.data-table thead th.sort-desc::after {
    content: ' ▼';
    color: var(--red);
    font-size: 8px;
}

.data-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.data-table tbody tr {
    transition: background 0.1s ease;
}

.data-table tbody tr:hover {
    background: rgba(224, 160, 42, 0.03);
}

.mono {
    font-family: var(--font-mono);
}

.text-cyan {
    color: var(--red-bright);
}

.text-emerald {
    color: var(--online);
}

.text-amber {
    color: var(--warn);
}

.text-rose {
    color: var(--red);
}

.text-dim {
    color: var(--text-secondary);
}

.text-xs {
    font-size: 11px;
}

.bot-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.bot-status.online {
    background: var(--online);
    box-shadow: 0 0 3px var(--online);
}

.bot-status.offline {
    background: var(--offline);
}

.country-flag {
    width: 16px;
    height: 11px;
    vertical-align: middle;
    margin-right: 5px;
    border-radius: 1px;
    opacity: 0.8;
}

/* --- Toolbar --- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 10px 7px 30px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    transition: border-color 0.15s;
    outline: none;
}

.search-input:focus {
    border-color: var(--red-muted);
    box-shadow: 0 0 0 1px var(--red-dim);
}

.search-wrap {
    position: relative;
    flex: 1;
}

.search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 11px;
    pointer-events: none;
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-mono);
}

.filter-select:focus {
    border-color: var(--red-muted);
}

.filter-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.table-scroll {
    overflow-y: auto;
    max-height: 600px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.03) transparent;
}

.table-scroll::-webkit-scrollbar {
    width: 3px;
}

.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
}

.table-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--border-subtle);
    font-size: 10px;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-mono);
}

.table-footer-btn {
    padding: 3px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--text-tertiary);
    background: transparent;
    cursor: pointer;
    transition: 0.15s;
    font-family: var(--font-mono);
}

.table-footer-btn:hover {
    border-color: var(--red-muted);
    color: var(--red);
}

.table-footer-btn.active {
    background: var(--red-dim);
    border-color: var(--red-muted);
    color: var(--red);
}

/* --- Command Page --- */
.cmd-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--gap);
    min-height: calc(100vh - 110px);
}

.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    text-align: center;
    font-family: var(--font-mono);
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

.tab-btn.active {
    color: var(--red);
    border-bottom-color: var(--red);
    background: var(--red-dim);
}

.tab-content {
    display: none;
    padding: 18px;
    flex: 1;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
}

.form-input,
.form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    transition: border-color 0.15s;
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--red-muted);
    box-shadow: 0 0 0 1px var(--red-dim);
}

.form-textarea {
    resize: none;
    min-height: 120px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-mono);
}

.btn-primary {
    background: var(--red);
    color: #fff;
    border: 1px solid var(--red);
}

.btn-primary:hover {
    background: var(--red-bright);
    box-shadow: 0 2px 12px rgba(224, 160, 42, 0.25);
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(224, 160, 42, 0.2);
    color: var(--red-muted);
}

.btn-danger:hover {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red-bright);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 9px;
}

/* Command log */
.cmd-log {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.03) transparent;
}

.cmd-log-entry {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--text-tertiary);
    font-size: 11px;
    font-family: var(--font-mono);
}

.cmd-log-entry.success {
    border-left-color: var(--online);
}

.cmd-log-entry.error {
    border-left-color: var(--red);
}

.cmd-log-entry .log-time {
    font-size: 9px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.cmd-log-entry .log-msg {
    color: var(--text-secondary);
}

/* Activity feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.015);
}

.feed-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--online);
    flex-shrink: 0;
}

.feed-text {
    font-size: 11px;
    color: var(--text-secondary);
    flex: 1;
}

.feed-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.feed-time {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Bar rows */
.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.bar-label {
    width: 110px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 1px;
    background: var(--red);
    transition: width 0.6s ease;
}

.bar-fill.emerald {
    background: var(--ice);
}

.bar-val {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    width: 35px;
    text-align: right;
    flex-shrink: 0;
}

/* Danger zone */
.danger-zone {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(224, 160, 42, 0.02);
}

/* --- Toasts --- */
.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in 0.2s ease;
    min-width: 240px;
    font-family: var(--font-mono);
}

.toast.success {
    border-left: 2px solid var(--online);
}

.toast.error {
    border-left: 2px solid var(--red);
}

.toast.info {
    border-left: 2px solid var(--steel);
}

.toast i {
    font-size: 12px;
}

.toast.success i {
    color: var(--online);
}

.toast.error i {
    color: var(--red);
}

.toast.info i {
    color: var(--steel);
}

@keyframes toast-in {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.15;
    display: block;
}

.empty-state p {
    font-size: 11px;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .overview-map {
        grid-row: auto;
    }

    .cmd-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 52px;
    }

    .sidebar .brand-text,
    .sidebar .nav-item span,
    .sidebar .connection-status span,
    .sidebar-clock {
        display: none;
    }

    .sidebar-brand {
        padding: 14px;
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 10px;
    }

    .nav-item i {
        margin: 0;
    }
}

/* ============================================================
   Utilities Page
   ============================================================ */
.util-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--gap);
    flex: 1;
    min-height: 0;
}

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--ice);
    border-bottom-color: var(--ice);
}

.tab-content {
    display: none;
    flex-direction: column;
    padding: 14px;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

.util-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.util-divider {
    border-top: 1px solid var(--border-subtle);
    margin: 4px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.json-preview {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ice);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}

/* DHT Telemetry KPIs */
.dht-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.dht-kpi {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 10px;
    text-align: center;
}

.dht-kpi-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.dht-kpi-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--ice);
}

@media (max-width: 1000px) {
    .util-grid {
        grid-template-columns: 1fr;
    }

    .dht-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Login & Setup Pages
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-deep);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: login-fade-in 0.4s ease;
}

@keyframes login-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    padding: 32px 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.login-icon {
    width: 48px;
    height: 48px;
    background: var(--red);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    box-shadow: 0 0 20px rgba(224, 160, 42, 0.2);
}

.login-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-subtitle {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
}

.login-input {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
}

.login-input:focus {
    border-color: var(--red-muted);
    box-shadow: 0 0 0 2px var(--red-dim);
}

.login-input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.login-btn {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    font-size: 11px;
    letter-spacing: 2px;
}

.login-error {
    margin: 0 24px;
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(224, 160, 42, 0.08);
    border: 1px solid rgba(224, 160, 42, 0.2);
    border-left: 3px solid var(--red);
    border-radius: var(--radius-sm);
    color: var(--red-bright);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
}

.login-success {
    margin: 0 24px;
    margin-top: 16px;
    margin-bottom: 24px;
    padding: 14px;
    background: rgba(58, 138, 74, 0.08);
    border: 1px solid rgba(58, 138, 74, 0.2);
    border-left: 3px solid var(--online);
    border-radius: var(--radius-sm);
    color: var(--online);
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: center;
}

.login-lockout {
    margin: 16px 24px 24px;
    padding: 16px;
    background: rgba(224, 160, 42, 0.06);
    border: 1px solid rgba(224, 160, 42, 0.15);
    border-radius: var(--radius-sm);
    color: var(--red);
    font-family: var(--font-mono);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: center;
    justify-content: center;
}

.login-lockout svg {
    flex-shrink: 0;
    stroke: var(--red);
}

.login-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
}

.login-footer-text {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    opacity: 0.5;
}

/* Logout link styling */
.logout-link {
    color: var(--text-tertiary) !important;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s;
}

.logout-link:hover {
    color: var(--red) !important;
    opacity: 1;
    background: var(--red-dim);
}

/* ============================================================
   POLISH PASS — professional / mature refinements
   Sans-serif for interface chrome, monospace only for data.
   Softer chrome, calmer accents, more breathing room.
   ============================================================ */

/* --- Interface typography (was monospace almost everywhere) --- */
.nav-item,
.card-title,
.kpi-label,
.data-table thead th,
.btn,
.tab-btn,
.form-label,
.util-section-label,
.dht-kpi-label,
.table-footer,
.table-footer-btn,
.connection-status,
.header-badge,
.brand-name,
.brand-version,
.login-title,
.login-subtitle,
.login-label,
.login-error,
.login-lockout,
.login-success,
.login-footer-text,
.toast {
    font-family: var(--font-ui);
}

.nav-item {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.1px;
    padding: 9px 12px;
    border-radius: 6px;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.kpi-label {
    font-size: 11px;
    letter-spacing: 0.4px;
}

.data-table thead th {
    font-size: 10px;
    letter-spacing: 0.5px;
}

.btn {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 9px 16px;
    border-radius: 6px;
}

.tab-btn {
    font-size: 12px;
    letter-spacing: 0.2px;
}

.form-label,
.util-section-label,
.dht-kpi-label {
    font-size: 10.5px;
    letter-spacing: 0.3px;
}

.brand-name {
    font-size: 13px;
    letter-spacing: 1.5px;
}

.brand-version {
    letter-spacing: 1px;
}

/* --- Values / technical data stay monospaced --- */
.kpi-value,
.bar-val,
.feed-time,
.log-time,
.mono,
.json-preview,
.search-input,
.filter-select,
.form-input,
.form-textarea,
.login-input,
.header-badge .badge-val,
.sidebar-clock,
.boot-text {
    font-family: var(--font-mono);
}

/* --- Softer, calmer chrome --- */
.brand-icon {
    background: rgba(224, 160, 42, 0.12);
    border: 1px solid rgba(224, 160, 42, 0.3);
    color: var(--red-bright);
    border-radius: 8px;
    box-shadow: none;
}

.status-dot.online {
    box-shadow: none;
    animation: none;
}

.card {
    border-radius: 8px;
}

.card-header {
    padding: 12px 16px;
    background: transparent;
}

.card-body {
    padding: 16px;
}

.kpi-card {
    padding: 18px 20px;
}

.kpi-card::after {
    width: 3px;
    border-radius: 0 3px 3px 0;
}

.kpi-value {
    font-size: 24px;
    letter-spacing: -0.5px;
}

.btn-primary:hover {
    box-shadow: none;
}

.form-input,
.form-textarea,
.search-input,
.filter-select {
    border-radius: 6px;
}

.form-input:focus,
.form-textarea:focus,
.search-input:focus,
.filter-select:focus {
    border-color: var(--red-muted);
    box-shadow: 0 0 0 3px var(--red-dim);
}

.data-table tbody td {
    padding: 9px 12px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.page-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.page-title i {
    color: var(--red-muted);
}

/* --- Login surface --- */
.login-container {
    border-radius: 12px;
}

.login-icon {
    background: rgba(224, 160, 42, 0.12);
    border: 1px solid rgba(224, 160, 42, 0.3);
    color: var(--red-bright);
    border-radius: 10px;
    box-shadow: none;
}

.login-title {
    font-weight: 700;
    letter-spacing: 2px;
}

.login-subtitle {
    letter-spacing: 1px;
}

/* ============================================================
   UX PASS — accessibility, hierarchy, finishing touches
   ============================================================ */

/* Visible keyboard focus everywhere */
:focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
.nav-item:focus-visible,
.tab-btn:focus-visible,
.table-footer-btn:focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
}

/* Secondary button — neutral actions (preview, cancel, etc.) */
.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* Danger button refinement */
.btn-danger {
    background: rgba(224, 160, 42, 0.08);
    border: 1px solid rgba(224, 160, 42, 0.3);
    color: var(--red-bright);
}

/* Map tooltip */
.map-tooltip {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-panel) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
}

/* Readability: lift the smallest label sizes a touch */
.kpi-label,
.form-label,
.util-section-label,
.dht-kpi-label,
.tab-btn,
.table-footer {
    font-size: 11px;
}

.page-subtitle,
.feed-text,
.bar-label {
    font-size: 12px;
}

.login-footer-text {
    font-size: 9px;
    letter-spacing: 1.2px;
}

/* Comfortable form control sizing */
.form-input,
.form-textarea,
.search-input,
.filter-select,
.login-input {
    font-size: 12.5px;
}

.filter-select {
    padding: 8px 10px;
}

/* Nicer empty state */
.empty-state i {
    opacity: 0.28;
}

/* Subtle card transitions */
.card {
    transition: border-color 0.15s ease, background 0.15s ease;
}

/* A little more breathing room around the workspace */
.main-content {
    padding: 18px;
}

/* ============================================================
   THEME — "Sun & Moon" palette (from the emblem artwork)
   Accent = sun gold · secondary = moon blue · success = olive.
   Danger/error states keep a distinct warm terracotta.
   ============================================================ */

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 4px rgba(212, 87, 58, 0.35);
}

.kpi-trend.down {
    background: var(--danger-dim);
    color: var(--danger);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.cmd-log-entry.error {
    border-left-color: var(--danger);
}

.btn-danger {
    background: var(--danger-dim);
    border: 1px solid rgba(212, 87, 58, 0.35);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(212, 87, 58, 0.2);
    border-color: var(--danger);
    color: #e8704f;
}

.login-error {
    background: var(--danger-dim);
    border: 1px solid rgba(212, 87, 58, 0.28);
    border-left: 3px solid var(--danger);
    color: #e8825f;
}

.login-lockout {
    background: rgba(212, 87, 58, 0.08);
    border: 1px solid rgba(212, 87, 58, 0.2);
    color: #e8825f;
}

.login-lockout svg {
    stroke: var(--danger);
}

.logout-link:hover {
    color: var(--danger) !important;
    background: var(--danger-dim);
}

.danger-zone {
    background: rgba(212, 87, 58, 0.03);
}

/* --- Logo mark (the artwork) --- */
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-medium);
    display: block;
}

.login-logo {
    width: 76px;
    height: 76px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border-medium);
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   DREAMCORE — bespoke "Sun & Moon" artwork + ambience
   ============================================================ */

/* --- Emblem marks (SVG) --- */
.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    object-fit: cover;
    border: 1px solid rgba(244, 189, 76, 0.3);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(224, 160, 42, 0.12);
    display: block;
    flex: 0 0 auto;
}

.login-logo {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(244, 189, 76, 0.25);
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 26px rgba(224, 160, 42, 0.14);
}

/* --- Login: two-panel dreamcore layout --- */
.login-page.has-visual {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
    padding: 0;
}

.login-page.has-visual .login-visual {
    position: relative;
    overflow: hidden;
    background: #070b18;
}

.login-page.has-visual .login-visual img {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    display: block;
}

/* Animated dream overlay sitting on top of the artwork */
.login-page.has-visual .login-visual .login-visual-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .login-page.has-visual .login-visual .login-visual-fx {
        display: none;
    }
}

.login-page.has-visual .login-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 11, 24, 0) 55%, rgba(7, 11, 24, 0.9) 100%),
                linear-gradient(0deg, rgba(7, 11, 24, 0.8) 0%, rgba(7, 11, 24, 0) 38%);
    pointer-events: none;
}

.login-visual-caption {
    position: absolute;
    left: 36px;
    bottom: 36px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 72%;
}

.login-visual-caption .lv-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 7px;
    text-transform: uppercase;
    color: #fff3cf;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
}

.login-visual-caption .lv-tag {
    font-size: 12px;
    letter-spacing: 0.4px;
    line-height: 1.5;
    color: rgba(240, 232, 214, 0.78);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

.login-page.has-visual .login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(224, 160, 42, 0.06), transparent 70%),
        radial-gradient(70% 60% at 100% 100%, rgba(106, 168, 216, 0.05), transparent 70%);
}

.login-page.has-visual .login-container {
    background: rgba(17, 26, 46, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
    .login-page.has-visual {
        grid-template-columns: 1fr;
    }

    .login-page.has-visual .login-visual {
        display: none;
    }

    .login-page.has-visual .login-panel {
        min-height: 100vh;
    }
}

/* --- Dashboard ambience: drifting aurora + star field --- */
body::before {
    background:
        radial-gradient(42% 34% at 12% 6%, rgba(122, 90, 200, 0.12), transparent 70%),
        radial-gradient(38% 30% at 88% 12%, rgba(224, 160, 42, 0.1), transparent 70%),
        radial-gradient(50% 40% at 70% 100%, rgba(106, 168, 216, 0.08), transparent 72%),
        radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.02) 0%, transparent 55%);
    animation: dream-drift 30s ease-in-out infinite alternate;
}

@keyframes dream-drift {
    from {
        transform: translate3d(0, 0, 0) scale(1.02);
    }
    to {
        transform: translate3d(-1.4%, 1.2%, 0) scale(1.06);
    }
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
    background-image:
        radial-gradient(1.6px 1.6px at 8% 18%, rgba(255, 243, 207, 0.7), transparent 60%),
        radial-gradient(1.3px 1.3px at 24% 9%, rgba(255, 243, 207, 0.5), transparent 60%),
        radial-gradient(1.5px 1.5px at 41% 26%, rgba(188, 214, 245, 0.55), transparent 60%),
        radial-gradient(1.2px 1.2px at 57% 12%, rgba(255, 243, 207, 0.5), transparent 60%),
        radial-gradient(1.7px 1.7px at 73% 22%, rgba(255, 243, 207, 0.65), transparent 60%),
        radial-gradient(1.3px 1.3px at 88% 8%, rgba(188, 214, 245, 0.5), transparent 60%),
        radial-gradient(1.4px 1.4px at 96% 30%, rgba(255, 243, 207, 0.5), transparent 60%),
        radial-gradient(1.2px 1.2px at 14% 44%, rgba(188, 214, 245, 0.4), transparent 60%),
        radial-gradient(1.5px 1.5px at 66% 40%, rgba(255, 243, 207, 0.4), transparent 60%);
    animation: dream-twinkle 8s ease-in-out infinite alternate;
}

@keyframes dream-twinkle {
    from {
        opacity: 0.45;
    }
    to {
        opacity: 0.85;
    }
}

/* Sidebar: faint sun/moon wash so the shell feels part of the artwork */
.sidebar {
    background:
        radial-gradient(90% 50% at 50% 0%, rgba(224, 160, 42, 0.05), transparent 70%),
        radial-gradient(120% 60% at 50% 100%, rgba(106, 168, 216, 0.05), transparent 70%),
        var(--bg-sidebar);
}

/* Cards get a whisper of warmth on hover, echoing the sun */
.card:hover {
    border-color: rgba(244, 189, 76, 0.16);
}

/* Keep ambience from fighting reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}
