@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS VARIABLES & DESIGN SYSTEM
   ============================================ */
:root {
    /* Primary palette — Indigo accent from shashi theme */
    --primary: #5f6efa;
    --primary-light: #7f8bff;
    --primary-dark: #4a57e0;
    --primary-glow: rgba(95, 110, 250, 0.3);

    /* Accent */
    --accent: #ffb700;
    --accent-light: #ffda00;

    /* Success / Warning / Danger */
    --success: #16c28e;
    --success-bg: rgba(22, 194, 142, 0.12);
    --warning: #f5a623;
    --warning-bg: rgba(245, 166, 35, 0.12);
    --danger: #f5595c;
    --danger-bg: rgba(245, 89, 92, 0.12);
    --info: #4facfe;
    --info-bg: rgba(79, 172, 254, 0.12);

    /* Dark theme — Deep navy from shashi */
    --bg-primary: #07102b;
    --bg-secondary: #0e1634;
    --bg-card: #0b132d;
    --bg-card-hover: #101b3a;
    --bg-input: #0c1328;
    --bg-sidebar: #091026;

    /* Text — Crisp blue-tinted whites */
    --text-primary: #dde7ff;
    --text-secondary: #a8b2dd;
    --text-muted: #7a89c4;
    --text-white: #e9f1ff;

    /* Borders — Subtle indigo tints */
    --border: rgba(120, 138, 255, 0.15);
    --border-light: rgba(120, 138, 255, 0.08);

    /* Glass */
    --glass-bg: rgba(14, 22, 52, 0.9);
    --glass-border: rgba(120, 138, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 36px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--primary-glow);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 24px;

    /* Spacing */
    --sidebar-width: 250px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #e8ebf0;
    --bg-card: #f7f8fa;
    --bg-card-hover: #f0f2f5;
    --bg-input: #edf0f4;
    --bg-sidebar: #f5f6f8;

    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #8896ab;
    --text-white: #1a202c;

    --border: rgba(130, 145, 170, 0.22);
    --border-light: rgba(130, 145, 170, 0.1);

    --glass-bg: rgba(247, 248, 250, 0.95);
    --glass-border: rgba(130, 145, 170, 0.18);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 36px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(95, 110, 250, 0.08);
}

/* Light mode overrides for hardcoded colors */
[data-theme="light"] body {
    background: linear-gradient(135deg, #eaecf2 0%, #e4e7ee 50%, #eef0f5 100%);
}

[data-theme="light"] .sidebar {
    background: #f3f4f7;
    border-right: 1px solid rgba(130, 145, 170, 0.18);
}

[data-theme="light"] .sidebar-brand small {
    color: #5a6578;
}

[data-theme="light"] .nav-link {
    color: #4a5568;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    background: rgba(95, 110, 250, 0.07);
    color: #5f6efa;
}

[data-theme="light"] .nav-section {
    color: #8896ab;
}

[data-theme="light"] .sidebar-user {
    border-top: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .user-avatar {
    background: linear-gradient(135deg, #5f6efa, #4a57e0);
    color: #fff;
}

[data-theme="light"] .topbar {
    background: rgba(243, 244, 247, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .topbar h1 {
    color: #2d3748;
}

[data-theme="light"] .menu-toggle {
    color: #4a5568;
}

[data-theme="light"] .stat-card {
    background: #f7f8fa;
    border: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .stat-card .stat-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03));
}

[data-theme="light"] .form-control,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="date"],
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: #edf0f4;
    border-color: #d8dce5;
    color: #2d3748;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
    border-color: #5f6efa;
    box-shadow: 0 0 0 3px rgba(95, 110, 250, 0.06);
}

[data-theme="light"] .table-container {
    background: #f7f8fa;
    border: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .table-header {
    border-bottom: 1px solid rgba(130, 145, 170, 0.1);
}

[data-theme="light"] .data-table thead th {
    background: #eef0f4;
    color: #4a5568;
    border-bottom: 1px solid #d8dce5;
}

[data-theme="light"] .data-table tbody tr {
    border-bottom: 1px solid #edf0f4;
}

[data-theme="light"] .data-table tbody tr:hover {
    background: #f0f2f5;
}

[data-theme="light"] .card,
[data-theme="light"] .card-header {
    background: #f7f8fa;
    border-color: rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .modal {
    background: #f5f6f8;
    border: 1px solid rgba(130, 145, 170, 0.18);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .kanban-column {
    background: #eef0f4;
}

[data-theme="light"] .kanban-card {
    background: #f7f8fa;
    border: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .kanban-card:hover {
    border-color: #5f6efa;
}

[data-theme="light"] .toast {
    background: #f5f6f8;
    border: 1px solid rgba(130, 145, 170, 0.18);
    color: #2d3748;
}

[data-theme="light"] .bulk-action-bar {
    background: rgba(243, 244, 247, 0.95);
    border-top: 1px solid rgba(130, 145, 170, 0.15);
}

[data-theme="light"] .empty-state .empty-icon {
    color: #8896ab;
}

[data-theme="light"] .podium-card {
    background: #f7f8fa;
    border: 1px solid rgba(130, 145, 170, 0.12);
}

[data-theme="light"] .leaderboard-item {
    background: #f7f8fa;
    border: 1px solid rgba(130, 145, 170, 0.1);
}

[data-theme="light"] .leaderboard-item:hover {
    background: #f0f2f5;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(150deg, #0a1636, #070c23 55%, #05102b);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body,
body[data-theme="light"] {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf8 50%, #f5f7fb 100%);
}

/* Theme toggle button */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-normal);
}
.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary-glow);
    transform: scale(1.05);
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary); }

img { max-width: 100%; display: block; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #0a1636 0%, #070c23 55%, #05102b 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(95, 110, 250, 0.2) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: pulse-glow 4s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(95, 110, 250, 0.12) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: pulse-glow 5s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s var(--transition-slow);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    transition: all var(--transition-normal);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #1a1a2e;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

.btn-sm { padding: 8px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; min-width: 40px; }

/* ============================================
   LAYOUT: SIDEBAR + MAIN
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
    font-size: 1.375rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    list-style: none;
}

.sidebar-nav .nav-section {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 8px;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: var(--primary-light);
    font-weight: 600;
}

.sidebar-nav .nav-link .icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

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

.topbar-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

.page-content {
    padding: 28px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-glow);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: var(--primary-light);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* ============================================
   DATA TABLE
   ============================================ */
.table-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.table-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
}

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

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-new { background: var(--info-bg); color: var(--info); }
.badge-contacted { background: var(--warning-bg); color: var(--warning); }
.badge-closed { background: var(--success-bg); color: var(--success); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg); color: var(--danger); }
.badge-admin { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-pm { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-intern { background: rgba(16, 185, 129, 0.15); color: #34d399; }

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

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 160px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group .form-control {
    padding: 9px 12px;
    font-size: 0.8125rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlide 0.3s ease;
    backdrop-filter: blur(12px);
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 0.875rem; }
.toast-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1.25rem; padding: 0;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.125rem; font-weight: 700; }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.leaderboard-item:hover {
    background: rgba(99, 102, 241, 0.03);
}

.leaderboard-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1a2e; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #1a1a2e; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.rank-default { background: var(--bg-input); color: var(--text-secondary); }

.leaderboard-info { flex: 1; }
.leaderboard-name { font-weight: 600; font-size: 0.9375rem; }
.leaderboard-meta { font-size: 0.75rem; color: var(--text-muted); }

.leaderboard-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
}

.progress-bar-container {
    width: 120px;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; max-width: 360px; margin: 0 auto; }

/* ============================================
   LOADING
   ============================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    padding: 16px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

/* ============================================
   FORM ROW
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================
   MOBILE SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ============================================
   PASSWORD TOGGLE
   ============================================ */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.125rem;
}

/* ============================================
   GEO TAG
   ============================================ */
.geo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--success);
    background: var(--success-bg);
    padding: 3px 8px;
    border-radius: 12px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
}

.pagination button:hover { border-color: var(--primary); color: var(--primary-light); }
.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.hide-mobile { display: table-cell; }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ============================================
   RESPONSIVE GRID UTILITIES
   ============================================ */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ============================================
   LEADERBOARD
   ============================================ */
.podium-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.podium-card {
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;
}

.podium-card:hover {
    transform: translateY(-4px);
}

.podium-medal { font-size: 2.5rem; margin-bottom: 8px; }
.podium-name { font-weight: 700; font-size: 1.125rem; color: var(--text-white); }
.podium-count { font-size: 2rem; font-weight: 800; color: var(--primary-light); margin: 4px 0; }
.podium-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   LEADERBOARD LIST
   ============================================ */
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    flex-shrink: 0;
    background: rgba(120, 138, 255, 0.1);
    color: var(--text-secondary);
}

.leaderboard-rank.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a2e; }
.leaderboard-rank.rank-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #1a1a2e; }
.leaderboard-rank.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: white; }

.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; font-size: 0.9375rem; color: var(--text-white); }
.leaderboard-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.leaderboard-score {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-light);
    flex-shrink: 0;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(120, 138, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content {
        padding: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .table-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .menu-toggle {
        display: block;
    }

    .page-content {
        padding: 14px;
    }

    .topbar {
        padding: 0 14px;
    }

    .topbar h1 {
        font-size: 1.1rem;
    }

    /* Stats grid — 2 columns on tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-icon { font-size: 1.4rem; }

    /* Filters — stack vertically */
    .filter-bar {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        min-width: 100%;
    }

    /* Form rows — single column */
    .form-row, .form-row-2 {
        grid-template-columns: 1fr;
    }

    /* Table header — stack */
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }

    .table-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .table-actions .btn {
        font-size: 0.75rem;
        padding: 8px 10px;
    }

    /* Tables — horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .data-table {
        min-width: auto;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 10px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Modals — near fullscreen on mobile */
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        margin: 5vh auto;
        border-radius: 12px;
    }

    .modal-body {
        max-height: 65vh;
        overflow-y: auto;
    }

    /* Login card */
    .login-card {
        padding: 28px 20px;
        width: 95vw;
        max-width: 400px;
    }

    /* Auth card mobile */
    .auth-container {
        padding: 12px;
    }

    .auth-card {
        padding: 28px 20px !important;
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    /* Campaign cards grid */
    .campaigns-grid {
        grid-template-columns: 1fr;
    }

    /* Kanban — single column */
    .kanban-board {
        grid-template-columns: 1fr !important;
    }

    /* Bulk action bar — full width on mobile */
    .bulk-action-bar {
        left: 0 !important;
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
    }

    .bulk-action-bar .bulk-actions {
        width: 100%;
        justify-content: stretch;
    }

    .bulk-action-bar .bulk-actions .btn {
        flex: 1;
        font-size: 0.75rem;
    }

    /* Form field builder */
    .field-card .field-header {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .pagination button {
        min-width: 34px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Touch-friendly inputs - prevents iOS zoom */
    input, select, textarea {
        font-size: 16px !important;
    }

    .form-control {
        padding: 10px 12px;
    }

    /* User cards / list */
    .user-cards-grid {
        grid-template-columns: 1fr;
    }

    /* Detail modal field grid */
    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    /* Topbar right — compact */
    .topbar-right {
        gap: 6px;
    }

    .topbar-right .btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    /* View toggle compact */
    #viewTableBtn, #viewKanbanBtn {
        font-size: 0.7rem !important;
        padding: 5px 8px !important;
    }

    /* Search bar full width */
    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100%;
    }

    /* Hide columns on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Grid utility — single column on mobile */
    .grid-2col,
    .grid-3col {
        grid-template-columns: 1fr;
    }

    /* Podium — stack on mobile */
    .podium-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .podium-card {
        min-width: auto;
        padding: 16px 20px;
        height: auto !important;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .podium-medal { font-size: 1.8rem; margin-bottom: 0; }
    .podium-count { font-size: 1.5rem; margin: 0; }
    .podium-name { font-size: 1rem; }

    /* Leaderboard compact */
    .leaderboard-item {
        gap: 10px;
        padding: 12px 14px;
    }

    .leaderboard-rank {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .leaderboard-score {
        font-size: 1rem;
    }

    /* Modal — responsive max-width */
    .modal {
        max-width: 95vw !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Campaign modal */
    .field-card .field-header {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .field-card input,
    .field-card select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card { padding: 12px; }
    .stat-card .stat-value { font-size: 1.2rem; }

    .table-actions {
        width: 100%;
    }

    .table-actions .btn {
        flex: 1;
        padding: 7px 8px;
    }

    /* Hide button text labels, show only emoji icons */
    .btn-text {
        display: none;
    }

    .page-content {
        padding: 10px;
    }

    .topbar h1 {
        font-size: 0.95rem;
    }

    /* Kanban cards — tighter */
    .kanban-card {
        padding: 10px;
    }

    .kanban-card .kc-name {
        font-size: 0.8rem;
    }

    /* Modal — full width bottom sheet */
    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0;
        border-radius: 12px 12px 0 0;
        max-height: 95vh;
        position: fixed;
        bottom: 0;
    }

    /* Hide less important cols */
    .hide-mobile {
        display: none !important;
    }

    /* Campaign public form */
    .campaign-container {
        padding: 16px;
    }

    .campaign-card {
        padding: 24px 16px;
    }

    /* Sidebar user info */
    .sidebar-user {
        padding: 12px 16px;
    }

    /* Filter bar compact */
    .filter-bar {
        gap: 6px;
    }

    .filter-bar select,
    .filter-bar input {
        padding: 8px 10px;
        font-size: 14px !important;
    }

    /* Auth page ultra-small */
    .auth-card {
        padding: 20px 16px !important;
    }

    .auth-logo img {
        height: 36px !important;
    }

    /* Table: data-table min-width smaller for phone */
    .data-table {
        min-width: 500px;
    }

    /* Topbar right hide clock */
    #liveTime {
        display: none;
    }

    /* Bulk bar compact */
    .bulk-action-bar {
        padding: 8px 10px;
    }

    .bulk-info {
        font-size: 0.75rem;
    }
}


