/* ==========================================================================
   Rental Booking Calendar — Admin CSS
   ========================================================================== */

:root {
    --rb-sidebar-w:    240px;
    --rb-sidebar-bg:   #1e293b;
    --rb-sidebar-text: #94a3b8;
    --rb-sidebar-act:  #ffffff;
    --rb-sidebar-hover:#334155;
    --rb-topbar-h:     56px;
    --rb-primary:      #2563eb;
    --rb-primary-d:    #1d4ed8;
    --rb-border:       #e2e8f0;
    --rb-bg:           #f8fafc;
    --rb-radius:       0.5rem;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
body.rb-admin { margin: 0; background: var(--rb-bg); font-family: system-ui,-apple-system,sans-serif; }

/* -------------------------------------------------------------------------
   Layout shell
------------------------------------------------------------------------- */
.rb-admin {
    display: grid;
    /* minmax(0, 1fr) instead of plain 1fr: in CSS Grid the default
       min-width of a track is auto, so a 1fr column expands to the
       widest min-content of its items. With per-tab forms the
       editor's grid contents push the second track out past the
       viewport (Bootstrap tab-pane defaults, intrinsic input
       widths, etc.). minmax(0, …) caps the min-content at zero so
       the column always fits the remaining viewport width. */
    grid-template-columns: var(--rb-sidebar-w) minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-height: 100vh;
}
.rb-main {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* -------------------------------------------------------------------------
   Sidebar
------------------------------------------------------------------------- */
.rb-sidebar {
    grid-column: 1;
    grid-row: 1;
    background: var(--rb-sidebar-bg);
    color: var(--rb-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    width: var(--rb-sidebar-w);
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.25s ease;
}
.rb-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.rb-sidebar-brand i { font-size: 1.4rem; color: var(--rb-primary); }
.rb-nav-section {
    padding: 1rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}
.rb-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    color: var(--rb-sidebar-text);
    text-decoration: none;
    border-radius: 0;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    margin: 1px 0.5rem;
    border-radius: 0.375rem;
}
.rb-nav-item:hover { background: var(--rb-sidebar-hover); color: #fff; }
.rb-nav-item.active { background: var(--rb-primary); color: #fff; }
.rb-nav-item i { font-size: 1rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.rb-sidebar-footer { margin-top: auto; border-top: 1px solid #334155; padding: 0.5rem; }

/* -------------------------------------------------------------------------
   Topbar
------------------------------------------------------------------------- */
.rb-topbar {
    height: var(--rb-topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--rb-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.rb-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #64748b;
    display: none;
    padding: 0;
}
.rb-page-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}
.rb-topbar-right { margin-left: auto; display: flex; align-items: center; }

/* -------------------------------------------------------------------------
   Content area
------------------------------------------------------------------------- */
.rb-content { padding: 1.5rem; flex: 1; }

/* -------------------------------------------------------------------------
   Cards & panels
------------------------------------------------------------------------- */
.rb-card {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.rb-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.rb-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

/* -------------------------------------------------------------------------
   Stat cards (dashboard)
------------------------------------------------------------------------- */
.rb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rb-stat {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.rb-stat-icon {
    width: 44px; height: 44px;
    border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.rb-stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.rb-stat-icon.green  { background: #dcfce7; color: #15803d; }
.rb-stat-icon.amber  { background: #fef9c3; color: #a16207; }
.rb-stat-icon.red    { background: #fee2e2; color: #b91c1c; }
.rb-stat-label { font-size: 0.78rem; color: #64748b; margin-bottom: 0.2rem; }
.rb-stat-value { font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1; }

/* -------------------------------------------------------------------------
   Tables
------------------------------------------------------------------------- */
.rb-table-wrap {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    overflow: hidden;
}
.rb-table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--rb-border);
    flex-wrap: wrap;
}
.rb-table-toolbar .rb-search { flex: 1; min-width: 180px; max-width: 320px; }
.rb-table-toolbar .ms-auto   { margin-left: auto; }
.rb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.rb-table th {
    background: #f8fafc;
    padding: 0.625rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid var(--rb-border);
    white-space: nowrap;
}
.rb-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.rb-table tbody tr:last-child td { border-bottom: none; }
.rb-table tbody tr:hover td { background: #f8fafc; }

/* -------------------------------------------------------------------------
   Status badges
------------------------------------------------------------------------- */
.rb-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}
.rb-badge--confirmed { background: #dcfce7; color: #15803d; }
.rb-badge--pending   { background: #fef9c3; color: #a16207; }
.rb-badge--cancelled { background: #fee2e2; color: #b91c1c; }
.rb-badge--active    { background: #dbeafe; color: #1d4ed8; }
.rb-badge--inactive  { background: #f1f5f9; color: #64748b; }

/* -------------------------------------------------------------------------
   Page header row
------------------------------------------------------------------------- */
.rb-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.rb-page-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }

/* -------------------------------------------------------------------------
   Forms
------------------------------------------------------------------------- */
.rb-form-card {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.rb-form-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rb-border);
}
.rb-form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    align-items: center;
}

/* "Dirty form" visual cue — pulsing Save button + helper hint.
   Triggered when the user performs a change that needs to be persisted
   via the main form submit (e.g. deleting a seasonal price or a
   date-based limit row). */
@keyframes rb-save-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.55); }
    50%      { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
}
.rb-form-actions .btn.rb-btn-dirty {
    animation: rb-save-pulse 1.6s ease-in-out infinite;
    background-color: #f59e0b;
    border-color: #f59e0b;
}
.rb-form-actions .btn.rb-btn-dirty:hover {
    background-color: #d97706;
    border-color: #d97706;
}

/* Tab navigation inside forms */
.rb-tabs { border-bottom: 1px solid var(--rb-border); margin-bottom: 1.25rem; }
.rb-tabs .nav-link { color: #64748b; font-size: 0.875rem; font-weight: 500; border-radius: 0; }
.rb-tabs .nav-link.active { color: var(--rb-primary); border-bottom: 2px solid var(--rb-primary); }

/* Inline delete confirm */
.rb-confirm-delete { display: none; }
.rb-confirm-delete.show { display: inline-flex; gap: 0.4rem; align-items: center; }

/* -------------------------------------------------------------------------
   Pagination
------------------------------------------------------------------------- */
.rb-pagination { display: flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; }
.rb-pagination a, .rb-pagination span {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--rb-border);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: #374151;
}
.rb-pagination a:hover { background: #f3f4f6; }
.rb-pagination .current { background: var(--rb-primary); color: #fff; border-color: var(--rb-primary); }

/* -------------------------------------------------------------------------
   Responsive — collapse sidebar on small screens
------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .rb-admin            { grid-template-columns: 1fr; }
    .rb-main             { grid-column: 1; }
    .rb-sidebar          { transform: translateX(calc(-1 * var(--rb-sidebar-w))); }
    .rb-sidebar.open     { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
    .rb-sidebar-toggle   { display: block; }
    .rb-content          { padding: 1rem; }
    .rb-stats            { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .rb-stats            { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   Bootstrap overrides
------------------------------------------------------------------------- */
.btn-primary  { background: var(--rb-primary)   !important; border-color: var(--rb-primary)   !important; }
.btn-primary:hover { background: var(--rb-primary-d) !important; border-color: var(--rb-primary-d) !important; }
.form-control:focus, .form-select:focus { border-color: var(--rb-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-label { font-weight: 500; font-size: 0.875rem; }

/* Schedule / timeline */
.rb-schedule-grid { overflow-x: auto; }
.rb-schedule-table { border-collapse: collapse; font-size: 0.78rem; min-width: 600px; }
.rb-schedule-table th, .rb-schedule-table td { border: 1px solid var(--rb-border); padding: 0.3rem 0.5rem; white-space: nowrap; }
.rb-schedule-table th { background: #f8fafc; font-weight: 600; }
.rb-schedule-bar { height: 28px; border-radius: 4px; display: flex; align-items: center; padding: 0 6px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; }
.rb-schedule-bar--confirmed { background: #dcfce7; color: #15803d; }
.rb-schedule-bar--pending   { background: #fef9c3; color: #a16207; }

/* -------------------------------------------------------------------------
   Completion bar
------------------------------------------------------------------------- */
.rb-completion {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.25rem;
}
.rb-completion-items { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.rb-completion-item {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.7rem; font-weight: 600;
    padding: 3px 9px; border-radius: 99px;
    border: 1px solid transparent;
}
.rb-completion-item.done { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.rb-completion-item.todo { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

/* -------------------------------------------------------------------------
   Payment gateway cards
------------------------------------------------------------------------- */
.rb-gw-grid { display: flex; flex-wrap: wrap; gap: 0.875rem; }
.rb-gw-card {
    position: relative;
    border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 1rem 0.75rem;
    width: 155px; min-height: 84px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
    background: #fff;
    gap: 0.35rem;
    user-select: none;
}
.rb-gw-card:hover:not(.rb-gw-soon) { border-color: #6b7280; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.rb-gw-card.rb-gw-active  { border-color: #16a34a; background: #f0fdf4; }
.rb-gw-card.rb-gw-soon    { opacity: 0.45; cursor: default; }
.rb-gw-badge {
    position: absolute; top: -9px; right: 10px;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 7px; border-radius: 99px;
    background: #16a34a; color: #fff; letter-spacing: 0.04em;
}
.rb-gw-name     { font-size: 0.75rem; font-weight: 600; color: #374151; }
.rb-gw-sub      { font-size: 0.65rem; color: #9ca3af; }
.rb-gw-icon     { font-size: 1.9rem; line-height: 1; }
.rb-gw-wordmark { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rb-gw-wordmark.stripe { color: #635bff; }
.rb-gw-wordmark.paypal { color: #003087; }

/* -----------------------------------------------------------------------
   HugeRTE rich-text editor
   --------------------------------------------------------------------- */
/* HugeRTE is loaded via $extraScripts and renders inside its own iframe;
   in-editor preview styles (alert / button / iframe wrappers) live in
   `content_style` inside `window.rbHugeRteInit` (admin.js) so the
   editor's iframe picks them up. The host page only needs spacing
   tweaks around the editor wrapper. */
.tox.tox-tinymce { border-radius: 0 0 4px 4px; }
/* Toolbar dropdowns (color picker, blocks dropdown, custom Alert /
   Button menus) need to sit above the editor itself — leave their
   z-index at TinyMCE's default 1300 so they overlap the editor cleanly. */

/* HugeRTE's full-screen dialogs (Insert Image, Source Code, Embed)
   default to z-index 1100, which sits ABOVE Bootstrap's modal (1055)
   and modal-backdrop (1050). When the operator clicks the editor's
   image button, HugeRTE's dialog opens, then HugeRTE invokes our
   `file_picker_callback` which opens our (Bootstrap) gallery modal —
   without this override the gallery would render BEHIND the HugeRTE
   dialog and be uninteractable.

   `!important` is required because HugeRTE's stylesheet loads
   *dynamically* (the runtime injects a <style> tag the first time an
   editor initialises) which means it sits AFTER admin.css in the
   cascade and its same-specificity rule wins on a non-`!important`
   override. Lowering both the dialog wrapper and the toolbar popups
   to 1040 puts them under Bootstrap's modal-backdrop (1050) so the
   gallery dims and covers them as intended. */
.tox-dialog-wrap     { z-index: 1040 !important; }
.tox.tox-silver-sink { z-index: 1040 !important; }

/* -----------------------------------------------------------------------
   Image Gallery Modal
   --------------------------------------------------------------------- */
.rb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.rb-gallery-item {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #f9fafb;
    transition: border-color 0.15s;
}
.rb-gallery-item:hover { border-color: #3b82f6; }
.rb-gallery-item img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.rb-gallery-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    gap: 4px;
}
.rb-gallery-actions .btn { font-size: 0.7rem; padding: 2px 8px; }


/* HTML source textarea (shown when toggling </> in Quill) */
.rb-html-source {
    min-height: 260px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    tab-size: 2;
    border-radius: 4px;
}

/* HTML toggle button above editor */
.rb-html-toggle {
    font-size: 0.72rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 1px 8px;
}

/* -----------------------------------------------------------------------
   Availability Calendar (property editor — Calendar tab)
   --------------------------------------------------------------------- */
.rb-avail-calendar { /* outer container */ }

/* Navigation row */
.rb-avail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    gap: 0.5rem;
}
.rb-avail-nav-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    text-align: center;
    flex: 1;
}

/* Two-month grid */
.rb-avail-months-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 640px) {
    .rb-avail-months-wrap { grid-template-columns: 1fr; }
}
.rb-avail-month {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.75rem;
}
.rb-avail-month-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.rb-avail-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.rb-avail-hdr {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 2px 0 4px;
}
.rb-avail-day {
    text-align: center;
    font-size: 0.75rem;
    padding: 4px 0;
    border-radius: 4px;
    cursor: default;
    line-height: 1.4;
}
.rb-avail-day--empty {
    background: transparent;
}
.rb-avail-day--available {
    background: #f0fdf4;
    color: #15803d;
}
.rb-avail-day--booked {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}
.rb-avail-day--pending {
    background: #fef9c3;
    color: #a16207;
    font-weight: 600;
}
/* Check-in: transparent left → booked-blue right; circle behind the number */
.rb-avail-day--checkin {
    position: relative;
    isolation: isolate;
    background: linear-gradient(90deg, #f0fdf4 50%, #dbeafe 50%);
    color: #1d4ed8;
    font-weight: 600;
}
/* Check-out: booked-blue left → transparent right; circle behind the number */
.rb-avail-day--checkout {
    position: relative;
    isolation: isolate;
    background: linear-gradient(90deg, #dbeafe 50%, #f0fdf4 50%);
    color: #1d4ed8;
    font-weight: 600;
}
/* Pending check-in: transparent left → pending-yellow right */
.rb-avail-day--pending-checkin {
    position: relative;
    isolation: isolate;
    background: linear-gradient(90deg, #f0fdf4 50%, #fef9c3 50%);
    color: #a16207;
    font-weight: 600;
}
/* Pending check-out: pending-yellow left → transparent right */
.rb-avail-day--pending-checkout {
    position: relative;
    isolation: isolate;
    background: linear-gradient(90deg, #fef9c3 50%, #f0fdf4 50%);
    color: #a16207;
    font-weight: 600;
}
/* Centered full circle — paints above the gradient strip but below the text number */
.rb-avail-day--checkin::after,
.rb-avail-day--checkout::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: #dbeafe;
    border-radius: 50%;
    z-index: -1;
}
.rb-avail-day--pending-checkin::after,
.rb-avail-day--pending-checkout::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: #fef9c3;
    border-radius: 50%;
    z-index: -1;
}
.rb-avail-day--blocked {
    background: #f1f5f9;
    color: #94a3b8;
    text-decoration: line-through;
}
.rb-avail-day--clickable {
    cursor: pointer;
}
.rb-avail-day--clickable:hover {
    background: #f1f5f9;
    position: relative;
}
.rb-avail-day--selected {
    background: var(--rb-primary) !important;
    color: #fff !important;
    font-weight: 700;
    position: relative;
}

/* Calendar legend key */
.rb-cal-key {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 3px;
    vertical-align: middle;
}
.rb-cal-key--available { background: #dcfce7; border: 1px solid #bbf7d0; }
.rb-cal-key--booked    { background: #dbeafe; border: 1px solid #bfdbfe; }
.rb-cal-key--checkin   { background: linear-gradient(90deg, #f0fdf4 50%, #dbeafe 50%); border: 1px solid #bfdbfe; }
.rb-cal-key--checkout  { background: linear-gradient(90deg, #dbeafe 50%, #f0fdf4 50%); border: 1px solid #bfdbfe; }
.rb-cal-key--pending   { background: #fef9c3; border: 1px solid #fde68a; }
.rb-cal-key--blocked   { background: #f1f5f9; border: 1px solid #e2e8f0; }

/* -----------------------------------------------------------------------
   iCal Feeds table (property editor — Calendar tab)
   --------------------------------------------------------------------- */
#feedListWrap { overflow-x: auto; }
#feedListWrap .rb-table { margin-bottom: 0; }

/* -----------------------------------------------------------------------
   Reservation filter banner (shown when a calendar date is selected)
   --------------------------------------------------------------------- */
.rb-res-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--rb-radius);
    padding: 0.5rem 0.875rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------------
   Reservation pagination (Calendar tab)
   --------------------------------------------------------------------- */
.rb-res-pagination { padding-top: 0.5rem; }
.rb-pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--rb-border);
    border-radius: 0.375rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: #374151;
    cursor: pointer;
}
.rb-pagination-item:hover { background: #f3f4f6; }
.rb-pagination-item.current {
    background: var(--rb-primary);
    color: #fff;
    border-color: var(--rb-primary);
    cursor: default;
}

/* -----------------------------------------------------------------------
   Calendar tab — split-pane layout
   --------------------------------------------------------------------- */
.rb-cal-split {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.rb-cal-pane {
    flex: 1 1 65%;
    min-width: 0;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 0.25rem;
}
.rb-cal-side {
    flex: 0 0 360px;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
@media (max-width: 1199px) {
    .rb-cal-side { flex-basis: 320px; }
}
@media (max-width: 991px) {
    .rb-cal-split { flex-direction: column; }
    .rb-cal-pane, .rb-cal-side { flex: 1 1 auto; width: 100%; max-height: none; position: static; }
}

.rb-cal-toast {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1090;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    pointer-events: none;
}
.rb-cal-toast--success { background: #198754; }
.rb-cal-toast--error   { background: #dc3545; }

.rb-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 3;
}

/* Month grid inside left pane */
.rb-cal-months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 1199px) { .rb-cal-months-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .rb-cal-months-grid { grid-template-columns: 1fr; } }

.rb-cal-month {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.75rem;
}
.rb-cal-month-title {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.rb-cal-month-body {
    position: relative;
}
.rb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.rb-cal-hdr {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 2px 0 4px;
}
.rb-cal-day {
    position: relative;
    min-height: 72px;
    border-radius: 4px;
    padding: 5px 4px 4px;
    font-size: 0.75rem;
    cursor: default;
    background: #fff;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    user-select: none;
    -webkit-user-select: none;
}
/* Per-day price label, sits just under the day number (bar overlays the bottom). */
.rb-cal-dayprice {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1;
    margin-top: 2px;
    min-height: 0.68rem;
    pointer-events: none;
}
.rb-cal-day.rb-avail-day--booked .rb-cal-dayprice,
.rb-cal-day.rb-avail-day--pending .rb-cal-dayprice,
.rb-cal-day.rb-avail-day--checkin .rb-cal-dayprice,
.rb-cal-day.rb-avail-day--checkout .rb-cal-dayprice,
.rb-cal-day.rb-avail-day--pending-checkin .rb-cal-dayprice,
.rb-cal-day.rb-avail-day--pending-checkout .rb-cal-dayprice {
    visibility: hidden;
}

/* Multi-select (range) highlight — dashed border inside the cell. */
.rb-cal-day.rb-avail-day--range-selected {
    box-shadow: inset 0 0 0 2px var(--rb-primary, #2563eb);
    background: rgba(37, 99, 235, 0.08);
}
.rb-cal-day.rb-avail-day--range-selected .rb-cal-dayprice {
    color: #1d4ed8;
    font-weight: 600;
}
.rb-cal-day--empty { background: transparent; }
.rb-cal-daynum {
    position: relative;
    font-weight: 500;
    color: #334155;
    z-index: 10;
    font-size: 0.75rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    background: transparent;
}
.rb-cal-day--clickable { cursor: pointer; }
.rb-cal-day--clickable:hover { background: #f1f5f9; }
.rb-cal-day--past {
    opacity: 0.38;
    cursor: not-allowed;
}
.rb-cal-day--past:hover { background: transparent !important; }
.rb-cal-day.rb-avail-day--blocked {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px);
}
/* Reservations in the new month grid are drawn via bars — suppress the
   legacy per-cell gradients, pseudo-circles and colored backgrounds from
   .rb-avail-day--checkin/checkout/booked/pending that were designed for
   the old compact grid. */
.rb-cal-day.rb-avail-day--checkin,
.rb-cal-day.rb-avail-day--checkout,
.rb-cal-day.rb-avail-day--pending-checkin,
.rb-cal-day.rb-avail-day--pending-checkout,
.rb-cal-day.rb-avail-day--booked,
.rb-cal-day.rb-avail-day--pending,
.rb-cal-day.rb-avail-day--available {
    background: #fff;
    color: inherit;
    font-weight: inherit;
    isolation: auto;
}
.rb-cal-day.rb-avail-day--checkin::after,
.rb-cal-day.rb-avail-day--checkout::after,
.rb-cal-day.rb-avail-day--pending-checkin::after,
.rb-cal-day.rb-avail-day--pending-checkout::after {
    content: none;
}
/* Checkout day that has also been admin-blocked: stripe background,
   reservation bar still drawn on top by JS. */
.rb-cal-day.rb-avail-day--checkout-blocked,
.rb-cal-day.rb-avail-day--pending-checkout-blocked {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px);
    color: inherit;
    font-weight: inherit;
    isolation: auto;
}
/* Selection: clean circle that stays below the bar layer (bars have their
   own .rb-res-bar--selected highlight).
   If it's an available day, show a larger widget-style circle.
   If it's a booked/pending day (has reservation bar), hide the circle. */
.rb-cal-day.rb-avail-day--selected {
    background: transparent !important;
}

/* Hide the small circle highlight if there's a reservation (booked, pending, etc.) */
.rb-cal-day.rb-avail-day--selected.rb-avail-day--booked .rb-cal-daynum,
.rb-cal-day.rb-avail-day--selected.rb-avail-day--pending .rb-cal-daynum,
.rb-cal-day.rb-avail-day--selected.rb-avail-day--checkin .rb-cal-daynum,
.rb-cal-day.rb-avail-day--selected.rb-avail-day--checkout .rb-cal-daynum {
    background: transparent;
}

/* Keep stripe visible on blocked days when single-selected or range-selected */
.rb-cal-day.rb-avail-day--selected.rb-avail-day--blocked,
.rb-cal-day.rb-avail-day--selected.rb-avail-day--checkout-blocked,
.rb-cal-day.rb-avail-day--selected.rb-avail-day--pending-checkout-blocked {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px) !important;
}
.rb-cal-day.rb-avail-day--range-selected.rb-avail-day--blocked,
.rb-cal-day.rb-avail-day--range-selected.rb-avail-day--checkout-blocked,
.rb-cal-day.rb-avail-day--range-selected.rb-avail-day--pending-checkout-blocked {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px);
}


/* Bar overlay layer */
.rb-cal-bars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}
.rb-res-bar {
    position: absolute;
    /* top + height set by JS, anchored to cell bottom */
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto;
    background: #1e40af;
    border-radius: 0;
    white-space: nowrap;
}
.rb-res-bar-label { overflow: hidden; text-overflow: ellipsis; }
.rb-res-bar--starts { border-top-left-radius: 999px; border-bottom-left-radius: 999px; padding-left: 12px; }
.rb-res-bar--ends   { border-top-right-radius: 999px; border-bottom-right-radius: 999px; padding-right: 12px; }
.rb-res-bar--booked   { background: #93c5fd; color: #1e40af; }
.rb-res-bar--pending  { background: #fef3c7; color: #92400e; }
.rb-res-bar--imported { background: #a5b4fc; color: #3730a3; }
.rb-res-bar--selected {
    background: #1e40af !important;
    color: #fff !important;
    z-index: 2;
    box-shadow: 0 0 0 2px #1e40af, 0 2px 6px rgba(30,64,175,0.4);
}
.rb-res-bar:hover { filter: brightness(1.05); }

/* Right pane blocks */
.rb-side-block {
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.875rem 1rem;
}
.rb-side-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.rb-side-value { font-weight: 600; color: #1e293b; margin-top: 2px; }
.rb-side-status {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    text-transform: capitalize;
}
.rb-side-status--booked    { background: #dbeafe; color: #1d4ed8; }
.rb-side-status--pending   { background: #fef9c3; color: #a16207; }
.rb-side-status--blocked   { background: #f1f5f9; color: #64748b; }
.rb-side-status--checkin,
.rb-side-status--checkout  { background: #dbeafe; color: #1d4ed8; }
.rb-side-status--available { background: #dcfce7; color: #15803d; }

.rb-side-kv {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 4px 0;
    font-size: 0.85rem;
    border-top: 1px solid #f1f5f9;
}
.rb-side-kv:first-of-type { border-top: none; }
.rb-side-kv span { color: #64748b; }

/* Multi-select action panel (admin: edit rules across multiple dates) */
/* .rb-side-multi {
    border-color: var(--rb-primary, #2563eb); 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
} */
.rb-side-multi .rb-multi-action + .rb-multi-action { margin-top: 0.75rem; }
.rb-side-multi .btn-group .btn { font-weight: 500; }
.rb-side-multi .btn-outline-success.active,
.rb-side-multi .btn-outline-danger.active { color: #fff; }
.rb-side-multi a.small { text-decoration: none; }
.rb-side-multi a.small:hover { text-decoration: underline; }

/* Feed cards */
.rb-feed-card {
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    overflow: hidden;
    margin-bottom: 0.625rem;
    background: #fff;
}
.rb-feed-card-head { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; }
.rb-feed-card-name { font-weight: 600; color: #1e293b; }
.rb-feed-card-sub  { margin-top: 2px; }
.rb-feed-card-error { margin-top: 4px; }
.rb-feed-card-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #fff;
    border: none;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
}
.rb-feed-card-row:first-of-type { border-top: none; }
.rb-feed-card-row:hover { background: #f8fafc; }
.rb-feed-card-row i { color: #64748b; font-size: 1rem; }
.rb-feed-card-row.is-loading { opacity: 0.6; pointer-events: none; }

.rb-feed-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--rb-radius);
    color: #334155;
    cursor: pointer;
    font-size: 0.9rem;
}
.rb-feed-cta:hover { background: #f8fafc; border-color: #94a3b8; }

.rb-feed-add-form {
    margin-top: 0.625rem;
    padding: 0.875rem;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    background: #f8fafc;
}

/* Edit Feed modal */
.rb-feed-edit-modal { border-radius: 14px; }
.rb-feed-edit-group {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
}
.rb-feed-edit-field {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}
.rb-feed-edit-field:last-child { border-bottom: none; }
.rb-feed-edit-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}
.rb-feed-edit-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #1e293b;
    background: transparent;
    padding: 0;
}
.rb-feed-disconnect {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------
   Booking widget calendar inside admin reservation form
   Resets admin property-calendar styles that would otherwise bleed in
   ----------------------------------------------------------------------- */
.rb-res-booking-cal .rb-cal-grid {
    gap: 0;
}
.rb-res-booking-cal .rb-cal-day {
    min-height: 0;
    border-radius: 0;
    border: none;
    padding: 0;
    flex-direction: row;
    gap: 0;
}
.rb-feed-disconnect:hover { color: #991b1b; text-decoration: underline; }

/* Bottom-menu items in the property editor's Guest App tab share the
   same `renderItem` closure as section items, but bottom-nav items
   never use a card-gallery image. Hide the image col inside the
   `.rb-ga-bm-card` ancestor so the operator sees only the fields
   that apply (label / icon / type-aware payloads). */
.rb-ga-bm-card .rb-ga-item-image-col { display: none !important; }

