:root {
    --admin-navy: #102a43;
    --admin-blue: #1976d2;
    --admin-sky: #eaf4ff;
    --admin-muted: #627d98;
}

body {
    min-height: 100vh;
    background: #f5f8fc;
    color: var(--admin-navy);
}

.admin-navbar {
    background: var(--admin-navy);
}

.page-eyebrow {
    color: var(--admin-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 12px 32px rgba(16, 42, 67, 0.08);
}

.listing-cover {
    width: 100%;
    height: 100%;
    min-height: 330px;
    object-fit: cover;
}

.listing-meta {
    color: var(--admin-muted);
}

.metric-card {
    border: 1px solid #dce8f5;
    border-radius: 0.9rem;
    background: #fff;
}

.metric-label {
    color: var(--admin-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.amenity-badge {
    padding: 0.65rem 0.85rem;
    color: #184e77;
    background: var(--admin-sky);
    border: 1px solid #cfe5fb;
    font-weight: 600;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0.75rem;
    object-fit: cover;
}

.admin-image-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #e8eff7;
}

.admin-image-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.site-logo-preview {
    min-height: 120px;
    padding: 1rem;
    display: grid;
    place-items: center;
    border: 1px solid #dce8f5;
    border-radius: 0.75rem;
    background: #fff;
}

.site-logo-preview img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.hero-crop-preview {
    width: 100%;
    aspect-ratio: 16 / 5;
    overflow: hidden;
    border: 1px solid #dce8f5;
    border-radius: 0.6rem;
    background: #102a43;
    position: relative;
}

.hero-crop-preview img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--preview-image-size, 100%);
    height: auto;
    max-width: none;
    display: block;
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.hero-crop-preview img.is-dragging {
    cursor: grabbing;
}

.hero-crop-preview-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}

.hero-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-settings-toggle::after {
    content: '▾';
    transition: transform 0.2s ease;
}

.hero-settings-toggle[aria-expanded='true']::after {
    transform: rotate(180deg);
}

.section-collapse-toggle {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    font-size: 1.4rem;
}

.section-collapse-toggle::after {
    content: '▾';
    line-height: 1;
    transition: transform 0.2s ease;
}

.section-collapse-toggle[aria-expanded='true']::after {
    transform: rotate(180deg);
}

.maintenance-mode-heading-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.maintenance-mode-title {
    color: var(--admin-navy);
    font-size: clamp(1.65rem, 3vw, 2rem);
    line-height: 1.1;
}

.maintenance-mode-switch {
    min-height: 1.6rem;
    padding-left: 3.5rem;
}

.maintenance-mode-switch .form-check-input {
    width: 3rem;
    height: 1.6rem;
    margin-top: 0;
    margin-left: -3.5rem;
    cursor: pointer;
}

.site-admin-tabs,
.admin-subtabs {
    overflow: visible;
    border-bottom: 1px solid #c9d9ea;
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.28);
}

.site-admin-tabs .nav-link,
.admin-subtabs .nav-link {
    color: var(--admin-muted);
    font-weight: 700;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    
}

.site-admin-tabs .nav-link.active,
.admin-subtabs .nav-link.active {
    position: relative;
    z-index: 1;
    margin-bottom: -1px;
    color: var(--admin-blue);
    background: #f5f8fc;
    border-color: #c9d9ea #c9d9ea #f5f8fc;
    border-bottom-width: 1px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.28);
}

.site-admin-tabs .nav-link.active::after,
.admin-subtabs .nav-link.active::after {
    content: none;
}

.site-admin-tabs .nav-link:not(.active):hover,
.site-admin-tabs .nav-link:not(.active):focus,
.admin-subtabs .nav-link:not(.active):hover,
.admin-subtabs .nav-link:not(.active):focus {
    color: var(--admin-blue);
    
}

.listing-editor-tabs {
    align-items: stretch;
}

.listing-editor-tabs .nav-item {
    display: flex;
    flex: 0 0 auto;
}

.listing-editor-tabs .nav-link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    width: max-content;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.listing-editor-tabs .nav-item:nth-child(2) .nav-link {
    padding-right: 0.5rem;
}

@media (max-width: 575.98px) {
    .listing-editor-tabs {
        width: 100%;
    }

    .listing-editor-tabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
    }

    .listing-editor-tabs .nav-link {
        justify-content: center;
        width: 100%;
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .listing-editor-tabs .nav-item:nth-child(2) .nav-link {
        padding-right: 0.25rem;
    }

    .listing-editor-tabs .nav-item:nth-child(2) .badge {
        display: none;
    }
}

.app-toast-container {
    z-index: 1080;
    pointer-events: none;
}

.app-toast-container .toast {
    pointer-events: auto;
}

.sortable-table-heading > a,
.sortable-heading-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.sortable-table-heading > a:hover,
.sortable-heading-button:hover {
    color: var(--admin-blue);
    text-decoration: none;
}

.sortable-heading-button {
    padding: 0;
    border: 0;
    background: transparent;
}

.sort-indicator {
    font-size: 0.62em;
    line-height: 1;
}

.sortable-heading-button:focus-visible {
    outline: 2px solid var(--admin-blue);
    outline-offset: 3px;
}

.description-copy {
    color: #486581;
    line-height: 1.75;
}

.communication-rules-table th,
.communication-rules-table td { min-width: 110px; }
.communication-rules-table td:nth-child(4) { min-width: 240px; }
.communication-rules-table td:nth-child(5) { min-width: 230px; }
.communication-days { width: 5rem; }
.communication-time { width: 8rem; }

.admin-user-inline-form {
    min-width: 320px;
}

.admin-users-table tbody td {
    vertical-align: top;
}

.admin-user-row {
    cursor: pointer;
}

.admin-user-row:hover {
    background: #f0f6ff;
}

.admin-user-row.is-selected {
    background: #e3f0ff;
}

.admin-user-row.is-selected td {
    background: #e3f0ff;
    box-shadow: inset 0 1px 0 #c4dcff, inset 0 -1px 0 #c4dcff;
}

.calendar-toolbar {
    border-bottom: 1px solid #dce8f5;
    background: #fff;
}

.calendar-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.calendar-listing-panel {
    position: sticky;
    top: 1rem;
    max-height: min(760px, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-listing-search {
    padding: 1rem;
    border-bottom: 1px solid #dce8f5;
    background: #fff;
}

.calendar-listing-scroll {
    min-height: 0;
    flex: 1 1 auto;
    padding: 0.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.calendar-listing-item {
    position: relative;
    border: 1px solid transparent;
    border-radius: 0.75rem;
}

.calendar-listing-item:hover {
    border-color: #c6dcf2;
    background: #f2f8ff;
}

.calendar-listing-item.is-selected {
    border-color: #8dbce9;
    background: #e3f1ff;
    box-shadow: inset 3px 0 0 var(--admin-blue);
}

.calendar-listing-calendar {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    min-height: 66px;
    padding: 0.6rem 2.65rem 0.6rem 0.6rem;
    color: var(--admin-navy);
    text-decoration: none;
}

.calendar-listing-calendar:hover {
    color: var(--admin-navy);
}

.calendar-listing-settings {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #607890;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
}

.calendar-listing-settings:hover,
.calendar-listing-settings:focus {
    border-color: #aac7e3;
    color: var(--admin-blue);
    background: #fff;
}

.calendar-listing-thumb {
    width: 64px;
    height: 52px;
    border-radius: 0.55rem;
    object-fit: cover;
    background: #e8f0f8;
}

.calendar-listing-thumb.is-placeholder {
    display: grid;
    place-items: center;
    color: #56728f;
    font-size: 1.1rem;
    font-weight: 800;
}

.calendar-listing-name {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.calendar-listing-empty {
    padding: 1.25rem 0.75rem;
    text-align: center;
}

.calendar-main-panel {
    min-width: 0;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--admin-muted);
}

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

.calendar-legend-swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.calendar-legend-swatch.is-confirmed { background: #198754; }
.calendar-legend-swatch.is-pending { background: #f0ad00; }
.calendar-legend-swatch.is-expired { background: #e3e6e9; }
.calendar-legend-swatch.is-blocked { background: #6c757d; }
.calendar-legend-swatch.is-synced-airbnb { background: #ff385c; }
.calendar-legend-swatch.is-synced-vrbo { background: #3151b7; }

.calendar-scroll {
    overflow-x: auto;
}

.admin-calendar {
    min-width: 840px;
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    background: #dce8f5;
    gap: 1px;
}

.calendar-weekday {
    padding: 0.7rem;
    color: var(--admin-muted);
    background: #f8fbff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 132px;
    padding: 0.55rem;
    background: #fff;
    user-select: none;
    touch-action: pan-y;
}

.calendar-day.is-outside {
    background: #f7f9fc;
}

.calendar-day.is-outside .calendar-date,
.calendar-day.is-outside .calendar-events {
    opacity: 0.48;
}

.calendar-date {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: var(--admin-navy);
    font-size: 0.85rem;
    font-weight: 700;
}

.calendar-day-prices {
    max-width: calc(100% - 2rem);
    display: grid;
    justify-items: end;
    gap: 0.15rem;
    pointer-events: none;
}

.calendar-day-prices span {
    max-width: 100%;
    padding: 0.12rem 0.35rem;
    overflow: hidden;
    border: 1px solid #b8d6f5;
    border-radius: 999px;
    color: #125ca8;
    background: #eaf4ff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day-prices span.is-custom {
    border-color: #1976d2;
    color: #fff;
    background: #1976d2;
    box-shadow: 0 1px 3px rgba(16, 42, 67, 0.18);
}

.calendar-day-prices small {
    display: block;
    overflow: hidden;
    font-size: 0.58rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day.is-today .calendar-date {
    color: #fff;
    background: var(--admin-blue);
}

.calendar-day.is-selected {
    position: relative;
    z-index: 1;
    background: #dcecff;
    box-shadow: inset 0 0 0 2px var(--admin-blue);
}

.calendar-events {
    margin-top: 0.35rem;
    display: grid;
    gap: 0.3rem;
}

.calendar-event {
    width: 100%;
    padding: 0.35rem 0.45rem;
    overflow: hidden;
    border-left: 3px solid;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0.35rem;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: left;
}

.calendar-event strong,
.calendar-event span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event span {
    margin-top: 0.12rem;
    opacity: 0.78;
}

.calendar-event.is-confirmed {
    border-color: #198754;
    background: #dff3e8;
    color: #145c36;
}

.calendar-event.is-pending {
    border-color: #f0ad00;
    background: #fff2c6;
    color: #745400;
}

.calendar-event.is-expired {
    border-color: #e0e3e6;
    background: #f5f6f7;
    color: #747c84;
}

.calendar-event.is-blocked {
    border-color: #6c757d;
    background: #e9ecef;
    color: #41464b;
}

.calendar-event.is-synced-airbnb {
    border-color: #ff385c;
    background: #ffe5ea;
    color: #8c1730;
}

.calendar-event.is-synced-vrbo {
    border-color: #3151b7;
    background: #e5eaff;
    color: #253c82;
}

.calendar-feed-add,
.calendar-feed-card,
.calendar-feed-empty {
    border: 1px solid #dce8f5;
    border-radius: 0.85rem;
    background: #f8fbff;
}

.calendar-integration-property {
    padding: 0.65rem 0.75rem;
    border: 1px solid #d4e1ee;
    border-radius: 0.5rem;
    color: var(--admin-navy);
    font-weight: 700;
    background: #eef5fc;
}

.mailbox-layout {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.mailbox-thread-pane {
    min-width: 0;
    border-right: 1px solid #dce8f5;
    background: #f8fbff;
}

.mailbox-thread-list {
    max-height: 680px;
    overflow-y: auto;
}

.mailbox-thread-item {
    display: block;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e0eaf4;
    color: var(--admin-navy);
    text-decoration: none;
}

.mailbox-thread-item:hover {
    color: var(--admin-navy);
    background: #edf6ff;
}

.mailbox-thread-item.is-selected {
    background: #dfefff;
    box-shadow: inset 3px 0 0 var(--admin-blue);
}

.mailbox-conversation-pane {
    min-width: 0;
    background: #fff;
}

.mailbox-message-stream {
    max-height: 680px;
    padding: 1.25rem;
    overflow-y: auto;
    background: #f5f8fc;
}

.mailbox-message {
    width: min(82%, 760px);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #d6e3ef;
    border-radius: 0.8rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.07);
}

.mailbox-message.is-outbound {
    margin-left: auto;
    border-color: #a9caeb;
    background: #e8f3ff;
}

.mailbox-message-body {
    overflow-wrap: anywhere;
    color: #2e4052;
    line-height: 1.55;
}

.reservation-message-stream {
    max-height: 420px;
    padding: 0.85rem;
    overflow-y: auto;
    border: 1px solid #dbe5ee;
    border-radius: 0.75rem;
    background: #f5f8fc;
}

.reservation-message-stream .mailbox-message {
    width: min(92%, 760px);
    padding: 0.8rem;
    margin-bottom: 0.75rem;
}

.reservation-message-stream .mailbox-message:last-child {
    margin-bottom: 0;
}

.calendar-feed-empty {
    min-height: 250px;
    place-items: center;
}

.calendar-feed-card {
    background: #fff;
}

.calendar-provider-badge.is-airbnb {
    color: #fff;
    background: #ff385c;
}

.calendar-provider-badge.is-vrbo {
    color: #fff;
    background: #3151b7;
}

.calendar-detail-drawer {
    width: min(470px, 100vw) !important;
    --calendar-drawer-background: #fff;
    background: var(--calendar-drawer-background);
}

.calendar-detail-drawer .site-admin-tabs,
.calendar-detail-drawer .site-admin-tabs .nav-link {
    background: var(--calendar-drawer-background);
}

.calendar-detail-drawer .site-admin-tabs .nav-link.active {
    background: var(--calendar-drawer-background);
    border-bottom-color: var(--calendar-drawer-background);
}

.calendar-detail-drawer .site-admin-tabs .nav-link:not(.active) {
    border-bottom-color: #c9d9ea;
}

.calendar-drawer-section {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #dce8f5;
}

.calendar-detail-list {
    margin: 0;
}

.calendar-detail-list > div,
.calendar-payout-lines > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.42rem 0;
}

.calendar-detail-list dt {
    color: var(--admin-muted);
    font-weight: 600;
}

.calendar-detail-list dd {
    margin: 0;
    text-align: right;
}

.calendar-payout-lines span {
    color: var(--admin-muted);
}

.calendar-payout-total {
    padding-top: 0.75rem !important;
    margin-top: 0.35rem;
    border-top: 1px solid #c9d9ea;
    font-size: 1.05rem;
}

.calendar-note,
.calendar-price-preview {
    padding: 0.85rem;
    border: 1px solid #dce8f5;
    border-radius: 0.65rem;
    background: #f8fbff;
}

.library-documents-table-wrap .dropdown-menu {
    z-index: 1080;
}

.library-documents-table-wrap .dropdown-menu .form-check-label {
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

.library-documents-table-wrap .dropdown-menu .form-check:hover .form-check-label,
.library-documents-table-wrap .dropdown-menu .form-check-input:focus-visible + .form-check-label {
    color: #0d6efd;
}

@media (max-width: 991.98px) {
    .listing-cover {
        min-height: 260px;
        max-height: 430px;
    }

    .calendar-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .calendar-listing-panel {
        position: static;
        max-height: 330px;
    }

    .mailbox-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .mailbox-thread-pane {
        border-right: 0;
        border-bottom: 1px solid #dce8f5;
    }

    .mailbox-thread-list {
        max-height: 320px;
    }

    .mailbox-message {
        width: 94%;
    }
}
