/* =================================================================
   LeadLinka — Dark Mode
   Activated when body has class "dark-mode".
   theme.js applies this class based on:
     • OS/browser system preference (automatic, no toggle needed)
     • Manual override via the Settings toggle (stored in localStorage)
   ================================================================= */

/* color-scheme is controlled ONLY by our dark-mode class, never by the OS.
   This prevents browser native form controls from going dark when the OS
   is dark but the user has LeadLinka set to light mode. */
body             { color-scheme: light; }
body.dark-mode   { color-scheme: dark; }

/* ── CSS custom properties ── */
body.dark-mode {
  --secondary-color:   #181528;
  --text-color:        #dde1f0;
  --card-bg:           #1E1B35;
  --border-light:      #2D2A48;
  --link-color:        #9AAACF;
  --link-hover-color:  #BBC8DF;
  --footer-bg:         #0E0C1A;
  --footer-text:       #C5C3D5;
  --container-bg:      #1A182E;
  /* --primary-color stays #5a6ea6 – brand periwinkle works on dark */
}

/* ─────────────────────────────────────────
   GLOBAL BASE
───────────────────────────────────────── */
body.dark-mode {
  background-color: #181528 !important;
  color: #dde1f0 !important;
}

body.dark-mode a { color: #9AAACF; }
body.dark-mode a:hover { color: #BBC8DF; }
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 { color: #dde1f0; }

/* ─────────────────────────────────────────
   PAGE PANELS & CONTAINERS
───────────────────────────────────────── */
body.dark-mode .container,
body.dark-mode .lp-body,
body.dark-mode .lm-body {
  background: #1A182E !important;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5) !important;
}

/* ─────────────────────────────────────────
   NAVIGATION DROPDOWN
───────────────────────────────────────── */
body.dark-mode .dropdown-content,
body.dark-mode li.dropdown .dropdown-content {
  background-color: #1E1B35 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55) !important;
  border: 1px solid #2D2A48 !important;
}

body.dark-mode .dropdown-content a,
body.dark-mode li.dropdown .dropdown-content a {
  color: #dde1f0 !important;
}

body.dark-mode .dropdown-content a:hover,
body.dark-mode li.dropdown .dropdown-content a:hover {
  background-color: #232040 !important;
}

/* ─────────────────────────────────────────
   FEATURE & PRICING CARDS
───────────────────────────────────────── */
body.dark-mode .feature-card,
body.dark-mode .pricing-card {
  background-color: #1E1B35 !important;
  border-color: #2D2A48 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
}

body.dark-mode .feature-card p,
body.dark-mode .pricing-card ul li { color: #A0A0C0 !important; }

/* ─────────────────────────────────────────
   FORMS & INPUTS
───────────────────────────────────────── */
body.dark-mode .register-form {
  background-color: #1E1B35 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}

body.dark-mode .register-form h2 { color: #9AAACF !important; }

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #232040 !important;
  color: #dde1f0 !important;
  border-color: #38355A !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #8A8794 !important; }

/* Chrome/Safari autofill override — dark mode */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0px 1000px #232040 inset !important;
  -webkit-text-fill-color: #dde1f0 !important;
  transition: background-color 99999s ease-in-out 0s;
}

/* ─────────────────────────────────────────
   PROFILE PAGE
───────────────────────────────────────── */
body.dark-mode .profile-section {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}

body.dark-mode .profile-header h1 { color: #dde1f0 !important; }
body.dark-mode .profile-header p  { color: #8A8794 !important; }

/* ─────────────────────────────────────────
   SIDEBARS
───────────────────────────────────────── */
body.dark-mode .sidebar-nav,
body.dark-mode .hub-sidebar,
body.dark-mode .councils-sidebar {
  background-color: #1E1B35 !important;
  border-color: #2D2A48 !important;
}

body.dark-mode .sidebar-nav h3,
body.dark-mode .hub-sidebar h3,
body.dark-mode .councils-sidebar h3 { border-color: #2D2A48; }

body.dark-mode .sidebar-nav a { color: #A0A0C0 !important; }
body.dark-mode .sidebar-nav a:hover { color: #9AAACF !important; }

body.dark-mode .hub-sidebar select,
body.dark-mode .hub-sidebar input,
body.dark-mode .councils-sidebar select,
body.dark-mode .councils-sidebar input {
  background-color: #232040 !important;
  color: #dde1f0 !important;
  border-color: #38355A !important;
}

/* ─────────────────────────────────────────
   TABLES
───────────────────────────────────────── */
body.dark-mode table,
body.dark-mode #hub-projects-table,
body.dark-mode #councils-table {
  background-color: #1E1B35 !important;
}

body.dark-mode table td,
body.dark-mode #hub-projects-table td,
body.dark-mode #councils-table td {
  border-color: #2D2A48 !important;
  color: #dde1f0;
}

body.dark-mode table tr:nth-child(even),
body.dark-mode #hub-projects-table tr:nth-child(even),
body.dark-mode #councils-table tr:nth-child(even) {
  background-color: #232040 !important;
}

body.dark-mode #councils-table th { background-color: #3A3870 !important; }

/* ─────────────────────────────────────────
   SIMILAR PROJECTS & DETAIL PAGE
───────────────────────────────────────── */
body.dark-mode #similar-list li {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}

body.dark-mode .project-detail {
  background-color: #1E1B35 !important;
  border-color: #2D2A48 !important;
}

body.dark-mode .project-detail span,
body.dark-mode .project-detail a { color: #A0A0C0 !important; }

/* ─────────────────────────────────────────
   LANDING PAGE COMPONENTS
───────────────────────────────────────── */
body.dark-mode .lp-stat {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

body.dark-mode .lp-stat-label { color: #8A8794 !important; }
body.dark-mode .lp-section    { border-color: #2D2A48 !important; }
body.dark-mode .lp-stats      { border-color: #2D2A48 !important; }
body.dark-mode .lp-who-divider { background: #2D2A48 !important; }
body.dark-mode .lp-card       { background: #1E1B35 !important; }

body.dark-mode .lp-card p,
body.dark-mode .lp-col-text p,
body.dark-mode .lp-who-item p { color: #A0A0C0 !important; }

body.dark-mode .lm-section      { border-color: #2D2A48 !important; }
body.dark-mode .lm-use-case     {
  background: #1E1B35 !important;
  border-color: #3A3870 !important;
}

body.dark-mode .lm-use-case p,
body.dark-mode .lm-faq-item p,
body.dark-mode .lm-section p { color: #A0A0C0 !important; }

/* ─────────────────────────────────────────
   COOKIE BANNER & MODAL
───────────────────────────────────────── */
body.dark-mode .cookie-banner {
  background-color: #1E1B35 !important;
  border-color: #2D2A48 !important;
  color: #dde1f0 !important;
}

body.dark-mode .cookie-modal-content {
  background: #1E1B35 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
}

body.dark-mode .cookie-modal-content h2 { color: #dde1f0 !important; }
body.dark-mode .cookie-description { color: #A0A0C0 !important; }
body.dark-mode .cookie-modal-footer { color: #A0A0C0 !important; }

body.dark-mode #reject-all {
  background-color: #232040 !important;
  color: #dde1f0 !important;
}

/* ─────────────────────────────────────────
   DISCOVER PAGE
   (overrides inline <style> in discover.html)
───────────────────────────────────────── */

/* Sidebar */
body.dark-mode .filter-group label { color: #A0A0C0 !important; }

body.dark-mode .filter-group input,
body.dark-mode .filter-group select {
  background: #232040 !important;
  color: #dde1f0 !important;
  border-color: #38355A !important;
}

body.dark-mode .filter-group input:focus,
body.dark-mode .filter-group select:focus { border-color: #5a6ea6 !important; }

body.dark-mode .btn-clear {
  color: #A0A0C0 !important;
  border-color: #38355A !important;
}
body.dark-mode .btn-clear:hover { color: #dde1f0 !important; border-color: #9AAACF !important; }

/* Toolbar */
body.dark-mode .discover-count        { color: #A0A0C0 !important; }
body.dark-mode .discover-count strong { color: #dde1f0 !important; }

/* View toggle */
body.dark-mode .view-btn {
  background: #232040 !important;
  color: #A0A0C0 !important;
  border-color: #38355A !important;
}
body.dark-mode .view-btn.active {
  background: #5a6ea6 !important;
  color: #fff !important;
  border-color: #5a6ea6 !important;
}

/* Cards */
body.dark-mode .discover-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .discover-card:hover {
  box-shadow: 0 4px 16px rgba(92,107,192,0.25) !important;
}

body.dark-mode .card-image-wrap        { background: #232040 !important; }
body.dark-mode .card-image-placeholder { background: #232040 !important; color: #4a506a !important; }

body.dark-mode .card-type {
  background: #1e2448 !important;
  color: #9AAACF !important;
}

body.dark-mode .card-address     { color: #dde1f0 !important; }
body.dark-mode .card-council     { color: #8A8794 !important; }
body.dark-mode .card-council span { color: #9AAACF !important; }
body.dark-mode .card-description { color: #A0A0C0 !important; }
body.dark-mode .card-date        { color: #8A8794 !important; }
body.dark-mode .card-link        { color: #9AAACF !important; }
body.dark-mode .card-link:hover  { color: #BBC8DF !important; }
body.dark-mode .card-footer      { border-color: #2D2A48 !important; }
body.dark-mode .card-actions     { color: #8A8794; }

/* Freshness chips */
body.dark-mode .freshness-new    { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .freshness-recent { background: #0f1e30 !important; color: #74a9d8 !important; }

/* Status badges */
body.dark-mode .status-permitted,
body.dark-mode .status-approved  { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .status-refused,
body.dark-mode .status-rejected  { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .status-pending   { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .status-other     { background: #232040 !important; color: #A0A0C0 !important; }

/* Lead score badges */
body.dark-mode .lead-score-hot    { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .lead-score-strong { background: #1a1e36 !important; color: #9AAACF !important; }
body.dark-mode .lead-score-warm   { background: #1e1228 !important; color: #c09ada !important; }

/* Classification chips */
body.dark-mode .classify-commercial { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .classify-residential { background: #2a0e1a !important; color: #f08090 !important; }
body.dark-mode .classify-mixed       { background: #1e1228 !important; color: #c09ada !important; }

/* Score breakdown popover */
body.dark-mode .score-breakdown {
  background: #1E1B35 !important;
  border-color: #38355A !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
  color: #dde1f0 !important;
}
body.dark-mode .score-breakdown-title  { color: #9AAACF !important; }
body.dark-mode .score-breakdown-row    { border-color: #2D2A48 !important; }
body.dark-mode .score-breakdown-total  {
  border-color: #38355A !important;
  color: #dde1f0 !important;
}
body.dark-mode .score-breakdown-divider {
  border-color: #38355A !important;
  color: #8A8794 !important;
}
body.dark-mode .score-pts.zero   { color: #4a506a !important; }
body.dark-mode .score-breakdown-fit {
  background: #1e2448 !important;
  color: #9AAACF !important;
}

/* Feedback bar */
body.dark-mode .feedback-bar {
  border-color: #2D2A48 !important;
  color: #8A8794 !important;
}
body.dark-mode .feedback-btn {
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}
body.dark-mode .feedback-btn:hover   { border-color: #5a6ea6 !important; color: #9AAACF !important; }
body.dark-mode .feedback-btn.liked      { background: #122a1c !important; border-color: #43a047 !important; color: #56c87a !important; }
body.dark-mode .feedback-btn.disliked   { background: #2e1018 !important; border-color: #ef5350 !important; color: #f08090 !important; }
body.dark-mode .feedback-btn.bookmarked { background: #2a1f00 !important; border-color: #f9a825 !important; color: #ffd54f !important; }
body.dark-mode .feedback-reset       { color: #4a506a !important; }
body.dark-mode .feedback-reset:hover { color: #A0A0C0 !important; }

/* Undo toast — already dark-themed, just soften for dark mode */
body.dark-mode #ll-undo-toast { background: #232040 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important; }

/* Inline hidden-card strip */
body.dark-mode .card-hidden-strip { color: #8A8794 !important; }
body.dark-mode .card-undo-btn {
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}
body.dark-mode .card-undo-btn:hover {
  border-color: #9AAACF !important;
  color: #9AAACF !important;
}

/* Pagination */
body.dark-mode .page-btn {
  background: #232040 !important;
  color: #A0A0C0 !important;
  border-color: #38355A !important;
}
body.dark-mode .page-btn:hover:not(:disabled) {
  background: #1e2448 !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .page-btn.active {
  background: #5a6ea6 !important;
  color: #fff !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .page-info { color: #8A8794 !important; }

/* Map border */
body.dark-mode #discover-map { border-color: #2D2A48 !important; }
body.dark-mode #councils-map { border-color: #2D2A48 !important; }

/* Saved view button */
body.dark-mode #btn-saved-view {
  background: #122a1c !important;
  color: #56c87a !important;
  border-color: #1e4a2e !important;
}
body.dark-mode #btn-saved-view.active {
  background: #1e4a2e !important;
  border-color: #56c87a !important;
}

/* Hidden view button */
body.dark-mode #btn-hidden-view {
  background: #2e1018 !important;
  color: #f08090 !important;
  border-color: #5a2030 !important;
}
body.dark-mode #btn-hidden-view.active {
  background: #5a2030 !important;
  border-color: #f08090 !important;
}

/* ─────────────────────────────────────────
   TOGGLE SWITCH
───────────────────────────────────────── */
body.dark-mode .toggle-slider { background: #38355A !important; }
body.dark-mode .toggle-switch input:checked + .toggle-slider { background: #5a6ea6 !important; }
body.dark-mode .toggle-row p { color: #8A8794 !important; }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
body.dark-mode footer {
  background-color: #0E0C1A !important;
  color: #C5C3D5 !important;
}

body.dark-mode footer a       { color: #7d91c4 !important; }
body.dark-mode footer a:hover { color: #BBC8DF !important; }

/* ─────────────────────────────────────────
   COUNCILS PAGE — National panel
───────────────────────────────────────── */

/* Loading overlay */
body.dark-mode #loading-overlay {
  background: rgba(19,22,34,0.75) !important;
  color: #dde1f0 !important;
}

/* Offline warning bar */
body.dark-mode #nat-offline-bar {
  background: #1e1a0a !important;
  border-color: #3a3010 !important;
  color: #dde1f0 !important;
}

/* Tab buttons */
body.dark-mode .tab-active   { color: #9AAACF !important; border-bottom-color: #9AAACF !important; }
body.dark-mode .tab-inactive { color: #4a506a !important; border-bottom-color: transparent !important; }

/* Tab bar borders */
body.dark-mode div[style*="border-bottom:2px solid #e8eaf0"] {
  border-bottom-color: #2D2A48 !important;
}

/* Stat cards */
body.dark-mode .nat-sc {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .nat-sc-label { color: #8A8794 !important; }
body.dark-mode .nat-sc-sub   { color: #8A8794 !important; }

/* Next steps box + code blocks inside it */
body.dark-mode #nat-next-steps {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode #nat-next-steps-list { color: #A0A0C0 !important; }
body.dark-mode #nat-next-steps code {
  background: #232040 !important;
  color: #BBC8DF !important;
}

/* Registry toolbar */
body.dark-mode #nat-panel-registry > div[style*="background:#fff"] {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode #nat-panel-registry label[style*="color:#666"] { color: #A0A0C0 !important; }

/* Quick filter buttons in toolbar */
body.dark-mode #nat-panel-registry button[style*="background:#fff"] {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}
body.dark-mode #nat-panel-registry button[style*="background:#fff"]:hover {
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}

/* Result count */
body.dark-mode #nat-result-count { color: #8A8794 !important; }

/* Registry table container */
body.dark-mode #nat-panel-registry > div[style*="background:#fff"][style*="border-radius:12px"] {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode #nat-panel-registry table thead tr {
  background: #232040 !important;
}
body.dark-mode #nat-panel-registry table thead th {
  color: #8A8794 !important;
  border-bottom-color: #2D2A48 !important;
}
body.dark-mode #nat-tbody td {
  border-bottom-color: #232040 !important;
  color: #dde1f0 !important;
}
body.dark-mode #nat-tbody tr:hover td { background: #232040 !important; }
body.dark-mode #nat-tbody small      { color: #8A8794 !important; }

/* Inline table inputs / selects */
body.dark-mode .nat-inline-select,
body.dark-mode .nat-inline-input {
  background: #232040 !important;
  color: #dde1f0 !important;
  border-color: #38355A !important;
}
body.dark-mode .nat-inline-select:focus,
body.dark-mode .nat-inline-input:focus { border-color: #5a6ea6 !important; }

/* Save button */
body.dark-mode .nat-btn-save         { background: #3949ab !important; }
body.dark-mode .nat-btn-save:hover   { background: #5a6ea6 !important; }
body.dark-mode .nat-btn-save.nat-saved { background: #2e7d32 !important; }

/* Expand button */
body.dark-mode .nat-expand-btn { color: #9AAACF !important; }

/* Sample row */
body.dark-mode .nat-sample-row td    { background: #1A182E !important; }
body.dark-mode .nat-sample-table th  { color: #8A8794 !important; border-bottom-color: #2D2A48 !important; }
body.dark-mode .nat-sample-table td  { border-bottom-color: #232040 !important; color: #A0A0C0 !important; }

/* Pagination */
body.dark-mode .nat-page-btn {
  background: #232040 !important;
  color: #A0A0C0 !important;
  border-color: #38355A !important;
}
body.dark-mode .nat-page-btn:not(:disabled):hover {
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}
body.dark-mode .nat-page-info { color: #8A8794 !important; }
body.dark-mode #nat-page-info { color: #8A8794 !important; }

/* Registry portal-type badges */
body.dark-mode .nat-badge-api       { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .nat-badge-csv       { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .nat-badge-idox      { background: #1e1228 !important; color: #c09ada !important; }
body.dark-mode .nat-badge-uniform   { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .nat-badge-northgate { background: #2e0e1a !important; color: #f08090 !important; }
body.dark-mode .nat-badge-other     { background: #0e2020 !important; color: #56c8b8 !important; }
body.dark-mode .nat-badge-blocked   { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .nat-badge-unknown   { background: #232040 !important; color: #8A8794 !important; }

/* Record count chips */
body.dark-mode .nat-count-chip      { background: #1e2448 !important; color: #9AAACF !important; }
body.dark-mode .nat-count-zero      { background: #232040 !important; color: #4a506a !important; }
body.dark-mode .nat-count-chip[style*="background:#f3e5f5"] { background: #1e1228 !important; color: #c09ada !important; }

/* ── Browse Leads sidebar ── */
body.dark-mode .nat-browse-sidebar-title { color: #8A8794 !important; }
body.dark-mode .nat-fg-label             { color: #A0A0C0 !important; }
body.dark-mode .nat-fg-input {
  background: #232040 !important;
  color: #dde1f0 !important;
  border-color: #38355A !important;
}
body.dark-mode .nat-fg-input:focus { border-color: #5a6ea6 !important; }
body.dark-mode .nat-btn-clearfilters {
  color: #A0A0C0 !important;
  border-color: #38355A !important;
  background: none !important;
}
body.dark-mode .nat-btn-clearfilters:hover { color: #dde1f0 !important; border-color: #9AAACF !important; }

/* Browse toolbar */
body.dark-mode .nat-browse-count        { color: #A0A0C0 !important; }
body.dark-mode .nat-browse-count strong { color: #dde1f0 !important; }

/* Browse cards */
body.dark-mode .nat-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .nat-card:hover {
  box-shadow: 0 4px 16px rgba(92,107,192,0.25) !important;
}
body.dark-mode .nat-card-img       { background: #232040 !important; }
body.dark-mode .nat-card-type      { background: #1e2448 !important; color: #9AAACF !important; }
body.dark-mode .nat-card-address   { color: #dde1f0 !important; }
body.dark-mode .nat-card-council-line { color: #8A8794 !important; }
body.dark-mode .nat-card-council-line span { color: #9AAACF !important; }
body.dark-mode .nat-card-desc      { color: #A0A0C0 !important; }
body.dark-mode .nat-card-footer    { border-top-color: #2D2A48 !important; }
body.dark-mode .nat-card-meta      { color: #8A8794 !important; }
body.dark-mode .nat-card-appno     { color: #4a506a !important; }

/* Browse score badges */
body.dark-mode .nat-score-high  { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .nat-score-mid   { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .nat-score-low   { background: #232040 !important; color: #8A8794 !important; }

/* Browse status chips */
body.dark-mode .nat-status-decided  { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .nat-status-received { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .nat-status-pending  { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .nat-status-refused  { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .nat-status-other    { background: #232040 !important; color: #8A8794 !important; }

/* Pushed-to-Neon chip */
body.dark-mode .nat-pushed-chip { background: #1e1228 !important; color: #c09ada !important; }

/* Browse empty/loading state */
body.dark-mode .nat-browse-state-msg { color: #4a506a !important; }

/* Status badges on London tab */
body.dark-mode .status-fresh   { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .status-stale   { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .status-error   { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .status-never   { background: #232040 !important; color: #8A8794 !important; }
body.dark-mode .status-pending { background: #0f1e30 !important; color: #74a9d8 !important; }

/* Refresh button on London tab */
body.dark-mode .refresh-btn {
  background: #232040 !important;
  color: #9AAACF !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .refresh-btn:hover:not(:disabled) {
  background: #5a6ea6 !important;
  color: #fff !important;
}

/* ─────────────────────────────────────────
   PROJECT PAGE (inline CSS overrides)
   Covers all light-hardcoded classes in project.html <style>
───────────────────────────────────────── */

/* Page background */
body.dark-mode .project-outer { background: transparent; }

/* Back link */
body.dark-mode .back-link { color: #9AAACF !important; }

/* Hero card */
body.dark-mode .project-hero {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .project-address { color: #dde1f0 !important; }
body.dark-mode .project-meta-row { color: #8A8794 !important; }
body.dark-mode .project-meta-dot { color: #38355A !important; }
body.dark-mode .project-council-link { color: #9AAACF !important; }
body.dark-mode #project-map { background: #232040 !important; border-color: #2D2A48 !important; }

/* Status badges */
body.dark-mode .status-permitted { background: #122a1c !important; color: #56c87a !important; }
body.dark-mode .status-refused   { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .status-pending   { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .status-other     { background: #232040 !important; color: #A0A0C0 !important; }

/* Actions row */
body.dark-mode .project-actions-row { border-top-color: #2D2A48 !important; }
body.dark-mode .proj-action-btn-ghost {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}
body.dark-mode .proj-action-btn-ghost:hover {
  background: #2D2A48 !important;
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}
body.dark-mode .proj-action-btn.saved {
  background: #122a1c !important;
  color: #56c87a !important;
  border-color: #2e5e38 !important;
}

/* General section cards */
body.dark-mode .project-section {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .project-section h2 { color: #8A8794 !important; }

/* Stats */
body.dark-mode .stat-box {
  background: #232040 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .stat-label { color: #8A8794 !important; }
body.dark-mode .stat-value { color: #dde1f0 !important; }
body.dark-mode .stat-sub   { color: #4a506a !important; }

/* Description */
body.dark-mode .project-description { color: #A0A0C0 !important; }

/* Details grid */
body.dark-mode .detail-item dt { color: #8A8794 !important; }
body.dark-mode .detail-item dd { color: #dde1f0 !important; }
body.dark-mode .detail-item dd a { color: #9AAACF !important; }

/* Key signals */
body.dark-mode .signal-chip {
  background: #1e2448 !important;
  border-color: #3A3870 !important;
}
body.dark-mode .signal-label { color: #8A8794 !important; }
body.dark-mode .signal-value { color: #9AAACF !important; }

/* Cost guesstimate */
body.dark-mode .project-guesstimate {
  background: #0d2b18 !important;
  border-color: #2e5e38 !important;
}
body.dark-mode .ge-total { color: #81c784 !important; }
body.dark-mode .ge-breakdown {
  background: #1E1B35 !important;
  border-color: #2e5e38 !important;
}
body.dark-mode .ge-row-label { color: #A0A0C0 !important; }
body.dark-mode .ge-row-range { color: #56c87a !important; }
body.dark-mode .ge-row--contingency .ge-row-label { color: #8A8794 !important; }
body.dark-mode .ge-row--contingency .ge-row-range { color: #8A8794 !important; }
body.dark-mode .ge-disclaimer { color: #8A8794 !important; }

/* Timeline */
body.dark-mode .tl-dot {
  background: #1E1B35 !important;
  border-color: #3A3870 !important;
}
body.dark-mode .tl-step.done   .tl-dot { background: #3949ab !important; border-color: #3949ab !important; }
body.dark-mode .tl-step.active .tl-dot { background: #1E1B35 !important; border-color: #5a6ea6 !important; }
body.dark-mode .tl-step.future .tl-dot { background: #232040 !important; border-color: #2D2A48 !important; }
body.dark-mode .tl-label  { color: #A0A0C0 !important; }
body.dark-mode .tl-date   { color: #8A8794 !important; }
body.dark-mode .tl-step.done   .tl-label { color: #9AAACF !important; }
body.dark-mode .tl-step.active .tl-label { color: #9AAACF !important; }
body.dark-mode .tl-step.future .tl-label { color: #4a506a !important; }
body.dark-mode .tl-connector        { background: #3A3870 !important; }
body.dark-mode .tl-connector.future { background: #232040 !important; }

/* Intel opportunity section */
body.dark-mode .intel-opportunity-section {
  background: #1a1d36 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .intel-opp-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .intel-opp-card.highlight {
  background: #1e2448 !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .intel-opp-label { color: #8A8794 !important; }
body.dark-mode .intel-opp-value { color: #dde1f0 !important; }
body.dark-mode .intel-opp-sub   { color: #4a506a !important; }
body.dark-mode .intel-prob-bar  { background: #232040 !important; }

/* Intel "What this means" panel */
body.dark-mode .intel-panel-section {
  background: #1e1a0e !important;
  border-color: #3a3010 !important;
}
body.dark-mode .intel-summary-text { color: #A0A0C0 !important; }
body.dark-mode .intel-col-label    { color: #f9a825 !important; }
body.dark-mode .intel-list li      { color: #A0A0C0 !important; }
body.dark-mode .intel-route-tag {
  background: #2a1e00 !important;
  border-color: #4a3a00 !important;
  color: #f9a825 !important;
}

/* Long-lead risks */
body.dark-mode .intel-risks-section {
  background: #1e140e !important;
  border-color: #3a2010 !important;
}
body.dark-mode .intel-risk-row {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .risk-item-name  { color: #dde1f0 !important; }
body.dark-mode .risk-item-weeks { color: #8A8794 !important; }
body.dark-mode .risk-badge-critical { background: #2e1018 !important; color: #f08090 !important; }
body.dark-mode .risk-badge-high     { background: #2e1e0a !important; color: #f4a261 !important; }
body.dark-mode .risk-badge-medium   { background: #1e1a00 !important; color: #ffd54f !important; }
body.dark-mode .risk-badge-low      { background: #122a1c !important; color: #56c87a !important; }

/* Recommended actions */
body.dark-mode .intel-actions-section {
  background: #1a1d36 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .intel-action-row {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .action-title  { color: #dde1f0 !important; }
body.dark-mode .action-detail { color: #A0A0C0 !important; }
body.dark-mode .action-timing {
  background: #1e2448 !important;
  color: #9AAACF !important;
}

/* Pro insights cards */
body.dark-mode .pi-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .pi-card--highlight {
  background: #1e2448 !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .pi-card-label    { color: #8A8794 !important; }
body.dark-mode .pi-card-sublabel { color: #A0A0C0 !important; }
body.dark-mode .pi-card-value    { color: #dde1f0 !important; }
body.dark-mode .pi-bar-track     { background: #232040 !important; }
body.dark-mode .pi-card-sub      { color: #4a506a !important; }
body.dark-mode .pi-group-label   { color: #8A8794 !important; }
body.dark-mode .pi-upgrade-note  { color: #8A8794 !important; }

/* Intel CTA buttons on white section backgrounds */
body.dark-mode .intel-cta-btn.intel-cta-save-dark {
  background: #5a6ea6 !important;
  color: #fff !important;
}
body.dark-mode .intel-cta-btn.intel-cta-save-dark.intel-cta-saved {
  background: #122a1c !important;
  color: #56c87a !important;
  border-color: #2e5e38 !important;
}
body.dark-mode .intel-cta-btn.intel-cta-cal-outline {
  background: #1e2448 !important;
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}
body.dark-mode .intel-cta-btn.intel-cta-cal-outline:hover {
  background: #252a5a !important;
}

/* Contact gate */
body.dark-mode .contact-gate-msg p { color: #A0A0C0 !important; }
body.dark-mode .contact-gate-btn-outline {
  background: #1e2448 !important;
  color: #9AAACF !important;
  border-color: #5a6ea6 !important;
}
body.dark-mode .gated-blur    { color: #38355A !important; }
body.dark-mode .gated-upgrade { color: #9AAACF !important; }
body.dark-mode .mock-val      { color: #8A8794 !important; }
body.dark-mode .mock-label    { color: #4a506a !important; }

/* Sidebar cards */
body.dark-mode .sidebar-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .sidebar-section-label { color: #8A8794 !important; }
body.dark-mode .sidebar-stat-row  { border-bottom-color: #232040 !important; }
body.dark-mode .sidebar-stat-lbl  { color: #8A8794 !important; }
body.dark-mode .sidebar-stat-val  { color: #dde1f0 !important; }
body.dark-mode .sidebar-stat-sub  { color: #4a506a !important; }
body.dark-mode .sidebar-intel-value { color: #dde1f0 !important; }
body.dark-mode .sidebar-prob-bar  { background: #232040 !important; }
body.dark-mode .sidebar-save-btn.saved {
  background: #122a1c !important;
  color: #56c87a !important;
  border-color: #2e5e38 !important;
}
body.dark-mode .sidebar-ghost-btn {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}
body.dark-mode .sidebar-ghost-btn:hover {
  background: #2D2A48 !important;
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}
body.dark-mode .sidebar-ghost-btn.in-list {
  background: #2D2A48 !important;
  border-color: #5a6ea6 !important;
  color: #9AAACF !important;
}
body.dark-mode .sidebar-export-counter {
  background: #2D2A48 !important;
}
body.dark-mode .sidebar-export-counter span { color: #9AAACF !important; }

/* Nearby cards */
body.dark-mode .nearby-mini-card { border-bottom-color: #2D2A48 !important; }
body.dark-mode .nearby-mini-addr { color: #dde1f0 !important; }
body.dark-mode .nearby-mini-meta { color: #8A8794 !important; }
body.dark-mode .nearby-mini-card:hover .nearby-mini-addr { color: #9AAACF !important; }

/* Loading screen */
body.dark-mode .ll-loader-title { color: #9fa8da !important; }
body.dark-mode .ll-loader-sub   { color: #8A8794 !important; }
body.dark-mode .ll-loader-bar   { background: #232040 !important; }

/* ─────────────────────────────────────────
   DISCOVER PAGE — mobile filter button dark fix
───────────────────────────────────────── */
body.dark-mode .filter-toggle-btn {
  background: #1E1B35 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}

/* ─────────────────────────────────────────
   DISCOVER JS — inline-style overrides
   (JS sets background via element.style; !important wins)
───────────────────────────────────────── */

/* List dropdown row hover */
body.dark-mode .ll-dd-row:hover { background: #232040 !important; }
body.dark-mode #_ll-dd-newbtn:hover { background: #232040 !important; }

/* Profile preferences bar */
body.dark-mode #pref-bar {
  background: #162820 !important;
  border-color: #7A9E8A !important;
}
body.dark-mode #pref-bar span { color: #7A9E8A !important; }
body.dark-mode #pref-bar button {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}
body.dark-mode #pref-bar button:hover {
  background: #5a6ea6 !important;
  color: #fff !important;
}

/* Captcha modal cancel button */
body.dark-mode #_captcha-cancel {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #A0A0C0 !important;
}

/* Export bar (saved view — inside #cards-container) */
body.dark-mode #cards-container > div[style*="background:#F4F0EB"] {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode #cards-container > div[style*="background:#F4F0EB"] span {
  color: #9AAACF !important;
}

/* Score breakdown — combined row */
body.dark-mode .score-breakdown div[style*="background:#F4F0EB"] {
  background: #232040 !important;
  color: #9AAACF !important;
}

/* ─────────────────────────────────────────
   PROJECT JS — sidebar inline-style overrides
───────────────────────────────────────── */
body.dark-mode #btn-cal-reminder,
body.dark-mode #btn-email-alert {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}

/* ─────────────────────────────────────────
   PLANNING PAGES (.pl-* classes)
───────────────────────────────────────── */
body.dark-mode .pl-hero {
  background: linear-gradient(135deg, #1E1B35 0%, #1A182E 100%) !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .pl-hero h1     { color: #DDE1F0 !important; }
body.dark-mode .pl-hero-sub    { color: #A0A0C0 !important; }
body.dark-mode .pl-breadcrumb  { color: #8A8794 !important; }
body.dark-mode .pl-breadcrumb a { color: #9AAACF !important; }

body.dark-mode .pl-stats-line {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}

body.dark-mode .pl-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .pl-card:hover {
  box-shadow: 0 4px 16px rgba(92,107,192,0.25) !important;
}
body.dark-mode .pl-card-title   { color: #DDE1F0 !important; }
body.dark-mode .pl-card-meta,
body.dark-mode .pl-card-date    { color: #8A8794 !important; }
body.dark-mode .pl-card-desc    { color: #A0A0C0 !important; }
body.dark-mode .pl-card-ref     { color: #4a506a !important; }

body.dark-mode .pl-load-chip {
  background: #1E1B35 !important;
  color: #5a6ea6 !important;
  border-color: #2D2A48 !important;
}

body.dark-mode .pl-btn-more {
  background: #232040 !important;
  color: #9AAACF !important;
  border-color: #38355A !important;
}
body.dark-mode .pl-btn-more:hover {
  background: #5a6ea6 !important;
  color: #fff !important;
}

body.dark-mode .pl-btn-reset {
  color: #8A8794 !important;
  border-color: #38355A !important;
}
body.dark-mode .pl-btn-reset:hover {
  color: #DDE1F0 !important;
  border-color: #8A8794 !important;
}

body.dark-mode .pl-status-pending { background: #0f1e30 !important; color: #74a9d8 !important; }
body.dark-mode .pl-status-decided { background: #122a1c !important; color: #7A9E8A !important; }

body.dark-mode .pl-stat-item {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .pl-stat-num   { color: #DDE1F0 !important; }
body.dark-mode .pl-stat-label { color: #8A8794 !important; }

body.dark-mode .pl-error { color: #f08090 !important; }

/* ─────────────────────────────────────────
   TRADE LANDING PAGES (.value-card, .preview-card etc.)
───────────────────────────────────────── */
body.dark-mode .value-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .value-card h3 { color: #DDE1F0 !important; }
body.dark-mode .value-card p  { color: #A0A0C0 !important; }

body.dark-mode .signal-chip {
  background: #1e2448 !important;
  color: #9AAACF !important;
}

body.dark-mode .live-preview {
  background: #1A182E !important;
}
body.dark-mode .live-preview h2    { color: #DDE1F0 !important; }
body.dark-mode .live-preview .section-sub { color: #8A8794 !important; }

body.dark-mode .preview-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .preview-card .pc-ref   { color: #4a506a !important; }
body.dark-mode .preview-card .pc-desc  { color: #DDE1F0 !important; }
body.dark-mode .preview-card .pc-loc   { color: #8A8794 !important; }
body.dark-mode .preview-card .pc-badge {
  background: #122a1c !important;
  color: #7A9E8A !important;
}
body.dark-mode .preview-card .pc-badge.pending {
  background: #2e1e0a !important;
  color: #C4956B !important;
}
body.dark-mode .preview-loading { color: #4a506a !important; }

body.dark-mode .trade-section h2          { color: #DDE1F0 !important; }
body.dark-mode .trade-section .section-sub { color: #8A8794 !important; }
body.dark-mode .step h3 { color: #DDE1F0 !important; }
body.dark-mode .step p  { color: #A0A0C0 !important; }

body.dark-mode .faq-item {
  border-color: #2D2A48 !important;
}
body.dark-mode .faq-item h3 { color: #DDE1F0 !important; }
body.dark-mode .faq-item p  { color: #A0A0C0 !important; }

/* ─────────────────────────────────────────
   PLANNING HUB CARDS (.pl-hub-*)
───────────────────────────────────────── */
body.dark-mode .pl-hub-section h2 {
  color: #DDE1F0 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode .pl-hub-card {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
  color: #DDE1F0 !important;
}
body.dark-mode .pl-hub-card:hover {
  border-color: #5a6ea6 !important;
  box-shadow: 0 4px 16px rgba(92,107,192,0.25) !important;
}
body.dark-mode .pl-hub-card-sub { color: #8A8794 !important; }

body.dark-mode .pl-card-addr  { color: #DDE1F0 !important; }
body.dark-mode .pl-card-meta  { color: #8A8794 !important; }
body.dark-mode .pl-card-date  { color: #8A8794 !important; }

/* Inline-style overrides: CTA section and link chips in planning HTML pages */
body.dark-mode section[style*="background:#f0f2ff"] {
  background: #1E1B35 !important;
  border-color: #2D2A48 !important;
}
body.dark-mode section[style*="background:#f0f2ff"] h2,
body.dark-mode section[style*="background:#f0f2ff"] h3 { color: #DDE1F0 !important; }
body.dark-mode section[style*="background:#f0f2ff"] p   { color: #A0A0C0 !important; }

/* Link chips: <a style="background:#f0f2ff ..."> */
body.dark-mode a[style*="background:#f0f2ff"] {
  background: #1e2448 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}
body.dark-mode a[style*="background:#f0f2ff"]:hover {
  border-color: #5a6ea6 !important;
  color: #BBC8DF !important;
}

/* pl-filters in dark mode (planning pages) */
body.dark-mode .pl-filters input[type="text"],
body.dark-mode .pl-filters select {
  background: #232040 !important;
  border-color: #38355A !important;
  color: #DDE1F0 !important;
}
body.dark-mode .pl-borough-list li a {
  background: #1e2448 !important;
  border-color: #38355A !important;
  color: #9AAACF !important;
}
