html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: #f7f8fa;
    color: #1a1a1a;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.topnav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e6e6e6;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.topnav .brand {
    font-weight: 600;
}

.topnav .user {
    margin-right: 0.75rem;
    color: #555;
}

.nav-link {
    margin-right: 1rem;
    color: #2F80ED;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

/* Hidden by default — only shown below the breakpoint, where .nav-links becomes a collapsible
   dropdown instead of an inline row (see the media query below). */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: #333;
    border-radius: 1px;
}

/* Below this width the nav bar's brand + every link + username + language select no longer fit
   on one row without wrapping mid-word and overflowing the viewport horizontally — verified live
   at 375px (a common phone width): the row forced the whole page to ~638px wide. Collapses into
   a standard hamburger-menu pattern instead of letting it wrap or scroll sideways. */
@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        background: white;
        border-bottom: 1px solid #e6e6e6;
        padding: 1rem 1.5rem 1.25rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .nav-links-open {
        display: flex;
    }

    .nav-link {
        margin-right: 0;
    }

    .topnav .user {
        margin-right: 0;
    }

    .language-select {
        margin-left: 0;
        align-self: flex-start;
    }
}

.language-select {
    margin-left: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: white;
    font-size: 0.85rem;
}

.language-suggested {
    border-color: #2F80ED;
    font-weight: 600;
}

.select-all-row {
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e6e6e6;
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2rem 0;
}

.user-list li {
    padding: 0.5rem 0;
}

.user-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.user-name {
    font-weight: 500;
}

.user-meta {
    color: #888;
    font-size: 0.85rem;
}

.danger-button {
    background: #C0392B;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
}

.danger-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.link-button {
    background: none;
    border: none;
    color: #2F80ED;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
}

.field {
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field label {
    font-size: 0.85rem;
    color: #555;
}

.field input,
.field select,
.field textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 4.5rem;
}

.decision-note-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    min-width: 180px;
}

button[type="submit"] {
    background: #2F80ED;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: default;
}

.error {
    color: #C0392B;
    font-size: 0.9rem;
}

.password-rules {
    margin: 0.1rem 0 0 0;
    padding-left: 1.2rem;
    color: #777;
    font-size: 0.8rem;
}

.password-rules li {
    padding: 0;
}

.password-rules li.rule-met {
    color: #1E7B34;
}

.password-rules li.rule-met::before {
    content: "✓ ";
}

.notice {
    background: #FEF6E7;
    color: #92610A;
    border: 1px solid #F5D9A0;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

#blazor-error-ui {
    background: #fdf1e8;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.6rem 3.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-indicator {
    padding: 2rem;
    text-align: center;
    color: #888;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #e6e6e6;
    flex-wrap: wrap;
}

.user-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* AdminBookingQueue.razor's .user-row-actions also holds a .decision-note-input (min-width
   180px) alongside Approve/Reject — with flex-shrink: 0 and no wrap, that's 180px + two buttons
   that can't shrink, wider than a phone-width row can hold. Measured live at 375px: forced
   document.body to 413px wide (a 38px overflow) on this specific row, something AdminUsers.razor's
   button-only .user-row-actions doesn't hit. Letting this one row wrap — and the input claim a
   full line of its own — fixes it without affecting AdminUsers.razor, whose buttons already fit. */
@media (max-width: 640px) {
    .user-row-actions {
        flex-wrap: wrap;
        flex-basis: 100%;
    }

    .decision-note-input {
        min-width: 0;
        width: 100%;
    }
}

/* Forces onto its own line — .user-row already has flex-wrap: wrap — so per-row
   success/error feedback (AdminUsers.razor/AdminBookingQueue.razor) sits under that row's
   own info/actions instead of only ever being renderable once for the whole list. */
.user-row-feedback {
    flex-basis: 100%;
}

.user-row-feedback .notice,
.user-row-feedback .error {
    margin: 0.3rem 0 0 0;
}

.status-badge {
    display: inline-block;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    margin-top: 0.15rem;
}

.status-active {
    background: #E6F4EA;
    color: #1E7B34;
}

.status-inactive {
    background: #FBEAEA;
    color: #A32626;
}

.status-pending {
    background: #FFF4E0;
    color: #A9660A;
}

.secondary-button {
    background: white;
    color: #2F80ED;
    border: 1px solid #2F80ED;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: default;
    color: #999;
    border-color: #ccc;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-header h1 {
    margin: 0;
    min-width: 160px;
    text-align: center;
    font-size: 1.3rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e6e6e6;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    overflow: hidden;
}

.calendar-weekday {
    background: white;
    padding: 0.4rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
}

.calendar-day {
    background: white;
    min-height: 68px;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-day-outside {
    background: #fafafa;
    color: #ccc;
}

.calendar-day-number {
    font-size: 0.8rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-today .calendar-day-number {
    background: #2F80ED;
    color: white;
    border-radius: 50%;
}

.calendar-day-clickable {
    cursor: pointer;
}

.calendar-day-selected {
    box-shadow: inset 0 0 0 2px #2F80ED;
}

.calendar-markers {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-marker {
    height: 6px;
    border-radius: 3px;
}

.calendar-marker-pending {
    height: 4px;
    opacity: 0.55;
    border: 1px dashed rgba(0, 0, 0, 0.35);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-empty-note {
    color: #888;
    margin-top: 1rem;
}

/* Tap-triggered equivalent of the marker's hover-only title tooltip — a touchscreen has no
   hover state, so this is how phone users reach the same detail (house/requester/status/dates). */
.calendar-day-detail {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
}

.calendar-day-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.calendar-day-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.calendar-day-detail-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
