:root,
[data-bs-theme=light] {
    /* Text and borders in the brand blue. */
    --accent: #2563eb;
    /* Blue backgrounds behind white text (selected day/slot). */
    --accent-fill: #2563eb;
    --accent-soft: #dbeafe;
    --accent-soft-hover: #bfdbfe;
    --accent-soft-text: #1e3a8a;
    --border: #e5e7eb;
    --muted-bg: #f3f4f6;
    --page-bg: #f8fafc;
    --surface: #fff;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --text-disabled: #c0c4cc;
    --attention-border: #f59e0b;
    --attention-bg: #fffbeb;
    --hover-shadow: rgba(37, 99, 235, .12);
}

[data-bs-theme=dark] {
    --accent: #60a5fa;
    --accent-fill: #2563eb;
    --accent-soft: #1c2f4d;
    --accent-soft-hover: #24406a;
    --accent-soft-text: #bfdbfe;
    --border: #33383f;
    --muted-bg: #24282e;
    --page-bg: #121417;
    --surface: #1b1e23;
    --text-muted: #9ca3af;
    --text-faint: #6b7280;
    --text-disabled: #4b5058;
    --attention-border: #d97706;
    --attention-bg: #2e2208;
    --hover-shadow: rgba(0, 0, 0, .4);
    --bs-body-bg: #121417;
    --bs-link-color-rgb: 96, 165, 250;
    --bs-link-hover-color-rgb: 147, 197, 253;
}

body {
    background: var(--page-bg);
}

.site-nav {
    background: var(--surface);
}

/* Light/dark toggle: show the icon for the mode you'd switch to. */
.theme-toggle {
    color: var(--bs-nav-link-color);
}

[data-bs-theme=dark] .theme-toggle .icon-moon,
[data-bs-theme=light] .theme-toggle .icon-sun {
    display: none;
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.panel h2 {
    font-size: 1.15rem;
    margin-bottom: .75rem;
}

/* Auth pages */
.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.auth-card h1 {
    font-size: 1.5rem;
}

/* Booking page */
.booking-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 768px) {
    .booking-layout {
        grid-template-columns: 1fr;
    }
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.cal-header h2 {
    margin: 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.cal-dow {
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: .25rem;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: .95rem;
}

.cal-day .free {
    font-size: .65rem;
    opacity: .8;
}

.cal-day.unavailable {
    color: var(--text-disabled);
}

.cal-day.available {
    background: var(--accent-soft);
    color: var(--accent-soft-text);
    font-weight: 600;
}

.cal-day.available:hover {
    background: var(--accent-soft-hover);
}

.cal-day.selected,
.cal-day.selected:hover {
    background: var(--accent-fill);
    color: #fff;
}

.cal-day.today .num {
    text-decoration: underline;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.slot {
    display: block;
    text-align: center;
    padding: .55rem .25rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.slot:hover {
    background: var(--accent-soft);
}

.slot.selected {
    border-color: var(--accent-fill);
    background: var(--accent-fill);
    color: #fff;
}

.slot.taken {
    border-color: var(--border);
    background: var(--muted-bg);
    color: var(--text-faint);
    text-decoration: line-through;
    font-weight: 400;
}

.confirm-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 10px;
    background: var(--muted-bg);
}

/* Lists */
.booking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.booking-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

.booking-list li:last-child {
    border-bottom: 0;
}

.schedule-table select {
    max-width: 140px;
}

.slot-length select {
    max-width: 200px;
}

/* Directory */
.hero {
    margin-bottom: 1.5rem;
}

.search-form {
    max-width: 520px;
}

.host-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.host-card {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
}

.host-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--hover-shadow);
}

.host-initial {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .5rem;
}

/* Admin */
.view-as-bar {
    background: #1e3a8a;
    color: #fff;
    padding: .5rem 0;
    font-size: .95rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
}

.stat {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-label {
    font-size: .85rem;
    color: var(--text-muted);
}

.stat-attention {
    border-color: var(--attention-border);
    background: var(--attention-bg);
}

/* Services: customer picker */
.service-list {
    display: grid;
    gap: 1rem;
    max-width: 720px;
}

.tier-options {
    display: grid;
    gap: .5rem;
}

.tier-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.tier-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.tier-price {
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.chosen-service {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.25rem;
}

/* Services: host editor */
.service-hidden {
    opacity: .75;
    border-style: dashed;
}

.tier-grid,
.tier-head {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 3fr) auto;
    gap: .5rem;
    align-items: center;
}

.tier-head {
    margin-bottom: .25rem;
}

.tier-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}

.tier-row .tier-grid {
    flex: 1;
}

.tier-add {
    padding-top: .5rem;
    border-top: 1px dashed var(--border);
}

@media (max-width: 768px) {
    .tier-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tier-row {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: .5rem;
        border-bottom: 1px solid var(--border);
    }

    .tier-row .tier-grid {
        width: 100%;
    }
}
