/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

:root {
  --primary:       #2B6A87;
  --primary-dark:  #1d4f68;
  --primary-light: #eaf5f7;
  --primary-mid:   #72C4C4;
  --orange:  #f57c00;
  --red:     #c62828;
  --green:   #2e7d32;
  --blue:    #1565c0;
  --gray-bg:     #f3f7f8;
  --gray-border: #ddd;
  --text:        #1e3a4a;
  --text-light:  #607d8b;
  --surface:     white;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --radius: 6px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

/* === Dark mode === */
[data-theme="dark"] {
  --gray-bg:     #0e1c26;
  --gray-border: #2a3f52;
  --text:        #cce3ee;
  --text-light:  #6fa0b8;
  --primary-light: #0c2535;
  --surface:     #162736;
  --shadow:      0 2px 8px rgba(0,0,0,0.5);
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--gray-bg); color: var(--text); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--gray-border);
}
[data-theme="dark"] .bm-box { background: #162736 !important; border-color: var(--gray-border) !important; }
[data-theme="dark"] .bm-name { color: #cce3ee; }
[data-theme="dark"] .modal-overlay, [data-theme="dark"] #modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .suggestion-item:hover { background: var(--primary-light); }
[data-theme="dark"] .mybk-header h2 { color: white; }
[data-theme="dark"] .btn-outline { background: transparent; border-color: rgba(255,255,255,0.35); }
[data-theme="dark"] .export-dropdown .export-menu button:hover { background: var(--primary-light); }

/* Calendrier */
[data-theme="dark"] .cal-table th      { background: #1e3347; }
[data-theme="dark"] .cal-room-label    { background: #162736; }
[data-theme="dark"] .cal-building-row td { background: #0c1f2e; color: #72C4C4; }
[data-theme="dark"] .cal-empty         { background: #162736; }
[data-theme="dark"] .cal-empty:hover   { background: #1e3347; }
[data-theme="dark"] .cal-today         { background: rgba(43,106,135,0.25) !important; }
[data-theme="dark"] .res-card          { background: var(--surface); border-color: var(--gray-border); }

body {
  font-family: var(--font);
  background: var(--gray-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
header {
  background: var(--primary);
  color: white;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 1.1rem; font-weight: 600; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 0.6rem;
}
.logo-img { height: 36px; width: auto; }

.app-footer {
  text-align: right;
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  color: var(--text-light);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

#user-area { display: flex; align-items: center; gap: 0.75rem; }

/* === Menu utilisateur dropdown === */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 0.5rem;
  background: none; border: none; cursor: pointer;
  color: white; padding: 0.4rem 0.65rem;
  border-radius: var(--radius); transition: background 0.15s; height: 40px;
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.12); }
.user-menu-firstname { font-size: 0.9rem; font-weight: 500; opacity: 0.9; }
.user-menu-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--gray-border);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  width: 280px; z-index: 200; padding: 0.35rem 0; overflow: hidden;
}
.user-card { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1rem 1rem 0.85rem; min-width: 0; }
.user-card-avatar { width: 46px !important; height: 46px !important; font-size: 1rem !important; flex-shrink: 0; }
.user-card-info { min-width: 0; flex: 1; }
.user-card-name { display: block; font-size: 0.95rem; color: var(--text); margin-bottom: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-meta { display: block; font-size: 0.8rem; color: var(--text-light); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-dept::before { content: '·  '; opacity: 0.4; }
.user-card-email { display: block; font-size: 0.78rem; color: var(--text-light); opacity: 0.7; margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-admin-badge { display: inline-block; margin-top: 0.35rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); padding: 0.15rem 0.5rem; border-radius: 20px; }
.user-menu-divider { height: 1px; background: var(--gray-border); margin: 0.35rem 0; }
.user-menu-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem 1rem; background: none; border: none; cursor: pointer; font-size: 0.9rem; color: var(--text); text-align: left; transition: background 0.1s; }
.user-menu-item:hover { background: var(--gray-bg); }
.user-menu-logout { color: #c62828; }
.user-menu-logout:hover { background: #ffebee; }

/* === Menu admin dropdown === */
.admin-menu { position: relative; }
.admin-menu-trigger { font-size: 1rem; }
.admin-menu-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--gray-border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 240px; z-index: 200; padding: 0.35rem 0; overflow: hidden;
}
.admin-menu-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem 1rem; background: none; border: none; cursor: pointer; font-size: 0.9rem; color: var(--text); text-align: left; transition: background 0.1s; }
.admin-menu-item:hover { background: var(--gray-bg); }
.admin-menu-divider { height: 1px; background: var(--gray-border); margin: 0.35rem 0; }

.admin-pending-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: white; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.45rem;
  margin-left: auto; min-width: 20px;
}

/* === Theme button === */
.btn-theme { background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; color: white; opacity: 0.75; padding: 0.2rem 0.3rem; transition: opacity 0.15s, transform 0.2s; }
.btn-theme:hover { opacity: 1; transform: scale(1.2); }
.btn-theme-teams { display: none; }
body.in-teams .btn-theme-teams { display: block; }

/* Teams bar */
.teams-bar { display: none; background: var(--primary-dark); padding: 0.4rem 1rem; justify-content: flex-end; align-items: center; gap: 0.5rem; }
body.in-teams .teams-bar { display: flex; }
body.in-teams header { display: none; }
#teams-bar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* === Main / Views === */
main { flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; padding: 1.5rem; }
.view { width: 100%; }
.hidden { display: none !important; }

/* === Login === */
.login-box { max-width: 420px; margin: 5rem auto; background: var(--surface); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow); text-align: center; }
.login-box h1 { color: var(--primary); margin-bottom: 0.75rem; }
.login-box p { color: var(--text-light); margin-bottom: 1.5rem; }

/* === Buttons === */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.5rem 1.25rem; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; transition: background 0.15s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-large { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.6); padding: 0.4rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; transition: border-color 0.15s; }
.btn-outline:hover { border-color: white; }
.btn-outline-dark { background: transparent; border: 1px solid var(--gray-border); color: var(--text); border-radius: var(--radius); padding: 0.3rem 0.75rem; cursor: pointer; font-size: 0.9rem; }
.btn-outline-dark:hover { background: var(--gray-bg); }
.btn-danger { background: var(--red); color: white; border: none; padding: 0.4rem 0.9rem; border-radius: var(--radius); cursor: pointer; }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: var(--green); color: white; border: none; padding: 0.4rem 0.9rem; border-radius: var(--radius); cursor: pointer; }
.btn-success:hover { background: #1b5e20; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.btn-back { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.95rem; display: flex; align-items: center; gap: 0.3rem; padding: 0; }
.btn-back:hover { text-decoration: underline; }
.btn-icon { background: none; border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.3rem 0.6rem; cursor: pointer; font-size: 1rem; color: var(--text); }
.btn-icon:hover { background: var(--gray-bg); }
.btn-icon.active { background: var(--primary); color: white; border-color: var(--primary); }

/* === Modal === */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
#modal-box { background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.2); padding: 2rem; max-width: 540px; width: 95%; position: relative; max-height: 90vh; overflow-y: auto; }
#modal-close { position: absolute; top: 0.75rem; right: 0.75rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-light); }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.88rem; color: var(--text-light); margin-bottom: 0.3rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.45rem 0.75rem; font-size: 0.95rem; font-family: var(--font); }
.form-group input[readonly] { background: var(--gray-bg); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }
.form-error { color: #c62828; font-size: 0.85rem; margin-top: 0.5rem; padding: 0.4rem 0.7rem; background: #ffebee; border-radius: var(--radius); }

/* === Avatars === */
.header-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255,255,255,0.55); flex-shrink: 0; }
.header-avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--primary-mid); color: white; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; user-select: none; }

/* === Toast === */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 0.65rem 1.25rem; border-radius: 20px;
  font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 2000; max-width: 90vw; text-align: center;
  animation: toastIn 0.25s ease;
}
.toast.toast-error   { background: var(--red); }
.toast.toast-success { background: #2e7d32; }
.toast.toast-info    { background: var(--primary); }
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* === Mes réservations === */
.mybk-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.mybk-header h2 { color: var(--primary); }
.mybk-empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-top: 4rem; color: var(--text-light); }
.mybk-empty .mbw-icon { font-size: 2.5rem; }

.res-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 760px; }

.res-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.res-card-body { flex: 1; min-width: 0; }
.res-card-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.res-card-meta { font-size: 0.85rem; color: var(--text-light); display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin-bottom: 0.4rem; }
.res-card-note { font-size: 0.82rem; color: var(--text-light); font-style: italic; margin-top: 0.25rem; }
.res-card-admin-note { font-size: 0.82rem; color: var(--orange); margin-top: 0.25rem; }
.res-card-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* === Badges statut === */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.status-badge.pending   { background: #fff3e0; color: #e65100; }
.status-badge.approved  { background: #e8f5e9; color: #2e7d32; }
.status-badge.rejected  { background: #ffebee; color: #c62828; }
.status-badge.cancelled { background: var(--gray-bg); color: var(--text-light); }

[data-theme="dark"] .status-badge.pending   { background: #2e1a00; color: #ffb74d; }
[data-theme="dark"] .status-badge.approved  { background: #0d2e15; color: #81c784; }
[data-theme="dark"] .status-badge.rejected  { background: #2e0d0d; color: #ef9a9a; }
[data-theme="dark"] .status-badge.cancelled { background: #1a1a1a; color: #9e9e9e; }

/* === Calendrier timeline === */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem;
}
.cal-header h2 { color: var(--primary); }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-range { font-size: 0.9rem; color: var(--text-light); min-width: 200px; text-align: center; }
.cal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cal-scroll-wrapper { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }

.cal-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.88rem;
}
.cal-table th, .cal-table td {
  border: 1px solid var(--gray-border);
  white-space: nowrap;
}
.cal-table thead tr th {
  background: var(--primary);
  color: white;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.cal-table thead tr th.cal-room-col-header {
  min-width: 160px;
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
}
.cal-th-day { min-width: 52px; }
.cal-th-weekend { opacity: 0.65; }
.cal-th-today { background: var(--primary-dark) !important; }

.cal-room-label {
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
  border-right: 2px solid var(--gray-border);
}

.cal-building-row td {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
}
.cal-building-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.cal-empty {
  background: var(--surface);
  cursor: pointer;
  transition: background 0.1s;
  min-width: 52px;
  height: 40px;
}
.cal-empty:hover { background: var(--primary-light); }
.cal-empty.cal-today { background: rgba(114,196,196,0.12); }
.cal-empty.cal-weekend { opacity: 0.7; }
.cal-empty.cal-past { cursor: default; opacity: 0.5; }
.cal-empty.cal-past:hover { background: var(--surface); }

/* Cellule de réservation (spanning) */
.cal-res {
  cursor: pointer;
  padding: 0 0.4rem;
  vertical-align: middle;
  transition: filter 0.1s;
}
.cal-res:hover { filter: brightness(0.93); }
.cal-res.pending  { background: #fff3e0; border-color: #e65100; }
.cal-res.approved { background: #e8f5e9; border-color: #43a047; }
.cal-res.mine     { background: #e3f2fd; border-color: #1565c0; }

[data-theme="dark"] .cal-res.pending  { background: #2e1a00; border-color: #e65100; }
[data-theme="dark"] .cal-res.approved { background: #0d2e15; border-color: #43a047; }
[data-theme="dark"] .cal-res.mine     { background: #0d1e3d; border-color: #42a5f5; }

.cal-res-inner { display: flex; align-items: center; gap: 0.3rem; min-width: 0; overflow: hidden; }
.cal-res-name { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); flex: 1; min-width: 0; }
.cal-res-nights { font-size: 0.72rem; color: var(--text-light); flex-shrink: 0; }

/* Légende calendrier */
.cal-legend { display: flex; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-light); }
.cal-legend-dot { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid; flex-shrink: 0; }
.cal-legend-dot.approved { background: #e8f5e9; border-color: #43a047; }
.cal-legend-dot.pending  { background: #fff3e0; border-color: #e65100; }
.cal-legend-dot.mine     { background: #e3f2fd; border-color: #1565c0; }

/* === Formulaire de réservation === */
.res-form { min-width: min(420px, 90vw); }
.res-form h3 { margin: 0 0 1.25rem; font-size: 1.1rem; color: var(--primary); }
.res-form-room-info {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.res-form-room-info strong { display: block; font-size: 1rem; color: var(--primary); margin-bottom: 0.25rem; }
.res-form-room-meta { color: var(--text-light); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.res-form-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.res-form-time  { margin-top: 0.35rem; font-size: 0.88rem; }
.res-form-summary {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}
.res-form-summary strong { color: var(--text); font-size: 1.05rem; }
.res-form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-light); margin: 0.85rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.res-form-input, .res-form-select {
  width: 100%;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}

/* === Détail réservation modal === */
.res-detail { min-width: min(420px, 90vw); }
.res-detail h3 { margin: 0 0 1.25rem; font-size: 1.1rem; }
.res-detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.45rem 0; border-bottom: 1px solid var(--gray-border); font-size: 0.9rem; gap: 1rem; }
.res-detail-row:last-of-type { border-bottom: none; }
.res-detail-label { color: var(--text-light); font-size: 0.82rem; flex-shrink: 0; }
.res-detail-value { text-align: right; font-weight: 500; }
.res-detail-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }

/* Admin note form */
.admin-note-form { margin-top: 1rem; }
.admin-note-form textarea { width: 100%; border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.45rem 0.75rem; font-size: 0.9rem; font-family: var(--font); min-height: 80px; resize: vertical; background: var(--surface); color: var(--text); }

/* === Admin — tableau réservations === */
.admin-res-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-res-header h2 { color: var(--primary); }
.admin-res-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-res-filters select { border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.3rem 0.6rem; font-size: 0.88rem; background: var(--surface); color: var(--text); }

.admin-res-list { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-res-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.admin-res-card.status-pending { border-left: 4px solid #e65100; }
.admin-res-card.status-approved { border-left: 4px solid #43a047; }
.admin-res-card.status-rejected { border-left: 4px solid #c62828; }
.admin-res-card.status-cancelled { border-left: 4px solid #9e9e9e; opacity: 0.75; }

/* === Admin — gestion chambres === */
.room-editor-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.room-editor-header h2 { color: var(--primary); }

.building-section { margin-bottom: 2rem; }
.building-section-title {
  font-size: 1rem; font-weight: 700; color: var(--primary);
  margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; justify-content: space-between;
}

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.room-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.room-card-inactive { opacity: 0.55; }
.room-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.room-card-meta { font-size: 0.82rem; color: var(--text-light); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0.5rem; }
.room-card-price { font-weight: 700; color: var(--primary); }
.room-card-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.room-amenity-tag { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 0.72rem; padding: 0.1rem 0.4rem; border-radius: 10px; margin: 0.1rem 0.1rem 0 0; }

/* Statut des chambres */
.room-status-badge { font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 10px; margin-left: auto; }
.room-status-available   { background: var(--primary-light); color: var(--primary-dark); }
.room-status-blocked     { background: #fff3e0; color: #e65100; }
.room-status-maintenance { background: #f5f5f5; color: #616161; }
.room-status-select { border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.25rem 0.4rem; font-size: 0.8rem; background: var(--surface); color: var(--text); cursor: pointer; }
.archived-section { margin-top: 2rem; }
.archived-section summary { cursor: pointer; font-size: 0.9rem; color: var(--text-light); font-weight: 500; padding: 0.5rem 0; }
.archived-section summary:hover { color: var(--text); }

/* === Admin — tableau de bord === */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); text-align: center; }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 0.35rem; }
.kpi-label { font-size: 0.82rem; color: var(--text-light); }

/* === Site map (Leaflet) === */
.site-map-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.site-map-header h2 { color: var(--primary); }
#leaflet-map { height: 75vh; min-height: 400px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.legend { display: flex; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text-light); }

/* Building markers Leaflet */
.building-marker { background: none !important; border: none !important; }
.bm-box { background: white; border: 2px solid #43a047; border-radius: 8px; padding: 0.3rem 0.5rem; text-align: center; cursor: pointer; min-width: 90px; }
.bm-name { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.bm-count { font-size: 0.72rem; font-weight: 600; }
.bm-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 auto; margin-top: 2px; }

/* === Section titre avec séparateur === */
.section-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-header h3 { color: var(--primary); font-size: 1.05rem; }

/* === Table générique === */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--primary); color: white; padding: 0.65rem 1rem; text-align: left; font-size: 0.9rem; }
.data-table td { padding: 0.55rem 1rem; border-bottom: 1px solid var(--gray-border); font-size: 0.88rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-bg); }
[data-theme="dark"] .data-table th { background: #1e3347; }
[data-theme="dark"] .data-table td { border-color: var(--gray-border); }
[data-theme="dark"] .data-table tbody tr:hover { background: #1a2e3e; }

/* === Loading === */
.loading { text-align: center; padding: 3rem; color: var(--text-light); font-size: 0.95rem; }
.loading::after { content: ''; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--primary-mid); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin-left: 0.5rem; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Prix === */
.price { font-weight: 700; color: var(--primary); }
.price-total { font-size: 1.1rem; }

/* === Pagination / Navigation dates === */
.date-nav { display: flex; align-items: center; gap: 0.5rem; }
.date-nav input[type=date] { border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 0.3rem 0.6rem; font-size: 0.9rem; background: var(--surface); color: var(--text); }

/* === Building view === */
.building-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.building-header h2 { color: var(--primary); flex: 1; }
.building-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.floor-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.floor-tab {
  background: var(--surface);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.floor-tab.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }

.building-plan-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}
.building-plan-container svg { width: 100%; height: auto; max-height: 75vh; display: block; }
.building-plan-container svg.edit-mode { cursor: crosshair; }

/* === Room SVG styles === */
.room-rect { transition: fill 0.12s, stroke 0.12s; }

.room-group.free .room-rect { fill: var(--primary-light); stroke: var(--primary-mid); stroke-width: 1.5; }
.room-group.free:hover .room-rect { fill: #c4e8eb; }

.room-group.mine .room-rect { fill: #e3f2fd; stroke: var(--blue); stroke-width: 1.5; }
.room-group.mine:hover .room-rect { fill: #bbdefb; }

.room-group.occupied .room-rect { fill: #ffebee; stroke: var(--red); stroke-width: 1.5; }
.room-group.occupied:hover .room-rect { fill: #ffcdd2; }

.room-group.blocked .room-rect     { fill: #fff3e0; stroke: #f57c00; stroke-width: 1.5; }
.room-group.blocked:hover .room-rect { fill: #ffe0b2; }
.room-group.maintenance .room-rect { fill: #f5f5f5; stroke: #9e9e9e; stroke-width: 1.5; stroke-dasharray: 5 3; }
.room-group.edit-room .room-rect { fill: #eef2ff; stroke: #6366f1; stroke-width: 1.5; stroke-dasharray: 5 3; }

.room-label { font-size: 10px; font-family: var(--font); fill: #222; pointer-events: none; font-weight: 600; }
.room-sub   { font-size: 8px;  font-family: var(--font); fill: #555; pointer-events: none; }

/* === Legend items with colored indicators === */
.legend-item::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid;
  flex-shrink: 0;
}
.legend-item.free::before        { background: var(--primary-light); border-color: var(--primary-mid); }
.legend-item.mine::before        { background: #e3f2fd; border-color: var(--blue); }
.legend-item.occupied::before    { background: #ffebee; border-color: var(--red); }
.legend-item.blocked::before     { background: #fff3e0; border-color: #f57c00; }
.legend-item.maintenance::before { background: #f5f5f5; border-color: #9e9e9e; }

/* === Edit toolbar === */
.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-mid);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.edit-hint { flex: 1; font-size: 0.88rem; color: var(--primary-dark); }

/* === Room edit panel === */
.desk-edit-panel {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 180px;
  transform: translateX(-50%);
}
.dep-row { display: flex; flex-direction: column; gap: 0.2rem; }
.dep-row label { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }
.dep-row input, .dep-row select { padding: 0.3rem 0.5rem; border: 1px solid var(--gray-border); border-radius: 4px; font-size: 0.85rem; background: var(--surface); color: var(--text); }
.dep-actions { display: flex; gap: 0.4rem; justify-content: flex-end; margin-top: 0.2rem; }
.btn-outline-dark { background: transparent; border: 1px solid var(--gray-border); color: var(--text); border-radius: var(--radius); padding: 0.25rem 0.6rem; cursor: pointer; font-size: 0.8rem; }
.btn-outline-dark:hover { background: var(--gray-bg); }
.dep-sizes { display: flex; gap: 0.3rem; }
.dep-size-btn { background: var(--surface); border: 1px solid var(--gray-border); border-radius: 4px; padding: 0.2rem 0.5rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text); }
.dep-size-btn:hover { border-color: var(--primary); color: var(--primary); }
.dep-size-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* === Tooltip === */
#desk-tooltip {
  position: fixed;
  z-index: 5000;
  background: rgba(30, 58, 74, 0.93);
  color: white;
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  line-height: 1.5;
  max-width: 220px;
}
#desk-tooltip.visible { opacity: 1; }
#desk-tooltip strong { display: block; font-size: 0.88rem; }
#desk-tooltip span    { display: block; opacity: 0.8; }

/* Dark mode — building view */
[data-theme="dark"] .building-header h2 { color: #7ec8d0; }
[data-theme="dark"] .building-plan-container { background: #1a2e3e; }
[data-theme="dark"] .floor-tab { background: #1e2d3d; border-color: #2d4a5e; }
[data-theme="dark"] .floor-tab.active { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .room-label { fill: #e0e0e0; }
[data-theme="dark"] .room-sub   { fill: #aaa; }
[data-theme="dark"] .edit-toolbar { background: #1e3347; border-color: #2d4a5e; }
[data-theme="dark"] .edit-hint { color: #7ec8d0; }
[data-theme="dark"] .desk-edit-panel { background: #1a2e3e; }
[data-theme="dark"] .dep-row select, [data-theme="dark"] .dep-row input { background: #1e2d3d; border-color: #2d4a5e; color: #e0e0e0; }

/* === Autocomplete utilisateur === */
.user-ac { position: relative; }
.user-ac-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}
.user-ac-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-mid);
  color: var(--primary-dark);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}
.user-ac-name { flex: 1; font-size: 0.92rem; font-weight: 500; }
.user-ac-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 0.85rem; line-height: 1;
  padding: 0.1rem 0.3rem; border-radius: 4px;
}
.user-ac-clear:hover { background: var(--gray-border); color: var(--text); }
.user-ac-search { position: relative; }
.user-ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 500;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.user-ac-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.user-ac-item:hover { background: var(--primary-light); }
.user-ac-item + .user-ac-item { border-top: 1px solid var(--gray-border); }
.user-ac-info { display: flex; flex-direction: column; gap: 0.1rem; }
.user-ac-info strong { font-size: 0.9rem; }
.user-ac-info span { font-size: 0.78rem; color: var(--text-light); }
[data-theme="dark"] .user-ac-chip { background: #1e2d3d; }
[data-theme="dark"] .user-ac-dropdown { background: #1a2e3e; }
[data-theme="dark"] .user-ac-item:hover { background: #1e3347; }

/* === Dessin de polygone (mode édition) === */
.drawing-polygon {
  fill: var(--primary-light);
  fill-opacity: 0.45;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
  pointer-events: none;
}
.drawing-preview {
  stroke: var(--primary-mid);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.drawing-dot {
  fill: white;
  stroke: var(--primary);
  stroke-width: 1.5;
  pointer-events: none;
}
.drawing-first-dot { stroke-width: 2; }

/* === Check-in / Check-out === */
.cio-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem 0.5rem;
}
.cio-header h2 { font-size: 1.15rem; flex: 1 1 auto; }
.cio-today-label { font-size: 0.85rem; color: var(--text-light); }

.cio-section { padding: 0.5rem 1.25rem 0.25rem; }
.cio-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--primary-light);
}
.cio-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.6rem 0 0.35rem;
}

.cio-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cio-card-arrival   { border-left: 4px solid var(--primary); }
.cio-card-departure { border-left: 4px solid var(--orange); }
.cio-card-inprogress{ border-left: 4px solid var(--primary-mid); }
.cio-card-overdue   { border-left: 4px solid var(--red); background: #fff8f8; }
.cio-card-done      { border-left: 4px solid #9e9e9e; opacity: 0.8; }

.cio-card-info  { flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.3rem; }
.cio-card-title { font-weight: 600; font-size: 0.92rem; }
.cio-building   { font-weight: 400; color: var(--text-light); font-size: 0.85rem; margin-left: 0.35rem; }
.cio-card-person{ font-size: 0.85rem; color: var(--text-light); }
.cio-card-dates { font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.15rem; }
.cio-card-condition { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; flex-wrap: wrap; }
.cio-condition-notes { font-size: 0.8rem; color: var(--text-light); font-style: italic; margin-top: 0.15rem; }

.cio-stamp         { font-size: 0.75rem; font-weight: 600; margin-left: 0.4rem; }
.cio-stamp-done    { color: var(--green); }

.cio-condition-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: 10px;
}
.cio-cond-good    { background: #e8f5e9; color: #2e7d32; }
.cio-cond-issues  { background: #fff3e0; color: #e65100; }
.cio-cond-damaged { background: #ffebee; color: #c62828; }

.cio-keys       { font-size: 0.78rem; font-weight: 600; }
.cio-keys-ok    { color: var(--green); }
.cio-keys-no    { color: var(--red); }

.cio-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  padding-top: 0.1rem;
}

/* Formulaire checkout inline */
.cio-checkout-form {
  width: 100%;
  flex-basis: 100%;
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 0.3rem;
}
.cio-form-inner { display: flex; flex-direction: column; gap: 0.65rem; }
.cio-form-row   { display: flex; flex-direction: column; gap: 0.3rem; }
.cio-form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-light); }
.cio-radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cio-radio-group label { font-size: 0.85rem; display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.cio-notes-input { font-size: 0.85rem; }
.cio-form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.25rem; }

/* Badge check-in/out */
.cio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
}

.cio-empty {
  padding: 2rem 1.25rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.cio-past-section {
  margin: 0.5rem 1.25rem;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.cio-past-section summary {
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem 0;
}

[data-theme="dark"] .cio-card         { background: var(--surface); }
[data-theme="dark"] .cio-card-overdue { background: #1a0a0a; }
[data-theme="dark"] .cio-checkout-form{ background: #0e1c26; }
[data-theme="dark"] .cio-cond-good    { background: #0d2e15; color: #81c784; }
[data-theme="dark"] .cio-cond-issues  { background: #2e1a00; color: #ffb74d; }
[data-theme="dark"] .cio-cond-damaged { background: #2e0d0d; color: #ef9a9a; }

/* === Calendrier admin (timeline chambres) === */
.acal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem 0.75rem;
}
.acal-header h2 { font-size: 1.15rem; flex: 1 1 auto; }
.acal-nav { display: flex; gap: 0.4rem; }
.acal-range { font-size: 0.85rem; color: var(--text-light); white-space: nowrap; }

.acal-scroll-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 140px);
  padding: 0 1.25rem 1.25rem;
}

.acal-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: max-content;
}

/* En-tête */
.acal-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--gray-bg);
  border-bottom: 2px solid var(--gray-border);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.3rem 0;
  white-space: nowrap;
}
.acal-head-corner {
  position: sticky !important;
  left: 0;
  z-index: 30 !important;
  width: var(--label-w, 170px);
  min-width: var(--label-w, 170px);
}
.acal-day-head {
  width: var(--day-w, 46px);
  min-width: var(--day-w, 46px);
}
.acal-day-num  { display: block; font-size: 0.88rem; line-height: 1.2; }
.acal-day-name { display: block; font-size: 0.65rem; color: var(--text-light); text-transform: capitalize; }
.acal-today-head   { color: var(--primary); }
.acal-weekend-head { background: rgba(0,0,0,0.03); }

/* Lignes */
.acal-label-cell {
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--surface);
  width: var(--label-w, 170px);
  min-width: var(--label-w, 170px);
  max-width: var(--label-w, 170px);
  padding: 0 0.6rem;
  border-right: 2px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: var(--row-h, 36px);
  vertical-align: middle;
}
.acal-room-name { font-size: 0.82rem; font-weight: 500; }
.acal-room-status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
}
.acal-dot-blocked     { background: var(--orange); }
.acal-dot-maintenance { background: #9e9e9e; }

.acal-day-cell {
  width: var(--day-w, 46px);
  min-width: var(--day-w, 46px);
  height: var(--row-h, 36px);
  border-bottom: 1px solid var(--gray-border);
  border-right: 1px solid rgba(0,0,0,0.05);
  padding: 0;
  vertical-align: middle;
  position: relative;
}
.acal-day-cell.acal-today { background: rgba(43,106,135,0.12); }
.acal-day-cell.acal-weekend { background: rgba(0,0,0,0.025); }

/* Lignes spéciales */
.acal-building-row td {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  left: 0;
  z-index: 5;
}
.acal-floor-row td {
  background: var(--gray-bg);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 1rem;
  border-bottom: 1px solid var(--gray-border);
}
.acal-row-blocked     .acal-label-cell,
.acal-row-blocked     .acal-day-cell { background: #fff8f0; }
.acal-row-maintenance .acal-label-cell,
.acal-row-maintenance .acal-day-cell { background: #f7f7f7; }

/* Blocs de réservation */
.acal-res-block {
  position: absolute;
  top: 3px;
  left: 2px;
  height: calc(var(--row-h, 36px) - 6px);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
  transition: filter 0.15s;
}
.acal-res-block:hover { filter: brightness(0.92); }
.acal-res-approved {
  background: var(--primary);
  color: white;
}
.acal-res-pending {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #f57c00;
}
.acal-res-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Détail réservation (dans modal) */
.acal-detail-grid { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; }
.acal-detail-row  { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.88rem; }
.acal-detail-label { min-width: 100px; color: var(--text-light); font-size: 0.8rem; }

/* Dark mode */
[data-theme="dark"] .acal-table thead th    { background: #1e3347; }
[data-theme="dark"] .acal-label-cell        { background: #162736; }
[data-theme="dark"] .acal-building-row td   { background: #0c2030; color: #72C4C4; }
[data-theme="dark"] .acal-floor-row td      { background: #0e1c26; }
[data-theme="dark"] .acal-day-cell          { border-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .acal-today            { background: rgba(43,106,135,0.28) !important; }
[data-theme="dark"] .acal-weekend          { background: rgba(255,255,255,0.03) !important; }
[data-theme="dark"] .acal-row-blocked .acal-label-cell,
[data-theme="dark"] .acal-row-blocked .acal-day-cell   { background: #1e1500; }
[data-theme="dark"] .acal-row-maintenance .acal-label-cell,
[data-theme="dark"] .acal-row-maintenance .acal-day-cell { background: #131313; }
[data-theme="dark"] .acal-res-pending { background: #2a1800; color: #ffb74d; border-color: #f57c00; }

/* === Responsive === */
@media (max-width: 640px) {
  main { padding: 0.75rem; }
  #modal-box { padding: 1.25rem; }
  .cal-header { flex-direction: column; align-items: flex-start; }
  .res-card { flex-direction: column; }
  .res-card-actions { width: 100%; justify-content: flex-end; }
  .admin-res-card { flex-direction: column; }
  .room-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .res-form-dates { grid-template-columns: 1fr; }
  .building-header { flex-direction: column; align-items: flex-start; }
  .building-actions { width: 100%; }
  .floor-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  header { padding: 0 0.75rem; }
  .logo-img { height: 28px; }
}
