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

:root {
    /* Clean, minimal palette - matches marketing site */
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-border: #e5e5e5;
    --color-border-subtle: #f5f5f5;

    /* Text colors - high contrast (WCAG AA compliant) */
    --color-text-primary: #171717;
    --color-text-secondary: #525252;
    --color-text-tertiary: #737373;

    /* Brand color - single accent (dark) */
    --color-brand: #171717;
    --color-brand-soft: #f5f5f5;
    --color-accent: #171717;
    --color-accent-soft: #f5f5f5;

    /* Status colors - clean */
    --color-success: #22c55e;
    --color-success-soft: #dcfce7;
    --color-warning: #f59e0b;
    --color-warning-soft: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-soft: #fee2e2;
    --color-neutral: #737373;
    --color-neutral-soft: #f5f5f5;

    /* Shadows - minimal */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);

    /* Radius - slightly smaller for cleaner look */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Dark mode */
[data-theme="dark"] {
    --color-bg: #0a0a0a;
    --color-surface: #171717;
    --color-border: #262626;
    --color-border-subtle: #1f1f1f;

    --color-text-primary: #fafafa;
    --color-text-secondary: #a3a3a3;
    --color-text-tertiary: #8a8a8a;

    --color-brand: #fafafa;
    --color-brand-soft: #262626;
    --color-accent: #fafafa;
    --color-accent-soft: #262626;

    --color-success-soft: #14532d;
    --color-warning-soft: #713f12;
    --color-danger-soft: #7f1d1d;
    --color-neutral-soft: #262626;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* Dark mode overrides for inline styles */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--color-text-tertiary) !important;
}
[data-theme="dark"] .auth-container {
    background: var(--color-surface);
}
[data-theme="dark"] .modal-content {
    background: var(--color-surface);
}
[data-theme="dark"] .detail-section {
    background: var(--color-bg);
    border-color: var(--color-border);
}
[data-theme="dark"] .settings-btn,
[data-theme="dark"] .notification-btn {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
[data-theme="dark"] .filter-tab.active {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border-color: var(--color-text-tertiary);
}
/* Dark mode: Job action buttons */
[data-theme="dark"] .job-action-btn.call {
    background: #14532d;
    color: #86efac;
}
[data-theme="dark"] .job-action-btn.call:hover {
    background: #166534;
}
[data-theme="dark"] .job-action-btn.text {
    background: #1e3a5f;
    color: #93c5fd;
}
[data-theme="dark"] .job-action-btn.text:hover {
    background: #1e40af;
}
[data-theme="dark"] .job-action-btn.complete {
    background: #fafafa;
    color: #171717;
}
/* Dark mode: Followup tip in customer cards */
[data-theme="dark"] .followup-tip {
    background: #422006;
    color: #fcd34d;
    border-left-color: #f59e0b;
}
[data-theme="dark"] .followup-tip.scheduled {
    background: #14532d;
    color: #86efac;
    border-left-color: #22c55e;
}
/* Dark mode: Auto-response text */
[data-theme="dark"] .suggested-response {
    color: #86efac;
}
/* Dark mode: Lead score pills */
[data-theme="dark"] .lead-score-pill.high {
    background: #14532d;
    color: #86efac;
}
[data-theme="dark"] .lead-score-pill.medium {
    background: #422006;
    color: #fcd34d;
}
/* Dark mode: Detail action buttons (voicemail/customer detail views) */
[data-theme="dark"] .detail-action-btn.text {
    background: #fafafa;
    color: #171717;
}
/* Dark mode: Status button archive state */
[data-theme="dark"] .status-btn.archive {
    background: #262626;
    color: #a3a3a3;
}
[data-theme="dark"] .status-btn.archive.selected,
[data-theme="dark"] .status-btn.archive:hover {
    border-color: #525252;
}
/* Dark mode: Calendar view toggle buttons (Today/Week/Month) */
[data-theme="dark"] .view-toggle-btn.active {
    background: #fafafa;
    color: #171717;
}
/* Dark mode: Selected calendar day */
[data-theme="dark"] .calendar-day.selected {
    background: #fafafa;
    color: #171717;
}
/* Dark mode: Book Appointment button */
[data-theme="dark"] .book-appointment-btn {
    background: #fafafa !important;
    color: #171717 !important;
}
/* Dark mode: Save notes button */
[data-theme="dark"] .save-notes-btn {
    background: #fafafa !important;
    color: #171717 !important;
}
/* Dark mode: Stat cards when selected */
[data-theme="dark"] .stat-card.selected {
    background: #fafafa;
    border-color: #fafafa;
}
[data-theme="dark"] .stat-card.selected .stat-number,
[data-theme="dark"] .stat-card.selected .stat-label {
    color: #171717;
}
/* Dark mode: Urgency badges */
[data-theme="dark"] .urgency-badge.high {
    background: #422006;
    color: #fcd34d;
}
[data-theme="dark"] .urgency-badge.medium {
    background: #422006;
    color: #fcd34d;
}
/* Dark mode: Lead badge */
[data-theme="dark"] .lead-badge {
    background: #14532d;
    color: #86efac;
}
/* Dark mode: Channel badges */
[data-theme="dark"] .channel-badge.voice-ai {
    background: #3b0764;
    color: #c4b5fd;
}
[data-theme="dark"] .channel-badge.voicemail {
    background: #422006;
    color: #fcd34d;
}
[data-theme="dark"] .channel-badge.booking {
    background: #083344;
    color: #67e8f9;
}
/* Dark mode: Insight cards with --color-text-primary background */
[data-theme="dark"] .insight-card[style*="background: var(--color-text-primary)"] {
    background: #fafafa !important;
}
[data-theme="dark"] .insight-card[style*="background: var(--color-text-primary)"] .insight-card-title,
[data-theme="dark"] .insight-card[style*="background: var(--color-text-primary)"] .insight-subtitle {
    color: rgba(23, 23, 23, 0.7) !important;
}
[data-theme="dark"] .insight-card[style*="background: var(--color-text-primary)"] .insight-big-number {
    color: #171717 !important;
}
/* Dark mode: Interaction type badges */
[data-theme="dark"] .interaction-type.voicemail {
    background: #422006;
    color: #fcd34d;
}
[data-theme="dark"] .interaction-type.voice-ai {
    background: #3b0764;
    color: #c4b5fd;
}
[data-theme="dark"] .interaction-type.sms {
    background: #1e3a8a;
    color: #93c5fd;
}
[data-theme="dark"] .interaction-type.chat {
    background: #3b0764;
    color: #c4b5fd;
}
/* Dark mode: Status badges */
[data-theme="dark"] .status-badge.pending {
    background: #422006;
    color: #fcd34d;
}
[data-theme="dark"] .status-badge.confirmed {
    background: #14532d;
    color: #86efac;
}
[data-theme="dark"] .status-badge.cancelled {
    background: #1f2937;
    color: #9ca3af;
}
/* Dark mode: Schedule status badges */
[data-theme="dark"] .schedule-status.pending {
    background: #422006;
    color: #fcd34d;
}
[data-theme="dark"] .schedule-status.scheduled {
    background: #14532d;
    color: #86efac;
}
[data-theme="dark"] .schedule-status.completed {
    background: #7f1d1d;
    color: #fca5a5;
}
/* Dark mode: Spam section */
[data-theme="dark"] #detail-spam-section {
    background: #7f1d1d !important;
    border-color: #991b1b !important;
}
[data-theme="dark"] #detail-spam-section .detail-label {
    color: #fca5a5 !important;
}
[data-theme="dark"] #detail-spam-reason {
    color: #fca5a5 !important;
}
/* Dark mode: Pending booking section */
[data-theme="dark"] #detail-pending-section {
    background: #3b0764 !important;
    border-color: #7c3aed !important;
}
[data-theme="dark"] #detail-pending-section .detail-label {
    color: #c4b5fd !important;
}
[data-theme="dark"] #detail-pending-info {
    color: #c4b5fd !important;
}
/* Dark mode: Settings descriptive text */
[data-theme="dark"] .settings-view span[style*="color: #6b7280"],
[data-theme="dark"] .settings-view p[style*="color: #6b7280"] {
    color: var(--color-text-tertiary) !important;
}
/* Dark mode: Booking URL input and copy button */
[data-theme="dark"] #booking-url-input {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-primary) !important;
}
[data-theme="dark"] #copy-booking-url-btn {
    background: var(--color-accent) !important;
    color: white !important;
}
/* Dark mode: Job action buttons text colors */
[data-theme="dark"] .job-action-btn.call {
    color: #86efac;
}
[data-theme="dark"] .job-action-btn.text {
    color: #93c5fd;
}

/* Payment buttons dark mode */
[data-theme="dark"] #job-request-payment-btn {
    background: #22c55e !important;
    color: white !important;
}
[data-theme="dark"] #job-resend-payment-btn {
    background: #3b82f6 !important;
    color: white !important;
}

/* Booking modal dark mode fixes */
[data-theme="dark"] .modal-btn.primary {
    background: #3b82f6;
    color: white;
}
[data-theme="dark"] .modal-btn.primary:hover {
    background: #2563eb;
}
[data-theme="dark"] .booking-day.selected {
    background: #3b82f6;
    color: white;
}
[data-theme="dark"] .booking-day.has-slots {
    background: rgba(34, 197, 94, 0.2);
}
[data-theme="dark"] .time-slot.selected {
    background: #3b82f6;
    color: white;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly interactive elements */
.touchable {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.1s ease, background-color 0.15s ease;
}
.touchable:active {
    transform: scale(0.97);
    opacity: 0.85;
}

/* Prevent text selection on interactive items during touch */
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Header - Clean white with subtle border */
.header {
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding: 20px 20px 24px;
    padding-top: max(20px, env(safe-area-inset-top));
    position: relative;
    border-bottom: 1px solid var(--color-border);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    height: 32px;
    width: auto;
}
.logo-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: var(--color-text-primary);
}
.greeting {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: var(--color-text-primary);
}
.business-name {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-top: 2px;
    font-weight: 500;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Compact logo bar for inner views */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    padding-top: max(6px, env(safe-area-inset-top));
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.compact-logo {
    cursor: pointer;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 4px 0;
}
.compact-logo svg {
    height: 22px;
    width: auto;
}
.compact-header .header-actions {
    gap: 6px;
}
.compact-header .settings-btn,
.compact-header .notification-btn {
    width: 34px;
    height: 34px;
}
.compact-header .settings-btn svg,
.compact-header .notification-btn svg {
    width: 16px;
    height: 16px;
}

.notification-wrapper {
    position: relative;
}
.settings-btn,
.notification-btn {
    width: 40px;
    height: 40px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.15s ease;
    position: relative;
}
.settings-btn:hover,
.notification-btn:hover {
    background: var(--color-border-subtle);
    border-color: var(--color-text-tertiary);
}
.settings-btn:active,
.notification-btn:active {
    background: var(--color-border);
}
.settings-btn svg,
.notification-btn svg { width: 20px; height: 20px; }

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.notification-badge.hidden { display: none; }

/* Notification Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Notification Dropdown - Fixed position */
.notification-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}
.notification-dropdown-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text-primary);
}
.mark-all-read-btn {
    font-size: 12px;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.mark-all-read-btn:hover {
    background: var(--color-accent-soft);
}
.notification-list {
    max-height: 360px;
    overflow-y: auto;
}
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--color-border-subtle);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background: var(--color-bg);
}
.notification-item:active {
    background: var(--color-border-subtle);
}
.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}
.notification-preview {
    font-size: 13px;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-time {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-tertiary);
}
.notification-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.notification-empty-text {
    font-size: 14px;
}

/* Stats Cards - Clean, minimal */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
}
.stat-card:hover {
    border-color: var(--color-text-tertiary);
}
.stat-card:active {
    background: var(--color-border-subtle);
}
.stat-card.selected {
    background: var(--color-text-primary);
    border-color: var(--color-text-primary);
}
.stat-card.selected .stat-number,
.stat-card.selected .stat-label {
    color: white;
}
.stat-number {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--color-text-primary);
}
.stat-number.attention {
    color: var(--color-warning);
}
.stat-number.booked {
    color: var(--color-success);
}
.stat-label {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 6px;
    font-weight: 500;
}

/* Insights Banner */
.insights-banner {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}
.insights-banner:hover {
    border-color: var(--color-text-tertiary);
}
.insights-banner:active {
    background: var(--color-border-subtle);
}
.insights-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.insights-content svg {
    color: var(--color-text-secondary);
}
.insights-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}
.insights-value {
    font-weight: 700;
    color: var(--color-text-primary);
}
.insights-arrow {
    color: var(--color-text-tertiary);
    font-size: 16px;
}

/* Main Content */
.content {
    padding: 24px 20px;
    padding-top: 28px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.4px;
}

/* Sort Selector */
.sort-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-tertiary);
}
.sort-selector select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 28px 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238899a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
}
.sort-selector select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.15);
}

/* Filter Dropdowns - Pill Style */
.filter-dropdowns {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.filter-dropdown select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 8px 28px 8px 28px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
}
.filter-dropdown select:hover {
    border-color: var(--color-text-tertiary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.filter-dropdown select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}
.filter-dropdown select.active {
    background: linear-gradient(135deg, var(--color-accent) 0%, #2d4a6f 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(30,58,95,0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
[data-theme="dark"] .filter-dropdown select {
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .filter-dropdown select:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
[data-theme="dark"] .filter-dropdown select.active {
    background: linear-gradient(135deg, #3b5998 0%, #1e3a5f 100%);
    box-shadow: 0 2px 10px rgba(59,89,152,0.4);
}

/* Filter Tabs - pill style */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    box-shadow: none;
    transition: transform 0.1s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.filter-tab:hover {
    background: var(--color-bg);
    border-color: var(--color-border);
}
.filter-tab:active {
    background: var(--color-border-subtle);
    transform: scale(0.96);
}
.filter-tab.active {
    background: var(--color-text-primary);
    color: white;
    border-color: var(--color-text-primary);
    box-shadow: none;
}

/* Payment sub-filter buttons */
.payment-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.payment-filter-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-text-tertiary);
}
.payment-filter-btn.active {
    background: var(--color-brand-soft);
    color: var(--color-brand);
    border-color: var(--color-brand);
}
.payment-filter-btn[data-payment-filter="unpaid"].active {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: var(--color-warning);
}
.payment-filter-btn[data-payment-filter="paid"].active {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: var(--color-success);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Activity Card - Clean, minimal */
.activity-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--color-border);
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.activity-card:hover {
    border-color: var(--color-text-tertiary);
    background: var(--color-surface);
}
.activity-card:active {
    background: var(--color-bg);
    transform: scale(0.985);
}
.activity-card-inner {
    padding: 18px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Status Indicator - simple solid bar */
.status-indicator {
    width: 3px;
    height: 100%;
    min-height: 48px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}
.status-indicator.new {
    background: var(--color-warning);
}
.status-indicator.needs_callback {
    background: var(--color-danger);
}
.status-indicator.booked {
    background: var(--color-success);
}
.status-indicator.pending_customer {
    background: #8b5cf6;
}
.status-indicator.cancelled {
    background: var(--color-neutral);
}
.status-indicator.handled {
    background: var(--color-text-primary);
}
.status-indicator.spam {
    background: var(--color-neutral);
}

/* Card Content */
.card-content { flex: 1; min-width: 0; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.card-header-left { flex: 1; min-width: 0; }
.caller-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1.3;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.card-time {
    font-size: 13px;
    color: var(--color-text-tertiary);
}
.card-status {
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}
.card-status.new { color: var(--color-warning); }
.card-status.needs_callback { color: var(--color-danger); }
.card-status.booked { color: var(--color-success); }
.card-status.pending_customer { color: #8b5cf6; }
.card-status.cancelled { color: var(--color-neutral); }
.card-status.handled { color: var(--color-accent); }
.card-status.spam { color: var(--color-neutral); }
.card-status.voice_ai { color: #7c3aed; }
.card-summary {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Action Buttons */
.card-actions {
    flex-shrink: 0;
}
.action-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.action-btn:hover {
    opacity: 0.85;
}
.action-btn:active {
    opacity: 0.7;
}
.action-btn.call {
    background: var(--color-success);
    color: white;
}
.action-btn.call svg { width: 18px; height: 18px; }

/* Detail View */
.detail-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 100;
    overflow-y: auto;
}
.detail-view.active { display: block; }
.detail-header {
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
}
.back-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.back-btn:hover {
    background: var(--color-border-subtle);
    border-color: var(--color-text-tertiary);
}
.back-btn svg { width: 18px; height: 18px; }
.detail-caller {
    flex: 1;
}
.detail-caller-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.detail-caller-phone {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin-top: 2px;
}
.job-detail-phone {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-decoration: none;
    display: block;
    margin-top: 2px;
}
.job-detail-phone:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
.detail-content {
    padding: 20px;
}
.detail-section {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
}
.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.detail-value {
    font-size: 14px;
    color: var(--color-text-primary);
    line-height: 1.5;
}
.detail-value.editable-field {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.detail-value.editable-field:hover {
    background: var(--color-bg);
}
.detail-value.editable-field:active {
    background: var(--color-border-subtle);
}
.detail-value.editable-field .edit-icon {
    opacity: 0.4;
    flex-shrink: 0;
}
.detail-value.editable-field:hover .edit-icon {
    opacity: 0.7;
}
.detail-value.editable-field span {
    flex: 1;
}
.detail-value.editable-field span:empty::before {
    content: 'Add...';
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* Activity Log */
.activity-section {
    margin-top: 16px;
}
.activity-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.activity-log {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px;
}
.activity-log.collapsed {
    display: none;
}
.activity-entry {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--color-bg-tertiary);
    border-radius: 8px;
}
.activity-entry:last-child {
    margin-bottom: 0;
}
.activity-description {
    font-size: 14px;
    color: var(--color-text-primary);
    line-height: 1.4;
}
.activity-user {
    font-weight: 500;
    color: var(--color-text-primary);
}
.activity-status-text { font-weight: 600; }
.activity-status-text.scheduled { color: var(--color-accent); }
.activity-status-text.in_progress { color: #1d4ed8; }
.activity-status-text.on_hold { color: #b45309; }
.activity-status-text.completed { color: var(--color-success); }
.activity-status-text.cancelled { color: var(--color-neutral); }
[data-theme="dark"] .activity-status-text.in_progress { color: #93c5fd; }
[data-theme="dark"] .activity-status-text.on_hold { color: #fcd34d; }
.activity-time {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 2px;
}
.activity-toggle {
    font-size: 10px;
    margin-left: 8px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 28px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-success);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.transcript-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.transcript-chevron {
    transition: transform 0.2s ease;
}
.transcript-expanded .transcript-chevron {
    transform: rotate(180deg);
}
.transcript-box {
    background: var(--color-border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    display: none;
}
.transcript-expanded .transcript-box {
    display: block;
}
.suggested-response {
    background: var(--color-success-soft);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: #065f46;
    font-size: 13px;
    line-height: 1.5;
}

/* Status Buttons */
.status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.status-btn {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.status-btn:active {
    transform: scale(0.95);
}
.status-btn.needs_callback {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.status-btn.needs_callback.selected,
.status-btn.needs_callback:hover {
    border-color: var(--color-danger);
}
.status-btn.booked {
    background: var(--color-success-soft);
    color: var(--color-success);
}
.status-btn.booked.selected,
.status-btn.booked:hover {
    border-color: var(--color-success);
}
.status-btn.handled {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}
.status-btn.handled.selected,
.status-btn.handled:hover {
    border-color: var(--color-accent);
}
.status-btn.spam {
    background: var(--color-neutral-soft);
    color: var(--color-neutral);
}
.status-btn.spam.selected,
.status-btn.spam:hover {
    border-color: var(--color-neutral);
}
.status-btn.archive {
    background: #f5f5f5;
    color: #666;
}
.status-btn.archive.selected,
.status-btn.archive:hover {
    border-color: #999;
}

/* Job Status Buttons */
.job-status-btn {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.job-status-btn:active {
    transform: scale(0.95);
}
.job-status-btn[data-status="scheduled"] {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}
.job-status-btn[data-status="scheduled"].selected {
    border-color: var(--color-accent);
}
.job-status-btn[data-status="in_progress"] {
    background: #dbeafe;
    color: #1d4ed8;
}
.job-status-btn[data-status="in_progress"].selected {
    border-color: #1d4ed8;
}
.job-status-btn[data-status="on_hold"] {
    background: var(--color-warning-soft);
    color: #b45309;
}
.job-status-btn[data-status="on_hold"].selected {
    border-color: var(--color-warning);
}
.job-status-btn[data-status="completed"] {
    background: var(--color-success-soft);
    color: var(--color-success);
}
.job-status-btn[data-status="completed"].selected {
    border-color: var(--color-success);
}
.job-status-btn[data-status="cancelled"] {
    background: var(--color-neutral-soft);
    color: var(--color-neutral);
}
.job-status-btn[data-status="cancelled"].selected {
    border-color: var(--color-neutral);
}
[data-theme="dark"] .job-status-btn[data-status="in_progress"] {
    background: #1e3a8a;
    color: #93c5fd;
}
[data-theme="dark"] .job-status-btn[data-status="on_hold"] {
    background: #78350f;
    color: #fcd34d;
}

/* Assigned To Select */
.assigned-to-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.assigned-to-select:focus {
    outline: none;
    border-color: var(--color-accent);
}
[data-theme="dark"] .assigned-to-select {
    background-color: var(--color-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Job Status Badge (for job cards) */
.job-status-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}
.job-status-badge.scheduled { background: var(--color-accent-soft); color: var(--color-accent); }
.job-status-badge.in_progress { background: #dbeafe; color: #1d4ed8; }
.job-status-badge.on_hold { background: var(--color-warning-soft); color: #b45309; }
.job-status-badge.completed { background: var(--color-success-soft); color: var(--color-success); }
.job-status-badge.cancelled { background: var(--color-neutral-soft); color: var(--color-neutral); }
[data-theme="dark"] .job-status-badge.in_progress { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .job-status-badge.on_hold { background: #78350f; color: #fcd34d; }
.job-assigned-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--color-neutral-soft);
    color: var(--color-text-secondary);
    text-transform: capitalize;
}

/* Detail Actions */
.detail-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: var(--color-surface);
    position: sticky;
    bottom: 0;
    border-top: 1px solid var(--color-border);
}
.detail-action-btn {
    flex: 1;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.detail-action-btn:hover { opacity: 0.9; }
.detail-action-btn:active { opacity: 0.8; transform: scale(0.96); }
.detail-action-btn.call {
    background: var(--color-success);
    color: white;
}
.detail-action-btn.text {
    background: var(--color-text-primary);
    color: white;
}

/* Edit name button */
.edit-name-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: var(--radius-sm);
}
.edit-name-btn svg {
    width: 14px;
    height: 14px;
}
.edit-name-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-tertiary);
}
.empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.4;
}
.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}
.empty-text {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

/* Bottom Nav - Clean, minimal */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--color-text-tertiary);
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
    flex: 1;
    max-width: 80px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}
.nav-item:hover {
    color: var(--color-text-primary);
}
.nav-item:active {
    opacity: 0.7;
}
.nav-item.active {
    color: var(--color-text-primary);
}
.nav-item.active .nav-icon {
    stroke-width: 2.5;
}
.nav-icon {
    width: 22px;
    height: 22px;
}
.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    width: 6px;
    height: 6px;
    background: var(--color-danger);
    border-radius: 50%;
}

/* Badges - vibrant with subtle glow */
.urgency-badge,
.lead-badge,
.spam-badge,
.scheduled-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.urgency-badge {
    font-size: 12px;
}
.urgency-badge.emergency {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.urgency-badge.high {
    background: var(--color-warning-soft);
    color: #b45309;
}
.urgency-badge.medium {
    background: #fef9c3;
    color: #a16207;
}
.lead-badge {
    background: var(--color-success-soft);
    color: #059669;
}
.spam-badge {
    background: var(--color-neutral-soft);
    color: var(--color-neutral);
}
.scheduled-badge {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.channel-badge.voice-ai {
    background: #ede9fe;
    color: #7c3aed;
}
.channel-badge.voicemail {
    background: #fef3c7;
    color: #b45309;
}
.channel-badge.booking {
    background: #e0f2fe;
    color: #0891b2;
}
.followup-tip {
    background: var(--color-warning-soft);
    border-left: 2px solid var(--color-warning);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: #78350f;
    margin-top: 10px;
}
.followup-tip.scheduled {
    background: var(--color-success-soft);
    border-left-color: var(--color-success);
    color: #14532d;
}

/* Customers View */
.customers-view { display: none; }
.customers-view.active { display: block; }
.customer-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.customer-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.customer-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}
.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.customer-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
}
.customer-phone {
    color: var(--color-text-tertiary);
    font-size: 13px;
    margin-top: 3px;
}
.customer-meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--color-text-tertiary);
}
.lead-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 700;
}
.lead-score-pill.high {
    background: var(--color-success-soft);
    color: #059669;
}
.lead-score-pill.medium {
    background: var(--color-warning-soft);
    color: #b45309;
}
.lead-score-pill.low {
    background: var(--color-neutral-soft);
    color: var(--color-neutral);
}

/* Sequence Status */
.sequence-status-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px 16px;
}

.sequence-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sequence-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sequence-status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.sequence-status-badge.paused {
    background: #fef3c7;
    color: #92400e;
}

.sequence-status-badge.completed {
    background: #e5e7eb;
    color: #374151;
}

.sequence-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sequence-actions {
    display: flex;
    gap: 8px;
}

.sequence-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sequence-action-btn.pause {
    background: #fef3c7;
    color: #92400e;
}

.sequence-action-btn.resume {
    background: #dcfce7;
    color: #166534;
}

.sequence-action-btn.stop {
    background: #fee2e2;
    color: #991b1b;
}

.sequence-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Customer Detail View */
.customer-detail-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 100;
    overflow-y: auto;
}
.customer-detail-view.active { display: block; }
.interaction-item {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.interaction-item.clickable {
    cursor: pointer;
    position: relative;
    padding-right: 32px;
}
.interaction-item.clickable:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}
.interaction-item.clickable:active {
    transform: translateX(2px);
}
.interaction-item.clickable::after {
    content: '›';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    font-size: 18px;
    font-weight: 300;
}
.interaction-type {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}
.interaction-type.voicemail { background: #fef3c7; color: #b45309; }
.interaction-type.voice-ai { background: #ede9fe; color: #7c3aed; }
.interaction-type.sms { background: #eff6ff; color: #2563eb; }
.interaction-type.chat { background: #f3e8ff; color: #7c3aed; }
.interaction-date { font-size: 12px; color: #9ca3af; }
.interaction-summary { font-size: 14px; margin-top: 4px; }

/* Scrollable area accounting for bottom nav */
.main-scroll {
    padding-bottom: 80px;
}

/* Settings View */
.settings-view { display: none; }
.settings-view.active { display: block; }

/* Team List Styles */
.team-list {
    margin: 16px 0;
}
.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.team-member-info {
    display: flex;
    flex-direction: column;
}
.team-member-name {
    font-weight: 500;
    color: var(--color-text-primary);
}
.team-member-role {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-left: 8px;
}
.team-member-email {
    font-size: 13px;
    color: var(--color-text-secondary);
}
.team-edit-btn {
    padding: 6px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
}
.team-edit-btn:hover {
    background: var(--color-border);
}
.add-employee-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
}
.add-employee-btn:hover {
    background: var(--color-bg);
}

/* Slot Time Buttons */
.slot-time-btn {
    padding: 8px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--color-text-secondary);
}
.slot-time-btn:hover {
    border-color: var(--color-accent);
}
.slot-time-btn.selected {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Insights View */
.insights-view { display: none; }
.insights-view.active { display: block; }
.insights-tab-toggle {
    display: flex;
    gap: 0;
    margin-top: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 4px;
}
.insights-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.insights-tab-btn:hover {
    color: var(--color-text-primary);
}
.insights-tab-btn.active {
    background: var(--color-text-primary);
    color: var(--color-surface);
}
.insights-tab-content {
    display: none;
}
.insights-tab-content.active {
    display: block;
}
.insights-period-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.period-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.period-btn:hover {
    background: var(--color-bg);
}
.period-btn.active {
    background: var(--color-text-primary);
    color: var(--color-surface);
    border-color: var(--color-text-primary);
}
.insight-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 12px;
}
.insight-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.insight-big-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1;
    letter-spacing: -1px;
}
.insight-big-number.green { color: var(--color-success); }
.insight-big-number.blue { color: var(--color-accent); }
.insight-subtitle {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}
.insight-row {
    display: flex;
    gap: 10px;
}
.insight-row .insight-card {
    flex: 1;
}
.insight-section-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.insight-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-subtle);
}
.insight-stat-row:last-child {
    border-bottom: none;
}
.insight-stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}
.insight-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.insight-bar-container {
    margin-top: 8px;
}
.insight-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.insight-bar-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    width: 80px;
    flex-shrink: 0;
}
.insight-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}
.insight-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.insight-bar-fill.green { background: var(--color-success); }
.insight-bar-fill.yellow { background: var(--color-warning); }
.insight-bar-fill.red { background: var(--color-danger); }
.insight-bar-fill.blue { background: var(--color-accent); }
.insight-bar-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    width: 30px;
    text-align: right;
}
.clickable {
    cursor: pointer;
    transition: transform 0.1s;
}
.clickable:active {
    transform: scale(0.98);
}

/* Schedule Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26,43,60,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.modal-close {
    background: var(--color-neutral-soft);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--color-text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--color-border);
    color: var(--color-text-secondary);
}
.modal-body {
    padding: 24px;
}
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text-primary);
    transition: all 0.2s;
    background: var(--color-surface);
}
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(30,58,95,0.15);
}
.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    gap: 12px;
}
.modal-btn {
    flex: 1;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.1s ease, background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.modal-btn:active { transform: scale(0.95); }
.modal-btn.cancel {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.modal-btn.cancel:hover {
    background: var(--color-border-subtle);
    border-color: var(--color-text-tertiary);
}
.modal-btn.primary {
    background: var(--color-text-primary);
    color: white;
}
.modal-btn.primary:hover {
    opacity: 0.9;
}
.modal-btn.danger {
    background: var(--color-danger);
    color: white;
}
.modal-btn.danger:hover {
    opacity: 0.9;
}

.credentials-box {
    background: var(--color-bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-family: monospace;
}
.credentials-note {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Appointment Booking Style Modal */
.booking-calendar {
    margin-bottom: 20px;
}
.booking-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.booking-calendar-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.booking-calendar-month {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.booking-calendar-year {
    font-size: 18px;
    font-weight: 400;
    color: var(--color-text-tertiary);
}
.booking-calendar-nav {
    display: flex;
    gap: 6px;
}
.booking-nav-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.booking-nav-btn:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    box-shadow: var(--shadow-md);
}
.booking-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}
.booking-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    padding: 6px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.booking-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.booking-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.booking-day:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}
.booking-day.other-month {
    color: var(--color-text-tertiary);
    opacity: 0.5;
}
.booking-day.today {
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    font-weight: 700;
}
.booking-day.selected {
    background: var(--color-text-primary);
    color: white;
}
.booking-day.selected.today {
    border: none;
}
.booking-day.past {
    color: var(--color-text-tertiary);
    opacity: 0.4;
    cursor: not-allowed;
}
.booking-day.past:hover {
    background: transparent;
    color: var(--color-text-tertiary);
}
.booking-day.has-slots {
    background: var(--color-success-soft);
}
.booking-day.has-slots:hover {
    background: var(--color-success-soft);
    border-color: var(--color-success);
}

/* Selected date display */
.booking-selected-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}
.booking-timezone {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-bottom: 16px;
}

/* Time slots */
.time-slots-section {
    margin-bottom: 16px;
}
.time-slots-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 10px;
}
.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.time-slot {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--color-neutral-soft);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text-secondary);
}
.time-slot:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}
.time-slot.selected {
    background: var(--color-text-primary);
    color: white;
}
.time-slot.disabled, .time-slot:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}
.time-slot.disabled:hover, .time-slot:disabled:hover {
    background: var(--color-neutral-soft);
    color: var(--color-text-secondary);
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-bar:focus-within {
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(30,58,95,0.15);
}
.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--color-text-primary);
}
.search-bar input::placeholder {
    color: var(--color-text-tertiary);
}
.search-icon {
    color: var(--color-text-tertiary);
    margin-right: 10px;
    width: 16px;
    height: 16px;
}
.search-clear {
    background: var(--color-neutral-soft);
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    display: none;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.search-clear:hover {
    background: var(--color-border);
    color: var(--color-text-secondary);
}
.search-clear.visible {
    display: block;
}

/* Jobs View */
.jobs-view { display: none; }
.jobs-view.active { display: block; }
.customers-section-header {
    margin: 14px 0 14px;
}
.customers-header-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    width: min(520px, 100%);
}
.customers-header-controls .modal-btn {
    width: 100%;
    margin: 0;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.customers-sort-selector {
    display: block;
    white-space: nowrap;
    margin: 0;
}
.customers-sort-selector span {
    display: none;
}
.customers-sort-selector select {
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 38px;
    padding: 8px 36px 8px 12px;
    font-size: 13px;
    box-shadow: none;
}
.jobs-section-header {
    margin: 14px 0 14px;
}
.jobs-header-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    width: min(520px, 100%);
}
.jobs-header-controls .modal-btn {
    width: 100%;
    margin: 0;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jobs-filter-selector {
    display: block;
    white-space: nowrap;
    margin: 0;
}
.jobs-filter-selector span {
    display: none;
}
.jobs-filter-selector select {
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 38px;
    padding: 8px 36px 8px 12px;
    font-size: 13px;
    box-shadow: none;
}
.job-card {
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.job-card:hover {
    border-color: var(--color-text-tertiary);
}
.job-card.new-booking {
    animation: highlightPulse 2s ease-out;
    box-shadow: 0 0 0 2px var(--color-success), var(--shadow-sm);
}
@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), var(--shadow-sm); }
    100% { box-shadow: 0 0 0 2px var(--color-success), var(--shadow-sm); }
}
/* Past appointments - grayed out */
.job-card.past {
    opacity: 0.6;
    background: var(--color-bg-tertiary);
}
.job-card.past .job-time {
    color: var(--color-text-tertiary);
}
/* Upcoming appointments - green accent */
.job-card.upcoming {
    border-left: 3px solid var(--color-success);
}
/* Today's appointments - subtle highlight */
.job-card.today {
    border-left: 3px solid var(--color-text-primary);
}
.job-date-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-tertiary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.job-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.job-time-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.job-customer {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}
.job-address {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}
.job-address a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}
.job-address a:hover {
    text-decoration: underline;
}
.job-issue {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
.job-notes {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-style: italic;
    background: var(--color-neutral-soft);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--color-accent);
}
.job-actions {
    display: flex;
    gap: 8px;
}
.job-action-btn {
    flex: 1;
    padding: 11px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.job-action-btn:active { transform: scale(0.97); }
.job-action-btn.call {
    background: var(--color-success-soft);
    color: #16a34a;
}
.job-action-btn.call:hover {
    background: #bbf7d0;
}
.job-action-btn.text {
    background: #dbeafe;
    color: #1d4ed8;
}
.job-action-btn.text:hover {
    background: #bfdbfe;
}
.job-action-btn.complete {
    background: var(--color-text-primary);
    color: white;
}
.job-action-btn.complete:hover {
    opacity: 0.9;
}

/* Scheduled badge on voicemail cards */
.scheduled-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* Calendar View */
.calendar-view { display: none; }
.calendar-view.active { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-bottom: 80px; overflow: hidden; }

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    background: var(--color-surface);
    border-bottom: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
    gap: 8px;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-nav-btn {
    background: var(--color-neutral-soft);
    border: none;
    font-size: 18px;
    padding: 10px;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 999;
    transition: all 0.2s;
}
.calendar-nav-btn:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}
.calendar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text-primary);
    min-width: 120px;
    text-align: center;
    flex-shrink: 1;
}
.calendar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.calendar-today-btn {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--color-accent-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-accent);
    transition: all 0.2s;
}
.calendar-today-btn:hover {
    background: var(--color-accent);
    color: white;
}
.calendar-add-btn {
    background: #3b82f6;
    color: white;
}
.calendar-add-btn:hover {
    background: #2563eb;
    color: white;
}
.view-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: var(--color-neutral-soft);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}
.view-toggle-btn {
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-tertiary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
}
.view-toggle-btn.active {
    background: var(--color-text-primary);
    color: white;
}
.calendar-weekdays.day-view {
    grid-template-columns: 1fr;
}
.calendar-grid.day-view {
    grid-template-columns: 1fr;
    justify-items: center;
}
.calendar-grid.day-view .calendar-day {
    width: 90px;
}

/* Tablet/mobile layout tuning for jobs and calendar controls */
@media (max-width: 900px) {
    .calendar-header {
        padding: 12px 10px;
        gap: 10px;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .calendar-nav {
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }
    .calendar-title {
        min-width: 0;
        flex: 1;
        font-size: 16px;
        padding: 0 6px;
    }
    .calendar-nav-btn {
        padding: 9px;
    }
    .calendar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .calendar-today-btn {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .view-toggle {
        grid-column: 1 / -1;
        width: 100%;
    }
    .calendar-add-btn {
        grid-column: 1 / -1;
    }
    .view-toggle-btn {
        text-align: center;
    }

    .customers-section-header {
        margin: 12px 0 12px;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
    }
    .customers-header-controls {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jobs-section-header {
        margin: 12px 0 12px;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
    }
    .jobs-header-controls {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .calendar-today-btn {
        padding: 8px 8px;
        font-size: 11px;
    }
    .calendar-title {
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .customers-header-controls {
        grid-template-columns: 1fr;
    }
    .jobs-header-controls {
        grid-template-columns: 1fr;
    }
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 12px;
    background: var(--color-bg);
}
.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 12px;
    background: var(--color-surface);
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 48px;
}
.calendar-day:hover {
    background: var(--color-accent-soft);
}
.calendar-day.today {
    background: var(--color-accent-soft);
    border: 2px solid var(--color-accent);
}
.calendar-day.selected {
    background: var(--color-text-primary);
    color: white;
}
.calendar-day.selected:hover {
    background: var(--color-text-primary);
    opacity: 0.9;
}
.calendar-day.other-month {
    opacity: 0.3;
}
.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
}
.calendar-day-indicator {
    position: absolute;
    bottom: 6px;
    display: flex;
    gap: 3px;
}
.calendar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-success);
}
.calendar-dot.urgent {
    background: var(--color-danger);
}
.calendar-day.selected .calendar-dot {
    background: white;
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}
.calendar-day.selected .calendar-dot.urgent {
    background: #fca5a5;
    box-shadow: 0 0 6px rgba(252,165,165,0.5);
}
.calendar-selected-date {
    display: none; /* Hidden - date headers now inline with jobs */
}
.calendar-jobs-list {
    padding: 0 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
.calendar-date-group {
    scroll-margin-top: 10px;
}
.calendar-date-header {
    position: sticky;
    top: 0;
    background: var(--color-bg);
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    margin: 0;
    z-index: 5;
    border-bottom: 1px solid var(--color-border);
}
.calendar-date-header.today {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-bottom-color: var(--color-success);
}
.calendar-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-tertiary);
}
.calendar-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    opacity: 0.3;
}
.calendar-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}
.calendar-empty-text {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Month view specific */
.calendar-grid.month-view {
    gap: 3px;
}
.calendar-grid.month-view .calendar-day {
    min-height: 40px;
    border-radius: var(--radius-sm);
}
.calendar-grid.month-view .calendar-day-number {
    font-size: 14px;
}

/* Conversation View - iOS-style chat UI */
.conversation-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 150;
    flex-direction: column;
}
.conversation-view.active {
    display: flex;
}
.conversation-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding-top: max(12px, env(safe-area-inset-top));
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
}
.conversation-header .back-btn {
    width: 36px;
    height: 36px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
}
.conversation-header-info {
    flex: 1;
}
.conversation-header-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
}
.conversation-header-phone {
    font-size: 12px;
    color: var(--color-text-tertiary);
}
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--color-bg);
}
.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
}
.message-bubble.inbound {
    align-self: flex-start;
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
}
.message-bubble.outbound {
    align-self: flex-end;
    background: var(--color-text-primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.message-bubble.outbound.auto {
    background: var(--color-neutral);
}
.message-time {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.7;
}
.message-sender-type {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}
.message-input-area {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.quick-responses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.quick-response-chip {
    padding: 8px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text-secondary);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.quick-response-chip:hover {
    background: var(--color-text-primary);
    color: white;
    border-color: var(--color-text-primary);
}
.quick-response-chip:active {
    opacity: 0.8;
}
.message-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.message-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    font-family: inherit;
    line-height: 1.4;
}
.message-input:focus {
    border-color: var(--color-brand-start);
}
.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-text-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.send-btn:hover {
    opacity: 0.85;
}
.send-btn:active {
    opacity: 0.7;
}
.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.send-btn svg {
    width: 20px;
    height: 20px;
}
.messages-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-tertiary);
    text-align: center;
    padding: 20px;
}
.messages-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.messages-empty-text {
    font-size: 14px;
}
.messages-date-divider {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin: 16px 0 8px;
    font-weight: 500;
}

/* Auth Screen */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 20px;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-brand-start);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.auth-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-brand-start);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    font-size: 16px;
}

.auth-switch {
    margin-top: 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.auth-switch a {
    color: var(--color-brand-start);
    text-decoration: none;
    font-weight: 500;
}

.auth-error {
    color: #dc3545;
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}

/* Long-press Context Menu */
.context-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.context-menu-overlay.active {
    display: block;
    opacity: 1;
}
.context-menu {
    position: fixed;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    padding: 8px 0;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
    overflow: hidden;
}
.context-menu-overlay.active .context-menu {
    transform: scale(1);
    opacity: 1;
}
.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.context-menu-item:hover,
.context-menu-item:active {
    background: var(--color-bg);
}
.context-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.context-menu-item.handled {
    color: var(--color-accent);
}
.context-menu-item.spam {
    color: var(--color-neutral);
}
.context-menu-item.archive {
    color: #666;
}
[data-theme="dark"] .context-menu-item.archive {
    color: #aaa;
}
.context-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
}

/* Long-press visual feedback */
.activity-card.long-pressing {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}
