/* Central colour tokens shared by the public website and admin panel. */
:root {
    --theme-page: #f8fafc;
    --theme-surface: #ffffff;
    --theme-surface-muted: #f1f5f9;
    --theme-text: #172b4d;
    --theme-muted: #64748b;
    --theme-border: #dce5ef;
    --theme-link: #2563eb;
    --theme-shadow: 0 12px 30px rgba(16, 42, 67, .08);
}

html[data-theme='dark'] {
    --theme-page: #0b1220;
    --theme-surface: #131d2d;
    --theme-surface-muted: #1a2738;
    --theme-text: #e5edf8;
    --theme-muted: #a8b7cb;
    --theme-border: #2b3a4e;
    --theme-link: #8dbbff;
    --theme-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

html[data-theme='dark'] body { background: var(--theme-page); color: var(--theme-text); }
html[data-theme='dark'] a:not(.btn):not(.nav-link) { color: var(--theme-link); }
html[data-theme='dark'] .bg-white, html[data-theme='dark'] .bg-light, html[data-theme='dark'] .table-light { background-color: var(--theme-surface) !important; color: var(--theme-text) !important; }
html[data-theme='dark'] .text-dark, html[data-theme='dark'] .text-body { color: var(--theme-text) !important; }
html[data-theme='dark'] .text-muted { color: var(--theme-muted) !important; }
html[data-theme='dark'] .border, html[data-theme='dark'] .border-top, html[data-theme='dark'] .border-bottom, html[data-theme='dark'] .border-start, html[data-theme='dark'] .border-end { border-color: var(--theme-border) !important; }
html[data-theme='dark'] .card, html[data-theme='dark'] .modal-content, html[data-theme='dark'] .dropdown-menu, html[data-theme='dark'] .list-group-item, html[data-theme='dark'] .offcanvas { background-color: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme='dark'] .card-header, html[data-theme='dark'] .card-footer, html[data-theme='dark'] .modal-header, html[data-theme='dark'] .modal-footer { background-color: var(--theme-surface-muted); border-color: var(--theme-border); }
html[data-theme='dark'] .form-control, html[data-theme='dark'] .form-select, html[data-theme='dark'] .input-group-text { background-color: var(--theme-surface-muted); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme='dark'] .form-control::placeholder { color: #91a1b7; }
html[data-theme='dark'] .form-control:focus, html[data-theme='dark'] .form-select:focus { background-color: var(--theme-surface-muted); color: var(--theme-text); border-color: #5b9dff; box-shadow: 0 0 0 .22rem rgba(91,157,255,.2); }
html[data-theme='dark'] .table { --bs-table-bg: var(--theme-surface); --bs-table-color: var(--theme-text); --bs-table-border-color: var(--theme-border); --bs-table-striped-bg: var(--theme-surface-muted); --bs-table-hover-bg: #1d2c40; --bs-table-hover-color: var(--theme-text); color: var(--theme-text); }
html[data-theme='dark'] .btn-light, html[data-theme='dark'] .btn-outline-secondary { color: var(--theme-text); background-color: var(--theme-surface-muted); border-color: var(--theme-border); }
html[data-theme='dark'] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
html[data-theme='dark'] .alert-light { background: var(--theme-surface-muted); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme='dark'] :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.fw-bold,.fw-semibold) { color: var(--theme-text); }
html[data-theme='dark'] :is(p,li,dt,dd,label,legend,small,.small,.form-text,.form-label,.breadcrumb-item,.dropdown-item) { color: var(--theme-text); }
html[data-theme='dark'] :is(.text-secondary,.text-black-50,.opacity-75,.form-text,.breadcrumb-item + .breadcrumb-item::before) { color: var(--theme-muted) !important; opacity: 1 !important; }
html[data-theme='dark'] .nav-tabs, html[data-theme='dark'] .nav-tabs .nav-link { border-color: var(--theme-border); }
html[data-theme='dark'] .nav-tabs .nav-link { color: var(--theme-muted); }
html[data-theme='dark'] .nav-tabs .nav-link.active { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border) var(--theme-border) var(--theme-surface); }
html[data-theme='dark'] .pagination .page-link { color: #a8c9ff; background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme='dark'] .pagination .active .page-link { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme='dark'] .list-group-item-action:hover, html[data-theme='dark'] .dropdown-item:hover { background: #203049; color: var(--theme-text); }

.theme-toggle { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-grid; place-items: center; border-radius: 999px; }
.theme-toggle:focus-visible { outline: 3px solid rgba(96, 165, 250, .7); outline-offset: 3px; }

/* Public surfaces */
html[data-theme='dark'] .public-main { background: radial-gradient(circle at 100% 0, rgba(59,130,246,.13), transparent 32rem) !important; }
html[data-theme='dark'] .public-main .card, html[data-theme='dark'] .public-main .p-4.bg-white, html[data-theme='dark'] .public-main .p-5.bg-white, html[data-theme='dark'] .contact-panel, html[data-theme='dark'] .search-panel, html[data-theme='dark'] .map-panel { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; box-shadow: var(--theme-shadow); }
html[data-theme='dark'] .listings-header, html[data-theme='dark'] .workflow-hero, html[data-theme='dark'] .trust-feature-card { background: linear-gradient(135deg, #172438 0%, #101b2b 100%) !important; border-color: var(--theme-border); }
html[data-theme='dark'] .page-intro h1, html[data-theme='dark'] .prop-price, html[data-theme='dark'] .trust-feature-card h2 { color: var(--theme-text) !important; }
html[data-theme='dark'] .page-intro p, html[data-theme='dark'] .trust-feature-card p { color: var(--theme-muted) !important; }
html[data-theme='dark'] .footer-section { background-color: #080e19 !important; color: var(--theme-muted) !important; }

/* Admin surfaces */
html[data-theme='dark'] body.admin-body { --bg-main: var(--theme-page); --bg-card: var(--theme-surface); --text-main: var(--theme-text); --text-muted: var(--theme-muted); --border-color: var(--theme-border); --sidebar-bg: #0a1321; --sidebar-hover: #17263a; --sidebar-active: #315fba; --shadow-sm: 0 1px 2px rgba(0,0,0,.22); --shadow-md: 0 8px 20px rgba(0,0,0,.22); }
html[data-theme='dark'] .admin-topbar { background-color: var(--theme-surface); }
html[data-theme='dark'] .admin-main .table { --bs-table-hover-bg: #1d2c40; }
html[data-theme='dark'] .admin-main .form-label { color: var(--theme-text); }
html[data-theme='dark'] .admin-main .form-control, html[data-theme='dark'] .admin-main .form-select { background: var(--theme-surface-muted); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme='dark'] .admin-main .card-header { background: var(--theme-surface-muted); }
html[data-theme='dark'] .admin-brand-logo, html[data-theme='dark'] .brand-logo-shell, html[data-theme='dark'] .brand-logo-wrap { background: #fff !important; }

@media (max-width: 575.98px) { .theme-toggle { width: 2.35rem; height: 2.35rem; } }
