/* ===== CSS Variables — Dark Theme ===== */
:root {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-deep: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --primary-glow: rgba(99, 102, 241, 0.2);
    --bg: #0a0a0f;
    --bg-alt: #0e0e14;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-solid: #13131a;
    --surface-hover: rgba(255, 255, 255, 0.06);
    --text: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --error: #f87171;
    --error-bg: rgba(239, 68, 68, 0.12);
    --success: #34d399;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #fbbf24;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-card-hover: 0 12px 36px rgba(99, 102, 241, 0.15), 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== Auth Page ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0a0a0f;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.logo-icon {
    color: var(--primary);
}

.logo h1, .nav-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.tagline {
    color: var(--text-muted);
    font-size: 15px;
    letter-spacing: -0.01em;
}

/* ===== Forms ===== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
    color: var(--text);
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    height: 52px;
    padding: 14px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all 0.25s ease;
    outline: none;
    background-color: #1a1f2e;
    color: var(--text);
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: #1e2438;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.1);
    background-color: #1e2438;
}

/* Password field with eye toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    outline: none;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    margin-top: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ===== Messages ===== */
.error-message {
    background: var(--error-bg);
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-message {
    background: var(--success-bg);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ===== Navbar ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-left .logo-icon {
    font-size: 24px;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Nav links */
.nav-links {
    display: flex;
    gap: 4px;
    margin-left: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    padding: 3px;
}

.nav-link {
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.nav-link:hover:not(.active) {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Dashboard Main ===== */
.dashboard-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== Tab Switcher ===== */
.tab-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    overflow: hidden;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
    flex-wrap: nowrap;
}

.tab-btn {
    flex: 1;
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 50px;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.tab-btn:hover:not(.active) {
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Map Search ===== */
.map-search-controls {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto 16px;
    align-items: stretch;
}

.map-search-controls input {
    flex: 1;
    height: 52px;
    min-height: 52px;
    padding: 0 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 15px;
    letter-spacing: -0.01em;
    outline: none;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.map-search-controls input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.map-search-controls input:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.map-search-controls input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.map-search-controls .btn {
    height: 52px;
    padding: 0 32px;
    width: auto;
    margin-top: 0;
    border-radius: 14px;
    font-size: 15px;
    flex-shrink: 0;
}

.map-search-controls .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.map-info-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

#map-container {
    width: 100%;
    height: 420px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #1a1a24;
    margin-top: 8px;
    overflow: hidden;
}

/* ===== Search Section ===== */
.search-section {
    text-align: center;
    margin-bottom: 32px;
}

.search-section h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.search-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
    align-items: stretch;
}

.search-form input {
    flex: 1;
    height: 52px;
    min-height: 52px;
    padding: 0 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 15px;
    letter-spacing: -0.01em;
    outline: none;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.search-form input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-form input:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.search-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.search-form .btn {
    height: 52px;
    padding: 0 32px;
    width: auto;
    margin-top: 0;
    border-radius: 14px;
    font-size: 15px;
    flex-shrink: 0;
}

/* ===== Count Range Slider ===== */
.count-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.count-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    border: none;
    padding: 0;
}

.count-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.count-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.6);
}

.count-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.count-row input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.count-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    min-width: 22px;
    text-align: center;
}

.count-label {
    color: var(--text-muted);
}

/* ===== Query Info ===== */
.query-info {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-cached {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 48px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Results ===== */
.results-section {
    margin-bottom: 48px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.results-section > h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ===== Results Toolbar ===== */
.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-toolbar h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.results-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* View toggle */
.view-toggle {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50px;
}

.view-btn.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.view-btn:hover:not(.active) {
    color: var(--primary);
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

/* Export button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-export:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-export svg {
    width: 14px;
    height: 14px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ===== Premium Result Card ===== */
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.result-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Card gallery */
.card-gallery {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}
.card-gallery .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.15s;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.card-gallery:hover .gallery-nav { opacity: 1; }
.card-gallery .gallery-nav:hover {
    background: rgba(99,102,241,0.75);
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-50%) scale(1.1);
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-counter {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Card photo */
.card-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.card-photo-placeholder {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
    opacity: 0.5;
}

/* Card body */
.card-body {
    padding: 20px;
}

/* Status row */
.card-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: var(--success-bg);
    color: var(--success);
}

.status-closed {
    background: var(--error-bg);
    color: var(--error);
}

.price-indicator {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: -0.5px;
}

.price-indicator .active {
    color: var(--success);
}

.price-indicator .inactive {
    color: rgba(255, 255, 255, 0.1);
}

/* Card name */
.card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

/* Rating row */
.card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.card-rating .stars {
    display: flex;
    gap: 1px;
}

.card-rating .star {
    color: var(--warning);
    font-size: 14px;
}

.card-rating .star.empty {
    color: rgba(255, 255, 255, 0.1);
}

.card-rating .rating-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.card-rating .rating-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* Type tags */
.card-types {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}

.type-tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Card info rows */
.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.card-info-row .info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.card-info-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.card-info-row a:hover {
    text-decoration: underline;
}

/* Card actions */
.card-actions {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.card-action-btn {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.card-action-btn .action-icon {
    font-size: 16px;
    line-height: 1;
}

.card-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.card-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.card-action-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.card-action-whatsapp:hover {
    background: rgba(37, 211, 102, 0.25);
    color: #25D366;
}

.card-action-directions {
    background: rgba(99, 102, 241, 0.15);
    color: #A5B4FC;
}

.card-action-directions:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
}

.card-action-call {
    background: rgba(236, 72, 153, 0.15);
    color: #F472B6;
}

.card-action-call:hover {
    background: rgba(236, 72, 153, 0.25);
    color: #F472B6;
}

.card-action-website {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.card-action-website:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #60A5FA;
}

/* WhatsApp Quick Popup */
.wa-quick-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.wa-quick-popup.active {
    opacity: 1;
    visibility: visible;
}

.wa-quick-popup-content {
    background: #0F1419;
    border: 1px solid #1F2937;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: popupSlideIn 0.25s ease-out;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.wa-quick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #1F2937;
}

.wa-quick-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-quick-header h3 svg {
    color: #25D366;
}

.wa-quick-close {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.wa-quick-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wa-quick-body {
    padding: 16px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.wa-type-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.wa-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wa-type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #374151;
}

.wa-type-btn.selected {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25D366;
}

.wa-type-btn svg {
    width: 32px;
    height: 32px;
}

.wa-type-btn.personal svg {
    color: #25D366;
}

.wa-type-btn.business svg {
    color: #0088cc;
}

.wa-type-btn span {
    font-size: 13px;
    font-weight: 500;
    color: #E5E7EB;
}

.wa-type-btn small {
    font-size: 11px;
    color: #6B7280;
}

.wa-template-section {
    margin-top: 16px;
}

.wa-template-section label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wa-template-select {
    width: 100%;
    padding: 12px 14px;
    background: #111827;
    border: 1px solid #1F2937;
    border-radius: 10px;
    color: #E5E7EB;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.wa-template-select:hover {
    border-color: #374151;
}

.wa-template-select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.wa-message-preview {
    margin-top: 12px;
    padding: 12px;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: #D1D5DB;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

.wa-quick-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #1F2937;
    background: rgba(0, 0, 0, 0.2);
}

.wa-quick-footer .btn-cancel {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 10px;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wa-quick-footer .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #4B5563;
    color: #E5E7EB;
}

.wa-quick-footer .btn-send {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #25D366;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wa-quick-footer .btn-send:hover {
    background: #22c55e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wa-quick-footer .btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Hours */
.hours-toggle {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
    font-size: 12px;
}

.hours-toggle:hover {
    text-decoration: underline;
}

.hours-dropdown {
    display: none;
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-xs);
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.hours-dropdown.open {
    display: block;
}

/* ===== Table View ===== */
.results-table-container {
    margin-top: 0;
}

.table-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
    background: var(--surface-solid);
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.results-table th {
    background: linear-gradient(180deg, #1e1e2e 0%, #16161f 100%);
    color: var(--text-secondary);
    padding: 12px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--border);
}

.results-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.results-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.results-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text);
    vertical-align: middle;
}

.results-table tbody tr {
    transition: background 0.15s;
}

.results-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.results-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

.results-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius);
}

.results-table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius) 0;
}

/* Table cells */
.td-num {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    width: 36px;
    text-align: center;
}

.td-photo {
    width: 48px;
    padding: 6px 8px;
}

.table-photo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.table-photo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
}

.td-name {
    font-weight: 600;
    color: var(--text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-address {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.td-phone a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.td-phone a:hover {
    text-decoration: underline;
}

.table-rating {
    font-weight: 600;
    color: var(--text);
}

.table-star {
    color: var(--warning);
    font-size: 13px;
}

.td-reviews {
    color: var(--text-muted);
    font-size: 12px;
}

.td-types {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.status-pill-open {
    background: var(--success-bg);
    color: var(--success);
}

.status-pill-closed {
    background: var(--error-bg);
    color: var(--error);
}

.td-price {
    font-weight: 700;
    color: var(--success);
    letter-spacing: -0.5px;
}

.td-website a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
}

.td-website a:hover {
    text-decoration: underline;
}

.td-actions {
    display: flex;
    gap: 6px;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.table-action:hover {
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.1);
}

/* Colored action buttons */
.table-action-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.25);
    color: #25D366;
}

.table-action-whatsapp:hover {
    background: rgba(37, 211, 102, 0.25);
    border-color: rgba(37, 211, 102, 0.4);
}

.table-action-directions {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.25);
    color: #6366F1;
}

.table-action-directions:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.4);
}

.table-action-call {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.25);
    color: #EC4899;
}

.table-action-call:hover {
    background: rgba(236, 72, 153, 0.25);
    border-color: rgba(236, 72, 153, 0.4);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-btn.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-prev, .page-next {
    font-weight: 600;
    font-size: 12px;
    padding: 0 14px;
}

.page-dots {
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 2px;
    user-select: none;
}

.page-info {
    margin-left: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== History ===== */
.history-section {
    border-top: 1px solid var(--border);
    padding-top: 32px;
}

.history-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

/* History card */
.history-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.history-card:hover {
    background: var(--surface-hover);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.history-card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.history-card-content {
    flex: 1;
    min-width: 0;
}

.history-card-prompt {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.history-badge-type {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.history-badge-location {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.history-badge-radius {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.history-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.history-card-count {
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 8px;
    border-radius: 50px;
    font-size: 11px;
}

.history-card-date {
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px 0;
    grid-column: 1 / -1;
}

/* ===== History Page ===== */
.history-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.history-hero {
    text-align: center;
    padding: 40px 0 32px;
    position: relative;
}

.history-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.history-hero h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text);
    margin-bottom: 8px;
    position: relative;
}

.history-hero p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    position: relative;
}

.history-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    position: relative;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Filter bar */
.history-filter-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.history-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    transition: all 0.25s ease;
}

.history-search-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.history-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.1);
}

.filter-icon {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.history-search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    letter-spacing: -0.01em;
}

.history-search-box input::placeholder {
    color: var(--text-muted);
}

/* History page grid */
.history-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* History page card */
.hp-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: fadeSlideUp 0.4s ease both;
}

.hp-card:hover {
    background: var(--surface-hover);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hp-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.hp-card-body {
    flex: 1;
    min-width: 0;
}

.hp-card-prompt {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.hp-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.hp-card-count {
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
}

.hp-card-date {
    color: var(--text-muted);
}

.hp-card-arrow {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 300;
    flex-shrink: 0;
    transition: all 0.2s;
}

.hp-card:hover .hp-card-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* Empty state */
.history-empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-illustration {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.history-empty-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.history-empty-state p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 8px;
}

/* ===== Detail Modal ===== */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.detail-modal {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 1100px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-solid);
    border-radius: 20px 20px 0 0;
}

.detail-header-info {
    flex: 1;
    min-width: 0;
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.detail-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.detail-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 16px;
    transition: all 0.2s;
    line-height: 1;
}

.detail-close:hover {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.detail-result-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-modal .results-grid {
    padding: 0 32px;
}

.detail-modal .results-table-container {
    padding: 0 32px 8px;
}

.detail-modal .results-table thead {
    position: relative;
    top: auto;
    z-index: auto;
}

.detail-modal .table-scroll {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.detail-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 32px 28px;
    flex-wrap: wrap;
}

/* Detail no results */
.detail-no-results {
    text-align: center;
    padding: 48px 24px;
}

.detail-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.detail-no-results h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.detail-no-results p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.detail-no-results a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.detail-no-results a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
/* ===== Tablet (max-width: 900px) ===== */
@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .detail-modal {
        max-width: 95%;
    }
}

/* ===== Mobile (max-width: 640px) ===== */
@media (max-width: 640px) {

    /* -- Navbar: wrap into 2 rows -- */
    .navbar {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 0;
        overflow-x: hidden;
    }

    .nav-left {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding-bottom: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-left .logo-icon {
        font-size: 18px;
        flex-shrink: 0;
    }

    .nav-title {
        font-size: 15px;
        margin-right: 8px;
        margin-left: 4px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Nav links - horizontal scroll on mobile */
    .nav-links {
        margin-left: 0;
        padding: 2px;
        flex-shrink: 0;
        display: flex;
        gap: 2px;
    }

    .nav-link {
        padding: 4px 8px;
        font-size: 10px;
        white-space: nowrap;
    }

    /* Right section becomes its own row */
    .nav-right {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .user-email {
        display: none;
    }

    .usage-badge {
        padding: 3px 10px;
        font-size: 11px;
    }

    .btn-sm {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* -- Auth Page -- */
    .auth-container {
        padding: 12px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .auth-form h2 {
        font-size: 20px;
    }

    .auth-page::before {
        width: 300px;
        height: 200px;
    }

    #otp-code {
        font-size: 20px;
        letter-spacing: 6px;
    }

    /* -- Dashboard -- */
    .dashboard-main {
        padding: 16px 12px;
    }

    .tab-switcher {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* -- Search -- */
    .search-section {
        margin-bottom: 24px;
    }

    .search-section h2 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .search-hint {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .search-form {
        flex-direction: column;
        max-width: 100%;
    }

    .search-form input {
        width: 100%;
        height: 56px;
        min-height: 56px;
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
    }

    .search-form .btn {
        width: 100%;
        height: 56px;
        min-height: 56px;
        font-size: 16px;
        border-radius: 12px;
    }

    .map-search-controls input {
        width: 100%;
        height: 56px;
        min-height: 56px;
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
    }

    .count-row {
        font-size: 12px;
        margin-top: 10px;
    }

    .count-row input[type="range"] {
        width: 120px;
    }

    /* -- Map Search -- */
    .map-search-controls {
        flex-direction: column;
        max-width: 100%;
    }

    .map-search-controls input {
        width: 100%;
        height: 50px;
        font-size: 15px;
        border-radius: 12px;
    }

    .map-search-controls .btn {
        width: 100%;
        height: 50px;
        font-size: 15px;
        border-radius: 12px;
    }

    #map-container {
        height: 280px;
        border-radius: 12px;
    }

    .map-info-bar {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* -- Query Info -- */
    .query-info {
        gap: 6px;
        padding: 0 4px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* -- Results -- */
    .results-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .results-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-card {
        border-radius: 14px;
    }

    .card-photo {
        height: 140px;
    }

    .card-photo-placeholder {
        height: 70px;
        font-size: 28px;
    }

    .card-body {
        padding: 14px;
    }

    .card-status-row {
        margin-bottom: 8px;
    }

    .card-name {
        font-size: 16px;
    }

    .card-rating {
        font-size: 13px;
    }

    .card-types {
        gap: 4px;
    }

    .card-type-tag {
        font-size: 10px;
        padding: 2px 8px;
    }

    .card-info-row {
        font-size: 12px;
    }

    .card-actions {
        gap: 6px;
        flex-wrap: wrap;
    }

    .card-action-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Table view: allow horizontal scroll */
    .results-table-container {
        margin: 0 -12px;
        border-radius: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .results-table th,
    .results-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .td-name {
        max-width: 150px;
    }

    .td-address {
        max-width: 160px;
    }

    /* -- Pagination -- */
    .pagination {
        gap: 4px;
        flex-wrap: wrap;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .page-info {
        font-size: 11px;
    }

    /* -- History Page -- */
    .history-main {
        padding: 16px 12px;
    }

    .history-hero {
        padding: 20px 0 16px;
    }

    .history-hero h1 {
        font-size: 24px;
    }

    .history-hero p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .history-hero::before {
        width: 300px;
        height: 200px;
    }

    .history-stats {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .stat-chip {
        flex: 1;
        min-width: 0;
        padding: 12px 10px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 10px;
    }

    .history-filter-bar {
        margin-bottom: 16px;
    }

    .history-search-box {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .history-search-box input {
        font-size: 14px;
    }

    .history-list {
        grid-template-columns: 1fr;
    }

    /* History cards: stack vertically on mobile */
    .hp-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 10px;
        border-radius: 14px;
    }

    .hp-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }

    .hp-card-body {
        width: 100%;
    }

    .hp-card-prompt {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.4;
        word-break: break-word;
    }

    .hp-card-badges {
        gap: 4px;
        margin-bottom: 6px;
    }

    .hp-card-badges .badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .hp-card-meta {
        gap: 8px;
        font-size: 11px;
        flex-wrap: wrap;
    }

    .hp-card-arrow {
        display: none;
    }

    .history-empty-state {
        padding: 40px 16px;
    }

    .empty-illustration {
        font-size: 48px;
    }

    .history-empty-state h3 {
        font-size: 18px;
    }

    /* -- Detail Modal: full-screen on mobile -- */
    .detail-overlay {
        padding: 0;
    }

    .detail-modal {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        max-width: 100%;
    }

    .detail-header {
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .detail-header-info {
        flex: 1;
        min-width: 0;
    }

    .detail-header h2 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .detail-badges .badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .detail-meta {
        font-size: 11px;
    }

    .detail-close {
        flex-shrink: 0;
    }

    .detail-toolbar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .detail-result-count {
        font-size: 12px;
    }

    .detail-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .detail-modal .results-grid {
        padding: 0 12px;
        grid-template-columns: 1fr;
    }

    .detail-modal .results-table-container {
        padding: 0 4px;
    }

    .detail-pagination {
        padding: 12px;
    }

    /* -- Limit Modal -- */
    .limit-modal-overlay {
        padding: 16px;
    }

    .limit-modal {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .limit-modal-icon {
        font-size: 40px;
    }

    .limit-modal h3 {
        font-size: 18px;
    }

    .limit-modal p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .limit-packs-label {
        font-size: 12px;
    }

    .limit-packs-row {
        gap: 6px;
    }

    .limit-pack-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .limit-modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .limit-modal-actions .btn {
        width: 100% !important;
        padding: 12px !important;
    }
}

/* ===== Pricing Page ===== */
.pricing-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.pricing-hero {
    text-align: center;
    padding: 40px 0 32px;
    position: relative;
}

.pricing-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.pricing-hero h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text);
    margin-bottom: 8px;
    position: relative;
}

.pricing-hero p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 0;
    position: relative;
}

/* Current plan banner */
.current-plan-banner {
    max-width: 640px;
    margin: 0 auto 36px;
    padding: 20px 28px;
    background: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
}

.current-plan-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-plan-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.current-plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.current-plan-usage {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.usage-bar {
    width: 160px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border-radius: 50px;
    transition: width 0.4s ease;
}

/* Plans grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 52px;
}

.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.12);
    transform: translateY(-4px);
}

.plan-card.plan-popular {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.1);
}

.plan-card.plan-current {
    border-color: rgba(99, 102, 241, 0.4);
    background: var(--primary-light);
}

.plan-popular-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.plan-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.plan-price-currency {
    font-size: 18px;
    font-weight: 600;
    vertical-align: super;
}

.plan-price-period {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
    flex: 1;
}

.plan-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.plan-features li::before {
    content: '\2713';
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.plan-btn {
    width: 100%;
    padding: 12px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-family: inherit;
}

.plan-btn-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
}

.plan-btn-primary:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.plan-btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

.plan-btn-outline:hover {
    background: var(--primary-light);
}

.plan-btn-current {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: default;
}

.plan-btn-cancel {
    background: transparent;
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    font-size: 12px;
    padding: 8px;
    margin-top: 8px;
}

.plan-btn-cancel:hover {
    background: var(--error-bg);
}

/* Addons section */
.addons-section {
    text-align: center;
    margin-bottom: 48px;
}

.addons-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.addons-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.addons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.addon-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
}

.addon-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.addon-card.addon-current {
    border-color: rgba(99, 102, 241, 0.4);
    background: var(--primary-light);
}

.addon-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.addon-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.addon-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.addon-price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.addon-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: transparent;
    color: var(--primary);
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.addon-btn:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
}

.addon-btn-current {
    border-color: var(--border);
    color: var(--text-muted);
    cursor: default;
}

.addon-btn-current:hover {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

/* Coming Soon — addon cards */
.addon-card.addon-coming-soon {
    opacity: 0.7;
    position: relative;
    flex-wrap: wrap;
}

.addon-coming-soon-badge {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f59e0b;
    margin-bottom: 8px;
}

.addon-btn-disabled {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: not-allowed;
    white-space: nowrap;
    font-family: inherit;
}

/* Coming Soon — section heading tag */
.section-coming-soon-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50px;
    padding: 2px 10px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Landing page Coming Soon tag */
.lp-coming-soon-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50px;
    padding: 2px 10px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Landing addon coming soon state */
.landing-addon-coming-soon {
    opacity: 0.65;
}

/* Usage badge in navbar */
.usage-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.usage-badge:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
}

/* Limit reached modal */
.limit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.limit-modal {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 44px 40px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    animation: modalSlideUp 0.3s ease;
}

.limit-modal-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.limit-modal h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.limit-modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.limit-modal-packs {
    margin-bottom: 24px;
}

.limit-packs-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.limit-packs-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.limit-pack-btn {
    padding: 8px 16px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.limit-pack-btn:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
}

.limit-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ===== Auth Method Toggle ===== */
.auth-method-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
}

.method-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border-radius: 50px;
    font-family: inherit;
}

.method-btn.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.method-btn:hover:not(.active) {
    color: var(--primary);
}

/* Phone input group */
.phone-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.04);
}

.phone-input-group:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.phone-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.1);
}

.phone-prefix {
    padding: 14px 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

/* Phone input with country code dropdown */
.phone-input-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    width: 100% !important;
}

.country-code-dropdown {
    width: 85px !important;
    max-width: 85px !important;
    min-width: 85px !important;
    flex: 0 0 85px !important;
    height: 52px !important;
    padding: 0 6px 0 10px !important;
    background-color: #0F1419 !important;
    border: 1px solid #1F2937 !important;
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
    color: var(--text) !important;
    font-size: 13px !important;
    font-family: inherit !important;
    cursor: pointer !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    box-sizing: border-box !important;
}

.country-code-dropdown:hover {
    background-color: #111827 !important;
    border-color: #374151 !important;
}

.country-code-dropdown:focus {
    border-color: #6366F1 !important;
    background-color: #0A0D11 !important;
}

.country-code-dropdown option {
    background: #1F2937 !important;
    color: var(--text) !important;
}

.phone-input-wrapper input[type="tel"] {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 52px !important;
    padding: 0 16px !important;
    background-color: #0F1419 !important;
    border: 1px solid #1F2937 !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    color: #E5E7EB !important;
    font-size: 14px !important;
    font-family: inherit !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.phone-input-wrapper input[type="tel"]::placeholder {
    color: var(--text-muted) !important;
}

.phone-input-wrapper input[type="tel"]:hover {
    background-color: #111827 !important;
    border-color: #374151 !important;
}

.phone-input-wrapper input[type="tel"]:focus {
    border-color: #6366F1 !important;
    background-color: #0A0D11 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* OTP form */
.otp-desc {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.otp-desc span {
    font-weight: 700;
    color: var(--primary);
}

#otp-code {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    padding: 12px;
}

/* ===== Search Packs Section ===== */
.packs-section {
    text-align: center;
    margin-bottom: 48px;
}

.packs-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.packs-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.packs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.pack-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
}

.pack-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.pack-card-info {
    text-align: left;
}

.pack-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.pack-card-detail {
    font-size: 13px;
    color: var(--text-muted);
}

.pack-card-right {
    text-align: center;
    flex-shrink: 0;
}

.pack-card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.pack-card-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pack-buy-btn {
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: transparent;
    color: var(--primary);
    transition: all 0.2s;
    font-family: inherit;
}

.pack-buy-btn:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
}

/* Pricing page responsive */
@media (max-width: 900px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .packs-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

@media (max-width: 640px) {
    .pricing-main {
        padding: 16px 12px;
    }

    .pricing-hero {
        padding: 24px 0 20px;
    }

    .pricing-hero h1 {
        font-size: 24px;
    }

    .pricing-hero p {
        font-size: 14px;
    }

    .pricing-hero::before {
        width: 300px;
        height: 200px;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
        gap: 16px;
    }

    .plan-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .plan-price {
        font-size: 30px;
    }

    .addons-section h2,
    .packs-section h2 {
        font-size: 20px;
    }

    .addons-grid {
        grid-template-columns: 1fr;
    }

    .addon-card {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
        border-radius: 14px;
        gap: 12px;
    }

    .addon-info h4 {
        font-size: 14px;
    }

    .addon-price {
        font-size: 18px;
    }

    .addon-btn {
        width: 100%;
        padding: 10px 16px;
    }

    .current-plan-banner {
        flex-direction: column;
        text-align: center;
        padding: 14px 16px;
        gap: 12px;
    }

    .current-plan-info {
        flex-direction: column;
        gap: 4px;
    }

    .current-plan-name {
        font-size: 16px;
    }

    .current-plan-usage {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .usage-bar {
        width: 100%;
    }

    .plan-name {
        font-size: 16px;
    }

    .plan-price-period {
        font-size: 12px;
    }

    .plan-features li {
        font-size: 13px;
    }

    .plan-btn {
        padding: 10px;
        font-size: 13px;
    }

    .plan-btn-cancel {
        font-size: 11px;
    }

    .addons-subtitle,
    .packs-subtitle {
        font-size: 13px;
    }

    .packs-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    .pack-card {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
        border-radius: 14px;
        gap: 10px;
    }

    .pack-card-info {
        text-align: center;
    }

    .pack-card-price {
        font-size: 18px;
    }

    .pack-buy-btn {
        width: 100%;
        padding: 10px 16px;
    }
}

/* ===== Leads Page ===== */
.leads-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 28px 60px;
}

.leads-hero {
    text-align: center;
    margin-bottom: 32px;
}

.leads-hero h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.leads-hero p {
    color: var(--text-muted);
    font-size: 15px;
}

.leads-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 18px;
}

.leads-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto 24px;
}

.leads-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 16px;
    transition: border-color 0.2s;
}

.leads-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.leads-search-box .filter-icon {
    font-size: 16px;
    margin-right: 10px;
    opacity: 0.5;
}

.leads-search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    padding: 12px 0;
    outline: none;
    font-family: inherit;
}

.leads-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.leads-empty-state .empty-illustration {
    font-size: 48px;
    margin-bottom: 16px;
}

.leads-empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.leads-empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Map Search Box (inside map) ===== */
.map-search-box {
    width: 300px;
    height: 40px;
    padding: 0 14px;
    margin: 10px 0 0 10px;
    border: 1.5px solid rgba(100, 100, 120, 0.4);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: rgba(30, 30, 40, 0.92);
    color: #fff;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.map-search-box:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-search-box::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ===== Map Locate Button ===== */
.map-locate-btn {
    width: 40px;
    height: 40px;
    margin: 0 10px 10px 0;
    border: none;
    border-radius: 10px;
    background: rgba(30, 30, 40, 0.92);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.2s, transform 0.15s;
}

.map-locate-btn:hover {
    background: rgba(50, 50, 65, 0.95);
    transform: scale(1.05);
}

.map-locate-btn.locating {
    animation: locatePulse 0.8s ease infinite;
}

@keyframes locatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 640px) {
    .leads-main {
        padding: 20px 16px 40px;
    }

    .leads-hero h1 {
        font-size: 22px;
    }

    .leads-filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .leads-filter-bar .btn-export {
        width: 100%;
    }

    .map-search-box {
        width: 200px;
        font-size: 13px;
        height: 36px;
    }
}

/* ===== Chat Widget ===== */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    font-family: inherit;
}

.chat-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(99, 102, 241, 0.6);
}

.chat-toggle-btn.chat-toggle-active {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.chat-toggle-close {
    font-size: 28px;
    line-height: 1;
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    animation: chatSlideUp 0.25s ease;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.chat-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.chat-close-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.chat-close-btn:hover {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Message bubbles */
.chat-msg {
    display: flex;
    max-width: 88%;
}

.chat-msg-user {
    align-self: flex-end;
}

.chat-msg-assistant {
    align-self: flex-start;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-msg-user .chat-msg-bubble {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg-assistant .chat-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    flex-shrink: 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 13px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}

.chat-input-area input::placeholder {
    color: var(--text-muted);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

/* Chat Search Results */
.chat-results-container {
    width: 100%;
    max-width: 320px;
}

.chat-results-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 0 2px;
}

.chat-result-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.chat-result-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.chat-result-card:last-child {
    margin-bottom: 0;
}

.chat-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.chat-result-address {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chat-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.chat-result-rating {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
}

.chat-result-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
}

.chat-result-phone {
    font-size: 11px;
    color: var(--text-secondary);
}

.chat-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.chat-result-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.chat-result-link:hover {
    text-decoration: underline;
}

/* Chat Quick-Reply Buttons */
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 8px;
    animation: quickReplyFadeIn 0.3s ease;
}

@keyframes quickReplyFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-quick-btn {
    padding: 8px 16px;
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.08);
    color: #818cf8;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-quick-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.chat-quick-btn:active {
    transform: translateY(0);
}

/* Chat list items (markdown bullet points) */
.chat-list-item {
    display: block;
    padding-left: 12px;
    position: relative;
    margin: 2px 0;
}

.chat-list-item::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #818cf8;
    font-weight: bold;
}

/* Chat Widget Mobile */
@media (max-width: 640px) {
    .chat-widget {
        bottom: 12px;
        right: 12px;
    }

    .chat-toggle-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .chat-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }

    .chat-header {
        padding: 14px 16px;
    }

    .chat-messages {
        padding: 12px;
        gap: 10px;
    }

    .chat-msg {
        max-width: 92%;
    }

    .chat-input-area {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .chat-input-area input {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* ===== Extra Small Screens (max-width: 380px) ===== */
@media (max-width: 380px) {
    .navbar {
        padding: 8px 10px;
    }

    .nav-link {
        padding: 3px 7px;
        font-size: 10px;
    }

    .nav-title {
        font-size: 14px;
    }

    .nav-left .logo-icon {
        font-size: 18px;
    }

    .search-section h2 {
        font-size: 19px;
    }

    .search-form input {
        height: 50px;
        padding: 0 14px;
        font-size: 15px;
    }

    .search-form .btn {
        height: 50px;
        font-size: 15px;
    }

    .auth-card {
        padding: 22px 14px;
    }

    .tab-switcher {
        max-width: 240px;
    }

    .tab-btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    .dashboard-main,
    .history-main,
    .pricing-main {
        padding: 12px 8px;
    }

    .plan-card {
        padding: 20px 16px;
    }

    .plan-price {
        font-size: 26px;
    }

    .plan-features li {
        font-size: 12px;
    }

    .hp-card {
        padding: 12px;
    }

    .hp-card-prompt {
        font-size: 13px;
    }

    .hp-card-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .stat-chip {
        padding: 10px 8px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 9px;
    }

    .history-hero h1,
    .pricing-hero h1 {
        font-size: 22px;
    }

    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .detail-header h2 {
        font-size: 15px;
    }

    .current-plan-banner {
        padding: 12px;
    }

    .limit-modal {
        padding: 24px 16px;
    }

    .limit-pack-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ===== Integration Page Styles ===== */
.integration-main {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.integration-hero {
    text-align: center;
    margin-bottom: 32px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.05) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.integration-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.integration-hero p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Tab Switcher */
.integration-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.integration-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.integration-tab-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.integration-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-icon {
    font-size: 18px;
}

/* Tab Content */
.integration-tab-content {
    display: none;
}

.integration-tab-content.active {
    display: block;
}

/* Split Panel Layout */
.integration-split-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.integration-panel-left,
.integration-panel-right {
    min-height: 400px;
}

/* Integration Card */
.integration-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s ease;
}

.integration-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.integration-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.integration-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.integration-card-body {
    padding: 24px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-connected {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-connected .status-dot {
    background: #34d399;
}

.status-failed {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.status-failed .status-dot {
    background: #f87171;
}

.status-not-connected {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-not-connected .status-dot {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Integration Actions */
.integration-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* WhatsApp Button */
.btn-whatsapp {
    background: #25D366 !important;
    color: white !important;
    border: none;
}

.btn-whatsapp:hover {
    background: #20BA5A !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

/* Connection Message */
.connection-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.connection-message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.connection-message.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Info List */
.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--primary);
    font-weight: bold;
}

.info-list a {
    color: var(--primary);
    text-decoration: none;
}

.info-list a:hover {
    text-decoration: underline;
}

/* Setup Guide */
.integration-guide {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 24px;
}

.integration-guide h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-step {
    display: flex;
    gap: 16px;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Templates List */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.2s ease;
}

.template-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.template-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.template-item-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.template-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-marketing {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.badge-utility {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-followup {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-custom {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-secondary);
}

.template-item-body {
    margin-bottom: 12px;
}

.template-preview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.template-type {
    display: flex;
    align-items: center;
    gap: 4px;
}

.template-vars {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    color: var(--primary);
}

.template-item-actions {
    display: flex;
    gap: 8px;
}

.btn-danger {
    color: var(--error) !important;
    border-color: var(--error) !important;
}

.btn-danger:hover {
    background: var(--error-bg) !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
}

/* Detected Variables */
.detected-variables {
    margin-top: 12px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
}

.detected-variables strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text);
}

.variables-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-tag {
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* WhatsApp Preview */
.whatsapp-preview {
    background: #0a0a0f;
    border-radius: var(--radius);
    padding: 20px;
    min-height: 200px;
}

.whatsapp-message {
    display: flex;
    justify-content: flex-end;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    background: #25D366;
    color: white;
    border-radius: 12px 12px 0 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.preview-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.preview-info p {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.preview-info code {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

/* Message Logs */
.logs-filters {
    display: flex;
    gap: 12px;
}

.input-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.logs-table-container {
    overflow-x: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table thead {
    background: rgba(255, 255, 255, 0.02);
}

.logs-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.logs-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.logs-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-message {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-sent {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.status-failed {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.status-delivered {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-link_generated {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-secondary);
}

.status-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge-business_api {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.badge-personal_whatsapp {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* Responsive */
@media (max-width: 1024px) {
    .integration-split-panel {
        grid-template-columns: 1fr;
    }

    .integration-panel-right {
        order: -1;
    }

    .integration-guide {
        position: static;
    }
}

@media (max-width: 768px) {
    .integration-main {
        padding: 16px;
    }

    .integration-hero {
        padding: 24px 16px;
    }

    .integration-hero h1 {
        font-size: 24px;
    }

    .integration-tabs {
        flex-direction: column;
    }

    .integration-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .integration-actions {
        flex-direction: column;
    }

    .logs-filters {
        flex-direction: column;
    }

    .logs-table {
        font-size: 12px;
    }

    .logs-table th,
    .logs-table td {
        padding: 10px 12px;
    }
}

/* ========================================
   WHATSAPP MODAL & CHECKBOX STYLES
   ======================================== */

/* WhatsApp Button */
.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-1px);
}

.btn-whatsapp:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

/* WhatsApp Modal Specific */
.whatsapp-modal-content {
    max-width: 700px;
}

.whatsapp-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-option:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.mode-option.active {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

.mode-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.mode-info {
    flex: 1;
}

.mode-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.mode-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.mode-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.mode-status.status-connected {
    color: #25D366;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* WhatsApp Preview Box */
.whatsapp-preview-box {
    margin-top: 16px;
    padding: 16px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 12px;
}

.whatsapp-preview-box h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.preview-message {
    padding: 12px;
    background: rgba(37, 211, 102, 0.15);
    border-radius: 8px;
    color: #25D366;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Alert Boxes */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.alert p {
    margin: 0 0 8px 0;
}

.alert p:last-child {
    margin-bottom: 0;
}

/* Rate Limit Info */
.rate-limit-info {
    padding: 12px 16px;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 8px;
    margin-top: 16px;
}

.rate-limit-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Checkbox Styles */
.lead-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.td-checkbox {
    width: 40px;
    text-align: center;
    padding: 12px 8px !important;
}

#select-all-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ========================================
   INTEGRATIONS PAGE - SCREENSHOT-MATCHED DESIGN
   ======================================== */

.integrations-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 28px;
}

/* Control Bar - Compact */
.integrations-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid #1F2937;
    border-radius: 8px;
    font-size: 14px;
    background: #0F1419;
    color: #E5E7EB;
    transition: border-color 0.2s ease, background 0.2s ease;
    height: 44px;
}

.search-box input::placeholder {
    color: #6B7280;
}

.search-box input:focus {
    outline: none;
    border-color: #374151;
    background: #0A0D11;
}

.category-select {
    padding: 10px 14px;
    border: 1px solid #1F2937;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    background: #0F1419;
    color: #E5E7EB;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 160px;
    height: 44px;
}

.category-select:focus {
    outline: none;
    border-color: #374151;
    background: #0A0D11;
}

@media (max-width: 768px) {
    .integrations-container {
        padding: 16px;
    }

    .integrations-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }

    .search-box input {
        height: 40px;
        padding: 8px 12px 8px 38px;
        font-size: 13px;
    }

    .category-select {
        width: 100%;
        height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .integration-card {
        padding: 14px;
        min-height: 160px;
    }

    .integration-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .integration-name {
        font-size: 14px;
    }

    .integration-description {
        font-size: 11px;
    }

    .configure-btn {
        height: 34px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .integrations-container {
        padding: 12px;
    }

    .search-box input {
        height: 38px;
        font-size: 12px;
    }

    .category-select {
        height: 38px;
        font-size: 12px;
    }

    .integration-card {
        padding: 12px;
        min-height: 150px;
    }

    .integration-card-header {
        margin-bottom: 10px;
    }

    .integration-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .integration-status {
        font-size: 8px;
        padding: 2px 5px;
    }

    .integration-name {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .integration-description {
        font-size: 10px;
        line-height: 1.4;
    }

    .configure-btn {
        height: 32px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Grid Layout - 4 Cards Per Row, Fully Responsive */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    row-gap: 14px;
}

@media (max-width: 1400px) {
    .integrations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .integrations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .integrations-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Design - Compact & Responsive */
.integration-card {
    background: #0F1419;
    border: 1px solid #1F2937;
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 180px;
}

.integration-card:hover {
    border-color: #374151;
    background: #141A21;
    transform: translateY(-2px);
}

.integration-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.integration-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    background: #1A1F2E;
    border: 1px solid #2A2F3E;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.status-connected {
    background: transparent;
    color: #A78BFA;
    border: 1px solid #A78BFA;
}

.status-connected .status-dot {
    background: #A78BFA;
}

.status-not-connected {
    background: transparent;
    color: #EF4444;
    border: 1px solid #EF4444;
}

.status-not-connected .status-dot {
    background: #EF4444;
}

.status-coming-soon {
    background: transparent;
    color: #F59E0B;
    border: 1px solid #F59E0B;
}

.status-coming-soon .status-dot {
    background: #F59E0B;
}

/* Card Body - Compact & Responsive */
.integration-card-body {
    flex: 1;
    margin-bottom: 12px;
}

.integration-name {
    font-size: 15px;
    font-weight: 600;
    color: #F9FAFB;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.integration-description {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer - Compact */
.integration-card-footer {
    margin-top: auto;
}

.configure-btn {
    width: 100%;
    padding: 8px 14px;
    background: #7C3AED;
    color: #FFFFFF;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.configure-btn:hover:not(.disabled) {
    background: #6D28D9;
}

.configure-btn.disabled {
    background: transparent;
    color: #6B7280;
    border: 1px solid #374151;
    cursor: not-allowed;
}

/* Empty State - Screenshot Style */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    border-radius: 12px;
    border: 1px dashed #374151;
    background: #0F1419;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* ========================================
   WHATSAPP INTEGRATION PAGE STYLES
   ======================================== */

/* Breadcrumb */
.integration-breadcrumb {
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.back-link:hover {
    color: #7C3AED;
}

.back-link svg {
    transition: transform 0.2s;
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* Hero Section Updates */
.integration-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-icon {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.integration-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 12px 0;
}

.integration-hero p {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* ========================================
   MESSAGING MODULE STYLES
   ======================================== */

/* Main Container */
.messaging-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
}

.messaging-header {
    margin-bottom: 32px;
}

.messaging-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.messaging-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Messaging Cards Grid */
.messaging-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .messaging-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .messaging-grid {
        grid-template-columns: 1fr;
    }
    .messaging-container {
        padding: 16px;
    }
}

.messaging-card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.messaging-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.messaging-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.messaging-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.messaging-icon svg {
    width: 24px;
    height: 24px;
}

.messaging-icon.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.messaging-icon.logs {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.messaging-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.messaging-badge.templates {
    background: var(--primary-light);
    color: var(--primary);
}

.messaging-badge.business {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.messaging-badge.logs {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.messaging-card-body {
    flex: 1;
    margin-bottom: 20px;
}

.messaging-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.messaging-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.messaging-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.messaging-stats {
    font-size: 13px;
    color: var(--text-muted);
}

.messaging-stats .stat-item span {
    font-weight: 600;
    color: var(--text);
}

.messaging-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.messaging-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ========================================
   TEMPLATES PAGE STYLES
   ======================================== */

.templates-main,
.logs-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.templates-breadcrumb {
    margin-bottom: 24px;
}

.templates-header,
.logs-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.templates-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.header-left .templates-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.templates-header h1,
.logs-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.templates-subtitle,
.logs-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Compact create button in header */
.btn-create-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #6366F1;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-create-compact:hover {
    background: #5558E3;
    transform: translateY(-1px);
}

.btn-create-compact svg {
    width: 14px;
    height: 14px;
}

/* Toolbar */
.templates-toolbar,
.logs-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: #0F1419;
    border: 1px solid #1F2937;
    border-radius: 8px;
    color: #E5E7EB;
    font-size: 13px;
    transition: all 0.15s ease;
}

.search-box input::placeholder {
    color: #6B7280;
}

.search-box input:hover {
    border-color: #374151;
    background: #111827;
}

.search-box input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: #0A0D11;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    background: #0F1419;
    border: 1px solid #1F2937;
    border-radius: 8px;
    color: #E5E7EB;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 140px;
    height: 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' 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");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.15s ease;
}

.filter-select:hover {
    border-color: #374151;
    background-color: #111827;
}

.filter-select:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Dark theme for select options */
.filter-select option {
    background: #111827;
    color: #E5E7EB;
    padding: 10px 14px;
}

.filter-select option:checked {
    background: #6366F1;
    color: #fff;
}

.filter-select option:hover {
    background: #1F2937;
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.info-banner svg {
    flex-shrink: 0;
    color: var(--primary);
}

.info-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Tables */
.templates-table-container,
.logs-table-container {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.templates-table,
.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.templates-table th,
.templates-table td,
.logs-table th,
.logs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.templates-table th,
.logs-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface);
}

.templates-table td,
.logs-table td {
    font-size: 14px;
    color: var(--text);
}

.templates-table tbody tr:hover,
.logs-table tbody tr:hover {
    background: var(--surface-hover);
}

.template-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-name-cell strong {
    font-weight: 600;
}

.template-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Channel Badges */
.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
}

.channel-badge.generic {
    background: var(--primary-light);
    color: var(--primary);
}

.channel-badge.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.channel-badge.email {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.channel-badge.sms {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* Category Tags */
.category-tag {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
}

.status-badge.active,
.status-badge.status-approved,
.status-badge.status-delivered,
.status-badge.status-read {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.inactive,
.status-badge.status-draft {
    background: var(--surface);
    color: var(--text-muted);
}

.status-badge.status-pending,
.status-badge.status-sent {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.status-badge.status-rejected,
.status-badge.status-failed {
    background: var(--error-bg);
    color: var(--error);
}

/* Language Badge */
.lang-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    background: var(--surface);
    border-radius: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Header Type */
.header-type {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Type Badge */
.type-badge {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Actions Cell */
.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.action-btn.delete:hover {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-bg);
}

.action-btn.submit:hover {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-bg);
}

/* Recipient Cell */
.recipient-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recipient-contact {
    font-size: 12px;
    color: var(--text-muted);
}

/* Text Muted */
.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Logs Header Row */
.logs-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Inline Stats Pills */
.logs-stats-inline {
    display: flex;
    gap: 8px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1F2937;
    border-radius: 20px;
    padding: 4px 12px;
}

.stat-pill .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #E5E7EB;
}

.stat-pill .stat-label {
    font-size: 12px;
    color: #9CA3AF;
}

.stat-pill.success {
    background: rgba(34, 197, 94, 0.15);
}

.stat-pill.success .stat-value {
    color: #22C55E;
}

.stat-pill.error {
    background: rgba(239, 68, 68, 0.15);
}

.stat-pill.error .stat-value {
    color: #EF4444;
}

/* Logs Stats (Legacy - keep for compatibility) */
.logs-stats {
    display: flex;
    gap: 16px;
}

.stat-box {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
}

.stat-box .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Icon Buttons */
.actions-cell {
    white-space: nowrap;
}

.action-icons {
    display: inline-flex;
    gap: 6px;
}

.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #1F2937;
    color: #9CA3AF;
    text-decoration: none;
    transition: all 0.15s ease;
}

.action-icon-btn:hover {
    transform: translateY(-1px);
}

.action-icon-btn.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.action-icon-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.25);
}

.action-icon-btn.call {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.action-icon-btn.call:hover {
    background: rgba(59, 130, 246, 0.25);
}

.action-icon-btn.email {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.action-icon-btn.email:hover {
    background: rgba(245, 158, 11, 0.25);
}

.action-icon-btn.directions {
    background: rgba(99, 102, 241, 0.15);
    color: #6366F1;
}

.action-icon-btn.directions:hover {
    background: rgba(99, 102, 241, 0.25);
}

.action-icon-btn svg {
    width: 14px;
    height: 14px;
}

/* Pagination */
.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
}

#page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.modal-content.modal-lg {
    max-width: 640px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

#template-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #0F1419;
    border: 1px solid #1F2937;
    border-radius: 8px;
    color: #E5E7EB;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' 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");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.form-group select option {
    background: #111827;
    color: #E5E7EB;
    padding: 10px;
}

.form-group select option:checked {
    background: #6366F1;
    color: #fff;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #374151;
    background: #111827;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: #0A0D11;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Variable Chips for Template Editor */
.variable-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.variable-hint {
    font-size: 12px;
    color: #6B7280;
    margin-right: 4px;
}

.variable-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    color: #A5B4FC;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
}

.variable-chip:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #C7D2FE;
    transform: translateY(-1px);
}

.variable-chip:active {
    transform: translateY(0);
    background: rgba(99, 102, 241, 0.35);
}

.variable-chip::before {
    content: '{{';
    opacity: 0.6;
    margin-right: 1px;
}

.variable-chip::after {
    content: '}}';
    opacity: 0.6;
    margin-left: 1px;
}

.modal-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-solid);
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.modal-footer .btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 100px;
    width: auto !important;
    margin-top: 0 !important;
}

/* Responsive for Templates/Logs Pages */
@media (max-width: 768px) {
    .templates-main,
    .logs-main {
        padding: 16px;
    }

    .templates-header,
    .logs-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .logs-stats {
        flex-wrap: wrap;
        width: 100%;
    }

    .stat-box {
        flex: 1;
        min-width: 80px;
        padding: 12px 16px;
    }

    .stat-box .stat-value {
        font-size: 20px;
    }

    .templates-toolbar,
    .logs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .templates-table-container,
    .logs-table-container {
        overflow-x: auto;
    }

    .templates-table,
    .logs-table {
        min-width: 600px;
    }
}

/* Messaging Redirect Banner */
.messaging-redirect-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
}

.banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.banner-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 640px) {
    .messaging-redirect-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .messaging-redirect-banner .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Integration Section (non-tabbed) */
.integration-section {
    margin-bottom: 24px;
}

/* ================================================
   TEMPLATE EDITOR MODAL STYLES
   ================================================ */

.template-editor-modal {
    max-width: 1100px !important;
    width: 95% !important;
    max-height: 92vh;
    background: linear-gradient(180deg, #0D1117 0%, #161B22 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.08);
}

.template-editor-modal .modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.template-editor-modal .modal-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-editor-modal .modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #F9FAFB;
    margin: 0;
    letter-spacing: -0.02em;
}

.template-editor-modal .modal-subtitle {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
}

.template-editor-modal .modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.template-editor-modal .modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

/* Editor Layout */
.template-editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    max-height: calc(92vh - 160px);
    overflow: hidden;
}

.template-editor-panel {
    padding: 24px 28px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.template-preview-panel {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #E5E7EB;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title svg {
    color: #6366F1;
}

.editor-section {
    margin-bottom: 28px;
}

.editor-section:last-child {
    margin-bottom: 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.template-editor-modal .form-group {
    margin-bottom: 0;
}

.template-editor-modal .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.template-editor-modal .form-group input,
.template-editor-modal .form-group select {
    height: 44px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #F3F4F6;
    font-size: 14px;
    transition: all 0.2s ease;
}

.template-editor-modal .form-group input:hover,
.template-editor-modal .form-group select:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.template-editor-modal .form-group input:focus,
.template-editor-modal .form-group select:focus {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}


/* Rich Text Editor Wrapper */
.rich-editor-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

/* Quill Toolbar Customization */
#quill-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#quill-toolbar .ql-formats {
    display: flex;
    gap: 2px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#quill-toolbar .ql-formats:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

#quill-toolbar button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

#quill-toolbar button:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #A5B4FC;
}

#quill-toolbar button.ql-active {
    background: rgba(99, 102, 241, 0.25);
    color: #818CF8;
}

#quill-toolbar button svg {
    stroke: currentColor;
}

#quill-toolbar .ql-stroke {
    stroke: currentColor !important;
}

#quill-toolbar .ql-fill {
    fill: currentColor !important;
}

#quill-toolbar .custom-btn {
    font-size: 16px;
    padding: 0;
}

/* Quill Editor */
#quill-editor {
    background: transparent;
    min-height: 180px;
    max-height: 250px;
    overflow-y: auto;
}

#quill-editor .ql-editor {
    padding: 16px;
    color: #E5E7EB;
    font-size: 14px;
    line-height: 1.6;
    min-height: 180px;
}

#quill-editor .ql-editor.ql-blank::before {
    color: #6B7280;
    font-style: normal;
}

#quill-editor .ql-editor p {
    margin-bottom: 8px;
}

#quill-editor .ql-editor a {
    color: #818CF8;
}

/* Override Quill snow theme for dark mode */
.ql-container.ql-snow {
    border: none;
}

.ql-toolbar.ql-snow {
    border: none;
}

/* Media Insert Buttons */
.media-insert-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.media-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #9CA3AF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    color: #A5B4FC;
}

.media-btn svg {
    opacity: 0.7;
}

/* Variable Section */
.variable-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.variable-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 12px;
}

.variable-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    color: #A5B4FC;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variable-chip:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.variable-chip .chip-icon {
    font-size: 12px;
}


/* Phone Preview Mockup */
.phone-preview-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 0;
}

.phone-mockup {
    width: 280px;
    background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
    border-radius: 32px;
    padding: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-notch {
    width: 100px;
    height: 24px;
    background: #000;
    border-radius: 0 0 14px 14px;
    margin: 0 auto 8px;
}

.phone-screen {
    background: #0A0D11;
    border-radius: 20px;
    overflow: hidden;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #128C7E 0%, #075E54 100%);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.chat-contact {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.contact-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 260px;
}

.message-bubble {
    max-width: 90%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    margin-bottom: 4px;
}

.message-bubble.outgoing {
    background: linear-gradient(135deg, #DCF8C6 0%, #C5E1A5 100%);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #1F2937;
}

.message-content {
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content p {
    margin: 0 0 6px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content .preview-placeholder {
    color: #6B7280;
    font-style: italic;
}

.message-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.message-content .media-embed {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-content .media-embed svg {
    color: #128C7E;
}

.message-time {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.45);
    display: block;
    text-align: right;
    margin-top: 4px;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1F2937;
}

.input-placeholder {
    flex: 1;
    padding: 10px 14px;
    background: #374151;
    border-radius: 20px;
    font-size: 13px;
    color: #6B7280;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #128C7E;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Preview Channel Badge */
.preview-channel-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    margin-top: 16px;
    font-size: 12px;
    color: #9CA3AF;
}

.preview-channel-badge .badge-icon {
    font-size: 14px;
}


/* Media Modal */
.modal-sm {
    max-width: 420px !important;
}

.media-preview-box {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    overflow: hidden;
}

.media-preview-box img,
.media-preview-box video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.media-preview-box .preview-placeholder-text {
    color: #6B7280;
    font-size: 13px;
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    background: #1F2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10100;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.emoji-grid button {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-grid button:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.1);
}

/* Template Editor Footer */
.template-editor-modal .modal-footer {
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-ghost {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #E5E7EB;
}

.btn-save {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-save svg {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 900px) {
    .template-editor-layout {
        grid-template-columns: 1fr;
    }

    .template-preview-panel {
        display: none;
    }

    .template-editor-panel {
        border-right: none;
    }

    .template-editor-modal {
        max-width: 95% !important;
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .media-insert-row {
        flex-direction: column;
    }

    .template-editor-modal .modal-header {
        padding: 16px 20px;
    }

    .template-editor-panel {
        padding: 16px 20px;
    }
}

/* ===== Lead Detail Page - Modern Redesign ===== */

.lead-detail-page {
    background: linear-gradient(180deg, #0a0a0f 0%, #111118 100%);
    min-height: 100vh;
}

.lead-detail-main {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 72px;
}

/* Loading & Error States */
.ld-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    color: var(--text-secondary);
}

.ld-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.ld-error-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.ld-error h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.ld-error p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Hero Section */
.ld-hero {
    position: relative;
    height: 420px;
    overflow: hidden;
}

.ld-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
}

.ld-back-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

/* Hero photo gallery controls */
.hero-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.hero-gallery-btn:hover {
    background: rgba(99,102,241,0.7);
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-50%) scale(1.08);
}
.hero-gallery-prev-btn { left: 16px; }
.hero-gallery-next-btn { right: 16px; }
.hero-gallery-counter {
    position: absolute;
    bottom: 14px;
    right: 16px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 14px;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.1);
}

.ld-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: top center;
    background-color: #1a1a2e;
}

.ld-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10, 10, 15, 0.2) 0%,
        rgba(10, 10, 15, 0.6) 50%,
        rgba(10, 10, 15, 0.95) 100%
    );
}

.ld-hero-overlay {
    display: none;
}

.ld-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.ld-business-photo {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border: 3px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ld-business-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ld-photo-placeholder {
    font-size: 40px;
    opacity: 0.5;
}

.ld-hero-info {
    flex: 1;
    min-width: 0;
}

.ld-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ld-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.ld-status-badge.closed,
.ld-status-badge.closed_temporarily {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.ld-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
    color: #a78bfa;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.ld-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ld-address {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
}

.ld-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ld-stars {
    display: flex;
    gap: 2px;
}

.ld-star {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.ld-star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.ld-rating-text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.ld-review-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Quick Actions Bar */
.ld-actions-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 24px 30px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ld-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    border-radius: 12px;
}

.ld-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.ld-action-btn span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.ld-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ld-action-call {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.ld-action-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
}

.ld-action-directions {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.ld-action-website {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
}

/* Content Grid */
.ld-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 30px 40px;
}

.ld-left-column,
.ld-right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.ld-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.ld-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ld-card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.ld-card-header h3 svg {
    color: var(--primary);
}

.ld-card-body {
    padding: 20px 24px;
}

/* Lead Detail — Photos Gallery */
.ld-photos-gallery {
    display: flex;
    flex-direction: column;
}
.ld-gallery-main-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}
.ld-gallery-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.ld-gallery-btn {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}
.ld-gallery-btn:hover {
    background: rgba(99,102,241,0.35);
    border-color: rgba(99,102,241,0.6);
}
.ld-gallery-counter {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    font-weight: 600;
    min-width: 52px;
    text-align: center;
}
.ld-gallery-thumbs {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ld-gallery-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.ld-gallery-thumb:hover { opacity: 0.8; }
.ld-gallery-thumb.active {
    opacity: 1;
    border-color: #6366f1;
}

/* Detail Rows */
.ld-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ld-detail-row:last-child {
    border-bottom: none;
}

.ld-detail-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    flex-shrink: 0;
}

.ld-detail-content {
    flex: 1;
    min-width: 0;
}

.ld-detail-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ld-detail-value {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

.ld-detail-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.ld-detail-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.ld-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ld-tag {
    display: inline-flex;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
}

/* Add Note Button */
.ld-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ld-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Notes Timeline */
.ld-notes-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ld-empty-notes {
    text-align: center;
    padding: 40px 20px;
}

.ld-empty-icon {
    font-size: 40px;
    opacity: 0.4;
    margin-bottom: 12px;
}

.ld-empty-notes p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 4px 0;
}

.ld-empty-notes span {
    font-size: 13px;
    color: var(--text-muted);
}

.ld-note-item {
    position: relative;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.2s;
}

.ld-note-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.ld-note-item.pinned {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.ld-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ld-note-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.ld-note-type.call { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.ld-note-type.meeting { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.ld-note-type.follow_up { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }

.ld-note-date {
    font-size: 12px;
    color: var(--text-muted);
}

.ld-note-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
}

.ld-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ld-note-action {
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.ld-note-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.ld-note-action.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Deep Search Card - Modern */
.ld-deep-search-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.ld-ds-state {
    padding: 0;
}

.ld-ds-intro {
    text-align: center;
    padding: 40px 24px;
}

.ld-ds-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.ld-ds-intro h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px 0;
}

.ld-ds-intro p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* Deep Search Progress */
.ld-ds-progress {
    text-align: center;
    padding: 40px 24px;
}

.ld-ds-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.ld-ds-progress h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.ld-ds-progress > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.ld-ds-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 220px;
    margin: 0 auto;
}

.ld-ds-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.3s;
}

.ld-ds-step.active {
    opacity: 1;
    color: var(--primary);
}

.ld-ds-step-icon {
    font-size: 18px;
}

/* Deep Search Results */
.ld-ds-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ld-ds-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.ld-ds-time {
    font-size: 12px;
    color: var(--text-muted);
}

.ld-ds-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ld-ds-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.ld-ds-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.ld-ds-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ld-ds-tag {
    display: inline-flex;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
}

.ld-ds-rerun {
    margin-top: 20px;
}

/* Deep Search Error */
.ld-ds-error {
    text-align: center;
    padding: 40px 24px;
}

.ld-ds-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ld-ds-error h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px 0;
}

.ld-ds-error p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

/* Lead Detail Modal */
.ld-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ld-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ld-modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ld-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ld-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.ld-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.ld-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.ld-modal-body {
    padding: 24px;
}

.ld-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ld-form-group {
    margin-bottom: 20px;
}

.ld-form-group:last-child {
    margin-bottom: 0;
}

.ld-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.ld-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}

.ld-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.ld-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Lead Detail Responsive */
@media (max-width: 1024px) {
    .ld-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lead-detail-main {
        padding-top: 60px;
    }

    .ld-hero {
        height: 340px;
    }

    .ld-hero-content {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .ld-business-photo {
        width: 80px;
        height: 80px;
    }

    .ld-title {
        font-size: 24px;
    }

    .ld-actions-bar {
        gap: 8px;
        padding: 20px;
        flex-wrap: wrap;
    }

    .ld-action-btn {
        padding: 10px 16px;
    }

    .ld-action-icon {
        width: 40px;
        height: 40px;
    }

    .ld-content-grid {
        padding: 20px;
    }

    .ld-card-body {
        padding: 16px;
    }

    .ld-modal-content {
        max-width: 100%;
        margin: 0 10px;
    }
}

/* Lead Name Links in Leads Page */
.lead-name-link,
.card-name-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.lead-name-link:hover,
.card-name-link:hover {
    color: var(--primary);
}

.card-name-link {
    display: block;
}

.card-name-link .card-name {
    transition: color 0.2s;
}

.card-name-link:hover .card-name {
    color: var(--primary);
}

/* ===== Lead Status — v23 ===== */

/* Custom status filter dropdown (replaces native select) */
.leads-status-filter {
    position: relative;
    display: inline-flex;
}
.status-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    min-width: 148px;
    white-space: nowrap;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.status-filter-trigger:hover { border-color: var(--primary); }
.status-filter-trigger.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.sf-trigger-inner {
    display: flex;
    align-items: center;
    gap: 7px;
}
.filter-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.status-filter-trigger.open .filter-chevron { transform: rotate(180deg); }
.status-filter-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    background: #1a1a2e;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(0,0,0,0.5);
    z-index: 600;
    display: none;
}
.status-filter-panel.open { display: block; }
.status-filter-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.status-filter-opt:hover { background: rgba(99,102,241,0.12); color: var(--text); }
.status-filter-opt.active { color: var(--text); font-weight: 600; }
/* Colored dots in filter options and trigger */
.sf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.sf-dot-hidden         { display: none; }
.sf-dot-new            { background: #3b82f6; }
.sf-dot-qualified      { background: #10b981; }
.sf-dot-not-interested { background: #6b7280; }
.sf-dot-invalid        { background: #ef4444; }

/* Lead status badge (display column) */
.lead-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-transform: uppercase;
}
.lead-status-new            { background: rgba(59,130,246,0.15);  color: #60a5fa;  border: 1px solid rgba(59,130,246,0.3); }
.lead-status-qualified      { background: rgba(16,185,129,0.15);  color: #34d399;  border: 1px solid rgba(16,185,129,0.3); }
.lead-status-not-interested { background: rgba(107,114,128,0.12); color: #9ca3af;  border: 1px solid rgba(107,114,128,0.25); }
.lead-status-invalid        { background: rgba(239,68,68,0.12);   color: #f87171;  border: 1px solid rgba(239,68,68,0.25); }

/* Lead status column width */
.td-lead-status { white-space: nowrap; min-width: 110px; }

/* Card lead status row */
.card-lead-status-row {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Status trigger button in table / card actions */
.table-action-status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
}
.table-action-status-btn:hover {
    background: rgba(99,102,241,0.15);
    border-color: var(--primary);
    color: var(--primary);
}
.card-action-status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.card-action-status-btn:hover {
    background: rgba(99,102,241,0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Lead Status Popup ===== */
.lead-status-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.lead-status-popup-box {
    background: #1a1a2e;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    min-width: 300px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    overflow: hidden;
}
.lead-status-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}
.lead-status-popup-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.lead-status-popup-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.lead-status-popup-close:hover { background: var(--border); color: var(--text); }

.status-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 18px 20px;
}
.status-option-btn {
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    border: 2px solid transparent;
    letter-spacing: 0.2px;
}
.status-option-btn.opt-new {
    background: rgba(59,130,246,0.1);
    color: #60a5fa;
    border-color: rgba(59,130,246,0.2);
}
.status-option-btn.opt-new:hover,
.status-option-btn.opt-new.selected {
    background: rgba(59,130,246,0.25);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.status-option-btn.opt-qualified {
    background: rgba(16,185,129,0.1);
    color: #34d399;
    border-color: rgba(16,185,129,0.2);
}
.status-option-btn.opt-qualified:hover,
.status-option-btn.opt-qualified.selected {
    background: rgba(16,185,129,0.25);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.status-option-btn.opt-not-interested {
    background: rgba(107,114,128,0.1);
    color: #9ca3af;
    border-color: rgba(107,114,128,0.2);
}
.status-option-btn.opt-not-interested:hover,
.status-option-btn.opt-not-interested.selected {
    background: rgba(107,114,128,0.25);
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107,114,128,0.15);
}
.status-option-btn.opt-invalid {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border-color: rgba(239,68,68,0.2);
}
.status-option-btn.opt-invalid:hover,
.status-option-btn.opt-invalid.selected {
    background: rgba(239,68,68,0.25);
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}
.lead-status-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   DEEP AREA SEARCH — Tab, Controls, Map Container
   ============================================================ */

/* ---- Controls wrapper ---- */
.deep-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 800px;
    margin: 0 auto;
}

/* ---- Business type input with icon ---- */
.deep-field {
    position: relative;
    display: flex;
    align-items: center;
}
.deep-field-icon {
    position: absolute;
    left: 18px;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: var(--text-muted);
    transition: color 0.2s;
    z-index: 1;
}
.deep-field-input {
    width: 100%;
    height: 54px;
    padding: 0 18px 0 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.deep-field-input::placeholder { color: var(--text-muted); }
.deep-field-input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
}
.deep-field-input:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.deep-field:focus-within .deep-field-icon { color: var(--primary); }

/* ---- Shape selector ---- */
.deep-shape-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.deep-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.deep-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.deep-section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Shape cards grid */
.shape-type-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.shape-type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
    overflow: hidden;
}
/* Radial glow overlay */
.shape-type-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    border-radius: inherit;
}
.shape-type-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.14);
}
.shape-type-card:hover::before { opacity: 1; }
.shape-type-card.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.09);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 8px 28px rgba(99, 102, 241, 0.22);
    transform: translateY(-1px);
}
.shape-type-card.active::before { opacity: 1; }

/* Active dot indicator */
.shape-type-card.active::after {
    content: '';
    position: absolute;
    top: 11px;
    right: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.9);
}

/* Icon box */
.shape-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}
.shape-type-card:hover .shape-card-icon,
.shape-type-card.active .shape-card-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}
.shape-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.shape-type-card:hover .shape-card-name,
.shape-type-card.active .shape-card-name { color: var(--text); }
.shape-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
}
.shape-type-card.active .shape-card-desc { color: var(--text-secondary); }

/* ---- Splits slider card ---- */
.deep-splits-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.deep-splits-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.deep-splits-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.deep-splits-label svg { color: var(--primary); flex-shrink: 0; }
.deep-splits-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.deep-splits-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0;
    cursor: pointer;
}
.deep-splits-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.14);
    transition: transform 0.15s, box-shadow 0.15s;
}
.deep-splits-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 16px rgba(99, 102, 241, 0.7), 0 0 0 5px rgba(99, 102, 241, 0.18);
}
.deep-splits-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}
.deep-splits-range::-moz-range-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}
.deep-splits-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
.deep-splits-meta strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- Info banner ---- */
.deep-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}
.deep-info-icon {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
}

/* ---- Action row ---- */
.deep-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-deep-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 42px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-deep-clear:hover {
    border-color: rgba(248, 113, 113, 0.45);
    color: var(--error);
    background: rgba(248, 113, 113, 0.07);
}
.btn-deep-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 14px;
}

/* ---- Deep map container ---- */
#deep-map-container {
    height: 440px;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 4px;
}

/* ---- Mobile overrides ---- */
@media (max-width: 640px) {
    #deep-map-container { height: 300px; }
    .shape-type-group { gap: 8px; }
    .shape-type-card { padding: 14px 10px 12px; border-radius: 12px; }
    .shape-card-icon { width: 44px; height: 44px; }
    .shape-card-desc { display: none; }
    .deep-action-row { flex-direction: column; }
    .btn-deep-search { width: 100%; }
    .btn-deep-clear { width: 100%; justify-content: center; }
}

/* ============================================================
   NOTES MODAL  (uses .ld-modal base + nm-* overrides)
   ============================================================ */

/* Raise z-index above map / nav elements */
#nm-overlay {
    z-index: 3000;
    animation: nmOverlayIn 0.22s ease;
}
@keyframes nmOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Notes modal content — wider, taller, flex-column */
.nm-content {
    max-width: 580px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nmContentIn 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes nmContentIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Scrollable notes area */
.nm-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nm-body::-webkit-scrollbar { width: 4px; }
.nm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ---- WhatsApp-style chat bubble notes ---- */
.nm-chat-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px 10px;
}

/* Inside the modal body — no extra side padding (nm-body already handles scroll) */
.nm-body > .nm-chat-list {
    padding: 12px 14px 8px;
}

/* Inside lead-detail card body — card already has its own padding */
.ld-card-body > .nm-chat-list {
    padding: 4px 0 8px;
}

/* Empty state */
.nm-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 36px 20px;
    text-align: center;
}
.nm-chat-empty p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 4px 0 0;
}
.nm-chat-empty span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Bubble wrapper — left-aligned, max 88% wide */
.nm-bubble {
    max-width: 88%;
    width: fit-content;
    align-self: flex-start;
    position: relative;
}

/* The actual bubble */
.nm-bubble-inner {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px 16px 16px 16px;
    padding: 9px 12px 7px;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}
.nm-bubble:hover .nm-bubble-inner {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.13);
}
.nm-bubble.pinned .nm-bubble-inner {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.28);
    border-radius: 4px 16px 16px 16px;
}

/* Top row: type badge + hover actions */
.nm-bubble-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

/* Type badge */
.nm-bubble-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    white-space: nowrap;
    flex-shrink: 0;
}
.nm-bubble-badge.call      { background: rgba(34, 197, 94, 0.15);  color: #4ade80; }
.nm-bubble-badge.meeting   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.nm-bubble-badge.follow_up { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.nm-bubble-badge.other     { background: rgba(255, 255, 255, 0.07); color: var(--text-secondary); }

/* Hover icon action buttons */
.nm-bubble-acts {
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.nm-bubble:hover .nm-bubble-acts { opacity: 1; }

.nm-bact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s, transform 0.1s;
}
.nm-bact:hover             { background: rgba(255, 255, 255, 0.15); transform: scale(1.1); }
.nm-bact.delete:hover      { background: rgba(239, 68, 68, 0.2); }

/* Note text */
.nm-bubble-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
    margin: 0 0 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Bottom row: pin indicator + timestamp */
.nm-bubble-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.nm-pin-ind {
    font-size: 10px;
    color: #a5b4fc;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.nm-bubble-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Form section at the bottom */
.nm-form-section {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 18px 24px 20px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.018);
}

/* ---- Note type pill selector ---- */
.nm-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.nm-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.nm-type-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    transform: translateY(-1px);
}
.nm-type-pill.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
    font-weight: 600;
}

/* ---- Textarea ---- */
.nm-textarea {
    width: 100%;
    min-height: 76px;
    max-height: 160px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    margin-bottom: 12px;
}
.nm-textarea::placeholder { color: var(--text-muted); }
.nm-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: rgba(99, 102, 241, 0.04);
}

/* ---- Form action buttons ---- */
.nm-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.nm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 18px;
    height: 38px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.nm-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}
.nm-btn-primary:active  { transform: translateY(0); }
.nm-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nm-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text);
}

/* ---- Table / Card Notes action buttons ---- */
.table-action-notes { color: #a78bfa; }
.table-action-notes:hover {
    background: rgba(167, 139, 250, 0.15) !important;
    color: #c4b5fd !important;
}
.card-action-notes { color: #a78bfa; }
.card-action-notes:hover {
    background: rgba(167, 139, 250, 0.15) !important;
    color: #c4b5fd !important;
}

@media (max-width: 640px) {
    .nm-content { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }
    #nm-overlay { align-items: flex-end; padding: 0; }
}

/* =====================================================
   LEAD DETAIL PAGE v2 — World-Class Premium UI
   Inspired by Linear, Vercel, Raycast design systems
   ===================================================== */

/* ── Base ── */
.lead-detail-page { background: #090b14; min-height: 100vh; }
.ldp-main { padding-top: 64px; }

/* ── Loading ── */
.ldp-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 70vh; gap: 16px;
}
.ldp-loading p { font-size: 14px; color: rgba(255,255,255,0.3); font-weight: 500; letter-spacing: 0.2px; }
.ldp-spinner {
    width: 40px; height: 40px;
    border: 2px solid rgba(99,102,241,0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* ── Error ── */
.ldp-error {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 70vh; gap: 14px;
    text-align: center; padding: 40px 20px;
}
.ldp-error-icon {
    width: 72px; height: 72px; border-radius: 24px;
    background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.15);
    display: flex; align-items: center; justify-content: center; color: #f87171;
    box-shadow: 0 0 40px rgba(239,68,68,0.08);
}
.ldp-error h3 { font-size: 22px; font-weight: 700; color: #fff; margin: 0; }
.ldp-error p  { font-size: 14px; color: rgba(255,255,255,0.4); margin: 0; }

/* ====================================================
   HERO
   ==================================================== */
.ldp-hero {
    position: relative;
    height: 520px;
    overflow: hidden;
    background: #0d0e1a;
}

/* BG Image with subtle zoom effect */
.ldp-hero-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #0d0e1a;
    transform: scale(1.04);
    transition: transform 8s ease;
}
.ldp-hero:hover .ldp-hero-bg { transform: scale(1.0); }

/* Cinematic triple-gradient overlay */
.ldp-hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(to top,  #090b14 0%, rgba(9,11,20,0.85) 28%, transparent 58%),
        linear-gradient(to right, rgba(9,11,20,0.65) 0%, transparent 55%),
        linear-gradient(180deg, rgba(9,11,20,0.38) 0%, transparent 42%);
}

/* Gallery controls */
.ldp-gallery-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 10; width: 44px; height: 44px; border-radius: 50%;
    background: rgba(9,11,20,0.55); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1); color: #fff;
    font-size: 22px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.ldp-gallery-btn:hover {
    background: rgba(99,102,241,0.5); border-color: rgba(99,102,241,0.4);
    transform: translateY(-50%) scale(1.08);
}
.ldp-gallery-prev { left: 20px; }
.ldp-gallery-next { right: 20px; }
.ldp-gallery-counter {
    position: absolute; bottom: 20px; right: 20px; z-index: 10;
    background: rgba(9,11,20,0.65); backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8); font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; padding: 5px 12px; border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Back pill button */
.ldp-back {
    position: absolute; top: 22px; left: 24px; z-index: 20;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px 8px 10px;
    background: rgba(9,11,20,0.5); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 100px;
    color: rgba(255,255,255,0.75); text-decoration: none;
    font-size: 13px; font-weight: 600; letter-spacing: 0.1px;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.ldp-back:hover {
    background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.3); color: #fff;
}

/* Hero body — anchored to bottom, above overlay */
.ldp-hero-body {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
    padding: 0 32px 36px;
    display: flex; align-items: flex-end; gap: 24px;
}

/* Business Avatar */
.ldp-avatar {
    width: 100px; height: 100px; border-radius: 22px; flex-shrink: 0;
    background: linear-gradient(135deg, #1a1b2e 0%, #252637 100%);
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.15),
        0 16px 48px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.ldp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ldp-avatar-ph { font-size: 38px; opacity: 0.4; }

/* Hero Info Text */
.ldp-hero-info { flex: 1; min-width: 0; }

.ldp-chips {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.ldp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 100px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.ldp-chip-green {
    background: rgba(34,197,94,0.12); color: #4ade80;
    border: 1px solid rgba(34,197,94,0.2);
}
.ldp-chip-green::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #4ade80; display: inline-block; flex-shrink: 0;
    box-shadow: 0 0 6px rgba(74,222,128,0.8);
}
.ldp-chip-green.closed::before,
.ldp-chip-green.closed_temporarily::before,
.ldp-chip-green.permanently_closed::before {
    background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.8);
}
.ldp-chip-green.closed,
.ldp-chip-green.closed_temporarily,
.ldp-chip-green.permanently_closed {
    background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.2);
}
.ldp-chip-purple {
    background: rgba(139,92,246,0.14); color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.25);
}

.ldp-biz-name {
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 800; color: #fff; margin: 0 0 8px 0;
    line-height: 1.1; letter-spacing: -1px;
    text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.ldp-addr-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.ldp-addr-row svg { opacity: 0.5; flex-shrink: 0; }
.ldp-addr { font-size: 14px; color: rgba(255,255,255,0.52); margin: 0; }

.ldp-rating { display: flex; align-items: center; gap: 8px; }
.ldp-stars  { display: flex; gap: 2px; }
.ldp-star   { width: 15px; height: 15px; color: #fbbf24; }
.ldp-star.empty { color: rgba(255,255,255,0.15); }
.ldp-rating-num { font-size: 14px; font-weight: 700; color: #fff; }
.ldp-rating-rev { font-size: 13px; color: rgba(255,255,255,0.38); }

/* ====================================================
   QUICK ACTIONS BAR
   ==================================================== */
.ldp-actions {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; flex-wrap: wrap;
    padding: 16px 32px;
    background: rgba(255,255,255,0.016);
    border-bottom: 1px solid rgba(255,255,255,0.048);
}
.ldp-act {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 20px; border-radius: 100px;
    text-decoration: none; font-size: 13px; font-weight: 600;
    color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer; font-family: inherit;
    transition: all 0.18s; white-space: nowrap;
}
.ldp-act:hover {
    background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15);
    color: #fff; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.ldp-act-ico {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ldp-act-call .ldp-act-ico      { background: linear-gradient(145deg,#22c55e,#15803d); color:#fff; box-shadow: 0 4px 12px rgba(34,197,94,0.35); }
.ldp-act-whatsapp .ldp-act-ico  { background: linear-gradient(145deg,#25d366,#128c7e); color:#fff; box-shadow: 0 4px 12px rgba(37,211,102,0.35); }
.ldp-act-directions .ldp-act-ico{ background: linear-gradient(145deg,#3b82f6,#1d4ed8); color:#fff; box-shadow: 0 4px 12px rgba(59,130,246,0.35); }
.ldp-act-website .ldp-act-ico   { background: linear-gradient(145deg,#8b5cf6,#6d28d9); color:#fff; box-shadow: 0 4px 12px rgba(139,92,246,0.35); }

/* ====================================================
   CONTENT GRID
   ==================================================== */
.ldp-grid {
    display: grid; grid-template-columns: 360px 1fr; gap: 20px;
    padding: 28px 32px 60px; max-width: 1340px; margin: 0 auto; align-items: start;
}
.ldp-sidebar, .ldp-col { display: flex; flex-direction: column; gap: 16px; }

/* ====================================================
   CARD BASE
   ==================================================== */
.ldp-card {
    border-radius: 20px; overflow: hidden;
    background: rgba(255,255,255,0.026);
    border: 1px solid rgba(255,255,255,0.065);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.055),
        0 1px 3px rgba(0,0,0,0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ldp-card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 4px 20px rgba(0,0,0,0.25);
}
.ldp-card-hd {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.048);
    font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
    color: rgba(255,255,255,0.45); text-transform: uppercase;
}
.ldp-card-hd > span { display: flex; align-items: center; gap: 8px; }
.ldp-card-hd svg { color: #6366f1; }
.ldp-card-bd { padding: 16px 20px; }

/* ====================================================
   CONTACT ROWS
   ==================================================== */
.ldp-row {
    display: flex; align-items: flex-start; gap: 14px; padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,0.035);
}
.ldp-row:last-child  { border-bottom: none; padding-bottom: 0; }
.ldp-row:first-child { padding-top: 0; }
.ldp-row-ico {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.15);
    color: #818cf8; margin-top: 1px;
}
.ldp-row-content { flex: 1; min-width: 0; }
.ldp-row-lbl {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: rgba(255,255,255,0.25); margin-bottom: 4px;
}
.ldp-row-val { font-size: 13px; color: rgba(255,255,255,0.78); word-break: break-word; line-height: 1.5; }
.ldp-link { color: #818cf8; text-decoration: none; transition: color 0.15s; }
.ldp-link:hover { color: #a5b4fc; text-decoration: underline; }
.ldp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ldp-tag {
    display: inline-flex; padding: 3px 10px;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.18);
    border-radius: 100px; font-size: 11px; font-weight: 500; color: #a5b4fc;
}

/* Photo thumbnails */
.ld-gallery-thumbs {
    display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px;
}
.ld-gallery-thumb {
    width: 56px; height: 56px; object-fit: cover; border-radius: 10px;
    cursor: pointer; opacity: 0.45; border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s; flex-shrink: 0;
}
.ld-gallery-thumb:hover { opacity: 0.8; transform: scale(1.05); }
.ld-gallery-thumb.active { opacity: 1; border-color: #6366f1; }

/* ====================================================
   NOTES CARD
   ==================================================== */
.ldp-notes-card .ldp-card-hd { padding: 15px 18px; }
.ldp-notes-body {
    max-height: 500px; overflow-y: auto;
    background: rgba(0,0,0,0.12);
    scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.22) transparent;
}
.ldp-notes-body::-webkit-scrollbar { width: 3px; }
.ldp-notes-body::-webkit-scrollbar-track { background: transparent; }
.ldp-notes-body::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.22); border-radius: 3px; }

.ldp-add-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; border: none; border-radius: 100px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
    cursor: pointer; font-family: inherit; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35); transition: all 0.2s;
}
.ldp-add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(99,102,241,0.5); }

/* ====================================================
   AI DEEP SEARCH CARD — Glowing border
   ==================================================== */
.ldp-ai-card {
    background: rgba(10,9,22,0.7);
    border-color: rgba(99,102,241,0.22);
    box-shadow:
        inset 0 1px 0 rgba(99,102,241,0.1),
        0 0 40px rgba(99,102,241,0.06),
        0 1px 3px rgba(0,0,0,0.3);
    position: relative;
}
.ldp-ai-card:hover {
    border-color: rgba(99,102,241,0.35);
    box-shadow: inset 0 1px 0 rgba(99,102,241,0.14), 0 0 60px rgba(99,102,241,0.1), 0 4px 20px rgba(0,0,0,0.3);
}
/* Gradient accent line at top of AI card */
.ldp-ai-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(99,102,241,0.7) 40%, rgba(168,85,247,0.7) 60%, transparent 95%);
    border-radius: 20px 20px 0 0;
}
.ldp-ai-card .ldp-card-hd { border-bottom-color: rgba(99,102,241,0.1); }
.ldp-ai-card .ldp-card-hd svg { color: #a78bfa; }

.ldp-ds-state {}

/* DS — Not Started */
.ldp-ds-intro {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 44px 32px; gap: 12px;
}
.ldp-ds-glyph {
    width: 72px; height: 72px; border-radius: 22px; margin-bottom: 4px;
    background: linear-gradient(145deg, rgba(99,102,241,0.16), rgba(168,85,247,0.1));
    border: 1px solid rgba(99,102,241,0.22);
    display: flex; align-items: center; justify-content: center; color: #a78bfa;
    box-shadow: 0 8px 32px rgba(99,102,241,0.15), inset 0 1px 0 rgba(99,102,241,0.2);
}
.ldp-ds-intro h4 { font-size: 19px; font-weight: 800; color: #fff; margin: 0; letter-spacing: -0.4px; }
.ldp-ds-intro p  { font-size: 13px; color: rgba(255,255,255,0.4); margin: 0; line-height: 1.65; max-width: 300px; }
.ldp-ds-btn {
    display: inline-flex; align-items: center; gap: 9px; padding: 13px 30px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
    background-size: 200% 200%;
    animation: ldpGradShift 4s ease infinite;
    color: #fff; border: none; border-radius: 100px;
    font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; margin-top: 8px;
    box-shadow: 0 6px 26px rgba(99,102,241,0.42), 0 0 0 1px rgba(99,102,241,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.ldp-ds-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(99,102,241,0.58), 0 0 0 1px rgba(99,102,241,0.3); }
@keyframes ldpGradShift {
    0%,100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* DS — Running */
.ldp-ds-running {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 44px 32px; gap: 12px;
}
.ldp-ds-ring {
    width: 48px; height: 48px; border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.14);
    border-top-color: #6366f1;
    animation: spin 0.9s linear infinite; margin-bottom: 6px;
    box-shadow: 0 0 20px rgba(99,102,241,0.2);
}
.ldp-ds-running h4 { font-size: 16px; font-weight: 700; color: #fff; margin: 0; }
.ldp-ds-running > p { font-size: 13px; color: rgba(255,255,255,0.38); margin: 0; }
.ldp-ds-steps {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 12px; text-align: left; width: 100%; max-width: 200px;
}
.ldp-ds-step { display: flex; align-items: center; gap: 11px; font-size: 13px; color: rgba(255,255,255,0.2); transition: all 0.35s; }
.ldp-ds-step.active { color: #a5b4fc; font-weight: 600; }
.ldp-ds-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; transition: box-shadow 0.35s; }
.ldp-ds-step.active .ldp-ds-dot { animation: ldpDotPulse 1.5s ease infinite; }
@keyframes ldpDotPulse {
    0%,100% { box-shadow: 0 0 6px currentColor; }
    50%      { box-shadow: 0 0 16px currentColor, 0 0 28px rgba(165,180,252,0.4); }
}

/* DS — Results */
.ldp-ds-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}
.ldp-ds-ok {
    display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px;
    background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2);
    color: #4ade80; border-radius: 100px; font-size: 12px; font-weight: 700;
}
.ldp-ds-time { font-size: 11px; color: rgba(255,255,255,0.25); letter-spacing: 0.2px; }
.ldp-ds-blocks { padding: 4px 20px 8px; }
.ldp-ds-block { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.038); }
.ldp-ds-block:last-child { border-bottom: none; }
.ldp-ds-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: rgba(255,255,255,0.22); margin-bottom: 6px; }
.ldp-ds-val { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.6; margin: 0; }
.ldp-ds-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ldp-ds-tag {
    display: inline-flex; padding: 3px 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 100px; font-size: 12px; color: rgba(255,255,255,0.58); transition: all 0.15s;
}
.ldp-ds-tag:hover { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.2); color: #a5b4fc; }
.ldp-ds-rerun {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px; color: rgba(255,255,255,0.45); font-size: 12px;
    font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.ldp-ds-rerun:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); }

/* DS — Failed */
.ldp-ds-fail {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 44px 28px; gap: 12px;
}
.ldp-ds-fail-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.18);
    display: flex; align-items: center; justify-content: center; color: #f87171;
    box-shadow: 0 0 30px rgba(239,68,68,0.1);
}
.ldp-ds-fail h4 { font-size: 17px; font-weight: 700; color: #fff; margin: 0; }
.ldp-ds-fail p  { font-size: 13px; color: rgba(255,255,255,0.4); margin: 0; }

/* ====================================================
   NOTE MODAL — Premium glass + spring animation
   ==================================================== */
.ldp-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ldp-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ldp-modal-box {
    position: relative; width: 100%; max-width: 500px;
    background: #10111e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px; overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.7),
        0 0 0 1px rgba(99,102,241,0.08),
        inset 0 1px 0 rgba(255,255,255,0.06);
    animation: ldpModalPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ldpModalPop {
    from { opacity: 0; transform: scale(0.88) translateY(18px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* Gradient top line on modal */
.ldp-modal-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(99,102,241,0.8) 40%, rgba(168,85,247,0.8) 60%, transparent 95%);
}
.ldp-modal-hd {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 26px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ldp-modal-hd h2 { font-size: 17px; font-weight: 800; color: #fff; margin: 0; letter-spacing: -0.3px; }
.ldp-modal-x {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05); border: none; border-radius: 9px;
    color: rgba(255,255,255,0.35); cursor: pointer; transition: all 0.15s;
}
.ldp-modal-x:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ldp-modal-bd { padding: 22px 26px; }
.ldp-fgroup { margin-bottom: 20px; }
.ldp-fgroup:last-child { margin-bottom: 0; }
.ldp-flbl {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: rgba(255,255,255,0.3); margin-bottom: 10px;
}
/* Type pills */
.ldp-type-pills { display: flex; gap: 7px; flex-wrap: wrap; }
.ldp-type-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border-radius: 100px;
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.4); transition: all 0.15s;
}
.ldp-type-pill:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border-color: rgba(255,255,255,0.14); }
.ldp-type-pill.active {
    background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.38);
    color: #c4b5fd; box-shadow: 0 0 12px rgba(99,102,241,0.15);
}
.ldp-textarea {
    width: 100%; padding: 13px 15px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px; color: #fff;
    font-size: 14px; font-family: inherit; line-height: 1.6;
    resize: vertical; min-height: 110px; box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ldp-textarea::placeholder { color: rgba(255,255,255,0.2); }
.ldp-textarea:focus {
    outline: none; border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.04);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.ldp-modal-ft {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 18px 26px; border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.012);
}
.ldp-modal-cancel {
    padding: 10px 22px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 100px; color: rgba(255,255,255,0.5);
    font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.ldp-modal-cancel:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.ldp-modal-save {
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none; border-radius: 100px; color: #fff;
    font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35); transition: all 0.2s;
}
.ldp-modal-save:hover { transform: translateY(-1px); box-shadow: 0 7px 26px rgba(99,102,241,0.52); }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 1080px) { .ldp-grid { grid-template-columns: 300px 1fr; gap: 16px; padding: 20px 24px 48px; } }
@media (max-width: 880px) {
    .ldp-grid { grid-template-columns: 1fr; padding: 16px 20px 48px; }
    .ldp-hero { height: 400px; }
    .ldp-hero-body { padding: 0 20px 28px; }
    .ldp-biz-name { font-size: clamp(22px, 6vw, 34px); }
    .ldp-avatar { width: 80px; height: 80px; border-radius: 18px; }
    .ldp-actions { padding: 14px 20px; }
}
@media (max-width: 600px) {
    .ldp-hero { height: 340px; }
    .ldp-hero-body { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ldp-avatar { width: 64px; height: 64px; border-radius: 14px; }
    .ldp-biz-name { font-size: 22px; letter-spacing: -0.5px; }
    .ldp-actions { gap: 6px; }
    .ldp-act { padding: 9px 14px; font-size: 12px; }
    .ldp-act-ico { width: 26px; height: 26px; }
    .ldp-type-pills { gap: 5px; }
    .ldp-type-pill { font-size: 11px; padding: 6px 11px; }
    .ldp-modal-box { border-radius: 24px 24px 0 0; }
}
@media (max-width: 440px) {
    .ldp-modal { align-items: flex-end; padding: 0; }
    .ldp-modal-box { max-width: 100%; }
    .ldp-grid { padding: 12px 14px 40px; gap: 12px; }
}

/* ====================================================
   CARD UPGRADES v3 — Premium Redesign
   Contact · Notes · Photos · AI Business Intelligence
   ==================================================== */

/* ── Card header: indigo left accent + gradient bg ── */
.ldp-card-hd {
    background: linear-gradient(90deg, rgba(99,102,241,0.08) 0%, transparent 70%);
    border-bottom: 1px solid rgba(99,102,241,0.1);
    border-left: 3px solid rgba(99,102,241,0.55);
    padding-left: 17px;
    gap: 10px;
}
.ldp-ai-card .ldp-card-hd {
    border-left-color: rgba(167,139,250,0.7);
    background: linear-gradient(90deg, rgba(139,92,246,0.08) 0%, transparent 70%);
    border-bottom-color: rgba(139,92,246,0.12);
}
.ldp-notes-card .ldp-card-hd { border-left-color: rgba(99,102,241,0.55); }

/* ── Card header icon ── */
.ldp-card-hd svg {
    width: 16px; height: 16px;
    padding: 4px;
    background: rgba(99,102,241,0.12);
    border-radius: 6px;
    box-sizing: content-box;
}
.ldp-ai-card .ldp-card-hd svg { background: rgba(167,139,250,0.12); color: #c4b5fd; }

/* ====================================================
   CONTACT & DETAILS — Color-coded rows
   ==================================================== */
.ldp-card-bd { padding: 8px 16px 12px; }

.ldp-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 12px 10px 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    border-radius: 10px;
    margin: 2px -8px;
    transition: background 0.18s;
    position: relative;
}
.ldp-row:last-child  { border-bottom: none; }
.ldp-row:first-child { padding-top: 10px; }
.ldp-row:hover { background: rgba(255,255,255,0.025); }

/* Hover: colored left indicator line */
.ldp-row::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 2px; border-radius: 2px;
    opacity: 0; transition: opacity 0.2s;
}
.ldp-row:hover::before { opacity: 1; }

/* Icon circles — color per row type */
.ldp-row-ico {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: transform 0.2s;
}
.ldp-row:hover .ldp-row-ico { transform: scale(1.08); }

/* Address — rose */
.ldp-row-addr .ldp-row-ico   { background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.22); color: #fb7185; }
.ldp-row-addr::before         { background: #fb7185; }
/* Phone — emerald */
.ldp-row-phone .ldp-row-ico  { background: rgba(52,211,153,0.12);  border: 1px solid rgba(52,211,153,0.22);  color: #34d399; }
.ldp-row-phone::before        { background: #34d399; }
/* Website — blue */
.ldp-row-website .ldp-row-ico{ background: rgba(96,165,250,0.12);  border: 1px solid rgba(96,165,250,0.22);  color: #60a5fa; }
.ldp-row-website::before      { background: #60a5fa; }
/* Category — purple */
.ldp-row-cat .ldp-row-ico    { background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.22); color: #a78bfa; }
.ldp-row-cat::before          { background: #a78bfa; }
/* Price — amber */
.ldp-row-price .ldp-row-ico  { background: rgba(251,191,36,0.12);  border: 1px solid rgba(251,191,36,0.22);  color: #fbbf24; }
.ldp-row-price::before        { background: #fbbf24; }

.ldp-row-lbl {
    font-size: 9.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: rgba(255,255,255,0.28); margin-bottom: 5px;
}
.ldp-row-val { font-size: 13.5px; color: rgba(255,255,255,0.8); word-break: break-word; line-height: 1.5; }
.ldp-link    { color: #818cf8; text-decoration: none; transition: color 0.15s; }
.ldp-link:hover { color: #a5b4fc; }

/* Category tags */
.ldp-tag {
    display: inline-flex; padding: 3px 10px;
    background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.2);
    border-radius: 100px; font-size: 11px; font-weight: 600; color: #c4b5fd;
    transition: background 0.15s;
}
.ldp-tag:hover { background: rgba(167,139,250,0.2); }

/* ====================================================
   PHOTOS — 2-column grid with overlay
   ==================================================== */
.ld-gallery-thumbs {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow-x: unset !important;
    padding-bottom: 0 !important;
}
.ld-gallery-thumb {
    width: 100% !important;
    height: 90px;
    object-fit: cover;
    border-radius: 12px !important;
    border: 2px solid transparent !important;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: unset;
}
.ld-gallery-thumb:hover {
    opacity: 1 !important;
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ld-gallery-thumb.active {
    opacity: 1 !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3), 0 6px 20px rgba(0,0,0,0.4) !important;
}

/* ====================================================
   NOTES — Full-width premium bubbles
   ==================================================== */
.ldp-notes-body {
    max-height: 520px;
    overflow-y: auto;
    background: rgba(0,0,0,0.14);
    padding: 10px 0 4px;
}
.nm-chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 14px 10px;
}

/* Bubble base — full-width, left border color coded */
.nm-bubble {
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
    border-left: 3px solid rgba(148,163,184,0.35);
    position: relative;
}
.nm-bubble:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    transform: translateX(3px);
}
.nm-bubble.pinned {
    background: rgba(99,102,241,0.055);
    border-color: rgba(99,102,241,0.2);
}

/* Type-coded left border */
.nm-type-general  { border-left-color: rgba(148,163,184,0.5); }
.nm-type-call     { border-left-color: #34d399; }
.nm-type-meeting  { border-left-color: #fbbf24; }
.nm-type-follow_up{ border-left-color: #fb7185; }
.nm-type-other    { border-left-color: #a78bfa; }
.nm-type-call:hover     { border-left-color: #6ee7b7; }
.nm-type-meeting:hover  { border-left-color: #fde68a; }
.nm-type-follow_up:hover{ border-left-color: #fca5a5; }
.nm-type-other:hover    { border-left-color: #c4b5fd; }

/* Bubble inner — no separate background */
.nm-bubble-inner {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* Top row */
.nm-bubble-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px 7px; gap: 8px; margin-bottom: 0;
}

/* Type badge — per type colors */
.nm-bubble-badge {
    display: inline-flex; align-items: center;
    font-size: 10.5px; font-weight: 700;
    padding: 3px 10px; border-radius: 100px; white-space: nowrap; flex-shrink: 0;
}
.nm-bubble-badge.general    { background: rgba(148,163,184,0.1);  color: #94a3b8; border: 1px solid rgba(148,163,184,0.18); }
.nm-bubble-badge.call       { background: rgba(52,211,153,0.1);   color: #34d399; border: 1px solid rgba(52,211,153,0.22); }
.nm-bubble-badge.meeting    { background: rgba(251,191,36,0.1);   color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }
.nm-bubble-badge.follow_up  { background: rgba(251,113,133,0.1);  color: #fb7185; border: 1px solid rgba(251,113,133,0.22); }
.nm-bubble-badge.other      { background: rgba(167,139,250,0.1);  color: #a78bfa; border: 1px solid rgba(167,139,250,0.22); }

/* Action buttons */
.nm-bubble-acts { display: flex; gap: 3px; opacity: 0; transition: opacity 0.15s; }
.nm-bubble:hover .nm-bubble-acts { opacity: 1; }
.nm-bact {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none; cursor: pointer;
    font-size: 13px; transition: background 0.15s; font-family: inherit;
}
.nm-bact:hover      { background: rgba(255,255,255,0.12); }
.nm-bact.delete:hover { background: rgba(239,68,68,0.15); }

/* Note text */
.nm-bubble-text {
    font-size: 13.5px; color: rgba(255,255,255,0.82);
    line-height: 1.65; padding: 2px 14px 10px; margin: 0;
    white-space: pre-wrap;
}

/* Footer */
.nm-bubble-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 14px 10px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.nm-pin-ind   { font-size: 10.5px; color: #818cf8; font-weight: 700; letter-spacing: 0.2px; }
.nm-bubble-time { font-size: 11px; color: rgba(255,255,255,0.25); }

/* Empty state */
.nm-chat-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 52px 20px; gap: 10px; text-align: center;
}
.nm-chat-empty p   { font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.5); margin: 0; }
.nm-chat-empty span { font-size: 13px; color: rgba(255,255,255,0.25); }

/* ====================================================
   AI BUSINESS INTELLIGENCE — Enhanced results
   ==================================================== */
/* DS results blocks */
.ldp-ds-blocks { padding: 6px 20px 10px; }
.ldp-ds-block {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.038);
    display: grid; gap: 8px;
}
.ldp-ds-block:last-child { border-bottom: none; }

.ldp-ds-lbl {
    font-size: 9.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.9px;
    color: rgba(99,102,241,0.8);  /* indigo accent instead of dim white */
}
.ldp-ds-val {
    font-size: 13.5px; color: rgba(255,255,255,0.78);
    line-height: 1.65; margin: 0;
}
.ldp-ds-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ldp-ds-tag {
    display: inline-flex; padding: 4px 12px;
    background: rgba(99,102,241,0.09); border: 1px solid rgba(99,102,241,0.16);
    border-radius: 100px; font-size: 11.5px; color: #a5b4fc;
    transition: all 0.15s; cursor: default;
}
.ldp-ds-tag:hover {
    background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.3); color: #c4b5fd;
}

/* DS result bar */
.ldp-ds-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(99,102,241,0.04);
}
.ldp-ds-ok {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 14px;
    background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.22);
    color: #4ade80; border-radius: 100px; font-size: 12px; font-weight: 700;
}
.ldp-ds-time { font-size: 11px; color: rgba(255,255,255,0.28); }

/* DS running ring */
.ldp-ds-ring {
    box-shadow: 0 0 30px rgba(99,102,241,0.3);
}

/* DS rerun button */
.ldp-ds-rerun {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px;
    background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.18);
    border-radius: 100px; color: #a5b4fc; font-size: 12px; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.ldp-ds-rerun:hover {
    background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.3);
    color: #c4b5fd; transform: translateY(-1px);
}

/* ====================================================
   NOTE MODAL — Type pills enhanced
   ==================================================== */
.ldp-type-pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.ldp-type-pill {
    padding: 6px 14px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.5);
    font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: all 0.18s;
}
.ldp-type-pill:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.ldp-type-pill.active[data-value="general"]  { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.4); color: #e2e8f0; box-shadow: 0 0 10px rgba(148,163,184,0.1); }
.ldp-type-pill.active[data-value="call"]     { background: rgba(52,211,153,0.15);  border-color: rgba(52,211,153,0.45);  color: #6ee7b7; box-shadow: 0 0 10px rgba(52,211,153,0.15); }
.ldp-type-pill.active[data-value="meeting"]  { background: rgba(251,191,36,0.15);  border-color: rgba(251,191,36,0.45);  color: #fde68a; box-shadow: 0 0 10px rgba(251,191,36,0.15); }
.ldp-type-pill.active[data-value="follow_up"]{ background: rgba(251,113,133,0.15); border-color: rgba(251,113,133,0.45); color: #fca5a5; box-shadow: 0 0 10px rgba(251,113,133,0.15); }
.ldp-type-pill.active[data-value="other"]    { background: rgba(167,139,250,0.15); border-color: rgba(167,139,250,0.45); color: #c4b5fd; box-shadow: 0 0 10px rgba(167,139,250,0.15); }

/* ====================================================
   ADD NOTE BUTTON — gradient pulse
   ==================================================== */
.ldp-add-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
    padding: 7px 16px;
}
.ldp-add-btn:hover {
    box-shadow: 0 6px 24px rgba(99,102,241,0.6);
    transform: translateY(-1px) scale(1.02);
}

/* ====================================================
   RESPONSIVE — mobile
   ==================================================== */
@media (max-width: 768px) {
    .ldp-grid { grid-template-columns: 1fr; padding: 16px 16px 40px; gap: 14px; }
    .ldp-hero { height: 360px; }
    .ldp-hero-body { padding: 0 18px 24px; }
    .ldp-avatar { width: 72px; height: 72px; border-radius: 16px; }
    .ldp-biz-name { font-size: 22px; letter-spacing: -0.5px; }
    .ldp-actions { padding: 12px 16px; gap: 6px; }
    .ldp-act { padding: 8px 14px; font-size: 12px; }
    .ldp-act-ico { width: 26px; height: 26px; }
    .ld-gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
    .ld-gallery-thumb  { height: 70px; }
}

/* ====================================================
   LAYOUT FIX — Full-width card grid, no side gaps
   ==================================================== */

/* Remove max-width cap, let grid span full available width */
.ldp-grid {
    grid-template-columns: minmax(300px, 400px) 1fr;
    gap: 20px;
    padding: 24px 20px 60px;
    max-width: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Actions bar also padded to match */
.ldp-actions { padding: 16px 20px; }

/* Sidebar and main column fill height */
.ldp-sidebar, .ldp-col { display: flex; flex-direction: column; gap: 14px; }

/* Notes card fills available height */
.ldp-notes-card { flex: 1; }
.ldp-notes-body  { max-height: 560px; }

@media (max-width: 900px) {
    .ldp-grid { grid-template-columns: 1fr; padding: 16px 14px 40px; gap: 12px; }
}
@media (max-width: 640px) {
    .ldp-grid { padding: 12px 10px 32px; }
    .ldp-actions { padding: 12px 10px; gap: 6px; }
}

/* ===== OAUTH LOGIN PAGE v1 ============================================== */
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #2d3748;
    background: #161b27;
    color: #f9fafb;
    transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    text-decoration: none;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}
.oauth-btn:hover {
    background: #1e2535;
    border-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.oauth-btn:active  { transform: translateY(0); box-shadow: none; }
.oauth-btn:disabled, .oauth-btn.loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}
.oauth-btn svg, .oauth-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #6b7280;
    font-size: 13px;
}
.or-divider::before, .or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2d3748;
}
.email-toggle {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 14px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    margin-top: 4px;
    font-family: inherit;
}
.email-toggle:hover { text-decoration: underline; }
