/* ============================================================
   LeadFlow CRM - Main Stylesheet
   Design: Sharp enterprise SaaS, dark sidebar, light content
   ============================================================ */

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

:root {
    /* Brand */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #06b6d4;
    --accent: #f59e0b;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4f46e5;
    --sidebar-active-bg: rgba(79, 70, 229, 0.15);
    --sidebar-hover-bg: rgba(255,255,255,0.05);
    --sidebar-width: 260px;

    /* Content */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-focus: #4f46e5;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Status Colors */
    --status-new: #6366f1;
    --status-contacted: #f59e0b;
    --status-interested: #10b981;
    --status-not-interested: #ef4444;
    --status-converted: #059669;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Font */
    --font: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */

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

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.sidebar-logo {
    padding: 22px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.sidebar-logo .logo-version {
    font-size: 10px;
    color: var(--sidebar-text);
    background: var(--sidebar-border);
    padding: 1px 6px;
    border-radius: 99px;
    margin-left: auto;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-border) transparent;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    padding: 16px 20px 6px;
    opacity: 0.6;
}

.nav-item {
    padding: 2px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: white;
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: white;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-link.active .nav-icon { opacity: 1; }

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.nav-badge.orange { background: #f59e0b; }
.nav-badge.red    { background: #ef4444; }

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

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

.user-role {
    font-size: 11px;
    color: var(--sidebar-text);
}

.user-actions { display: flex; gap: 4px; }

.user-action-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.user-action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Topbar ---- */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.topbar-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    background: var(--bg-muted);
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s;
}

.topbar-search input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.topbar-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px; height: 16px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.topbar-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    position: relative;
}

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

.notif-dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* ---- Page Content ---- */
.page-content {
    padding: 28px;
    flex: 1;
}

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

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-body { padding: 22px; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 0 var(--radius-lg) 0 80px;
    opacity: 0.08;
}

.stat-card.indigo::before { background: var(--primary); }
.stat-card.amber::before  { background: var(--accent); }
.stat-card.emerald::before{ background: #10b981; }
.stat-card.red::before    { background: #ef4444; }
.stat-card.cyan::before   { background: var(--secondary); }

.stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-icon.indigo  { background: #eef2ff; color: var(--primary); }
.stat-icon.amber   { background: #fffbeb; color: var(--accent); }
.stat-icon.emerald { background: #ecfdf5; color: #10b981; }
.stat-icon.red     { background: #fef2f2; color: #ef4444; }
.stat-icon.cyan    { background: #ecfeff; color: var(--secondary); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

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

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 7px;
    border-radius: 99px;
}

.stat-change.up   { background: #ecfdf5; color: #059669; }
.stat-change.down { background: #fef2f2; color: #ef4444; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

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

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

.btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}
.btn-danger:hover { background: #dc2626; }

.btn-outline {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

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

.btn-icon {
    width: 32px; height: 32px;
    padding: 0;
    justify-content: center;
}

/* ---- Badges / Status Pills ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-new           { background: #eef2ff; color: #4f46e5; }
.badge-contacted     { background: #fffbeb; color: #d97706; }
.badge-interested    { background: #ecfdf5; color: #059669; }
.badge-not-interested{ background: #fef2f2; color: #dc2626; }
.badge-converted     { background: #d1fae5; color: #065f46; }

.badge-low    { background: #f1f5f9; color: #475569; }
.badge-medium { background: #fffbeb; color: #d97706; }
.badge-high   { background: #fff7ed; color: #ea580c; }
.badge-urgent { background: #fef2f2; color: #dc2626; }

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: white;
}

table.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.crm-table thead {
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

.crm-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    white-space: nowrap;
}

.crm-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.crm-table th.sortable:hover { color: var(--primary); }

.crm-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.crm-table tbody tr:hover { background: #fafbff; }

.crm-table .td-name {
    font-weight: 600;
    color: var(--text-primary);
}

.crm-table .td-email {
    font-size: 12px;
    color: var(--text-muted);
}

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

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label span { color: #ef4444; }

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--text-primary);
    background: white;
    outline: none;
    transition: all 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-control.error { border-color: #ef4444; }

select.form-control { cursor: pointer; }

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

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    gap: 16px;
}
.form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- Filters Bar ---- */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filters-bar select,
.filters-bar input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    background: var(--bg-muted);
    transition: border-color 0.15s;
}

.filters-bar select:focus,
.filters-bar input:focus {
    border-color: var(--primary);
    background: white;
}

/* ---- Kanban Board ---- */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 260px;
    width: 260px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.kanban-col-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

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

.kanban-col-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.kanban-count {
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--primary);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-cards {
    padding: 10px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    cursor: grab;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}

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

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

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

.kanban-card-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.kanban-card-actions {
    display: flex;
    gap: 4px;
}

.kanban-card-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s;
}

.kanban-card-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.drag-over { background: rgba(79,70,229,0.05); border: 2px dashed var(--primary) !important; }

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 780px; }

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

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.modal-close {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: none;
    background: var(--bg-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }

.modal-body { padding: 22px 24px; }

.modal-footer {
    padding: 14px 24px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 9px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ---- Avatar ---- */
.avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 64px; height: 64px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

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

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

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

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border);
    background: var(--primary);
}

.timeline-dot.call    { background: #10b981; }
.timeline-dot.email   { background: var(--secondary); }
.timeline-dot.meeting { background: var(--accent); }
.timeline-dot.note    { background: #8b5cf6; }

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.timeline-content {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
}

.timeline-subject {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.timeline-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    justify-content: center;
}

.page-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.15s;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ---- Auth Pages ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-bg-decor {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
}

.auth-bg-decor.one { width: 400px; height: 400px; background: #4f46e5; top: -100px; left: -100px; }
.auth-bg-decor.two { width: 300px; height: 300px; background: #06b6d4; bottom: -80px; right: -80px; }

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-logo .logo-icon {
    width: 44px; height: 44px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
}

.auth-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-heading {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-subheading {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Lead Detail ---- */
.lead-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.detail-field {
    margin-bottom: 12px;
}

.detail-field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.detail-field-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ---- Charts (placeholder bars) ---- */
.mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 50px;
}

.mini-bar {
    flex: 1;
    background: var(--primary-light);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    position: relative;
}

.mini-bar:hover { background: var(--primary); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .lead-detail-grid { grid-template-columns: 1fr; }
    .form-row.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row.cols-2,
    .form-row.cols-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
    .kanban-board { padding-bottom: 16px; }
}

/* ---- Utility ---- */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: #ef4444; }
.text-success{ color: #059669; }
.fw-bold { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.w-100  { width: 100%; }
.mb-0   { margin-bottom: 0; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.p-0    { padding: 0; }
.hidden { display: none !important; }

/* ---- Loading spinner ---- */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-flex; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font);
}

.dropdown-item:hover { background: var(--bg-muted); color: var(--text-primary); }
.dropdown-item.danger:hover { background: #fef2f2; color: #ef4444; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
@media (max-width: 1024px) {
    .sidebar-overlay.open { display: block; }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 380px;
    animation: slideIn 0.3s ease;
    font-size: 13.5px;
    font-weight: 500;
}

.toast.success { border-left: 3px solid #10b981; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #f59e0b; }

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

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}
