/* ============================================================
   OAKTREE GROUP — MEETING ROOM BOOKING SYSTEM
   Design System: Navy · Green · Gold · Grey · Beige
   ============================================================ */

:root {
  --navy:        #1B2A4A;
  --navy-dark:   #0f1d35;
  --navy-light:  #253560;
  --green:       #2A5C45;
  --green-light: #3a7a5e;
  --gold:        #C9A84C;
  --gold-light:  #e0be70;
  --grey-bg:     #F4F4F6;
  --grey-border: #E2E2E8;
  --grey-text:   #6B7280;
  --beige:       #F8F3EA;
  --beige-dark:  #EDE5D4;
  --white:       #FFFFFF;
  --danger:      #C0392B;
  --danger-bg:   #FEF0EE;
  --warning:     #E67E22;
  --warning-bg:  #FFF8F0;
  --success:     #2A5C45;
  --success-bg:  #F0F7F4;
  --text-primary:#1B2A4A;
  --text-secondary:#4B5563;
  --text-muted:  #9CA3AF;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --transition:  .2s ease;
}

[data-theme="dark"] {
  --navy:        #1e3a5f;
  --navy-dark:   #111e30;
  --grey-bg:     #111827;
  --grey-border: #1f2937;
  --grey-text:   #9CA3AF;
  --beige:       #1a2035;
  --beige-dark:  #1f2840;
  --white:       #1f2937;
  --text-primary:#F9FAFB;
  --text-secondary:#D1D5DB;
  --text-muted:  #6B7280;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.5);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--grey-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-container { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-mark {
  width: 42px; height: 42px;
  background: var(--gold);
  color: var(--navy-dark);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  letter-spacing: .5px;
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; min-width: 0; }
.company-name { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.system-name  { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(201,168,76,.15); color: var(--gold); }
.nav-item.active svg { color: var(--gold); }

.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 12px 0; }
.nav-label { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.35); letter-spacing: 1px; padding: 0 14px 6px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 2px;
}

.admin-link { color: rgba(255,255,255,.45) !important; font-size: 13px; }
.admin-link:hover { background: rgba(201,168,76,.1) !important; color: var(--gold) !important; }

.theme-toggle {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: rgba(255,255,255,.45);
  font-size: 13px; font-weight: 500;
  cursor: pointer; width: 100%;
  transition: all var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.75); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle span { font-family: inherit; }

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

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: 17px; font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

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

.internal-badge {
  font-size: 11px; font-weight: 600;
  color: var(--green);
  background: var(--success-bg);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .3px;
  border: 1px solid rgba(42,92,69,.15);
}

.date-display {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.sidebar-toggle:hover { background: var(--grey-bg); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* ── PAGE CONTENT ────────────────────────────────────────── */
.page-content { flex: 1; padding: 28px; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--grey-border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 17px; height: 17px; color: var(--gold); }

.card-body { padding: 20px 22px; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .5px; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); margin: 4px 0 2px; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }
.stat-icon  { float: right; width: 40px; height: 40px; background: var(--beige); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 20px; height: 20px; color: var(--gold); }

/* ── ROOM STATUS CARDS ───────────────────────────────────── */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.room-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.room-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
}
.room-card.available::before  { background: var(--green); }
.room-card.occupied::before   { background: var(--danger); }
.room-card.blocked::before    { background: var(--grey-text); }

.room-name { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.room-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.room-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary); }
.room-meta span { display: flex; align-items: center; gap: 4px; }
.room-meta svg { width: 13px; height: 13px; }

/* ── STATUS BADGES ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-available  { background: var(--success-bg);  color: var(--green);   border: 1px solid rgba(42,92,69,.2); }
.badge-booked     { background: #EEF2FF;             color: #4F46E5;        border: 1px solid rgba(79,70,229,.2); }
.badge-blocked    { background: #F3F4F6;             color: #6B7280;        border: 1px solid rgba(107,114,128,.2); }
.badge-past       { background: var(--grey-bg);      color: var(--text-muted); border: 1px solid var(--grey-border); }
.badge-cancelled  { background: var(--danger-bg);    color: var(--danger);  border: 1px solid rgba(192,57,43,.2); }
.badge-overridden { background: var(--warning-bg);   color: var(--warning); border: 1px solid rgba(230,126,34,.2); }
.badge-confirmed  { background: var(--success-bg);   color: var(--green);   border: 1px solid rgba(42,92,69,.2); }
.badge-in-progress{ background: #FFF7ED;             color: #C05621;        border: 1px solid rgba(192,86,33,.2); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary   { background: var(--navy);  color: #fff; }
.btn-primary:hover   { background: var(--navy-light); box-shadow: var(--shadow-md); }

.btn-gold      { background: var(--gold);  color: var(--navy-dark); }
.btn-gold:hover      { background: var(--gold-light); box-shadow: var(--shadow-md); }

.btn-green     { background: var(--green); color: #fff; }
.btn-green:hover     { background: var(--green-light); box-shadow: var(--shadow-md); }

.btn-outline   { background: transparent; color: var(--text-primary); border: 1.5px solid var(--grey-border); }
.btn-outline:hover   { border-color: var(--navy); color: var(--navy); background: var(--beige); }

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

.btn-ghost     { background: none; color: var(--text-secondary); }
.btn-ghost:hover     { background: var(--grey-bg); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-loading { pointer-events: none; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.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: 13px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
label .required { color: var(--danger); margin-left: 2px; }

input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,.08);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }

textarea { resize: vertical; min-height: 90px; }

.input-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.input-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea { border-color: var(--danger); }
.form-group.has-error .input-error { display: block; }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  padding: 11px 16px;
  background: var(--beige);
  color: var(--text-secondary);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  text-align: left;
  border-bottom: 2px solid var(--grey-border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--grey-border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--beige); }
.data-table .actions { display: flex; gap: 6px; }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: all .2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform .2s ease;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--grey-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; padding: 4px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center;
}
.modal-close:hover { background: var(--grey-bg); color: var(--text-primary); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body   { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--grey-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── TOAST NOTIFICATIONS ─────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px;
}

.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .3s ease;
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.toast.success::before { background: var(--green); }
.toast.error::before   { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before    { background: var(--navy); }

.toast-icon svg { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--navy); }

.toast-content { flex: 1; min-width: 0; }
.toast-title   { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; flex-shrink: 0; }
.toast-close svg { width: 14px; height: 14px; }

@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(120%); } }
.toast.removing { animation: fadeOut .3s ease forwards; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center;
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--beige);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.empty-state-icon svg { width: 28px; height: 28px; color: var(--gold); }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 14px; color: var(--text-muted); max-width: 320px; line-height: 1.5; }

/* ── SCHEDULE / TIMELINE ─────────────────────────────────── */
.schedule-grid { position: relative; }

.time-slot-row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr;
  min-height: 48px;
  border-bottom: 1px solid var(--grey-border);
}
.time-slot-row:last-child { border-bottom: none; }

.slot-time {
  padding: 8px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--grey-border);
  display: flex; align-items: center;
  background: var(--beige);
}

.slot-cell {
  padding: 6px;
  border-right: 1px solid var(--grey-border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.slot-cell:last-child { border-right: none; }
.slot-cell:hover { background: var(--beige); }

.slot-booking {
  background: rgba(79,70,229,.1);
  border: 1px solid rgba(79,70,229,.3);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11px; font-weight: 500;
  color: #4F46E5;
  height: 100%;
  min-height: 32px;
  display: flex; align-items: center;
}
.slot-blocked {
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11px; color: var(--text-muted);
  height: 100%; min-height: 32px;
  display: flex; align-items: center;
}
.slot-available:hover .slot-add {
  opacity: 1;
}
.slot-add {
  opacity: 0;
  font-size: 11px; color: var(--green);
  font-weight: 600;
  transition: opacity var(--transition);
}

/* ── BOOKING FORM STEPS ──────────────────────────────────── */
.booking-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 32px;
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
}
.step.active   { color: var(--navy); }
.step.complete { color: var(--green); }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--grey-bg);
  color: var(--text-muted);
  border: 2px solid var(--grey-border);
  flex-shrink: 0;
}
.step.active   .step-num { background: var(--navy); color: #fff; border-color: var(--navy); }
.step.complete .step-num { background: var(--green); color: #fff; border-color: var(--green); }

.step-line { flex: 1; height: 1.5px; background: var(--grey-border); margin: 0 12px; min-width: 20px; }

/* ── ROOM SELECTOR ───────────────────────────────────────── */
.room-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.room-option {
  border: 2px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.room-option:hover { border-color: var(--navy); background: var(--beige); }
.room-option.selected { border-color: var(--navy); background: rgba(27,42,74,.04); }
.room-option.selected::after {
  content: '✓';
  position: absolute;
  top: 10px; right: 12px;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}
.room-option-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.room-option-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

/* ── DURATION PILLS ──────────────────────────────────────── */
.duration-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.duration-pill {
  padding: 7px 16px;
  border: 1.5px solid var(--grey-border);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.duration-pill:hover { border-color: var(--navy); color: var(--navy); }
.duration-pill.selected { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── TIME SLOTS GRID ─────────────────────────────────────── */
.time-slots-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.time-slot-btn {
  padding: 8px 14px;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  color: var(--text-primary);
}
.time-slot-btn:hover:not(:disabled) { border-color: var(--navy); background: var(--beige); }
.time-slot-btn.selected:not(:disabled) { background: var(--navy); color: #fff; border-color: var(--navy); }
.time-slot-btn.booked   { background: #EEF2FF; color: #9BA3F5; border-color: #C7D2FE; cursor: not-allowed; }
.time-slot-btn.blocked  { background: var(--grey-bg); color: var(--text-muted); border-color: var(--grey-border); cursor: not-allowed; }
.time-slot-btn.past     { opacity: .4; cursor: not-allowed; }
.time-slot-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── CALENDAR ────────────────────────────────────────────── */
.calendar-nav {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.calendar-nav h2 { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.cal-grid-header {
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  gap: 1px;
  background: var(--grey-border);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
}
.cal-day-header {
  background: var(--beige);
  padding: 10px 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}
.cal-day-header.today-header { background: rgba(27,42,74,.06); color: var(--navy); }
.cal-time-header { background: var(--beige); }

.cal-body { border: 1px solid var(--grey-border); border-top: none; overflow: auto; max-height: 65vh; }
.cal-row {
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  min-height: 52px;
  border-bottom: 1px solid var(--grey-border);
  background: var(--white);
}
.cal-row:last-child { border-bottom: none; }

.cal-time {
  padding: 6px 10px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  background: var(--beige);
  border-right: 1px solid var(--grey-border);
  display: flex; align-items: flex-start;
  padding-top: 8px;
}
.cal-cell {
  border-right: 1px solid var(--grey-border);
  padding: 3px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.cal-cell:last-child { border-right: none; }
.cal-cell:hover { background: var(--beige); }
.cal-cell.today-col { background: rgba(201,168,76,.04); }

.cal-event {
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px; font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity var(--transition);
}
.cal-event:hover { opacity: .85; }
.cal-event.oak-room  { background: rgba(27,42,74,.12); color: var(--navy); border-left: 3px solid var(--navy); }
.cal-event.tree-room { background: rgba(42,92,69,.1);  color: var(--green); border-left: 3px solid var(--green); }
.cal-event.blocked   { background: #F3F4F6; color: #6B7280; border-left: 3px solid #9CA3AF; }

/* Day view */
.cal-day-grid { border: 1px solid var(--grey-border); border-radius: var(--radius-md); overflow: hidden; }
.cal-day-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  min-height: 52px;
  border-bottom: 1px solid var(--grey-border);
}
.cal-day-row:last-child { border-bottom: none; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-header-left h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-header-left p  { font-size: 14px; color: var(--text-muted); margin-top: 3px; }

/* ── SEARCH & FILTER BAR ─────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-bar input, .filter-bar select { width: auto; min-width: 140px; }
.search-input-wrap { position: relative; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-input-wrap input { padding-left: 34px; }

/* ── BOOKING DETAIL PANEL ────────────────────────────────── */
.booking-detail {
  background: var(--beige);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--beige-dark);
}
.booking-detail-row { display: flex; gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.booking-detail-row:last-child { margin-bottom: 0; }
.detail-label { color: var(--text-muted); font-weight: 500; min-width: 90px; flex-shrink: 0; }
.detail-value { color: var(--text-primary); font-weight: 600; }

/* ── ADMIN LOGIN ─────────────────────────────────────────── */
.admin-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--grey-bg);
  padding: 20px;
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--grey-border);
  text-align: center;
}
.admin-login-icon {
  width: 64px; height: 64px;
  background: rgba(27,42,74,.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.admin-login-icon svg { width: 28px; height: 28px; color: var(--navy); }
.admin-login-card h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.admin-login-card p  { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ── TAB NAV ─────────────────────────────────────────────── */
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--grey-border); margin-bottom: 24px; overflow-x: auto; }
.tab-btn {
  padding: 10px 18px;
  background: none; border: none;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── ANALYTICS ───────────────────────────────────────────── */
.analytics-bar-wrap { display: flex; flex-direction: column; gap: 10px; }
.analytics-bar-row  { display: flex; align-items: center; gap: 12px; }
.analytics-bar-label{ font-size: 13px; color: var(--text-secondary); min-width: 80px; }
.analytics-bar-track{ flex: 1; height: 8px; background: var(--grey-border); border-radius: 4px; overflow: hidden; }
.analytics-bar-fill { height: 100%; border-radius: 4px; background: var(--navy); transition: width .6s ease; }
.analytics-bar-val  { font-size: 13px; font-weight: 600; color: var(--text-primary); min-width: 30px; text-align: right; }

/* ── CONFIRMATION SUCCESS ────────────────────────────────── */
.success-banner {
  background: var(--success-bg);
  border: 1px solid rgba(42,92,69,.2);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative;
}
.success-banner svg { width: 24px; height: 24px; color: var(--green); flex-shrink: 0; margin-top: 1px; }

/* ── RTL / ARABIC SUPPORT ────────────────────────────────── */
[dir="rtl"] {
  font-family: 'Segoe UI', Tahoma, 'Arial Unicode MS', Arial, sans-serif;
}
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--grey-border);
}
[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: 260px;
}
[dir="rtl"] .sidebar.open {
  transform: translateX(100%) !important;
}
@media (max-width: 768px) {
  [dir="rtl"] .main-content { margin-right: 0; }
  [dir="rtl"] .sidebar { right: -260px; left: auto; transform: none; }
  [dir="rtl"] .sidebar.open { right: 0; transform: none !important; }
}
[dir="rtl"] .nav-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .nav-label { text-align: right; }
[dir="rtl"] .sidebar-logo { flex-direction: row-reverse; }
[dir="rtl"] .logo-text { text-align: right; }
[dir="rtl"] .topbar { flex-direction: row-reverse; }
[dir="rtl"] .topbar-right { flex-direction: row-reverse; }
[dir="rtl"] .card-header { flex-direction: row-reverse; }
[dir="rtl"] .card-title { flex-direction: row-reverse; }
[dir="rtl"] .page-header { flex-direction: row-reverse; }
[dir="rtl"] .page-header-left { text-align: right; }
[dir="rtl"] .form-group label { display: block; text-align: right; }
[dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .input-hint { text-align: right; }
[dir="rtl"] .input-error { text-align: right; }
[dir="rtl"] .stat-card { text-align: right; }
[dir="rtl"] .stat-icon { margin-left: 0; }
[dir="rtl"] .tab-nav { flex-direction: row-reverse; }
[dir="rtl"] .filter-bar { flex-direction: row-reverse; }
[dir="rtl"] .two-col { direction: rtl; }
[dir="rtl"] .three-col { direction: rtl; }
[dir="rtl"] .stats-grid { direction: rtl; }
[dir="rtl"] .booking-detail-row { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .detail-label { text-align: right; }
[dir="rtl"] .detail-value { text-align: right; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }
[dir="rtl"] .modal-footer { flex-direction: row-reverse; }
[dir="rtl"] .toast { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .room-cards { direction: rtl; }
[dir="rtl"] .room-card { text-align: right; }
[dir="rtl"] .room-card-actions { flex-direction: row-reverse; }
[dir="rtl"] .duration-pills { flex-direction: row-reverse; }
[dir="rtl"] .actions { flex-direction: row-reverse; }
[dir="rtl"] .data-table th, [dir="rtl"] .data-table td { text-align: right; }
[dir="rtl"] .empty-state { direction: rtl; }
[dir="rtl"] .schedule-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .schedule-time { text-align: right; }
[dir="rtl"] .sidebar-footer { direction: rtl; }
[dir="rtl"] .lang-toggle { direction: ltr; }

/* Language toggle button */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: inherit;
  transition: background .15s, color .15s;
  text-align: left;
  margin-top: 4px;
}
[dir="rtl"] .lang-toggle { text-align: right; flex-direction: row-reverse; }
.lang-toggle:hover { background: var(--grey-bg); color: var(--text-primary); }
.lang-toggle svg { flex-shrink: 0; }
.success-banner-title { font-size: 15px; font-weight: 700; color: var(--green); margin-bottom: 4px; }
.success-banner-msg   { font-size: 13.5px; color: var(--text-secondary); }
.success-banner-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm);
}
.success-banner-close:hover { background: rgba(0,0,0,.05); }
.success-banner-close svg { width: 14px; height: 14px; }

/* ── PAGE-SPECIFIC ───────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── LOADING SPINNER ─────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: rgba(27,42,74,.2);
  border-top-color: var(--navy);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td { padding: 40px; text-align: center; color: var(--text-muted); }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── UTILITY ─────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-muted    { color: var(--text-muted); }
.text-sm       { font-size: 13px; }
.font-bold     { font-weight: 700; }
.hidden        { display: none !important; }
.w-full        { width: 100%; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .room-selector { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .cal-grid-header, .cal-row { grid-template-columns: 56px repeat(7, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .booking-steps { display: none; }
}

/* ── SIDEBAR OVERLAY ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
@media (max-width: 768px) {
  .sidebar-overlay.show { display: block; }
}
