:root {
    --bg: #030712;
    --bg-deep: #02040b;
    --bg-soft: #091121;
    --panel: rgba(9, 16, 34, 0.82);
    --panel-strong: rgba(14, 23, 48, 0.95);
    --panel-alt: rgba(16, 28, 56, 0.88);
    --line: rgba(125, 211, 252, 0.16);
    --line-strong: rgba(125, 211, 252, 0.32);
    --text: #e6eef8;
    --text-secondary: #94a7c6;
    --accent: #7dd3fc;
    --accent-strong: #22d3ee;
    --accent-warm: #fbbf24;
    --success: #4ade80;
    --danger: #fb7185;
    --warning: #f59e0b;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.48);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.16), transparent 26%),
        radial-gradient(circle at 86% 14%, rgba(251, 191, 36, 0.14), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.12), transparent 35%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-soft) 50%, var(--bg) 100%);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(125, 211, 252, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.05) 1px, transparent 1px);
    background-size: 120px 120px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), transparent 100%);
    opacity: 0.7;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
        radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
        radial-gradient(circle at 68% 76%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.8px),
        radial-gradient(circle at 32% 84%, rgba(255, 255, 255, 0.68) 0 1px, transparent 1.5px),
        radial-gradient(circle at 88% 62%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px);
    opacity: 0.5;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 26px 20px;
    background: rgba(4, 9, 21, 0.8);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--line);
    box-shadow: inset -1px 0 0 rgba(125, 211, 252, 0.08);
}

.sidebar-header {
    padding: 22px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 35%),
        linear-gradient(160deg, rgba(14, 23, 48, 0.95), rgba(6, 10, 24, 0.95));
    box-shadow: var(--shadow);
}

.sidebar-kicker,
.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
}

.sidebar-header h2,
.header h1,
.card h2,
.modal-header h2,
.login-intro h1,
.login-copy h1,
.login-copy h2 {
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.sidebar-header h2 {
    font-size: 30px;
    line-height: 1.1;
}

.sidebar-header p {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(9, 16, 34, 0.52);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    transform: translateX(4px);
    border-color: var(--line-strong);
    background: rgba(16, 28, 56, 0.82);
    color: var(--text);
}

.nav-item.active {
    color: var(--text);
    border-color: rgba(34, 211, 238, 0.42);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(14, 165, 233, 0.18)),
        rgba(16, 28, 56, 0.92);
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.12);
}

.nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.14);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(9, 16, 34, 0.55);
    color: var(--text-secondary);
    font-size: 14px;
}

.sidebar-signal {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.85);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 38px clamp(18px, 3vw, 40px);
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding: 28px clamp(22px, 4vw, 34px);
    border-radius: 30px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.12), transparent 30%),
        linear-gradient(145deg, rgba(12, 20, 43, 0.94), rgba(7, 11, 25, 0.96));
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.header::after {
    content: "";
    position: absolute;
    inset: auto -10% -60% 35%;
    height: 220px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 70%);
    pointer-events: none;
}

.header h1 {
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.05;
}

.page-description {
    max-width: 640px;
    margin-top: 12px;
    color: var(--text-secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.user-panel {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(9, 16, 34, 0.66);
}

.btn-logout,
.btn,
.action-btn {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-logout {
    padding: 10px 16px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.96), rgba(244, 63, 94, 0.88));
    box-shadow: 0 10px 24px rgba(244, 63, 94, 0.24);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card,
.card,
.modal-content,
.login-card,
.login-intro {
    border-radius: 28px;
    border: 1px solid var(--line);
    background:
        linear-gradient(155deg, rgba(12, 19, 40, 0.94), rgba(7, 11, 24, 0.92));
    box-shadow: var(--shadow);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: auto -20% -50% auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 70%);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--accent);
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(125, 211, 252, 0.04));
    border: 1px solid rgba(125, 211, 252, 0.16);
}

.stat-info h3 {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 30px;
    line-height: 1.1;
    color: var(--text);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.card {
    padding: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 24px;
}

.table-shell {
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(5, 9, 20, 0.5);
}

.data-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(125, 211, 252, 0.04);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
}

.data-table th {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.data-table tbody tr {
    border-top: 1px solid rgba(125, 211, 252, 0.08);
}

.data-table tbody tr:hover {
    background: rgba(34, 211, 238, 0.05);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge-success {
    color: #dcfce7;
    background: rgba(74, 222, 128, 0.18);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge-danger {
    color: #ffe4e6;
    background: rgba(251, 113, 133, 0.18);
    border: 1px solid rgba(251, 113, 133, 0.2);
}

.badge-warning {
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--accent-warm);
    text-decoration: none;
    font-weight: 700;
}

.servers-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.server-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(9, 16, 34, 0.58);
}

.server-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.server-status.online {
    background: var(--success);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.8);
}

.server-status.offline {
    background: var(--danger);
    box-shadow: 0 0 12px rgba(251, 113, 133, 0.45);
}

.server-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.server-info p,
.server-load,
.empty-state,
.login-note {
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
}

.btn-primary,
.action-btn-edit {
    color: #03131b;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 30px rgba(34, 211, 238, 0.18);
}

.btn-secondary {
    color: var(--text);
    background: rgba(9, 16, 34, 0.62);
    border: 1px solid var(--line);
}

.btn-danger,
.action-btn-delete {
    color: #fff;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.96), rgba(244, 63, 94, 0.88));
}

.search-bar {
    margin-bottom: 24px;
}

.toolbar-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-form .form-control {
    flex: 1 1 260px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    background: rgba(5, 10, 22, 0.74);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus {
    border-color: rgba(34, 211, 238, 0.48);
    background: rgba(9, 16, 34, 0.92);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.form-control::placeholder {
    color: rgba(148, 167, 198, 0.8);
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.checkbox-row input {
    accent-color: var(--accent-strong);
}

.form-actions,
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(9, 16, 34, 0.62);
    color: var(--text);
    text-decoration: none;
}

.pagination .active,
.pagination a:hover {
    border-color: rgba(34, 211, 238, 0.36);
    background: rgba(34, 211, 238, 0.14);
}

.empty-state {
    padding: 30px 24px;
    text-align: center;
    border-radius: 22px;
    border: 1px dashed rgba(125, 211, 252, 0.2);
    background: rgba(5, 10, 22, 0.44);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(100%, 560px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

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

.modal-header h2 {
    font-size: 28px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(9, 16, 34, 0.8);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(16, 28, 56, 0.95);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.stars,
.stars2,
.stars3 {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-repeat: repeat;
}

.stars {
    opacity: 0.22;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px);
    background-size: 180px 180px;
    animation: drift 90s linear infinite;
}

.stars2 {
    opacity: 0.18;
    background-image: radial-gradient(circle, rgba(125, 211, 252, 0.8) 0 1px, transparent 1.9px);
    background-size: 260px 260px;
    animation: drift 130s linear infinite reverse;
}

.stars3 {
    opacity: 0.12;
    background-image: radial-gradient(circle, rgba(251, 191, 36, 0.8) 0 1px, transparent 2px);
    background-size: 340px 340px;
    animation: drift 170s linear infinite;
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-120px, -240px, 0);
    }
}

.login-container {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
    gap: 26px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.login-container-compact {
    width: min(460px, 100%);
    grid-template-columns: 1fr;
}

.login-intro,
.login-card {
    padding: 34px;
}

.login-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34%),
        linear-gradient(150deg, rgba(10, 18, 40, 0.95), rgba(4, 8, 20, 0.95));
}

.login-intro h1 {
    font-size: clamp(40px, 5vw, 64px);
    line-height: 0.98;
    margin-bottom: 18px;
}

.login-intro p {
    max-width: 560px;
    font-size: 18px;
    color: var(--text-secondary);
}

.login-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.login-highlights span {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(9, 16, 34, 0.66);
    color: var(--text);
    font-size: 14px;
}

.login-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.14), transparent 35%),
        linear-gradient(150deg, rgba(11, 19, 41, 0.94), rgba(6, 10, 24, 0.95));
}

.login-content {
    width: 100%;
}

.login-copy {
    margin-bottom: 18px;
}

.login-copy h1,
.login-copy h2 {
    font-size: 32px;
    margin-bottom: 8px;
}

.login-copy p {
    color: var(--text-secondary);
}

.login-note {
    margin-top: 18px;
    font-size: 14px;
}

@media (max-width: 980px) {
    .container {
        flex-direction: column;
    }

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

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-item {
        flex: 1 1 200px;
    }

    .sidebar-footer {
        margin-top: 0;
    }

    .main-content {
        margin-left: 0;
        padding-top: 24px;
    }

    .header {
        flex-direction: column;
    }

    .login-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .login-page,
    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header,
    .card,
    .modal-content,
    .login-card,
    .login-intro,
    .sidebar-header {
        border-radius: 22px;
    }

    .section-heading,
    .toolbar-form,
    .user-info,
    .actions,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .btn-logout,
    .action-btn {
        width: 100%;
    }

    .server-item {
        grid-template-columns: auto 1fr;
    }

    .server-load {
        grid-column: 2;
    }
}
