/* 
 * SELATOUR CRM - PREMIUM VANILLA CSS DESIGN SYSTEM
 * Highly optimized for mobile-first views, rapid loading, and elegant modern aesthetics.
 */

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

:root {
    /* Color Palette */
    --primary: #208AEC; /* Biru Terpercaya */
    --primary-light: #E8F3FF;
    --primary-hover: #1573CB;
    
    --success: #27AE60; /* Hijau Lunas */
    --success-light: #EAF7EE;
    
    --warning: #F2994A; /* Orange WARM */
    --warning-light: #FFF4EA;
    
    --danger: #EB5757; /* Merah HOT */
    --danger-light: #FDF0F0;
    
    --info: #2F80ED;
    --cold: #56CCF2; /* Biru COLD */
    --cold-light: #EEFAFD;

    /* Neutrals */
    --bg-app: #F8FAFC;
    --bg-surface: #FFFFFF;
    --border: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Styling Elements */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-premium: 0 20px 25px -5px rgba(32, 138, 236, 0.08), 0 10px 10px -5px rgba(32, 138, 236, 0.04);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button, input, select, textarea {
    font-size: 14px;
    outline: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ----------------------------------------------------
   1. AUTH PAGES (Login)
   ---------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--primary-light), var(--bg-app));
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    border: 1px solid var(--border);
    animation: slideUp 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    height: 70px;
    object-fit: contain;
    margin-bottom: 15px;
}

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

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

.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    background-color: #FAFAFA;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--primary);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(32, 138, 236, 0.15);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background-color: var(--primary);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.error-alert {
    background-color: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ----------------------------------------------------
   2. APP LAYOUT (Sidebar + Topbar + Content)
   ---------------------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--text-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    height: 40px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.sidebar-link.active {
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(32, 138, 236, 0.25);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.sidebar-username {
    font-weight: 700;
    font-size: 14px;
}

.sidebar-role {
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
}

.logout-btn {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Wrapper */
.main-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    background-color: var(--bg-surface);
    height: 70px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.content-container {
    padding: 30px;
    flex-grow: 1;
}

/* ----------------------------------------------------
   3. DASHBOARD & ANALYTICS WIDGETS
   ---------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.stat-icon {
    font-size: 20px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-app);
}

.stat-card.closing .stat-icon { color: var(--success); background-color: var(--success-light); }
.stat-card.potential .stat-icon { color: var(--primary); background-color: var(--primary-light); }
.stat-card.received .stat-icon { color: var(--warning); background-color: var(--warning-light); }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 15px;
    letter-spacing: -0.5px;
}

/* Global Filter Panel */
.filter-panel {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.filter-select, .filter-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background-color: var(--bg-app);
    cursor: pointer;
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
    background-color: var(--bg-surface);
}

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

.btn-secondary {
    padding: 10px 18px;
    background-color: var(--bg-app);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

/* ----------------------------------------------------
   4. TABLES & CARD LAYOUTS (MOBILE-FIRST)
   ---------------------------------------------------- */
.leads-table-container {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.leads-table th {
    background-color: #F8FAFC;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.leads-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.leads-table tr:hover td {
    background-color: #FCFDFE;
}

/* Highlight Follow-Up Hari Ini */
.row-followup-today {
    border-left: 4px solid var(--warning);
}
.row-followup-today td {
    background-color: var(--warning-light) !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Suhu Lead Badges */
.badge.suhu-hot { background-color: var(--danger-light); color: var(--danger); }
.badge.suhu-warm { background-color: var(--warning-light); color: var(--warning); }
.badge.suhu-cold { background-color: var(--cold-light); color: var(--primary); }

/* Status Follow Up Badges */
.badge.status-new { background-color: #F1F5F9; color: var(--text-secondary); }
.badge.status-followup { background-color: var(--primary-light); color: var(--primary); }
.badge.status-negosiasi { background-color: #F2C94C; color: #7F5F00; }
.badge.status-dp { background-color: var(--warning-light); color: var(--warning); }
.badge.status-lunas { background-color: var(--success-light); color: var(--success); }
.badge.status-lost { background-color: #FFF0F0; color: var(--danger); }

/* WhatsApp click to chat button */
.wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: var(--success-light);
    color: var(--success);
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.wa-btn:hover {
    background-color: var(--success);
    color: #fff;
    transform: scale(1.1);
}

/* Mobile Card Layout (Visible on mobile, hidden on desktop) */
.mobile-cards-grid {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.lead-mobile-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
}

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

.lead-mobile-card.card-followup-today {
    border-left: 5px solid var(--warning);
    background-color: var(--warning-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-city {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.card-item {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.card-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination container */
.pagination-container {
    margin-top: 24px;
    background-color: var(--bg-surface);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

/* Pagination style overrides */
.pagination-container nav {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

/* ----------------------------------------------------
   5. DETAILED VIEW & TIMELINE KRONOLOGIS
   ---------------------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 30px;
    align-items: flex-start;
}

.profile-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    margin-bottom: 30px;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 30px;
}

.detail-info-item {
    display: flex;
    flex-direction: column;
}

.detail-info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Finance Card */
.finance-box {
    background: linear-gradient(135deg, #FFFDF9, #FFFBF0);
    border: 1px solid #FFE4A3;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 30px;
}

.finance-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.finance-item {
    display: flex;
    flex-direction: column;
}

.finance-val {
    font-size: 18px;
    font-weight: 800;
}

.finance-val.tagihan { color: var(--text-primary); }
.finance-val.dp { color: var(--success); }
.finance-val.pelunasan { color: var(--danger); }

/* Chronological Timeline */
.timeline-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 30px;
}

.timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 20px;
}

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

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

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

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: var(--text-muted);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-item.active .timeline-dot {
    background-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.timeline-date {
    color: var(--text-secondary);
    font-weight: 600;
}

.timeline-type {
    font-weight: 700;
    color: var(--primary);
}

.timeline-status {
    margin-top: 4px;
    margin-bottom: 8px;
}

.timeline-content {
    font-size: 13px;
    color: var(--text-primary);
    background-color: var(--bg-app);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ----------------------------------------------------
   6. PREMIUM CUSTOM MODALS & POPUPS
   ---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow-y: auto; /* Allow overlay to scroll if modal is taller than screen */
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 580px;
    margin: auto; /* Centers in flex, but allows scrolling if taller */
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    background-color: var(--bg-app);
    padding: 20px 24px;
    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);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
}

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

.modal-body {
    padding: 24px;
    /* max-height removed so the whole modal can scroll within the overlay */
}

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

.modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Financial summary card inside modal */
.modal-finance-preview {
    background-color: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(32, 138, 236, 0.2);
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    text-align: center;
}

.finance-preview-item {
    flex: 1;
}

.finance-preview-item:not(:last-child) {
    border-right: 1px solid rgba(32, 138, 236, 0.15);
}

.finance-preview-val {
    font-weight: 800;
    font-size: 14px;
    color: var(--primary);
    margin-top: 4px;
}

/* Form Helper Classes */
.form-helper {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Notification Popups */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
}

.toast.error {
    border-left-color: var(--danger);
}

/* UTILITY BUTTON STYLES */
.btn-primary-outline {
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.btn-danger {
    background-color: var(--danger);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-danger:hover {
    background-color: #d13d3d;
}

/* ----------------------------------------------------
   7. KEYFRAME ANIMATIONS & RESPONSIVE BREAKPOINTS
   ---------------------------------------------------- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ----------------------------------------------------
   8. RESPONSIVE QUERIES
   ---------------------------------------------------- */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Layout Adjustments */
    .sidebar {
        left: -260px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .topbar {
        padding: 0 20px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .content-container {
        padding: 20px;
    }
    
    /* Stats Grid to 1 Column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
    }

    /* Filters to Vertical stack */
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-actions {
        width: 100%;
        margin-top: 5px;
    }
    
    .filter-actions button {
        flex: 1;
    }

    /* Responsive Lead View: Hide table, show Mobile Cards */
    .leads-table-container {
        display: none;
    }
    
    .mobile-cards-grid {
        display: flex;
    }
    
    /* Overlay alignment for scrolling */
    .modal-overlay {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* Modal full width but height auto to wrap the form completely */
    .modal-container {
        max-width: 100%;
        height: auto;
        min-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-body {
        padding: 20px 15px;
        overflow: visible; /* Let the container wrap it, overlay will scroll */
    }
    
    .modal-grid-2 {
        grid-template-columns: 1fr;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .finance-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
