:root {
    /* Light Corporate Base */
    --bg-page: #F3F4F6;       /* Gray 100 - Page background */
    --bg-surface: #FFFFFF;    /* White - Cards and Sidebar */
    --bg-surface-alt: #F9FAFB;/* Gray 50 - Alt surface */
    
    --text-main: #020617;     /* Deeper, sharp Slate 950/Black */
    --text-secondary: #334155;/* Crisper Slate 700 */
    --text-muted: #64748B;    /* Slate 500 */
    
    --border-color: #E5E7EB;  /* Gray 200 - Borders */
    
    /* Corporate Gaming Blue Accent */
    --accent: #2563EB; /* Blue 600 */
    --accent-hover: #1D4ED8; /* Blue 700 */
    --accent-glow: 0 4px 14px rgba(37, 99, 235, 0.25);
    --accent-bg: rgba(37, 99, 235, 0.1);
    
    /* Generic Status */
    --status-active: var(--accent);
    --status-active-glow: var(--accent-glow);
    
    --status-inactive: var(--text-muted);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}
.logo i { font-size: 28px; color: var(--accent); }

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.nav-item i { font-size: 20px; color: var(--text-muted); transition: 0.2s; }

.nav-item:hover {
    background-color: var(--bg-surface-alt);
    color: var(--text-main);
}
.nav-item:hover i { color: var(--accent); }

.nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}
.nav-item.active i { color: var(--accent); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-page);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    padding: 10px 20px;
    border-radius: 12px;
    width: 360px;
    border: 1px solid var(--border-color);
    transition: 0.2s;
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}
.search-box input {
    border: none;
    background: transparent;
    color: var(--text-main);
    width: 100%;
    outline: none;
}
.search-box i { color: var(--text-muted); font-size: 18px; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    padding: 6px 16px 6px 6px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.user-name {
    font-size: 13px;
    font-weight: 600;
}
.wallet-balance {
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

/* Dashboard Wrapper */
.dashboard-wrapper {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Quick Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.3s;
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--accent-glow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-info .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

/* Generic Muted Elements */
.text-muted-alt { color: var(--text-muted) !important; }
.bg-muted-alt { background: var(--bg-surface-alt) !important; color: var(--text-muted) !important; border-color: var(--border-color) !important;}

/* Game Servers Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.section-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title i { color: var(--accent); }

.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); }

/* Game Server Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.server-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sc-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.05);
}

.game-title-area {
    display: flex;
    align-items: center;
    gap: 16px;
}
.game-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
/* Inactive server icon */
.game-icon.inactive { background: var(--bg-surface-alt); color: var(--text-muted); }

.game-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}
.game-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-family: monospace;
}

.status-pill {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.05);
}
.status-pill.online { color: var(--status-active); }
.status-pill.offline { color: var(--status-inactive); }
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.online { background: var(--status-active); box-shadow: var(--status-active-glow); }
.dot.offline { background: var(--status-inactive); }

/* HUD Metrics */
.sc-body {
    padding: 24px;
}
.metrics-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}
.metric {
    flex: 1;
}
.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.metric-header span:last-child {
    color: var(--text-main);
}
.progress-bg {
    width: 100%;
    height: 6px;
    background: var(--bg-surface-alt);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    box-shadow: var(--accent-glow);
}
.progress-fill.empty { background: transparent; box-shadow: none; }

/* Server Controls */
.sc-controls {
    display: flex;
    gap: 12px;
}
.btn-control {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-page);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: 0.2s;
}
.btn-control:hover { background: var(--bg-surface-alt); border-color: var(--accent); color: var(--accent); }

.btn-control:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--border-color) !important; color: var(--text-muted) !important; }

/* Quick Lists */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.panel-box {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
}
.panel-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.item-left h5 { font-size: 14px; color: var(--text-main); margin-bottom: 4px; }
.item-left p { font-size: 12px; color: var(--text-secondary); }

.ticket-row .item-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ticket-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.ticket-row .status-pill {
    display: inline-flex;
    margin-top: 8px;
    width: fit-content;
}

.accent-text { color: var(--accent); font-weight: 700; margin-right: 12px; }

.btn-outline {
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s;
}
.btn-outline:hover { background: var(--accent); color: #FFF; border-color: var(--accent); }

/* --- Modern Form Elements (Checkbox & Select) --- */

/* Modern Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px var(--accent-bg);
    outline: none;
}

/* Modern Select Dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* Space for the arrow */
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    
    /* Custom SVG Arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23CBD5E1%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 12px;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    padding: 32px;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:hover {
    color: #EF4444;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* --- Card Based Form Selections --- */
.os-option-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.os-option-card:hover {
    background: rgba(0,0,0,0.05);
}

.os-option-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.os-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s;
}

.os-option-card:has(input:checked) .os-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.check-icon-wrapper {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.check-icon-wrapper i {
    font-size: 14px;
    color: #FFF;
    opacity: 0;
    transition: 0.2s;
}

.os-option-card:has(input:checked) .check-icon-wrapper {
    background: var(--accent);
    border-color: var(--accent);
}

.os-option-card:has(input:checked) .check-icon-wrapper i {
    opacity: 1;
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 1024px) {
    .server-grid, .pricing-grid, .kb-grid {
        grid-template-columns: 1fr !important;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .dashboard-wrapper {
        padding: 24px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-row {
        flex-direction: column;
    }

    .sc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-box {
        padding: 24px;
        margin: 16px;
    }

    .form-row {
        flex-direction: column;
    }
    
    .auth-left, .auth-right {
        padding: 24px;
    }
    .auth-right {
        display: none; /* Hide the promotional banner on mobile for login/register */
    }
}
