/* Venue Hire module. Lists reuse the shared .rm-vlist-* styles in main.css
   - only what is specific to hire bookings lives here. Status colours come
   from config/venuehire.php and are set inline on each pill / grid cell. */

/* Status pill reuses .rm-status-badge (main.css) for layout; colour comes
   from config/venuehire.php, set inline per status. */

/* Overlap marker next to a hirer's name. */
.rm-vh-clash {
    display: inline-block;
    margin-left: 6px;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #9c0006;
    background: #fde2e2;
    border: 1px solid #f4b7b7;
    vertical-align: middle;
}

.rm-vh-when { white-space: nowrap; }
.rm-vh-sub { display: block; font-size: 0.75rem; color: #6b7280; }
.rm-vh-notes { max-width: 260px; font-size: 0.8rem; color: #4b5563; }

/* Register toolbar: date pair stays together, everything wraps on phones. */
.rm-vh-dates { display: flex; gap: 6px; flex: 1 1 260px; }
.rm-vh-dates .form-control { flex: 1 1 0; min-width: 0; }

/* Booking form sections. */
.rm-vh-section-title {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.6px; color: #6b7280;
    margin: 0 0 8px;
}
.rm-vh-section + .rm-vh-section { border-top: 1px solid #f1f2f4; padding-top: 14px; margin-top: 14px; }

/* Money summary on the edit page. */
.rm-vh-money { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-vh-money-tile {
    flex: 1 1 120px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb; border-radius: 8px; background: #f8f9fc;
}
.rm-vh-money-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; }
.rm-vh-money-value { font-size: 1.05rem; font-weight: 600; color: #1f2937; }
.rm-vh-money-tile.is-due .rm-vh-money-value { color: #b45309; }

/* Lets a flex child shrink so .text-truncate can work inside it. */
.rm-vh-min0 { min-width: 0; }

/* Module sub-navigation (Day / Month / Register). */
.rm-vh-subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rm-vh-subnav .rm-vlist-btn-ghost.active { color: #fff; background: #1f2937; border-color: #1f2937; }

/* Date / month bar above a grid. */
.rm-vh-datebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.rm-vh-datebar .form-control,
.rm-vh-datebar .form-select { width: auto; flex: 0 1 auto; font-size: 0.85rem; }
.rm-vh-dayname { font-weight: 600; color: #1f2937; margin-left: 4px; }

/* Colour key. */
.rm-vh-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; font-size: 0.75rem; }
.rm-vh-legend-note { color: #6b7280; }

/* Hour grids. Scroll sideways inside the card, never the page; the first
   column and the header row stay put while scrolling. */
.rm-vh-gridwrap { overflow: auto; max-height: 75vh; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.rm-vh-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.78rem; }
.rm-vh-grid th, .rm-vh-grid td { border-right: 1px solid #f1f2f4; border-bottom: 1px solid #f1f2f4; padding: 0; }
.rm-vh-grid thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8f9fc; color: #374151; font-weight: 600;
    padding: 8px 10px; text-align: left; white-space: nowrap;
}
.rm-vh-grid .rm-vh-rowhead {
    position: sticky; left: 0; z-index: 1;
    background: #f8f9fc; color: #6b7280; font-weight: 600;
    padding: 0 10px; white-space: nowrap; width: 1%;
}
.rm-vh-grid thead .rm-vh-rowhead { z-index: 3; }
.rm-vh-grid.is-day td { min-width: 150px; height: 30px; }
.rm-vh-grid.is-month thead th { padding: 6px 4px; text-align: center; font-weight: 500; font-size: 0.7rem; }
.rm-vh-grid.is-month td { min-width: 34px; height: 30px; }
.rm-vh-grid tr.is-weekend .rm-vh-rowhead { color: #9a3412; }
.rm-vh-grid tr.is-today .rm-vh-rowhead { background: #e0ecff; color: #1e3a8a; }
.rm-vh-grid .rm-vh-sub { font-weight: 400; }

/* A free hour: the whole cell is the "book from here" link. */
.rm-vh-free a { display: block; width: 100%; height: 100%; min-height: 30px; }
.rm-vh-free a:hover, .rm-vh-free a:focus { background: #eef2f7; outline: none; }

/* A booked run of hours. */
.rm-vh-busy { vertical-align: top; }
.rm-vh-busy > a, .rm-vh-busy > div {
    display: block; height: 100%; padding: 4px 8px; color: inherit; text-decoration: none; overflow: hidden;
}
.rm-vh-busy > a:hover { filter: brightness(0.96); }
.rm-vh-who { display: block; font-weight: 600; overflow-wrap: anywhere; }
.rm-vh-tag { display: inline-block; font-size: 0.65rem; font-weight: 600; opacity: 0.85; }
.rm-vh-grid.is-month .rm-vh-busy > a, .rm-vh-grid.is-month .rm-vh-busy > div {
    padding: 4px 6px; white-space: nowrap; text-overflow: ellipsis;
}

/* A cell with two+ bookings that share an hour without truly overlapping
   (e.g. back-to-back 09:00-09:30 and 09:30-10:00) - stacked, not merged. */
.rm-vh-busy-multi { display: flex; flex-direction: column; gap: 2px; padding: 2px; height: 100%; }
.rm-vh-busy-sub {
    flex: 1 1 0; min-height: 0; border-radius: 3px; padding: 2px 6px; overflow: hidden;
}
.rm-vh-busy-sub > a, .rm-vh-busy-sub > div {
    display: block; color: inherit; text-decoration: none; overflow: hidden;
}
.rm-vh-grid.is-month .rm-vh-busy-sub { padding: 1px 4px; white-space: nowrap; text-overflow: ellipsis; }

/* Phone agenda: one card per venue (day) or per date (month). */
.rm-vh-agenda { display: flex; flex-direction: column; gap: 10px; }
.rm-vh-agenda-card { border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; padding: 12px 14px; }
.rm-vh-agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rm-vh-agenda-title { font-weight: 600; color: #1f2937; }
.rm-vh-agenda-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 10px; margin-top: 6px; border-radius: 6px;
    color: inherit; text-decoration: none;
}
.rm-vh-agenda-time { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.rm-vh-agenda-body { min-width: 0; flex: 1 1 auto; }
.rm-vh-agenda-free { color: #6b7280; font-size: 0.85rem; }
