/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: #1a1a2e; background: #f0f2f7; overflow: hidden; }

/* ── App Layout ───────────────────────────────────────────────────────────── */
.rms-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.rms-main { flex: 1; display: flex; overflow: hidden; }

/* ── Top Header ───────────────────────────────────────────────────────────── */
.rms-header {
  display: flex; justify-content: space-between; align-items: center;
  background: #1a1a2e; padding: 0 18px; height: 48px;
  flex-shrink: 0; gap: 10px; z-index: 200;
}
.header-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Hamburger */
.ham-btn {
  background: none; border: none; cursor: pointer; padding: 6px 7px;
  display: flex; flex-direction: column; gap: 5px; border-radius: 4px; flex-shrink: 0;
}
.ham-btn span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.ham-btn:hover span { background: #f39c12; }

/* Logo */
.rms-logo { font-size: 1rem; font-weight: 800; color: #fff; white-space: nowrap; flex-shrink: 0; }
.header-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.15); flex-shrink: 0; }

/* Header buttons */
.hdr-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12); color: #fff;
  white-space: nowrap; transition: all 0.2s; font-family: inherit; flex-shrink: 0;
}
.hdr-btn-cal         { border-width: 2px; }
.hdr-btn-cal.active  { background: #f39c12; border-color: #f1c40f; box-shadow: 0 0 8px rgba(243,156,18,0.5); }
.hdr-btn-today       { background: rgba(255,255,255,0.1); }
.hdr-btn-dashboard   { background: #2563eb; border-color: #2563eb; }
.hdr-btn-dashboard.active { background: #1e3a8a; }
.hdr-btn-block       { background: #7b241c; border-color: #7b241c; }
.hdr-btn-res         { background: #1565c0; border-color: #1565c0; }
.hdr-btn:hover       { opacity: 0.85; }

/* Month nav */
.month-nav {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.08); padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
}
.month-nav button {
  border: none; background: transparent; cursor: pointer;
  color: #fff; font-size: 1.1rem; padding: 0 4px; line-height: 1;
}
#hdr-month-lbl { min-width: 110px; text-align: center; font-weight: 700; font-size: 0.82rem; color: #fff; }

/* Search */
.hdr-search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 400px; }
#hdr-search {
  width: 100%; padding: 4px 32px 4px 12px;
  background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
  font-size: 0.75rem; outline: none; font-family: inherit;
}
#hdr-search::placeholder { color: rgba(255,255,255,0.45); }
#hdr-search-spinner, #hdr-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.7); font-size: 0.75rem;
  background: none; border: none; cursor: pointer; padding: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.rms-sidebar {
  width: 0; min-width: 0;
  background: #1e2a3a;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden; flex-shrink: 0; display: flex; flex-direction: column;
  z-index: 100;
}
.rms-sidebar.open {
  width: 240px; min-width: 240px;
  box-shadow: 4px 0 16px rgba(0,0,0,0.2);
}
.sidebar-inner { width: 240px; height: 100%; display: flex; flex-direction: column; overflow-y: auto; }

/* User card */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #1565c0, #42a5f5);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-size: 0.85rem; font-weight: 700; }
.sidebar-user-role { color: rgba(255,255,255,0.5); font-size: 0.72rem; text-transform: capitalize; }

/* Nav items */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 0.85rem; font-weight: 500;
  transition: all 0.15s; cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item i { width: 16px; text-align: center; font-size: 0.78rem; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { color: #64b5f6; background: rgba(100,181,246,0.1); border-left-color: #64b5f6; font-weight: 700; }
.nav-sub { padding: 8px 18px 8px 36px; font-size: 0.8rem; }

/* Nav groups */
.nav-group { border-bottom: none; }
.nav-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; color: rgba(255,255,255,0.75); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.nav-group-header span { display: flex; align-items: center; gap: 8px; }
.nav-group-header:hover { background: rgba(255,255,255,0.05); }
.nav-group-arrow { font-size: 0.65rem; color: rgba(255,255,255,0.4); }

/* Logout */
.sidebar-logout { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-btn-red {
  width: 100%; padding: 9px; border: none; border-radius: 8px;
  background: #c0392b; color: #fff; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.logout-btn-red:hover { background: #e74c3c; }

/* ── Content Area ─────────────────────────────────────────────────────────── */
.rms-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: #f8f9fa; position: relative;
}
#page-content { flex: 1; overflow-y: auto; overflow-x: hidden; }

/* ── Stats Bar ────────────────────────────────────────────────────────────── */
.stats-bar {
  background: #fff; border-bottom: 1px solid #e8eaed;
  padding: 6px 18px; display: flex; gap: 0; align-items: center;
  flex-shrink: 0; flex-wrap: wrap; min-height: 38px;
}
.stat-item {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 14px; border-right: 1px solid #e0e0e0;
}
.stat-item:first-child { padding-left: 4px; }
.stat-val { font-size: 1rem; font-weight: 800; }
.stat-lbl { font-size: 0.7rem; color: #888; }
.stat-divider { width: 1px; height: 18px; background: #e0e0e0; margin: 0 6px; flex-shrink: 0; }
.stat-select {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #ddd;
  font-size: 0.7rem; font-weight: 600; cursor: pointer; margin-right: 6px;
  font-family: inherit;
}
.cat-legend {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-left: auto; padding-left: 8px;
}
.payment-legend {
  display: flex; gap: 6px; align-items: center; font-size: 0.65rem; color: #888;
  margin-left: 10px; flex-shrink: 0;
}
.pay-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  background: #fff; border-bottom: 1px solid #e8eaed;
  padding: 10px 24px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.bc-home { background: none; border: none; cursor: pointer; color: #1565c0; font-size: 0.82rem; font-weight: 600; padding: 0; font-family: inherit; }
.bc-home:hover { text-decoration: underline; }
.bc-sep  { color: #ccc; }
.bc-title { font-size: 0.82rem; color: #555; font-weight: 600; text-transform: capitalize; }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.loading-spinner {
  position: absolute; inset: 0; z-index: 300;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
}
.spinner { width: 36px; height: 36px; border: 3px solid #e0e0e0; border-top-color: #1565c0; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card-header { padding: 14px 18px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 16px 18px; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th { padding: 9px 12px; text-align: left; font-weight: 700; color: #555; border-bottom: 2px solid #e0e0e0; background: #f0f2f5; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid #f5f5f5; color: #1a1a2e; }
.data-table tbody tr:nth-child(even) { background: #f9f9f9; }
.data-table tbody tr:hover { background: #f0f4ff; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.78rem; font-weight: 700; color: #444; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-select, .form-textarea {
  padding: 8px 12px; border-radius: 7px; border: 1.5px solid #e0e0e0;
  font-size: 0.83rem; background: #fff; color: #1a1a2e;
  outline: none; transition: border 0.2s, box-shadow 0.2s; font-family: inherit; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #1565c0; box-shadow: 0 0 0 3px rgba(21,101,192,0.08); }
.form-textarea { resize: vertical; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border: none; border-radius: 7px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.btn-primary   { background: linear-gradient(135deg, #1565c0, #1976d2); color: #fff; box-shadow: 0 3px 10px rgba(21,101,192,0.25); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(21,101,192,0.35); transform: translateY(-1px); }
.btn-success   { background: #1e8449; color: #fff; }
.btn-success:hover { background: #196f3d; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-danger:hover  { background: #c0392b; }
.btn-secondary { background: #f5f5f5; color: #555; border: 1px solid #ddd; }
.btn-secondary:hover { background: #ebebeb; }
.btn-sm  { padding: 4px 10px; font-size: 0.72rem; }
.btn-link { background: none; border: none; color: #1565c0; font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: #e74c3c; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid #e8eaed; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px; border: none; cursor: pointer;
  background: #f7f8fa; font-weight: 500; color: #666; font-size: 0.83rem;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  border-radius: 6px 6px 0 0; transition: all 0.15s; font-family: inherit;
}
.tab-btn.active { background: #fff; font-weight: 700; color: #1565c0; border-bottom-color: #1565c0; }
.tab-btn:hover:not(.active) { background: #eef; color: #333; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 0.68rem; font-weight: 700; }
.badge-confirmed  { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.badge-tentative  { background: #fef9e7; color: #d4ac0d; border: 1px solid #f9e79f; }
.badge-checked-in { background: #dbeafe; color: #1565c0; border: 1px solid #93c5fd; }
.badge-cancelled  { background: #fce8e8; color: #e74c3c; border: 1px solid #f5b7b1; }
.badge-blocked    { background: #fdedec; color: #7b241c; border: 1px solid #fadbd8; }
.badge-no-show    { background: #f4ecf7; color: #6c3483; border: 1px solid #d7bde2; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; margin-bottom: 14px; }
.alert-success { background: #f0fff4; border: 1.5px solid #9be9a8; color: #1e8449; }
.alert-error   { background: #fff5f5; border: 1.5px solid #fcc; color: #c0392b; }
.alert-warning { background: #fffbf0; border: 1.5px solid #f9e79f; color: #7d5a00; }
.alert-info    { background: #eff6ff; border: 1.5px solid #93c5fd; color: #1565c0; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.25); animation: fadeIn 0.2s; }
.modal-header { background: linear-gradient(135deg, #1a1a2e, #1565c0); padding: 16px 22px; border-radius: 14px 14px 0 0; display: flex; justify-content: space-between; align-items: center; }
.modal-title  { color: #fff; font-weight: 800; font-size: 1rem; }
.modal-close  { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 7px; padding: 5px 12px; cursor: pointer; font-size: 0.82rem; font-family: inherit; }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Page specific ────────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-title  { font-size: 1.2rem; font-weight: 700; color: #1f2937; }
.page-subtitle { font-size: 0.8rem; color: #777; margin-top: 4px; }

/* ── Booking status ────────────────────────────────────────────────────────── */
.status-confirmed  { color: #1e8449; }
.status-tentative  { color: #d4ac0d; }
.status-checked-in { color: #1565c0; }
.status-cancelled  { color: #e74c3c; }
.status-blocked    { color: #7b241c; }

/* ── Misc utils ───────────────────────────────────────────────────────────── */
.text-muted  { color: #888; }
.text-center { text-align: center; }
.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mt-auto{ margin-top: auto; }
.p-16   { padding: 16px; }
.p-24   { padding: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1a1a2e; color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: fadeIn 0.2s;
}
