/* =============================================
   RUPOSHI88 ADMIN PANEL - DARK THEME CSS
   Mobile-First Responsive Design
   ============================================= */

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

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --bg-sidebar: #0f0f0f;
    --bg-header: #111111;
    --border-color: #2a2a2a;
    --border-gold: #c9a227;
    --gold: #c9a227;
    --gold-light: #f0c040;
    --gold-dark: #a07a10;
    --text-primary: #e8e8e8;
    --text-secondary: #9a9a9a;
    --text-muted: #666666;
    --green: #00c853;
    --green-dark: #009624;
    --red: #f44336;
    --red-dark: #ba000d;
    --orange: #ff9800;
    --blue: #2196f3;
    --purple: #9c27b0;
    --cyan: #00bcd4;
    --sidebar-width: 200px;
    --header-height: 60px;
    --transition: all 0.25s ease;
    --radius: 8px;
    --radius-sm: 5px;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-gold: 0 0 15px rgba(201,162,39,0.2);
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Inter', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul { list-style: none; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* =============================================
   OVERLAY (mobile sidebar)
   ============================================= */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
}
#sidebar-overlay.active { display: block; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-logo .logo-icon {
    font-size: 28px;
    color: var(--gold);
    display: block;
    line-height: 1;
    margin-bottom: 2px;
}

.sidebar-logo .logo-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 1px;
    line-height: 1.1;
}

.sidebar-logo .logo-sub {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
    border-top: 1px solid var(--border-color);
    padding-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 14px 4px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(201,162,39,0.08);
    color: var(--gold-light);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(201,162,39,0.18), rgba(201,162,39,0.04));
    color: var(--gold);
    border-left: 3px solid var(--gold);
    font-weight: 600;
}

.nav-link .nav-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link .nav-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.visit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    background: transparent;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius);
    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.visit-btn:hover {
    background: rgba(201,162,39,0.12);
    box-shadow: var(--shadow-gold);
}

/* =============================================
   MAIN WRAPPER
   ============================================= */
.main-wrapper {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* =============================================
   HEADER
   ============================================= */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 900;
    flex-shrink: 0;
}

.header-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: none;
}

.header-menu-btn:hover { color: var(--gold); }

.header-welcome {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-welcome .welcome-text {
    font-size: 10px;
    color: var(--text-muted);
}

.header-welcome .admin-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-badge {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    display: inline-block;
}

.header-spacer { flex: 1; }

.header-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.header-info-item .info-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-info-item .info-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
}

.header-profile:hover {
    border-color: var(--border-color);
    background: var(--bg-card);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    border: 2px solid var(--gold);
    flex-shrink: 0;
}

.profile-info .profile-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-info .profile-role {
    font-size: 10px;
    color: var(--text-muted);
}

/* =============================================
   CONTENT AREA
   ============================================= */
.content {
    flex: 1;
    padding: 16px;
    background: var(--bg-primary);
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title .title-icon { color: var(--gold); }

.date-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.date-picker:hover { border-color: var(--gold); color: var(--gold); }
.date-picker .dp-icon { color: var(--gold); }

/* =============================================
   STAT CARDS ROW
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

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

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 3px;
}

.stat-badge.up { background: rgba(0,200,83,0.12); color: var(--green); }
.stat-badge.down { background: rgba(244,67,54,0.12); color: var(--red); }

.stat-icon {
    font-size: 28px;
    opacity: 0.7;
}

.stat-icon.users { color: var(--gold); }
.stat-icon.agents { color: var(--green); }
.stat-icon.deposits { color: var(--cyan); }
.stat-icon.withdrawals { color: var(--red); }
.stat-icon.profit { color: var(--purple); }

.stat-link {
    font-size: 11px;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 8px;
    transition: var(--transition);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    width: 100%;
}

.stat-link:hover { color: var(--gold-light); gap: 6px; }

/* =============================================
   MAIN GRID (charts + right column)
   ============================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 12px;
    margin-bottom: 16px;
}

/* =============================================
   CARDS (generic)
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-title .ct-icon { color: var(--gold); }

.card-body { padding: 14px; }

.view-all {
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
    transition: var(--transition);
}
.view-all:hover { color: var(--gold-light); }

/* =============================================
   CHART CARD
   ============================================= */
.chart-card .card-body { padding: 10px 14px 14px; }

.chart-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
}

.chart-filter:hover { border-color: var(--gold); color: var(--gold); }

.chart-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.green { background: var(--green); }
.legend-dot.red { background: var(--red); }

.chart-container {
    position: relative;
    height: 200px;
}

/* =============================================
   TOP GAMES
   ============================================= */
.top-games-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.game-item:last-child { border-bottom: none; }
.game-item:hover { background: rgba(255,255,255,0.02); padding-left: 4px; }

.game-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.game-logo.jili { background: linear-gradient(135deg, #e65100, #ff6d00); }
.game-logo.pg   { background: linear-gradient(135deg, #1565c0, #1976d2); }
.game-logo.prag { background: linear-gradient(135deg, #2e7d32, #388e3c); }
.game-logo.fc   { background: linear-gradient(135deg, #c62828, #e53935); }
.game-logo.jdb  { background: linear-gradient(135deg, #6a1b9a, #8e24aa); }

.game-name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.game-amount {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* =============================================
   SYSTEM INFO
   ============================================= */
.system-info-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sys-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
}

.sys-item .sys-label {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sys-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.sys-item .sys-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.sys-item .sys-value.green { color: var(--green); font-weight: 700; }
.sys-item .sys-value.blue { color: var(--cyan); font-weight: 700; }
.sys-item .sys-value.gold { color: var(--gold); font-weight: 700; }

/* =============================================
   QUICK ACTIONS
   ============================================= */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.qa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    color: #000;
}

.qa-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }

.qa-btn.gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); }
.qa-btn.green { background: linear-gradient(135deg, var(--green-dark), var(--green)); }
.qa-btn.blue { background: linear-gradient(135deg, #1565c0, var(--blue)); color: #fff; }
.qa-btn.purple { background: linear-gradient(135deg, #6a1b9a, var(--purple)); color: #fff; }

/* =============================================
   SHORTCUTS
   ============================================= */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.sc-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,162,39,0.06);
}

.sc-btn .sc-icon { font-size: 13px; }

/* =============================================
   TABLES SECTION (deposits / withdrawals)
   ============================================= */
.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    min-width: 420px;
}

thead tr {
    background: rgba(255,255,255,0.03);
}

th {
    padding: 8px 10px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 8px 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: nowrap;
}

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

tbody tr:hover { background: rgba(255,255,255,0.02); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge.approved { background: rgba(0,200,83,0.15); color: var(--green); border: 1px solid rgba(0,200,83,0.3); }
.badge.pending  { background: rgba(255,152,0,0.15); color: var(--orange); border: 1px solid rgba(255,152,0,0.3); }
.badge.rejected { background: rgba(244,67,54,0.15); color: var(--red); border: 1px solid rgba(244,67,54,0.3); }

.amount-col { font-weight: 700; color: var(--text-primary); }
.num-col { color: var(--text-muted); }
.user-col { font-weight: 600; color: var(--text-primary); }
.time-col { font-size: 10px; color: var(--text-muted); }

/* =============================================
   TODAY'S SUMMARY
   ============================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.summary-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-1px);
}

.summary-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.summary-icon.users   { background: rgba(201,162,39,0.12); color: var(--gold); }
.summary-icon.deposit { background: rgba(0,200,83,0.12); color: var(--green); }
.summary-icon.withdraw { background: rgba(244,67,54,0.12); color: var(--red); }
.summary-icon.active  { background: rgba(33,150,243,0.12); color: var(--blue); }
.summary-icon.bets    { background: rgba(156,39,176,0.12); color: var(--purple); }

.summary-info .summary-label {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.summary-info .summary-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.summary-info .summary-change {
    font-size: 10px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.summary-info .summary-change.up { color: var(--green); }
.summary-info .summary-change.down { color: var(--red); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.footer-right { display: flex; align-items: center; gap: 4px; }
.footer-heart { color: var(--red); }

/* =============================================
   RIGHT COLUMN (sidebar right)
   ============================================= */
.right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =============================================
   CHART LEFT COL
   ============================================= */
.left-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =============================================
   SECTION DIVIDER
   ============================================= */
.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 0 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Large tablet: 1200px */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .right-col { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Tablet: 1024px */
@media (max-width: 1024px) {
    :root { --sidebar-width: 200px; }
    .header-info { gap: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tables-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small tablet: 768px */
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    .sidebar {
        left: -220px;
        width: 220px;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

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

    .header-menu-btn { display: flex; align-items: center; }

    .header-info { display: none; }
    .header-divider { display: none; }

    .profile-info { display: none; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .tables-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .right-col { display: grid; grid-template-columns: 1fr 1fr; }
    .content { padding: 12px; }
}

/* Mobile: 480px */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .right-col { grid-template-columns: 1fr; }
    .quick-actions-grid { grid-template-columns: 1fr 1fr; }
    .shortcuts-grid { grid-template-columns: 1fr 1fr; }

    .stat-card { padding: 10px; }
    .stat-value { font-size: 15px; }
    .stat-icon { font-size: 22px; }

    .page-title { font-size: 15px; }
    .content { padding: 10px; }

    .summary-card { padding: 10px; gap: 8px; }
    .summary-icon { width: 36px; height: 36px; font-size: 17px; }
    .summary-info .summary-value { font-size: 14px; }

    .date-picker { font-size: 10px; padding: 6px 8px; }
}

/* Very small: 360px */
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .header { padding: 0 10px; }
    .content { padding: 8px; }
}
