@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Calendar View ──────────────────────────────────────────────────── */
.cal-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 73px);
  transition: grid-template-columns 0.4s ease;
}
.cal-layout.collapsed {
  grid-template-columns: 75px 1fr;
}

.cal-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  transition: padding 0.4s ease;
  position: relative;
}
.cal-sidebar.collapsed {
  padding: 1.5rem 0.5rem;
}

.cal-nav {
  display: flex;
  flex-direction: column;
  padding: 0 0.75rem;
  padding-right: 2rem;
  gap: 2px;
  transition: padding 0.4s ease;
}
.cal-sidebar.collapsed .cal-nav {
  padding-right: 0.75rem;
}

.cal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.cal-nav-link:hover { color: #111827; background: #f3f4f6; }
.cal-nav-link.active { color: #111827; background: #f3f4f6; font-weight: 600; }
.cal-nav-link svg {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.cal-sidebar.collapsed .cal-nav-link {
  justify-content: center;
  padding: 0.6rem;
}
.cal-sidebar.collapsed .cal-nav-link svg {
  transform: scale(1.1);
}
.cal-nav-link span {
  transition: opacity 0.3s ease, max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 200px;
  display: inline-block;
  overflow: hidden;
}
.cal-sidebar.collapsed .cal-nav-link span {
  opacity: 0;
  max-width: 0;
  margin-left: 0;
}

.cal-nav-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem 0;
  border-top: 1px solid #e5e7eb;
  color: #9ca3af;
  font-size: 0.68rem;
  line-height: 1.7;
  transition: padding 0.4s ease;
}
.cal-sidebar.collapsed .cal-nav-footer {
  padding: 1.25rem 0.5rem 0;
  text-align: center;
}

.sidebar-toggle {
  position: absolute;
  top: 1.5rem;
  right: -12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.25rem;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 24px;
  height: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  z-index: 10;
}
.sidebar-toggle:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transform: scale(1.05);
}
.sidebar-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cal-sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.cal-view {
  background: #ffffff;
  color: #111827;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.cal-title h2 { font-size: 1.4rem; font-weight: 300; color: #111827; font-family: Georgia, serif; }
.cal-title p { color: #6b7280; font-size: 0.78rem; margin-top: 2px; }

.cal-date-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cal-nav-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  border-radius: 10px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
}
.cal-nav-btn:hover { border-color: #111827; color: #111827; box-shadow: none; }
.cal-nav-btn svg { width: 14px; height: 14px; }
.cal-date-display {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 500;
}
.cal-today-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  border-radius: 10px;
  padding: 0 0.85rem;
  height: 32px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}
.cal-today-btn:hover { border-color: #111827; color: #111827; box-shadow: none; }

.week-slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  min-width: 160px;
}
.week-slider-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  min-width: 50px;
}
.week-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  outline: none;
}
.week-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #111827;
  cursor: grab;
}
.week-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #111827;
  cursor: grab;
  border: none;
}

.cal-filter-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.filter-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #6b7280;
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: 0.2s ease;
  display: flex; align-items: center; gap: 0.4rem;
}
.filter-pill:hover { border-color: #111827; color: #111827; box-shadow: none; }
.filter-pill.active { background: #111827; border-color: #111827; color: #ffffff; }
.pill-count {
  background: #e5e7eb; border-radius: 10px;
  padding: 1px 6px; font-size: 0.7rem;
}
.filter-pill.active .pill-count { background: rgba(255,255,255,0.2); }

.cal-grid-wrap {
  flex: 1;
  overflow: auto;
  background: #ffffff;
  border-radius: 0;
  padding: 0;
}
.cal-grid-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.cal-grid-wrap::-webkit-scrollbar-track { background: transparent; }
.cal-grid-wrap::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
.cal-grid-wrap::-webkit-scrollbar-thumb:hover { background: #ccc; }

.cal-grid {
  display: grid;
}
.cal-day-cell:hover { background: #f8f8f5; }
.cal-head-cell {
  padding: 0.4rem 0.3rem;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
  border-left: 1px solid #f5f5f5;
  color: #b0b0b0;
  font-size: 0.5rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  position: sticky; top: 0;
  background: #fafafa;
  z-index: 3;
}
.cal-head-cell .head-day { margin-bottom: 1px; }
.cal-head-cell .head-num { font-size: 0.8rem; font-weight: 600; color: #1a1a1a; font-family: Georgia, serif; }
.cal-head-cell.today {
  background: #f5f5f0;
}
.cal-head-cell.today .head-num {
  background: #111827; color: #ffffff;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-family: Georgia, serif;
}
.cal-head-cell.weekend {
  background: #fafaf8;
}

.cal-room-cell {
  padding: 0.3rem 0.5rem 0.3rem 0.7rem;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #eaeaea;
  display: flex; align-items: center; gap: 6px;
  position: sticky; left: 0;
  z-index: 2;
  cursor: pointer;
  transition: background 0.15s ease;
  background: #fafafa;
  white-space: nowrap;
}
.cal-room-cell:hover { background: #f5f5f2; }
.room-num { font-size: 0.78rem; font-weight: 500; color: #1a1a1a; font-family: Georgia, serif; letter-spacing: -0.01em; }
.room-type { font-size: 0.58rem; font-weight: 500; color: #b5b5b5; text-transform: uppercase; letter-spacing: 0.03em; }
.room-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.room-dot.clean { background: #10b981; }
.room-dot.dirty { background: #f59e0b; }

/* Corner cell: sticky both top + left */
.cal-corner-cell {
  position: sticky; left: 0; top: 0;
  z-index: 4;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
  border-right: 1px solid #eaeaea;
}

.cal-day-cell {
  border-bottom: 1px solid #f2f2f2;
  border-left: 1px solid #f8f8f8;
  position: relative; min-height: 50px;
  padding: 4px 2px;
  transition: background 0.1s ease;
}
.cal-day-cell.today-col { background: #f5f5f0; }
.cal-day-cell.weekend { background: #fafaf8; }
.drag-highlight { background: rgba(59, 130, 246, 0.10) !important; box-shadow: inset 0 -2px 0 0 rgba(59,130,246,0.35); }
.cal-select { background: rgba(59, 130, 246, 0.08) !important; }

.res-chip {
  position: absolute; top: 4px; bottom: 4px; left: 2px; right: 2px;
  border-radius: 5px;
  padding: 4px 6px 4px 8px;
  display: flex; flex-direction: column; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: visible; z-index: 1;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-left: 3px solid #e8e8e8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.res-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  z-index: 10;
}
.res-chip-grouped {
  box-shadow: 0 0 0 1px rgba(59,130,246,0.25), 0 2px 6px rgba(0,0,0,0.05);
  z-index: 10;
}
.cal-room-cell.room-grouped {
  background: rgba(59,130,246,0.04);
}

/* Confirmed / Reserved */
.res-chip.reserved { border-left-color: #3b82f6; }
.res-chip.reserved .res-name { color: #171717; }
.res-chip.reserved .res-info { color: #9ca3af; }

/* Checked-in */
.res-chip.checkedin { border-left-color: #10b981; }
.res-chip.checkedin .res-name { color: #171717; }
.res-chip.checkedin .res-info { color: #9ca3af; }

/* Checked-out */
.res-chip.checkedout { border-left-color: #d1d5db; background: #fafafa; }
.res-chip.checkedout .res-name { color: #a3a3a3; }
.res-chip.checkedout .res-info { color: #d4d4d4; }
.res-chip.checkedout { box-shadow: none; }

/* Option */
.res-chip.option { border-left-color: #ec4899; }
.res-chip.option .res-name { color: #171717; }
.res-chip.option .res-info { color: #9ca3af; }

/* Blocked */
.res-chip.blocked {
  background: repeating-linear-gradient(135deg, #fafafa, #fafafa 4px, #f5f5f5 4px, #f5f5f5 8px);
  border-left-color: #94a3b8;
}
.res-chip.blocked .res-name { color: #6b7280; }
.res-chip.blocked .res-info { color: #9ca3af; }

.res-name { font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; color: #171717; }
.res-info { font-size: 0.48rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0px; color: #9ca3af; display: none; }

/* ─── Mobile Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cal-layout { grid-template-columns: 1fr !important; }
  .cal-sidebar { display: none !important; }
  .cal-title-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* Toast animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
