@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* PulseCTR Official Brand Kit Tokens (Septiembre 2026) */
    --bg-main: #f4f7fc;       /* Nube #F4F7FC */
    --bg-card: #ffffff;       /* Blanco #FFFFFF */
    --bg-card-hover: #ffffff;
    --bg-sidebar: #1d2433;    /* Azul Noche #1D2433 */
    --border-color: #cbd5e1;  /* Borde #CBD5E1 */
    --border-subtle: #e2e8f0;
    --border-glow: rgba(37, 99, 235, 0.15);
    
    --primary: #2563eb;       /* Azul Pulse #2563EB */
    --primary-hover: #1d4ed8; /* Azul 700 #1D4ED8 */
    --primary-light: rgba(37, 99, 235, 0.1);
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --ai-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --secondary: #1e3a8a;     /* Azul 900 #1E3A8A */
    
    --success: #15803d;       /* Éxito #15803D */
    --success-hover: #166534;
    --success-bg: #ecfdf5;
    --warning: #a16207;       /* Aviso #A16207 */
    --warning-bg: #fefce8;
    --danger: #b91c1c;        /* Error #B91C1C */
    --danger-bg: #fee2e2;
    
    /* Modern Slate & Night Blue Typography */
    --text-primary: #1d2433;   /* Azul Noche #1D2433 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #64748b;     /* Slate 500 */
    
    --sidebar-width: 252px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;          /* Controles 8px */
    --radius-md: 12px;
    --radius-lg: 16px;         /* Tarjetas 16px */
    --radius-full: 9999px;
    
    /* Layered Elevation Shadows */
    --shadow-xs: 0 1px 2px rgba(29, 36, 51, 0.04);
    --shadow-sm: 0 1px 3px rgba(29, 36, 51, 0.06), 0 1px 2px rgba(29, 36, 51, 0.04);
    --shadow-card: 0 1px 3px rgba(29, 36, 51, 0.05), 0 2px 8px rgba(29, 36, 51, 0.02);
    --shadow-card-hover: 0 4px 14px -2px rgba(29, 36, 51, 0.08), 0 2px 6px -1px rgba(29, 36, 51, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(29, 36, 51, 0.08), 0 2px 6px -1px rgba(29, 36, 51, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(29, 36, 51, 0.1), 0 4px 10px -2px rgba(29, 36, 51, 0.04);
    --shadow-glow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3, h4, .brand-title, .modal-title, .page-header-title {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    display: flex;
}

/* Sidebar Smartproxy Style */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid #2a2a35;
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 22px 8px;
    border-bottom: 1px solid #2a2a35;
    margin-bottom: 16px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-size: 17.5px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.brand-badge {
    font-size: 9.5px;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
}

.nav-category {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 12px 6px 12px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #a1a1aa;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* Linear/Stripe Active Indicator with subtle left accent */
.nav-item.active {
    background-color: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    color: inherit;
}

.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid #2a2a35;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease;
}

.system-status:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.status-text {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Main Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    flex-grow: 1;
    padding: 32px 40px;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(139, 92, 246, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.btn-ai {
    background: var(--ai-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards & Panels */
.overview-hero-two-columns {
    display: grid;
    grid-template-columns: 1.18fr 1fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.metrics-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    height: 100%;
}

.metrics-grid-2x2 .metric-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px;
    height: 100%;
}

@media (max-width: 1200px) {
    .overview-hero-two-columns {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 580px) {
    .metrics-grid-2x2 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.metric-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--primary);
    font-size: 17px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.metric-card:hover .metric-icon-wrap {
    transform: scale(1.06);
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.metric-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.metric-sub.positive {
    color: var(--success);
    font-weight: 500;
}

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

code {
    background: #eff6ff;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border: 1px solid #dbeafe;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success { background-color: var(--success-bg); color: #059669; border: 1px solid #a7f3d0; }
.badge-warning { background-color: var(--warning-bg); color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background-color: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background-color: #eff4ff; color: var(--primary); border: 1px solid #bfdbfe; }
.badge-primary { background-color: #eff4ff; color: var(--primary); border: 1px solid #bfdbfe; }
.badge-ai { background-color: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }

/* Terminal Window (Clean Dark Slate) */
.terminal-window {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    height: 380px;
    overflow-y: auto;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-entry { line-height: 1.5; word-break: break-word; }
.log-entry.info { color: #94a3b8; }
.log-entry.success { color: #34d399; font-weight: 600; }
.log-entry.warning { color: #fbbf24; }
.log-entry.error { color: #f87171; font-weight: 600; }

.view-content { display: none; }
.view-content.active { display: block; animation: fadeIn 0.2s ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   UTILITY CLASSES (Replacing common inline styles)
   ========================================================================== */
.flex-between   { display: flex; justify-content: space-between; align-items: center; }
.flex-end       { display: flex; justify-content: flex-end; gap: 10px; }
.flex-center    { display: flex; align-items: center; gap: 8px; }
.flex-col       { display: flex; flex-direction: column; gap: 8px; }
.flex-wrap      { flex-wrap: wrap; }
.gap-sm         { gap: 6px; }
.gap-md         { gap: 10px; }
.gap-lg         { gap: 16px; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-xs        { font-size: 11px; }
.text-sm        { font-size: 12px; }
.text-md        { font-size: 13px; }
.fw-500         { font-weight: 500; }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }
.mb-0           { margin-bottom: 0; }
.mb-sm          { margin-bottom: 8px; }
.mb-md          { margin-bottom: 16px; }
.mb-lg          { margin-bottom: 24px; }
.mt-sm          { margin-top: 8px; }
.mt-md          { margin-top: 16px; }
.info-banner    { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #475569; }
.success-banner { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #166534; }
.warning-banner { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #92400e; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pipeline Stage Badges */
.pipeline-badge         { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pipeline-badge.lead    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.pipeline-badge.proposal{ background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.pipeline-badge.active  { background: #e6f9ed; color: #059669; border: 1px solid #a7f3d0; }
.pipeline-badge.churned { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Role Badges */
.role-badge             { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.role-badge.admin       { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.role-badge.manager     { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.role-badge.viewer      { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.role-badge.client      { background: #e6f9ed; color: #059669; border: 1px solid #a7f3d0; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.close-btn:hover { color: var(--text-primary); }

/* AI Recommendation Cards */
.ai-audit-result {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 18px;
}
.kw-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   CRM TABLE & ADVANCED SMART FILTERS SYSTEM
   ========================================================================== */

.crm-toolbar-container {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-filters-primary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.crm-search-box {
    position: relative;
    flex: 1 1 240px;
    min-width: 220px;
}

.crm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    background: #f8fafc;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.crm-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.crm-filter-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-select {
    padding: 8px 12px;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.crm-select:focus, .crm-select:hover {
    border-color: #cbd5e1;
}

.crm-filter-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.crm-filter-reset-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.crm-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: var(--text-secondary);
}

.crm-summary-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 9999px;
    background: #f8fafc;
    color: #475569;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.crm-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-primary);
    transform: translateY(-1px);
}

.crm-chip.active {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.crm-chip.success {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.crm-chip.purple {
    background: #faf5ff;
    color: #7c3aed;
    border-color: #e9d5ff;
}

/* CRM Table Headers with Sort indicators */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    position: relative;
    white-space: nowrap;
}

.sortable-th:hover {
    background: #f1f5f9 !important;
    color: var(--text-primary);
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    color: #94a3b8;
    vertical-align: middle;
}

.sortable-th.sorted-asc .sort-icon,
.sortable-th.sorted-desc .sort-icon {
    color: var(--primary);
    font-weight: bold;
}

/* CRM Data Column Elements */
.crm-client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.crm-avatar.blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.crm-avatar.emerald { background: linear-gradient(135deg, #059669, #047857); }
.crm-avatar.purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.crm-avatar.slate { background: linear-gradient(135deg, #475569, #334155); }

.crm-client-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-client-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.2;
}

.crm-client-sub {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.crm-client-sub a {
    color: inherit;
    text-decoration: none;
}

.crm-client-sub a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.crm-keyword-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-keyword-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-target-link {
    font-size: 11px;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-target-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.crm-progress-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 110px;
}

.crm-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.crm-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.crm-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
}

.crm-status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crm-status-toggle.active {
    background: #e6f9ed;
    color: #059669;
    border-color: #a7f3d0;
}

.crm-status-toggle.active:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.crm-status-toggle.paused {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.crm-status-toggle.paused:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.crm-dwell-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 6px;
}

.crm-strategy-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ==========================================================================
   OFFCANVAS DRAWER & COMPACT LISTING GRID FOR CLIENTS & PLANS
   ========================================================================== */

.crm-listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.crm-listing-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.crm-listing-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.14), 0 4px 10px -2px rgba(37, 99, 235, 0.06);
    transform: translateY(-2px);
}

.crm-listing-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.crm-listing-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.crm-listing-card-identity {
    min-width: 0;
    flex: 1;
}

.crm-listing-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-listing-card-domain {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary, #2563eb);
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-listing-card-domain:hover {
    text-decoration: underline;
}

.crm-listing-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    padding-top: 2px;
    flex-wrap: wrap;
}

.crm-listing-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-listing-card-badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.2px;
}

.crm-listing-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    border-radius: 10px;
}

.crm-metric-mini-title {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.crm-metric-mini-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.crm-metric-mini-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.crm-listing-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.crm-listing-view-btn {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.crm-listing-card:hover .crm-listing-view-btn {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Offcanvas Drawer / Modal Lateral */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.client-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 560px;
    max-width: 92vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.client-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    flex-shrink: 0;
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.drawer-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.drawer-body {
    flex: 1;
    padding: 22px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #fafafa;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.drawer-section-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.drawer-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #141424;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.drawer-kw-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.drawer-kw-item:last-child {
    margin-bottom: 0;
}

/* Animación de refresco para el botón del panel */
@keyframes spin-clockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refresh-icon.spinning {
    animation: spin-clockwise 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* --- Overview Filter Bar & Client Presentation Mode --- */
.overview-filter-bar select:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Modo Presentación / Cliente (Marca Blanca) */
body.client-presentation-mode .sidebar {
    display: none !important;
}

body.client-presentation-mode .main-wrapper {
    margin-left: 0 !important;
    max-width: 1400px;
    margin: 0 auto !important;
    padding: 24px 32px;
    width: 100% !important;
}

body.client-presentation-mode .header-bar .header-actions {
    display: none !important;
}

body.client-presentation-mode #btn-quick-ping,
body.client-presentation-mode #btn-spotlight-action,
body.client-presentation-mode .btn-internal-only {
    display: none !important;
}

body.client-presentation-mode #stat-mrr-card {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

body.client-presentation-mode #stat-mrr {
    color: #059669 !important;
}

body.client-presentation-mode .client-presentation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* --- Estilos para el Informe Ejecutivo PDF de Cliente --- */
.report-sheet {
    box-sizing: border-box;
    line-height: 1.5;
    background: #ffffff;
}

.report-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.report-kpi-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: left;
}

.report-kpi-num {
    font-size: 24px;
    font-weight: 800;
    color: #141424;
    margin-top: 4px;
}

.report-kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.report-kpi-hint {
    font-size: 11.5px;
    color: #059669;
    font-weight: 600;
    margin-top: 2px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.report-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.report-table td {
    padding: 10px 12px;
    font-size: 12.5px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.report-impact-box {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.report-footer-note {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}

/* Reglas Especiales de Impresión para el Informe PDF */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 12mm;
    }
    
    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Ocultar todo el sistema excepto el contenido del reporte */
    #app-layout, 
    .sidebar, 
    .header-bar, 
    .overview-filter-bar, 
    .modal-overlay:not(#modal-client-report),
    #modal-client-report > .modal-box > div:first-child,
    .btn,
    .close-btn {
        display: none !important;
    }

    #modal-client-report {
        position: static !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        overflow: visible !important;
    }

    #modal-client-report .modal-box {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-preview-container {
        background: none !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    #report-sheet-content {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
        break-inside: avoid;
    }

    .report-header-banner,
    .report-kpi-grid,
    .report-table,
    .report-impact-box,
    .report-footer-note {
        break-inside: avoid;
    }
}

/* ==========================================================================
   Table Pagination Bar (Clean Smartproxy SaaS Style)
   ========================================================================== */
.table-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    flex-wrap: wrap;
    gap: 12px;
    user-select: none;
}

.pagination-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-size-selector label {
    font-size: 12px;
    color: var(--text-muted);
}

.pagination-size-selector select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition-fast);
}

.pagination-size-selector select:hover,
.pagination-size-selector select:focus {
    border-color: var(--primary);
}

.pagination-buttons-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 32px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: bold;
}

@media (max-width: 640px) {
    .table-pagination-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pagination-meta {
        justify-content: space-between;
    }
    .pagination-buttons-group {
        justify-content: center;
    }
}

/* ==========================================================================
   Google Search Console / Analytics Style Date Range Selector
   ========================================================================== */
.gsc-date-range-container {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #e2e8f0;
}

.gsc-pill {
    padding: 5px 11px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
}

.gsc-pill:hover:not(.active) {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.65);
}

.gsc-pill.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

/* ==========================================================================
   Audit Log Detail Row & Visited Pages Inspector
   ========================================================================== */
.clickable-log-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-log-row:hover {
    background-color: #f8fafc !important;
}

.clickable-log-row.expanded-row {
    background-color: #eff6ff !important;
    border-left: 3px solid #2563eb;
}

.log-detail-row {
    background-color: #f8fafc;
}

.log-detail-container {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    margin: 6px 10px 14px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.journey-steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    position: relative;
}

.journey-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.journey-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.journey-step-icon.google {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.journey-step-icon.landing {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.journey-step-icon.internal {
    background: #faf5ff;
    color: #9333ea;
    border: 1px solid #e9d5ff;
}

.journey-step-content {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* ==========================================================================
   Google Search Console Style Ranking Evolution Widget
   ========================================================================== */
.ranking-evolution-card {
    position: relative;
    overflow: hidden;
}

.rank-stat-box {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rank-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ==========================================================================
   In-App Toast & Modal Notifications (Replacing Native Alerts)
   ========================================================================== */
.app-toast {
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 290px;
    max-width: 440px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.app-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.app-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.app-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-toast-content {
    flex: 1;
}

.app-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #141424;
    margin-bottom: 2px;
}

.app-toast-msg {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

#modal-app-alert.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

#modal-app-alert .modal-box {
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
/* Discovery filter buttons */
.discovery-filter-btn {
    transition: all 0.15s ease;
    font-weight: 500;
}
.discovery-filter-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Client avatar & logo enhancements */
.crm-avatar-wrap {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.crm-avatar-wrap:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   OVERVIEW HORIZONTAL TABS (SEGMENTED CONTROL) & FORECAST / GSC MODULES
   ========================================================================== */

.overview-tabs-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.overview-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
}

.overview-subtab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.65);
}

.overview-subtab-btn.active {
    background: #ffffff;
    color: #1d4ed8;
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.subtab-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.subtab-badge.live {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.subtab-badge.ai {
    background: #faf5ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
}

.subtab-badge.gsc {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.subtab-badge.competitors {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Presentation / Client Mode Pill Toggle */
.mode-toggle-switch {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.mode-toggle-btn {
    border: none;
    background: transparent;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mode-toggle-btn.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mode-toggle-btn.client-active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

.forecast-pill {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forecast-pill:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.forecast-pill.active {
    background: #7c3aed;
    color: #ffffff;
    border-color: #6d28d9;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.forecast-card-highlight {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(37, 99, 235, 0.03) 100%);
    border: 1px solid rgba(124, 58, 237, 0.18);
    position: relative;
    overflow: hidden;
}

.forecast-card-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Competitor Benchmark Styles */
.competitor-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.competitor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
}

.competitor-card.is-client {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.competitor-card.is-client::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.competitor-card.add-card {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    cursor: pointer;
    text-align: center;
}

.competitor-card.add-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.competitor-card.add-card:hover .add-icon {
    transform: scale(1.1);
    color: var(--primary);
}

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.rank-pill.top3 {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.rank-pill.top10 {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.rank-pill.top20 {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.rank-pill.out {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* =========================================================
   BULK SELECTION & FLOATING ACTION BAR
   ========================================================= */
.crm-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #2563eb;
    cursor: pointer;
    border-radius: 4px;
    vertical-align: middle;
}

.crm-checkbox:indeterminate {
    accent-color: #2563eb;
}

.crm-bulk-floating-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 999;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: bulkBarSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
}

@keyframes bulkBarSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.bulk-bar-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bulk-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-selected-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.01em;
}

.bulk-btn-clear {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.bulk-btn-clear:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-action-btn {
    border: 1px solid transparent;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bulk-btn-activate {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}
.bulk-btn-activate:hover {
    background: #059669;
    color: #ffffff;
}

.bulk-btn-pause {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}
.bulk-btn-pause:hover {
    background: #d97706;
    color: #ffffff;
}

.bulk-btn-edit {
    background: rgba(37, 99, 235, 0.25);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.35);
}
.bulk-btn-edit:hover {
    background: #2563eb;
    color: #ffffff;
}

.bulk-btn-delete {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.bulk-btn-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

.campaign-row-selected {
    background: #eff6ff !important;
}

/* ==========================================================================
   VIEW MODE TOGGLE (GRID vs LISTING) & LISTING TABLES
   ========================================================================== */
.view-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    gap: 2px;
}

.view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
    line-height: 1;
}

.view-mode-btn svg {
    flex-shrink: 0;
}

.view-mode-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.65);
}

.view-mode-btn.active {
    background: #ffffff;
    color: #2563eb;
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.listing-table-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.listing-table-container table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin: 0;
}

.listing-table-container table.data-table th {
    padding: 12px 16px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 11.5px;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.listing-table-container table.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background: #ffffff;
}

.listing-table-container table.data-table tr:hover td {
    background: #f8fafc;
}




/* Humanized Lifestyle & Residential Photography Styles */
.hero-lifestyle-banner { margin-top: 36px; width: 100%; position: relative; z-index: 2; }
.lifestyle-card-main { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 48px -12px rgba(29, 36, 51, 0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.lifestyle-card-main:hover { box-shadow: 0 24px 54px -10px rgba(37, 99, 235, 0.18); }
.lifestyle-img-wrap { position: relative; width: 100%; height: 480px; overflow: hidden; background: #f8fafc; }
@media (max-width: 768px) { .lifestyle-img-wrap { height: 300px; } }
.lifestyle-hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform 0.5s ease; }
.lifestyle-card-main:hover .lifestyle-hero-img { transform: scale(1.02); }
.lifestyle-gradient-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, 0.65) 100%); pointer-events: none; }
.lifestyle-badge-top { position: absolute; top: 20px; left: 20px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(203, 213, 225, 0.9); padding: 8px 16px; border-radius: 9999px; display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #1e293b; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12); }
.pulse-indicator-dot { width: 9px; height: 9px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); animation: livePulse 2s infinite ease-in-out; }
@keyframes livePulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.7; } }
.lifestyle-badge-bottom-left { position: absolute; bottom: 20px; left: 20px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(203, 213, 225, 0.9); border-radius: 12px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15); }
.lifestyle-badge-bottom-right { position: absolute; bottom: 20px; right: 20px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(203, 213, 225, 0.9); border-radius: 12px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15); }
@media (max-width: 720px) { .lifestyle-badge-bottom-right { display: none; } }
.badge-icon-wrap { width: 36px; height: 36px; border-radius: 8px; background: #eff6ff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lifestyle-caption { padding: 22px 28px; display: flex; flex-direction: column; gap: 6px; background: #ffffff; border-top: 1px solid #f1f5f9; }
.lifestyle-caption-title { font-family: 'Manrope', sans-serif; font-size: 17px; font-weight: 800; color: #1d2433; display: flex; align-items: center; gap: 8px; }
.lifestyle-caption-desc { font-size: 14px; color: #64748b; line-height: 1.55; }
.module-card-media { width: calc(100% + 56px); margin: -28px -28px 20px -28px; height: 160px; overflow: hidden; position: relative; border-bottom: 1px solid #e2e8f0; }
.module-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.module-card:hover .module-img { transform: scale(1.04); }
.residential-showcase-section { padding: 96px 0; background: #f8fafc; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; position: relative; z-index: 1; }
.residential-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; }
@media (max-width: 992px) { .residential-grid { grid-template-columns: 1fr; } }
.residential-card { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(29, 36, 51, 0.05); transition: transform 0.25s ease, box-shadow 0.25s ease; display: flex; flex-direction: column; }
.residential-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px -8px rgba(37, 99, 235, 0.12); border-color: #94a3b8; }
.residential-card-img-wrap { width: 100%; height: 220px; overflow: hidden; position: relative; }
.residential-card-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.residential-card:hover .residential-card-img { transform: scale(1.04); }
.residential-card-pill { position: absolute; top: 14px; left: 14px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border: 1px solid rgba(203, 213, 225, 0.85); padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #1e293b; }
.residential-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.residential-card-title { font-family: 'Manrope', sans-serif; font-size: 18px; font-weight: 800; color: #1d2433; margin-bottom: 8px; }
.residential-card-desc { font-size: 13.5px; color: #64748b; line-height: 1.6; margin-bottom: 16px; flex: 1; }
.residential-card-metrics { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #f1f5f9; font-size: 12px; font-weight: 600; color: #059669; }

