#leftPanel {
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  padding: 12px;
}

.panel-section {
  padding: 0;
  border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
  border-bottom: none;
}

#rightPanel {
  padding: 0;
}

/* MINI CALENDAR */
.mini-calendar-container {
  padding: 5px 0;
}

/* Mini Calendar */
.mini-calendar {
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.mini-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mini-calendar-header button {
  border: none;
  padding: 4px 8px;
  background: #eee;
  cursor: pointer;
  border-radius: 4px;
}
.mini-calendar-header button:hover {
  background: #ddd;
}

/* Mini Calendar Grid */
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.mini-calendar-grid div {
  font-size: 13px;
  padding: 6px 0;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.mini-calendar-grid div:hover {
  background: #e5e7eb;
}
.mini-calendar-grid .today {
  background: #3b82f6;
  color: white;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mini-day {
  padding: 6px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
}

.mini-day:hover {
  background: #e0f2fe;
}

.mini-day.active {
  background: #2563eb;
  color: white;
}

.main-calendar-shell {
  width: 100%;
  height: calc(100dvh - var(--navbar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

/* Toolbar stays visible */
#calendarToolbar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: #f8fafc;
  padding: 8px 3px;
  border-bottom: 1px solid #e5e7eb;
}

/* The grid area scrolls */
.calendar-panel-section {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  padding: 0;
}

#main-calendar-grid {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0;
}

#mainCalendar {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Day cells */
#main-calendar-grid .day {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 6px;
  height: 100px;
  border-radius: 6px;
  position: relative;
}
#main-calendar-grid .day:hover {
  border-color: #3b82f6;
}

#main-calendar-grid .day .date-label {
  font-size: 12px;
  font-weight: 500;
}
/* Main Calendar Header */
.main-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-calendar-header button {
  border: none;
  padding: 0 14px;
  margin: 0 4px;
  background: #eee;
  cursor: pointer;
  border-radius: 4px;
}
.main-calendar-header button:hover {
  background: #ddd;
}

/* ROOMS */
.rooms-section {
  margin-top: 20px;
}
.rooms-section h3 {
  margin-bottom: 12px;
  font-size: 17px;
}
.room-list {
  list-style: none;
  padding: 0;
}
.room-item {
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  gap: 10px;
}
.room-item:hover {
  background: #f5f5f5;
}
.room-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 6px;
  cursor: pointer;
}

.room-checkbox {
  display: flex;
  align-items: center;
  gap: 8px; /* Space between elements */
  white-space: nowrap; /* Prevent text wrapping */
}

/* Hide native checkbox */
.room-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background-color: var(--event-color, #cccccc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #999;
  cursor: pointer;
  position: relative;
}

/* Show checkmark when checkbox is checked */
.room-checkbox input[type="checkbox"]:checked + .checkbox-color::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  line-height: 1;
}

.room-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TOOLBAR */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.toolbar-header {
  top: 0;
  z-index: 200;
  background: #fff;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.view-switch .active {
  background: #3b82f6;
  color: white;
}

/* BUTTONS */
.btn-icon {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}
/* MAIN MONTH GRID */

.month-grid {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday-header {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  font-size: 13px;
  font-weight: 550;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  /* border-bottom: none; */
  border-radius: 9px;
  overflow: hidden;
  /* display: grid;
  grid-template-columns: repeat(7, 1fr);

  margin-bottom: 4px; */
}

.weekday-header > div {
  text-align: center;
  padding: 4px 0;
  color: var(--primary-color);
}


/* EVENTS */

.event-card {
  font-size: 12px;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 4px;
  color: white;
  cursor: pointer;
}

.event-card.all-day { background: #059669; }
.event-card.multi-day { background: #7c3aed; }
.event-card.normal { background: #2563eb; }

.today {
  border: 1px solid #f59e0b;
}

.mini-day.today {
  background: #2563eb;
  color: white;
  font-weight: 600;
}
.day-cell {
  min-height: 135px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px;
}

.day-number {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.day-cell.today {
  box-shadow: inset 0 0 0 1px #f59e0b;
}
.day-cell.other-month {
  background-color: #f9fafb;
  color: #9ca3af; /* gray text */
}
.day-cell.other-month:hover {
  background-color: #f3f4f6;
}
.day-cell.other-month .day-number {
  opacity: 0.6;
}
.day-cell.other-month .event-card {
  opacity: 0.5;
}

.week-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* HEADER */
.week-header {
  position: sticky;
  top: 0;
  z-index: 80;

  display: grid;
  grid-template-columns: 70px repeat(7, minmax(0, 1fr));

  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  /* display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  border-bottom: 1px solid #ddd; */
}

/* ALL DAY */
.all-day-row {
  position: sticky;
  top: 58px;
  z-index: 90;
  display: grid;
  background-color: whitesmoke;
  grid-template-columns: 80px repeat(7, 1fr);
  border-bottom: 1px solid #ddd;
}

.time-col-header {
  padding: 6px;
  width: 80px;
  flex-shrink: 0;
  /* font-size: 12px; */
  /* color: #6b7280; */
}

.day-header {
  text-align: center;
  padding: 6px;
  font-size: small;
  /* font-weight: bold;
  margin-bottom: 10px; */
}

.day-header.today {
  background: #fef3c7;
}

.time-col-label {
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  color: var(--primary-color);
}

.all-day-cell {
  min-height: 40px;
  padding: 2px;
}

/* BODY */
.week-body {
  display: flex;
  flex: 1;
  overflow-y: auto;
}

/* LEFT TIME COLUMN */
.time-column {
  width: 80px;
  flex-shrink: 0;
}

.time-slot {
  position: relative;
  height: 48px;
  border-bottom: 1px solid #eee;
}
/* Label positioned at bottom */
.time-slot span {
  position: absolute;
  top: 0;          /* adjust for perfect alignment */
  right: 4px;
  transform: translateY(-50%); /* KEY: move to previous border */
  font-size: 12px;
  color: #6b7280;
  background: white;     /* prevents overlap with grid line */
  padding: 0 2px;
  z-index: 1;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
  flex: 1;
}

.day-column {
  position: relative;
  border-left: 1px solid #eee;
  height: calc(24 * 48px);
  background-image:
  /* major hour lines */
  repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 47px,
    #d1d5db 48px
  ),
  /* minor 15-min lines */
  repeating-linear-gradient(
    to bottom,
    #f3f4f6 0px,
    #f3f4f6 1px,
    transparent 1px,
    transparent 24px
  );
}

.day-view {
  padding: 12px;
}

.no-events {
  color: #9ca3af;
}

.day-col {
  text-align: center;
  padding: 6px;
}

.day-col.today {
  background: #fef3c7;
  border-radius: 6px;
}

.event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  /* background: #3b82f6; */
  color: white;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 12px;
  overflow: hidden;
}

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: red;
  z-index: 10;
}

.view-switch, .view-switcher {
  display: flex;
  gap: 8px;
}

.view-switcher .btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.public-calendar-shell {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0;
}

.public-event-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--event-color, #0f172a);
  color: var(--event-text-color, white);
  padding: 12px;
  margin: 10px 10px;

  border: 1px solid #e5e7eb;
  border-radius: 14px;

  background: #ffffff;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.public-event-card:hover {
  transform: translateY(-1px);

  border-color: #cbd5e1;

  box-shadow:
    0 4px 10px rgba(15, 23, 42, 0.06);
}

.public-event-card.is-yesterday {
  background: #f8fafc;
}

.public-event-card.is-today {
  background: #fff7ed;
  border-color: #fb923c;
}

.event-date {
  width: 58px;
  min-width: 58px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 8px 6px;

  border-radius: 12px;

  background: #f1f5f9;
}

.event-date .day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;

  color: #0f172a;
}

.event-date .month {
  margin-top: 4px;

  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  color: #64748b;
}

.event-info {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;

  overflow: hidden;
}

.event-info .event-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  /* text-shadow: 0 1px 1px rgba(0,0,0,0.2); */
  overflow: hidden;
  text-overflow: ellipsis;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.event-info .event-meta {
  font-size: 13px;
  line-height: 1.45;

  /* color: #64748b; */
}

/* .event-info .event-room {
  font-size: 12px;
  font-weight: 500;

  color: #475569;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
} */

.public-events-empty,
.public-events-loading {
  padding: 14px;
  color: #64748b;
}

.booking-conflict {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 14px;
  line-height: 1.4;
}

.booking-conflict.hidden {
  display: none;
}

.public-month-calendar {
  width: 100%;
}

.public-month-calendar .weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.public-month-calendar .weekday-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.public-month-calendar .month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
}

.public-month-calendar .month-cell {
  min-height: 95px;
  padding: 6px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
}

.public-month-calendar .month-cell.outside-month {
  background: #f8fafc;
  color: #94a3b8;
}

.public-month-calendar .month-cell.today-cell {
  background: #fff7ed;
}

.public-month-calendar .month-cell-date {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.public-month-calendar .month-cell-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.public-month-calendar .month-event {
  padding: 4px 5px;
  border-radius: 6px;
  color: var(--event-text-color, white);
  background-color: var(--event-color, #0f172a);
  /* background: #e0f2fe; */
  /* border-left: 3px solid #0284c7; */
  font-size: 12px;
  line-height: 1.25;
  cursor: default;
}

.public-month-calendar .month-event-title {
  font-weight: 700;
  /* text-shadow: 0 1px 1px rgba(0,0,0,0.2); */
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-month-calendar .month-event-time,
.public-month-calendar .month-event-room {
  /* color: var(--event-color, #475569); */
  /* color: var(--event-text-color, white); */
  /* text-shadow: 0 1px 1px rgba(0,0,0,0.2); */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Mobile */
@media (max-width: 768px) and (orientation: portrait) {
  .view-switcher {
    display: none;
  }
}