/* Base variables - will be overridden by themes */
:root {
    --bg-primary: #0B0B0F;
    --bg-secondary: #12121A;
    --bg-tertiary: #1A1A24;
    --accent-primary: #00E5FF;
    --accent-secondary: #A020F0;
    --accent-tertiary: #FFD700;
    --success: #00FF88;
    --danger: #FF3366;
    --warning: #FFAA00;
    --text-primary: #FFFFFF;
    --text-secondary: #8B9DC3;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(160, 32, 240, 0.3);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-bg: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    --glow-color: rgba(0, 229, 255, 0.3);
    --font-family: 'Rubik', sans-serif;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Legacy variable aliases for compatibility */
:root {
    --neon-cyan: var(--accent-primary);
    --neon-purple: var(--accent-secondary);
    --gold: var(--accent-tertiary);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Performance optimizations - Hardware acceleration */
.glass-card, .custom-modal-content, .btn, table tr {
    transform: translateZ(0);
    backface-visibility: hidden;
}

body {
    font-family: var(--font-family, 'Rubik', sans-serif);
    direction: rtl;
    background: var(--gradient-bg, linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Screen */
.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    z-index: 9999;
    padding: 20px;
}

.login-container.hidden { display: none !important; }

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 25px;
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo { text-align: center; margin-bottom: 30px; }

.login-logo h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p { color: var(--text-secondary); font-size: 1.1rem; margin-top: 10px; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--glow-color);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--glow-color);
}

.btn-success { background: var(--success); color: var(--bg-primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: var(--bg-primary); }
.btn-secondary { background: var(--glass-bg); border: 2px solid var(--glass-border); color: var(--text-primary); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-icon { padding: 10px; min-width: 40px; }

/* App Container */
.app-container { display: none; min-height: 100vh; }
.app-container.visible { display: block; }

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10001;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-role.admin { background: var(--accent-secondary); color: white; }
.user-role.user { background: var(--accent-primary); color: var(--bg-primary); }

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 5px;
    padding: 20px 30px;
    background: var(--bg-secondary);
    overflow-x: auto;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 12px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-tab:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--glow-color);
}

.nav-tab i { font-size: 1.1rem; }

/* Main Content */
.main-content { padding: 30px; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: tabEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

@keyframes tabEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i { color: var(--accent-primary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glow-color);
    border-color: var(--accent-primary);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}

.stat-icon.cyan { background: rgba(0, 229, 255, 0.15); color: var(--accent-primary); }
.stat-icon.purple { background: rgba(160, 32, 240, 0.15); color: var(--accent-secondary); }
.stat-icon.gold { background: rgba(255, 215, 0, 0.15); color: var(--accent-tertiary); }
.stat-icon.green { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.stat-icon.red { background: rgba(255, 51, 102, 0.15); color: var(--danger); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label { color: var(--text-secondary); font-size: 0.9rem; }

/* Enhanced Stats Grid */
.stats-grid--enhanced {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card--enhanced {
    text-align: right;
    position: relative;
    overflow: hidden;
}

.stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card--enhanced .stat-icon {
    margin: 0;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text-secondary);
}

.stat-trend--up {
    background: rgba(0, 255, 136, 0.12);
    color: var(--success);
}

.stat-trend--down {
    background: rgba(255, 51, 102, 0.12);
    color: var(--danger);
}

.stat-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    margin-top: 12px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sparkline-bar {
    flex: 1;
    height: var(--h, 50%);
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0.25;
    transition: opacity 0.3s ease;
}

.sparkline-bar:last-child {
    opacity: 0.8;
}

.stat-card--enhanced:hover .sparkline-bar {
    opacity: 0.5;
}

.stat-card--enhanced:hover .sparkline-bar:last-child {
    opacity: 1;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

tr:hover { background: var(--glass-hover); }

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 51, 102, 0.15); color: var(--danger); }
.badge-info { background: rgba(0, 229, 255, 0.15); color: var(--accent-primary); }

.brand-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color, var(--glass-border));
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.modal-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-tab:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.modal-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.modal-tab i {
    font-size: 0.85rem;
}

/* Player Tags */
.player-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.player-tag .remove-tag {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.player-tag .remove-tag:hover {
    opacity: 1;
    color: var(--danger);
}

.suggested-tag {
    cursor: pointer;
    color: var(--accent-primary);
    margin-right: 8px;
}

.suggested-tag:hover {
    text-decoration: underline;
}

/* VIP Level Badges */
.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.vip-badge.standard { background: rgba(128, 128, 128, 0.3); color: #aaa; }
.vip-badge.bronze { background: rgba(205, 127, 50, 0.3); color: #cd7f32; }
.vip-badge.silver { background: rgba(192, 192, 192, 0.3); color: #c0c0c0; }
.vip-badge.gold { background: rgba(255, 215, 0, 0.3); color: #ffd700; }
.vip-badge.platinum { background: rgba(229, 228, 226, 0.3); color: #e5e4e2; }
.vip-badge.diamond { background: rgba(185, 242, 255, 0.3); color: #b9f2ff; }

/* Risk Level Badges */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.risk-badge.low { background: rgba(0, 255, 136, 0.2); color: var(--success); }
.risk-badge.medium { background: rgba(255, 170, 0, 0.2); color: var(--warning); }
.risk-badge.high { background: rgba(255, 51, 102, 0.2); color: var(--danger); }

/* KYC Status Badges */
.kyc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kyc-badge.pending { background: rgba(255, 170, 0, 0.2); color: var(--warning); }
.kyc-badge.verified { background: rgba(0, 255, 136, 0.2); color: var(--success); }
.kyc-badge.rejected { background: rgba(255, 51, 102, 0.2); color: var(--danger); }

/* Player Profile Card */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-info-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.profile-info-item span {
    font-weight: 500;
}

/* Player Events Timeline */
.event-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-primary);
}

.event-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: var(--bg-primary);
    flex-shrink: 0;
}

.event-content {
    flex: 1;
}

.event-content .event-type {
    font-weight: 600;
    margin-bottom: 4px;
}

.event-content .event-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--accent-primary); }

/* Create vs Edit modal distinction */
.modal-header.modal-create h3 i { color: var(--success); }
.modal-header.modal-edit h3 i { color: var(--warning); }

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover { color: var(--danger); }

.modal-body { padding: 25px; }

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Sub-tabs (Deposits/Withdrawals) */
.sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.sub-tab {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.sub-tab:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.sub-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    font-weight: 600;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-group { flex: 1; min-width: 150px; }
.filter-group label { display: block; margin-bottom: 5px; font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }

.filter-group input, .filter-group select {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid .form-group.full-width { grid-column: span 2; }

/* Action Buttons */
.action-btns { display: flex; gap: 5px; }

/* Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10003;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInLeft 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--success); color: var(--bg-primary); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: var(--bg-primary); }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Help Section */
.help-section { margin-bottom: 30px; }
.help-section h3 { color: var(--accent-primary); margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.help-section p, .help-section li { color: var(--text-secondary); line-height: 1.8; margin-bottom: 10px; }
.help-section ul { padding-right: 25px; }
.help-section code { background: var(--bg-tertiary); padding: 2px 8px; border-radius: 4px; color: var(--accent-tertiary); }

.formula-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    font-family: monospace;
    color: var(--accent-primary);
}

/* ============================================
   CUSTOM SELECT DROPDOWN STYLES
============================================ */

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 45px 14px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300E5FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

select:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.15), 0 0 0 3px rgba(0, 229, 255, 0.1);
    transform: translateY(-1px);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2), 0 8px 25px rgba(0, 229, 255, 0.2);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238B9DC3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Select option styling (limited browser support) */
select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
    font-weight: 500;
}

select option:checked {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

select optgroup {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    font-weight: 700;
    font-style: normal;
}

/* Multiple select */
select[multiple] {
    padding: 10px;
    background-image: none;
    height: auto;
    min-height: 120px;
}

select[multiple] option {
    padding: 10px 15px;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s;
}

select[multiple] option:hover {
    background: var(--glass-hover);
}

/* ============================================
   DATETIME PICKER STYLES
============================================ */

input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

input[type="datetime-local"]:hover,
input[type="date"]:hover,
input[type="time"]:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.15), 0 0 0 3px rgba(0, 229, 255, 0.1);
    transform: translateY(-1px);
}

input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2), 0 8px 25px rgba(0, 229, 255, 0.2);
}

/* Style the calendar/clock picker icon */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: brightness(1.2);
    opacity: 0.9;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 15px var(--accent-primary);
}

/* Firefox date input styling */
input[type="datetime-local"]::-moz-focus-inner,
input[type="date"]::-moz-focus-inner,
input[type="time"]::-moz-focus-inner {
    border: 0;
}

/* Date/time input inner elements */
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
    padding: 0;
}

input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    background: transparent;
}

input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-text {
    color: var(--text-secondary);
    padding: 0 4px;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus {
    background: rgba(0, 229, 255, 0.2);
    color: var(--accent-primary);
}

/* Number input styling */
input[type="number"] {
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

input[type="number"]:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.15), 0 0 0 3px rgba(0, 229, 255, 0.1);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2), 0 8px 25px rgba(0, 229, 255, 0.2);
}

/* Number input spinner buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    background: var(--accent-primary);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
    opacity: 1;
}

/* Color input styling */
input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    width: 60px;
    height: 50px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    padding: 4px;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

/* ============================================
   CHECKBOX & RADIO STYLES
============================================ */

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--bg-tertiary);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    vertical-align: middle;
    margin-left: 10px;
}

input[type="checkbox"] {
    border-radius: 6px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 7px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2);
}

/* Toggle switch style */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    right: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(-24px);
    background: white;
}

/* ============================================
   TEXT INPUT ENHANCEMENTS
============================================ */

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary)) !important;
    border: 2px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
textarea:hover {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.15), 0 0 0 3px rgba(0, 229, 255, 0.1) !important;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2), 0 8px 25px rgba(0, 229, 255, 0.2) !important;
}

/* Placeholder styling */
::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
}

::-webkit-input-placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

::-moz-placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Search input with icon */
input[type="search"] {
    padding-right: 45px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238B9DC3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
}

/* Clear search button */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23FF3366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

input[type="search"]::-webkit-search-cancel-button:hover {
    opacity: 1;
}

/* ============================================
   ANALYSIS TAB STYLES
============================================ */

.analysis-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.analysis-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.analysis-card.income .analysis-icon { background: rgba(0, 200, 83, 0.2); color: #00C853; }
.analysis-card.expense .analysis-icon { background: rgba(255, 82, 82, 0.2); color: #FF5252; }
.analysis-card.bonus .analysis-icon { background: rgba(156, 39, 176, 0.2); color: #9C27B0; }
.analysis-card.fees .analysis-icon { background: rgba(255, 152, 0, 0.2); color: #FF9800; }
.analysis-card.profit .analysis-icon { background: rgba(0, 229, 255, 0.2); color: #00E5FF; }
.analysis-card.net .analysis-icon { background: rgba(118, 255, 3, 0.2); color: #76FF03; }

.analysis-content {
    flex: 1;
}

.analysis-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.analysis-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.analysis-card.income .analysis-value { color: #00C853; }
.analysis-card.expense .analysis-value { color: #FF5252; }
.analysis-card.profit .analysis-value { color: #00E5FF; }
.analysis-card.net .analysis-value { color: #76FF03; }

.analysis-content small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Cost Breakdown */
.cost-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.cost-row:last-child {
    border-bottom: none;
}

.cost-row.total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--accent-primary);
    border-bottom: none;
    color: var(--text-primary);
    font-weight: bold;
}

.cost-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Progress bars for percentages */
.progress-bar {
    background: var(--bg-tertiary);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.5s ease;
}

/* ============================================
   RESPONSIVE & MOBILE IMPROVEMENTS
============================================ */

/* Prevent overflow globally */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Table responsiveness */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table {
    min-width: 600px;
    width: 100%;
    table-layout: auto;
}

table th, table td {
    white-space: nowrap;
}

/* Glass card overflow protection */
.glass-card {
    overflow: hidden;
    max-width: 100%;
}

/* ============================================
   DESKTOP TABLE ENHANCEMENTS
   ============================================ */

/* Sticky table headers */

/* Compact table mode */
.table-container.compact-mode table {
    font-size: 0.85rem;
}

.table-container.compact-mode th,
.table-container.compact-mode td {
    padding: 8px 12px;
}

.table-container.compact-mode .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Table controls toolbar */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.table-controls-left,
.table-controls-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.table-toggle-btn:hover {
    background: var(--glass-hover);
    border-color: var(--accent-primary);
}

.table-toggle-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.table-toggle-btn i {
    font-size: 0.9rem;
}

/* Keyboard navigation highlight */
.table-container tbody tr.keyboard-focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
    background: rgba(0, 229, 255, 0.1);
}

/* Column visibility toggles */
.column-visibility-menu {
    position: relative;
}

.column-visibility-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
}

.column-visibility-dropdown.active {
    display: block;
}

.column-visibility-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.column-visibility-item:hover {
    background: var(--glass-hover);
}

.column-visibility-item input[type="checkbox"] {
    margin: 0;
}

.column-visibility-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

/* Hidden columns */
table th.hidden-column,
table td.hidden-column {
    display: none;
}

/* Sortable column headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 24px;
}

.sortable-header::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.sortable-header:hover::after {
    opacity: 0.7;
}

.sortable-header.sorted-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--accent-primary);
}

.sortable-header.sorted-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--accent-primary);
}

/* Resizable columns */
.resizable-header {
    position: relative;
}

.column-resizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background: transparent;
    transition: background 0.2s ease;
}

.column-resizer:hover,
.column-resizer.resizing {
    background: var(--accent-primary);
}

/* Table loading state */
.table-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   MICRO-INTERACTIONS AND VISUAL POLISH
   ============================================ */

/* Number counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value,
.stat-card .value {
    animation: countUp 0.5s ease-out;
}

/* Pulse animation for updated values */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.value-updated {
    animation: pulse 0.4s ease-out;
    color: var(--accent-primary);
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loader {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0px,
        var(--bg-tertiary) 40px,
        var(--bg-secondary) 80px
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
    height: 20px;
}

/* Improved focus states */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
.btn:focus-visible {
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1);
}

/* Parallax effect on stat cards */

/* Badge animations */
.badge {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Success/error flash animations */
@keyframes successFlash {
    0%, 100% {
        background: var(--glass-bg);
    }
    50% {
        background: rgba(0, 255, 136, 0.2);
    }
}

@keyframes errorFlash {
    0%, 100% {
        background: var(--glass-bg);
    }
    50% {
        background: rgba(255, 51, 102, 0.2);
    }
}

.row-success {
    animation: successFlash 0.6s ease-out;
}

.row-error {
    animation: errorFlash 0.6s ease-out;
}

/* Smooth color transitions */
.glass-card,
.stat-card,
.btn,
table tr,
.badge {
    transition: background 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

/* Icon spin on action */
@keyframes iconSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.btn.loading i,
.icon-spinning {
    animation: iconSpin 1s linear infinite;
}

/* Stagger animation for lists */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* Tooltip enhancements */
[title] {
    position: relative;
    cursor: help;
}

/* Button press effect */
.btn:active {
    transform: scale(0.96);
}

/* Glow effect on hover for primary actions */
.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-primary),
                0 0 40px rgba(0, 229, 255, 0.3),
                0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Card entrance animation */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.glass-card {
    animation: cardEntrance 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Loading dots animation */
@keyframes loadingDots {
    0%, 20% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

.loading-dots span {
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Custom Confirmation Modal */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.15s ease;
    will-change: opacity;
}

.custom-modal.active {
    display: flex;
}

.custom-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.2s ease;
    will-change: transform, opacity;
}

.custom-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-modal-header i {
    font-size: 1.5rem;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.custom-modal-body {
    padding: 24px;
}

.custom-modal-body p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.custom-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-footer .btn {
    min-width: 100px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Landscape mobile - show normal buttons */

/* Small mobile */

/* ============================================
   PLAYER ANALYTICS
============================================ */

/* Funnel Visualization */
.funnel-container {
    padding: 10px 0;
}

.funnel-stages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.funnel-stage {
    display: flex;
    align-items: center;
    gap: 15px;
}

.funnel-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    min-width: 100px;
    transition: width 0.5s ease;
}

.funnel-label {
    font-weight: 600;
    color: var(--bg-primary);
}

.funnel-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--bg-primary);
}

.funnel-rate {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

/* Segment Tabs */
.segment-tabs .btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Player Analytics Stats */
#playerAnalyticsOverview .stat-card,
#playerAnalyticsRetention .stat-card {
    padding: 15px;
}

#playerAnalyticsOverview .stat-info h3,
#playerAnalyticsRetention .stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

#playerAnalyticsOverview .stat-info p,
#playerAnalyticsRetention .stat-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   MOBILE FAB - Dedicated Floating Action Button
   ============================================ */

.mobile-fab {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 50%, #0066cc 100%);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 25px rgba(0, 150, 255, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    animation: fabPulse 2s ease-in-out infinite;
}

.mobile-fab:active {
    transform: scale(0.9);
    box-shadow: 0 4px 15px rgba(0, 150, 255, 0.4);
    animation: none;
}

.mobile-fab i {
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Subtle pulse animation to draw attention */
@keyframes fabPulse {
    0%, 100% {
        box-shadow: 
            0 8px 25px rgba(0, 150, 255, 0.5),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 8px 30px rgba(0, 150, 255, 0.7),
            0 4px 15px rgba(0, 0, 0, 0.4);
    }
}

/* ============================================
   TABLE HORIZONTAL SCROLL - Fixed & Smooth
   ============================================ */

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

