:root {
    --bg: #08111f;
    --bg-soft: rgba(15, 25, 44, 0.76);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f2f6ff;
    --muted: #9fb0c9;
    --accent: #6ea8fe;
    --accent-strong: #3d8bfd;
    --green: #3ddc97;
    --yellow: #ffc857;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(61, 139, 253, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(61, 220, 151, 0.14), transparent 24%),
        linear-gradient(180deg, #08111f 0%, #0a1323 40%, #050b14 100%);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
}

.glass-card {
    background: linear-gradient(180deg, rgba(17, 28, 49, 0.84), rgba(10, 18, 34, 0.76));
    border: 1px solid var(--line);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
}

.sidebar {
    min-height: calc(100vh - 48px);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
}

.brand-block {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(110, 168, 254, 0.28), rgba(61, 220, 151, 0.22));
    font-size: 26px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
}

.brand-subtitle,
.page-subtitle,
.small-muted,
.hint-text,
.field-help,
.log-time,
.timeline-time,
.empty-state,
.metric-label,
.label {
    color: var(--muted);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text);
    border: 1px solid transparent;
}

.nav-pill:hover,
.nav-pill.active {
    color: var(--text);
    background: rgba(110, 168, 254, 0.14);
    border-color: rgba(110, 168, 254, 0.25);
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.stat-mini {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
}

.stat-mini .value {
    font-size: 22px;
    font-weight: 700;
}

.content-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topbar {
    border-radius: 24px;
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.btn-soft,
.btn-primary-app {
    border-radius: 14px;
    padding: 10px 16px;
    border: 1px solid var(--line);
}

.btn-soft {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.btn-soft:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.btn-primary-app {
    background: linear-gradient(135deg, var(--accent-strong), #6f7bff);
    color: #fff;
    border: none;
}

.btn-primary-app:hover {
    background: linear-gradient(135deg, #4c95ff, #7b85ff);
    color: #fff;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    border-radius: 24px;
    padding: 22px;
}

.metric-value {
    font-size: 34px;
    font-weight: 700;
    margin-top: 8px;
}

.metric-value-sm {
    font-size: 20px;
}

.panel-card {
    border-radius: 24px;
    padding: 22px;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-title-row h2 {
    margin: 0;
    font-size: 22px;
}

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

.table-link {
    color: #d6e7ff;
    text-decoration: none;
    font-weight: 600;
}

.table-link:hover {
    color: #fff;
}

.badge-outline {
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.form-control-app {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.form-control-app:focus,
.form-select.form-control-app:focus {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border-color: rgba(110, 168, 254, 0.6);
    box-shadow: 0 0 0 0.25rem rgba(110, 168, 254, 0.12);
}

.form-control-app::placeholder {
    color: #7f93b2;
}

.form-select.form-control-app option {
    color: #111;
}

.form-check-input {
    cursor: pointer;
}

.font-mono,
pre,
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-list.compact {
    gap: 10px;
}

.log-row {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.log-row.level-error {
    border-color: rgba(255, 107, 107, 0.2);
}

.log-row.level-info {
    border-color: rgba(110, 168, 254, 0.18);
}

.log-row.level-warning {
    border-color: rgba(255, 200, 87, 0.2);
}

.log-level {
    min-width: 72px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.log-message {
    font-weight: 600;
}

.log-content-grow {
    flex: 1;
}

.log-context,
.probe-pre,
.wrap-pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.log-context,
.probe-pre {
    margin-top: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    color: #dbe6ff;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 12px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yellow), #ff8f5a);
    margin-top: 7px;
    box-shadow: 0 0 0 8px rgba(255, 200, 87, 0.08);
}

.timeline-title {
    font-weight: 700;
}

.timeline-text {
    margin-top: 4px;
    color: #d8e5ff;
    white-space: pre-wrap;
    word-break: break-word;
}

.chart-wrap {
    min-height: 360px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 360px !important;
}

.small-danger {
    color: #ffb7b7;
    font-size: 12px;
}

.empty-state {
    padding: 24px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1400px) {
    .grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: static;
    }
}

@media (max-width: 768px) {
    .grid-cards {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
