:root {
    /* Default (Light) */
    --primary: #2563eb;       /* Blue-600 */
    --primary-hover: #1d4ed8; /* Blue-700 */
    --secondary: #64748b;     /* Slate-500 */
    --background: #f8fafc;    /* Slate-50 */
    --background-soft: #eff6ff; /* For cards inside sections */
    --surface: #ffffff;       /* White */
    --text-main: #0f172a;     /* Slate-900 */
    --text-muted: #64748b;    /* Slate-500 */
    --border: #e2e8f0;        /* Slate-200 */
    --danger: #ef4444;        /* Red-500 */
    --success: #10b981;       /* Emerald-500 */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Radius */
    --radius: 0.75rem;
    /* Category colours (NEW) */
    --cat-general: #1976D2;
    --cat-for-sale: #388E3C;
    --cat-wanted: #7B1FA2;
    --cat-ride-share: #F57C00;
    --cat-help-needed: #D32F2F;
    --cat-lost: #E65100;
    --cat-found: #00838F;
    --cat-safety: #C62828;
    --cat-facilities: #0277BD;
    --cat-site-issue: #EF6C00;
    /* Functional colours (NEW) */
    --color-warning: #FF8F00;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-dark: #1d4ed8;
    /* Z-index layers (NEW) */
    --z-sticky: 100;
    --z-nav: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-install-banner: 500;
    --z-toast: 600;
    /* Transitions (NEW) */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    /* Spacing (NEW) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    /* Radii (NEW) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Dark Mode Overrides */
:root.dark-mode {
    --primary: #60a5fa;       /* Lighter blue for dark bg */
    --primary-hover: #93c5fd;
    --secondary: #94a3b8;
    --background: #0f172a;    /* Slate-900 */
    --background-soft: #1e293b; /* Slate-800 */
    --surface: #1e293b;       /* Slate-800 */
    --text-main: #f1f5f9;     /* Slate-100 */
    --text-muted: #cbd5e1;    /* Slate-300 */
    --border: #334155;        /* Slate-700 */
    --danger: #f87171;
    --success: #34d399;
    --cat-general: #42a5f5;
    --cat-for-sale: #66bb6a;
    --cat-wanted: #ab47bc;
    --cat-ride-share: #ffa726;
    --cat-help-needed: #ef5350;
    --cat-lost: #ff7043;
    --cat-found: #26c6da;
    --cat-safety: #e53935;
    --cat-facilities: #29b6f6;
    --cat-site-issue: #fb8c00;
    --color-warning: #FFB300;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --accent-dark: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 16px;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    overscroll-behavior-y: none;
}

/* Layout */
#app {
    display: flex;
    min-height: 100vh;
}

#main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    padding-bottom: 100px; /* Space for mobile nav */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Navigation */
#mobile-header {
    display: none;
}

.mobile-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    display: none;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.75rem;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    overflow: visible;
}

.mobile-nav-link {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.4rem;
    border-radius: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
}

.mobile-nav-link__icon {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-link__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.mobile-nav-link__label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible,
.mobile-nav-link.active,
body.mobile-menu-open #mobile-menu-btn {
    color: var(--primary);
    background: var(--background-soft);
    border-color: rgba(37, 99, 235, 0.14);
}

.mobile-nav-link--button {
    appearance: none;
}

.mobile-more {
    flex: 1;
    position: relative;
}

.mobile-more > summary {
    list-style: none;
}

.mobile-more > summary::-webkit-details-marker {
    display: none;
}

.mobile-more[open] > summary {
    color: var(--primary);
    background: var(--background-soft);
    border-color: rgba(37, 99, 235, 0.14);
}

.mobile-more__sheet {
    position: fixed;
    left: 0.9rem;
    right: 0.9rem;
    bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 0.9rem;
    display: grid;
    gap: 0.75rem;
    max-height: min(62vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-more__title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-more__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.mobile-more__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.85rem;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.mobile-more__item--button {
    width: 100%;
}

/* Sidebar */
#sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease, background-color 0.3s;
}

.brand-desktop {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brand-desktop .version {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--background);
    padding: 2px 6px;
    border-radius: 4px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1; /* Push footer down */
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--background);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--background-soft);
    color: var(--primary);
}

/* Highlight "Take Payments" button */
.nav-links a.nav-btn-green {
    background: var(--primary);
    color: white; /* Always white text on primary button */
    justify-content: center;
    margin-bottom: 1rem;
}
.nav-links a.nav-btn-green:hover {
    background: var(--primary-hover);
    color: white;
}

/* Typography */
h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-main); }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }

/* Cards & Containers */
.card, .glass-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Dashboard Specific Dark Mode Fixes */
:root.dark-mode .card {
    background-color: var(--surface);
    border-color: var(--border);
}

/* Section Cards (Payments Page) */
.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    color: var(--text-main);
}

/* Section Tints (Light Mode Only) */
:root:not(.dark-mode) .sec-camp { background: rgba(147, 197, 253, 0.1); border-color: rgba(147, 197, 253, 0.3); }
:root:not(.dark-mode) .sec-dates { background: rgba(167, 243, 208, 0.1); border-color: rgba(167, 243, 208, 0.3); }
:root:not(.dark-mode) .sec-occupants { background: rgba(216, 180, 254, 0.1); border-color: rgba(216, 180, 254, 0.3); }
:root:not(.dark-mode) .sec-payment { background: rgba(254, 202, 202, 0.1); border-color: rgba(254, 202, 202, 0.3); }

/* Dark Mode Section Tints - darker/subtle */
:root.dark-mode .sec-camp { background: rgba(59, 130, 246, 0.1); border-color: var(--border); }
:root.dark-mode .sec-dates { background: rgba(16, 185, 129, 0.1); border-color: var(--border); }
:root.dark-mode .sec-occupants { background: rgba(168, 85, 247, 0.1); border-color: var(--border); }
:root.dark-mode .sec-payment { background: rgba(239, 68, 68, 0.1); border-color: var(--border); }

/* Dashboard Summary Boxes - Dark Mode Overrides */
/* These inline styles from JS need CSS counterparts for dark mode control */
.dashboard-summary-box {
    padding: 0.5rem;
    border-radius: 8px;
    background: #eff6ff; /* Light default */
}
.dashboard-summary-box h4 { color: #1e40af; }

:root.dark-mode .dashboard-summary-box {
    background: rgba(59, 130, 246, 0.15) !important; /* Force override inline styles via class if needed, or update JS */
    border: 1px solid var(--border);
}
:root.dark-mode .dashboard-summary-box h4 { color: #93c5fd !important; }

/* Grid Systems */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.form-row > * { min-width: 0; }
.checkbox-inline { justify-content: flex-start; }

@media (max-width: 900px) {
    .form-row { flex-direction: column; align-items: stretch; gap: 0.5rem; }
}

label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-main); margin-bottom: 0.35rem; }

/* Inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background); /* Use background instead of surface for contrast in inputs */
    color: var(--text-main);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Dark mode inputs specific */
:root.dark-mode input, 
:root.dark-mode select, 
:root.dark-mode textarea {
    background-color: var(--surface); /* Darker input background */
    border-color: var(--border);
    color: var(--text-main);
}
:root.dark-mode input::placeholder { color: var(--text-muted); }

.flex-fill { flex: 1; }

/* Buttons */
button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 600;
    border-radius: 0.5rem; border: 1px solid transparent; cursor: pointer;
    transition: all 0.2s; background-color: var(--primary); color: white;
}
button:hover:not(:disabled) { background-color: var(--primary-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary { background-color: var(--surface); border-color: var(--border); color: var(--text-main); }
button.secondary:hover { background-color: var(--background); }
:root.dark-mode button.secondary:hover { background-color: rgba(255,255,255,0.05); }

button.danger { background-color: #fee2e2; color: var(--danger); }
button.danger:hover { background-color: #fecaca; }
:root.dark-mode button.danger { background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }

button.small { padding: 0.35rem 0.75rem; font-size: 0.75rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left; padding: 0.75rem 1rem;
    background-color: var(--background); border-bottom: 1px solid var(--border);
    font-weight: 600; color: var(--text-muted);
}
.data-table td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.data-table tr:last-child td { border-bottom: none; }
:root.dark-mode .data-table th { background-color: rgba(255,255,255,0.03); }

/* Badges */
.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.badge.paid, .badge.active, .badge.allocated, .badge.matched { background: #dcfce7; color: #15803d; }
.badge.unpaid, .badge.inactive, .badge.overdue, .badge.unmatched { background: #fee2e2; color: #b91c1c; }
.badge.draft, .badge.unknown, .badge.needs_review { background: #f1f5f9; color: #475569; }
.badge.exempt { background: #e0f2fe; color: #0369a1; }

/* Additional badge styles for site statuses */
/* Keep available visually distinct from allocated sites */
.badge.available { background: #ffedd5; color: #c2410c; }
:root.dark-mode .badge.available { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

/* Site grid layout */
.site-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    width: 100%;
}

/* Site card styling */
.site-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.site-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Site card header */
.site-card .site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.site-card .site-number {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

.site-card .site-type {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.site-card .site-body {
    flex: 1;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.site-card .site-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.site-card .site-stat-block {
    display: grid;
    gap: 0.15rem;
}

.site-card .site-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.site-card .site-stat-value {
    font-size: 1rem;
    color: var(--primary);
}

.site-card .site-fee-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-card .site-occupant-list {
    display: grid;
    gap: 0.5rem;
}

.site-card .site-occupant-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
}

.site-card .site-occupant-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.site-card .site-occupant-name {
    font-weight: 600;
    color: var(--text-main);
}

.site-card .site-occupant-fee {
    font-size: 0.82rem;
    text-align: right;
}

.site-card .site-occupant-fee.is-current,
.site-card .site-fee-badge.is-current {
    color: #15803d;
    background: rgba(22, 163, 74, 0.08);
}

.site-card .site-occupant-fee.is-overdue,
.site-card .site-fee-badge.is-overdue {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
}

.site-card .site-occupant-fee.is-flagged,
.site-card .site-fee-badge.is-flagged {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.site-card .site-occupant-fee.is-unknown,
.site-card .site-fee-badge.is-unknown {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.12);
}

.site-card .site-occupant--empty {
    color: var(--text-muted);
}

.site-card .site-actions {
    margin-top: auto;
}

.site-card .site-actions button {
    width: 100%;
}

/* Dark mode badges */
:root.dark-mode .badge.paid, :root.dark-mode .badge.active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
:root.dark-mode .badge.unpaid, :root.dark-mode .badge.overdue { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
:root.dark-mode .badge.unknown { background: rgba(255, 255, 255, 0.1); color: #cbd5e1; }
:root.dark-mode .badge.exempt { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
:root.dark-mode .site-card .site-occupant-row { border-top-color: rgba(255,255,255,0.08); }
:root.dark-mode .site-card .site-stat-value { color: #e2e8f0; }
:root.dark-mode .site-card .site-occupant-name { color: #e2e8f0; }
:root.dark-mode .site-card .site-occupant-fee.is-current,
:root.dark-mode .site-card .site-fee-badge.is-current { color: #4ade80; background: rgba(34, 197, 94, 0.14); }
:root.dark-mode .site-card .site-occupant-fee.is-overdue,
:root.dark-mode .site-card .site-fee-badge.is-overdue { color: #fbbf24; background: rgba(245, 158, 11, 0.16); }
:root.dark-mode .site-card .site-occupant-fee.is-flagged,
:root.dark-mode .site-card .site-fee-badge.is-flagged { color: #fca5a5; background: rgba(239, 68, 68, 0.18); }
:root.dark-mode .site-card .site-occupant-fee.is-unknown,
:root.dark-mode .site-card .site-fee-badge.is-unknown { color: #cbd5e1; background: rgba(148, 163, 184, 0.16); }

/* Dashboard Specifics */
.stat-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); color: var(--text-main); }
.stat-row:last-child { border-bottom: none; }
.chart-wrap { position: relative; height: 300px; width: 100%; margin-top: 1rem; }

/* Theme Switcher */
.theme-switch {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.5rem; border-radius: var(--radius);
    color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
}
.theme-switch:hover { background: var(--background); color: var(--primary); }

/* Modals */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; backdrop-filter: blur(2px); padding: 1rem;
}
.modal-content {
    background: var(--surface); padding: 2rem; border-radius: var(--radius);
    width: 100%; max-width: 500px; box-shadow: var(--shadow-lg);
    max-height: 90vh; overflow-y: auto; color: var(--text-main);
}
.hidden { display: none !important; }

/* Mobile Sidebar Drawer */
@media(max-width:900px){
    #app { flex-direction: column; }

    #mobile-header {
        display: flex;
    }
    
    #sidebar {
        display: none !important;
    }
    
    #main-content {
        padding-bottom: 118px; 
    }
    
    .grid-2 { grid-template-columns: 1fr; }
}


/* Map pins */
.map-container { position: relative; }
#pins-layer { z-index: 5; }
.map-pin{
  position:absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.map-pin--admin {
  appearance: none;
  padding: 0;
  background: #2563eb;
}

.map-pin::after{
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  transform: translate(-50%, -50%);
}
.map-pin.highlight{
  outline: 3px solid rgba(37,99,235,0.5);
  outline-offset: 2px;
}
.map-pin.is-selected {
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.18), 0 10px 20px rgba(15, 23, 42, 0.26);
}

.map-pin.is-bulk-selected {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.18), 0 10px 20px rgba(15, 23, 42, 0.26);
}

.map-pin.is-relocating {
  cursor: grab;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18), 0 10px 20px rgba(15, 23, 42, 0.26);
}

.map-pin.is-dragging {
  cursor: grabbing;
  transition: none;
  z-index: 25;
}

.map-pin.is-match {
  animation: map-pin-flash 1s ease-in-out infinite;
}

.map-pin.is-dimmed {
  opacity: 0.28;
}

.map-pin.status-available{ background:#22c55e; }
.map-pin.status-occupied{ background:#ef4444; }
.map-pin.status-reserved{ background:#f59e0b; }
.map-pin.status-maintenance{ background:#6b7280; }

@keyframes map-pin-flash {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.22), 0 10px 22px rgba(15, 23, 42, 0.3);
  }
}

.map-admin {
  display: grid;
  gap: 0.9rem;
}

.map-admin__controls {
  display: grid;
  gap: 0.85rem;
}

.map-admin__controls--stacked {
  align-items: stretch;
}

.map-admin__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.map-admin__toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.map-admin__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  user-select: none;
}

.map-admin__toggle input {
  width: auto;
}

.map-admin__toggle.is-disabled {
  opacity: 0.55;
}

.map-admin__toggle.is-disabled input,
.map-admin__toggle.is-disabled span {
  cursor: not-allowed;
}

.map-admin__status,
.map-admin__search-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.map-admin__selected {
  min-height: 0;
}

.map-selected-strip {
  display: flex;
  align-items: center;
  min-height: 3.1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: var(--background);
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-selected-strip--empty {
  color: var(--text-muted);
  font-weight: 500;
}

.map-bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
}

.map-bulk-actions__count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.map-selection-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--background);
  display: grid;
  gap: 0.65rem;
}

.map-selection-card--empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.map-selection-card__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.map-selection-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.map-selection-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.map-selection-card__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.map-selection-card__list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.map-selection-card__hint {
  font-size: 0.9rem;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 0.8rem;
  padding: 0.75rem 0.85rem;
}

.map-admin__wrapper {
  margin-top: 0.25rem;
  width: 100%;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #dbeafe;
}

.map-admin__wrapper--dragging {
  cursor: grabbing;
}

.map-admin__image {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-drag: none;
}

.map-admin__overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: auto;
}

.map-selection-box {
  position: absolute;
  z-index: 60;
  border: 2px dashed rgba(37, 99, 235, 0.95);
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.12);
  pointer-events: none;
}


html, body {
    width: 100%;
}

body.mobile-menu-open {
    overflow: hidden;
}

#main-content.auth-screen {
    max-width: 560px;
    margin: 0 auto;
    padding-top: 4rem;
}

.loader {
    color: var(--text-muted);
}

.muted {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input,
.small-input,
.camp-selector {
    width: 100%;
}

.small-input {
    min-width: 180px;
}

.payment-grid input,
.payment-grid select,
.payment-grid textarea,
.payment-grid .small-input {
    min-width: 0;
    box-sizing: border-box;
}

.payment-grid .day-count.small-input {
    min-width: 0;
}

.camp-selector {
    min-width: 220px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.filter-chip {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.login-container {
    max-width: 460px;
    margin: 0 auto;
}

.rates-edit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.rates-edit-table th,
.rates-edit-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

.rates-edit-table th {
    background: var(--background);
    position: sticky;
    top: 0;
    z-index: 1;
}

.card[style*="overflow-x: auto"],
.glass-card[style*="overflow-x: auto"] {
    overflow-x: auto !important;
}

@media (min-width: 901px) {
    #main-content {
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 900px) {
    .header-actions,
    .actions-group {
        align-items: stretch;
    }

    .header-actions > *,
    .actions-group > * {
        width: 100%;
    }

    #main-content {
        padding: 1rem;
        padding-bottom: 118px;
    }

    .map-admin__header,
    .map-selection-card__meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-admin__toggle-row,
    .map-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .map-bulk-actions .actions-group,
    .map-bulk-actions .actions-group > * {
        width: 100%;
    }

    .map-selected-strip {
        min-height: 0;
        padding: 0.7rem 0.85rem;
        font-size: 0.9rem;
    }
}

/* Admin notifications */
.brand-desktop__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.icon-shell-btn {
    position: relative;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.icon-shell-btn:hover,
.icon-shell-btn:focus-visible {
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--primary);
}

.icon-shell-btn svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.icon-shell-btn__badge,
.mobile-nav-notification,
.mobile-more__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.icon-shell-btn__badge {
    position: absolute;
    top: -0.2rem;
    right: -0.18rem;
    border: 2px solid var(--surface);
}

.mobile-nav-notification {
    position: absolute;
    top: 0.32rem;
    right: 0.9rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    font-size: 0.62rem;
}

.mobile-more__item--wide {
    width: 100%;
    justify-content: space-between;
}

.mobile-nav-link {
    position: relative;
}

.notifications-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(4px);
    z-index: 9800;
}

.notifications-panel {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: min(420px, calc(100vw - 2rem));
    max-height: min(78vh, 720px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
    z-index: 9801;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notifications-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.notifications-panel__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.notifications-panel__title {
    margin: 0.2rem 0 0;
    font-size: 1.05rem;
}

.notifications-panel__meta {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.notifications-panel__actions {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notifications-panel__list {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    overflow-y: auto;
}

.notification-item-card {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--surface) 86%, var(--background));
    padding: 0.9rem 1rem;
    cursor: pointer;
    display: grid;
    gap: 0.45rem;
}

.notification-item-card:hover,
.notification-item-card:focus-visible {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.notification-item-card--unread {
    border-color: rgba(37, 99, 235, 0.28);
    background: color-mix(in srgb, var(--surface) 80%, rgba(37, 99, 235, 0.12));
}

.notification-item-card__top {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
}

.notification-item-card__title {
    font-weight: 700;
    color: var(--text-main);
}

.notification-item-card__time {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.notification-item-card__body {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.notification-item-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.notification-item-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--primary);
}

.notification-empty {
    color: var(--text-muted);
    padding: 1rem 0.25rem;
}

.admin-focus-card {
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12) !important;
}

@media (max-width: 900px) {
    .notifications-panel {
        top: auto;
        right: 0.85rem;
        left: 0.85rem;
        bottom: calc(5.7rem + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-height: min(68vh, 560px);
        border-radius: 1.15rem;
    }

    .notifications-panel__header {
        flex-direction: column;
        align-items: stretch;
    }

    .notifications-panel__actions {
        justify-content: flex-start;
    }
}
