/* StayServe ERP - Modern Hospitality Design System */
:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent-gold: #d97706;
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --status-available: #10b981;
  --status-occupied: #3b82f6;
  --status-reserved: #8b5cf6;
  --status-dirty: #f59e0b;
  --status-cleaning: #06b6d4;
  --status-out: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  z-index: 1045;
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand span.badge-mode {
  font-size: 0.65rem;
  background: var(--accent-gold);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex-grow: 1;
}

.menu-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  padding: 0.8rem 1.5rem 0.3rem;
  letter-spacing: 1px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.5rem;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-left-color: #38bdf8;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.15);
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.top-navbar {
  background: #ffffff;
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.page-wrapper {
  padding: 1.75rem 2rem;
  flex-grow: 1;
}

/* Card Styling */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.content-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
}

.content-card .card-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Status Badges System (Hotel, Reservations, Folio, Dining, Orders)
   ========================================================================== */
.badge {
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.2px;
  border-radius: 6px !important;
  padding: 0.35rem 0.65rem !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  white-space: nowrap;
}

/* Universal Fallback: ensures NO badge text is ever invisible white-on-white */
.badge:not([class*="bg-"]) {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

/* Room Status Badges & Rack */
.badge-available { background-color: #d1fae5 !important; color: #065f46 !important; border: 1px solid #a7f3d0 !important; }
.badge-occupied { background-color: #dbeafe !important; color: #1e40af !important; border: 1px solid #bfdbfe !important; }
.badge-reserved { background-color: #ede9fe !important; color: #5b21b6 !important; border: 1px solid #ddd6fe !important; }
.badge-dirty { background-color: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.badge-cleaning { background-color: #cffafe !important; color: #155e75 !important; border: 1px solid #a5f3fc !important; }
.badge-outofservice, .badge-out-of-service { background-color: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca !important; }

/* Reservation Status Badges */
.badge-confirmed { background-color: #dbeafe !important; color: #1e40af !important; border: 1px solid #93c5fd !important; }
.badge-checkedin, .badge-checked-in, .badge-checked_in { background-color: #d1fae5 !important; color: #065f46 !important; border: 1px solid #6ee7b7 !important; }
.badge-checkedout, .badge-checked-out, .badge-checked_out { background-color: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }
.badge-pending { background-color: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.badge-cancelled, .badge-canceled { background-color: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fca5a5 !important; }
.badge-noshow, .badge-no-show, .badge-no_show { background-color: #fce7f3 !important; color: #9d174d !important; border: 1px solid #fbcfe8 !important; }

/* Folio & Billing Badges */
.badge-open { background-color: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.badge-settled { background-color: #d1fae5 !important; color: #065f46 !important; border: 1px solid #a7f3d0 !important; }
.badge-closed { background-color: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }

/* Dining Table & Order Badges */
.badge-preparing { background-color: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.badge-ready { background-color: #ecfdf5 !important; color: #047857 !important; border: 1px solid #a7f3d0 !important; }
.badge-served { background-color: #e0f2fe !important; color: #0369a1 !important; border: 1px solid #bae6fd !important; }
.badge-billed { background-color: #ede9fe !important; color: #5b21b6 !important; border: 1px solid #ddd6fe !important; }
.badge-completed { background-color: #d1fae5 !important; color: #065f46 !important; border: 1px solid #a7f3d0 !important; }
.badge-refunded, .badge-void { background-color: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca !important; }

.room-card-box {
  border-radius: 10px;
  padding: 1rem;
  background: #ffffff;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
  position: relative;
}

.room-card-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.room-card-box.status-Available { border-top: 4px solid var(--status-available); }
.room-card-box.status-Occupied { border-top: 4px solid var(--status-occupied); }
.room-card-box.status-Reserved { border-top: 4px solid var(--status-reserved); }
.room-card-box.status-Dirty { border-top: 4px solid var(--status-dirty); }
.room-card-box.status-Cleaning { border-top: 4px solid var(--status-cleaning); }
.room-card-box.status-OutOfService { border-top: 4px solid var(--status-out); }

.room-no {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Folio and Bills */
.bill-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.bill-total-row {
  font-size: 1.15rem;
  font-weight: 700;
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
}

/* Print Styles */
@media print {
  .sidebar, .top-navbar, .no-print, .btn, .breadcrumb {
    display: none !important;
  }
  .main-content, .page-wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }
  body {
    background: #ffffff !important;
  }
  .bill-box {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* Configuration & Policy Settings UI */
.config-nav .nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px 8px 0 0;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
}
.config-nav .nav-link.active {
  color: var(--primary);
  background-color: #ffffff;
  border-color: var(--border-color) var(--border-color) #ffffff;
  border-top: 3px solid var(--primary);
  box-shadow: 0 -2px 5px rgba(0,0,0,0.02);
}
.config-field-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.2rem;
  height: 100%;
  transition: all 0.2s ease;
}
.config-field-group:hover, .config-field-group:focus-within {
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.05);
}
.simulator-box {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
}
.simulator-box .form-control, .simulator-box .form-select {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.simulator-box .form-control:focus, .simulator-box .form-select:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
}

/* ==========================================================================
   Responsive & Mobile Friendly Overrides
   ========================================================================== */

/* Off-canvas Behavior on Screen Width < 992px */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
    z-index: 1050;
    overflow-y: auto;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .top-navbar {
    padding: 0 1rem;
    height: 58px;
  }

  .top-navbar-title {
    font-size: 1.05rem;
  }

  .page-wrapper {
    padding: 1.25rem 1rem;
  }
}

/* Mobile Screens < 576px */
@media (max-width: 575.98px) {
  .top-navbar {
    padding: 0 0.75rem;
    height: 54px;
  }

  .top-navbar-title {
    font-size: 0.95rem;
  }

  .page-wrapper {
    padding: 0.85rem 0.6rem;
  }

  .sidebar-brand {
    padding: 1rem 1.25rem;
  }

  .sidebar-menu a {
    padding: 0.65rem 1.25rem;
  }

  .stat-card {
    padding: 0.9rem !important;
  }

  .stat-icon-wrapper {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .room-no {
    font-size: 1.15rem;
  }

  .bill-box {
    padding: 1rem !important;
  }

  .content-card .card-header {
    padding: 0.75rem 1rem;
  }

  /* Form controls touch ergonomics */
  .form-control, .form-select, .btn {
    min-height: 38px;
  }
}

/* Horizontal scrollable config tabs on mobile/tablet */
.config-nav {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.config-nav::-webkit-scrollbar {
  height: 4px;
}

.config-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.config-nav .nav-link {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Tables in card-body touch enhancements */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}

/* Mobile pill touch container */
.room-filter-container {
  overflow-x: auto;
  flex-wrap: nowrap !important;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.room-filter-container::-webkit-scrollbar {
  display: none;
}
.room-filter-container .filter-pill {
  white-space: nowrap;
  flex-shrink: 0;
}


