/* Boutique Hotel PMS Prototype - Custom Premium Style System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* HSL Tailored Color Palette (Apple Minimalist & High Contrast) */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.75);
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.15);
  
  --color-primary: #000000; /* Apple Black */
  --color-primary-hover: #1c1c1e;
  --color-text: #1d1d1f;
  --color-text-muted: #86868b;
  
  /* Status Colors */
  --color-clean-bg: #eafbf0;
  --color-clean-border: #a3e9b9;
  --color-clean-text: #1b7a3e;
  
  --color-dirty-bg: #fff9e6;
  --color-dirty-border: #ffe08c;
  --color-dirty-text: #b27a00;
  
  --color-occupied-bg: #eef2ff;
  --color-occupied-border: #c7d2fe;
  --color-occupied-text: #3730a3;
  
  --color-ooo-bg: #fdf2f2;
  --color-ooo-border: #fca5a5;
  --color-ooo-text: #991b1b;

  --color-accent: #0071e3; /* Apple Link Blue */
  
  /* Layout Dimensions */
  --sidebar-width: 250px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  height: 100vh;
}

/* App Layout Grid */
.pms-app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styling (Apple Premium Gloss) */
.pms-sidebar {
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 10;
  padding: 1.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-symbol {
  width: 36px;
  height: 36px;
  background-color: #000;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.menu-item button {
  width: 100%;
  border: none;
  background: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item button:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--color-text);
}

.menu-item.active button {
  background-color: var(--color-primary);
  color: #fff;
}

/* Main Panel Layout */
.pms-main {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Header Navbar */
.pms-header {
  height: var(--header-height);
  background-color: var(--color-surface-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.header-title-sec h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title-sec p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Global Search Input Box */
.global-search-wrapper {
  position: relative;
  width: 320px;
}

.global-search-wrapper input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background-color: rgba(0, 0, 0, 0.03);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.global-search-wrapper input:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.global-search-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Buttons System */
.btn-pms {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pms-black {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-pms-black:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-pms-white {
  background-color: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-pms-white:hover {
  background-color: #fafafa;
  border-color: var(--color-border-hover);
}

.btn-pms-danger {
  background-color: #ffe6e6;
  color: #991b1b;
}

.btn-pms-danger:hover {
  background-color: #fca5a5;
}

/* Glassmorphism Cards & Panels */
.glass-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Views Wrapper */
.view-container {
  padding: 2rem;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Dashboard Layout */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-details h3 {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-details .value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* Central RoomRack Grid Calendar */
.roomrack-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - 150px);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background-color: var(--color-surface);
}

.roomrack-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.channel-pool-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem;
  max-width: 60%;
}

.pool-badge {
  background-color: #000;
  color: #fff;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: grab;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.pool-badge:active {
  cursor: grabbing;
  transform: scale(0.95);
}

/* RoomRack Layout Grid */
.roomrack-grid-wrapper {
  display: flex;
  height: 100%;
  overflow: auto;
}

/* Left Rooms Column */
.rooms-column {
  width: 220px;
  flex-shrink: 0;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: sticky;
  left: 0;
  z-index: 2;
}

.rooms-col-header {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
  background-color: #fafafa;
}

.room-row-cell {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.room-info-block {
  display: flex;
  flex-direction: column;
}

.room-number {
  font-weight: 700;
  font-size: 0.95rem;
}

.room-type {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.room-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.room-icons {
  display: flex;
  gap: 0.25rem;
  color: var(--color-text-muted);
}

/* Main Calendar Board Area */
.calendar-board {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 1500px; /* Force wide width for horizontal scroll */
}

.days-row-header {
  height: 50px;
  display: flex;
  border-bottom: 2px solid var(--color-border);
  background-color: #fafafa;
}

.day-header-cell {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--color-border);
  font-size: 0.75rem;
}

.day-header-cell.today {
  background-color: #000;
  color: #fff;
  font-weight: 700;
}

.day-name {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  opacity: 0.8;
}

.day-num {
  font-size: 0.95rem;
  font-weight: 700;
}

.roomrack-body-row {
  height: 60px;
  display: flex;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.grid-cell {
  width: 90px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  position: relative;
  transition: background-color 0.15s;
}

.grid-cell.drag-over {
  background-color: rgba(0, 113, 227, 0.15) !important;
  border: 2px dashed var(--color-accent);
}

/* Room Status Cell Colors */
.grid-cell.clean {
  background-color: #fcfdfe;
}
.grid-cell.dirty {
  background-color: #fffdf5;
}
.grid-cell.ooo {
  background-color: #fdfafb;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(153, 27, 27, 0.03) 10px, rgba(153, 27, 27, 0.03) 20px);
}

/* Reservation Block Card Overlay */
.res-block-card {
  position: absolute;
  top: 6px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.res-block-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  filter: brightness(0.98);
}

.res-block-card.checked_in {
  background-color: var(--color-occupied-bg);
  border-color: var(--color-occupied-border);
  color: var(--color-occupied-text);
}

.res-block-card.confirmed {
  background-color: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

/* Contextual Sliding Drawer System */
.pms-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pms-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.pms-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  background-color: var(--color-surface);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pms-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text-muted);
}

.drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #fafafa;
}

/* Forms & UI Form Elements */
.form-group-pms {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group-pms label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-input-pms {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}

.form-input-pms:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Step Wizard Navigation Styles */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  background-color: #fafafa;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
}

.step-item {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-item.active {
  color: var(--color-primary);
  font-weight: 700;
}

.step-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.step-item.active .step-badge {
  background-color: #000;
  color: #fff;
}

/* Folio Window Layouts */
.folio-windows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.folio-window-box {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  background-color: #fafafa;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.folio-window-box h4 {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.folio-tx-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 180px;
}

.folio-tx-item {
  background-color: #fff;
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.folio-tx-item:hover {
  background-color: #f5f5f7;
}

.tx-amount {
  font-weight: 700;
}

/* Escalated task system & animations */
.maid-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.task-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-item-card {
  border-left: 4px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-item-card.escalated {
  border-left-color: #dc2626;
  animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
  from {
    border-left-color: #dc2626;
    box-shadow: 0 0 0px rgba(220, 38, 38, 0);
  }
  to {
    border-left-color: #f87171;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.15);
  }
}

/* Network Status Indicator Banner */
.network-status-banner {
  background-color: #1c1c1e;
  color: #fff;
  padding: 0.5rem 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.network-status-banner.offline {
  background-color: #b22a00;
}

/* UI/UX Animations */
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.modal-pms {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  padding: 2rem;
  display: none;
}

.modal-pms.active {
  display: block;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
