/* =============================================
   BetPanel - Ana CSS
   ============================================= */
:root {
    --primary: #0ea882;
    --primary-dark: #0c8f6e;
    --primary-light: #13c99a;
    --accent-orange: #f59e0b;
    --accent-orange-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: #0a7a61;
    --bg-sidebar-dark: #086652;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: rgba(255,255,255,0.9);

    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);

    --sidebar-width: 230px;
    --topbar-height: 60px;

    font-family: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg-body); color: var(--text-primary); min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-sidebar-dark) 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-logo {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
}
.brand-name { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.user-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px; flex-shrink: 0;
}
.user-name { color: #fff; font-size: 13px; font-weight: 600; display: block; line-height: 1.3; }
.user-role {
    font-size: 10px; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; display: inline-block; margin-top: 2px; text-transform: uppercase;
}
.user-role.superadmin { background: #ef4444; color: #fff; }
.user-role.admin { background: var(--accent-orange); color: #fff; }
.user-role.operator { background: rgba(255,255,255,0.2); color: #fff; }

.sidebar-nav { flex: 1; padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.nav-item.logout:hover { background: rgba(239,68,68,0.3); }

/* ---- Main Wrapper ---- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 18px;
    padding: 6px; border-radius: 6px; transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--bg-body); color: var(--primary); }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-time { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text-secondary); }
.topbar-user { display: flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 13px; }

/* ---- Page Content ---- */
.page-content { padding: 24px; }

/* ---- Filter Bar ---- */
.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: #fff;
    transition: border-color 0.2s;
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: var(--primary); }

.btn {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1400px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
    border-radius: var(--radius);
    padding: 18px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.4s ease both;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -10px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.stat-card.teal { background: linear-gradient(135deg, #0ea882 0%, #0c8f6e 100%); }
.stat-card.orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.stat-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}
.stat-label {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ---- Data Table ---- */
.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-body { padding: 0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.data-table thead th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }

.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-approved { background: #d1fae5; color: #059669; }
.badge-rejected { background: #fee2e2; color: #dc2626; }

/* ---- Timer Badge ---- */
.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.timer-badge.green { background: var(--primary); }
.timer-badge.yellow { background: var(--accent-orange); }
.timer-badge.red { background: var(--danger); }

/* ---- Action Buttons ---- */
.action-btns { display: flex; gap: 4px; }
.action-btn {
    width: 28px; height: 28px;
    border: none; border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    color: #fff;
}
.action-btn.view { background: var(--info); }
.action-btn.approve { background: var(--success); }
.action-btn.reject { background: var(--danger); }
.action-btn.edit { background: var(--accent-orange); }
.action-btn:hover { transform: scale(1.1); opacity: 0.9; }

/* ---- Site Summary Table ---- */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}
.summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.summary-table td:first-child { font-weight: 600; color: var(--primary); }
.summary-table tbody tr:hover { background: #f8fafc; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-muted); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Alert ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.page-btn {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { border-color: var(--primary); color: var(--primary); background: #f0fdf9; }

/* ---- Animations ---- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.25s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.3s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .page-content { padding: 14px; }
    .filter-bar { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .data-table { font-size: 11px; }
    .data-table thead th, .data-table tbody td { padding: 8px 10px; }
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a7a61 0%, #0c8f6e 50%, #13c99a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    color: #fff; font-size: 28px;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
