html {
    font-size: 13px;
}

:root {
    --primary-color: #059669; /* Emerald Green */
    --primary-hover: #047857;
    --secondary-color: #111827; /* Dark Slate */
    --bg-color: #f8fafc;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-active: #ffffff;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.25);
    --radius: 0.375rem;
    --btn-radius: 0.325rem;
    
    /* Layout Constants */
    --sidebar-width: 200px;
    --topbar-height: 48px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Outfit', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Premium Utility Classes */
.premium-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

.hidden {
    display: none !important;
}

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

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Login Page Styling */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #065f46, #111827);
    padding: 1.5rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    animation: entrance 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes entrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 1.25rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 8px 16px -4px rgba(5, 150, 105, 0.4);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    color: var(--secondary-color);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    opacity: 0.8;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

/* Password Toggle Indicator */
.pw-toggle {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.1s;
    background: none;
    border: none;
    padding: 0.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.pw-toggle:hover {
    color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--btn-radius);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    box-shadow: 0 4px 12px -2px rgba(5, 150, 105, 0.3);
}

.login-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -2px rgba(5, 150, 105, 0.4);
}

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

/* Dashboard Layout Styling */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-color);
}

/* Sidebar Styling (High Contrast Premium) */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.nav-group-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
    margin: 1rem 0 0.4rem 0.25rem;
    opacity: 0.8;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.sidebar-logo i {
    color: var(--primary-color);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.25rem;
    /* Show a thin scrollbar so users know it's scrollable */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nav-menu::-webkit-scrollbar {
    width: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.nav-item {
    margin-bottom: 0.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-footer {
    flex-shrink: 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 0.5rem;
}

.nav-link i {
    font-size: 1rem;
    width: 18px;
    margin-right: 10px;
    opacity: 0.7;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-link:hover i {
    opacity: 1;
    transform: translateX(2px);
}

.nav-link.active {
    background: #10b981;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.25);
    font-weight: 700;
}

.nav-sub-bar {
    max-height: 0;
    overflow: hidden;
    padding-left: 3rem;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.open .nav-sub-bar {
    max-height: 200px;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.nav-sub-item {
    padding: 0.625rem 0;
    cursor: pointer;
    color: var(--sidebar-text);
    transition: color 0.2s;
    font-weight: 400;
}

.nav-sub-item:hover {
    color: white;
}

/* Main Content area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Topbar Styling */
.topbar {
    height: var(--topbar-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    width: 300px;
}

.search-bar input {
    background: transparent;
    border: none;
    margin-left: 0.5rem;
    width: 100%;
    outline: none;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Body Content */
.content-body {
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    flex-grow: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.charts-section {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px dashed #e2e8f0;
}

/* Lead Management Components */
.assignment-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-assign {
    padding: 0.4rem 0.8rem;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-assign:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.language-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.8rem;
}

.badge-state {
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* CRM Pipeline Status Badges */
.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: capitalize;
}

.status-new {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.status-assigned {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.status-contacted {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fef3c7;
}

/* Orange */
.status-followup {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fef08a;
}

/* Yellow */
.status-interested {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

/* Blue */
.status-not_interested {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-converted {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

/* Green */
.status-lost {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

/* Red */
.status-negotiation {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #fae8ff;
}

.status-advance_paid {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}


/* Lead Score Badges */
.score-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-hot {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #ffe4e6;
}

.score-warm {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.score-cold {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* ============================================================ */
/* ⚡ KANBAN PIPELINE UI STYLES */
/* ============================================================ */

.pipeline-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.pipeline-stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pipeline-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pipeline-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.pipeline-board {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    min-height: calc(100vh - 300px);
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

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

.pipeline-board::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.pipeline-column {
    flex: 0 0 300px;
    background: #f1f5f9;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.pipeline-column.drag-over {
    background: #e2e8f0;
    border: 1px dashed var(--primary-color);
    transform: scale(1.01);
}

.column-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #f1f5f9;
    border-radius: 1rem 1rem 0 0;
    z-index: 10;
}

.column-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    color: var(--primary-color);
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.cards-container {
    padding: 0.75rem;
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lead-card {
    background: white;
    padding: 1rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.lead-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

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

/* Premium Form Components */
.premium-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.form-control-premium {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #ffffff;
    color: #1e293b;
}

.form-control-premium:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0fdf4;
}

.lead-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: none;
}

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

.card-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.15rem;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-phone {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-staff {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    margin-top: 0.5rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.followup-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
}

.fi-overdue { background: #fee2e2; color: #dc2626; }
.fi-today { background: #fef9c3; color: #a16207; }
.fi-upcoming { background: #dcfce7; color: #16a34a; }

.quick-actions {
    display: flex;
    gap: 0.4rem;
}

.qa-btn {
    width: 28px;
    height: 28px;
    border-radius: 0.4rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.pipeline-filter-bar {
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-item label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-item select, .filter-item input {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    outline: none;
    background: #f8fafc;
}

.filter-item select:focus, .filter-item input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}


/* Lead Details Specific Styling */
.lead-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-display-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.info-item p {
    font-weight: 500;
    color: var(--text-main);
}

/* Timeline */
.timeline-list {
    position: relative;
    padding-left: 2.5rem;
    margin-left: 0.5rem;
    border-left: 2px solid #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

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

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 2.5rem;
    display: flex;
    justify-content: center;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    transform: translateX(-1px);
    z-index: 2;
}

.timeline-content {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
}

.timeline-date {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.timeline-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0.25rem 0;
    color: var(--text-main);
}

.timeline-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sidebar Cards */
.sidebar-info-card {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    padding: 1.5rem;
}

.sidebar-info-card.orange {
    background: #fff7ed;
    border-color: #ffedd5;
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background: #22c35e;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Edit Mode Helpers */
.edit-mode .view-item {
    display: none;
}

.edit-mode .edit-item {
    display: block !important;
}

.edit-item {
    display: none;
}

.detail-section-title {
    position: relative;
    padding-right: 3rem;
}

.edit-section-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.edit-section-btn:hover {
    background: var(--bg-color);
}

.edit-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
}

/* Global Search Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 400px;
    max-height: 400px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    overflow-y: auto;
    z-index: 2000;
    display: none;
    animation: searchFadeIn 0.2s ease-out;
}

@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-section-header {
    background: #f8fafc;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.1s;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-item:hover {
    background: #f1f5f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    flex-shrink: 0;
}

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

.result-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Order Conversion Modal */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.order-modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.order-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step {
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #94a3b8;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active {
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.step.completed {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.order-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.order-step-view {
    display: none;
}

.order-step-view.active {
    display: block;
    animation: slideInUp 0.4s ease;
}

.product-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.product-pick-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.product-pick-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.product-pick-card.selected {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 0 0 2px #10b981;
}

.payment-preview-box {
    width: 100%;
    height: 200px;
    border: 2px dashed #e2e8f0;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.payment-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
}


/* Packaging Page Specific Styles */
.p-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.p-badge {
    padding: 0.25rem 0.6rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.order-id {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: var(--primary-color);
}

/* Common Utilities */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Data Table System */
.table-container {
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.table-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.data-table th {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* Action Buttons */
.btn-action {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-action.primary {
    background: #eff6ff;
    color: var(--primary-color);
    border-color: #dbeafe;
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Modal Overlay System */

.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay .premium-card {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Action Icons in Tables */
.action-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-icon-btn:hover {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.action-icon-btn.fa-key:hover {
    background: #fffbeb;
    color: #d97706;
    border-color: #fbbf24;
}

.action-icon-btn.fa-trash:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* User Status Indicators */
.status-pill {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Lead Navigation Tabs - Premium Styling */
.lead-nav-container {
    display: flex;
    overflow-x: auto;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 2px solid #f1f5f9;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.lead-nav-container::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 0.85rem;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    font-size: 0.875rem;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
}

.nav-tab i {
    font-size: 1rem;
    opacity: 0.8;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: #ecfdf5;
    border-color: #bef264;
    transform: translateY(-1px);
}

.nav-tab.active {
    color: white !important;
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px -6px rgba(5, 150, 105, 0.4);
}

/* Unassigned Tab Urgency Styling */
.nav-tab[data-filter="unassigned"] {
    border-left: 4px solid #f87171;
}

.nav-tab[data-filter="unassigned"]:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Add Lead Button Styling */
.btn-add-lead {
    background: #059669;
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-add-lead:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.nav-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 24px;
    text-align: center;
}

.nav-tab.active .nav-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* =========================================================
   Decision Engine Modal & Step UI 
   ========================================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content.premium-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.step-ind {
    position: relative;
    padding-bottom: 0.5rem;
}

.step-ind.active {
    color: var(--primary-color);
}

.step-ind.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.wizard-step {
    animation: fadeInStep 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
    display: none !important;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dynamic-subform {
    animation: fadeInForm 0.3s ease-out;
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Form Controls - Global */
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-control-premium {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #1e293b;
    /* Deep slate/navy for best visibility */
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control-premium::placeholder {
    color: #64748b;
    /* Darker placeholder */
    opacity: 0.7;
}

.form-control-premium:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.15);
    color: #000000;
    /* Pure black on focus for extreme clarity */
    outline: none;
}

/* Premium Alert/Toast Notification System */
.alert-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.alert-premium {
    min-width: 320px;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 6px solid #cbd5e1;
    pointer-events: auto;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.alert-premium.success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.alert-premium.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.alert-premium.info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.alert-icon {
    font-size: 1.25rem;
}

.alert-premium.success .alert-icon {
    color: #10b981;
}

.alert-premium.error .alert-icon {
    color: #ef4444;
}

.alert-premium.info .alert-icon {
    color: #3b82f6;
}

.alert-content {
    flex-grow: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.1rem;
}

.alert-message {
    font-size: 0.8rem;
    color: #64748b;
}

.alert-close {
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.alert-close:hover {
    color: #475569;
}

/* Call Status Pills */
.status-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.status-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-pill:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.status-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* ============================================================ */
/* ✨ PREMIUM UI ENHANCEMENTS (Settings & Invoice) */
/* ============================================================ */

.premium-card-v2 {
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.02), 0 4px 6px -2px rgba(0, 0, 0, 0.01);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card-v2:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.glass-surface {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.section-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-premium-group {
    margin-bottom: 1.5rem;
}

.input-premium-group label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 0.5rem;
}

.input-premium-group input[type="text"],
.input-premium-group input[type="number"],
.input-premium-group select {
    width: 100%;
    padding: 0.85rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-premium-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.checkbox-premium-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-premium-wrapper:hover {
    background: #e2e8f0;
}

.checkbox-premium-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Invoice Specific Utilities */
.invoice-v2-container {
    background: #ffffff;
    padding: 4rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 2rem auto;
}

.invoice-item-row:nth-child(even) {
    background: #f8fafc;
}

.premium-btn-v2 {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.premium-btn-v2:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -1px rgba(16, 185, 129, 0.3);
}

/* ============================================================ */
/* 📅 SCHEDULES & FOLLOW-UPS UI STYLES */
/* ============================================================ */

.stat-card-alt {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.icon-today { background: #f0fdfa; color: #0d9488; }
.icon-overdue { background: #fef2f2; color: #ef4444; }
.icon-upcoming { background: #eff6ff; color: #2563eb; }
.icon-completed { background: #f0fdf4; color: #10b981; }

.filter-container {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    gap: 2rem;
}

.filter-group {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.filter-item {
    flex: 1;
    min-width: 180px;
}

.search-filter-wrapper {
    width: 320px;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-input-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-input-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

/* Premium Tabs */
.premium-tabs-wrapper {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.premium-tabs {
    display: flex;
    gap: 0.5rem;
}

.p-tab {
    padding: 0.875rem 1.5rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.p-tab:hover {
    color: var(--text-main);
}

.p-tab.active {
    color: var(--primary-color);
}

.p-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.tab-overdue.active::after {
    background: #ef4444;
}

.tab-count {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
    font-weight: 800;
}

/* Table Enhancements */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.premium-table th {
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    background: #ffffff;
}

.premium-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.premium-table tr:hover {
    background-color: #f8fafc;
}

.premium-table tr.row-overdue {
    background-color: #fff1f2 !important;
}

.time-cell {
    font-weight: 700;
    min-width: 120px;
}

.time-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cust-cell {
    min-width: 180px;
}

.cust-name {
    font-weight: 700;
    color: var(--text-main);
}

.cust-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-cell {
    min-width: 130px;
}

.priority-cell {
    min-width: 110px;
}

.staff-tag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 150px;
}

.staff-avatar {
    width: 28px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
}

.last-note {
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 350px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.action-btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon-premium {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.btn-icon-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-icon-premium.view:hover { color: var(--primary-color); border-color: var(--primary-color); }
.btn-icon-premium.call:hover { color: #2563eb; border-color: #2563eb; }
.btn-icon-premium.check:hover { color: #10b981; border-color: #10b981; }

/* Side Drawer Styling */
.side-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-drawer:hover { color: #ef4444; }

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

.drawer-section {
    margin-bottom: 2.5rem;
}

.drawer-cust-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.large-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 1rem;
}

.info-item label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.info-item p {
    font-weight: 600;
    font-size: 0.95rem;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* WhatsApp Card in Drawer */
.wa-card {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 1rem;
    padding: 1.25rem;
}

.wa-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #15803d;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.wa-body p {
    font-size: 0.85rem;
    color: #166534;
    margin-bottom: 1rem;
}

.btn-wa-toggle {
    width: 100%;
    padding: 0.6rem;
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    color: #15803d;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-wa-toggle:hover { background: #dcfce7; }

/* Notes Timeline */
.notes-timeline {
    border-left: 2px solid #e2e8f0;
    padding-left: 1.5rem;
    position: relative;
    margin-top: 1rem;
}

.note-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.note-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 5px;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
}

.note-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.note-text {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.25rem 0;
}

.note-author {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-style: italic;
}
/* ============================================================ */
/* ?? PREMIUM NOTIFICATION SYSTEM */
/* ============================================================ */
/* Alert Overlay & Toast Container */
.alert-overlay {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.alert-toast {
    min-width: 350px;
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: alertSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(226, 232, 240, 0.8);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.alert-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

.alert-success::before { background: #10b981; }
.alert-error::before { background: #ef4444; }
.alert-info::before { background: #3b82f6; }

.alert-toast.hiding {
    animation: alertSlideOut 0.3s ease-in forwards;
}

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

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

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success .alert-icon {
    background: #ecfdf5;
    color: #10b981;
}

.alert-error .alert-icon {
    background: #fef2f2;
    color: #ef4444;
}

.alert-info .alert-icon {
    background: #eff6ff;
    color: #3b82f6;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.4;
}

.alert-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.alert-close:hover {
    color: #1e293b;
}

/* ============================================================ */
/* ⚡ MODAL SYSTEM UI STYLES */
/* ============================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.modal.active {
    display: flex !important;
}

.modal-content.premium-card {
    width: 100%;
    max-width: 650px;
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: translateY(0);
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.modal-open {
    overflow: hidden !important;
    padding-right: 6px; /* Compensate for scrollbar to prevent vibrating/jitter */
}

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

@keyframes modalSlide {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
