/* ==========================================================================
   CRM LEADFLOW PREMIUM DESIGN SYSTEM (Modern Glassmorphism & Adaptive Themes)
   ========================================================================== */

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

:root {
    /* Font System */
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Animation Transitions */
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Shadow Palette */
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 30px -4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 60px -8px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    /* Common Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* Status Color Palette (Linear inspired) */
    --status-new-color: #6366f1;
    --status-new-bg: rgba(99, 102, 241, 0.08);
    --status-new-border: rgba(99, 102, 241, 0.2);

    --status-contacting-color: #f59e0b;
    --status-contacting-bg: rgba(245, 158, 11, 0.08);
    --status-contacting-border: rgba(245, 158, 11, 0.2);

    --status-potential-color: #10b981;
    --status-potential-bg: rgba(16, 185, 129, 0.08);
    --status-potential-border: rgba(16, 185, 129, 0.2);

    --status-none-color: #ef4444;
    --status-none-bg: rgba(239, 68, 68, 0.08);
    --status-none-border: rgba(239, 68, 68, 0.2);
}

/* --- DARK MODE CONFIGURATION --- */
[data-theme="dark"] {
    --bg-app: #080b11;
    --bg-sidebar: #0e131f;
    --bg-surface: rgba(20, 27, 45, 0.6);
    --bg-surface-hover: rgba(28, 37, 60, 0.7);
    --bg-input: #131a2b;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #818cf8;
    --primary-hover: #93c5fd;
    --primary-glow: rgba(129, 140, 248, 0.2);
    --bg-tertiary: #131a2c;
    --bg-secondary: #0f1424;
    
    --glass-blur: blur(16px);
    --glass-shimmer: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
    
    --card-glow-blue: rgba(59, 130, 246, 0.08);
    --card-glow-purple: rgba(139, 92, 246, 0.08);
    --card-glow-orange: rgba(245, 158, 11, 0.08);
    --card-glow-green: rgba(16, 185, 129, 0.08);
}

/* --- LIGHT MODE CONFIGURATION --- */
[data-theme="light"] {
    --bg-app: #f6f8fb;
    --bg-sidebar: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --bg-input: #f8fafc;
    --border-color: rgba(15, 23, 42, 0.06);
    --border-color-hover: rgba(15, 23, 42, 0.12);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.1);
    --bg-tertiary: #f1f5f9;
    --bg-secondary: #f8fafc;
    
    --glass-blur: blur(12px);
    --glass-shimmer: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
    
    --card-glow-blue: rgba(59, 130, 246, 0.04);
    --card-glow-purple: rgba(139, 92, 246, 0.04);
    --card-glow-orange: rgba(245, 158, 11, 0.04);
    --card-glow-green: rgba(16, 185, 129, 0.04);
}

/* ==========================================================================
   RESET & LAYOUT BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Custom modern scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    flex-shrink: 0;
    transition: background-color var(--transition-normal), border var(--transition-normal);
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-icon {
    color: var(--primary-color);
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.badge-enterprise {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary-glow);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.theme-toggle-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 46px;
    height: 24px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 5px;
}

.theme-toggle-btn i {
    width: 12px;
    height: 12px;
    transition: opacity var(--transition-fast);
}

[data-theme="dark"] .sun-icon { opacity: 0.25; }
[data-theme="dark"] .moon-icon { opacity: 1; color: var(--primary-color); }
[data-theme="light"] .sun-icon { opacity: 1; color: #f59e0b; }
[data-theme="light"] .moon-icon { opacity: 0.25; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-input);
    padding: 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c7d2fe 100%);
    color: #ffffff;
    font-weight: 700;
    font-family: var(--font-heading);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.main-header {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    transition: background-color var(--transition-normal), border var(--transition-normal);
}

#pageTitle {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.15rem;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.scheduler-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-input);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.scheduler-info:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

.scheduler-info i {
    width: 14px;
    height: 14px;
    color: var(--primary-color);
}

.scheduler-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    display: block;
}

.scheduler-value {
    color: var(--text-primary);
    font-weight: 600;
}

.sync-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--status-potential-color);
    box-shadow: 0 0 8px var(--status-potential-color);
    display: inline-block;
}

.pulse-dot.syncing {
    background-color: var(--status-contacting-color);
    box-shadow: 0 0 8px var(--status-contacting-color);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.5; }
}

.content-body {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ==========================================================================
   BUTTONS AND CONTROLS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0.55rem 1.1rem;
    font-size: 0.8rem;
    letter-spacing: -0.1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

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

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

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

.btn-danger-outline {
    background-color: transparent;
    border-color: var(--status-none-border);
    color: var(--status-none-color);
}

.btn-danger-outline:hover {
    background-color: var(--status-none-bg);
    border-color: var(--status-none-color);
}

.btn-icon-only {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-sync i.spinning {
    animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   TAB MANAGEMENT
   ========================================================================== */

.tab-pane {
    display: none;
    animation: tabFadeIn var(--transition-normal) forwards;
}

.tab-pane.active {
    display: block;
}

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

/* ==========================================================================
   TAB: DASHBOARD
   ========================================================================== */

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    top: -25px;
    right: -25px;
    border-radius: 50%;
    z-index: 0;
    filter: blur(24px);
    opacity: 0.4;
    transition: opacity var(--transition-normal);
}

.stat-card:hover::after {
    opacity: 0.75;
}

.stat-card:nth-child(1)::after { background: var(--card-glow-blue); }
.stat-card:nth-child(2)::after { background: var(--card-glow-purple); }
.stat-card:nth-child(3)::after { background: var(--card-glow-orange); }
.stat-card:nth-child(4)::after { background: var(--card-glow-green); }

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    z-index: 1;
    position: relative;
}

.stat-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper i {
    width: 16px;
    height: 16px;
}

.stat-icon-wrapper.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-icon-wrapper.orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.15rem;
    color: var(--text-primary);
    z-index: 1;
    position: relative;
}

.stat-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    z-index: 1;
    position: relative;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.chart-card-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.chart-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--status-potential-color);
    background: var(--status-potential-bg);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

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

.chart-container-donut {
    position: relative;
    height: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detail Lists Dashboard */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

.details-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.card-header-flex h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.timeline-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.25rem;
}

.timeline-item {
    display: flex;
    gap: 0.85rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    width: 1.5px;
    background: var(--border-color);
    top: 22px;
    bottom: -10px;
    left: 10px;
}

.timeline-badge {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
    z-index: 1;
}

.timeline-badge.system { background: var(--border-color); color: var(--text-secondary); }
.timeline-badge.note { background: var(--status-new-bg); color: var(--status-new-color); }
.timeline-badge.call { background: var(--status-contacting-bg); color: var(--status-contacting-color); }
.timeline-badge.email { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.timeline-badge.status_change { background: var(--status-potential-bg); color: var(--status-potential-color); }

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-grow: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.timeline-lead-link {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.timeline-lead-link:hover {
    color: var(--primary-color);
}

.timeline-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.timeline-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timeline-creator {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Source List details */
.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex-grow: 1;
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: border var(--transition-fast);
}

.source-item:hover {
    border-color: var(--border-color-hover);
}

.source-name-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.source-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-avatar i {
    width: 14px;
    height: 14px;
}

.source-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.source-count-badge {
    background: var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   TAB: KANBAN BOARD
   ========================================================================== */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    height: calc(100vh - 165px);
    min-height: 500px;
    align-items: stretch;
}

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

@media (max-width: 600px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.kanban-column-header h2 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
}

.status-indicator.new { background-color: var(--status-new-color); }
.status-indicator.contacting { background-color: var(--status-contacting-color); }
.status-indicator.potential { background-color: var(--status-potential-color); }
.status-indicator.none { background-color: var(--status-none-color); }

.kanban-count {
    background: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
}



.kanban-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    cursor: grab;
    transition: transform var(--transition-fast), border var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.kanban-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary-color);
    transform: scale(0.96);
    box-shadow: none;
}

.kanban-cards-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 0.1rem;
    min-height: 100px;
    transition: background-color var(--transition-normal), border var(--transition-normal);
    border: 2px solid transparent;
}

.kanban-cards-wrapper.drag-over {
    background-color: rgba(99, 102, 241, 0.06);
    border-color: var(--primary-color);
    border-radius: var(--radius-md);
}

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

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.kanban-card-contact {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kanban-card-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.kanban-card-info i {
    width: 11px;
    height: 11px;
    color: var(--text-muted);
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-color);
}

.kanban-source-badge {
    font-size: 0.6rem;
    color: var(--text-muted);
    background: var(--bg-surface-hover);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-status-actions {
    display: flex;
    gap: 0.2rem;
}

.kanban-status-btn {
    border: none;
    background: var(--bg-surface);
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.kanban-status-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ==========================================================================
   TAB: LEADS & TABLE FILTERS
   ========================================================================== */

.filters-bar {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box-wrapper input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.search-box-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filters-select-wrapper {
    display: flex;
    gap: 0.85rem;
}

.select-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.select-group select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    outline: none;
    cursor: pointer;
    min-width: 130px;
    font-size: 0.75rem;
    transition: border var(--transition-fast);
}

.select-group select:focus {
    border-color: var(--primary-color);
}

/* Leads Table Layout */
.table-container {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leads-table th {
    background-color: var(--bg-tertiary);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.leads-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    vertical-align: middle;
}

.leads-table tbody tr {
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

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

.lead-name-cell {
    font-weight: 700;
    color: var(--text-primary);
}

.lead-contact-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lead-contact-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.lead-contact-line i {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.lead-address-cell {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.lead-address-cell a {
    color: var(--primary-color);
    text-decoration: none;
}

.lead-address-cell a:hover {
    text-decoration: underline;
}

.lead-source-cell {
    font-family: monospace;
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom Status Badges (Inspired by Linear/SaaS) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
}

.status-badge.status-new { 
    color: var(--status-new-color); 
    background: var(--status-new-bg); 
    border-color: var(--status-new-border);
}
.status-badge.status-contacting { 
    color: var(--status-contacting-color); 
    background: var(--status-contacting-bg); 
    border-color: var(--status-contacting-border);
}
.status-badge.status-potential { 
    color: var(--status-potential-color); 
    background: var(--status-potential-bg); 
    border-color: var(--status-potential-border);
}
.status-badge.status-none { 
    color: var(--status-none-color); 
    background: var(--status-none-bg); 
    border-color: var(--status-none-border);
}

.status-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background-color: currentColor;
}

/* Pagination container */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.page-number-active {
    font-weight: 800;
    color: var(--text-primary);
}

.page-number-divider {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.page-number-total {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ==========================================================================
   SLIDE-OUT DRAWER
   ========================================================================== */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100%;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
    z-index: 101;
}

@media (max-width: 480px) {
    .drawer-content {
        width: 100%;
        right: -100%;
    }
}

.drawer-overlay.open .drawer-content {
    right: 0;
}

.drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-pre-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.15rem;
    letter-spacing: 0.08em;
}

#drawerLeadName {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-close-drawer:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.drawer-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

/* Tabs inside Drawer */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.drawer-tab {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.drawer-tab:hover {
    color: var(--text-primary);
}

.drawer-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.drawer-tab-pane {
    display: none;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.drawer-tab-pane.active {
    display: block;
}

/* Form layouts */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.span-2 {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Care note form card */
.activity-form-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 1.25rem;
}

.activity-form-card h4 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.activity-inputs {
    display: flex;
    gap: 0.5rem;
}

.small-select, .small-input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    outline: none;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.small-select {
    cursor: pointer;
    min-width: 90px;
}

.small-input {
    flex-grow: 1;
}

.mt-2 { margin-top: 0.5rem; }

.history-timeline h4 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-card {
    display: flex;
    gap: 0.75rem;
    position: relative;
}

.timeline-card:not(:last-child)::before {
    content: '';
    position: absolute;
    width: 1.5px;
    background: var(--border-color);
    top: 22px;
    bottom: -15px;
    left: 10px;
}

.timeline-card-content {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    flex-grow: 1;
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-card-body {
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.json-viewer {
    background-color: #050811;
    color: #38bdf8;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================================================
   POPUP MODAL
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

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

.modal-content {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(15px);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
}

.btn-close-modal {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-close-modal:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.pad-form {
    padding: 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.required {
    color: var(--status-none-color);
}

/* ==========================================================================
   TAB: APIFY CONTROLS
   ========================================================================== */

.apify-settings-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.settings-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.apify-settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.input-action-wrapper {
    display: flex;
    gap: 0.5rem;
}

.input-action-wrapper input {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.input-action-wrapper input:focus {
    border-color: var(--primary-color);
}

.scrapers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.scraper-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.scraper-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.scraper-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scraper-icon i {
    width: 18px;
    height: 18px;
}

.scraper-icon.green { background: var(--status-potential-bg); color: var(--status-potential-color); }
.scraper-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.scraper-card-header h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.scraper-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.scraper-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.scraper-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.scraper-actions {
    display: flex;
    gap: 0.5rem;
}

.advanced-json-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
}

.advanced-json-toggle:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.advanced-json-panel {
    display: none;
    margin-top: 0.4rem;
}

.advanced-json-panel.open {
    display: block;
}

.advanced-json-textarea {
    width: 100%;
    background-color: #050811;
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.75rem;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    resize: vertical;
}

.runs-history-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   SCHEDULER CARD
   ========================================================================== */

.scheduler-status-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.scheduler-status-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.scheduler-status-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.scheduler-status-left h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.scheduler-status-left p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.scheduler-status-left p strong {
    color: var(--primary-color);
    font-weight: 700;
}

.scheduler-pulse-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, var(--status-potential-color), #059669);
    border-radius: var(--radius-md);
    color: #fff;
}

.scheduler-pulse-icon i {
    width: 20px;
    height: 20px;
}

.scheduler-pulse-icon .pulse-ring {
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--status-potential-color);
    animation: schedulerPulse 2s ease-out infinite;
}

.scheduler-status-right {
    display: flex;
    align-items: center;
}

.scheduler-next-run {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    min-width: 160px;
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.scheduler-next-run:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.scheduler-next-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.scheduler-next-time {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
}

.scheduler-next-countdown {
    font-size: 0.7rem;
    color: var(--status-potential-color);
    font-weight: 600;
    margin-top: 0.15rem;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform var(--transition-normal);
    max-width: 360px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification .toast-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.toast-notification .toast-icon i {
    width: 14px;
    height: 14px;
}

.toast-notification .toast-icon.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-notification .toast-icon.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-notification .toast-icon.info { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.toast-notification .toast-body {
    flex: 1;
}

.toast-notification .toast-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.toast-notification .toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.poller-pulse {
    display: inline-block;
    animation: pollerPulse 1.5s ease-in-out infinite;
    margin-right: 4px;
    font-size: 0.7rem;
}

@keyframes pollerPulse {
    0%, 100% { opacity: 1; color: var(--primary-color); }
    50% { opacity: 0.3; color: var(--text-muted); }
}

/* ==========================================================================
   DATA TABLE CARD (Old Scraping View - Styled to match design system)
   ========================================================================== */

.data-table-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.data-table-card h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.data-table-actions {
    display: flex;
    gap: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.data-table thead {
    background-color: var(--bg-tertiary);
}

.data-table th {
    padding: 0.85rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th:nth-child(1) { width: 22%; }
.data-table th:nth-child(2) { width: 16%; }
.data-table th:nth-child(3) { width: 16%; }
.data-table th:nth-child(4) { width: 8%; }
.data-table th:nth-child(5) { width: 38%; }

.data-table td {
    padding: 0.85rem 0.75rem;
    color: var(--text-secondary);
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
    word-break: break-all;
}

.data-title-cell {
    font-weight: 700;
    color: var(--text-primary);
}

.data-desc-cell {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.phone-badge, .email-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
}

.phone-badge {
    background: var(--status-new-bg);
    color: var(--status-new-color);
    border-color: var(--status-new-border);
}

.email-badge {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.url-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.url-link:hover {
    color: var(--primary-hover);
}

/* ========================================
   DATASET RESULT MODAL (Popup Viewer)
   ======================================== */

.dataset-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: modalFadeIn 0.25s ease-out;
}

.dataset-modal-content {
    background: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 95%;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease-out;
}

.dataset-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-radius: 18px 18px 0 0;
    flex-shrink: 0;
}

.dataset-modal-body {
    overflow: auto;
    flex: 1;
    padding: 0;
}

.dataset-result-table {
    border-radius: 0 !important;
    border: none !important;
}

.dataset-result-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-tertiary);
}

.dataset-result-table thead th {
    padding: 0.85rem 1.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.dataset-result-table tbody td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

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