/* ═══════════════════════════════════════════════════
   ServerPanel — Clean Dark Theme + Colorful Icons
   ═══════════════════════════════════════════════════ */

/* Local Fonts — Circular Std */
@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Regular-D_XqMrZX.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Medium-DXgNykXS.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Circular Std';
    src: url('../fonts/CircularStd-Bold-DF4DZaMM.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0b0f19;
    --bg-card: #111827;
    --bg-surface: #1a2035;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --text-muted: #475569;
    --border: rgba(148, 163, 184, 0.08);
    --border-active: rgba(148, 163, 184, 0.15);
    --radius: 14px;
    --radius-sm: 10px;

    /* Vibrant colors */
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --green: #10b981;
    --orange: #f59e0b;
    --pink: #ec4899;
    --cyan: #06b6d4;
    --red: #ef4444;
    --indigo: #6366f1;

    /* Gradients for icon boxes */
    --grad-blue: linear-gradient(135deg, #3b82f6, #60a5fa);
    --grad-purple: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --grad-green: linear-gradient(135deg, #10b981, #34d399);
    --grad-orange: linear-gradient(135deg, #f59e0b, #fbbf24);
    --grad-pink: linear-gradient(135deg, #ec4899, #f472b6);
    --grad-cyan: linear-gradient(135deg, #06b6d4, #22d3ee);
    --grad-red: linear-gradient(135deg, #ef4444, #f87171);
    --grad-indigo: linear-gradient(135deg, #6366f1, #818cf8);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    font-size: 14px;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: opacity 0.15s;
}

a:hover {
    opacity: 0.8;
}

::selection {
    background: var(--blue);
    color: #fff;
}

iconify-icon {
    display: inline-flex;
    vertical-align: middle;
}

/* ── Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
    font-family: 'Circular Std', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--grad-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-surface);
    color: var(--text);
    opacity: 1;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-icon.icon-blue {
    background: var(--grad-blue);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.nav-icon.icon-purple {
    background: var(--grad-purple);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.nav-icon.icon-green {
    background: var(--grad-green);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.nav-icon.icon-orange {
    background: var(--grad-orange);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.nav-icon.icon-pink {
    background: var(--grad-pink);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
}

.nav-icon.icon-cyan {
    background: var(--grad-cyan);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.nav-icon.icon-red {
    background: var(--grad-red);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.nav-icon.icon-indigo {
    background: var(--grad-indigo);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}



/* ── Main ── */
.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 60px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: 'Circular Std', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-area {
    padding: 32px;
    flex: 1;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-family: 'Circular Std', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.card-body {
    padding: 22px;
}

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
}

/* Colored top accent bar */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.accent-blue::before {
    background: var(--grad-blue);
}

.stat-card.accent-green::before {
    background: var(--grad-green);
}

.stat-card.accent-purple::before {
    background: var(--grad-purple);
}

.stat-card.accent-orange::before {
    background: var(--grad-orange);
}

.stat-card.accent-cyan::before {
    background: var(--grad-cyan);
}

.stat-card.accent-pink::before {
    background: var(--grad-pink);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card .label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.stat-card .value {
    font-family: 'Circular Std', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card .sub {
    font-size: 13px;
    color: var(--text-dim);
}

.gauge-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 14px;
}

.gauge-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.gauge-fill.fill-blue {
    background: var(--grad-blue);
}

.gauge-fill.fill-green {
    background: var(--grad-green);
}

.gauge-fill.fill-purple {
    background: var(--grad-purple);
}

.gauge-fill.fill-orange {
    background: var(--grad-orange);
}

.gauge-fill.fill-cyan {
    background: var(--grad-cyan);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Circular Std', sans-serif;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-blue);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
    opacity: 0.95;
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-active);
    opacity: 1;
}

.btn-accent {
    background: var(--grad-purple);
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
}

.btn-accent:hover {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    opacity: 0.85;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    font-family: 'Circular Std', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    min-height: 90px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.radio-row {
    display: flex;
    gap: 20px;
}

.radio-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dim);
}

.radio-opt input {
    width: auto;
}

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.06);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.12);
}

.alert-success {
    background: rgba(16, 185, 129, 0.06);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.12);
}

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(59, 130, 246, 0.02);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-online {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-offline {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.dot-online {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.dot-offline {
    background: #f87171;
}

.dot-pending {
    background: #fbbf24;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state h3 {
    font-family: 'Circular Std', sans-serif;
    font-size: 16px;
    margin-bottom: 8px;
    color: #fff;
}

.empty-state p {
    margin-bottom: 20px;
}

/* ═══════════════════════════════════
   SIDEBAR FOOTER — User Card
   ═══════════════════════════════════ */

.sidebar-footer {
    padding: 14px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--grad-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.user-info {
    overflow: hidden;
}

.user-info strong {
    display: block;
    font-size: 13px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 16px;
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.15s;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}

.btn-logout:hover {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
    opacity: 1;
}

/* ═══════════════════════════════════
   SIDEBAR TOGGLE (mobile)
   ═══════════════════════════════════ */

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.nav-section {
    margin-bottom: 4px;
}

/* ═══════════════════════════════════
   TOPBAR — Greeting
   ═══════════════════════════════════ */

.topbar-greeting {
    font-size: 13px;
    color: var(--text-dim);
}

.topbar-greeting strong {
    color: var(--text);
}

/* ═══════════════════════════════════
   WELCOME BANNER
   ═══════════════════════════════════ */

.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-blue);
}

.welcome-left h2 {
    font-family: 'Circular Std', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.welcome-left p {
    font-size: 13px;
    color: var(--text-dim);
}

/* ═══════════════════════════════════
   QUICK STATS ROW
   ═══════════════════════════════════ */

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.qs-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s;
}

.qs-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
}

.qs-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.qs-data {
    display: flex;
    flex-direction: column;
}

.qs-num {
    font-family: 'Circular Std', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.qs-label {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 3px;
}

/* ═══════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════ */

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

.section-header h3 {
    font-family: 'Circular Std', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-count {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--bg-surface);
    border-radius: 20px;
}

/* ═══════════════════════════════════
   SERVER CARDS GRID
   ═══════════════════════════════════ */

.server-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.server-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

.server-card:hover {
    border-color: var(--border-active);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.sc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.sc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.sc-name {
    font-family: 'Circular Std', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.sc-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.sc-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-os {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.sc-date {
    font-size: 11px;
    color: var(--text-muted);
}

.sc-arrow {
    color: var(--text-muted);
    font-size: 16px;
    transition: transform 0.15s, color 0.15s;
}

.server-card:hover .sc-arrow {
    transform: translateX(4px);
    color: var(--blue);
}

/* ─── Empty Card ─── */
.empty-card {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-card .empty-icon {
    margin-bottom: 16px;
}

.empty-card h3 {
    font-family: 'Circular Std', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.empty-card p {
    font-size: 13px;
    color: var(--text-dim);
}

/* ═══════════════════════════════════
   MANAGE PAGE
   ═══════════════════════════════════ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-decoration: none;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--blue);
    opacity: 1;
}

.manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.mh-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mh-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.mh-info h1 {
    font-family: 'Circular Std', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.mh-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    flex-wrap: wrap;
}

.mh-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mh-sep {
    color: var(--text-muted);
}

.mh-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.danger-card {
    border-color: rgba(239, 68, 68, 0.12);
}

.danger-card .card-header {
    border-color: rgba(239, 68, 68, 0.08);
}

/* ═══════════════════════════════════
   RESPONSIVE (updated)
   ═══════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .content-area {
        padding: 20px;
    }

    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }

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

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

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

    .mh-right {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-greeting {
        display: none;
    }
}

@media (max-width: 480px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }

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

/* ═══════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.03) 40%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo .logo-icon-large {
    width: 48px;
    height: 48px;
    background: var(--grad-blue);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-family: 'Circular Std', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-dim);
    font-size: 14px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.auth-card h2 {
    font-family: 'Circular Std', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-dim);
}

.auth-footer a {
    color: var(--blue);
    font-weight: 600;
}

/* ═══════════════════════════════════
   ADD SERVER
   ═══════════════════════════════════ */

.add-server-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg);
}

.add-server-wrap {
    width: 100%;
    max-width: 680px;
}

.add-server-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 24px;
    text-decoration: none;
}

.add-server-back:hover {
    color: var(--blue);
    opacity: 1;
}

.add-server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.add-server-head {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.add-server-head h1 {
    font-family: 'Circular Std', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.add-server-head p {
    color: var(--text-dim);
    font-size: 13px;
}

.add-server-body {
    padding: 28px;
}

/* ═══════════════════════════════════
   TERMINAL
   ═══════════════════════════════════ */

.terminal-wrap {
    margin-top: 20px;
    display: none;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.term-dot.red {
    background: #ff5f57;
}

.term-dot.yellow {
    background: #febc2e;
}

.term-dot.green {
    background: #28c840;
}

.term-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 6px;
}

.terminal {
    background: #0a0e18;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 16px 18px;
    height: 340px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
}

.terminal .line {
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal .line.info {
    color: var(--text-dim);
}

.terminal .line.ok {
    color: #34d399;
}

.terminal .line.warn {
    color: #fbbf24;
}

.terminal .line.error {
    color: #f87171;
}

.terminal .line.section {
    color: var(--blue);
    font-weight: 600;
}

.terminal .line.cmd {
    color: var(--cyan);
}

.terminal .line.prompt {
    color: #34d399;
}

.terminal .cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: var(--blue);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════
   SERVER MANAGE
   ═══════════════════════════════════ */

.server-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.server-icon {
    width: 48px;
    height: 48px;
    background: var(--grad-indigo);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.server-meta h1 {
    font-family: 'Circular Std', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.server-meta .server-ip {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.server-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ═══════════════════════════════════
   HOMEPAGE
   ═══════════════════════════════════ */

.home-page {
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.home-page::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.04) 30%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Home Nav */
.home-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.home-nav-logo {
    font-family: 'Circular Std', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-nav-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--grad-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.home-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-nav-links a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    text-decoration: none;
}

.home-nav-links a:hover {
    color: var(--text);
    opacity: 1;
}

.home-nav-links .nav-btn {
    background: var(--grad-blue);
    color: #fff;
    font-weight: 600;
    padding: 8px 20px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.25);
}

.home-nav-links .nav-btn:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
    opacity: 0.95;
}

.home-nav-links .nav-btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 8px 20px;
    font-weight: 600;
}

.home-nav-links .nav-btn-outline:hover {
    border-color: var(--border-active);
    color: var(--text);
}

/* Hero */
.home-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 100px 40px 60px;
    max-width: 820px;
    margin: 0 auto;
}

.home-hero .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 28px;
}

.home-hero h1 {
    font-family: 'Circular Std', sans-serif;
    font-size: 52px;
    font-weight: 700;
    line-height: 1.12;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.home-hero h1 .accent {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero p {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 550px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.home-hero-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.home-hero-btns .btn {
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

/* Terminal Demo */
.home-terminal {
    max-width: 620px;
    margin: 0 auto 60px;
    position: relative;
    z-index: 1;
}

.home-terminal .terminal {
    height: auto;
    max-height: 280px;
    padding: 18px 20px;
    border-radius: 0 0 var(--radius) var(--radius);
}

.home-terminal .terminal-header {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Features */
.home-section {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: 0 auto;
    padding: 60px 40px 80px;
}

.home-section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--orange);
    margin-bottom: 12px;
}

.home-section h2 {
    font-family: 'Circular Std', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.home-section>p {
    color: var(--text-dim);
    font-size: 16px;
    margin-bottom: 42px;
    max-width: 520px;
    line-height: 1.7;
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.home-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: border-color 0.2s, transform 0.2s;
}

.home-feature-card:hover {
    border-color: var(--border-active);
    transform: translateY(-3px);
}

.home-feature-card .feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    margin-bottom: 18px;
}

.home-feature-card h3 {
    font-family: 'Circular Std', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.home-feature-card p {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Steps */
.home-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.home-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    transition: border-color 0.2s;
}

.home-step-card:hover {
    border-color: var(--border-active);
}

.home-step-card .step-num {
    font-family: 'Circular Std', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.home-step-card:nth-child(1) .step-num {
    color: var(--blue);
}

.home-step-card:nth-child(2) .step-num {
    color: var(--purple);
}

.home-step-card:nth-child(3) .step-num {
    color: var(--green);
}

.home-step-card:nth-child(4) .step-num {
    color: var(--orange);
}

.home-step-card .step-label {
    font-size: 13px;
    color: var(--text-dim);
}

/* Footer */
.home-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 28px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-footer-left {
    font-size: 13px;
    color: var(--text-muted);
}

.home-footer-links {
    display: flex;
    gap: 20px;
}

.home-footer-links a {
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
}

.home-footer-links a:hover {
    color: var(--text);
    opacity: 1;
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .content-area {
        padding: 20px;
    }

    .home-nav {
        padding: 12px 20px;
    }

    .home-hero {
        padding: 60px 20px 40px;
    }

    .home-hero h1 {
        font-size: 32px;
    }

    .home-features-grid {
        grid-template-columns: 1fr;
    }

    .home-steps-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-section {
        padding: 40px 20px 60px;
    }

    .home-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 24px 20px;
    }
}

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

    .auth-card {
        padding: 24px;
    }

    .home-hero h1 {
        font-size: 28px;
    }

    .home-steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════
   TOP LOADING BAR
   ═══════════════════════════════════ */

.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.top-loader.active {
    opacity: 1;
}

.top-loader.done {
    opacity: 0;
    transition: opacity 0.4s 0.1s;
}

.top-loader-bar {
    height: 100%;
    width: 0%;
    background: var(--grad-blue);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 4px rgba(59, 130, 246, 0.3);
}

/* ═══════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.toast.toast-in {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-out {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-msg {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    padding: 2px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

/* ── Toast color accents ── */
.toast-success {
    border-left: 3px solid var(--green);
}

.toast-success .toast-icon {
    color: var(--green);
}

.toast-error {
    border-left: 3px solid var(--red);
}

.toast-error .toast-icon {
    color: var(--red);
}

.toast-warning {
    border-left: 3px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 3px solid var(--blue);
}

.toast-info .toast-icon {
    color: var(--blue);
}

/* ═══════════════════════════════════
   ALERT BOXES
   ═══════════════════════════════════ */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}