:root {
    --bg-dark: #0b0f19;
    --bg-card: #111827;
    --bg-card-hover: #1f293d;
    --border-color: #1e293b;
    --sidebar-bg: #0d121f;
    --primary-purple: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

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

.brand-section {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ff4500;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.brand-info h2 {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.brand-info span {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.menu-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.menu-item a .left-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.menu-item.active a {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.menu-item a .arrow {
    font-size: 12px;
    opacity: 0.4;
}

.sidebar-footer {
    padding: 20px 14px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

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

/* Top Navbar */
.top-navbar {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.app-selector-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.pill-active-users {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.pill-production {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

/* Page Content */
.content-body {
    padding: 32px;
    flex: 1;
}

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

.page-title h1 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

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

.btn-refresh {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 4 KPI Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    border-radius: 16px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.card-purple {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.card-green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

.card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.card-orange {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.3);
}

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

.metric-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.metric-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.metric-value {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.metric-sub {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

/* Chart Container Card */
.chart-card {
    background: #0e1526;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
}

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

.chart-header-info h3 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.chart-header-info p {
    font-size: 12px;
    color: var(--text-dim);
}

.chart-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent-green);
    margin-bottom: 15px;
    font-weight: 700;
}

.chart-box {
    height: 320px;
    width: 100%;
}

/* Data Tables & Form Cards */
.panel-card {
    background: #0e1526;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.panel-card h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 18px;
    color: #fff;
}

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

.gaming-table th {
    text-align: left;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.gaming-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.gaming-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active, .status-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-rejected, .status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: #080d1a;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
}
