/* ============================================================
   Hotel Management System - Main Stylesheet
   Mobile-first, fully responsive
   ============================================================ */

/* ─── Variables ────────────────────────────────────────── */
:root {
  --primary:        #1e3a5f;
  --primary-dark:   #152a47;
  --primary-light:  #2a4d7d;
  --secondary:      #c9a84c;
  --secondary-dark: #b8933e;
  --accent:         #e8b86d;
  --success:        #28a745;
  --warning:        #ffc107;
  --danger:         #dc3545;
  --info:           #17a2b8;
  --sidebar-width:  260px;
  --sidebar-bg:     #1e3a5f;
  --topbar-height:  60px;
  --mobile-nav-h:   65px;
  --card-radius:    14px;
  --card-shadow:    0 2px 20px rgba(0,0,0,0.08);
  --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: #f0f2f7;
  color: #2d3748;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c9d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0adb8; }

/* ─── Layout ───────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; position: relative; }

/* ─── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 3px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-brand .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201,168,76,0.4);
}
.sidebar-brand .brand-text { flex: 1; min-width: 0; }
.sidebar-brand .brand-name {
  font-size: 14px; font-weight: 700;
  color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand .brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Sidebar Nav */
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label {
  padding: 6px 18px 4px;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 1px;
  margin-top: 8px;
}
.sidebar-nav .nav-item { position: relative; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.sidebar-nav .nav-link .nav-icon {
  width: 20px; text-align: center; font-size: 15px; flex-shrink: 0;
}
.sidebar-nav .nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 10px;
  font-weight: 600;
}
.sidebar-nav .nav-link .nav-arrow {
  margin-left: auto; font-size: 11px;
  transition: transform 0.3s;
}
.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
  border-left-color: var(--secondary);
}
.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(201,168,76,0.15);
  border-left-color: var(--secondary);
}
.sidebar-nav .nav-link.active .nav-icon { color: var(--secondary); }

/* Submenu */
.nav-submenu { background: rgba(0,0,0,0.2); display: none; }
.nav-submenu.show { display: block; }
.sidebar-nav .nav-link[data-bs-toggle="collapse"].collapsed .nav-arrow { transform: rotate(0deg); }
.sidebar-nav .nav-link[data-bs-toggle="collapse"] .nav-arrow { transform: rotate(90deg); }
.nav-submenu .nav-link {
  padding: 8px 18px 8px 48px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  border-left: 3px solid transparent;
}
.nav-submenu .nav-link:hover,
.nav-submenu .nav-link.active {
  color: #fff; background: rgba(255,255,255,0.05);
  border-left-color: var(--secondary);
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 18px;
}
.sidebar-footer .user-info {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-footer .user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-footer .user-role { font-size: 11px; color: rgba(255,255,255,0.5); }

/* ─── Main Content ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

/* ─── Topbar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 1040;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.topbar-toggle {
  background: none; border: none; padding: 6px;
  color: #6c757d; font-size: 18px; cursor: pointer;
  border-radius: 8px; transition: var(--transition);
  display: none;
}
.topbar-toggle:hover { background: #f0f2f7; color: var(--primary); }
.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb h1 { font-size: 18px; font-weight: 700; color: var(--primary); margin: 0; }
.topbar-breadcrumb .breadcrumb { margin: 0; font-size: 12px; }
.topbar-breadcrumb .breadcrumb-item.active { color: #6c757d; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid #e8ecf0; background: #f8f9fa;
  color: #6c757d; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); position: relative; font-size: 15px;
}
.topbar-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.topbar-btn .badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 8px; border-radius: 10px;
  transition: var(--transition);
}
.topbar-user:hover { background: #f0f2f7; }
.topbar-user .user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.topbar-user .user-name { font-size: 13px; font-weight: 600; color: #2d3748; }
.topbar-user .user-role { font-size: 11px; color: #6c757d; }

/* ─── Page Content ─────────────────────────────────────── */
.page-content { flex: 1; padding: 24px; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: 0 4px 30px rgba(0,0,0,0.12); }
.card-header {
  background: none;
  border-bottom: 1px solid #f0f2f7;
  padding: 16px 20px;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}
.card-header h5, .card-header h6 {
  margin: 0; font-weight: 700; color: var(--primary);
}
.card-body { padding: 20px; }

/* ─── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px;
  height: 100%;         /* fill column so same-row cards are equal height */
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border-left: 4px solid transparent;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  top: -20px; right: -20px;
  opacity: 0.08;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.stat-card.stat-primary   { border-left-color: var(--primary); }
.stat-card.stat-success   { border-left-color: var(--success); }
.stat-card.stat-warning   { border-left-color: var(--warning); }
.stat-card.stat-danger    { border-left-color: var(--danger); }
.stat-card.stat-info      { border-left-color: var(--info); }
.stat-card.stat-secondary { border-left-color: var(--secondary); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.icon-primary   { background: rgba(30,58,95,0.1);  color: var(--primary); }
.stat-icon.icon-success   { background: rgba(40,167,69,0.1); color: var(--success); }
.stat-icon.icon-warning   { background: rgba(255,193,7,0.15); color: #d39e00; }
.stat-icon.icon-danger    { background: rgba(220,53,69,0.1); color: var(--danger); }
.stat-icon.icon-info      { background: rgba(23,162,184,0.1);color: var(--info); }
.stat-icon.icon-secondary { background: rgba(201,168,76,0.1);color: var(--secondary-dark); }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; color: #1a202c; line-height: 1; }
.stat-label { font-size: 12px; color: #6c757d; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.stat-trend { font-size: 12px; margin-top: 6px; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* Compact stat-cards inside narrow col-lg-2 columns (rooms status bar) */
@media (min-width: 992px) {
  .col-lg-2 .stat-card        { padding: 14px 10px; gap: 10px; }
  .col-lg-2 .stat-icon        { width: 42px; height: 42px; font-size: 17px; border-radius: 11px; flex-shrink: 0; }
  .col-lg-2 .stat-value       { font-size: 22px; }
  .col-lg-2 .stat-label       { font-size: 11px; letter-spacing: 0; }
}

/* ─── Room Status Grid ──────────────────────────────────── */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.room-card {
  border-radius: 10px; padding: 12px 8px;
  text-align: center; cursor: pointer;
  transition: var(--transition); border: 2px solid transparent;
  position: relative;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.room-card.available   { background: rgba(40,167,69,0.08); border-color: rgba(40,167,69,0.3); }
.room-card.occupied    { background: rgba(220,53,69,0.08); border-color: rgba(220,53,69,0.3); }
.room-card.reserved    { background: rgba(23,162,184,0.08); border-color: rgba(23,162,184,0.3); }
.room-card.housekeeping{ background: rgba(255,193,7,0.1); border-color: rgba(255,193,7,0.4); }
.room-card.maintenance { background: rgba(108,117,125,0.1); border-color: rgba(108,117,125,0.3); }
.room-card.blocked     { background: rgba(52,58,64,0.1); border-color: rgba(52,58,64,0.3); }
.room-number { font-size: 16px; font-weight: 800; }
.room-card.available   .room-number { color: var(--success); }
.room-card.occupied    .room-number { color: var(--danger); }
.room-card.reserved    .room-number { color: var(--info); }
.room-card.housekeeping .room-number { color: #d39e00; }
.room-card.maintenance .room-number { color: #6c757d; }
.room-card.blocked     .room-number { color: #343a40; }
.room-type { font-size: 10px; color: #6c757d; margin-top: 2px; }
.room-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-top: 4px;
}
.dot-available   { background: var(--success); }
.dot-occupied    { background: var(--danger); }
.dot-reserved    { background: var(--info); }
.dot-housekeeping { background: var(--warning); }
.dot-maintenance { background: #6c757d; }
.dot-blocked     { background: #343a40; }

/* ─── Tables ────────────────────────────────────────────── */
.table-responsive { border-radius: var(--card-radius); overflow: hidden; }
.table { margin: 0; }
.table thead th {
  background: #f8f9fa; border-bottom: 2px solid #e8ecf0;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #6c757d; padding: 12px 16px;
  white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid #f0f2f7; }
.table tbody tr:hover { background: #f8f9ff; }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── Buttons ───────────────────────────────────────────── */
.btn { border-radius: 8px; font-weight: 600; font-size: 13px; transition: var(--transition); letter-spacing: 0.3px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-hotel { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border: none; }
.btn-hotel:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(30,58,95,0.3); }
.btn-gold { background: linear-gradient(135deg, var(--secondary), var(--accent)); color: #fff; border: none; }
.btn-gold:hover { background: linear-gradient(135deg, var(--secondary-dark), var(--secondary)); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; }
.btn-sm { border-radius: 6px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 5px; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: #2d3748;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
  outline: none;
}
.form-label { font-size: 12px; font-weight: 600; color: #4a5568; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-group { margin-bottom: 18px; }
.input-group .form-control { border-radius: 0 8px 8px 0; }
.input-group-text { background: #f8f9fa; border: 1.5px solid #e2e8f0; border-right: none; border-radius: 8px 0 0 8px; color: #6c757d; }

/* ─── Badges ────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.badge-vip { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-vip-silver  { background: linear-gradient(135deg, #bdc3c7, #95a5a6); color: #fff; }
.badge-vip-gold    { background: linear-gradient(135deg, #f39c12, #e67e22); color: #fff; }
.badge-vip-platinum{ background: linear-gradient(135deg, #9b59b6, #8e44ad); color: #fff; }
.badge-vip-diamond { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-content { border: none; border-radius: var(--card-radius); box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { background: var(--primary); color: #fff; border-radius: var(--card-radius) var(--card-radius) 0 0; padding: 16px 20px; }
.modal-header .modal-title { font-weight: 700; font-size: 16px; }
.modal-header .btn-close { filter: invert(1); }
.modal-footer { border-top: 1px solid #f0f2f7; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { border: none; border-radius: 10px; font-size: 13px; }
.alert-success { background: rgba(40,167,69,0.1);  color: #155724; border-left: 4px solid var(--success); }
.alert-danger   { background: rgba(220,53,69,0.1);  color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning  { background: rgba(255,193,7,0.15); color: #856404; border-left: 4px solid var(--warning); }
.alert-info     { background: rgba(23,162,184,0.1); color: #0c5460; border-left: 4px solid var(--info); }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-container { position: relative; width: 100%; }

/* ─── Calendar ───────────────────────────────────────────── */
.fc .fc-toolbar-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.fc .fc-button-primary { background: var(--primary); border-color: var(--primary); border-radius: 8px; font-size: 12px; font-weight: 600; }
.fc .fc-button-primary:hover { background: var(--primary-light); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--secondary); border-color: var(--secondary); }
.fc-event { border-radius: 4px; font-size: 11px; font-weight: 600; border: none; cursor: pointer; }
.fc-event-available { background: var(--success) !important; }
.fc-event-occupied  { background: var(--danger) !important; }
.fc-event-reserved  { background: var(--info) !important; }
.fc .fc-daygrid-day.fc-day-today { background: rgba(201,168,76,0.08); }

/* ─── Timeline ──────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: #e8ecf0; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -22px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.2);
}
.timeline-time { font-size: 11px; color: #6c757d; margin-bottom: 4px; }
.timeline-content { background: #f8f9fa; border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* ─── KPI Ring ──────────────────────────────────────────── */
.kpi-ring { position: relative; width: 100px; height: 100px; margin: 0 auto; }
.kpi-ring svg { transform: rotate(-90deg); }
.kpi-ring .ring-track { fill: none; stroke: #f0f2f7; stroke-width: 8; }
.kpi-ring .ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.kpi-ring .ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--primary); }

/* ─── Search Bar ────────────────────────────────────────── */
.search-wrapper { position: relative; }
.search-wrapper .form-control { padding-left: 36px; border-radius: 10px; }
.search-wrapper .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ba3af; font-size: 14px; }

/* ─── Filter Bar ─────────────────────────────────────────── */
.filter-bar { background: #fff; border-radius: 10px; padding: 14px 20px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; box-shadow: var(--card-shadow); }
.filter-bar .filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; }

/* ─── Avatars ────────────────────────────────────────────── */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-xs  { width: 28px; height: 28px; font-size: 11px; }
.avatar-sm  { width: 36px; height: 36px; font-size: 13px; }
.avatar-md  { width: 48px; height: 48px; font-size: 16px; }
.avatar-lg  { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl  { width: 96px; height: 96px; font-size: 32px; }
.avatar-primary  { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.avatar-success  { background: linear-gradient(135deg, #28a745, #20c997); }
.avatar-warning  { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.avatar-danger   { background: linear-gradient(135deg, #dc3545, #e83e8c); }
.avatar-info     { background: linear-gradient(135deg, #17a2b8, #6f42c1); }
.avatar-gold     { background: linear-gradient(135deg, var(--secondary), var(--accent)); }

/* ─── Empty State ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 64px; color: #dee2e6; margin-bottom: 16px; }
.empty-state h5 { color: #6c757d; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: #9ba3af; font-size: 13px; }

/* ─── Loading ───────────────────────────────────────────── */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.85); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.spinner-hotel { width: 48px; height: 48px; border: 4px solid #e8ecf0; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Sidebar Overlay (mobile) ──────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 1049;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.show { display: block; }

/* ─── Login Page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 40%, #0d1f35 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  position: relative; z-index: 1;
}
.login-logo {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; margin: 0 auto 20px;
  box-shadow: 0 10px 30px rgba(30,58,95,0.3);
}
.login-title { font-size: 26px; font-weight: 800; color: var(--primary); text-align: center; }
.login-subtitle { font-size: 13px; color: #6c757d; text-align: center; margin-bottom: 28px; }
.login-divider { text-align: center; position: relative; margin: 20px 0; }
.login-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #e8ecf0; }
.login-divider span { background: #fff; padding: 0 12px; color: #9ba3af; font-size: 12px; position: relative; }

/* ─── Profile Page ──────────────────────────────────────── */
.profile-cover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  height: 160px; border-radius: var(--card-radius) var(--card-radius) 0 0;
  position: relative;
}
.profile-avatar-wrap {
  position: absolute; bottom: -40px; left: 24px;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  border: 4px solid #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
}

/* ─── Notification Dropdown ─────────────────────────────── */
.notification-list { max-height: 360px; overflow-y: auto; }
.notification-item { padding: 12px 16px; border-bottom: 1px solid #f0f2f7; display: flex; gap: 10px; transition: var(--transition); }
.notification-item:hover { background: #f8f9ff; }
.notification-item.unread { background: rgba(30,58,95,0.04); }
.notification-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.notification-text { flex: 1; min-width: 0; }
.notification-text p { margin: 0; font-size: 12.5px; color: #2d3748; }
.notification-text small { color: #9ba3af; font-size: 11px; }

/* ─── Housekeeping Kanban ────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.kanban-column { background: #f8f9fa; border-radius: 12px; padding: 12px; }
.kanban-header { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 2px solid; }
.kanban-card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); font-size: 12.5px; cursor: grab; }

/* ─── Data Tables ─────────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input { border-radius: 8px; border: 1.5px solid #e2e8f0; padding: 6px 10px; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; border: 1.5px solid #e2e8f0; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 6px !important; }

/* ─── Select2 Override ────────────────────────────────────── */
.select2-container--default .select2-selection--single { border: 1.5px solid #e2e8f0; border-radius: 8px; height: 38px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--primary); }

/* ─── Flatpickr Override ──────────────────────────────────── */
.flatpickr-calendar { border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); border: none; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); }
.flatpickr-day.inRange { background: rgba(30,58,95,0.1); border-color: rgba(30,58,95,0.1); }

/* ─── Dropdown ─────────────────────────────────────────── */
.dropdown-menu { border: none; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); padding: 8px; font-size: 13px; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; transition: var(--transition); }
.dropdown-item:hover { background: rgba(30,58,95,0.08); color: var(--primary); }
.dropdown-divider { margin: 6px 0; }

/* ─── Mobile Bottom Nav ─────────────────────────────────── */
.mobile-nav {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: #fff;
  border-top: 1px solid #e8ecf0;
  z-index: 1050;
  padding: 0 8px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.mobile-nav-inner { display: flex; align-items: stretch; height: 100%; }
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; border: none;
  background: none; color: #9ba3af; transition: var(--transition);
  padding: 0 4px; position: relative; border-radius: 12px; margin: 6px 2px;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--primary); background: rgba(30,58,95,0.08);
}
.mobile-nav-item .nav-icon { font-size: 20px; }
.mobile-nav-item .nav-label { font-size: 10px; font-weight: 600; line-height: 1; }
.mobile-nav-item .nav-dot {
  position: absolute; top: 6px; right: 10px;
  width: 6px; height: 6px; background: var(--danger);
  border-radius: 50%; border: 1px solid #fff;
}
.mobile-nav-fab {
  flex-shrink: 0; padding: 0 4px; margin: 6px 2px;
}
.mobile-nav-fab button {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none; color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(30,58,95,0.4);
  transition: var(--transition);
}
.mobile-nav-fab button:hover { transform: scale(1.05); }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .topbar-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .page-content { padding: 16px 12px calc(var(--mobile-nav-h) + 16px); }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
}

@media (max-width: 767.98px) {
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-icon { width: 44px; height: 44px; font-size: 18px; }
  .page-content { padding: 12px 10px calc(var(--mobile-nav-h) + 12px); }
  .topbar { padding: 0 12px; }
  .topbar-breadcrumb h1 { font-size: 15px; }
  .card-body { padding: 14px; }
  .filter-bar { padding: 10px 14px; }
  .table thead th { padding: 10px 12px; }
  .table tbody td { padding: 10px 12px; }
  .login-card { padding: 28px 20px; }
}

@media (max-width: 575.98px) {
  .room-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .topbar-user .user-name, .topbar-user .user-role { display: none; }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .mobile-nav, .btn, .no-print { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #dee2e6; }
  body { font-size: 12px; }
}

/* ─── Dark mode (optional) ───────────────────────────────── */
@media (prefers-color-scheme: dark) {
  /* Opt-out — hotel uses light theme by default */
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-fadeInUp { animation: fadeInUp 0.4s ease forwards; }
.animate-fadeIn   { animation: fadeIn 0.3s ease forwards; }
.pulse            { animation: pulse 2s infinite; }

/* Staggered animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.30s; }

/* ─── Utilities ──────────────────────────────────────────── */
.text-primary-hotel { color: var(--primary) !important; }
.text-gold          { color: var(--secondary) !important; }
.bg-hotel           { background: var(--primary) !important; }
.bg-gold            { background: var(--secondary) !important; }
.fw-800             { font-weight: 800 !important; }
.fs-11              { font-size: 11px !important; }
.fs-12              { font-size: 12px !important; }
.fs-13              { font-size: 13px !important; }
.rounded-10         { border-radius: 10px !important; }
.rounded-14         { border-radius: 14px !important; }
.cursor-pointer     { cursor: pointer; }
.min-w-0            { min-width: 0; }
.gap-6              { gap: 6px !important; }
.gap-8              { gap: 8px !important; }

/* ═══════════════════════════════════════════════════════════
   MOBILE APP / PWA — v2.0
   Comprehensive app-like mobile experience
   ═══════════════════════════════════════════════════════════ */

/* ─── Remove iOS tap flash; fast tap via manipulation ─────── */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"], .btn, label[for],
.mobile-nav-item, .topbar-btn, .nav-link,
input[type="checkbox"], input[type="radio"] {
  touch-action: manipulation;
}

/* ─── Momentum scrolling (iOS rubber-band) ────────────────── */
.sidebar, .modal-body, .notification-list,
.select2-results__options {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ─── CRITICAL FIX: table-responsive overflow:hidden blocked scroll ─ */
/* Bootstrap sets overflow-x:auto; our rule overwrote it with hidden */
.table-responsive {
  border-radius: 0 !important;   /* card provides rounding */
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Scroll shadow: visual cue for horizontally scrollable tables */
.table-responsive {
  background:
    linear-gradient(to right, #fff, rgba(255,255,255,0)) left  / 28px 100%,
    linear-gradient(to left,  #fff, rgba(255,255,255,0)) right / 28px 100%,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.09), transparent) left  / 10px 100%,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.09), transparent) right / 10px 100%;
  background-repeat: no-repeat;
  background-color: #fff;
  background-attachment: local, local, scroll, scroll;
}

/* ─── Safe Area Insets — iPhone X / 12 / 14 / 15 ─────────── */
@supports (padding: max(0px)) {
  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
  }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  @media (max-width: 991.98px) {
    .topbar {
      padding-left:  max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
    .page-content {
      padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 16px) !important;
    }
  }
  @media (max-width: 767.98px) {
    .page-content {
      padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 12px) !important;
    }
  }
}

/* ─── iOS Input Zoom Prevention (font ≥16px stops auto-zoom) ─ */
@media (max-width: 767.98px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="tel"],
  input[type="url"], input[type="date"], input[type="time"],
  input[type="datetime-local"], textarea, select,
  .form-control, .form-select, .flatpickr-input {
    font-size: 16px !important;
  }
  .select2-container .select2-selection__rendered { font-size: 15px; }
}

/* ─── Touch Targets — WCAG / Apple HIG: min 44×44px ─────── */
@media (max-width: 991.98px) {
  .topbar-btn { width: 44px; height: 44px; font-size: 16px; }
  .sidebar-nav .nav-link { padding: 12px 18px; min-height: 44px; }
  .nav-submenu .nav-link { min-height: 40px; }
  .mobile-nav-item { min-height: 44px; }
  .dropdown-item { padding: 10px 14px; font-size: 14px; }
  .btn:not(.btn-xs):not(.btn-icon) { min-height: 40px; }
  .btn-sm { min-height: 36px; }
}

/* ─── Glass Morphism Bottom Navigation ───────────────────── */
@media (max-width: 991.98px) {
  .mobile-nav {
    background: rgba(255,255,255,0.90);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.07);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }
  .mobile-nav-item { transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .mobile-nav-item:active { transform: scale(0.88) !important; }
  .mobile-nav-item.active { color: var(--primary); background: rgba(30,58,95,0.08); }
  .mobile-nav-fab button { transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important; }
  .mobile-nav-fab button:active { transform: scale(0.88) !important; box-shadow: none !important; }
}

/* ─── Bottom Sheet Modals (xs screens) ───────────────────── */
@media (max-width: 575.98px) {
  .modal { align-items: flex-end; }

  .modal-dialog:not(.modal-sm):not(.modal-dialog-centered):not(.modal-fullscreen) {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .modal-dialog:not(.modal-sm):not(.modal-dialog-centered):not(.modal-fullscreen) .modal-content {
    border-radius: 22px 22px 0 0 !important;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
  }
  .modal-dialog:not(.modal-sm):not(.modal-dialog-centered):not(.modal-fullscreen) .modal-header {
    border-radius: 22px 22px 0 0 !important;
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 5;
  }
  /* Swipe handle indicator on header */
  .modal-header::after {
    content: '';
    display: block; position: absolute;
    top: 8px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.4); border-radius: 2px;
  }
  .modal-dialog:not(.modal-sm):not(.modal-dialog-centered):not(.modal-fullscreen) .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    overscroll-behavior: contain;
  }
  .modal-dialog:not(.modal-sm):not(.modal-dialog-centered):not(.modal-fullscreen) .modal-footer {
    flex-shrink: 0;
    background: #fff;
    position: sticky; bottom: 0; z-index: 5;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }
}

/* ─── Backdrop blur on all modals ─────────────────────────── */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-color: rgba(0,0,0,0.5);
}

/* ─── Notification Dropdown — fit on narrow screens ─────── */
@media (max-width: 575.98px) {
  .notification-dropdown {
    width: min(360px, calc(100vw - 12px)) !important;
    right: -4px !important;
    left: auto !important;
  }
}

/* ─── DataTables: mobile-friendly layout ─────────────────── */
@media (max-width: 767.98px) {
  .dataTables_wrapper .row:first-child { flex-direction: column; gap: 8px; }
  .dataTables_wrapper .row:first-child > div {
    width: 100% !important; max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  .dataTables_wrapper .dataTables_filter { text-align: left !important; }
  .dataTables_wrapper .dataTables_filter label { width: 100%; display: flex; align-items: center; gap: 8px; }
  .dataTables_wrapper .dataTables_filter input { flex: 1; width: auto !important; }
  .dataTables_wrapper .row:last-child > div {
    width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important;
  }
  .dataTables_wrapper .dataTables_info { padding-top: 0 !important; }
  .dataTables_wrapper .dataTables_paginate { text-align: left !important; margin-top: 8px; }
  .dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 10px !important; font-size: 12px !important;
  }
}

/* ─── Filter Bar: stack vertically on mobile ─────────────── */
@media (max-width: 767.98px) {
  .filter-bar { flex-direction: column !important; padding: 12px; gap: 8px !important; }
  .filter-bar > *, .filter-bar > form, .filter-bar > div { width: 100% !important; }
  .filter-bar .form-select, .filter-bar .form-control { width: 100% !important; }
  .filter-bar .d-flex { flex-wrap: wrap; gap: 8px !important; width: 100%; }
  .filter-bar .btn { flex: 1; min-width: 110px; justify-content: center; }
}

/* ─── Cards on mobile ─────────────────────────────────────── */
@media (max-width: 767.98px) {
  .card { border-radius: 10px !important; }
  .card-header { padding: 12px 14px; }
  .card-header h5 { font-size: 14px; }
  .card-header h6 { font-size: 13px; }
  .card-body { padding: 12px; }
}

/* ─── Stat Cards (xs) ─────────────────────────────────────── */
@media (max-width: 575.98px) {
  .stat-card { padding: 12px 10px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 17px; border-radius: 10px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }
  .stat-trend { font-size: 11px; }
}

/* ─── Table cells mobile ──────────────────────────────────── */
@media (max-width: 767.98px) {
  .table thead th { font-size: 10px; padding: 8px 10px; }
  .table tbody td { font-size: 12px; padding: 9px 10px; }
}

/* ─── Chart containers on mobile (cap height) ─────────────── */
@media (max-width: 767.98px) {
  [style*="height:300px"], [style*="height: 300px"] { height: 200px !important; }
  [style*="height:280px"], [style*="height: 280px"] { height: 180px !important; }
  [style*="height:260px"], [style*="height: 260px"] { height: 180px !important; }
  [style*="height:240px"], [style*="height: 240px"] { height: 170px !important; }
  [style*="height:220px"], [style*="height: 220px"] { height: 160px !important; }
}

/* ─── Topbar compact (very small phones) ─────────────────── */
@media (max-width: 399.98px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .topbar-breadcrumb h1 {
    font-size: 13px;
    max-width: calc(100vw - 148px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-breadcrumb nav { display: none; }
  .topbar-btn { width: 38px; height: 38px; }
}

/* ─── Offline indicator bar ──────────────────────────────── */
.offline-bar {
  position: fixed;
  top: var(--topbar-height); left: 0; right: 0; z-index: 1035;
  background: #343a40; color: #fff;
  text-align: center; font-size: 12px; font-weight: 600;
  padding: 7px 16px;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.offline-bar.show { transform: translateY(0); }

/* ─── Touch ripple ────────────────────────────────────────── */
@keyframes ripple-anim {
  from { transform: scale(0); opacity: 0.45; }
  to   { transform: scale(5); opacity: 0; }
}
.touch-ripple {
  position: absolute; border-radius: 50%;
  width: 40px; height: 40px;
  pointer-events: none; z-index: 0;
  background: rgba(255,255,255,0.3);
  animation: ripple-anim 0.5s ease-out forwards;
}
.btn .touch-ripple { background: rgba(255,255,255,0.25); }
.mobile-nav-item .touch-ripple { background: rgba(30,58,95,0.12); }

/* ─── Hide scrollbars on mobile (keep functionality) ─────── */
@media (max-width: 991.98px) {
  ::-webkit-scrollbar { width: 0 !important; height: 0 !important; background: transparent; }
}

/* ─── Modal backdrop lighter on mobile (battery) ──────────── */
@media (max-width: 767.98px) {
  .modal-backdrop { opacity: 0.5 !important; }
}

/* ─── Form group spacing on mobile ───────────────────────── */
@media (max-width: 767.98px) {
  .form-group { margin-bottom: 14px; }
}

/* ─── KPI ring mobile ─────────────────────────────────────── */
@media (max-width: 767.98px) {
  .kpi-ring { width: 80px; height: 80px; }
  .kpi-ring .ring-text { font-size: 15px; }
}

/* ─── Extra utilities (missing from base) ─────────────────── */
.fs-10 { font-size: 10px !important; }
.fs-14 { font-size: 14px !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.lh-1 { line-height: 1 !important; }
.gap-10 { gap: 10px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
