@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

/* 
=====================================================
   MODERN FLAT DESIGN SYSTEM v3.0
   - Clean Flat Colors (No Gradients)
   - Inter + Manrope Typography
   - Collapsible Sidebar
   - Light & Dark Theme
   - Modern Icons & Charts
===================================================== 
*/

/* 
   -----------------------------------------------------------------------------
   MODERN DESIGN SYSTEM (v3.0) - STABLE / LOCKED
   -----------------------------------------------------------------------------
   STATUS: LOCKED by User Request (2026-02-05)
   DO NOT MODIFY WITHOUT EXPLICIT INSTRUCTION.
   Backup created: modern-design-system.v1_stable.css
   -----------------------------------------------------------------------------
*/

:root {
    /* Primary Colors - Flat Design */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;

    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Neutral Colors - Light Theme */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Sidebar - Light Theme */
    --sidebar-bg: #ffffff;
    --sidebar-text: #0f172a;
    --sidebar-text-muted: #64748b;
    --sidebar-border: #e2e8f0;
    --sidebar-hover: #f1f5f9;
    --sidebar-active: #f1f5f9;
    --sidebar-active-text: #3b82f6;

    /* Borders & Dividers */
    --border-color: #e2e8f0;
    --divider: #e2e8f0;

    /* Shadows - Subtle & Modern */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Manrope', sans-serif;

    /* Transitions */
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-sidebar: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme='dark'] {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --sidebar-bg: #1e293b;
    --sidebar-text: #f1f5f9;
    --sidebar-text-muted: #cbd5e1;
    --sidebar-border: #334155;
    --sidebar-hover: #334155;
    --sidebar-active: #334155;
    --sidebar-active-text: #60a5fa;

    --border-color: #334155;
    --divider: #334155;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Structure */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Modern Sidebar */
.modern-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-sidebar);
    z-index: 1000;
    overflow: hidden;
    /* Prevent content bleeding */
}

.modern-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Sidebar Header */
.sidebar-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition-base);
}

.brand-logo img {
    height: 32px;
    width: auto;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Sidebar Toggle in Header */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    margin-right: 12px;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modern-sidebar.collapsed .brand-text {
    display: none !important;
    /* Force hide */
}

.modern-sidebar.collapsed .sidebar-header {
    padding: 0 8px;
    /* Tighter padding */
    justify-content: center;
    /* Center content */
    gap: 0;
}

.modern-sidebar.collapsed .brand-logo {
    margin-right: 0;
    flex: 1;
    justify-content: center;
}

.modern-sidebar.collapsed .brand-logo img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.modern-sidebar.collapsed .sidebar-toggle {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    position: absolute;
    right: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

/* Sidebar Body */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* User Profile Summary */
.user-profile-summary {
    padding: 12px;
    margin-bottom: 16px;
    background: var(--sidebar-hover);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-base);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-hover);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.modern-sidebar.collapsed .profile-info {
    display: none;
}

.modern-sidebar.collapsed .user-profile-summary {
    justify-content: center;
    padding: 8px;
}

/* Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0 12px;
    margin-bottom: 4px;
}

.modern-sidebar.collapsed .nav-label {
    display: none;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
}

.nav-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme='dark'] .nav-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.modern-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 10px;
}

.modern-sidebar.collapsed .nav-text,
.modern-sidebar.collapsed .nav-badge {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

.modern-sidebar.collapsed .sidebar-footer {
    display: none;
}

/* Header */
.header-modern {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: left var(--transition-sidebar);
}

.modern-sidebar.collapsed~.header-modern {
    left: var(--sidebar-collapsed);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-search {
    width: 320px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-base);
}

.header-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-base);
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-hover);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Content */
.main-container {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left var(--transition-sidebar);
}

.modern-sidebar.collapsed~.main-container {
    margin-left: var(--sidebar-collapsed);
}

/* Dashboard Layout */
.modern-dashboard {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.dashboard-container-full {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-quiz {
    background: #dbeafe;
    color: #3b82f6;
}

.icon-game {
    background: #d1fae5;
    color: #10b981;
}

.icon-rush {
    background: #fee2e2;
    color: #ef4444;
}

.icon-leader {
    background: #fef3c7;
    color: #f59e0b;
}

.icon-stats {
    background: #e0e7ff;
    color: #6366f1;
}

.icon-wallet {
    background: #f3e8ff;
    color: #a855f7;
}

.icon-test {
    background: #f1f5f9;
    color: #64748b;
}

.icon-refer {
    background: #fce7f3;
    color: #ec4899;
}

[data-theme='dark'] .icon-quiz {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme='dark'] .icon-game {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

[data-theme='dark'] .icon-rush {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme='dark'] .icon-leader {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme='dark'] .icon-stats {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

[data-theme='dark'] .icon-wallet {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

[data-theme='dark'] .icon-test {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

[data-theme='dark'] .icon-refer {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.action-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.action-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Chart Card */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
}

/* Sidebar Cards */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--primary);
}

/* Profile Card */
.profile-card {
    background: var(--primary);
    color: white;
    text-align: center;
    border: none;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 16px;
    object-fit: cover;
}

.profile-name-large {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.profile-email-muted {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-box-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.stat-box-label {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover);
    transition: var(--transition-base);
}

.activity-item:hover {
    background: var(--bg-main);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme='dark'] .activity-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-score {
    padding: 2px 8px;
    border-radius: 6px;
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

[data-theme='dark'] .activity-score {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.activity-time {
    font-size: 0.6875rem;
}

/* Topper Item */
.topper-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.topper-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.topper-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-active {
    padding: 2px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.6875rem;
    font-weight: 600;
}

[data-theme='dark'] .badge-active {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Platform Stats */
.platform-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.platform-stat-item {
    background: var(--bg-hover);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.platform-stat-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.platform-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Referral Banner */
.referral-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
}

.referral-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.referral-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.referral-copy-box {
    display: flex;
    gap: 8px;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.referral-copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-primary);
}

.referral-copy-box input:focus {
    outline: none;
}

.copy-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

/* =====================================================
   STANDARD PAGE UI COMPONENTS
   ===================================================== */

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-base);
}

.breadcrumb-nav a:hover {
    color: var(--primary);
}

.breadcrumb-nav i {
    font-size: 0.75rem;
}

.breadcrumb-nav .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.header-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Section Subtitle */
.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* Grid Container for Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Filter/Action Components */
.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-icon:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Compact Card Variations */
.compact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
}

.compact-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.compact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.compact-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.compact-card-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Badge Components */
.badge-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.badge-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Info Bar */
.info-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.info-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-bar-item i {
    color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
}

/* Text Utilities */
.text-main {
    color: var(--text-primary) !important;
}

.text-sec {
    color: var(--text-secondary) !important;
}

/* Responsive */
@media (max-width: 1280px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {

    .modern-sidebar,
    .modern-sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .modern-sidebar.show {
        transform: translateX(0);
    }

    .modern-sidebar.collapsed .brand-text {
        display: block !important;
    }

    .modern-sidebar.collapsed .sidebar-header {
        justify-content: space-between;
        padding: 0 20px;
    }

    .modern-sidebar.collapsed .brand-logo img {
        height: 32px;
        width: auto;
    }

    /* Reset toggle for mobile since it's now in header */
    .sidebar-toggle-btn {
        display: flex !important;
    }

    .header-modern {
        left: 0 !important;
        padding: 0 12px;
        /* Reduce padding on mobile */
    }

    .main-container {
        margin-left: 0 !important;
    }

    .header-search {
        display: none;
    }

    /* Hide page title on mobile - logo already shows */
    .page-title {
        display: none;
    }

    /* Style the sidebar toggle button better on mobile */
    .header-left {
        gap: 8px;
    }

    /* Fix user menu spacing and avatar cropping */
    .header-right {
        gap: 8px;
    }

    .user-menu {
        padding: 4px 6px;
        gap: 6px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .user-name {
        display: none;
        /* Hide username on mobile to save space */
    }

    /* Make header icon buttons more compact */
    .header-icon-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        /* Reduced from 16px */
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        /* Reduced from 16px */
    }

    .modern-dashboard {
        padding: 12px 10px;
        /* More compact */
    }

    /* Make dashboard stack on mobile */
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 16px;
        /* Reduced from 20px */
    }

    /* Compact sections */
    section {
        margin-bottom: 20px !important;
        /* Reduced from 32px */
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    /* Compact action cards */
    .action-card {
        padding: 12px;
        /* Reduced from 20px */
        min-width: 0;
    }

    .action-icon {
        width: 44px;
        /* Reduced from 56px */
        height: 44px;
        font-size: 1.25rem;
    }

    .action-card h3 {
        font-size: 0.8125rem;
    }

    .action-card p {
        font-size: 0.7rem;
    }

    /* Compact stat cards */
    .stat-card {
        padding: 12px;
        /* Reduced from 20px */
    }

    .stat-icon {
        width: 40px;
        /* Reduced */
        height: 40px;
        font-size: 1.125rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Compact referral banner */
    .referral-banner {
        padding: 12px;
        margin-bottom: 16px;
    }

    .referral-content {
        flex-direction: column;
        gap: 10px;
    }

    .referral-text h3 {
        font-size: 0.9375rem;
        margin-bottom: 6px;
    }

    .referral-text p {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .referral-copy-box {
        flex-direction: column;
        gap: 6px;
        width: 100%;
        padding: 3px;
    }

    .referral-copy-box input {
        font-size: 0.7rem;
        padding: 8px 10px;
        width: 100%;
        text-overflow: ellipsis;
    }

    .copy-btn {
        width: 100%;
        padding: 8px 12px;
        justify-content: center;
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.75rem;
    }

    /* Compact chart cards */
    .chart-card {
        padding: 12px;
    }

    /* Compact sidebar cards */
    .sidebar-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    /* Mobile responsive for standard UI components */
    .breadcrumb-nav {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .header-main {
        gap: 12px;
    }

    .header-icon {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .compact-card {
        padding: 12px;
    }

    .info-bar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {

    /* Keep Quick Actions at 2 per row, only make stats 1 column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Minimal padding on very small screens */
    .modern-dashboard {
        padding: 10px 8px;
    }

    /* Tighter spacing */
    .dashboard-container {
        gap: 12px;
    }

    .referral-banner {
        padding: 10px;
        margin-bottom: 12px;
    }

    .quick-actions-grid {
        gap: 8px;
    }

    section {
        margin-bottom: 16px !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-dashboard {
    animation: fadeIn 0.4s ease-out;
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-sidebar-toggle {
        display: flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
    }
}

/* =====================================================
   ADMIN TABLE STYLES - Theme-Aware
   ===================================================== */

/* Bootstrap Table Overrides for Theme Support */
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: var(--bg-hover);
    --bs-table-hover-bg: var(--bg-hover);
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Define bg-secondary for light and dark themes if not already defined */
:root {
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
}

[data-theme='dark'] {
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
}

.table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-hover) !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Responsive Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Override Bootstrap badge colors for dark mode compatibility */
.badge.bg-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary);
}

.badge.bg-primary {
    background: #1c1d4dff !important;
    color: white;
}

/* DataTables Future Support - Placeholder */
/* 
 * When integrating DataTables, add the following overrides:
 * - .dataTables_wrapper { color: var(--text-primary); }
 * - .dataTables_filter input { background: var(--bg-surface); }
 * - .dataTables_length select { background: var(--bg-surface); }
 * - Pagination buttons with theme colors
 */
/* Theme-Aware Sidebar Logo */
.logo-dark { display: none; }
[data-theme='dark'] .logo-light { display: none !important; }
[data-theme='dark'] .logo-dark { display: block !important; }
