:root {
    --bg: #06121f;
    --bg-soft: #0a1727;
    --panel: rgba(9, 23, 39, 0.92);
    --panel-2: rgba(13, 30, 48, 0.94);
    --line: rgba(100, 149, 201, 0.18);
    --line-strong: rgba(100, 149, 201, 0.34);
    --text: #d7e6f5;
    --muted: #7f98b3;
    --accent: #4ec7ff;
    --accent-2: #00e0a4;
    --danger: #ff5d7a;
    --warn: #ffb84d;
    --good: #2de08a;
    --violet: #8b7dff;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(0, 224, 164, 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(78, 199, 255, 0.12), transparent 30%),
        linear-gradient(180deg, #07111b 0%, #030812 100%);
    color: var(--text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

body {
    display: grid;
    grid-template-columns: 280px 1fr;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: start;
    padding: 28px 22px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(5, 15, 25, 0.98), rgba(5, 15, 25, 0.9)),
        radial-gradient(circle at top, rgba(78, 199, 255, 0.08), transparent 30%);
}

.brand {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(78, 199, 255, 0.2), rgba(0, 224, 164, 0.18));
    border: 1px solid rgba(78, 199, 255, 0.25);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.5;
}

.nav-section {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 22px 0 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #b2c6da;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.nav-link:hover {
    background: rgba(78, 199, 255, 0.07);
    border-color: rgba(78, 199, 255, 0.12);
    color: var(--text);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(78, 199, 255, 0.12), rgba(0, 224, 164, 0.08));
    border-color: rgba(78, 199, 255, 0.28);
    color: #f5fbff;
    box-shadow: inset 0 0 0 1px rgba(78, 199, 255, 0.08);
}

.nav-meta {
    font-size: 11px;
    color: var(--muted);
}

.sidebar-foot {
    margin-top: 24px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(7, 18, 31, 0.8);
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(255, 93, 122, 0.45);
}

.live-dot.online {
    background: var(--good);
    box-shadow: 0 0 18px rgba(45, 224, 138, 0.7);
}

.main {
    padding: 24px 28px 48px;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.hero h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: 0.03em;
}

.hero p {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.clock-box,
.panel,
.metric,
.table-card,
.form-card,
.notice,
.empty {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel) 0%, rgba(7, 18, 31, 0.92) 100%);
    box-shadow: var(--shadow);
}

.clock-box {
    min-width: 210px;
    padding: 16px 18px;
    border-radius: 18px;
    text-align: right;
}

.clock-box .label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.clock-box .value {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 700;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.metric {
    border-radius: 18px;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.metric::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(78, 199, 255, 0.12), transparent 48%);
    pointer-events: none;
}

.metric .label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.metric .value {
    font-size: 28px;
    font-weight: 700;
}

.metric .sub {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.good {
    color: var(--good);
}

.danger {
    color: var(--danger);
}

.warn {
    color: var(--warn);
}

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

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    margin-bottom: 22px;
}

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

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

.panel-title {
    font-size: 15px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ec0df;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.stack {
    display: grid;
    gap: 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(100, 149, 201, 0.08);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row .k {
    color: var(--muted);
    font-size: 13px;
}

.info-row .v {
    text-align: right;
    font-weight: 600;
}

.table-card,
.form-card,
.empty {
    border-radius: 22px;
    padding: 20px;
}

.table-card.dense {
    padding: 16px;
}

.table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(100, 149, 201, 0.18);
    background: rgba(4, 14, 24, 0.95);
    color: var(--text);
    font-size: 14px;
}

input:focus,
select:focus {
    outline: none;
    border-color: rgba(78, 199, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(78, 199, 255, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: #9ec0df;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.field-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.check-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.check-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(4, 14, 24, 0.95);
    border: 1px solid rgba(100, 149, 201, 0.18);
}

.check-chip input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    color: white;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #0c85ff, #3bc7ff);
}

.btn-success {
    background: linear-gradient(135deg, #00a86f, #2de08a);
}

.btn-danger {
    background: linear-gradient(135deg, #e54265, #ff6e7a);
}

.btn-warn {
    background: linear-gradient(135deg, #ff9d2f, #ffce58);
    color: #2a1a00;
}

.btn-ghost {
    background: rgba(16, 35, 56, 0.96);
    border: 1px solid rgba(100, 149, 201, 0.18);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge.good {
    background: rgba(45, 224, 138, 0.12);
    color: #8ef2bf;
}

.badge.warn {
    background: rgba(255, 184, 77, 0.12);
    color: #ffd28b;
}

.badge.danger {
    background: rgba(255, 93, 122, 0.12);
    color: #ff9eb0;
}

.badge.info {
    background: rgba(78, 199, 255, 0.12);
    color: #9fe4ff;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(100, 149, 201, 0.08);
    vertical-align: top;
}

th {
    color: #9ec0df;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: rgba(6, 18, 31, 0.96);
    z-index: 1;
}

tbody tr:hover {
    background: rgba(78, 199, 255, 0.04);
}

.cell-main {
    font-weight: 600;
    color: #eef7ff;
}

.cell-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.num {
    font-variant-numeric: tabular-nums;
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.split-metric {
    display: grid;
    gap: 2px;
}

.table-scroll {
    overflow: auto;
    max-height: 70vh;
    border-radius: 16px;
    border: 1px solid rgba(100, 149, 201, 0.08);
}

.toolbar input,
.toolbar select {
    min-width: 180px;
}

.mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-stat {
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(4, 14, 24, 0.95);
    border: 1px solid rgba(100, 149, 201, 0.14);
}

.mini-stat .k {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mini-stat .v {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.mono {
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.empty {
    text-align: center;
    color: var(--muted);
    min-height: 220px;
    display: grid;
    place-items: center;
}

.empty strong {
    display: block;
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

.notice {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.notice strong {
    display: block;
    margin-bottom: 6px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    min-width: 260px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 16px;
    color: white;
    z-index: 9999;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.info {
    background: linear-gradient(135deg, #0d6efd, #26c0ff);
}

.toast.success {
    background: linear-gradient(135deg, #0c9f69, #2de08a);
}

.toast.error {
    background: linear-gradient(135deg, #d83d5d, #ff5d7a);
}

@media (max-width: 1080px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 18px 16px 32px;
    }

    .hero {
        flex-direction: column;
    }

    .clock-box {
        width: 100%;
        text-align: left;
    }
}
