:root {
    color-scheme: dark;
    --app-bg: #0b0d12;
    --app-surface: #121722;
    --app-border: rgba(255, 255, 255, 0.08);
    --app-text: #f1f5f9;
    --app-text-muted: #9aa4b2;
}

html,
body {
    background: radial-gradient(circle at top, #171d29 0%, #0b0d12 52%, #090b10 100%);
    color: var(--app-text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    min-height: 100%;
}

a {
    color: #9ec5fe;
}

a:hover {
    color: #cfe2ff;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}

h1:focus {
    outline: none;
}

code {
    color: #c6d4ff;
}

.overwatch-shell {
    min-height: 100vh;
}

.overwatch-main-shell {
    min-width: 0;
}

.overwatch-collapsed-toggle {
    left: 0.75rem;
    position: fixed;
    top: 0.75rem;
    z-index: 1100;
}

.overwatch-shell-sidebar-collapsed .overwatch-topbar {
    padding-left: 4.5rem !important;
}

.overwatch-sidebar {
    background: linear-gradient(180deg, rgba(17, 21, 28, 0.98), rgba(10, 12, 17, 0.98));
    flex: 0 0 20.5rem;
    max-width: 20.5rem;
    transition: flex-basis 0.2s ease, max-width 0.2s ease, opacity 0.2s ease;
}

.overwatch-sidebar-body {
    overflow-y: auto;
}

.overwatch-sidebar .panel-card {
    padding: 0.85rem;
}

.overwatch-icon-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.4rem;
}

.overwatch-icon-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 0.22rem;
}

.overwatch-icon-bars span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 1rem;
}

.overwatch-shell-sidebar-collapsed .overwatch-sidebar {
    border-right: 0 !important;
    flex-basis: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
}

.overwatch-topbar {
    background: rgba(16, 19, 26, 0.82);
    backdrop-filter: blur(12px);
}

.hero-card,
.panel-card,
.metric-card {
    background: linear-gradient(180deg, rgba(18, 23, 34, 0.96), rgba(13, 17, 25, 0.96));
    border: 1px solid var(--app-border);
    border-radius: 1.15rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.hero-card,
.panel-card {
    padding: 1rem;
}

.metric-card {
    min-height: 100%;
    padding: 1.25rem;
}

.eyebrow,
.metric-label {
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.5rem;
}

.metric-value-small {
    font-size: 1.2rem;
}

.metric-meta {
    color: var(--app-text-muted);
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

.letter-spaced {
    letter-spacing: 0.12em;
}

.narrow-panel {
    margin-inline: auto;
    max-width: 56rem;
}

.status-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
}

.status-pill-ok {
    background: rgba(31, 170, 127, 0.15);
    border-color: rgba(31, 170, 127, 0.35);
    color: #9fe4c8;
}

.status-pill-warn {
    background: rgba(199, 138, 33, 0.15);
    border-color: rgba(199, 138, 33, 0.35);
    color: #f0c979;
}

.status-pill-error {
    background: rgba(192, 86, 92, 0.18);
    border-color: rgba(192, 86, 92, 0.35);
    color: #f7b0b5;
}

.status-pill-info {
    background: rgba(90, 166, 255, 0.16);
    border-color: rgba(90, 166, 255, 0.35);
    color: #b3d3ff;
}

.status-pill-muted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #d4d8de;
}

.empty-state {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 0.9rem;
    color: var(--app-text-muted);
    padding: 1.2rem;
}

.app-nav-link {
    color: var(--bs-secondary-color);
    border: 1px solid transparent;
}

.app-nav-link:hover,
.app-nav-link:focus {
    color: var(--bs-light);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.app-nav-link.active {
    color: #f8fafc;
    background: rgba(61, 139, 253, 0.16);
    border-color: rgba(61, 139, 253, 0.45);
}

.server-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
}

.server-table thead th {
    color: var(--app-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.form-control,
.form-check-input {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--app-text);
}

.form-control:focus,
.form-check-input:focus {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(61, 139, 253, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(61, 139, 253, 0.16);
    color: var(--app-text);
}

.validation-message {
    color: #ff9f9f;
    display: block;
    margin-top: 0.35rem;
}

.btn-primary {
    background: linear-gradient(180deg, #3d8bfd, #2c74db);
    border-color: rgba(61, 139, 253, 0.72);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.18);
}

.alert-success {
    background: rgba(31, 170, 127, 0.15);
    border-color: rgba(31, 170, 127, 0.35);
    color: #c9f5e3;
}

.alert-danger {
    background: rgba(192, 86, 92, 0.15);
    border-color: rgba(192, 86, 92, 0.35);
    color: #ffd5d8;
}

.monitor-shell {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100vh - 9rem);
}

.monitor-clients,
.monitor-board {
    min-height: 0;
}

.monitor-clients {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.monitor-clients-header,
.monitor-board-header {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.monitor-clients-header h1,
.monitor-board-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.2rem 0 0;
}

.monitor-clients-header-compact {
    margin-bottom: 0.75rem;
}

.monitor-copy {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.monitor-client-actions {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    margin-bottom: 0.85rem;
}

.monitor-client-actions .btn {
    white-space: nowrap;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.monitor-client-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 0;
    overflow: auto;
}

.monitor-client-item {
    background: #1a2029;
    border: 1px solid #2e3847;
    border-radius: 0.75rem;
    color: var(--app-text);
    padding: 0.7rem 0.8rem;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.monitor-client-item:hover,
.monitor-client-item:focus {
    background: #202835;
    border-color: #435168;
}

.monitor-client-item-active {
    border-color: rgba(95, 211, 141, 0.6);
}

.monitor-client-line {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
}

.monitor-client-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.monitor-client-dot {
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 0.7rem;
    width: 0.7rem;
}

.monitor-client-dot-online {
    background: #5fd38d;
}

.monitor-client-dot-offline {
    background: #5f6775;
}

.monitor-client-id,
.monitor-client-meta {
    color: var(--app-text-muted);
    font-size: 0.78rem;
    margin-top: 0.22rem;
}

.monitor-board {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.monitor-board-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.monitor-canvas {
    background-color: #0b0e13;
    background-image: linear-gradient(rgba(26, 34, 48, 0.52) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 34, 48, 0.52) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 1rem;
    min-height: 1100px;
    position: relative;
    width: 100%;
    min-width: 1200px;
}

.monitor-empty-state {
    left: 1rem;
    max-width: 26rem;
    position: absolute;
    top: 1rem;
}

.monitor-tile {
    background: #121821;
    border: 3px solid #303949;
    border-radius: 1rem;
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    user-select: none;
}

.monitor-tile-selected {
    border-color: #5fd38d;
}

.monitor-tile-header {
    align-items: start;
    cursor: move;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem 0.6rem;
}

.monitor-tile-title {
    font-size: 1rem;
    font-weight: 600;
}

.monitor-tile-subtitle {
    color: var(--app-text-muted);
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.monitor-tile-close {
    background: transparent;
    border: 0;
    color: var(--app-text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.2rem;
}

.monitor-tile-body {
    background: #050607;
    border: 1px solid #303949;
    border-radius: 0.75rem;
    flex: 1 1 auto;
    margin: 0 0.9rem 0.7rem;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.monitor-tile-image {
    display: block;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    width: 100%;
}

.monitor-tile-overlay {
    align-items: center;
    background: rgba(11, 14, 19, 0.88);
    color: #f5f7fa;
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: absolute;
    text-align: center;
}

.monitor-tile-badges {
    align-items: center;
    bottom: 0.6rem;
    display: flex;
    gap: 0.5rem;
    left: 0.6rem;
    position: absolute;
    right: 0.6rem;
}

.monitor-tile-stamp {
    background: rgba(11, 14, 19, 0.72);
    border-radius: 999px;
    color: #dde5f0;
    font-size: 0.72rem;
    margin-left: auto;
    padding: 0.2rem 0.55rem;
}

.monitor-tile-footer {
    color: #c8d0db;
    font-size: 0.76rem;
    line-height: 1.35;
    padding: 0 0.9rem 0.9rem;
}

.monitor-tile-resize {
    background: rgba(232, 185, 74, 0.82);
    border: 1px solid rgba(245, 247, 250, 0.8);
    border-radius: 0.3rem;
    bottom: 0.4rem;
    cursor: nwse-resize;
    height: 1rem;
    position: absolute;
    right: 0.4rem;
    width: 1rem;
}

@media (max-width: 1199.98px) {
    .overwatch-sidebar {
        flex-basis: 100%;
        max-width: 100%;
    }

    .overwatch-shell-sidebar-collapsed .overwatch-sidebar {
        flex-basis: 0;
        max-width: 0;
    }

    .overwatch-collapsed-toggle {
        left: 0.5rem;
        top: 0.5rem;
    }

    .monitor-shell {
        grid-template-columns: 1fr;
    }

    .monitor-canvas {
        min-height: 900px;
        min-width: 0;
        width: 100%;
    }
}

#blazor-error-ui {
    background: #5b1317;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    color: #fff;
    display: none;
    left: 0;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: 600;
    margin-left: 0.75rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.7rem;
}
