/* =============================================================
   ROOM BOOKINGS MODULE STYLES
   ============================================================= */

/* ── Page wrapper ────────────────────────────────────────────── */
.rb-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.rb-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 20px;
}

.rb-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rb-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  transition: background 0.15s;
}

.rb-nav-btn:hover {
  background: var(--color-bg, #f9fafb);
  color: var(--color-text, #111827);
}

.rb-date-input {
  width: 160px;
  height: 34px;
  font-size: 0.875rem;
}

.rb-date-label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text, #374151);
}

.rb-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--color-bg, #f3f4f6);
  border-radius: 8px;
  padding: 3px;
}

.rb-view-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.rb-view-btn--active {
  background: var(--color-surface, #fff);
  color: var(--color-text, #111827);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Room cards grid ─────────────────────────────────────────── */
.rb-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.rb-room-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rb-room-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--room-bg, #f9fafb);
}

.rb-room-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--room-color, #6b7280);
  flex-shrink: 0;
}

.rb-room-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text, #111827);
  margin: 0;
  flex: 1;
}

.rb-room-count {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  background: var(--color-border, #e5e7eb);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Timeline ────────────────────────────────────────────────── */
.rb-timeline {
  padding: 8px 16px 4px;
  position: relative;
}

.rb-ticks {
  position: relative;
  height: 18px;
  margin-bottom: 4px;
}

.rb-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rb-tick::before {
  content: '';
  width: 1px;
  height: 5px;
  background: var(--color-border, #d1d5db);
}

.rb-tick-label {
  font-size: 0.6rem;
  color: var(--color-text-muted, #9ca3af);
  white-space: nowrap;
}

.rb-track {
  position: relative;
  height: 28px;
  background: var(--color-bg, #f3f4f6);
  border-radius: 4px;
  overflow: hidden;
}

.rb-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
  min-width: 4px;
}

.rb-block:hover {
  opacity: 0.85;
  z-index: 1;
}

.rb-block-label {
  font-size: 0.6875rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* ── Booking list ────────────────────────────────────────────── */
.rb-room-bookings {
  padding: 6px 16px 10px;
  flex: 1;
}

.rb-empty {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #9ca3af);
  margin: 0;
  padding: 4px 0;
}

.rb-booking-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--color-border, #f3f4f6);
  font-size: 0.8125rem;
}

.rb-booking-row:last-child { border-bottom: none; }

.rb-booking-time {
  color: var(--color-text-muted, #6b7280);
  white-space: nowrap;
  min-width: 100px;
}

.rb-booking-who {
  font-weight: 500;
  color: var(--color-text, #374151);
  flex: 1;
}

.rb-booking-purpose {
  color: var(--color-text-muted, #9ca3af);
  font-size: 0.75rem;
  flex: 1;
}

.rb-del-btn {
  background: none;
  border: none;
  color: var(--color-text-muted, #9ca3af);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.rb-del-btn:hover {
  color: #dc2626;
  background: #fef2f2;
}

.rb-book-btn {
  margin: 10px 16px 14px;
  align-self: flex-start;
  font-size: 0.8125rem;
}

/* ── Week table ──────────────────────────────────────────────── */
.rb-week-table-wrap {
  overflow-x: auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
}

.rb-week-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.rb-week-table th,
.rb-week-table td {
  border: 1px solid var(--color-border, #e5e7eb);
  padding: 8px 10px;
  font-size: 0.8125rem;
}

.rb-week-table th {
  background: var(--color-bg, #f9fafb);
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.rb-week-room-col { width: 160px; }
.rb-week-day-col  { min-width: 100px; }

.rb-week-today {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.rb-week-today-cell {
  background: #f0f7ff;
}

.rb-week-room-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rb-week-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rb-week-free {
  color: var(--color-text-muted, #9ca3af);
  font-size: 0.75rem;
}

.rb-week-booking {
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 3px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rb-week-booking span {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
}

.rb-week-booking strong {
  color: var(--color-text, #374151);
  font-size: 0.75rem;
}

/* ── Modal ───────────────────────────────────────────────────── */
.rb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.rb-modal {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}

.rb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.rb-modal-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text, #111827);
  margin: 0;
}

.rb-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
  padding: 0 4px;
  border-radius: 4px;
}

.rb-modal-close:hover { color: var(--color-text, #111827); }

.rb-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-optional {
  font-size: 0.75rem;
  color: var(--color-text-muted, #9ca3af);
  font-weight: 400;
}

.rb-modal-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #dc2626;
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.rb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg, #f9fafb);
}

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .rb-rooms-grid {
    grid-template-columns: 1fr;
  }

  .rb-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .rb-date-label {
    display: none;
  }
}

/* Recurring badge */
.rb-recur-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary, #1FAF8C);
  background: var(--primary-light, #e6faf6);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Small delete in week view */
.rb-del-btn--sm {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--error, #dc2626);
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
  float: right;
}
.rb-del-btn--sm:hover { opacity: 1; }
