:root {
    --bg-page: #F5F8FC;
    --bg-card: #FFFFFF;
    --text-primary: #122038;
    --text-secondary: #4B5A74;
    --text-muted: #90A1B9;
    --border: #DDE6F2;
    --accent-blue: #0A2540;
    --accent-blue-hover: #123A63;
    --accent-teal: #22D3EE;
    --accent-teal-hover: #1AB8D1;
    --accent-purple: #6D5EF5;
    --accent-orange: #FE7C0B;
    --accent-green: #0E795D;
    --accent-silver: #94A3B8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg-page: #0B1220;
    --bg-card: #111B2F;
    --text-primary: #EAF2FF;
    --text-secondary: #B5C5DD;
    --text-muted: #7F95B5;
    --border: #243452;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
}

h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 600; color: var(--text-secondary); margin: 0 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 0.5rem; }
p { margin: 0 0 0.75rem; color: var(--text-secondary); }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
}

.auth-container {
    background: var(--bg-card);
    padding: 1.5rem 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-container h1 { text-align: center; margin-bottom: 1rem; }
.auth-container h2 { text-align: center; color: var(--text-muted); }

.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form label { display: block; margin-bottom: 0.35rem; font-weight: 600; color: var(--text-primary); }

.auth-form input {
    width: 100%;
    padding: 0.65rem 1rem;
    padding-right: 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.auth-form .input-wrap { position: relative; }
.auth-form .input-wrap input { padding-right: 2.75rem; }

.auth-form .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

.auth-form .password-toggle:hover { color: var(--accent-teal); }
.auth-form input:focus { outline: none; border-color: var(--accent-teal); }

.auth-form button[type="submit"] {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    background: var(--accent-teal);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.auth-form button[type="submit"]:hover { background: var(--accent-teal-hover); }
.auth-form a { display: block; margin-top: 1.25rem; text-align: center; color: var(--accent-teal); font-weight: 500; text-decoration: none; }
.auth-form a:hover { color: var(--accent-purple); }

.auth-logo {
    width: 100px;
    height: 100px;
    margin: 0.5rem auto;
    display: block;
}

.navbar {
    background: var(--accent-blue);
    color: #FFFFFF;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img { height: 36px; width: auto; }

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    padding: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.navbar-toggle:hover { color: #FFFFFF; }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; }

.navbar a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar a:hover { background: rgba(255,255,255,0.15); color: #FFFFFF; }
.navbar .nav-notifications { position: relative; }
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
}
.navbar a.active { background: var(--accent-teal); color: #1E293B; }

.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header > div:first-child { width: 100%; }
    .page-header .btn { width: 100%; max-width: 100%; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
    width: 100%;
}
@media (max-width: 767px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.stats-grid.stats-grid-sales {
    grid-template-columns: 1fr 1fr 1fr 1.5fr 1.5fr;
}
@media (max-width: 1024px) {
    .stats-grid.stats-grid-sales { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid.stats-grid-sales { grid-template-columns: 1fr; }
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
    width: 100%;
}
.dashboard-charts-row.charts-single {
    grid-template-columns: 1fr;
}
@media (max-width: 900px) {
    .dashboard-charts-row { grid-template-columns: 1fr; }
}
.dashboard-chart-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    width: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}
.dashboard-chart-wrap h3 {
    margin: 0 0 1rem;
    flex-shrink: 0;
}
.dashboard-chart-wrap .chart-inner {
    flex: 1;
    min-height: 240px;
    position: relative;
}
.dashboard-chart-wrap .chart-inner canvas {
    width: 100% !important;
    height: 100% !important;
}

.stat-card {
    background: var(--bg-card);
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 3px solid var(--accent-teal);
}

.stat-card:nth-child(2) { border-top-color: var(--accent-orange); }
.stat-card:nth-child(3) { border-top-color: var(--accent-purple); }
.stat-card:nth-child(4) { border-top-color: var(--accent-green); }
.stat-card:nth-child(5) { border-top-color: var(--accent-blue); }
.stat-card:nth-child(6) { border-top-color: #10B981; }

.stat-card .value { font-size: 1.35rem; color: var(--text-primary); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 0.2rem; }

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    overflow-y: visible;
}

.search-bar-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-input-wrap .search-input {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
}
.search-input-wrap .search-input:focus {
    outline: none;
    border-color: var(--accent-teal);
}
.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-clear:hover {
    color: var(--text-primary);
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
}
.search-input:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.table-container table { width: 100%; border-collapse: collapse; }
.table-container th, .table-container td { padding: 1rem 1.25rem; text-align: left; }
.table-container th {
    background: var(--border);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table-container tr:hover td { background: var(--border); }
.table-container tr:hover td.actions-cell { background: transparent; }
.table-container tr { cursor: pointer; }
.table-container td.actions-cell { position: relative; overflow: visible; }

.empty-state { padding: 3rem 2rem; text-align: center; color: var(--text-muted); }
.empty-state .icon { margin-bottom: 1rem; }

.btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary { background: var(--accent-blue); opacity: 0.95; color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-blue-hover); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.theme-btn-active {
    background: var(--accent-teal) !important;
    color: #FFFFFF !important;
    border-color: var(--accent-teal) !important;
}
.theme-btn-active:hover {
    background: #1da1a1 !important;
}

.nav-settings-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem !important;
}
.nav-settings-icon i {
    width: 20px;
    height: 20px;
}

.btn-icon {
    padding: 0.35rem;
    min-width: auto;
    background: transparent;
    color: var(--text-secondary);
}
.btn-icon:hover { color: var(--accent-teal); }
.actions-cell { white-space: nowrap; }

.breadcrumb { margin-bottom: 1rem; font-size: 0.9rem; }
.breadcrumb a { color: var(--accent-teal); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-muted); margin: 0 0.35rem; }
.lead-detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lead-detail-cards {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: stretch;
}
@media (min-width: 768px) {
    .lead-detail-cards {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .lead-detail-cards .lead-detail-grid { grid-column: 1; grid-row: 1 / 3; }
    .lead-detail-cards .lead-card-service { grid-column: 2 / 4; grid-row: 1; }
    .lead-detail-cards .lead-card-followups { grid-column: 2; grid-row: 2; }
    .lead-detail-cards .lead-card-internal { grid-column: 3; grid-row: 2; }
}
@media (max-width: 767px) {
    .lead-detail-cards { grid-template-columns: 1fr; }
}
.lead-detail-grid,
.lead-card-service {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.lead-detail-grid > .lead-detail-card,
.lead-card-service {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.project-info-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.project-info-item { color: var(--text-primary); }
.project-info-sep { color: var(--text-muted); font-weight: 300; }
.project-info-message { flex: 1; }
.project-info-message strong { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.project-info-message-value { color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.consultation-details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.15rem;
}
.consultation-detail-row {
    display: grid;
    grid-template-columns: minmax(82px, 96px) 1fr;
    align-items: start;
    column-gap: 0.65rem;
}
.consultation-detail-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.84rem;
    line-height: 1.35;
}
.consultation-detail-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
}
.detail-list { margin: 0; }
.detail-list dt { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.75rem; }
.detail-list dd { margin: 0.25rem 0 0; }
.detail-list dd a[href^="tel:"], .detail-list dd a[href^="mailto:"], .table-container td a[href^="tel:"], .table-container td a[href^="mailto:"] { color: var(--accent-teal); text-decoration: none; }
.notification-title-link { color: var(--accent-teal); text-decoration: none; }
.notification-title-link:hover { text-decoration: underline; }
.detail-list dd a:hover, .table-container td a[href^="tel:"]:hover, .table-container td a[href^="mailto:"]:hover { text-decoration: underline; }
.detail-list dt:first-child { margin-top: 0; }
.notes-list { margin-top: 1rem; }
.note-item { padding: 0.75rem; background: var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.note-item p { margin: 0 0 0.35rem; }
.note-item small { font-size: 0.8rem; color: var(--text-muted); }
.text-muted { color: var(--text-muted); margin: 0; }
.profile-form textarea { width: 100%; padding: 0.65rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; background: var(--bg-card); color: var(--text-primary); resize: vertical; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}
.modal-header h3 { margin: 0; flex: 1; }
.modal-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-icon:hover { color: var(--text-primary); }
.modal h3 { margin-bottom: 1.5rem; }
.modal .modal-header + * { margin-top: 0; }
.modal .modal-header ~ .modal-actions { margin-top: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.modal-actions .btn { flex: 1; justify-content: center; text-align: center; }

.form-group select, .form-group input, .profile-form input, .profile-form select {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.profile-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.avatar-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-teal);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.ADMIN { background: var(--accent-purple); color: #FFFFFF; }
.role-badge.SALES { background: var(--accent-orange); color: #FFFFFF; }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--text-muted);
    color: #fff;
}
.status-badge.NEW { background: var(--accent-blue); color: #fff; }
.status-badge.CONTACTED { background: #8B5CF6; color: #fff; }
.status-badge.QUALIFIED { background: var(--accent-teal); color: #fff; }
.status-badge.PROPOSAL { background: #F59E0B; color: #fff; }
.status-badge.NEGOTIATION { background: var(--accent-orange); color: #fff; }
.status-badge.WON { background: var(--accent-green); color: #fff; }
.status-badge.LOST { background: #EF4444; color: #fff; }

#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    max-width: 400px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    border-left: 4px solid;
}

.toast-item.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon { flex-shrink: 0; font-size: 1.25rem; font-weight: 700; line-height: 1; }
.toast-body { flex: 1; }
.toast-body strong { display: block; margin-bottom: 0.15rem; }
.toast-body span { font-size: 0.9em; opacity: 0.95; }
.toast-success { background: #f0fdf4; color: #166534; border-left-color: #22c55e; }
.toast-success .toast-icon { color: #22c55e; }
.toast-error { background: #fef2f2; color: #991b1b; border-left-color: #ef4444; }
.toast-error .toast-icon { color: #ef4444; }
.toast-warning { background: #fffbeb; color: #92400e; border-left-color: #f59e0b; }
.toast-warning .toast-icon { color: #f59e0b; }

.update-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    max-width: 380px;
    opacity: 0;
    transform: translateX(120%) scale(0.95);
    transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.update-toast.update-toast-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.update-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(0,0,0,0.18), 0 0 0 1px rgba(26,69,139,0.12);
    border-left: 4px solid var(--accent-teal);
}

.update-toast-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34,184,184,0.15);
    border-radius: var(--radius-sm);
    color: var(--accent-teal);
}

.update-toast-icon svg {
    width: 22px;
    height: 22px;
    animation: update-spin 2s linear infinite;
}

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

.update-toast-body { flex: 1; min-width: 0; }
.update-toast-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.update-toast-message {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.update-toast-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-update-cancel {
    background: var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.btn-update-cancel:hover {
    background: var(--text-muted);
    color: var(--text-primary);
}

.btn-update-confirm {
    background: var(--accent-teal);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-update-confirm:hover {
    background: #1A9A9A;
    color: #fff;
}

.btn-update-confirm svg {
    width: 16px;
    height: 16px;
}

.profile-form .form-group {
    margin-bottom: 1.25rem;
}

.profile-form .form-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-form textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
}

.profile-form .input-wrap {
    position: relative;
}

.profile-form .input-wrap input {
    padding-right: 2.75rem;
}

.profile-form .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

.profile-form .password-toggle:hover {
    color: var(--accent-teal);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: rgba(255,255,255,0.9);
}

.navbar-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-page);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.navbar-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.navbar-drawer {
    width: 100%;
    height: 100%;
    padding: 2rem;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar-drawer-overlay.is-open .navbar-drawer {
    transform: scale(1);
    opacity: 1;
}
.navbar-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
}
.navbar-drawer-close:hover { opacity: 0.8; }
.navbar-drawer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}
.navbar-drawer-links a,
.navbar-drawer-links .theme-toggle-drawer {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 0;
    border-radius: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-start;
    background: transparent;
}
.navbar-drawer-links a:hover,
.theme-toggle-drawer:hover {
    color: var(--accent-teal);
}
.navbar-drawer-links a.active {
    color: var(--accent-blue);
    background: transparent;
}
[data-theme="dark"] .navbar-drawer-links a.active {
    color: var(--accent-teal);
}
.navbar a.active i,
.navbar a.active svg {
    color: #1E293B;
}
.navbar-drawer-links .nav-notifications { position: relative; }
.navbar-drawer-links .notification-badge {
    position: static;
    margin-left: 0.35rem;
}
.theme-toggle-drawer { font-size: 1rem; }

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .navbar-toggle { display: flex; }
    .navbar-links { display: none; }
    .main-content { padding: 1rem; }
}

@media (min-width: 769px) {
    .navbar-drawer-overlay { display: none !important; }
}

.leads-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}
.leads-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.leads-tab:hover {
    color: var(--text-primary);
}
.leads-tab.active {
    color: var(--accent-teal);
}
.leads-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-teal);
}
.tab-badge {
    display: none;
    margin-left: 0.35rem;
    padding: 0.15rem 0.45rem;
    min-width: 1.25rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--accent-teal);
    color: #fff;
    text-align: center;
}
.tab-badge.show {
    display: inline-block;
}
.converted-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-green);
    color: #fff;
}

.actions-dropdown {
    position: relative;
    display: inline-block;
}
.actions-dropdown-btn {
    position: relative;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s;
}
.actions-dropdown-btn:hover {
    background: var(--border);
    border-color: var(--text-muted);
}
.actions-dropdown-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    z-index: 9999;
    display: none;
}
.actions-dropdown.open .actions-dropdown-menu {
    display: block;
}
.actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.actions-dropdown-item:hover {
    background: var(--border);
}
.actions-dropdown-item i, .actions-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.actions-dropdown-item.danger {
    color: #ef4444;
}
.actions-dropdown-item.danger i, .actions-dropdown-item.danger svg {
    color: #ef4444;
}

/* Table pagination: count + prev / page numbers / next */
.pagination-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.pagination-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.btn-pagination {
    min-width: 2.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    justify-content: center;
    text-align: center;
}
.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-ellipsis {
    padding: 0 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
