/* ============================================================
   HotelNova HMS   Main Stylesheet
   Font: Plus Jakarta Sans + Syne
   Palette: Deep navy/teal with amber accents
   ============================================================ */

/*   CSS Variables   */
:root {
  --primary: #1a3a5c;
  --primary-light: #1e4976;
  --primary-glow: rgba(26, 58, 92, 0.15);
  --accent: #0ea5e9;
  --accent-2: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --sidebar-w: 260px;
  --topbar-h: 64px;

  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 10px -5px rgba(0,0,0,0.06);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --transition: all 0.2s ease;
  --sidebar-bg: linear-gradient(180deg, #0f2942 0%, #1a3a5c 100%);
}

[data-theme="dark"] {
  --bg: #0a0f1a;
  --bg-card: #111827;
  --bg-hover: #1a2335;
  --border: #1f2f45;
  --border-dark: #2d4060;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.5);
  --sidebar-bg: linear-gradient(180deg, #040b14 0%, #0a1929 100%);
}

/*   Reset & Base   */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/*   Sidebar   */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #0369a1 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1rem;
  color: white; letter-spacing: -0.3px; line-height: 1.1;
}
.brand-sub {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
}

.sidebar-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 1.1rem; padding: 4px; cursor: pointer;
  transition: color 0.2s;
}
.sidebar-close:hover { color: white; }

.hotel-info {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  margin: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.hotel-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), #d97706);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: white;
  flex-shrink: 0;
}
.hotel-name { font-size: 0.8rem; font-weight: 700; color: white; }
.hotel-role { font-size: 0.7rem; color: rgba(255,255,255,0.45); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 8px 12px; }

.nav-section {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3); text-transform: uppercase;
  padding: 16px 8px 6px; margin-top: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.65); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: var(--transition);
  margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white; transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, #0369a1 100%);
  color: white; font-weight: 600;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}
.nav-item i { font-size: 1.05rem; flex-shrink: 0; width: 20px; text-align: center; }

.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }

/*   Main Wrapper   */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  transition: margin-left 0.3s ease;
}

/*   Topbar   */
.topbar {
  position: sticky; top: 0; z-index: 900;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.3rem; cursor: pointer;
  transition: var(--transition);
}
.menu-toggle:hover { background: var(--bg); color: var(--text); }

.page-title h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.3px; line-height: 1;
}
.breadcrumb-nav {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-muted); margin-top: 3px;
}
.breadcrumb-nav a { color: var(--accent); text-decoration: none; }
.breadcrumb-nav a:hover { text-decoration: underline; }
.bc-sep { color: var(--text-light); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1rem; cursor: pointer;
  transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

.notif-badge {
  position: absolute; top: 6px; right: 6px;
  width: 14px; height: 14px;
  background: var(--danger); color: white;
  border-radius: 50%; font-size: 0.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card);
}

.notif-dropdown { width: 320px; padding: 0; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius); }
.notif-header { padding: 14px 16px; font-weight: 700; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.9rem; opacity: 0.9;
}
.notif-text { font-size: 0.82rem; font-weight: 500; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.notif-footer { padding: 12px 16px; text-align: center; }
.notif-footer a { font-size: 0.8rem; color: var(--accent); text-decoration: none; font-weight: 600; }

.user-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 5px 10px 5px 5px; cursor: pointer; transition: var(--transition);
  color: var(--text);
}
.user-avatar-btn:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.85rem;
}
.user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/*   Page Content   */
.page-content { flex: 1; padding: 24px; max-width: 1600px; width: 100%; }

/*   Cards   */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
  background: none; border-bottom: 1px solid var(--border);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
}
.card-header h5 {
  font-weight: 700; font-size: 0.9rem; color: var(--text);
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/*   Stat Cards   */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--accent));
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--stat-bg, rgba(14,165,233,0.1));
  color: var(--stat-color, var(--accent));
  margin-bottom: 16px;
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.85rem; font-weight: 800; color: var(--text);
  line-height: 1; letter-spacing: -1px;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.stat-change {
  font-size: 0.75rem; font-weight: 600; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
}
.stat-change.up { color: var(--success); background: rgba(16,185,129,0.1); }
.stat-change.down { color: var(--danger); background: rgba(239,68,68,0.1); }

/*   Room Status Grid   */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.room-cell {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); position: relative;
  border: 2px solid transparent;
}
.room-cell:hover { transform: scale(1.05); z-index: 1; }
.room-cell.available    { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #059669; }
.room-cell.occupied     { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #dc2626; }
.room-cell.reserved     { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #d97706; }
.room-cell.cleaning     { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #2563eb; }
.room-cell.maintenance  { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.3); color: #7c3aed; }
.room-cell .room-num    { font-size: 0.9rem; font-weight: 800; }
.room-cell .room-status { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; opacity: 0.7; }

/*   Status Badges   */
.badge-available   { background: rgba(16,185,129,0.12); color: #059669; }
.badge-occupied    { background: rgba(239,68,68,0.12);  color: #dc2626; }
.badge-reserved    { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-cleaning    { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-maintenance { background: rgba(139,92,246,0.12); color: #7c3aed; }
.badge-pending     { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-confirmed   { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-checked_in  { background: rgba(16,185,129,0.12); color: #059669; }
.badge-checked_out { background: rgba(100,116,139,0.12);color: #475569; }
.badge-cancelled   { background: rgba(239,68,68,0.12);  color: #dc2626; }

.status-badge {
  padding: 4px 10px; border-radius: 20px; font-size: 0.72rem;
  font-weight: 600; text-transform: capitalize; white-space: nowrap;
}

/*   Tables   */
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-card .table { margin: 0; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table thead th {
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); padding: 12px 16px; white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-color: var(--border); font-size: 0.875rem; vertical-align: middle; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table-responsive { border-radius: var(--radius); }

/*   Buttons   */
.btn { font-weight: 600; border-radius: 9px; font-size: 0.85rem; letter-spacing: 0.1px; transition: var(--transition); }
.btn-sm { font-size: 0.78rem; border-radius: 7px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: white; }
.btn-accent:hover { background: #0284c7; border-color: #0284c7; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: white; }

/*   Forms   */
.form-control, .form-select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 9px 14px;
  font-size: 0.875rem; transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-card); color: var(--text);
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.form-label { font-weight: 600; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }

/*   Flash Messages   */
.flash-message {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; font-size: 0.875rem; font-weight: 500; gap: 12px;
}
.flash-success { background: rgba(16,185,129,0.1); border-bottom: 1px solid rgba(16,185,129,0.2); color: #065f46; }
.flash-error   { background: rgba(239,68,68,0.1);  border-bottom: 1px solid rgba(239,68,68,0.2);  color: #991b1b; }
[data-theme="dark"] .flash-success { color: #6ee7b7; }
[data-theme="dark"] .flash-error   { color: #fca5a5; }
.flash-close { background: none; border: none; opacity: 0.6; cursor: pointer; padding: 0 4px; font-size: 1rem; color: inherit; }

/*   Dropdown Menus   */
.dropdown-menu {
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 8px;
}
.dropdown-item {
  border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; font-weight: 500;
  color: var(--text); transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-divider { border-color: var(--border); margin: 6px 0; }

/*   Modals   */
.modal-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }
.modal-title { font-weight: 700; font-size: 1rem; }

/*   Section Headers   */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem; font-weight: 800; color: var(--text);
}

/*   Pagination   */
.page-link {
  background: var(--bg-card); border-color: var(--border);
  color: var(--text); border-radius: 8px !important;
  font-size: 0.82rem; font-weight: 600; margin: 0 2px;
}
.page-link:hover { background: var(--bg); color: var(--accent); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); }

/*   Sidebar Overlay (mobile)   */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 999; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/*   Chart containers   */
.chart-container { min-height: 280px; }

/*   Progress bars   */
.progress { background: var(--border); border-radius: 20px; height: 8px; }
.progress-bar { border-radius: 20px; }

/*   Avatar group   */
.avatar-xs {
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

/*   KPI Timeline   */
.timeline-item {
  display: flex; gap: 14px; padding-bottom: 18px;
  position: relative;
}
.timeline-item::before {
  content: ''; position: absolute; left: 15px; top: 28px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: white; z-index: 1;
}
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.timeline-meta  { font-size: 0.75rem; color: var(--text-muted); }

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

@media (max-width: 767.98px) {
  .page-content { padding: 16px; }
  .stat-value { font-size: 1.5rem; }
  .topbar { padding: 0 16px; }
}

/*   Utility   */
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.bg-glass     { background: rgba(255,255,255,0.04); backdrop-filter: blur(10px); }
.rounded-xl   { border-radius: var(--radius) !important; }
.fw-800       { font-weight: 800; }
.font-syne    { font-family: 'Syne', sans-serif; }

/*   Loading Spinner   */
.spinner-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; gap: 12px; color: var(--text-muted); font-size: 0.875rem;
}

/*   Empty state   */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; opacity: 0.3; display: block; margin-bottom: 12px; }
.empty-state h5 { font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; max-width: 320px; margin: 0 auto; }

/*   Auth Pages   */
.auth-page {
  min-height: 100vh; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(ellipse at 20% 50%, rgba(14,165,233,0.2) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 50%, rgba(245,158,11,0.1) 0%, transparent 60%);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: white; border-radius: 20px;
  padding: 40px; box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
[data-theme="dark"] .auth-card { background: var(--bg-card); }
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; justify-content: center;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
