﻿/* ================================================================
   EXO CALENDAR â€” Corporate Theme
   Clean, professional, slightly minimalist
   ================================================================ */

/* ------------------------- BASE & TYPOGRAPHY ---------------------- */
html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
    min-width: 100% !important;
}

body {
    font-family: 'Roboto Condensed', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #2d3436;
    /* Band reserved for the absolute footer (~34px tall) PLUS the 48px gap above it.
       If the footer ever grows, this must grow with it or content gets overlapped. */
    margin-bottom: 84px;
    line-height: 1.5;
}

/* Clears the fixed navbar. (Formerly ".dave > main" - renamed to say what it is.)
   No bottom padding here: the footer gap is the body margin band - see FOOTER section. */
.page-content > main {
    padding-top: 70px !important;
}

a {
    color: #2c5282;
}

    a:hover {
        color: #1a365d;
    }


/* ------------------------- NAVBAR -------------------------------- */
.sticky-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 0;
    z-index: 1000;
}

.navbar {
    background: #d0d8e5 !important;
    border-bottom: 1px solid #b8c4d6 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.4rem 1rem;
    margin: 0 !important;
    margin-bottom: 0 !important;
}

/* ------------------------- ENVIRONMENT BADGE ----------------------------- */
/* A non-live copy (appsettings Data:DisplayEnvironment) colours the whole header and shows a DEV / LOCAL badge,
   so it can't be mistaken for live at a glance. <body> carries "env-on env-<colour>" (AppConfig.EnvironmentCssClass). */
body.env-red   { --env-light: #f8d7da; --env-strong: #b02a37; }
body.env-amber { --env-light: #ffe8b3; --env-strong: #b36b00; }
body.env-green { --env-light: #d1e7dd; --env-strong: #146c43; }
body.env-blue  { --env-light: #cfe2ff; --env-strong: #0a58ca; }
body.env-grey  { --env-light: #e2e3e5; --env-strong: #565e64; }

body.env-on .navbar {
    background: var(--env-light) !important;
    border-bottom: 3px solid var(--env-strong) !important;
}

.env-badge {
    display: inline-block;
    background: var(--env-strong);
    color: #fff;
    border-radius: 4px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    line-height: 1.4;
    vertical-align: middle;
}

body.login-page.env-on {
    background: var(--env-light);
}

body.login-page.env-on .login-container {
    border-top: 6px solid var(--env-strong);
}

body.login-page .env-badge {
    margin-bottom: 12px;
    font-size: 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.15rem;
    color: #1a202c !important;
    letter-spacing: -0.3px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a5568 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

    .nav-link:hover {
        background: #edf2f7;
        color: #1a202c !important;
    }


/* ------------------------- FILTER BAR / CHECKBOXES --------------- */
.sticky-sub {
    position: sticky;
    top: 42px;
    left: 0;
    width: 100%;
    padding: 8px 12px;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

    .sticky-sub div {
        padding: 4px 8px;
        border: 1px solid #cbd5e0;
        background-color: #fff;
        border-radius: 3px;
        font-size: 0.9rem;
    }

/* --- Calendar layout: sidebar + grid --- */
.calendar-layout {
    display: flex;
    gap: 12px;
}

.filter-sidebar {
    flex: 0 0 106px;
    align-self: flex-start;
    position: sticky;
    top: 60px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Filters pop-down toggle - shown on mobile only (desktop keeps the sidebar) */
.filter-toggle { display: none; }
.filter-count { font-size: 0.75rem; font-weight: 600; background: #ebf4ff; color: #2c5282; padding: 1px 8px; border-radius: 10px; }

/* All/none master chip: leads the apartment chips (calendar sidebar + availability finder) */
.apt-all-chip {
    background: #fff;
    padding: 3px 8px;
    border: 1px solid #2c5282;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c5282;
    cursor: pointer;
    margin-right: 6px;
}

/* Apartment filters: one coloured chip per line so the sidebar stays narrow.
   flex-start stops the chips stretching to the full sidebar width - each hugs its own code. */
.apt-filter-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

    /* Same size as the calendar event text (0.85rem) - the chip hugs the code, not the sidebar */
    .filter-sidebar .apt-filter-grid label {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        padding: 1px 5px;
        font-size: 0.85rem;
        border-radius: 3px;
        cursor: pointer;
    }

        .filter-sidebar .apt-filter-grid label input[type="checkbox"] {
            margin: 0;
        }

.filter-group {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #718096;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.filter-sidebar label {
    display: block;
    font-size: 0.93rem;
    padding: 2px 0;
    cursor: pointer;
}

.filter-sidebar input[type="checkbox"] {
    margin-right: 4px;
    accent-color: #2c5282;
}

/* The grid + Load More column beside the filter sidebar */
.calendar-layout .calendar-main {
    flex: 1;
    min-width: 0;
}

/* Mobile: sidebar becomes top bar */
@media (max-width: 900px) {
    .calendar-layout {
        flex-direction: column;
    }

    .calendar-layout {
        margin-top: 0;
    }

    .filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
        padding: 9px 12px;
        margin-bottom: 6px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        font-size: 0.95rem;
        cursor: pointer;
        position: sticky;
        top: 60px;
        height: 44px;
        z-index: 501;
    }

    .filter-toggle-right { display: flex; align-items: center; gap: 8px; }
    .filter-toggle-chev { transition: transform 0.15s; }
    .filter-toggle.open .filter-toggle-chev { transform: rotate(180deg); }

    /* Collapsed by default on mobile; the toggle reveals it */
    .filter-sidebar {
        flex: none;
        display: none;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    /* Phones keep the compact wrapping chips - the vertical stack is a desktop-width device */
    .apt-filter-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* The open panel docks to the underside of the sticky toggle (60px navbar offset + 44px button
       + 6px gap), so button and panel travel together while the calendar scrolls beneath. z-index
       keeps the position:relative day tiles from painting over it; if the panel outgrows the
       viewport it scrolls internally rather than pushing the calendar out of reach. */
    .filter-sidebar.open {
        display: flex;
        position: sticky;
        top: 110px;
        z-index: 500;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
        max-height: calc(100vh - 130px);
        overflow-y: auto;
    }

    .filter-group {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        padding: 4px 8px;
        border: 1px solid #cbd5e0;
        border-radius: 3px;
        background: #fff;
    }

    .filter-group-label {
        display: none;
    }

    .filter-sidebar label {
        display: inline;
        font-size: 0.85rem;
    }
}

.toggleable {
    display: inline-block;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 6px 12px;
    margin: 2px 3px;
    border-radius: 3px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .toggleable:hover {
        border-color: #a0aec0;
    }

    .toggleable input[type="checkbox"] {
        margin-right: 4px;
        accent-color: #2c5282;
    }

.topfill {
    padding-top: 50px;
}


/* ------------------------- CALENDAR ------------------------------ */
.calendar-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
    color: #2d3436;
}

.calendar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    max-height: 100vh;
    padding-bottom: 20px;
    width: 100%;
}

.calendar-month {
    width: 100%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 12px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

    .calendar-month h3 {
        background: #d0d8e5;
        color: #1a202c;
        padding: 10px 12px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 3px 3px 0 0;
        margin: 0;
        border-bottom: 1px solid #b8c4d6;
    }

.month-title {
    font-size: 20px;
    font-weight: 600;
    vertical-align: central;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #1a202c;
}

.calendar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;   /* a partial last row starts at the left like every other row */
}

/* Month marker: a day-sized tile in the flow - big Jimmi front and centre, month name under him.
   Sizing mirrors .calendar-day so it sits in the grid like any other day. */
.calendar-month-marker {
    flex: 1 1 calc(14.28% - 10px);
    min-width: 290px;
    max-width: 290px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    box-sizing: border-box;
}

.month-marker-mascot {
    width: 160px;
    display: block;
}

.month-marker-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a202c;
    letter-spacing: 0.5px;
}

.calendar-day {
    flex: 1 1 calc(14.28% - 10px);
    min-width: 290px;
    max-width: 290px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    /* Always white - the 25%-alpha row tints must blend against a constant base, not the grey page */
    background: #fff;
    box-shadow: none;
    transition: border-color 0.15s;
    font-size: 0.93rem;
    text-align: left;
    overflow: hidden;
    position: relative;
    /* Only lay out / paint tiles as they scroll into view (calendar spans ~13 months).
       Off-screen tiles are skipped until needed, so initial render is far cheaper on mobile. */
    content-visibility: auto;
    contain-intrinsic-size: auto 240px;
}

    .calendar-day .day-content {
        width: 100%;
        word-wrap: break-word;
        white-space: normal;
    }

    .calendar-day.today {
        border: 3px solid #2c8c44;
    }

    .calendar-day:hover {
        border-color: #a0aec0;
    }

.weekday {
    background-color: #fff;
    padding: 5px;
}

.weekend {
    background-color: #f7fafc;
    padding: 5px;
}

.day-content {
    position: relative;
}

/* EXPERIMENT: date header is the tap-target for day Details */
.day-header-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s;
}

    .day-header-link:hover {
        background-color: #e2e8f0;
    }

.day-header-chevron {
    font-size: 0.8rem;
    color: #a0aec0;
}

.day-header-link:hover .day-header-chevron {
    color: #2c5282;
}


/* Responsive calendar grid */
@media (max-width: 1400px) {
    .calendar-day,
    .calendar-month-marker {
        flex: 1 1 calc(20% - 10px);
    }
}

@media (max-width: 1100px) {
    .calendar-day,
    .calendar-month-marker {
        flex: 1 1 calc(25% - 10px);
    }
}

@media (max-width: 900px) {
    .calendar-day,
    .calendar-month-marker {
        flex: 1 1 calc(33.33% - 10px);
    }
}

/* Phones: one full-width day per row. The tile expands to fill the width so every
   icon and detail stays legible (2-up got too cramped for icons on narrower phones). */
@media (max-width: 700px) {
    .calendar-day,
    .calendar-month-marker {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }

    /* Phone month tile: keep it a shallow banner, not a 240px block */
    .calendar-month-marker {
        min-height: 0;
        flex-direction: row;
        padding: 6px 12px;
    }

        .calendar-month-marker .month-marker-mascot {
            width: 44px;
        }

}


/* "Load More Days" - appends the next month of tiles to the grid */
.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 40px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2c5282;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .load-more-btn:hover {
        border-color: #a0aec0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .load-more-btn:disabled {
        opacity: 0.6;
        cursor: wait;
    }

/* Split-drift warning on the refresh screen: one line per apartment, dates + link */
.split-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 640px;
    margin: 10px auto;
    padding: 10px 16px;
    background: #fff8e6;
    border: 1px solid #f0c24c;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #6b4e0a;
}

    .split-warning .bi {
        color: #ba7517;
        margin-right: 4px;
    }

.split-warning-link {
    white-space: nowrap;
    font-weight: 600;
    color: #2c5282;
}

/* Import checker summary chips */
.import-stat {
    padding: 4px 12px;
    background: #edf2f7;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
}

.import-stat-good { background: #e6f4ea; color: #2c8c44; }
.import-stat-warn { background: #fff8e6; color: #b7791f; }
.import-stat-bad  { background: #fdecea; color: #c53030; }

/* ------------------------- APARTMENTS (colour picker) ------------ */
.apartments-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.apartments-hint {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 14px;
}

.apartments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.apt-select {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 6px 10px;
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
}

    .apt-select .apt-feeds {
        font-size: 0.7rem;
        font-weight: 400;
        color: #4a5568;
    }

    .apt-select.selected {
        border-color: #1a202c;
        box-shadow: 0 0 0 2px #fff inset;
    }

/* 12 family columns x 3 tone rows; items arrive family-major so column flow lays them out */
.palette-grid {
    display: grid;
    grid-template-rows: repeat(3, 34px);
    grid-auto-flow: column;
    gap: 4px;
    margin-bottom: 4px;
}

.palette-neutrals {
    display: flex;
    gap: 4px;
}

    .palette-neutrals .palette-slot {
        flex: 1;
        height: 30px;
    }

.palette-slot {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    padding: 0;
}

    .palette-slot:hover {
        border-color: #1a202c;
    }

    .palette-slot.taken {
        cursor: default;
    }

@media (max-width: 700px) {
    .palette-grid {
        grid-template-rows: repeat(6, 30px);   /* six rows of six families on phones */
    }
}

/* ------------------------- LIST TABLE ---------------------------- */
.CalendarListTable {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
}

    .CalendarListTable th {
        width: 10%;
        background: #fff;
        color: #2d3436;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        padding: 8px 10px;
        border-bottom: 2px solid #e2e8f0;
    }

    .CalendarListTable td {
        width: 10% !important;
        padding: 6px 10px;
        border-bottom: 1px solid #edf2f7;
        vertical-align: middle;
    }

    .CalendarListTable tbody tr:hover {
        background: #f7fafc;
    }


/* ------------------------- BOOKING STATUS ------------------------ */
.status_cancelled {
    border: 2px solid #e53e3e;
    opacity: 0.7;
}

/* A quickstay hold: amber border + the word "Pending" where extras sit (solid = booked, amber = held).
   The event already carries the status_held class, so this needs no markup change. */
.status_held {
    border: 2px solid #b7791f;
}

.status_held .event-extras::after {
    content: "Pending";
    color: #b7791f;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}


/* ------------------------- EVENTS -------------------------------- */
.event {
    position: relative;
    transition: opacity 0.15s;
    border-radius: 2px;
    display: flex;
    align-items: center;
    background: #fff;
    /* Taller rows (+~20%) with a gap between them, so the full-height status rectangles
       read as separate buttons rather than one continuous strip. */
    min-height: 26px;
    margin-bottom: 3px;
}

    .event:hover {
        opacity: 0.85;
    }

    /* The whole row navigates to its booking (delegated click), so it advertises as a link.
       Vacant rows have no booking-link inside and stay default. */
    .event:has(a.booking-link) {
        cursor: pointer;
    }

/* EXPERIMENT: coloured apt badge on left, white body, directional arrows */
.event-apt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    padding: 2px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
    border-radius: 2px 0 0 2px;
    text-decoration: none;
}

a.event-apt-badge:hover {
    color: #2d3436;
    text-decoration: none;
}

/* Split segment: dashed inner outline on the apartment badge (inset so the 36px width holds) */
.event-apt-badge-split {
    outline: 2px dashed rgba(45, 52, 54, 0.8);
    outline-offset: -3px;
}

/* Flagged bubble: star (new booking) or book-end arrow (changed check-in/out) sits left of the
   code and pushes it right - the width grows, and that nudge is what catches the eye */
.event-apt-badge-flagged {
    width: auto;
    min-width: 36px;
    padding: 2px 6px;
    gap: 3px;
}

.event-apt-badge-flag {
    font-size: 0.75rem;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* TODO nav badge: unread-style count on the cart, gone when the list is clear */
.nav-badge-host {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 0;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Traditional report table - the one table style for TODO, occupancy and future lists */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .report-table th,
    .report-table td {
        border: 1px solid #e2e8f0;
        padding: 4px 8px;
        text-align: left;
    }

    .report-table th {
        background: #f7fafc;
        font-weight: 700;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #4a5568;
        white-space: nowrap;
    }

/* Fixed layout: both stacked TODO tables get identical column widths, so their vertical
   lines align. Item is the one fluid column - on phones it wraps to a second line. */
.todo-table {
    table-layout: fixed;
    width: 100%;
}

    .todo-table .todo-col-apt {
        width: 90px;
    }

    .todo-table .todo-col-date {
        width: 92px;
    }

    .todo-table .todo-col-status {
        width: 54px;
    }

@media (max-width: 600px) {
    .todo-table .todo-col-apt {
        width: 52px;
    }

    .todo-table .todo-col-date {
        width: 64px;
    }

    .todo-table th,
    .todo-table td {
        padding: 4px 5px;
        font-size: 0.8rem;
    }
}

.todo-status-cell {
    width: 40px;
}

.todo-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a5568;
    margin: 14px 0 6px;
}

/* Same rectangle as the calendar's cleaning-status box - initials of who set the status sit on it */
.todo-status-rect {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
}

    .todo-status-rect:hover {
        opacity: 0.85;
        text-decoration: none;
    }

.todo-status-initials {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    pointer-events: none;
}

/* Links through to the item's booking (ViewBooking) */
.todo-apt-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #2d3436;
    text-decoration: none;
}

    a.todo-apt-badge:hover {
        color: #2d3436;
        text-decoration: none;
        filter: brightness(0.93);
    }

/* Who set the current status - initials chip, full name in the tooltip */
.todo-by-initials {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
}

.todo-date {
    text-align: right;
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.todo-paging {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 10px;
}

.todo-page {
    padding: 2px 9px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #2c5282;
}

.todo-page-current {
    background: #2c5282;
    border-color: #2c5282;
    color: #fff;
    font-weight: 700;
}

/* Feeds admin: fixed columns, the URL takes the room; inputs sit flush in their cells */
.feeds-table {
    table-layout: fixed;
}

    .feeds-table .feeds-col-apt { width: 84px; }
    .feeds-table .feeds-col-code { width: 76px; }
    .feeds-table .feeds-col-platform { width: 130px; }
    .feeds-table .feeds-col-source { width: 130px; }
    .feeds-table .feeds-col-save { width: 70px; }
    .feeds-table th:nth-child(3) { width: 170px; }

    .feeds-table td input,
    .feeds-table td select {
        font-size: 0.82rem;
        padding: 3px 6px;
    }

@media (max-width: 900px) {
    /* Phones scroll the wide table horizontally - the container already allows it */
    .feeds-table td input,
    .feeds-table td select {
        font-size: 0.78rem;
    }
}

/* Admin hub: one card per admin function */
.admin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-card {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    text-decoration: none;
    color: #2d3436;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .admin-card:hover {
        border-color: #4a90d9;
        box-shadow: 0 2px 8px rgba(74, 144, 217, 0.18);
        color: #2d3436;
        text-decoration: none;
    }

    .admin-card .bi {
        font-size: 1.6rem;
        color: #4a90d9;
    }

.admin-card-title {
    font-weight: 700;
    font-size: 1.02rem;
}

.admin-card-text {
    font-size: 0.83rem;
    color: #718096;
}

/* One-line report parameter bar (occupancy + checker): stacked mini-labels, controls in a row */
.report-filter {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

    .report-filter label {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 0.8rem;
        font-weight: 600;
        color: #4a5568;
    }

/* Occupancy report: month x apartment grid, cell green deepens with % booked */

/* report-table base supplies borders/thead; occupancy just centres and sizes its % cells */
.occupancy-table {
    width: auto;
}

    .occupancy-table th,
    .occupancy-table td {
        text-align: center;
        min-width: 52px;
        padding: 5px 9px;
    }

.occupancy-month {
    font-weight: 700;
    text-align: left !important;
    white-space: nowrap;
    background: #f7fafc;
}

.occupancy-prelaunch {
    background: #f1f3f5;
    color: #a0aec0;
}

.occupancy-avg-col {
    background: #fff9db;
    font-weight: 700;
}

/* The bottom Avg row is all pale yellow, label cell included */
.occupancy-table tfoot td {
    background: #fff9db;
}

/* IN/OUT text + arrow = the ViewBooking link (fixed width so arrows align) */
.event-inout {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    width: 60px;
    min-width: 60px;
    color: inherit;
    text-decoration: none;
}

    a.event-inout:hover {
        color: inherit;
        text-decoration: none;
        opacity: 0.7;
    }

.event-inout-text {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.event-inout .bi {
    font-size: 1.1rem;
    line-height: 1;
}

.event-body {
    flex: 1;
    min-width: 0;
    padding: 0 4px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    align-self: stretch;
}

/* Right-side columns shared by Check IN / OUT rows: flexible extras | status dot | tail */
.event-extras {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* One extra = icon plus its note ("<icon> 1pm"), kept together so they never wrap apart */
.extra-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 5px;
    white-space: nowrap;
}

    .extra-item .bi {
        font-size: 0.8rem;
        line-height: 1;
    }

.extra-note {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
}

/* Cleaning status: a solid full-row-height rectangle in the status colour (thumb-sized tap target).
   The colour sits on the inner icon (the cycle JS updates icon.style.color), so the icon paints
   itself as the rectangle via background: currentColor and its glyph is hidden. */
.event-status-dot {
    display: block;
    width: 36px;
    min-width: 36px;
    text-decoration: none;
}

    a.event-status-dot {
        cursor: pointer;
    }

        a.event-status-dot:hover {
            opacity: 0.85;
            text-decoration: none;
        }

    .event-status-dot .bi {
        display: block;
        width: 100%;
        height: 100%;
        font-size: 0;
        background: currentColor;
        border-radius: 3px;
    }

    /* Cleaned = job done: white fill with a green outline, so finished rows stop shouting.
       Keyed off the .status-cleaned class (set server-side from the status GUID, toggled by
       the cycle JS) - never off the status NAME, which is admin-editable. currentColor still
       supplies the GenList green, so the colour stays data-driven. */
    a.event-status-dot.status-cleaned .bi {
        background: #fff;
        border: 2px solid currentColor;
    }

    /* WHO set the status - initials sit on the rectangle (white on solid fills, the status
       colour itself on the white Cleaned box) */
    a.event-status-dot {
        position: relative;
    }

    .event-status-initials {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.68rem;
        font-weight: 700;
        color: #fff;
        pointer-events: none;
    }

    a.event-status-dot.status-cleaned .event-status-initials {
        color: currentColor;
    }

/* Days-until-next-checkin OR platform letter â€” fixed-ish column, right-aligned, so every row lines up.
   min-width covers 1-2 digits (the usual); a rare 3-digit count grows the box for that row only.
   Flex-centred vertically because the body's children stretch to full row height. */
.event-tail {
    min-width: 20px;
    margin-left: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.event-delete-btn {
    position: absolute;
    top: 2px;
    right: 30px;
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 2px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.event:hover .event-delete-btn {
    display: flex;
}

.add-event-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #38a169;
    color: white;
    border: none;
    border-radius: 3px;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.15s;
}

    .add-event-btn:hover {
        opacity: 1;
    }


/* ------------------------- MODAL POP UPS ------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    color: #a0aec0;
    background: none;
    border: none;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

    .modal-close:hover {
        background: #edf2f7;
        color: #2d3436;
    }


/* ------------------------- FORMS --------------------------------- */
.form-group {
    margin-bottom: 14px;
}

    .form-group label {
        display: block;
        margin-bottom: 4px;
        font-weight: 600;
        color: #4a5568;
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 7px 10px;
        border: 1px solid #cbd5e0;
        border-radius: 3px;
        font-size: 13px;
        transition: border-color 0.15s;
        background: #fff;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #2c5282;
            box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
        }

    .form-group textarea {
        resize: vertical;
        min-height: 60px;
    }

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #2c5282;
}

.btn {
    padding: 7px 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.btn-primary {
    background-color: #2c5282;
    color: white;
}

    .btn-primary:hover {
        background-color: #1a365d;
    }

.btn-secondary {
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

    .btn-secondary:hover {
        background-color: #e2e8f0;
        color: #4a5568;
    }

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

    .btn-danger:hover {
        background-color: #c53030;
    }

/* Mobile modal */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 16px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
}


/* ------------------------- BOOKING FORM -------------------------- */
/* The availability finder needs room for metadata-rich result rows; other booking forms stay 600 */
.booking-form-container.availability-wide {
    max-width: 1200px;
}

/* Wide report pages (occupancy grid, checker findings) need the full table on screen */
.booking-form-container.report-wide {
    max-width: 1400px;
}

.availability-wide {
    max-width: 1200px;
}

/* Dates / Nights / Apartments side by side; stack when narrow */
.finder-fieldsets {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

    .finder-fieldsets .booking-fieldset {
        flex: 1 1 280px;
        margin-bottom: 0;
    }

/* --- Multi-apartment stay: leg boxes + switch connectors --- */
/* Full screen width - the boxes are the whole show when a stay needs splitting */
.stay-boxes-wrap {
    width: 100%;
    padding: 20px 20px 0;
    box-sizing: border-box;
}

/* Find-box footer: Find button | status message | Copy pinned bottom-right */
.finder-footer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.finder-status {
    flex: 1;
    font-size: 0.92rem;
    color: #2c5282;
}

.stay-switch-return {
    color: #2c5282;
}

.stay-boxes {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    row-gap: 18px;
}

/* Elastic: few boxes spread out (up to 340px each), many squeeze down to the 218px floor
   before wrapping - so 6 legs fit a wide screen and 2 legs don't look lost */
.stay-box {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    flex: 1 1 240px;
    min-width: 218px;
    max-width: 340px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stay-box-header {
    display: flex;
    flex-direction: column;
    background: #f7fafc;
    padding: 9px 14px;
    border-bottom: 1px solid #e2e8f0;
}

/* Dates left, night count right, one line */
.stay-box-dateline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.stay-box-dates {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a202c;
    white-space: nowrap;
}

.stay-box-nights {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a202c;
    white-space: nowrap;
}

/* 1-night stay: amber accents so short stays stand out from normal legs */
.stay-box-short {
    border-color: #f0c24c;
}

    .stay-box-short .stay-box-header {
        background: #fff8e6;
        border-bottom-color: #f0c24c;
    }


/* One apartment per line: tick, badge, capacity detail, listing link */
.stay-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
    margin: 0;
}

    .stay-choice:last-child {
        border-bottom: none;
    }

    .stay-choice input[type="radio"] {
        display: none;
    }

.stay-choice-tick {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 1.5px solid #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.85rem;
}

.stay-choice input[type="radio"]:checked ~ .stay-choice-tick {
    background: #2c8c44;
    border-color: #2c8c44;
    color: #fff;
}

.stay-choice input[type="radio"]:checked ~ .stay-choice-badge {
    outline: 2px solid #1a202c;
}

.stay-choice-badge {
    padding: 3px 9px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 42px;
    text-align: center;
}

.stay-choice-detail {
    font-size: 0.76rem;
    color: #4a5568;
    line-height: 1.4;
}

/* Gap box: these nights cannot be booked - muted red, informational not alarming */
.stay-box-gap {
    background: #fdf3f2;
    border-color: #e8a9a3;
}

    .stay-box-gap .stay-box-header {
        background: #fae8e6;
        border-bottom-color: #e8a9a3;
    }

.stay-gap-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 14px;
    color: #9b2c2c;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

    .stay-gap-body .bi {
        font-size: 1.4rem;
        opacity: 0.7;
    }

.stay-choice-link {
    margin-left: auto;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
}

/* The switch connector between boxes: rails + switcheroo icon only (dates live in the box headers) */
.stay-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    min-width: 36px;
}

.stay-switch-line {
    width: 1px;
    flex: 1;
    background: #cbd5e0;
}

.stay-switch-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    color: #b7791f;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

    .stay-switch-label .bi {
        font-size: 1.15rem;
    }

    .stay-switch-label strong {
        color: #1a202c;
        font-size: 0.85rem;
    }

/* Phones: boxes stack vertically, connector rotates into a horizontal divider */
@media (max-width: 700px) {
    .stay-boxes {
        flex-direction: column;
        align-items: center;
    }

    .stay-box {
        width: 100%;
        max-width: 420px;
    }

    .stay-switch {
        flex-direction: row;
        min-width: 0;
        width: 100%;
        max-width: 420px;
        padding: 6px 0;
    }

    .stay-switch-line {
        width: auto;
        height: 1px;
        flex: 1;
    }

    .stay-switch-label {
        padding: 0 12px;
    }
}

.booking-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.booking-form-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

    .booking-form-header h2 {
        color: #1a202c;
        font-size: 22px;
        font-weight: 600;
        margin: 0;
    }

.booking-form .form-group {
    margin-bottom: 18px;
}

    .booking-form .form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        color: #4a5568;
        font-size: 13px;
    }

.booking-form .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.15s;
}

    .booking-form .form-control:focus {
        border-color: #2c5282;
        outline: none;
        box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
    }

.booking-form select.form-control {
    height: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 36px;
}

.booking-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.booking-form .text-danger {
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.booking-form .form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.booking-form .btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 3px;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.booking-form .btn-primary {
    background-color: #2c5282;
    color: white;
    border: none;
}

    .booking-form .btn-primary:hover {
        background-color: #1a365d;
    }

.booking-form .btn-secondary {
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

    .booking-form .btn-secondary:hover {
        background-color: #e2e8f0;
        color: #4a5568;
    }

.booking-form .validation-summary-errors {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 3px;
    padding: 12px;
    margin-bottom: 16px;
}

    .booking-form .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

    .booking-form .validation-summary-errors li {
        color: #c53030;
        font-size: 13px;
    }

/* Fieldsets and multi-column rows */
.booking-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 12px 14px 8px;
    margin-bottom: 12px;
}

    .booking-fieldset legend {
        font-size: 0.75rem;
        font-weight: 600;
        color: #a0aec0;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        padding: 0 6px;
        width: auto;
        margin-bottom: 4px;
    }

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.booking-form .form-group {
    margin-bottom: 6px;
}

    .booking-form .form-group label {
        margin-bottom: 2px;
        font-size: 0.75rem;
    }

.booking-validation {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.booking-platform-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: #718096;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

/* View Booking page */
.booking-view-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.booking-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

    .booking-view-header h2 {
        font-size: 1.2rem;
        font-weight: 600;
        color: #1a202c;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.booking-view-actions {
    display: flex;
    gap: 6px;
}

.booking-view-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.booking-view-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.booking-view-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.booking-view-field {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.booking-view-label {
    font-size: 0.7rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.booking-view-value {
    font-size: 0.85rem;
    color: #2d3436;
    font-weight: 500;
}

    .booking-view-value a {
        color: #2c5282;
        text-decoration: none;
    }

        .booking-view-value a:hover {
            text-decoration: underline;
        }

.booking-view-notes {
    font-size: 0.85rem;
    color: #4a5568;
    margin: 0;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .booking-form-container {
        padding: 16px;
        box-shadow: none;
        border-radius: 0;
    }

    .booking-form .form-actions {
        flex-direction: column;
    }

    .booking-form .btn {
        width: 100%;
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .booking-view-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ------------------------- FOOTER -------------------------------- */
/* Slim (~1.5 lines). Absolute at the page bottom; body margin-bottom = this height + 48px gap. */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 6px 0;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #a0aec0;
    text-align: center;
}

    /* The inner wrapper adds NO height of its own - one line of text, nothing else */
    .footer-content {
        padding: 0;
        margin: 0;
        line-height: 1.2;
    }


/* ------------------------- LOGIN PAGE ---------------------------- */
body.login-page {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
}

body.login-page .login-container {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    width: 380px;
    max-width: 90vw;
    overflow: hidden;
}

body.login-page .login-container h1 {
    color: #1a202c;
    margin: 0;
    padding: 18px 32px;
    background: #d0d8e5;
    font-size: 1.35rem;
    font-weight: 600;
}

body.login-page .login-body {
    padding: 28px 32px 32px;
}

body.login-page .login-body .subtitle {
    color: #718096;
    margin: 0 0 24px 0;
    padding: 0;
    font-size: 0.85rem;
}

body.login-page .login-body .login-field {
    margin-bottom: 18px;
}

body.login-page .login-body .login-field label {
    display: block;
    color: #4a5568;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

body.login-page .login-body .login-field input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #f7fafc;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

body.login-page .login-body .login-field input:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
    background: #fff;
}

body.login-page .login-body .btn-login {
    display: block;
    width: 100%;
    padding: 10px;
    background: #2c5282;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    box-sizing: border-box;
    transition: background 0.15s, box-shadow 0.15s;
}

body.login-page .login-body .btn-login:hover {
    background: #1a365d;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.2);
}

body.login-page .login-body .error-message {
    background: #fff5f5;
    color: #c53030;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    border-left: 3px solid #e53e3e;
}

body.login-page .login-body .dev-note {
    margin-top: 24px;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #718096;
    border-left: 3px solid #e2e8f0;
}

body.login-page .login-body .dev-note strong {
    color: #4a5568;
}


/* ------------------------- DASHBOARD ----------------------------- */
.dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.dashboard-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0;
}

/* Header row: title | week range | week nav. Wraps rather than squashing the range on narrow screens. */
.dashboard-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 4px;
}

.dashboard-range {
    font-size: 1rem;
    color: #4a5568;
    white-space: nowrap;
}

.dashboard-weeknav {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

/* Phones: the date range gets its own full-width line under the title, so it never compresses.
   The week nav stays on the title line where there is room for it. */
@media (max-width: 700px) {
    .dashboard-head {
        gap: 4px 12px;
    }

    .dashboard-range {
        order: 3;
        flex: 1 0 100%;
        margin-left: 0;
    }
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-cards-2 {
    grid-template-columns: repeat(2, 1fr);
}

.stat-cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-number.stat-new {
    color: #38a169;
}

.stat-number.stat-cancelled {
    color: #e53e3e;
}

.stat-label {
    font-size: 0.8rem;
    color: #a0aec0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Apartment status boxes grid */
.status-boxes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.status-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-top: 3px solid #cbd5e0;
}

.status-box-checkin {
    border-top-color: #38a169;
}

.status-box-checkout {
    border-top-color: #e53e3e;
}

.status-box-occupied {
    border-top-color: #2c5282;
}

.status-box-vacant {
    border-top-color: #a0aec0;
}

.status-box-switcheroo {
    border-top-color: #d69e2e;
}

.status-box-title {
    font-size: 0.9rem;
    font-weight: 400;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf2f7;
}

.apt-guest {
    font-size: 0.9rem;
    color: #4a5568;
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

@media (max-width: 1100px) {
    .status-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .status-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .status-boxes {
        grid-template-columns: 1fr;
    }
}

.detail-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-cards-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.detail-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.detail-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .detail-table th {
        text-align: left;
        font-weight: 600;
        color: #a0aec0;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        padding: 4px 8px 8px;
        border-bottom: 1px solid #edf2f7;
    }

    .detail-table td {
        padding: 6px 8px;
        color: #2d3436;
        border-bottom: 1px solid #f7fafc;
        vertical-align: middle;
    }

    .detail-table tbody tr:hover {
        background: #f7fafc;
    }

    .detail-table .col-apt {
        width: 50px;
        white-space: nowrap;
    }

    .detail-table .col-date {
        white-space: nowrap;
        width: 75px;
    }

.detail-empty {
    color: #a0aec0;
    font-size: 0.85rem;
    font-style: italic;
}

a.event-link {
    text-decoration: none;
    color: inherit;
}

.event-right {
    float: right;
}

/* Apartment code links to AirBnB - no visual change */
a.event-ext-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

    a.event-ext-link:hover {
        color: inherit;
        text-decoration: none;
    }

a.cleaning-status-toggle {
    text-decoration: none;
    cursor: pointer;
}

/* Action text (Check IN etc) links to edit booking - no visual change */
a.event-action-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

    a.event-action-link:hover {
        color: inherit;
        text-decoration: none;
    }

/* Platform letter (A/B/M) shown on list view */
.platform-letter {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    margin-left: 2px;
    vertical-align: super;
}

/* Booking popup links - inherit text style, no underline */
a.booking-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

    a.booking-link:hover {
        color: inherit;
        text-decoration: underline;
    }

.apt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #2d3436;
}

.apt-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.apt-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.apt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .apt-dot.occupied {
        background: #38a169;
    }

    .apt-dot.vacant {
        background: #cbd5e0;
    }

.apt-name {
    font-weight: 400;
    color: #2d3436;
}

.apt-state {
    color: #4a5568;
    font-size: 0.9rem;
}

.dashboard-links {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

/* Responsive dashboard */
@media (max-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-cards-row,
    .detail-cards-row-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
}


/* ------------------------- REFRESH RESULT PAGE ------------------- */
.refresh-result {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.refresh-header {
    margin-bottom: 24px;
}

    .refresh-header h2 {
        font-size: 1.4rem;
        font-weight: 600;
        color: #1a202c;
        margin-bottom: 4px;
    }

.refresh-time {
    font-size: 0.85rem;
    color: #a0aec0;
}

.refresh-actions {
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

