/* ============================================================
   HOTEL KING STAR — GLOBAL STYLES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #F5F3EF;
  --bg2: #EEEAE4;
  --surface: #FFFFFF;
  --primary: #2C3E50;
  --primary-light: #3D5166;
  --accent: #A45449;
  --gold: #D2B076;
  --gold-light: #E8D4A8;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --border: #DDD8D0;
  --success: #2D6A4F;
  --success-bg: #D8F3DC;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --danger: #991B1B;
  --danger-bg: #FEE2E2;
  --info: #1E40AF;
  --info-bg: #DBEAFE;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --sidebar-w: 260px;
  --transition: all 0.2s ease;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0F1117;
  --bg2: #181C25;
  --surface: #1E2330;
  --primary: #4A7FA5;
  --primary-light: #5B90B6;
  --accent: #C47067;
  --gold: #D2B076;
  --text: #F0EDE8;
  --text-muted: #9CA3AF;
  --border: #2D3447;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; }

/* ============================================================ LAYOUT */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================ SIDEBAR */

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #fff;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo .hotel-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .hotel-name .star {
  color: var(--gold);
  font-size: 18px;
}

.sidebar-logo .tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
  background: rgba(210, 176, 118, 0.15);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}

.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ============================================================ MAIN CONTENT */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================ TOP NAV */

.topnav {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow);
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.btn-icon {
  width: 38px; height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  color: var(--text);
  font-size: 16px;
  transition: var(--transition);
}

.btn-icon:hover { background: var(--border); }

.theme-toggle { font-size: 18px; }

/* ============================================================ PAGE BODY */

.page-body {
  flex: 1;
  padding: 24px;
}

/* ============================================================ CARDS */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: var(--transition);
}

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

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

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

/* ============================================================ STAT CARDS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 3px;
  background: var(--accent);
}

.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--success); }
.stat-card.blue::before  { background: var(--info); }
.stat-card.red::before   { background: var(--danger); }

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

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
  background: var(--bg2);
}

.stat-card.gold .stat-icon  { background: rgba(210,176,118,0.15); }
.stat-card.green .stat-icon { background: var(--success-bg); }
.stat-card.blue .stat-icon  { background: var(--info-bg); }
.stat-card.red .stat-icon   { background: var(--danger-bg); }

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-change {
  font-size: 11px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================ ROOM CARDS */

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.room-card {
  border-radius: var(--radius);
  padding: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
}

.room-card.available {
  background: var(--success-bg);
  border-color: rgba(45, 106, 79, 0.25);
}

.room-card.occupied {
  background: var(--danger-bg);
  border-color: rgba(153, 27, 27, 0.25);
}

.room-card.maintenance {
  background: var(--warning-bg);
  border-color: rgba(180, 83, 9, 0.25);
}

.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.room-card.selected { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(210,176,118,0.3); }

.room-number {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.room-card.available .room-number { color: var(--success); }
.room-card.occupied .room-number  { color: var(--danger); }

.room-status-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.room-price {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.room-guest {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================ BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-light); }

.btn-gold {
  background: var(--gold);
  color: var(--primary);
  font-weight: 600;
}

.btn-gold:hover { background: #C9A660; }

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover { background: var(--bg2); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { opacity: 0.9; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================ FORMS */

.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(44,62,80,0.08);
}

input.error { border-color: var(--accent); }

.field-error {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 38px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* ============================================================ TABLES */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--bg2);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg2); }

/* ============================================================ BADGES */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-neutral  { background: var(--bg2);        color: var(--text-muted); }
.badge-gold     { background: rgba(210,176,118,0.2); color: #8B6914; }

/* ============================================================ MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.modal-lg { max-width: 900px; }

/* ============================================================ ALERTS / TOASTS */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: slideIn 0.3s ease forwards;
  font-size: 13.5px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

.toast.removing { animation: slideOut 0.3s ease forwards; }

/* ============================================================ SKELETON */

.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--border) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================ FILTER BAR */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================ EMPTY STATE */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
  max-width: 300px;
  margin: 0 auto 20px;
}

/* ============================================================ LOADING OVERLAY */

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius);
}

[data-theme="dark"] .loading-overlay {
  background: rgba(15,17,23,0.7);
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ FAMILY MEMBER ROW */

.family-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.btn-remove-family {
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.btn-remove-family:hover { background: var(--danger); color: #fff; }

/* ============================================================ CHARTS */

.chart-container {
  position: relative;
  height: 280px;
}

/* ============================================================ PROGRESS BAR */

.progress {
  height: 8px;
  background: var(--bg2);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
  transition: width 0.5s ease;
}

.progress-bar.green  { background: var(--success); }
.progress-bar.accent { background: var(--accent); }
.progress-bar.blue   { background: var(--info); }

/* ============================================================ TABS */

.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
  font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================ DIVIDER */

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================ CONFIRMATION MODAL */

.confirm-modal .modal-body {
  text-align: center;
  padding: 32px 24px;
}

.confirm-modal .confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.confirm-modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 8px;
}

.confirm-modal p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
}

/* ============================================================ GRID UTILITIES */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-end     { display: flex; justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-muted  { color: var(--text-muted); }
.text-gold   { color: var(--gold); }
.text-accent { color: var(--accent); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.font-display { font-family: var(--font-display); }
.font-bold   { font-weight: 700; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

/* ============================================================ SIDEBAR OVERLAY (mobile) */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ============================================================ RESPONSIVE */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger { display: flex; }

  .form-row, .form-row-3, .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-body { padding: 16px; }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rooms-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .filter-bar { gap: 6px; }

  .family-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .topnav { padding: 0 16px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .rooms-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── EXTRA MOBILE FIXES ────────────────────────────────── */
@media (max-width: 600px) {
  .topnav { padding: 0 14px; height: 58px; }
  .page-title { font-size: 17px; }
  .page-body { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }
  .rooms-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .room-card { padding: 10px; }
  .room-number { font-size: 22px; }
  .card { padding: 14px; }
  .modal { max-width: calc(100vw - 24px); }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }
  .family-row { grid-template-columns: 1fr 1fr; }
  .family-row > *:nth-child(3) { grid-column: 1; }
  .family-row > *:nth-child(4) { grid-column: 2; grid-row: 2; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table-wrap { font-size: 12px; }
  thead th, tbody td { padding: 9px 10px; }
  .filter-bar { gap: 5px; }
  .filter-btn { padding: 5px 11px; font-size: 12px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .tab-btn { padding: 7px 10px; font-size: 12px; }
}
