/* 
   Hotelweb Operations SaaS Platform 
   Design System & Stylesheet (Premium Light-Glass Theme)
*/

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

:root {
  --primary-color: #2563eb;
  --secondary-color: #db2777;
  --bg-color: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Glassmorphism/Card Utilities */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(203, 213, 225, 0.8);
}

.glass-panel.glowing {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.05), var(--shadow-card);
}

/* Layout Framework */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* Sidebar Styling */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 1.1rem;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.tenant-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  transition: var(--transition-smooth);
}

.tenant-selector:hover {
  background: #f1f5f9;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-color);
  background: #f1f5f9;
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

.nav-item i,
.nav-item svg {
  width: 18px;
  height: 18px;
}

/* Main Content Section */
.main-content {
  padding: 32px;
  overflow-y: auto;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Form inputs & controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input-container {
  position: relative;
  flex-grow: 1;
  max-width: 300px;
  display: inline-flex;
  align-items: center;
}

.search-input-container i,
.search-input-container svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input-container input {
  padding: 8px 14px 8px 38px;
  border-radius: 20px;
  height: 38px;
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

/* Datepicker style link */
.datepicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  height: 38px;
  transition: var(--transition-smooth);
}

.datepicker-pill:hover {
  border-color: var(--primary-color);
  background-color: #f8fafc;
}

.datepicker-pill i,
.datepicker-pill svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Select Pills (e.g. Floor Filter) */
.select-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 32px 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  height: 38px;
  transition: var(--transition-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.select-pill:hover {
  border-color: var(--primary-color);
  background-color: #f8fafc;
}

.select-pill:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Pill buttons for action rows */
.btn-pill {
  border-radius: 20px !important;
  height: 38px;
  padding: 8px 18px !important;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Badges for status flags */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success, .badge-clean, .badge-active {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.badge-warning, .badge-dirty, .badge-pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-info, .badge-inspected, .badge-early {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-danger, .badge-ooo, .badge-suspended {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-vip {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}

/* Room Housekeeping Board Grid */
.floor-section {
  margin-top: 24px;
}

.floor-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.room-card {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.room-card.clean { border-left: 4px solid #16a34a; }
.room-card.dirty { border-left: 4px solid #d97706; }
.room-card.inspected { border-left: 4px solid #2563eb; }
.room-card.ooo { border-left: 4px solid #dc2626; }

/* Dashboard & Housekeeping Metrics Cards */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.metric-card-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value-sm {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}

.metric-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.metric-icon-box.clean { background: #f0fdf4; color: #16a34a; }
.metric-icon-box.dirty { background: #fffbeb; color: #d97706; }
.metric-icon-box.inspected { background: #eff6ff; color: #2563eb; }
.metric-icon-box.ooo { background: #fef2f2; color: #dc2626; }

/* Overall Progress Indicator */
.progress-ring-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-ring-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--primary-color) calc(var(--progress-val) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Premium Code Logger Console (PMS XML monitor) */
.xml-console-wrapper {
  margin-top: 32px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-lg);
}

.xml-console {
  background: #090d16;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  padding: 16px;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.xml-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  padding: 10px 16px;
  border-bottom: 1px solid #334155;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

/* Signature Drawing Canvas */
.sig-canvas-container {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
  height: 150px;
}

.sig-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Operational Tables */
.ops-table-container {
  overflow-x: auto;
  margin-top: 12px;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
}

.ops-table th {
  text-align: left;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ops-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-color);
}

.ops-table tr:hover td {
  background: #f8fafc;
}

/* Billings specific sparkline card */
.sparkline-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sparkline-svg {
  width: 120px;
  height: 40px;
}

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animated-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  padding: 8px 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--text-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Grid for Settings Cards */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.settings-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: rgba(37, 99, 235, 0.3);
}

.settings-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.settings-card-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Reports Specific Cards */
.reports-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.report-stat-card .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.report-stat-card .val {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 6px;
  color: #0f172a;
}

.report-stat-card .change {
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-stat-card .change.up { color: #16a34a; }
.report-stat-card .change.down { color: #dc2626; }

/* SVG Graph Elements */
.svg-chart-container {
  width: 100%;
  height: 140px;
  margin-top: 16px;
  position: relative;
}

.svg-donut-container {
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

/* Housekeeping Checklist & Workflow Overlay Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

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

.checklist-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.checklist-progress-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.checklist-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.checklist-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checklist-item-row:hover {
  background: #f1f5f9;
}

.checklist-item-row.checked {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.02);
}

.checklist-item-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
}

.checklist-item-row span.item-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  flex-grow: 1;
}

.checklist-item-row.checked span.item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-required-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--secondary-color);
  background: rgba(219, 39, 119, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Template Builder UI */
.builder-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: grab;
}

.builder-item-row:active {
  cursor: grabbing;
}

/* Responsive Design Overrides for Mobile and Tablets */
@media (max-width: 1024px) {
  .sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: -280px; /* Hidden by default */
    width: 260px;
    height: 100vh;
    z-index: 999;
    box-shadow: 10px 0 25px -5px rgba(15, 23, 42, 0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.open {
    left: 0 !important;
  }

  .main-content {
    padding: 16px !important;
  }

  .header-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .user-profile-badge {
    padding: 4px 10px !important;
  }
  
  #menu-toggle-btn {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  /* Stack 1fr 2fr and 1.2fr 1fr grids on mobile */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Stack layout grids */
  .settings-grid,
  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  }
  
  /* Hide badge circle on header to save space on mobile */
  .header-badge-circle {
    display: none !important;
  }

  /* Make sure modals fit on extremely small viewports */
  .modal-content {
    padding: 16px !important;
    margin: 12px;
  }
}
