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

:root {
    --bg-main: #0a0e1a;
    --bg-surface: #101726;
    --bg-card: rgba(18, 26, 43, 0.75);
    --bg-card-hover: rgba(26, 37, 60, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-highlight: rgba(99, 102, 241, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-violet: #8b5cf6;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
    
    --sidebar-width: 250px;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.07) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.04) 0px, transparent 60%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* App Container Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.brand-section {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 0 15px var(--primary-glow);
    flex-shrink: 0;
}

.brand-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-radius: 4px;
    font-weight: 700;
}

.nav-menu {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.nav-icon {
    font-size: 17px;
    width: 20px;
    text-align: center;
}

.user-profile-widget {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-rose));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Main Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: rgba(16, 23, 38, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 20px;
}

.header-search {
    position: relative;
    max-width: 440px;
    width: 100%;
}

.header-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px 8px 38px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.header-search input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon-pos {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Content Area */
.content-body {
    padding: 24px 28px;
    flex: 1;
    min-width: 0;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    color: #ffffff;
}

.btn-whatsapp {
    background: #25D366;
    color: #0b2212;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #20ba59;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-rose), #dc2626);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-trash {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    flex-shrink: 0;
}

.btn-trash:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.55);
    color: #ffffff;
    transform: scale(1.05);
}

/* Cards & Glass Panels */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-subtle);
    transition: all 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Stat KPI Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

.stat-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Funnel Stage Bar */
.funnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 10px;
}

.funnel-step {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.funnel-step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.funnel-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-count {
    font-size: 18px;
    font-weight: 800;
    margin-top: 4px;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-hot {
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-high {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-medium {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-low {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-status {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.badge-won {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(16px);
}

.table-container::-webkit-scrollbar {
    height: 7px;
    width: 7px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

table {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 13px;
}

thead {
    background: rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 12px 16px;
    font-weight: 700;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
    transition: background 0.15s ease;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Clickable Table Rows */
tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

tr.clickable-row:hover td {
    background: rgba(99, 102, 241, 0.08) !important;
}

tr.clickable-row:active td {
    background: rgba(99, 102, 241, 0.14) !important;
}

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

/* Pagination Component */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.65);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-info strong {
    color: #f8fafc;
    font-weight: 600;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
    user-select: none;
}

.page-link:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.page-link.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
    font-size: 13px;
}


/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' 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 12px center;
    background-size: 14px;
    padding-right: 36px;
}

select.form-control option {
    background: #0f172a;
    color: #ffffff;
    padding: 8px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-backdrop.active,
.modal-backdrop.show {
    display: flex;
}

.modal-dialog {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

.modal-dialog > form,
.modal-dialog form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin: 0;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes radarPulse {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.7); opacity: 0; }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.pulse-dot {
    animation: pulseDot 1.4s ease-in-out infinite;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #0f172a;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar,
#citiesScrollContainer::-webkit-scrollbar,
#nicheCardsContainer::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal-body::-webkit-scrollbar-track,
#citiesScrollContainer::-webkit-scrollbar-track,
#nicheCardsContainer::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
#citiesScrollContainer::-webkit-scrollbar-thumb,
#nicheCardsContainer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
#citiesScrollContainer::-webkit-scrollbar-thumb:hover,
#nicheCardsContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.modifier-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #c7d2fe;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.modifier-chip:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

.modifier-chip.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-color: #818cf8;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #0f172a;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fda4af;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
}

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

.timeline-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Anti-Collision Banner */
.collision-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(244, 63, 94, 0.2));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #fde68a;
}

/* Inline Stage Selector */
.status-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.stage-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 5px 24px 5px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.06);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' 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 7px center;
    background-size: 11px;
    border: 1px solid var(--border-color);
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.stage-select:hover, .stage-select:focus {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.stage-select.stage-new {
    background-color: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
}

.stage-select.stage-qualified {
    background-color: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.45);
    color: #67e8f9;
}

.stage-select.stage-contacted {
    background-color: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

.stage-select.stage-interested {
    background-color: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.stage-select.stage-requirement {
    background-color: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
}

.stage-select.stage-quotation_sent {
    background-color: rgba(236, 72, 153, 0.18);
    border-color: rgba(236, 72, 153, 0.45);
    color: #f472b6;
}

.stage-select.stage-negotiation {
    background-color: rgba(249, 115, 22, 0.18);
    border-color: rgba(249, 115, 22, 0.45);
    color: #fdba74;
}

.stage-select.stage-won {
    background-color: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.55);
    color: #34d399;
}

.stage-select.stage-not_interested, .stage-select.stage-no_response {
    background-color: rgba(100, 116, 139, 0.18);
    border-color: rgba(100, 116, 139, 0.35);
    color: #cbd5e1;
}

.stage-select.stage-lost, .stage-select.stage-do_not_contact {
    background-color: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.stage-select option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 8px;
    font-weight: 500;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}

.toast-item {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast-item.toast-leave {
    opacity: 0;
    transform: translateX(60px);
}

.toast-item.success {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.98));
}

.toast-item.error {
    border-color: rgba(239, 68, 68, 0.45);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(15, 23, 42, 0.98));
}

.toast-item.warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.98));
}

.toast-item.info {
    border-color: rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(15, 23, 42, 0.98));
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
    line-height: 1;
}

.toast-close-btn:hover {
    color: #ffffff;
}

/* Quick Toast Backward Compatibility */
.quick-toast {
    display: none !important;
}

/* Niche Selection Cards */
.niche-option-card:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-1px);
}

.niche-option-card.selected {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.niche-option-card.selected .niche-check-icon {
    color: var(--accent-emerald);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .lead-detail-grid {
        grid-template-columns: 1fr !important;
    }
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
    .content-body {
        padding: 20px 16px;
    }
}

@media (max-width: 900px) {
    .settings-tab-pane form [style*="grid-template-columns"],
    .settings-tab-pane [style*="grid-template-columns: 1fr 1.4fr"],
    .settings-tab-pane [style*="grid-template-columns: 2fr 1fr 1fr"],
    .settings-tab-pane [style*="grid-template-columns: 1fr 1fr 1fr"],
    .settings-tab-pane [style*="grid-template-columns: 1fr 1fr"],
    .card [style*="grid-template-columns: 280px 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px 12px;
    }
    .top-header {
        padding: 0 16px;
    }
    .header-search {
        max-width: 220px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Bulk Multi-Select & Floating Action Toolbar
   ========================================================================== */

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    background: rgba(16, 23, 38, 0.8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.custom-checkbox:hover {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.custom-checkbox:checked {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.custom-checkbox:checked::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.custom-checkbox:indeterminate {
    background: rgba(99, 102, 241, 0.4);
    border-color: var(--primary);
}

.custom-checkbox:indeterminate::after {
    content: '—';
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.row-selected {
    background: rgba(99, 102, 241, 0.12) !important;
    position: relative;
}

.row-selected td:first-child {
    border-left: 3px solid var(--primary) !important;
}

/* Floating Bottom Action Toolbar */
.bulk-action-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.45);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    max-width: 92vw;
}

.bulk-action-bar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.bulk-count-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.35));
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 9999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bulk-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

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

