/* ==========================================================================
   LEADCAPTURE ENTERPRISE SAAS DESIGN SYSTEM (2026 STANDARD)
   Supports Light & Dark Theme, Left Sidebar Navigation, and High-Density Data
   ========================================================================== */

:root, [data-theme="dark"] {
    --bg-canvas: #090d16;
    --bg-surface: #0f1624;
    --bg-sidebar: #0b111e;
    --bg-card: #131c2d;
    --bg-card-hover: #18243a;
    --bg-input: #0b111e;
    --bg-dropdown: #131c2d;
    --border-color: #1e2c44;
    --border-subtle: #182337;
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.2);

    --accent-emerald: #10b981;
    --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
    --accent-emerald-glow: rgba(16, 185, 129, 0.25);

    --accent-amber: #f59e0b;
    --accent-amber-subtle: rgba(245, 158, 11, 0.12);

    --accent-rose: #f43f5e;
    --accent-rose-subtle: rgba(244, 63, 94, 0.12);

    --accent-indigo: #6366f1;
    --accent-indigo-subtle: rgba(99, 102, 241, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 76px;
    --header-height: 64px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

[data-theme="light"] {
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --bg-dropdown: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;
    --border-focus: #2563eb;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --accent-emerald: #059669;
    --accent-emerald-subtle: rgba(5, 150, 105, 0.1);
    --accent-emerald-glow: rgba(5, 150, 105, 0.2);

    --accent-amber: #d97706;
    --accent-amber-subtle: rgba(217, 119, 6, 0.1);

    --accent-rose: #e11d48;
    --accent-rose-subtle: rgba(225, 29, 72, 0.1);

    --accent-indigo: #4f46e5;
    --accent-indigo-subtle: rgba(79, 70, 229, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
}

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

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ================= APP LAYOUT SHELL ================= */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

/* ================= 1. LEFT SIDEBAR NAVIGATION ================= */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-symbol {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.brand-text-wrapper {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--accent-emerald-subtle);
    color: var(--accent-emerald);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-role-indicator {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.role-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-label {
    font-size: 0.675rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.75rem 0.35rem;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
    width: 100%;
}

.nav-item-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item-btn.active {
    background-color: var(--accent-emerald-subtle);
    color: var(--accent-emerald);
    font-weight: 700;
}

.nav-item-btn.active svg {
    color: var(--accent-emerald);
}

.nav-item-icon {
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-label {
    transition: opacity 0.2s ease;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-collapse-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapse-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Collapsed Sidebar Mode */
.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .brand-text-wrapper,
.app-sidebar.collapsed .sidebar-role-indicator .role-text,
.app-sidebar.collapsed .nav-item-label,
.app-sidebar.collapsed .nav-section-label,
.app-sidebar.collapsed .collapse-label {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.app-sidebar.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.app-sidebar.collapsed .nav-item-btn {
    justify-content: center;
    padding: 0.75rem 0;
}

/* ================= 2. MAIN WRAPPER & TOP HEADER ================= */
.app-main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar.collapsed ~ .app-main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
}

.page-title-box {
    line-height: 1.25;
}

.breadcrumb {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 600;
}

.header-page-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.system-health-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-xl);
    background-color: var(--accent-emerald-subtle);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
    animation: liveGlow 2s infinite;
}

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

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.header-icon-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Theme Icon switching */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
}

/* User profile trigger */
.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-profile-trigger:hover {
    background-color: var(--bg-card-hover);
}

.user-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-indigo));
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-text {
    line-height: 1.15;
    text-align: left;
}

.user-name-display {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role-label {
    font-size: 0.625rem;
    font-weight: 800;
    color: var(--accent-emerald);
    letter-spacing: 0.05em;
}

/* ================= DROPDOWN MENUS ================= */
.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 200;
    display: none;
    flex-direction: column;
    padding: 0.45rem;
    animation: dropFade 0.15s ease;
}

.dropdown-menu.show {
    display: flex;
}

@keyframes dropFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-menu-header {
    padding: 0.65rem 0.75rem;
}

.profile-full-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-email-addr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.35rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--accent-rose);
}

.dropdown-item.danger:hover {
    background-color: var(--accent-rose-subtle);
}

.notification-menu {
    min-width: 320px;
}

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

.dropdown-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.badge-count {
    font-size: 0.675rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--accent-emerald-subtle);
    color: var(--accent-emerald);
}

.notification-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
}

.empty-notif {
    padding: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================= 3. MAIN CONTENT BODY ================= */
.app-content-body {
    flex: 1;
    padding: 1.75rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* ================= KPI CARDS ================= */
.kpi-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-tile {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.kpi-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-md);
}

.kpi-tile.featured {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, var(--accent-emerald-subtle), var(--bg-card));
}

.kpi-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-tile-title {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.kpi-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.kpi-tile.featured .kpi-tile-icon {
    color: var(--accent-emerald);
}

.kpi-tile-metric {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.kpi-tile-metric.emerald {
    color: var(--accent-emerald);
}

.kpi-tile-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ================= SECTION HEADERS & ACTION CONTROLS ================= */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-title-box {
    line-height: 1.3;
}

.module-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.module-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.module-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: var(--accent-emerald);
    color: #ffffff;
    font-weight: 700;
}

.btn-primary:hover {
    background-color: #059669;
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

.btn-outline {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

.btn-danger {
    background-color: var(--accent-rose-subtle);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
}

.btn-danger:hover {
    background-color: var(--accent-rose);
    color: white;
}

.btn-success {
    background-color: var(--accent-emerald-subtle);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.btn-success:hover {
    background-color: var(--accent-emerald);
    color: white;
}

.btn-block {
    width: 100%;
}

/* ================= 2026 ANALYTICS CHART CARD ================= */
.chart-panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-color-box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-color: var(--accent-emerald);
}

.bar-chart-canvas-wrapper {
    height: 180px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.bar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.bar-fill {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(180deg, var(--accent-emerald), #059669);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    min-height: 4px;
}

.bar-fill:hover {
    background: #34d399;
}

.bar-tooltip {
    position: absolute;
    top: -24px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}

.bar-axis-label {
    font-size: 0.675rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ================= WHATSAPP ACCOUNT MANAGEMENT MODULE ================= */
.account-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.account-management-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-management-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-md);
}

.account-management-card.status-active {
    border-color: rgba(16, 185, 129, 0.4);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.account-card-identity {
    line-height: 1.3;
}

.account-display-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.account-rename-icon {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
}

.account-rename-icon:hover {
    color: var(--primary);
}

.account-phone-line {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pill.connected {
    background-color: var(--accent-emerald-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.status-pill.connecting {
    background-color: var(--accent-amber-subtle);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
}

.status-pill.qr_ready {
    background-color: var(--accent-indigo-subtle);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-indigo);
}

.status-pill.disconnected {
    background-color: rgba(100, 116, 139, 0.12);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: var(--text-muted);
}

.account-card-metrics {
    display: flex;
    gap: 1.25rem;
    background-color: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.metric-column {
    display: flex;
    flex-direction: column;
}

.metric-column-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-column-value {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.account-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ================= ENTERPRISE DATA TABLES ================= */
.data-panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table-toolbar {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-field-container {
    position: relative;
}

.search-icon-inside {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.table-search-input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem 0.45rem 2.25rem;
    font-family: inherit;
    font-size: 0.825rem;
    color: var(--text-primary);
    width: 260px;
    outline: none;
    transition: border-color 0.15s ease;
}

.table-search-input:focus {
    border-color: var(--border-focus);
}

.filter-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    font-family: inherit;
    font-size: 0.825rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.table-responsive-box {
    overflow-x: auto;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.saas-table th {
    background-color: var(--bg-surface);
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.725rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.saas-table td {
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.saas-table tr:hover td {
    background-color: var(--bg-card-hover);
}

.lead-phone-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-emerald);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.copy-phone-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s ease;
}

.copy-phone-btn:hover {
    color: var(--primary);
}

.table-timestamp {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    color: var(--text-secondary);
}

/* ================= MODALS & AUTH CARDS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.25rem;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-md {
    max-width: 440px;
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Production Clean Login Card */
.auth-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    padding: 2.25rem;
}

.auth-brand-top {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo-badge {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 4px 14px var(--accent-emerald-glow);
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.form-label {
    display: block;
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-link {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-link:hover {
    text-decoration: underline;
}

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

.input-leading-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem 0.65rem 2.45rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.form-checkbox-row {
    margin-bottom: 1.25rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-error-banner {
    background-color: var(--accent-rose-subtle);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.auth-footer-note {
    text-align: center;
    font-size: 0.725rem;
    color: var(--text-dim);
    margin-top: 1.5rem;
}

/* ================= QR CODE SCANNER MODAL ================= */
.qr-presentation-box {
    background-color: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    min-width: 240px;
    min-height: 240px;
    position: relative;
}

.qr-canvas-img {
    display: block;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
}

.qr-loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 220px;
}

.qr-status-msg {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 0.85rem;
}

.qr-pairing-steps {
    text-align: left;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pairing-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.step-num {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background-color: var(--accent-emerald-subtle);
    color: var(--accent-emerald);
    font-weight: 700;
    font-size: 0.725rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pairing-assurance-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background-color: var(--accent-emerald-subtle);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-emerald);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.775rem;
    text-align: left;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    z-index: 2000;
}

.toast-item {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.825rem;
}

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

.toast-item.success {
    border-left: 4px solid var(--accent-emerald);
}

.toast-item.info {
    border-left: 4px solid var(--primary);
}

/* ================= SKELETON LOADERS ================= */
.skeleton-shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-emerald);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= RESPONSIVE ADAPTATIONS ================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        left: -280px;
        width: 260px !important;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.mobile-open {
        left: 0;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 95;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .app-main-wrapper {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-page-title {
        font-size: 1rem;
    }

    .breadcrumb {
        display: none;
    }

    .system-health-pill .health-label {
        display: none;
    }

    .app-content-body {
        padding: 1rem;
    }

    .kpi-grid-container {
        grid-template-columns: 1fr;
    }

    .account-cards-grid {
        grid-template-columns: 1fr;
    }

    .table-search-input {
        width: 100%;
    }
}

/* ==========================================================================
   ENTERPRISE CRM & PIPELINE STYLES (2026 Design System)
   ========================================================================== */

/* Priority Badges */
.priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: default;
    user-select: none;
}

.priority-pill.hot {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-pill.warm {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-pill.cold {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.priority-pill.none {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Dynamic Pipeline Status Pills */
.crm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.crm-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Inline Table Status Selector */
.inline-status-select {
    padding: 3px 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.inline-status-select:focus {
    border-color: var(--primary);
}

/* Inline Table Priority Selector */
.inline-priority-select {
    padding: 3px 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
}

/* Tag Pills */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.tag-badge .tag-remove-x {
    cursor: pointer;
    font-weight: 700;
    margin-left: 2px;
}

.tag-badge .tag-remove-x:hover {
    color: #ef4444;
}

/* View Mode Switcher (Table vs Kanban vs Trash) */
.view-mode-tabs {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-mode-btn:hover {
    color: var(--text-primary);
}

.view-mode-btn.active {
    background: var(--bg-hover);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* CRM Lead Details Slide-Out Drawer */
.drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 199;
}

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

.crm-drawer {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-drawer.open {
    right: 0;
}

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

.drawer-header-info {
    flex: 1;
}

.drawer-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.drawer-phone {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.drawer-name-input {
    width: 90%;
    background: transparent;
    border: 1px dashed transparent;
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    outline: none;
    transition: all 0.15s ease;
}

.drawer-name-input:hover {
    border-color: var(--border-color);
}

.drawer-name-input:focus {
    border-color: var(--primary);
    background: var(--bg-input);
    color: var(--text-primary);
}

.drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

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

.drawer-quick-bar {
    display: flex;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.quick-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.drawer-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.drawer-select:focus {
    border-color: var(--primary);
}

.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 0 1rem;
    gap: 4px;
    overflow-x: auto;
}

.drawer-tab-btn {
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.drawer-tab-btn:hover {
    color: var(--text-primary);
}

.drawer-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.drawer-tab-btn .tab-badge {
    padding: 1px 6px;
    border-radius: 9999px;
    background: var(--bg-hover);
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.drawer-tab-pane {
    display: none;
}

.drawer-tab-pane.active {
    display: block;
}

.drawer-section {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.drawer-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.drawer-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.detail-val {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-val.emerald {
    color: var(--accent-emerald);
    font-weight: 600;
}

/* Notes Feed */
.add-note-box {
    margin-bottom: 1.25rem;
}

.note-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    outline: none;
}

.note-input:focus {
    border-color: var(--primary);
}

.add-note-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.notes-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    position: relative;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.note-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.note-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.note-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px;
}

.note-delete-btn:hover {
    color: #ef4444;
}

/* Follow-ups Feed */
.pane-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pane-subheading {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.followups-feed, .purchases-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.followup-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.followup-card.completed {
    opacity: 0.6;
}

.followup-check {
    margin-top: 2px;
    cursor: pointer;
}

.followup-details {
    flex: 1;
}

.followup-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.followup-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--accent-amber);
    margin-bottom: 4px;
}

.followup-notes {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Purchases Feed */
.purchase-card {
    background: var(--bg-body);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 3px solid var(--accent-emerald);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}

.purchase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.purchase-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.purchase-product {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
}

.timeline-content {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

.timeline-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Floating Bulk Actions Toolbar */
.bulk-floating-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 150;
    animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.bulk-count-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bulk-count-num {
    background: var(--primary);
    color: #fff;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.bulk-action-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.bulk-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-select {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.78rem;
    color: var(--text-primary);
    outline: none;
}

/* Kanban Pipeline Board */
.kanban-board-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0.5rem 0 1.5rem;
    min-height: 520px;
}

.kanban-column {
    flex: 0 0 280px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-color);
}

.kanban-stage-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kanban-stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.kanban-count-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kanban-cards-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

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

.kanban-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.kanban-card-phone {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kanban-card-name {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
    margin-top: 6px;
}

/* Pipeline Status Manager Modal List */
.pipeline-stages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
    max-height: 380px;
    overflow-y: auto;
}

.pipeline-stage-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.add-status-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker-input {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}


/* ==========================================================================
   2026 ENTERPRISE COMPREHENSIVE RESPONSIVE SYSTEM
   ========================================================================== */

/* Zero Horizontal Page Overflow Base */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Background Scroll Locking */
body.mobile-nav-open,
body.drawer-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Desktop vs Mobile Lead Presentation Defaults */
.desktop-tablet-view {
    display: block;
}

.mobile-cards-view {
    display: none;
}

.mobile-sidebar-close-btn {
    display: none;
}

.kanban-mobile-stage-bar {
    display: none;
}

/* Dedicated Mobile Lead Card Component */
.mobile-lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    position: relative;
    border-left: 4px solid var(--border-color);
}

.mobile-lead-card:active {
    transform: scale(0.99);
}

.mobile-lead-card.hot {
    border-left-color: #ef4444;
}

.mobile-lead-card.warm {
    border-left-color: #f59e0b;
}

.mobile-lead-card.cold {
    border-left-color: #06b6d4;
}

.mobile-lead-card.none {
    border-left-color: var(--border-color);
}

.mobile-lead-card.selected {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.mobile-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.mobile-card-phone {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.mobile-card-name-row {
    margin-bottom: 0.55rem;
}

.mobile-card-name-input {
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
}

.mobile-card-name-input:focus {
    border-color: var(--primary);
}

.mobile-card-stage-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.55rem;
}

.mobile-field-label {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mobile-stage-select {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.mobile-card-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.65rem;
}

.mobile-card-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 8px 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 0.75rem;
    font-size: 0.775rem;
}

.mobile-meta-key {
    color: var(--text-muted);
    margin-right: 4px;
}

.mobile-meta-val {
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-card-actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-card-actions-row .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    min-height: 36px;
    font-size: 0.78rem;
    padding: 6px 10px;
}

/* Responsive Breakpoints System */

/* ==========================================================================
   TABLET & MOBILE (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .kpi-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .account-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   SMARTPHONE & SMALL TABLET (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Toggle Mobile Lead Experience */
    .desktop-tablet-view {
        display: none !important;
    }

    .mobile-cards-view {
        display: flex !important;
        flex-direction: column;
        gap: 0.85rem;
    }

    /* Mobile Sidebar & Header */
    .mobile-sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: var(--radius-sm);
        background: var(--bg-hover);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        font-size: 1rem;
        cursor: pointer;
        margin-left: auto;
    }

    .app-sidebar {
        width: 280px !important;
        max-width: 82vw !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        transform: translateX(-100%);
        left: 0 !important;
        z-index: 1000;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .nav-item-btn {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    /* Top Header Clamping */
    .app-top-header {
        padding: 0 0.85rem;
    }

    .header-page-title {
        font-size: 0.95rem;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-menu,
    .notification-menu {
        max-width: calc(100vw - 20px) !important;
        right: 0 !important;
        left: auto !important;
        width: 300px;
    }

    /* KPI Grid & Content */
    .kpi-grid-container {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .account-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .app-content-body {
        padding: 0.85rem;
    }

    /* Module Header Responsive Wrap */
    .module-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.85rem;
    }

    .module-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .module-actions .btn,
    .module-actions .view-mode-tabs {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    /* Mobile Slide-Out Lead Details Drawer */
    .crm-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
        right: -100vw !important;
        border-left: none;
    }

    .crm-drawer.open {
        right: 0 !important;
    }

    .crm-drawer-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .crm-drawer-tabs::-webkit-scrollbar {
        display: none;
    }

    .crm-drawer-tab-btn {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .crm-details-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem;
    }

    /* Mobile Kanban Pipeline Board */
    .kanban-mobile-stage-bar {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }

    .kanban-mobile-stage-bar::-webkit-scrollbar {
        display: none;
    }

    .kanban-stage-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
    }

    .kanban-stage-pill:active {
        background: var(--bg-hover);
    }

    .kanban-stage-count {
        background: var(--bg-body);
        border-radius: 9999px;
        padding: 1px 7px;
        font-size: 0.7rem;
        color: var(--text-muted);
    }

    .kanban-board-container {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 1rem;
    }

    .kanban-column {
        flex: 0 0 85vw !important;
        scroll-snap-align: center;
        max-height: 70vh;
    }

    /* Mobile Floating Bulk Actions Toolbar */
    .bulk-actions-toolbar {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        bottom: 12px !important;
        transform: translateY(0) !important;
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 12px;
        gap: 6px;
        border-radius: var(--radius-md);
    }

    .bulk-actions-toolbar .bulk-select {
        flex: 1;
        min-width: 120px;
    }

    /* Responsive QR Code Modal */
    .saas-modal-card {
        width: 94vw !important;
        max-width: 94vw !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 1.25rem !important;
    }

    .qr-presentation-box {
        min-width: auto;
        min-height: auto;
        padding: 0.75rem;
        max-width: 230px;
    }

    .qr-canvas-img {
        max-width: 200px;
    }
}

/* ==========================================================================
   SMALL MOBILE PHONES (<= 480px, e.g. iPhone SE, Galaxy A)
   ========================================================================== */
@media (max-width: 480px) {
    .app-top-header {
        height: 52px;
    }

    .header-page-title {
        font-size: 0.88rem;
        max-width: 110px;
    }

    .module-title {
        font-size: 1.15rem;
    }

    .module-subtitle {
        font-size: 0.78rem;
    }

    .mobile-card-actions-row {
        flex-wrap: wrap;
    }

    .mobile-card-actions-row .btn {
        flex: 1 1 40%;
    }

    .kanban-column {
        flex: 0 0 88vw !important;
    }

    .toast-item {
        min-width: 260px;
        max-width: calc(100vw - 32px);
    }
}
