/* ==========================================================================
   SEO HOTEL & VILLA - LUXURY RESORT & ERP MASTER STYLESHEET
   Brand Colors: Navy Blue (#003B73, #00245E) & Warm Amber Gold (#FDB813, #E59B12)
   ========================================================================== */

:root {
  --primary-navy: #003B73;
  --primary-dark: #00245E;
  --primary-light: #0062B2;
  --primary-glow: rgba(0, 98, 178, 0.15);
  
  --gold-accent: #E59B12;
  --gold-light: #FDB813;
  --gold-dark: #C27D08;
  --gold-gradient: linear-gradient(135deg, #FDB813 0%, #E59B12 50%, #C27D08 100%);
  --navy-gradient: linear-gradient(135deg, #00245E 0%, #003B73 50%, #0062B2 100%);
  --luxury-card-gradient: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);

  --bg-main: #F4F7FB;
  --bg-sidebar: #001F4D;
  --bg-card: #FFFFFF;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --border-color: #E2E8F0;
  --border-gold: rgba(229, 155, 18, 0.4);

  --status-available: #10B981;
  --status-occupied: #3B82F6;
  --status-reserved: #F59E0B;
  --status-dirty: #EF4444;
  --status-cleaning: #8B5CF6;
  --status-inspected: #06B6D4;
  --status-ooo: #6B7280;

  --sidebar-width: 270px;
  --header-height: 76px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 6px rgba(0, 36, 94, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 36, 94, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 36, 94, 0.12);
  --shadow-gold: 0 4px 15px rgba(229, 155, 18, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--primary-dark);
}

.luxury-heading {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  color: var(--gold-dark);
}

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

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  background-image: linear-gradient(180deg, #001A40 0%, #002860 100%);
  color: #fff;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.brand-logo-img {
  max-width: 190px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold-light);
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.35rem;
  opacity: 0.9;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  color: #CBD5E1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-link i {
  width: 22px;
  font-size: 1.1rem;
  text-align: center;
  color: #94A3B8;
  transition: all 0.2s;
}

.sidebar-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.sidebar-link:hover i {
  color: var(--gold-light);
}

.sidebar-link.active {
  color: #FFFFFF;
  background: var(--navy-gradient);
  border-left: 4px solid var(--gold-accent);
  box-shadow: 0 4px 15px rgba(0, 98, 178, 0.4);
  font-weight: 600;
}

.sidebar-link.active i {
  color: var(--gold-light);
}

.nav-badge {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* User profile footer in sidebar */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-dark);
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-meta {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role-badge {
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 500;
}

/* Main Content Area - Perfect Width Constraints */
.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: all 0.3s ease;
  background-color: var(--bg-main);
}

/* Header */
.app-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0, 36, 94, 0.04);
  transition: all 0.25s ease;
  width: 100%;
  max-width: 100%;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

/* Global Live AJAX Search */
.header-search-wrapper {
  position: relative;
  flex-shrink: 0;
}

.header-search {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.header-search input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.4rem;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 30px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.header-search input:focus {
  background: #FFFFFF;
  border-color: var(--primary-light);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 320px;
}

.header-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 0.9rem;
}

.header-search .search-kbd {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: #E2E8F0;
  color: #64748B;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  pointer-events: none;
}

/* AJAX Search Results Dropdown */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 440px;
  max-height: 460px;
  overflow-y: auto;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 36px rgba(0, 36, 94, 0.16);
  z-index: 1050;
  padding: 0.5rem 0;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-category-header {
  padding: 0.45rem 1rem 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: #64748B;
  background: #F8FAFC;
  border-top: 1px solid #F1F5F9;
  border-bottom: 1px solid #F1F5F9;
}
.search-category-header:first-child {
  border-top: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  transition: all 0.15s ease;
  border-bottom: 1px solid #F8FAFC;
}

.search-result-item:hover {
  background: #F1F5F9;
  transform: translateX(4px);
}

.search-icon-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

/* Header Live Status & Metrics Pills */
.header-occupancy-pill {
  padding: 0.45rem 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 30px;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.occupancy-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-normal {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulseDot 2s infinite;
}

.dot-high {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-weather-pill {
  padding: 0.45rem 0.85rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.header-clock-pill {
  padding: 0.45rem 0.9rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  font-size: 0.85rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background: #F8FAFC;
  border-color: var(--gold-accent);
  color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.notification-dropdown {
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 36, 94, 0.16) !important;
  animation: dropdownFadeIn 0.2s ease-out;
}

.notification-item {
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: #F8FAFC !important;
}

.quick-action-btn {
  background: var(--navy-gradient);
  color: #fff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 59, 115, 0.25);
  text-decoration: none;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.quick-action-btn * {
  white-space: nowrap !important;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 59, 115, 0.35);
  color: #fff;
}

.gold-btn {
  background: var(--gold-gradient);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.gold-btn:hover {
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 155, 18, 0.4);
}

.currency-badge-btn {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.currency-badge-btn:hover {
  border-color: var(--gold-accent);
}

.user-profile-pill {
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  border-radius: 30px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-profile-pill:hover {
  background: #F8FAFC;
  border-color: var(--gold-accent);
  box-shadow: var(--shadow-sm);
}

/* Page Body Spacing - Contained & Comfortable */
.page-content {
  padding: 1.5rem 1.75rem;
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.page-title-box {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Luxury Cards */
.luxury-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.luxury-card:hover {
  box-shadow: var(--shadow-md);
}

.luxury-card.gold-trim::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gold-gradient);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Stat KPI Cards */
.stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon-navy {
  background: rgba(0, 59, 115, 0.1);
  color: var(--primary-navy);
}

.stat-icon-gold {
  background: rgba(229, 155, 18, 0.15);
  color: var(--gold-dark);
}

.stat-icon-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-available);
}

.stat-icon-purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--status-cleaning);
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.stat-trend.up {
  color: #10B981;
}

.stat-trend.down {
  color: #EF4444;
}

/* Room Status Badges */
.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.room-badge.Available { background: #DCFCE7; color: #166534; }
.room-badge.Occupied { background: #DBEAFE; color: #1E40AF; }
.room-badge.Reserved { background: #FEF3C7; color: #92400E; }
.room-badge.Dirty { background: #FEE2E2; color: #991B1B; }
.room-badge.Cleaning { background: #F3E8FF; color: #6B21A8; }
.room-badge.Inspected { background: #CFFAFE; color: #155E75; }
.room-badge.OutOfOrder { background: #F3F4F6; color: #374151; }

/* Interactive Tables */
.table-luxury {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-luxury th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table-luxury td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
  background: #FFFFFF;
}

.table-luxury tr:hover td {
  background: #F8FAFF;
}

.table-luxury tr:last-child td {
  border-bottom: none;
}

/* Form Controls */
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Smart IoT Control Widget */
.smart-toggle-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.smart-toggle-btn.active {
  background: #10B981;
  color: #fff;
  border-color: #10B981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.smart-toggle-btn.off {
  background: #F1F5F9;
  color: var(--text-muted);
}

/* LankaQR Payment Modal Styling */
.lankaqr-box {
  background: #FFFFFF;
  border: 2px dashed var(--gold-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.lankaqr-img {
  max-width: 220px;
  height: auto;
  margin: 0.5rem auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.lankaqr-badge {
  display: inline-block;
  background: #E11D48;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Police Form C & Invoice Print styles */
@media print {
  .app-sidebar, .app-header, .btn, .no-print {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .printable-document {
    box-shadow: none !important;
    border: none !important;
  }
}

/* Responsive */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
}
