/* ============================================================
   LeadFlow CRM — Complete Dark Theme Stylesheet
   Premium Dental CRM Dashboard
   ============================================================ */

/* ----- 0. Design System Variables ----- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2847;
    --bg-surface: #141b2d;
    --border: #1e293b;
    --border-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.15);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.12);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.12);
    --rose: #f43f5e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

ul, ol {
    list-style: none;
}

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

::selection {
    background: rgba(99, 102, 241, 0.3);
}


/* =============================================================
   2. APP SHELL
   ============================================================= */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Main Nav --- */
.main-nav {
    display: flex;
    gap: 4px;
    margin-left: 24px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.nav-tab i,
.nav-tab svg {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo svg,
.logo img {
    width: 28px;
    height: 28px;
}


/* =============================================================
   3. SEARCH BAR
   ============================================================= */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 16px;
    height: 38px;
    width: 320px;
    gap: 8px;
    transition: border-color var(--transition);
}

.search-bar:focus-within {
    border-color: var(--accent);
}

.search-bar i,
.search-bar svg {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    min-width: 0;
}

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


/* =============================================================
   4. TOP BAR RIGHT ITEMS
   ============================================================= */

/* --- Tasks Badge --- */
.tasks-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.tasks-badge:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.tasks-badge .pulse-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* --- Language Toggle --- */
.lang-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: transparent;
}

.lang-option {
    min-width: 46px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--amber);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-option:hover {
    background: rgba(245, 158, 11, 0.1);
}

.lang-option.active {
    background: var(--amber);
    color: #1a1a2e;
}

/* --- Badge (online indicator) --- */
.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

/* --- Export Button --- */
.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.export-btn:hover {
    background: var(--accent);
    color: white;
}


/* =============================================================
   5. VIEW SECTIONS
   ============================================================= */
.view-section {
    display: none;
}

.view-section.active {
    display: flex;
}

#view-leads.active {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#view-kanban.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#view-dashboard.active {
    display: block;
    overflow-y: auto;
    padding: 24px;
    height: calc(100vh - 60px);
}


/* =============================================================
   6. LEADS PANEL (LEFT SIDEBAR)
   ============================================================= */
.leads-panel {
    width: 420px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.panel-header-top h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-kicker {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* =============================================================
   7. FILTER CHIPS
   ============================================================= */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.filter-chips::-webkit-scrollbar {
    height: 0;
}

.chip {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all var(--transition);
}

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

.chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-light);
}

.chip-success.active {
    background: var(--green-glow);
    border-color: var(--green);
    color: var(--green);
}

.chip-danger.active {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--rose);
    color: var(--rose);
}


/* =============================================================
   8. QUICK FILTER BAR
   ============================================================= */
.quick-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.quick-filter-bar::-webkit-scrollbar {
    display: none;
}

.quick-filter {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all var(--transition);
}

.quick-filter:hover {
    border-color: var(--border-hover);
}

.quick-filter.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-light);
}


/* =============================================================
   9. FILTERS STACK (DROPDOWNS)
   ============================================================= */
.filters-stack {
    display: flex;
    gap: 8px;
}

.filters-stack select {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    color: var(--text-primary);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    transition: border-color var(--transition);
}

.filters-stack select:focus {
    border-color: var(--accent);
    outline: none;
}

.filters-stack select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}


/* =============================================================
   10. SAVED VIEWS BAR
   ============================================================= */
.saved-views-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 0;
}

.saved-views-bar .saved-view-item {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.saved-views-bar .saved-view-item:hover {
    border-color: var(--border-hover);
    border-left-color: var(--accent-light);
    background: var(--bg-card-hover);
}

.saved-views-bar .saved-view-item.active {
    background: var(--accent-glow);
    color: var(--accent-light);
}


/* =============================================================
   11. LEADS LIST
   ============================================================= */
.leads-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.leads-list::-webkit-scrollbar {
    width: 6px;
}

.leads-list::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

.leads-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.leads-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* --- Lead Card --- */
.lead-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    position: relative;
}

.lead-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.lead-card.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* --- Lead Avatar --- */
.lead-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    color: white;
}

/* --- Lead Info --- */
.lead-info {
    flex: 1;
    min-width: 0;
}

.lead-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-subtitle-secondary {
    margin-left: 6px;
    color: var(--text-muted);
}

/* --- Lead Right Column --- */
.lead-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.lead-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lead-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.lead-badge.high {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.lead-badge.medium {
    background: var(--amber-glow);
    color: var(--amber);
}

.lead-badge.good {
    background: var(--green-glow);
    color: var(--green);
}

/* --- Lead Status Dot --- */
.lead-status-dot {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.lead-status-dot.nuevo {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.lead-status-dot.contactado {
    background: var(--cyan-glow);
    color: var(--cyan);
}

.lead-status-dot.reunion {
    background: var(--amber-glow);
    color: var(--amber);
}

.lead-status-dot.propuesta {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.lead-status-dot.negociando {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.lead-status-dot.cerrado {
    background: var(--green-glow);
    color: var(--green);
}

.lead-status-dot.perdido {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

/* --- Lead Source & Stale --- */
.lead-source-label {
    font-size: 10px;
    color: var(--text-muted);
}

.lead-stale-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 2px;
}

.stale-amber {
    background: var(--amber);
}

.stale-red {
    background: var(--rose);
}


/* =============================================================
   12. DETAIL PANEL (RIGHT SIDE)
   ============================================================= */
.detail-panel {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    height: calc(100vh - 60px);
    position: relative;
}

.detail-panel::-webkit-scrollbar {
    width: 6px;
}

.detail-panel::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.detail-panel::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.5;
    font-size: 48px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 340px;
    line-height: 1.6;
}

/* --- Detail Content --- */
.detail-content {
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

/* --- Detail Header --- */
.detail-header {
    margin-bottom: 20px;
}

.detail-header-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.detail-header-top h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.detail-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    font-size: 12px;
    align-items: center;
}


/* =============================================================
   13. DETAIL ACTION BUTTONS
   ============================================================= */

/* --- Stage Select --- */
.stage-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    transition: border-color var(--transition);
}

.stage-select:focus {
    border-color: var(--accent);
    outline: none;
}

/* --- WhatsApp Button --- */
.btn-wa {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    height: 34px;
    padding: 0 12px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--transition);
}

.btn-wa:hover {
    opacity: 0.9;
}

/* --- Google Maps Button --- */
.btn-gmaps {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 34px;
    padding: 0 12px;
    text-decoration: none;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-gmaps:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* --- Primary Button --- */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    color: white;
    border: none;
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --- Outline Button --- */
.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

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

/* --- Proposal Button --- */
.btn-proposal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn-proposal:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
}

/* --- Danger Button --- */
.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.5);
}


/* =============================================================
   14. META BADGES
   ============================================================= */
.meta-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.meta-badge.nuevo {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.meta-badge.contactado {
    background: var(--cyan-glow);
    color: var(--cyan);
}

.meta-badge.reunion {
    background: var(--amber-glow);
    color: var(--amber);
}

.meta-badge.propuesta {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.meta-badge.negociando {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.meta-badge.cerrado {
    background: var(--green-glow);
    color: var(--green);
}

.meta-badge.perdido {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}


/* =============================================================
   15. DETAIL TABS
   ============================================================= */
.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.detail-tabs::-webkit-scrollbar {
    height: 0;
}

.detail-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.detail-tab:hover {
    color: var(--text-secondary);
}

.detail-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

.tab-count {
    font-size: 10px;
    background: var(--accent-glow);
    color: var(--accent-light);
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 4px;
    font-weight: 600;
}


/* =============================================================
   16. DETAIL TAB CONTENT
   ============================================================= */
.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}


/* =============================================================
   17. INFO GRID
   ============================================================= */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.info-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.info-card:hover {
    border-color: var(--border-hover);
}

.info-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.phone-icon {
    background: var(--green-glow);
    color: var(--green);
}

.web-icon {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.area-icon {
    background: var(--cyan-glow);
    color: var(--cyan);
}

.email-icon {
    background: var(--amber-glow);
    color: var(--amber);
}

.info-card-content label,
.info-card label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
}

.info-card-content p,
.info-card p {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
    word-break: break-all;
}

.info-card-content a,
.info-card a {
    color: var(--accent-light);
    transition: color var(--transition);
}

.info-card-content a:hover,
.info-card a:hover {
    color: var(--accent);
}


/* =============================================================
   18. DETAIL SECTIONS
   ============================================================= */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.detail-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}


/* =============================================================
   19. AUDIT COMPONENTS
   ============================================================= */

/* --- Audit Grid --- */
.audit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.audit-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.audit-card:hover {
    border-color: var(--border-hover);
}

.audit-card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.audit-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.audit-card-subvalue {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.audit-score-high .audit-card-value {
    color: var(--green);
}

.audit-score-mid .audit-card-value {
    color: var(--amber);
}

.audit-score-low .audit-card-value {
    color: var(--rose);
}

/* --- Audit Lists --- */
.audit-list {
    list-style: none;
}

.audit-list li {
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    border-left: 3px solid var(--border);
    color: var(--text-secondary);
    transition: background var(--transition);
}

.audit-list li:hover {
    background: var(--bg-card-hover);
}

.audit-list-problems li {
    border-left-color: var(--rose);
}

.audit-list-solutions li {
    border-left-color: var(--green);
}

/* --- Signal Chips --- */
.signal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.signal-chip {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.signal-chip.good {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--green);
}

.signal-chip.bad {
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--rose);
}

.signal-chip.neutral {
    border-color: rgba(148, 163, 184, 0.2);
}

/* --- Audit Empty State --- */
.audit-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}


/* =============================================================
   20. SERVICES TAGS
   ============================================================= */
.services-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-tag {
    padding: 5px 12px;
    background: var(--bg-card);
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.service-tag:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}


/* =============================================================
   21. HIGHLIGHTS
   ============================================================= */
.highlights-list {
    list-style: none;
}

.highlights-list li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
}

.highlights-list li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    position: absolute;
    left: 0;
    top: 12px;
}


/* =============================================================
   22. ACTIVITY COMPONENTS
   ============================================================= */
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-add-activity {
    background: var(--accent-glow);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn-add-activity:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
}

/* --- Next Action Bar --- */
.next-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 8px 12px;
    background: var(--amber-glow);
    border-radius: 8px;
    color: var(--amber);
    margin-bottom: 16px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Activity Timeline --- */
.activity-timeline {
    position: relative;
    padding-left: 24px;
}

.activity-timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.activity-item {
    position: relative;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

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

.activity-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

.activity-item .activity-type {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.activity-item .activity-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.activity-item .activity-note {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 13px;
}


/* =============================================================
   23. SALES GRID
   ============================================================= */
.sales-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sales-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sales-field.full-width {
    grid-column: span 2;
}

.sales-field label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.sales-field input,
.sales-field select,
.sales-field textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition);
}

.sales-field input:focus,
.sales-field select:focus,
.sales-field textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.sales-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    cursor: pointer;
}

.sales-field input::placeholder,
.sales-field textarea::placeholder {
    color: var(--text-muted);
}


/* =============================================================
   24. KANBAN BOARD
   ============================================================= */

/* --- Kanban Header --- */
.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.kanban-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.kanban-summary {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.kanban-summary span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Kanban Board Container --- */
.kanban-board {
    display: flex;
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
    flex: 1;
    height: calc(100vh - 120px);
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* --- Kanban Column --- */
.kanban-column {
    min-width: 280px;
    width: 280px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid var(--border);
    max-height: 100%;
}

.kanban-column-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.kanban-column-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.kanban-column-title .stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Stage Dots --- */
.stage-dot.nuevo       { background: var(--accent); }
.stage-dot.contactado  { background: var(--cyan); }
.stage-dot.reunion     { background: var(--amber); }
.stage-dot.propuesta   { background: #a855f7; }
.stage-dot.negociando  { background: #f97316; }
.stage-dot.cerrado     { background: var(--green); }
.stage-dot.perdido     { background: var(--rose); }

.kanban-column-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--text-muted);
}

.kanban-column-stats {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

/* --- Kanban Column Body --- */
.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.kanban-column-body::-webkit-scrollbar {
    width: 4px;
}

.kanban-column-body::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* --- Kanban Card --- */
.kanban-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    cursor: grab;
    transition: all var(--transition);
    position: relative;
}

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

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

.kanban-card.sortable-ghost {
    opacity: 0.4;
    border-color: var(--accent);
}

.kanban-card.sortable-chosen {
    box-shadow: 0 0 0 2px var(--accent);
}

.kanban-card-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.kanban-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-card-score {
    font-size: 11px;
    font-weight: 700;
}

.kanban-card-days {
    font-size: 10px;
    color: var(--text-muted);
}

.kanban-card-value {
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
    margin-top: 4px;
}

/* --- Kanban Card Actions (appear on hover) --- */
.kanban-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

.kanban-card:hover .kanban-card-actions {
    opacity: 1;
}

.kanban-card-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.kanban-card-action:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* --- Kanban Stale Cards --- */
.kanban-card.stale-amber {
    border-left: 3px solid var(--amber);
}

.kanban-card.stale-red {
    border-left: 3px solid var(--rose);
}


/* =============================================================
   25. DASHBOARD
   ============================================================= */

/* --- KPI Row --- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.kpi-card:hover {
    border-color: var(--border-hover);
}

.kpi-card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-card-change {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-muted);
}

.kpi-card-change.up {
    color: var(--green);
}

.kpi-card-change.down {
    color: var(--rose);
}

/* --- Charts Grid --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.chart-card:hover {
    border-color: var(--border-hover);
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.chart-card canvas {
    max-height: 280px;
    width: 100%;
}


/* =============================================================
   26. MODALS
   ============================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay[style*="flex"],
.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.2s ease;
}

.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.modal-lg {
    width: 800px;
}

.modal-sm {
    width: 380px;
}

.modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.modal-header-actions {
    display: flex;
    gap: 8px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-field label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition);
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.modal-field input::placeholder,
.modal-field textarea::placeholder {
    color: var(--text-muted);
}

.modal-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    cursor: pointer;
}

.modal-field select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* --- Close Buttons --- */
.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color var(--transition);
}

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

.btn-close-sm {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    transition: color var(--transition);
}

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


/* =============================================================
   27. PROPOSAL PREVIEW
   ============================================================= */
.proposal-preview {
    background: white;
    color: #1a1a2e;
    border-radius: var(--radius-md);
    padding: 40px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
}

.proposal-preview::-webkit-scrollbar {
    width: 6px;
}

.proposal-preview::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.proposal-preview::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

.proposal-preview h1 {
    font-size: 24px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.proposal-preview h2 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.proposal-preview h3 {
    font-size: 16px;
    color: #334155;
    margin-bottom: 8px;
}

.proposal-preview p {
    color: #475569;
    margin-bottom: 12px;
}

.proposal-header {
    text-align: center;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.proposal-header h1 {
    color: #6366f1;
}

.proposal-section {
    margin-bottom: 24px;
}

.proposal-section h2 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.proposal-issue {
    background: #fef2f2;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid #ef4444;
    color: #991b1b;
    font-size: 13px;
}

.proposal-solution {
    background: #f0fdf4;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid #22c55e;
    color: #166534;
    font-size: 13px;
}

.proposal-package {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #6366f1;
    text-align: center;
    margin-bottom: 16px;
}

.proposal-price {
    font-size: 36px;
    font-weight: 800;
    color: #6366f1;
    line-height: 1.2;
}

.proposal-features {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.proposal-features li {
    padding: 4px 0;
    font-size: 14px;
    color: #475569;
}

.proposal-features li::before {
    content: "\2713  ";
    color: #6366f1;
    font-weight: 700;
}

.proposal-cta {
    text-align: center;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: white;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 20px;
}


/* =============================================================
   28. TODAY PANEL
   ============================================================= */
.today-panel {
    position: fixed;
    right: 0;
    top: 60px;
    width: 360px;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.today-panel.active {
    transform: translateX(0);
}

.today-panel::-webkit-scrollbar {
    width: 6px;
}

.today-panel::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.today-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

.today-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.today-panel-list {
    padding: 12px;
}

.today-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.today-item:hover {
    background: var(--bg-card-hover);
}

.today-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.today-item-action {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.today-item-overdue {
    border-left: 3px solid var(--rose);
}

.today-item-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}


/* =============================================================
   29. TOAST CONTAINER
   ============================================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    min-width: 280px;
    display: flex;
    gap: 10px;
    align-items: center;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
}

.toast-success {
    background: #065f46;
    color: #a7f3d0;
    border: 1px solid #10b981;
}

.toast-error {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #f43f5e;
}

.toast-info {
    background: #1e3a5f;
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

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


/* =============================================================
   30. ANIMATIONS
   ============================================================= */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* =============================================================
   31. RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
    .leads-panel {
        width: 340px;
    }

    .kanban-column {
        min-width: 250px;
        width: 250px;
    }

    .search-bar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    #view-leads.active {
        flex-direction: column;
    }

    .leads-panel {
        width: 100%;
        height: 50vh;
    }

    .detail-panel {
        height: 50vh;
    }

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

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

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

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

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

    .sales-field.full-width {
        grid-column: span 1;
    }

    .top-bar {
        padding: 0 12px;
    }

    .main-nav {
        margin-left: 12px;
    }

    .search-bar {
        width: 200px;
    }

    .today-panel {
        width: 100%;
    }

    .modal {
        max-width: 95vw;
        padding: 16px;
    }

    .modal-lg {
        width: 95vw;
    }

    .detail-content {
        padding: 16px;
    }

    .kanban-board {
        padding: 12px;
    }

    .detail-header-top {
        flex-direction: column;
    }

    .detail-actions {
        width: 100%;
    }
}


/* =============================================================
   32. MISC & UTILITIES
   ============================================================= */

/* --- Lead Card Quick Actions --- */
.lead-card-quick-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.lead-card:hover .lead-card-quick-actions {
    opacity: 1;
}

.quick-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* --- Text Truncation Utility --- */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Flex Center Utility --- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Hide Scrollbar Utility --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Focus Visible for Accessibility --- */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Global Placeholder Styling --- */
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* --- Meta Items --- */
.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item .star {
    color: var(--amber);
}

/* --- Stats Summary (legacy compat) --- */
.stats-summary {
    margin-top: 20px;
    width: 100%;
}

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

.stat-card {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition);
}

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

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Region Filter (legacy compat) --- */
.region-filter {
    margin-top: 10px;
}

.region-filter select {
    width: 100%;
    padding: 8px 28px 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.region-filter select:focus {
    border-color: var(--accent);
    outline: none;
}

/* --- Location Tag --- */
.location-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Main Layout (legacy compat) --- */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Source Icon --- */
.source-icon {
    background: rgba(244, 63, 94, 0.12);
    color: var(--rose);
}
