/* ===== Rezerv VPN — Unified Design System (Admin & Partner) ===== */
/* Clean, strict, modern dark theme with refined typography & micro-interactions */

:root {
    /* Base Color Palette */
    --bg-main: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --bg-sidebar: rgba(15, 23, 42, 0.96);
    --bg-modal: rgba(5, 8, 15, 0.82);
    --bg-input: rgba(0, 0, 0, 0.35);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Accents & Brand */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.12);
    --primary-glow: rgba(59, 130, 246, 0.3);

    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.25);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.25);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.25);
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.25);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.25);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.25);
    --accent-teal: #14b8a6;
    --accent-orange: #f97316;

    /* Borders & Dividers */
    --border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-highlight: rgba(59, 130, 246, 0.35);

    /* Typography & Spacing */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sidebar-width: 220px;
    --top-bar-height: 52px;

    /* Geometry & Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Effects & Transitions */
    --glass-blur: blur(20px);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.55);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

html {
    font-size: 13.5px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Custom Clean Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.45);
}

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

.app.hidden {
    display: none !important;
}

/* ===== Fullscreen Auth Screen / Заглушка авторизации ===== */
.auth-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.12), transparent 60%), #0a0e17;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.auth-screen.hidden {
    display: none !important;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    background: var(--primary-light);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.auth-input-wrapper input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: all var(--transition);
}

.auth-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    margin-top: 6px;
    gap: 8px;
}

.auth-footer {
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.5;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.logo-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    display: block;
}

.logo-subtitle {
    font-size: 9.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.1px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    color: inherit;
}

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

.version {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-bar {
    height: var(--top-bar-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.page-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    flex: 1;
}

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

.top-bar-actions .btn {
    height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 30px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.content {
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* ===== Pages ===== */
.page {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stats-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.stat-icon.green  { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.stat-icon.cyan   { background: rgba(6, 182, 212, 0.12); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.25); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.25); }
.stat-icon.gold   { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.stat-icon.orange { background: rgba(249, 115, 22, 0.12); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.25); }
.stat-icon.teal   { background: rgba(20, 184, 166, 0.12); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.25); }
.stat-icon.yellow { background: rgba(234, 179, 8, 0.12); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.25); }

@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .cards-row-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-info {
    min-width: 0;
    overflow: hidden;
}

.stat-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-sublabel {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Cards ===== */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

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

.card-header h3, .card-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 12px 14px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-value {
    font-weight: 600;
    color: var(--accent-blue);
    font-family: var(--font-family);
}

/* ===== Tables ===== */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 5px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 12px;
    height: 32px;
    transition: all var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.4;
}

.data-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.5);
}

.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 12px;
}

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

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.cell-ident {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-user {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-name {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-truncate {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-nowrap {
    white-space: nowrap;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
    font-size: 12px;
}

/* Status badges in tables */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    white-space: nowrap;
}

.badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

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

.badge.maintenance {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ===== Plan breakdown (dashboard) ===== */
.plan-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.plan-row:last-child {
    border-bottom: none;
}
.plan-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.plan-row-numbers {
    display: inline-flex;
    align-items: baseline;
    font-weight: 600;
}
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}
.plan-trial    { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.2); }
.plan-basic    { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.plan-standard { background: rgba(14, 165, 233, 0.12); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.2); }
.plan-optimal  { background: rgba(249, 115, 22, 0.12); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.2); }
.plan-premium  { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.2); }
.plan-bar {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.plan-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: width 0.4s ease;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* ===== Forms ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 13.5px;
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.25);
}

/* ===== Settings ===== */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    color: var(--text-secondary);
    font-size: 13.5px;
}

.setting-value {
    font-weight: 600;
    color: var(--accent-cyan);
    font-size: 13.5px;
}

/* ===== Server Status Indicator ===== */
.server-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.server-item:last-child {
    border-bottom: none;
}

.server-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
}

.server-load {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 80px;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.low { background: var(--accent-green); }
.progress-fill.medium { background: var(--accent-gold); }
.progress-fill.high { background: var(--accent-red); }

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.25s ease-out;
    pointer-events: auto;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    :root {
        --sidebar-width: 205px;
    }
    html {
        font-size: 13px;
    }
    .content {
        padding: 12px 16px;
    }
    .data-table th, .data-table td {
        padding: 6px 8px;
    }
    .stats-grid {
        gap: 10px;
    }
    .stat-card {
        padding: 10px 12px;
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

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

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

    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
    }

    .menu-toggle {
        display: block;
    }

    .top-bar {
        padding: 0 14px;
    }

    .content {
        padding: 12px;
    }

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

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

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

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

/* ===== Language Selector Dropdown ===== */
.lang-selector-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
}

.lang-flag {
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.lang-code {
    letter-spacing: 0.05em;
    font-size: 12px;
    font-weight: 700;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 155px;
    background: #0d131f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
    padding: 6px;
    z-index: 1000;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: fadeIn 0.15s ease-out;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lang-option:hover {
    background: rgba(59, 130, 246, 0.14);
    color: var(--text-primary);
}

.lang-option.active {
    background: rgba(59, 130, 246, 0.22);
    color: var(--accent-blue);
    font-weight: 600;
}

