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

:root {
  --primary: #4A90D9;
  --primary-dark: #2c6fad;
  --sidebar-bg: #1e2740;
  --sidebar-text: #c8d0e7;
  --sidebar-hover: #2d3a5f;
  --sidebar-active: #4A90D9;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #2d3748;
  --text-muted: #718096;
  --danger: #e53e3e;
  --success: #38a169;
  --warning: #dd6b20;
  --pending: #805ad5;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }

.screen { min-height: 100vh; }

/* AUTH */
#auth-screen {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e2740 0%, #2c6fad 100%);
  padding: 20px;
}
.auth-container {
  background: var(--card-bg); border-radius: 16px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.logo-icon { font-size: 48px; margin-bottom: 10px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; }
.auth-logo h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 4px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 8px; border: none; background: none; border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-muted); transition: all 0.2s;
}
.auth-tab.active { background: white; color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

/* APP LAYOUT */
#app-screen { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; flex-shrink: 0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}
.sidebar-header {
  padding: 20px 16px; font-size: 16px; font-weight: 700; color: white;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon-sm { font-size: 22px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 5px; flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--sidebar-text); transition: all 0.2s; margin-bottom: 2px;
  text-decoration: none; user-select: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-divider { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #5a6787; padding: 16px 12px 6px; }
.nav-icon { font-size: 16px; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-info { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.user-avatar { font-size: 18px; }
.btn-logout {
  width: 100%; padding: 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
  background: transparent; color: var(--sidebar-text); cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: white; }

.main-content { flex: 1; overflow-y: auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 22px; font-weight: 700; }

/* WEEK NAV */
.week-nav { display: flex; align-items: center; gap: 8px; }
#week-label { font-size: 15px; font-weight: 600; min-width: 200px; text-align: center; }
.room-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.room-filter select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 14px; }

/* CALENDAR */
.calendar-container { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.calendar-grid { display: grid; min-width: 700px; }
.cal-header-row { display: contents; }
.cal-time-col { width: 60px; }
.cal-day-header {
  padding: 10px 4px; text-align: center; font-weight: 600; font-size: 13px;
  border-bottom: 2px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10;
  border-right: 1px solid var(--border);
}
.cal-day-header.today { color: var(--primary); }
.cal-day-header.today span.day-num { background: var(--primary); color: white; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.cal-body { display: grid; }
.cal-time-cell {
  font-size: 11px; color: var(--text-muted); text-align: right; padding: 0 6px;
  height: 30px; display: flex; align-items: center; justify-content: flex-end;
  border-right: 1px solid var(--border);
}
.cal-slot {
  height: 30px; border-bottom: 1px solid #f0f2f8; border-right: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s; position: relative;
}
.cal-slot:hover { background: #EBF4FF !important; }
.cal-slot:active { background: #d0e8fb !important; }
/* Suppress browser long-press callout/selection on touch devices */
.cal-slot, .cal-time-cell {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* !important needed: cells have inline background from cssText that would otherwise win */
.cal-slot.selecting { background: #BFD9F7 !important; }
.booking-block {
  position: absolute; left: 2px; right: 2px; border-radius: 5px; padding: 3px 6px;
  font-size: 11px; font-weight: 500; cursor: pointer; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); z-index: 5; transition: filter 0.15s;
  color: white; line-height: 1.3;
}
.booking-block:hover { filter: brightness(0.9); }
.booking-block.pending { opacity: 0.7; border-left: 3px solid rgba(0,0,0,0.3); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--card-bg); color: var(--text); transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-group textarea { resize: vertical; }
.booking-form-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

/* BUTTONS */
.btn-primary {
  background: var(--primary); color: white; border: none; padding: 9px 18px;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent; color: var(--text); border: 1.5px solid var(--border); padding: 9px 18px;
  border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; border: none; padding: 7px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.btn-success { background: var(--success); color: white; border: none; padding: 7px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; border: none; cursor: pointer; font-weight: 500; }
.btn-icon { background: none; border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; }
.btn-icon:hover { background: var(--bg); }
.full-width { width: 100%; }

.error-msg { color: var(--danger); font-size: 13px; padding: 8px 12px; background: #fff5f5; border-radius: 6px; margin-bottom: 10px; }
.success-msg { color: var(--success); font-size: 13px; padding: 8px 12px; background: #f0fff4; border-radius: 6px; margin-bottom: 10px; }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content { background: white; border-radius: 14px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; position: relative; z-index: 1; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-content.large { max-width: 700px; }
.modal-content.xlarge { max-width: 860px; }
.modal-tab-bar { display: flex; border-bottom: 2px solid #e2e8f0; background: #f8fafc; border-radius: 14px 14px 0 0; overflow: hidden; }
.modal-tab-btn { flex: 1; padding: 13px 8px; font-size: 13px; font-weight: 600; color: #718096; background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; transition: all 0.15s; letter-spacing: .01em; }
.modal-tab-btn:hover { background: #edf2f7; color: #2d3748; }
.modal-tab-btn.active { color: #4A90D9; border-bottom-color: #4A90D9; background: white; }
.modal-tab-btn:disabled { color: #cbd5e0; cursor: not-allowed; }
.modal-tab-pane { display: none; }
.modal-tab-pane.active { display: block; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* BOOKINGS LIST */
.bookings-list { display: flex; flex-direction: column; gap: 12px; }
.booking-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-left: 4px solid transparent;
}
/* Status-coloured left border for quick visual scanning */
.booking-card:has(.status-approved) { border-left-color: #48BB78; }
.booking-card:has(.status-pending)  { border-left-color: #9B72CF; }
.booking-card:has(.status-rejected) { border-left-color: #FC8181; }
.booking-card:has(.status-cancelled){ border-left-color: #CBD5E0; }
.booking-card-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.booking-card-info p { font-size: 13px; color: var(--text-muted); }
.booking-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.status-pending { background: #F3E8FF; color: var(--pending); }
.status-approved { background: #F0FFF4; color: var(--success); }
.status-rejected { background: #FFF5F5; color: var(--danger); }
.status-cancelled { background: #EDF2F7; color: var(--text-muted); }

/* ADMIN LIST */
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.admin-card-info { flex: 1; min-width: 0; }
.admin-card-info h4 { font-size: 14px; font-weight: 600; }
.admin-card-info p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.admin-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Intermediate widths (sidebar visible but not enough room for card info + many buttons) ── */
/* At widths where the sidebar is still shown (~769 – 1050px) the info + actions
   row can overflow when there are 4+ action buttons.  Wrapping the card at this
   breakpoint mirrors the ≤768px behaviour without hiding the sidebar. */
@media (max-width: 1050px) and (min-width: 769px) {
  .admin-card { flex-wrap: wrap; }
  .admin-card-actions { flex-wrap: wrap; width: 100%; }
}

/* QUESTION FORM IN MODAL */
.question-field { padding: 14px; background: var(--bg); border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); }
.question-field label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 10px; }
.question-field .required-mark { color: var(--danger); }
.yn-buttons { display: flex; gap: 8px; }
.yn-btn { padding: 8px 20px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; background: white; font-weight: 500; transition: all 0.2s; }
.yn-btn.selected { border-color: var(--primary); background: var(--primary); color: white; }
.checkbox-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.checkbox-option input { width: 16px; height: 16px; cursor: pointer; }

/* Mobile-only elements (hidden on desktop, shown via media query) */
.mobile-only { display: none; }
.mobile-book-btn { display: none; }

/* ROOM DOT */
.room-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; }

/* Detail modal */
.detail-section { margin-bottom: 16px; }
.detail-section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.detail-row { display: flex; gap: 12px; margin-bottom: 8px; }
.detail-label { font-size: 13px; color: var(--text-muted); min-width: 120px; }
.detail-value { font-size: 14px; font-weight: 500; }

/* MOBILE TOP BAR + HAMBURGER */
.mobile-topbar { display: none; }

.hamburger-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.hamburger-btn span {
  display: block; width: 24px; height: 2px;
  background: white; border-radius: 2px; transition: all 0.2s;
}

/* NAV DRAWER */
.mobile-nav-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 900;
}
.mobile-nav-drawer {
  position: fixed; top: 0; left: -280px; bottom: 0; width: 280px;
  background: var(--sidebar-bg); z-index: 901;
  display: flex; flex-direction: column;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
.mobile-nav-drawer.open { left: 0; }
.mobile-nav-backdrop.open { display: block; }
.mobile-nav-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-nav-drawer-body { flex: 1; overflow-y: auto; padding: 10px 8px; }
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--sidebar-text);
  cursor: pointer; margin-bottom: 2px; transition: background 0.15s;
}
.drawer-item:hover { background: var(--sidebar-hover); color: white; }
.drawer-item.active { background: var(--primary); color: white; }
.drawer-item-danger { color: #fc8181; }
.drawer-item-danger:hover { background: rgba(229,62,62,0.15); color: #fc8181; }
.drawer-divider {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #5a6787; padding: 14px 14px 6px;
}

/* CLEARABLE INPUT */
.clearable-wrap { position: relative; display: inline-flex; align-items: center; }
.clearable-wrap input { padding-right: 26px !important; }
.clearable-wrap .clear-btn {
  position: absolute; right: 6px;
  width: 16px; height: 16px;
  display: none; align-items: center; justify-content: center;
  background: transparent; color: #e53e3e;
  border: 1.5px solid #e53e3e; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1; padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.clearable-wrap .clear-btn:hover { background: #e53e3e; color: #fff; }
.clearable-wrap input:not(:placeholder-shown) ~ .clear-btn { display: flex; }

/* ═══════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE OVERRIDES
   Breakpoints: ≤ 768px (mobile), ≤ 480px (small)
═══════════════════════════════════════════════════ */

/* ── Mobile layout: top bar + slide-in drawer ─── */
@media (max-width: 768px) {
  /* Show mobile top bar */
  .mobile-topbar {
    display: block; background: var(--sidebar-bg);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); order: 0;
  }
  .mobile-topbar-inner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; height: 52px;
  }

  /* App layout */
  #app-screen { flex-direction: column; height: 100dvh; }

  /* Sidebar: hidden on mobile (replaced by drawer) */
  .sidebar { display: none; }

  /* Main content fills full height below top bar */
  .main-content { flex: 1; overflow-y: auto; padding: 14px; order: 1; min-height: 0; }
  /* App layout: vertical stack */
  #app-screen { flex-direction: column; height: 100dvh; }



  /* Page header: stack vertically */
  .page-header {
    flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  }
  .page-header h2 { font-size: 19px; }
  .page-header > div { width: 100%; }

  /* Filter rows: wrap and stretch inputs */
  .page-header > div[style*="display:flex"],
  .page-header > div { flex-wrap: wrap !important; }
  .clearable-wrap { flex: 1 1 140px; }
  .clearable-wrap input { width: 100% !important; min-width: 0; }

  /* Cards: stack on mobile */
  .admin-card {
    flex-direction: column; align-items: flex-start; gap: 10px;
  }
  .admin-card-actions { flex-wrap: wrap; width: 100%; }
  .booking-card { flex-direction: column; align-items: flex-start; }
  .booking-card-actions { flex-wrap: wrap; }

  /* Booking form: single column (already default, kept for clarity) */

  /* Modals: full-height bottom sheet */
  .modal { align-items: flex-end; padding: 0; }
  .modal-content {
    border-radius: 18px 18px 0 0;
    max-width: 100%; width: 100%;
    max-height: 92dvh;
  }
  .modal-header { padding: 16px 20px 12px; }
  .modal-body   { padding: 16px 20px; }
  .modal-footer { padding: 12px 20px; }

  /* Bigger touch targets */
  .btn-primary, .btn-outline { padding: 11px 16px; }
  .btn-sm { padding: 8px 12px; font-size: 13px; }
  input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom */

  /* Calendar: allow horizontal scroll */
  .calendar-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Mobile Book toggle button */
  .mobile-book-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
    border: 2px solid var(--primary); color: var(--primary);
    background: white; cursor: pointer; white-space: nowrap;
    transition: all 0.15s;
  }
  .mobile-book-btn.active {
    background: var(--danger); border-color: var(--danger); color: white;
  }

  /* Week nav: compact */
  .week-nav { gap: 4px; }
  #week-label { min-width: 0; font-size: 13px; }
  .room-filter { flex-wrap: wrap; width: 100%; }
  .room-filter select { flex: 1; }

  /* Auth: tighter padding */
  .auth-container { padding: 28px 20px; }

  /* Config form rows: stack */
  .form-group > div[style*="display:flex"] { flex-direction: column; }
}

/* ── Extra-small phones ─────────────────────────── */
@media (max-width: 480px) {
  .main-content { padding: 10px; }
  .page-header h2 { font-size: 17px; }
  .modal-content { max-height: 95dvh; }
  .booking-card-info h4 { font-size: 14px; }
}

/* ══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS  (suggestion #2)
   Fixed bottom-right container; individual toasts slide up and fade out.
   ══════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 10px; min-width: 260px; max-width: 380px;
  font-size: 14px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: auto;
  animation: toastIn 0.25s ease forwards;
  color: white;
}
.toast.toast-success { background: #276749; }
.toast.toast-error   { background: #c53030; }
.toast.toast-info    { background: #2b6cb0; }
.toast.toast-warning { background: #92400e; }
.toast.toast-out     { animation: toastOut 0.3s ease forwards; }
.toast-icon   { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body   { flex: 1; }
.toast-close  {
  background: none; border: none; color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 0; flex-shrink: 0;
}
.toast-close:hover { color: white; }
@keyframes toastIn  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0);    } to { opacity:0; transform:translateY(-8px); } }

/* ══════════════════════════════════════════════════════════════════════
   LOADING SKELETONS  (suggestion #1)
   ══════════════════════════════════════════════════════════════════════ */
.skeleton-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.skeleton-line {
  height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f0f4fa 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.wide  { width: 75%; }
.skeleton-line.short { width: 42%; }
.skeleton-line.xshort{ width: 28%; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ══════════════════════════════════════════════════════════════════════
   TODAY COLUMN HIGHLIGHT  (suggestion #3)
   Applied as a CSS class to cells in the today column so it survives
   inline style overwrites from the selection highlight.
   ══════════════════════════════════════════════════════════════════════ */
.cal-today-cell { background-color: rgba(74,144,217,0.045) !important; }
.cal-today-header { color: var(--primary) !important; background: #f0f6ff !important; }

/* ══════════════════════════════════════════════════════════════════════
   BOOKING CONFLICT PREVIEW  (suggestion #4)
   ══════════════════════════════════════════════════════════════════════ */
#bm-conflict-warning {
  display: none;
  margin: -4px 0 12px;
  padding: 9px 13px;
  background: #FFFBEB;
  border: 1px solid #F6AD55;
  border-radius: 8px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.45;
}
#bm-conflict-warning.has-conflict { display: block; }

/* ══════════════════════════════════════════════════════════════════════
   CONFIRM DIALOG  (suggestion #6)
   ══════════════════════════════════════════════════════════════════════ */
#confirm-dialog .modal-content { max-width: 400px; }
#confirm-dialog-message { font-size: 15px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }

/* ══════════════════════════════════════════════════════════════════════
   FOCUS TRAP / ACCESSIBLE MODALS  (suggestion #7)
   Visible focus ring only for keyboard users.
   ══════════════════════════════════════════════════════════════════════ */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.modal-content:focus { outline: none; }

@media (max-width: 768px) {
  #toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: 100%; }
}

/* ── User-pick widget (Approvers + Responsible in room modal) ── */
.user-pick-widget { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.user-pick-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.user-pick-search input {
  flex: 1; border: none; background: transparent; font-size: 13px; outline: none; color: #2d3748;
}
.user-pick-search input::placeholder { color: #a0aec0; }
.user-pick-search-icon { color: #a0aec0; font-size: 13px; flex-shrink: 0; }
.user-pick-list { max-height: 160px; overflow-y: auto; }
.user-pick-section-hdr {
  font-size: 10px; font-weight: 700; color: #a0aec0; text-transform: uppercase;
  letter-spacing: .06em; padding: 6px 12px 3px; background: #fafbfc;
  border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 1;
}
.user-pick-row {
  display: flex; align-items: center; gap: 0; padding: 7px 14px;
  border-bottom: 1px solid #f8f8f8; cursor: pointer; transition: background .1s;
}
.user-pick-row input[type=checkbox] { flex-shrink: 0; margin: 0 10px 0 0; width: 15px; height: 15px; }
.user-pick-row:last-child { border-bottom: none; }
.user-pick-row:hover { background: #f0f6ff; }
.user-pick-row input[type=checkbox] { width: 15px; height: 15px; flex-shrink: 0; accent-color: #4A90D9; cursor: pointer; }
.user-pick-row .upw-name { font-size: 13px; font-weight: 500; color: #2d3748; }
.user-pick-row .upw-email { font-size: 11px; color: #a0aec0; margin-left: 4px; }
.user-pick-empty { padding: 14px 12px; font-size: 13px; color: #a0aec0; text-align: center; }
.user-pick-summary { padding: 5px 12px; font-size: 11px; color: #718096; background: #f8fafc; border-top: 1px solid #e2e8f0; }

/* ── Password toggle eye button ── */
/* ── Title autocomplete dropdown ── */
.title-autocomplete-wrap { position: relative; }
.title-suggestions {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0;
  background: white; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 200;
  max-height: 220px; overflow-y: auto;
}
.title-suggestion-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; cursor: pointer; transition: background 0.1s;
}
.title-suggestion-item:hover { background: #EBF4FF; }
.title-suggestion-text { flex: 1; font-size: 13px; color: #2d3748; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-suggestion-delete {
  flex-shrink: 0; background: none; border: none; color: #a0aec0;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
  border-radius: 4px; transition: color 0.1s, background 0.1s;
}
.title-suggestion-delete:hover { color: #e53e3e; background: #FFF5F5; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; width: 100%; box-sizing: border-box; }
.pw-toggle {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: #a0aec0; font-size: 16px; line-height: 1; user-select: none;
}
.pw-toggle:hover { color: #4A90D9; }

/* ── Pin button on public resource cards ── */
.pin-btn { font-size: 14px; padding: 5px 10px; line-height: 1; }
.pin-btn.pinned { color: #4A90D9; border-color: #4A90D9; background: #EBF4FF; }
