/* ===========================================
   LeadFlow AI - Design System
   Monochrome Futuristic UI
   =========================================== */

/* Import Modern Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables */
:root {
    /* Colors - Monochrome Palette */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --bg-dark: #1a1a2e;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f4;

    /* Text Colors */
    --text-primary: #0f0f0f;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-inverse: #ffffff;

    /* Accent Colors */
    --accent-primary: #2d2d2d;
    --accent-secondary: #4a4a4a;
    --accent-light: #6c757d;

    /* Status Colors */
    --success: #198754;
    --success-light: #d1e7dd;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --info: #0dcaf0;
    --info-light: #cff4fc;

    /* Borders */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --border-dark: #adb5bd;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   Typography
   =========================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    margin-bottom: var(--space-md);
}

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

a:hover {
    color: var(--accent-secondary);
}

/* ===========================================
   Layout
   =========================================== */

.app-container {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.content-wrapper {
    padding: var(--space-xl);
    max-width: 1400px;
}

/* Grid Utilities */
.grid {
    display: grid;
    gap: var(--space-md);
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

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

.justify-between {
    justify-content: space-between;
}

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

.justify-end {
    justify-content: flex-end;
}

/* Spacing Utilities */
.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

/* Text Utilities */
.text-sm {
    font-size: 0.8125rem;
}

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

/* ===========================================
   Sidebar Navigation
   =========================================== */

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    color: var(--text-inverse);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    padding: var(--space-md) 0;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-inverse);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    border-left-color: #667eea;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.nav-badge {
    margin-left: auto;
    background: #667eea;
    color: white;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* ===========================================
   Header
   =========================================== */

.page-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: var(--space-xs) 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ===========================================
   Cards
   =========================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat Cards */
.stat-card {
    padding: var(--space-lg);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

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

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-sm);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ===========================================
   Buttons
   =========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

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

/* Button Variants */
.btn-primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-xs) var(--space-sm);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
}

/* ===========================================
   Forms
   =========================================== */

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.1);
}

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

.form-input.error {
    border-color: var(--danger);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: var(--space-xs);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

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

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ===========================================
   Tables
   =========================================== */

.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.table td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===========================================
   Badges & Tags
   =========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: #055160;
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ===========================================
   Terminal / Console
   =========================================== */

.terminal {
    background: #1e1e2e;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: #11111b;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #f38ba8;
}

.terminal-dot.yellow {
    background: #f9e2af;
}

.terminal-dot.green {
    background: #a6e3a1;
}

.terminal-body {
    padding: var(--space-md);
    max-height: 300px;
    overflow-y: auto;
    color: #cdd6f4;
}

.terminal-line {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.terminal-prompt {
    color: #a6e3a1;
}

.terminal-line.info {
    color: #89b4fa;
}

.terminal-line.success {
    color: #a6e3a1;
}

.terminal-line.error {
    color: #f38ba8;
}

.terminal-line.warning {
    color: #f9e2af;
}

/* ===========================================
   Progress
   =========================================== */

.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-bar.success {
    background: var(--success);
}

.progress-bar.warning {
    background: var(--warning);
}

.progress-bar.danger {
    background: var(--danger);
}

/* ===========================================
   Modal
   =========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

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

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: var(--space-xs);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ===========================================
   Alerts / Toasts
   =========================================== */

.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: #055160;
    border: 1px solid var(--info);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* ===========================================
   Grid System
   =========================================== */

.grid {
    display: grid;
    gap: var(--space-lg);
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

/* Spacing utilities */
.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

/* ===========================================
   Login Page
   =========================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: var(--space-lg);
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-header {
    padding: var(--space-2xl) var(--space-xl) var(--space-lg);
    text-align: center;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-body {
    padding: 0 var(--space-xl) var(--space-xl);
}

.auth-footer {
    padding: var(--space-md) var(--space-xl);
    text-align: center;
    background: var(--bg-tertiary);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 500;
}

/* ===========================================
   Responsive
   =========================================== */

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

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

    .main-content {
        margin-left: 0;
    }
}

/* ===========================================
   Animations
   =========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===========================================
   Dropdown
   =========================================== */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-xs) 0;
}

/* ===========================================
   Empty State
   =========================================== */

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ===========================================
   Score Indicator
   =========================================== */

.score-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
}

.score-indicator.high {
    background: var(--success-light);
    color: var(--success);
}

.score-indicator.medium {
    background: var(--warning-light);
    color: #856404;
}

.score-indicator.low {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===========================================
   Country Flags (using emoji fallback)
   =========================================== */

.country-flag {
    font-size: 1.25rem;
    margin-right: var(--space-xs);
}

/* ===========================================
   Pagination
   =========================================== */

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.pagination-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-color: var(--accent-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   Enhanced Toast Notifications
   =========================================== */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    animation: toastSlideIn 0.3s ease;
}

.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

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

.toast-success .toast-icon {
    color: var(--success);
}

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

.toast-danger .toast-icon {
    color: var(--danger);
}

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

.toast-warning .toast-icon {
    color: #856404;
}

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

.toast-info .toast-icon {
    color: var(--info);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===========================================
   Confirmation Modal
   =========================================== */

.confirm-modal {
    max-width: 400px;
}

.confirm-modal .modal-body {
    text-align: center;
    padding: var(--space-xl);
}

.confirm-modal .modal-body p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===========================================
   Mobile Sidebar & Header
   =========================================== */

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Sidebar Footer / User Button Fix */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-dark);
}

.sidebar-footer .nav-item {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-footer .nav-item:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer .dropdown-menu {
    background: var(--bg-secondary);
}

.sidebar-footer .dropdown-item {
    color: var(--text-secondary);
}

.sidebar-footer .dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===========================================
   Chart Containers
   =========================================== */

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.chart-container.small {
    height: 200px;
}

.chart-container.large {
    height: 400px;
}

/* ===========================================
   File Upload Dropzone
   =========================================== */

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(45, 45, 45, 0.05);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
}

.dropzone-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

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

.file-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.file-preview-item .remove-file {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-muted);
}

.file-preview-item .remove-file:hover {
    color: var(--danger);
}

/* ===========================================
   Enhanced Stat Cards
   =========================================== */

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.02) 50%);
    border-radius: 0 var(--radius-lg) 0 0;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

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

.stat-card .stat-icon.primary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.stat-card .stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-light);
    color: #856404;
}

.stat-card .stat-icon.info {
    background: var(--info-light);
    color: #055160;
}

.stat-card .stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===========================================
   Filter Panel
   =========================================== */

.filter-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-toggle svg {
    transition: transform var(--transition-fast);
}

.filter-panel.open .filter-toggle svg {
    transform: rotate(180deg);
}

.filter-body {
    padding: 0 var(--space-md) var(--space-md);
    display: none;
}

.filter-panel.open .filter-body {
    display: block;
}

/* ===========================================
   Bulk Actions Toolbar
   =========================================== */

.bulk-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    animation: slideDown 0.2s ease;
}

.bulk-actions .selected-count {
    font-size: 0.875rem;
    font-weight: 500;
}

.bulk-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    color: var(--text-inverse);
}

.bulk-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

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

/* ===========================================
   Lead Detail Card
   =========================================== */

.lead-detail-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

.lead-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

.lead-info h2 {
    margin-bottom: var(--space-xs);
}

.lead-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ===========================================
   Score Bar
   =========================================== */

.score-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.score-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.score-bar-fill.high {
    background: var(--success);
}

.score-bar-fill.medium {
    background: var(--warning);
}

.score-bar-fill.low {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
}

.score-bar-value {
    min-width: 36px;
    font-weight: 700;
    font-size: 0.875rem;
    text-align: right;
}

/* ===========================================
   Animation Classes
   =========================================== */

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

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

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Live indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--success);
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ===========================================
   Responsive Design - Enhanced
   =========================================== */

/* Large Tablets & Small Desktops */
@media (max-width: 1280px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-wrapper {
        padding: var(--space-lg);
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 101;
    }

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

    .sidebar-overlay {
        display: block;
    }

    .sidebar-overlay.active {
        z-index: 100;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .page-header {
        padding: var(--space-md);
    }

    .page-title {
        font-size: 1.125rem;
    }

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

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .header-actions {
        gap: var(--space-sm);
    }

    .header-actions .btn span {
        display: none;
    }
}

/* Small Tablets */
@media (max-width: 768px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.5rem;
    }

    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: var(--space-md);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .table th,
    .table td {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8125rem;
    }

    .table-container {
        margin: 0 calc(-1 * var(--space-md));
        padding: 0 var(--space-md);
    }

    .stat-card {
        padding: var(--space-md);
    }

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

    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .auth-card {
        margin: var(--space-md);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        max-width: none;
    }

    /* Responsive Tables */
    .table-responsive-stack thead {
        display: none;
    }

    .table-responsive-stack tbody tr {
        display: block;
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-light);
    }

    .table-responsive-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-xs) 0;
        border: none;
    }

    .table-responsive-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-muted);
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: var(--space-sm) var(--space-md);
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .bulk-actions {
        flex-wrap: wrap;
    }

    .chart-container {
        height: 250px;
    }

    .lead-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .lead-meta {
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 320px) {
    :root {
        --space-md: 0.75rem;
        --space-lg: 1rem;
    }

    .sidebar {
        width: 100%;
    }

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

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-item {
        padding: var(--space-md) var(--space-lg);
    }

    .form-check-input {
        width: 22px;
        height: 22px;
    }

    .dropdown-item {
        padding: var(--space-md);
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .page-header,
    .header-actions,
    .btn,
    .toast-container {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===========================================
   Dark Mode Support (Future)
   =========================================== */

@media (prefers-color-scheme: dark) {
    /* Future dark mode styles */
}

/* ===========================================
   High Contrast Mode
   =========================================== */

@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-muted: #595959;
    }

    .btn {
        border-width: 2px;
    }
}

/* ===========================================
   Reduced Motion
   =========================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}