/* OutreachHub — CSS
   Inherits AREC brand tokens + adds platform-specific colours.
   Loads after tailwind.css (shared copy from AREC build).
*/

/* ── Brand tokens (mirrors AREC style.css) ──────────────────────────────── */
:root {
    --color-brand-red:   #E32626;
    --color-brand-blue:  #1A3668;
    --color-brand-navy:  #253B8E;
    --color-bg-main:     #F4F7F9;
    --color-bg-card:     #FFFFFF;
    --color-border:      #E5E7EB;
    --color-text-primary:#111827;
    --color-text-muted:  #6B7280;
    --color-action-link: #2B5CE7;
    --color-success:     #10B981;
    --color-info:        #3B82F6;
    --color-warning:     #F59E0B;
    --color-danger:      #EF4444;

    /* Social platform colours */
    --color-linkedin:    #0A66C2;
    --color-facebook:    #1877F2;

    /* Sidebar */
    --sidebar-width: 240px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    margin: 0;
}

/* ── App shell ───────────────────────────────────────────────────────────── */
.oh-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.oh-sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.oh-sidebar-logo {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--color-border);
}

.oh-sidebar-logo img { width: 100%; max-width: 160px; }

.oh-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }

.oh-nav-divider {
    height: 1px;
    background: var(--color-border);
    margin: 10px 4px 12px;
}

.oh-nav-group { margin-bottom: 8px; }

.oh-nav-group-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 12px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.oh-nav-group-trigger:hover {
    background: #F3F4F6;
    color: var(--color-text-primary);
}

.oh-nav-group-caret {
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}

.oh-nav-group-trigger.collapsed .oh-nav-group-caret {
    transform: rotate(-90deg);
}

.oh-nav-group-content {
    margin-top: 2px;
    overflow: hidden;
}

.oh-nav-group-content.collapsed {
    display: none;
}

.oh-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.oh-nav-item:hover { background: #F3F4F6; color: var(--color-text-primary); }
.oh-nav-item.active { background: #EFF6FF; color: var(--color-brand-blue); }
.oh-nav-item .oh-nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.oh-nav-subcategory {
    margin-top: 2px;
}

.oh-nav-subcategory-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 12px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.oh-nav-subcategory-trigger:hover {
    background: #F3F4F6;
    color: var(--color-text-primary);
}

.oh-nav-subcategory-caret {
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}

.oh-nav-subcategory-trigger.collapsed .oh-nav-subcategory-caret {
    transform: rotate(-90deg);
}

.oh-nav-subcategory-content {
    overflow: hidden;
}

.oh-nav-subcategory-content.collapsed {
    display: none;
}

.oh-nav-item-sub {
    margin-left: 10px;
}

.oh-sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ── Main content ────────────────────────────────────────────────────────── */
.oh-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.oh-topbar {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.oh-topbar-title { font-size: 1rem; font-weight: 600; color: var(--color-text-primary); }

.oh-content { padding: 24px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.oh-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px;
}

.oh-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 4px;
}

/* ── Stat tiles ──────────────────────────────────────────────────────────── */
.oh-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.oh-stat {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px 20px;
}

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

.oh-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-top: 4px;
}

.oh-stat-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.oh-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.oh-badge-active    { background: #D1FAE5; color: #065F46; }
.oh-badge-paused    { background: #FEF3C7; color: #92400E; }
.oh-badge-draft     { background: #F3F4F6; color: #374151; }
.oh-badge-error     { background: #FEE2E2; color: #991B1B; }
.oh-badge-completed { background: #EDE9FE; color: #4C1D95; }

.oh-badge-linkedin  { background: #DBEAFE; color: #1E40AF; }
.oh-badge-facebook  { background: #EFF6FF; color: #1D4ED8; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.oh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
    text-decoration: none;
}

.oh-btn:hover { opacity: 0.88; }
.oh-btn-primary { background: var(--color-brand-blue); color: #fff; }
.oh-btn-red     { background: var(--color-brand-red);  color: #fff; }
.oh-btn-ghost   { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-primary); }
.oh-btn-sm      { padding: 5px 10px; font-size: 0.8rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.oh-table-wrap { overflow-x: auto; }

.oh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.oh-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
    background: #F9FAFB;
}

.oh-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    vertical-align: middle;
}

.oh-table tr:last-child td { border-bottom: none; }
.oh-table tr:hover td { background: #F9FAFB; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.oh-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.oh-input, .oh-select, .oh-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    background: var(--color-bg-card);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.oh-input:focus, .oh-select:focus, .oh-textarea:focus {
    outline: none;
    border-color: var(--color-brand-blue);
    box-shadow: 0 0 0 3px rgba(26,54,104,0.08);
}

.oh-textarea { resize: vertical; min-height: 100px; }

.oh-form-group { margin-bottom: 16px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.oh-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.oh-modal-backdrop.open { display: flex; }

.oh-modal {
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
}

.oh-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 20px;
}

.oh-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.oh-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}

.oh-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.oh-empty-title { font-size: 1rem; font-weight: 600; color: var(--color-text-primary); margin-bottom: 6px; }
.oh-empty-desc  { font-size: 0.875rem; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
#oh-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oh-toast-item {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: oh-slide-in 0.2s ease;
}

.oh-toast-success { background: var(--color-success); }
.oh-toast-error   { background: var(--color-danger); }
.oh-toast-info    { background: var(--color-info); }

@keyframes oh-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* ── Chart container ─────────────────────────────────────────────────────── */
.oh-chart-wrap {
    position: relative;
    height: 240px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .oh-sidebar { display: none; }
    .oh-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ══ Leads Map Dashboard ════════════════════════════════════════════════════ */

/* Override oh-main: no overflow-y scroll — map fills remaining height */
.lm-main {
    overflow: hidden;
}

/* Topbar lead-type toggles */
.lm-type-toggles {
    display: flex;
    gap: 6px;
}

.lm-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.lm-type-btn.lm-type-active {
    background: #F0F4FF;
    border-color: var(--color-brand-blue);
    color: var(--color-text-primary);
}

.lm-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lm-status-msg {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    min-width: 80px;
}

/* Inline overlay pill bar */
.lm-overlay-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.lm-overlay-bar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    white-space: nowrap;
    margin-right: 2px;
}

.lm-overlay-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1.5px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.1s, color 0.1s, background 0.1s;
    user-select: none;
}

.lm-overlay-pill:has(input:checked) {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.lm-overlay-pill input[type="checkbox"] {
    display: none;
}

/* Overlay dropdown (legacy) */
.lm-overlay-dropdown {
    position: relative;
}

.lm-overlay-menu {
    display: none;
    position: fixed;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 10px 0;
    min-width: 240px;
    z-index: 99999;
    overflow-y: auto;
}

.lm-overlay-menu.open {
    display: block;
}

.lm-overlay-menu-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 0 14px 8px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 6px;
}

.lm-overlay-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-primary);
    transition: background 0.1s;
}

.lm-overlay-item:hover {
    background: #F3F4F6;
}

.lm-overlay-item-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lm-overlay-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.lm-overlay-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lm-badge-live { background: #D1FAE5; color: #065F46; }
.lm-badge-soon { background: #F3F4F6; color: #6B7280; }

/* Map + panel split */
.lm-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.lm-map-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Right panel — hidden: leads removed from map */
.lm-panel {
    display: none;
}

#lm-panel-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#lm-panel-detail {
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

/* People overlay tab switcher */
#lm-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.lm-panel-tab {
    flex: 1;
    padding: 7px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    cursor: pointer;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    transition: color 0.1s, border-color 0.1s;
}
.lm-panel-tab:hover { color: var(--color-text-primary); }
.lm-panel-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

/* People overlay item list (mirrors .lm-lead-list) */
#lm-panel-overlay-list {
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.lm-people-item { cursor: pointer; }
.lm-people-item:hover { background: var(--color-bg-hover, rgba(0,0,0,0.04)); }

/* Search / filter bar */
.lm-panel-search {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.lm-panel-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.lm-panel-count {
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* Lead list items */
.lm-lead-list {
    flex: 1;
    overflow-y: auto;
}

.lm-list-item {
    padding: 10px 12px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 0.1s;
}

.lm-list-item:hover { background: #F9FAFB; }
.lm-list-item.selected { background: #EFF6FF; }

.lm-list-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.lm-list-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-list-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.lm-list-addr {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 15px;
}

.lm-no-coord {
    color: var(--color-warning);
    font-size: 0.7rem;
}

/* Detail panel */
.lm-detail-back {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.lm-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 6px;
}

.lm-detail-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.lm-detail-type {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.lm-detail-addr {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding: 0 14px 10px;
}

.lm-detail-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 14px;
}

.lm-detail-rows {
    border-top: 1px solid var(--color-border);
    padding: 8px 0;
}

.lm-detail-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 14px;
}

.lm-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    width: 96px;
    flex-shrink: 0;
}

.lm-detail-value {
    font-size: 0.82rem;
    color: var(--color-text-primary);
    word-break: break-word;
}

.lm-detail-contact-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 20px;
    border-top: 1px solid var(--color-border);
}

.lm-contact-link {
    font-size: 0.82rem;
    color: var(--color-action-link);
    text-decoration: none;
    word-break: break-word;
}

.lm-contact-link:hover { text-decoration: underline; }

/* Responsive: stack on narrow screens */
@media (max-width: 600px) {
    .lm-body { flex-direction: column; }
    .lm-map-wrap { flex: 0 0 50vh; }
    .lm-panel { flex: 1; border-left: none; border-top: 1px solid var(--color-border); }
    .lm-type-toggles { display: none; }
}

/* ── Map address geocoder ─────────────────────────────────────────────────── */
.lm-geocoder-wrap {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100% - 80px));
    z-index: 10;
}

.lm-geocoder-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.lm-geocoder-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 9px 12px;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: var(--color-text-primary);
    background: transparent;
}

.lm-geocoder-btn {
    padding: 0 12px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: color 0.12s;
    flex-shrink: 0;
}

.lm-geocoder-btn:hover { color: var(--color-brand-blue); }

.lm-geocoder-suggestions {
    display: none;
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 240px;
    overflow-y: auto;
}

.lm-geocoder-suggestions li {
    padding: 9px 14px;
    font-size: 0.83rem;
    color: var(--color-text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-geocoder-suggestions li:hover,
.lm-geocoder-suggestions li.active {
    background: #EFF6FF;
    color: var(--color-brand-blue);
}
