/* Google Reviews Monitoring — Base CSS
   Re-skinned to the Faztrack Brand Identity Guideline v1.0: Faztrack Navy
   for structure/trust/links, Execution Amber reserved for the primary CTA
   button only (never overused — amber must stay ~10% of the UI), Off White
   canvas, Slate secondary text, Light Gray borders. Covers auth, discovery,
   Google connection, and review-management pages (design.css layers the
   sidebar/dashboard shell on top of this). */
:root {
    --primary: #102A43;        /* Faztrack Navy — links, active states, badges */
    --primary-dark: #243B53;   /* Deep Navy — hover on navy elements */
    --accent: #F5A623;         /* Execution Amber — primary CTA buttons ONLY */
    --accent-dark: #D98200;    /* Amber Dark — CTA hover */
    --accent-ink: #102A43;     /* Navy text on amber (brand contrast rule) */
    --bg: #F7F8FA;             /* Off White canvas */
    --surface: #ffffff;
    --text: #102A43;           /* Faztrack Navy as primary ink */
    --text-secondary: #52606D; /* Slate */
    --border: #D9E2EC;         /* Light Gray */
    --success: #2F855A;        /* Green — positive/healthy status only */
    --success-bg: #dcfce7;
    --warning: #F5A623;        /* Amber — warning/pending action */
    --warning-bg: #fef3c7;
    --danger: #C53030;         /* Red — critical/loss status only */
    --danger-bg: #fee2e2;
    --info: #168AAD;           /* Cyan — live/connected/measured data only */
    --info-bg: #e0f2fe;
    --radius: 10px;            /* Guideline: card radius 6-10px, no big pill cards */
    --radius-sm: 8px;
    --font: 'Inter', Arial, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Manrope', Arial, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin-bottom: 24px;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.nav-brand { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-user { font-size: 14px; color: var(--text-secondary); }
.nav-tenant { font-size: 14px; color: var(--primary); font-weight: 600; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s;
}
.btn:hover { background: var(--bg); }
/* Brand contrast rule: navy/black text on Execution Amber, never small
   white text on amber. Amber is reserved for the one primary CTA. */
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); color: var(--accent-ink); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: var(--accent-ink); border-color: var(--warning); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,166,35,.25); }
select.form-control { cursor: pointer; }
.form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.form-group-btn { flex: 0 0 auto; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.form-note { margin-top: 8px; font-size: 12px; }

/* Auth */
.auth-card {
    max-width: 400px;
    margin: 40px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 1px 3px rgba(16,42,67,.06);
}
.auth-card h2 { margin-bottom: 20px; color: var(--text); }
.auth-card label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; margin-top: 12px; color: var(--text-secondary); }
.auth-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: var(--font); }
.auth-card .btn { width: 100%; margin-top: 20px; padding: 12px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-link a { color: var(--primary); font-weight: 600; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f5b8b8; }
.alert-success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde3a7; }
.alert-info { background: var(--info-bg); color: #075985; border: 1px solid #bae6fd; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(16,42,67,.05);
    margin-bottom: 16px;
    overflow: hidden;
}

/* Dashboard */
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h1 { font-size: 24px; }
.subtitle { color: var(--text-secondary); font-size: 14px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(16,42,67,.05);
}
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(16,42,67,.05);
}
.info-box h3 { margin-bottom: 12px; }
.info-box ol { margin: 12px 0 12px 20px; }
.text-muted { color: var(--text-secondary); font-size: 13px; }

/* ─── DISCOVERY / BRANCH SEARCH ──────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; }
.page-header p { margin-top: 4px; color: var(--text-secondary); }

.search-card { padding: 20px; }
.summary-card { padding: 16px 20px; }
.summary-stats { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.stat { text-align: center; }
.stat .stat-value { font-size: 24px; }
.stat .stat-label { font-size: 12px; }

/* Candidate Cards */
.candidate-list { display: flex; flex-direction: column; gap: 12px; }
.candidate-card { border: 1px solid var(--border); }
.candidate-card[data-status="owner_confirmed"] { border-left: 4px solid var(--success); }
.candidate-card[data-status="owner_rejected"] { border-left: 4px solid var(--danger); }
.candidate-card[data-status="old_or_closed"] { border-left: 4px solid var(--warning); }
.candidate-card[data-status="possible_duplicate"] { border-left: 4px solid var(--text-secondary); }
.candidate-card[data-status="pending"] { border-left: 4px solid var(--primary); }

.candidate-header {
    padding: 16px 20px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}
.candidate-header h3 { font-size: 16px; }

.candidate-details { padding: 8px 20px 12px; }
.detail-item { margin: 6px 0; }
.detail-label { font-size: 12px; color: var(--text-secondary); display: block; }
.detail-value { font-size: 14px; }
.detail-value a { color: var(--primary); text-decoration: none; font-weight: 600; }
.detail-value a:hover { text-decoration: underline; }
.detail-row { display: flex; gap: 24px; flex-wrap: wrap; }
.reasons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reason-tag {
    display: inline-block;
    font-size: 11px;
    background: #eef2ff;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
}

.candidate-meta { padding: 8px 20px 12px; font-size: 12px; border-top: 1px solid var(--border); }

.maps-link { font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 600; }
.maps-link:hover { text-decoration: underline; }

/* Badges — light tint + dark text, consistent with the dashboard's own
   grm-badge-* pattern (no solid-color-plus-white-text badges). */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pending { background: #eef2ff; color: var(--primary); }
.badge-owner_confirmed { background: var(--success-bg); color: #166534; }
.badge-owner_rejected { background: var(--danger-bg); color: var(--danger); }
.badge-old_or_closed { background: var(--warning-bg); color: #92400e; }
.badge-possible_duplicate { background: var(--border); color: var(--text-secondary); }
.badge-uncertain { background: var(--border); color: var(--text-secondary); }
.badge-needs_access_review { background: var(--warning-bg); color: #92400e; }

/* Empty states */
.empty-card { padding: 40px; }
.empty-state { text-align: center; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 14px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg); }
.truncate { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 0;
}
.page-info { font-size: 13px; color: var(--text-secondary); }

/* Filter card */
.filter-card { padding: 16px 20px; }
.filter-card .form-row { align-items: flex-end; }

/* Audit */
.badge-action { font-size: 12px; }
.badge-brand_search { background: #eef2ff; color: var(--primary); }
.badge-candidate_verified { background: var(--success-bg); color: #166534; }
.badge-candidate_dedup_skipped { background: var(--border); color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════
   GOOGLE BUSINESS PROFILE CONNECTION (RUN_03)
   ══════════════════════════════════════════════════════════ */

/* Mock banner — striking visual cue that this is NOT production.
   Guideline: amber signals warning/pending action; no gradients/glow. */
.mock-banner {
    background: var(--warning-bg);
    border: 1px dashed var(--accent-dark);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mock-banner-icon { font-size: 32px; }
.mock-banner-text { flex: 1; }
.mock-banner-text h3 { font-size: 16px; color: #92400e; margin-bottom: 4px; }
.mock-banner-text p { font-size: 13px; color: #92400e; margin: 0; }
.mock-badge {
    display: inline-block;
    background: var(--accent-dark);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Status badges for Google connection */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}
.status-connected { background: var(--success-bg); color: #166534; }
.status-mock_connected { background: var(--warning-bg); color: #92400e; }
.status-disconnected { background: var(--border); color: var(--text-secondary); }
.status-token_expired { background: var(--warning-bg); color: #92400e; }
.status-token_revoked { background: var(--danger-bg); color: var(--danger); }
.status-permission_denied { background: var(--danger-bg); color: var(--danger); }
.status-api_access_pending { background: var(--info-bg); color: #075985; }
.status-not_connected { background: var(--border); color: var(--text-secondary); }
.status-oauth_in_progress { background: var(--info-bg); color: #075985; }
.status-partial_access { background: var(--warning-bg); color: #92400e; }

/* Mock status icon */
.mock-indicator { color: var(--accent-dark); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }

/* Google connection card */
.connection-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(16,42,67,.05);
    margin-bottom: 16px;
}
.connection-card h3 { font-size: 16px; margin-bottom: 16px; }
.connection-detail { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.connection-detail:last-child { border-bottom: none; }
.connection-detail-label { font-weight: 600; font-size: 13px; min-width: 140px; color: var(--text-secondary); }
.connection-detail-value { font-size: 13px; word-break: break-all; }

/* Google OAuth button — keep Google's own brand mark neutral/white per
   Google's own button guidelines; this is the one legitimate exception to
   the amber-CTA rule since it must remain recognizable as "Sign in with
   Google". */
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #3c4043;
    border: 1px solid var(--border);
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(16,42,67,.08);
    transition: box-shadow 0.15s;
    text-decoration: none;
}
.btn-google:hover { box-shadow: 0 1px 4px rgba(16,42,67,.15); background: var(--bg); }
.btn-google svg { width: 20px; height: 20px; }

.btn-disconnect {
    background: white;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-disconnect:hover { background: var(--danger-bg); }

/* Health check table */
.health-list { list-style: none; padding: 0; }
.health-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    align-items: center;
}
.health-item:last-child { border-bottom: none; }
.health-label { font-weight: 600; color: var(--text-secondary); min-width: 180px; }
.health-value { font-weight: 600; }
.health-pass { color: var(--success); }
.health-fail { color: var(--danger); }
.health-neutral { color: var(--text-secondary); }

/* Location items */
.location-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.location-item:last-child { border-bottom: none; }
.location-icon { font-size: 24px; flex: 0 0 auto; }
.location-info { flex: 1; }
.location-info h4 { font-size: 15px; margin-bottom: 4px; }
.location-info p { font-size: 13px; color: var(--text-secondary); margin: 2px 0; }
.location-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }

/* Owner-blocked visual */
.owner-blocked {
    opacity: 0.6;
    border-left: 4px solid var(--warning) !important;
}
.owner-blocked h4,
.owner-blocked p {
    text-decoration: line-through;
    color: var(--text-secondary) !important;
}
.owner-blocked-badge {
    display: inline-block;
    background: var(--warning-bg);
    color: #92400e;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Match status badges */
.match-matched {}
.match-matched-badge { background: var(--success-bg); color: #166534; }
.match-unmatched-badge { background: var(--border); color: var(--text-secondary); }
.match-ambiguous-badge { background: var(--warning-bg); color: #92400e; }

/* Reply disabled visual */
.reply-disabled {
    color: var(--text-secondary);
    font-style: italic;
}
.reply-disabled::after {
    content: ' ⛔';
}

/* Account card in picker */
.account-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--surface);
    transition: border-color 0.15s;
    cursor: pointer;
}
.account-card:hover { border-color: var(--primary); }
.account-card input[type=radio] { flex: 0 0 auto; }
.account-card .account-name { font-size: 15px; font-weight: 600; }
.account-card .account-email { font-size: 13px; color: var(--text-secondary); }

/* Limitation notes */
.limitation-box {
    background: var(--warning-bg);
    border: 1px solid var(--accent-dark);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    margin: 12px 0;
}
.limitation-box strong { font-weight: 700; }

/* Reconciliation table */
.reconciliation-row {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.reconciliation-row:last-child { border-bottom: none; }
.reconciliation-candidate { flex: 1; }
.reconciliation-gbp { flex: 1; }
.reconciliation-status { flex: 0 0 140px; text-align: center; }
