/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --warning-light: #fbbf24;

    /* Light Mode Colors (Default) */
    --bg-dark: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --border-color: rgba(99, 102, 241, 0.15);
    --border-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #1a1a2e;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --input-bg: rgba(0, 0, 0, 0.03);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
body.dark-mode {
    --bg-dark: #0f0f23;
    --bg-card: rgba(30, 30, 60, 0.6);
    --bg-card-hover: rgba(40, 40, 80, 0.7);
    --border-color: rgba(99, 102, 241, 0.2);
    --border-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --input-bg: rgba(0, 0, 0, 0.3);
}

body.dark-mode::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

/* Dark Mode - Input Card */
body.dark-mode .input-card {
    background: transparent;
    box-shadow: none;
    padding-bottom: 0;
}

body.dark-mode .input-card .card-header h2 {
    color: #ffffff;
}

body.dark-mode .input-card .card-header p {
    color: #a1a1aa;
}

body.dark-mode .input-area textarea {
    background: transparent;
    border: none;
    color: #ffffff;
}

body.dark-mode .input-area textarea::placeholder {
    color: #a1a1aa !important;
    opacity: 1;
}

body.dark-mode .input-area textarea:focus {
    background: transparent;
}

/* Dark Mode - Date Filter Inputs */
body.dark-mode .date-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
}

body.dark-mode .date-input:focus {
    border-color: #6366f1 !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.7);
}

body.dark-mode .date-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

body.dark-mode .date-input-group label {
    color: #a1a1aa !important;
}

/* Dark Mode - Quick Filter Buttons */
body.dark-mode .quick-filter-btn {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a1a1aa !important;
}

body.dark-mode .quick-filter-btn:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}

body.dark-mode .quick-filter-btn.active {
    background: #6366f1 !important;
    color: white !important;
    border-color: transparent !important;
}

/* Dark Mode - Clear Dates Button */
body.dark-mode .btn-ghost {
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a1a1aa !important;
}

body.dark-mode .btn-ghost:hover {
    border-color: #ef4444 !important;
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dark Mode - Dashboard Body */
body.dark-mode {
    background: linear-gradient(180deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
}

/* Dark Mode - Header */
body.dark-mode .header-content .logo h1 {
    color: #ffffff;
}

body.dark-mode .header-time {
    color: #a1a1aa;
}

body.dark-mode .logo-icon {
    background: rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .session-timer {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

/* Dark Mode - Stat Cards */
body.dark-mode .stat-card {
    background: rgba(30, 30, 60, 0.8) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stat-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 30, 60, 0.8) 100%) !important;
}

body.dark-mode .stat-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 30, 60, 0.8) 100%) !important;
}

body.dark-mode .stat-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(30, 30, 60, 0.8) 100%) !important;
}

body.dark-mode .stat-card:nth-child(4) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 30, 60, 0.8) 100%) !important;
}

body.dark-mode .stat-card:nth-child(5) {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(30, 30, 60, 0.8) 100%) !important;
}

body.dark-mode .stat-value {
    color: #ffffff;
}

body.dark-mode .stat-label {
    color: #a1a1aa;
}

/* Dark Mode - Input Column */
body.dark-mode .input-col {
    background: rgba(30, 30, 60, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .filter-header {
    color: #ffffff;
}

body.dark-mode .filter-header svg {
    color: #a5b4fc;
}

body.dark-mode .number-count {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

body.dark-mode .date-input-group label {
    color: #a1a1aa;
}

/* Dark Mode - Results Card */
body.dark-mode .results-card {
    background: rgba(30, 30, 60, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card-header h2 {
    color: #ffffff;
}

body.dark-mode .btn-outline {
    background: transparent;
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

/* Dark Mode - Results Table */
body.dark-mode .results-table th {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

body.dark-mode .results-table td {
    color: #e2e8f0;
    border-bottom-color: rgba(99, 102, 241, 0.15);
}

body.dark-mode .results-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .results-table tbody tr:hover:not(.empty-row) {
    background: rgba(99, 102, 241, 0.1);
}

body.dark-mode .status-badge.purchased {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

body.dark-mode .status-badge.not-purchased {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

body.dark-mode .status-badge.outside-range {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

body.dark-mode .empty-state {
    color: #71717a;
}

/* Dark Mode - Loading Overlay */
body.dark-mode .loading-overlay {
    background: rgba(15, 15, 35, 0.95);
}

body.dark-mode .spinner {
    border-color: rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
}

body.dark-mode .loading-spinner p {
    color: #a1a1aa;
}

/* Dark Mode - Toast */
body.dark-mode .toast {
    background: rgba(30, 30, 60, 0.95);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
}

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

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-screen.hidden {
    display: none;
}

.initial-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading Logo */
.loading-logo {
    margin-bottom: 30px;
}

.loading-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

/* ===== Modern Login Screen ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f0f23 url('login-bg.png') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 25%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent);
    pointer-events: none;
}

.login-screen::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 25%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent);
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 28px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 320px;
    max-width: 90%;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.login-icon {
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.login-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.login-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 12px;
    transition: all 0.2s ease;
}

.input-field:focus-within {
    border-color: #94a3b8;
    background: #fff;
}

.input-field svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    flex-shrink: 0;
}

.input-field input {
    flex: 1;
    padding: 10px 10px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: #1e293b;
    font-family: var(--font-family);
    outline: none;
}

.input-field input::placeholder {
    color: #94a3b8;
}

.login-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 16px;
    min-height: 18px;
}

.login-screen.hidden {
    display: none;
}

/* Login Theme Toggle */
.login-theme-toggle {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    margin-top: 20px;
}

.login-theme-toggle:hover {
    transform: scale(1.05) !important;
}

.login-theme-toggle:active {
    transform: scale(0.95) !important;
}

/* Dark Mode Login Screen */
body.dark-mode .login-screen {
    background: #0f0f23 url('login-bg.png') center center / cover no-repeat;
}

body.dark-mode .login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.75);
    pointer-events: none;
}

body.dark-mode .login-screen::after {
    display: none;
}

body.dark-mode .login-card {
    background: rgba(30, 30, 60, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.1);
}

body.dark-mode .login-card h2 {
    color: #ffffff;
}

body.dark-mode .login-subtitle {
    color: #a1a1aa;
}

body.dark-mode .login-icon {
    background: rgba(99, 102, 241, 0.2);
}

body.dark-mode .input-field {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .input-field:focus-within {
    border-color: #6366f1;
    background: rgba(0, 0, 0, 0.4);
}

body.dark-mode .input-field svg {
    color: #a1a1aa;
}

body.dark-mode .input-field input {
    color: #ffffff;
}

body.dark-mode .input-field input::placeholder {
    color: #71717a;
}

body.dark-mode .login-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

body.dark-mode .login-btn:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

body.dark-mode .loading-screen {
    background: #0f0f23;
}


html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(180deg, #f0f7fc 0%, #e8f4fc 50%, #dceef8 100%);
    color: #1e293b;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px 32px;
}

/* ===== Header ===== */
.header {
    padding: 12px 0;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 40px;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.header-time {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

/* Session Timer */
.session-timer {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    transition: all 0.3s ease;
}

.session-timer svg {
    width: 12px;
    height: 12px;
}

.session-timer.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning-light);
    animation: pulse 1s ease-in-out infinite;
}

.session-timer.danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Logout Button */
.logout-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn svg {
    width: 14px;
    height: 14px;
    color: var(--danger-light);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-50%) scale(1.02);
}

/* Version Badge */
.version-badge {
    position: absolute;
    right: 95px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--input-bg);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.version-badge:hover {
    color: var(--primary);
    background: var(--border-color);
}

.version-badge::after {
    content: 'Built By Niranjan';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 6px 10px;
    background: #1e1e3f;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

.version-badge:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

.theme-toggle .sun-icon {
    color: #f59e0b;
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .moon-icon {
    color: #6366f1;
    opacity: 0;
    transform: rotate(-90deg);
}

/* Dark mode toggle styles */
body.dark-mode .theme-toggle {
    background: linear-gradient(135deg, #1e1e3f 0%, #2d2d5a 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .theme-toggle:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

body.dark-mode .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
    color: #a5b4fc;
}

/* ===== Stats Section ===== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Colorful stat cards */
.stat-card:nth-child(1) {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.stat-card:nth-child(5) {
    background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 100%);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.total {
    background: #3b82f6;
    color: white;
}

.stat-icon.purchased {
    background: #10b981;
    color: white;
}

.stat-icon.pending {
    background: #f59e0b;
    color: white;
}

.stat-icon.revenue {
    background: #10b981;
    color: white;
}

.stat-icon.conversion {
    background: #8b5cf6;
    color: white;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

.conversion-card {
    flex-direction: row;
    align-items: center;
}

.conversion-bar {
    display: none;
}

/* ===== Input Section ===== */
.input-section {
    margin-bottom: 20px;
}

.input-card {
    padding: 0;
}

/* Side by side layout */
.input-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.section-title {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.input-col {
    flex: 1;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.phone-input-col {
    flex: 1;
}

.filter-col {
    flex: 1;
}

.phone-input-col .input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.results-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.input-card .card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
}

.input-card .card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.input-card .card-header p {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.card-header p {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 2px;
}

.input-area textarea {
    width: 100%;
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
    color: #1e293b;
    font-family: var(--font-family);
    font-size: 0.875rem;
    resize: none;
    overflow-y: auto;
    transition: all 0.2s ease;
}

.input-area textarea::placeholder {
    color: #94a3b8;
}

.input-area textarea:focus {
    outline: none;
}

.input-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 16px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn svg {
    width: 12px;
    height: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled:hover {
    background: #94a3b8;
    transform: none;
    box-shadow: none;
}

/* Button Tooltip Wrapper */
.btn-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.btn-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    pointer-events: none;
}

.btn-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #dc2626;
}

.btn-tooltip-wrapper:hover .btn-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Dark mode tooltip */
body.dark-mode .btn-tooltip {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

body.dark-mode .btn-tooltip::after {
    border-top-color: #ef4444;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
}

/* ===== Results Section ===== */
.results-section {
    margin-bottom: 32px;
}

.table-container {
    overflow-x: auto;
    margin: 0 -24px -24px;
    padding: 0 24px 24px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.results-table th,
.results-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4f46e5;
    background: #eef2ff;
}

.results-table th:first-child {
    border-radius: 8px 0 0 0;
}

.results-table th:last-child {
    border-radius: 0 8px 0 0;
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.results-table tbody tr:hover:not(.empty-row) {
    background: #f1f5f9;
}

.results-table td {
    font-size: 0.875rem;
    color: #1e293b;
}

/* Amount column - green color */
.results-table td:last-child {
    color: #10b981;
    font-weight: 600;
}

body.dark-mode .results-table td:last-child {
    color: #34d399;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.purchased {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.not-purchased {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.outside-range {
    background: #fef3c7;
    color: #d97706;
}

.status-badge svg {
    width: 12px;
    height: 12px;
}

/* Empty State */
.empty-row td {
    padding: 48px 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.empty-state-logo {
    width: 48px;
    height: 48px;
    opacity: 0.4;
    object-fit: contain;
    filter: grayscale(100%);
}

.empty-state p {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 400;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e2e8f0;
    border-top-color: #1e293b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    color: #64748b;
    font-weight: 500;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-container {
        padding: 0 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .input-card,
    .results-card {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

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

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.5s;
}

.input-card {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.results-card {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

/* Row animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.results-table tbody tr:not(.empty-row) {
    animation: slideIn 0.3s ease forwards;
}

/* ===== Mode Tabs ===== */
.mode-section {
    margin-bottom: 24px;
}

.mode-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: fit-content;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    transition: var(--transition);
}

.mode-tab svg {
    width: 18px;
    height: 18px;
}

.mode-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mode-tab .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mode-tab:not(.active) .badge {
    background: rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
}

/* ===== Sheet Info ===== */
.sheet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.sheet-name {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: var(--success-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.last-sync {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Sheet Stats ===== */
.sheet-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.sheet-stat {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.sheet-stat:hover {
    border-color: var(--border-glow);
}

.sheet-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.sheet-stat:nth-child(2) .sheet-stat-value {
    color: var(--warning-light);
}

.sheet-stat:nth-child(3) .sheet-stat-value {
    color: var(--success-light);
}

.sheet-stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ===== Help Text ===== */
.help-text {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Hidden ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive for new elements ===== */
@media (max-width: 768px) {
    .mode-tabs {
        width: 100%;
    }

    .mode-tab {
        flex: 1;
        justify-content: center;
        padding: 12px;
    }

    .mode-tab span:not(.badge) {
        display: none;
    }

    .sheet-stats {
        grid-template-columns: 1fr;
    }

    .sheet-info {
        align-items: flex-start;
    }
}

/* ===== Batch Selector ===== */
.batch-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.batch-selector label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.batch-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding: 4px;
}

.batch-selector select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* ===== Date Filter Section ===== */
.date-filter-section {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    height: 100%;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
}

.number-count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

.number-count.warning {
    color: #d97706;
    background: #fef3c7;
}

.number-count.error {
    color: #dc2626;
    background: #fee2e2;
}

.filter-header svg {
    width: 14px;
    height: 14px;
    color: #64748b;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* Date Range Inputs */
.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-input-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-input {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.8rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
    min-width: 110px;
}

.date-input:focus {
    outline: none;
    border-color: #94a3b8;
    background: #fff;
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: opacity(0.6);
}

.date-input::-webkit-calendar-picker-indicator:hover {
    filter: opacity(1);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-filter-btn {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-filter-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.quick-filter-btn.active {
    background: #1e293b;
    color: white;
    border-color: transparent;
}

/* Small Ghost Button */
.btn-small {
    padding: 6px 10px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* Outside Range Counter */
.outside-range-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #92400e;
    animation: fadeIn 0.3s ease;
}

.outside-range-counter svg {
    width: 16px;
    height: 16px;
    color: #f59e0b;
}

.outside-range-counter strong {
    font-weight: 700;
    color: #b45309;
}

.outside-range-counter.hidden {
    display: none;
}

/* Dark mode outside range counter */
body.dark-mode .outside-range-counter {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(251, 191, 36, 0.15) 100%);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fde68a;
}

body.dark-mode .outside-range-counter svg {
    color: #fbbf24;
}

body.dark-mode .outside-range-counter strong {
    color: #fcd34d;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Input Stats Section ===== */
.input-stats-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.input-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.input-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.input-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

.input-stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Color Variations */
.input-stat-item.duplicate {
    background: rgba(245, 158, 11, 0.08);
}

.input-stat-item.duplicate.has-value {
    background: rgba(245, 158, 11, 0.15);
}

.input-stat-item.duplicate.has-value .input-stat-value {
    color: #d97706;
}

.input-stat-item.invalid {
    background: rgba(239, 68, 68, 0.08);
}

.input-stat-item.invalid.has-value {
    background: rgba(239, 68, 68, 0.15);
}

.input-stat-item.invalid.has-value .input-stat-value {
    color: #dc2626;
}

.input-stat-item.valid {
    background: rgba(16, 185, 129, 0.08);
}

.input-stat-item.valid.has-value {
    background: rgba(16, 185, 129, 0.15);
}

.input-stat-item.valid.has-value .input-stat-value {
    color: #059669;
}

/* Dark Mode Input Stats */
body.dark-mode .input-stats-section {
    border-top-color: rgba(99, 102, 241, 0.2);
}

body.dark-mode .input-stat-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .input-stat-value {
    color: #a1a1aa;
}

body.dark-mode .input-stat-label {
    color: #71717a;
}

body.dark-mode .input-stat-item.duplicate {
    background: rgba(245, 158, 11, 0.1);
}

body.dark-mode .input-stat-item.duplicate.has-value {
    background: rgba(245, 158, 11, 0.2);
}

body.dark-mode .input-stat-item.duplicate.has-value .input-stat-value {
    color: #fbbf24;
}

body.dark-mode .input-stat-item.invalid {
    background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .input-stat-item.invalid.has-value {
    background: rgba(239, 68, 68, 0.2);
}

body.dark-mode .input-stat-item.invalid.has-value .input-stat-value {
    color: #f87171;
}

body.dark-mode .input-stat-item.valid {
    background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .input-stat-item.valid.has-value {
    background: rgba(16, 185, 129, 0.2);
}

body.dark-mode .input-stat-item.valid.has-value .input-stat-value {
    color: #34d399;
}

/* Dark Mode Date Filter */
body.dark-mode .date-filter-section {
    background: transparent;
    border-color: transparent;
}

body.dark-mode .date-input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.3);
    color: white;
}

body.dark-mode .date-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

body.dark-mode .date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.6);
}

body.dark-mode .date-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

body.dark-mode .quick-filter-btn {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-secondary);
}

body.dark-mode .quick-filter-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary-light);
}

body.dark-mode .btn-ghost {
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .toggle-slider {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Date Filter Responsive */
@media (max-width: 768px) {
    .date-range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input-group {
        width: 100%;
    }

    .date-input {
        width: 100%;
        min-width: unset;
    }

    .quick-filters {
        justify-content: center;
    }
}

/* ===== Sortable Column Header ===== */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.sortable:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.sort-icons {
    display: inline-flex;
    flex-direction: column;
    margin-left: 6px;
    vertical-align: middle;
    gap: 0;
}

.sort-icon {
    width: 12px;
    height: 12px;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    margin: -2px 0;
}

.sortable:hover .sort-icon {
    opacity: 0.5;
}

/* Active sort states */
.sortable.sort-desc .sort-desc,
.sortable.sort-asc .sort-asc {
    opacity: 1;
    color: var(--primary-light);
}

.sortable.sort-desc .sort-asc,
.sortable.sort-asc .sort-desc {
    opacity: 0.2;
}

/* ===== Clickable Stat Item ===== */
.input-stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-stat-item.clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.input-stat-item.clickable.has-value:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

body.dark-mode .input-stat-item.clickable.has-value:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.2) 100%);
}

/* ===== Invalid Numbers Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.modal-header h3 svg {
    width: 20px;
    height: 20px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    color: white;
}

.modal-body {
    padding: 20px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.modal-description {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
}

.invalid-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.invalid-item {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #dc2626;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.no-invalid-message {
    color: #10b981;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* Dark mode modal */
body.dark-mode .modal-content {
    background: #1e1e3f;
}

body.dark-mode .modal-description {
    color: #a1a1aa;
}

body.dark-mode .invalid-item {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Mobile Block Screen - Full screen block for mobile devices */
.mobile-block {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #1e1e3f 0%, #0f0f23 100%);
    color: white;
    justify-content: center;
    align-items: center;
}

.mobile-block-content {
    text-align: center;
    padding: 40px 30px;
    max-width: 320px;
}

.mobile-block-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-block-icon svg {
    width: 50px;
    height: 50px;
    stroke: #ef4444;
}

.mobile-block h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: white;
}

.mobile-block p {
    font-size: 1rem;
    color: #a1a1aa;
    margin: 0 0 40px;
    line-height: 1.6;
}

.mobile-block-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: #818cf8;
    font-size: 0.875rem;
    font-weight: 500;
}

.mobile-block-hint svg {
    width: 24px;
    height: 24px;
}

/* Show only on mobile devices (less than 768px) */
@media (max-width: 767px) {
    .mobile-block {
        display: flex;
    }
}