/* ── HOMS — Hotel Operations Management System ──────────────────────────── */
/* Industrial / Utilitarian HUD Aesthetic                                     */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Status colors — high contrast, colorblind-safe */
  --status-available:     #22c55e;
  --status-occupied:      #3b82f6;
  --status-dirty:         #f59e0b;
  --status-assigned:      #8b5cf6;
  --status-verify:        #06b6d4;
  --status-out-of-order:  #ef4444;
  --status-rush:          #ef4444;
  --status-dnd:           #f97316;

  /* UI chrome */
  --bg-primary:    #0a0f1a;
  --bg-secondary:  #111827;
  --bg-card:       #1e2a3a;
  --bg-card-hover: #263548;
  --bg-input:      #0f1824;
  --text-primary:  #e8edf5;
  --text-secondary:#7a8ba5;
  --text-muted:    #4a5a72;
  --border:        #2a3a50;
  --border-light:  #1e2e42;
  --accent:        #38bdf8;
  --accent-dim:    #1a6ea0;
  --danger:        #ef4444;
  --success:       #22c55e;
  --warning:       #f59e0b;

  /* Type */
  --font-display: 'JetBrains Mono', monospace;
  --font-body:    'IBM Plex Sans', -apple-system, sans-serif;

  /* Sizing */
  --radius: 6px;
  --radius-lg: 10px;
  --tap-min: 48px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  min-height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  overflow: hidden;
  gap: 0.5rem;
}

.topbar-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.topbar-brand span {
  color: var(--text-muted);
  font-weight: 400;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.topbar-user {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}

.topbar-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Notification Bell ───────────────────────────────────────────────────── */
.bell-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.15s;
}
.bell-btn:hover { border-color: var(--accent); color: var(--accent); }

.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}
.bell-badge:empty, .bell-badge[data-count="0"] { display: none; }

/* ── Building Tabs ───────────────────────────────────────────────────────── */
.building-tabs {
  display: flex;
  gap: 2px;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.building-tab {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}
.building-tab:hover { border-color: var(--text-muted); color: var(--text-primary); }
.building-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Sidebar / Nav ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 0.75rem 0;
  flex-shrink: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.12s;
  cursor: pointer;
  min-height: var(--tap-min);
  border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-card); }
.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(56, 189, 248, 0.05);
}
.sidebar-link .icon { font-size: 1rem; width: 20px; text-align: center; }

.main-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

/* ── Floor Summary Cards ─────────────────────────────────────────────────── */
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.floor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.floor-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.floor-card-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.floor-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.6rem;
}

.floor-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.floor-stat .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.floor-stat .count {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Room Tile Grid ──────────────────────────────────────────────────────── */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}

.room-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  min-height: 72px;
}
.room-tile:hover { transform: scale(1.04); filter: brightness(1.15); }

.room-tile.hatch-selected,
.hk-tile.hatch-selected {
  outline: 3px solid #22c55e;
}
.room-tile.hatch-selected::after,
.hk-tile.hatch-selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.35),
    rgba(255,255,255,0.35) 3px,
    transparent 3px,
    transparent 7px
  );
}

.room-tile[data-status="AVAILABLE"]        { background: var(--status-available); color: #052e16; }
.room-tile[data-status="OCCUPIED"]         { background: var(--status-occupied); color: #eef; }
.room-tile.room-departing-today        { background: #f97316; color: #fff; }
.room-tile[data-status="CHECKOUT_DIRTY"]    { background: var(--status-dirty); color: #422006; }
.room-tile[data-status="CLEANING_ASSIGNED"] { background: var(--status-assigned); color: #f5f3ff; }
.room-tile[data-status="VERIFY_CLEANING"]   { background: var(--status-verify); color: #042f2e; }
.room-tile[data-status="OUT_OF_ORDER"]       { background: var(--status-out-of-order); color: #fef2f2; }
.room-tile[data-status="INSPECTED"]          { background: #22c55e; color: #052e16; }

/* Designation overrides — CM classification reflected on FD tiles */
.room-tile[data-designation="DEPARTURE"]                              { background: #eab308; color: #422006; }
.room-tile[data-designation="DEPARTURE"][data-status="AVAILABLE"]      { background: #f97316; color: #431407; }
.room-tile[data-designation="DEPARTURE"][data-status="OCCUPIED"]       { background: #f97316; color: #431407; }
.room-tile[data-designation="DEPARTURE"][data-status="CLEANING_ASSIGNED"] { background: #f97316; color: #431407; }
.room-tile[data-designation="DEPARTURE"][data-status="INSPECTED"]      { background: #22c55e; color: #052e16; }
.room-tile[data-designation="STAYOVER"][data-status="INSPECTED"]       { background: #06b6d4; color: #042f2e; }
.room-tile[data-designation="STAYOVER"][data-acknowledged="true"]    { background: #06b6d4; color: #042f2e; }
.room-tile[data-designation="STAYOVER"]                               { background: #2563eb; color: #eef; }

.room-tile[data-rush="true"] .room-rush-badge { animation: pulse-rush-icon 1.2s ease-in-out infinite; }

.room-tile .room-number {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.room-tile .room-type-badge {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.room-rush-badge {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: #fff;
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.4;
  z-index: 3;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
}

.room-dnd-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1.2;
}

.room-occupied-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.3);
}

.room-select {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

@keyframes pulse-rush-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.8); }
  50%       { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}
@keyframes pulse-rework-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.9); }
  50%       { box-shadow: 0 0 0 5px rgba(234, 179, 8, 0); }
}

/* ── Status Legend ────────────────────────────────────────────────────────── */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ── Assignment Bar ──────────────────────────────────────────────────────── */
.assign-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 2px solid var(--accent);
  padding: 0.75rem 1.25rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 90;
  backdrop-filter: blur(12px);
}
.assign-bar.visible { display: flex; }

.assign-bar .count {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.assign-bar select, .assign-bar button {
  min-height: var(--tap-min);
}

/* ── Worker Todo Cards ───────────────────────────────────────────────────── */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 700px;
}

.todo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s;
}
.todo-card:hover { border-color: var(--text-muted); }

.todo-card.rush { border-left: 4px solid var(--status-rush); }
.todo-card.rework { border-left: 4px solid var(--warning); }

.todo-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.todo-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.todo-badge.rush { background: var(--danger); color: #fff; }
.todo-badge.rush::before,
.hk-badge-rush::before,
.room-rush-badge::before { content: '⏰ '; }
.todo-badge.rework { background: var(--warning); color: #422006; }

.todo-room {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.todo-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.todo-dnd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius);
  color: var(--status-dnd);
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.rework-reason {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.84rem;
  color: #7f1d1d;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── DND Toggle Switch ───────────────────────────────────────────────────── */
.dnd-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.dnd-toggle label { cursor: pointer; }

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-track.on { background: var(--status-dnd); border-color: var(--status-dnd); }
.toggle-track .toggle-thumb {
  width: 18px;
  height: 18px;
  background: var(--text-primary);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-track.on .toggle-thumb { transform: translateX(20px); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
  min-height: var(--tap-min);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c1a2a;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #052e16;
}
.btn-success:hover { filter: brightness(1.1); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #422006;
}
.btn-warning:hover { filter: brightness(1.1); }

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

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; min-height: 36px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  min-height: var(--tap-min);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a8ba5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2.5rem 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: 0.06em;
}

.login-subtitle {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* ── Modal box (inline-styled modals) ───────────────────────────────────── */
.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}


/* ── Tables ──────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.data-table tr:hover td { background: var(--bg-card); }

/* ── Section Header ──────────────────────────────────────────────────────── */
.section-header {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 72px;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  min-width: 260px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.25s ease-out;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }

  .topbar { padding: 0 0.75rem; }

  .main-content { padding: 0.75rem; }

  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 4px;
  }

  .room-tile { min-height: 60px; }
  .room-tile .room-number { font-size: 0.72rem; }

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

  /* Hamburger button (mobile only) */
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    order: -1;
  }

  /* Hide bottom nav completely */
  .mobile-nav { display: none !important; }

  /* Hamburger panel links */
  #hamburgerPanel .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
  }
  #hamburgerPanel .sidebar-link:hover,
  #hamburgerPanel .sidebar-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
  }

  /* Remove bottom padding that was for the old bottom nav */
  .main-content { padding-bottom: 1rem; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
  .hamburger-btn { display: none !important; }
  #hamburgerOverlay, #hamburgerPanel { display: none !important; }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-display); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Housekeeping View ───────────────────────────────────────────────────── */
.hk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.hk-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  text-align: center;
}
.hk-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.hk-stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}
.hk-section {
  margin-bottom: 1.5rem;
}
.hk-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hk-subsection-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.75rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hk-card.selected {
  border-color: var(--primary);
  background: #eff6ff;
}
.hk-card-checkbox {
  position: absolute;
  top: 6px;
  right: 6px;
  cursor: pointer;
  width: 14px;
  height: 14px;
}
.hk-assign-bar {
  display: none;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
}
.hk-assign-bar.visible { display: flex; }
.hk-verify-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

/* ── Housekeeping column layout ─────────────────────────────────────────── */
.hk-row-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.hk-cols {
  display: grid;
  gap: 0.75rem;
}
.hk-cols.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hk-cols.cols-2 { grid-template-columns: repeat(2, 1fr); }

.hk-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hk-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.hk-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hk-col-count {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.4rem;
  text-align: center;
  background: var(--bg);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.hk-col-body {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
}

.hk-col-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.25rem 0.1rem;
  margin: 0;
}

.col-stillin  .hk-col-head { background: #f1f5f9; }
.col-stillin  .hk-col-title { color: #64748b; }
.col-stillin  .hk-col-count { color: #475569; }

.col-unassigned .hk-col-head { background: #fffbeb; }
.col-unassigned .hk-col-title { color: #b45309; }
.col-unassigned .hk-col-count { color: #b45309; background: #fef3c7; }

.col-assigned .hk-col-head { background: #eff6ff; }
.col-assigned .hk-col-title { color: #1d4ed8; }
.col-assigned .hk-col-count { color: #1d4ed8; background: #dbeafe; }

@media (max-width: 768px) {
  .hk-cols.cols-3,
  .hk-cols.cols-2 { grid-template-columns: 1fr; }
  .hk-col-body { max-height: none; }
}

/* ── CleaningManager overview tiles ─────────────────────────────────────── */
.hk-tile {
  position: relative;
  border-radius: var(--radius);
  padding: 0.45rem 0.5rem 0.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 64px;
  transition: filter 0.12s, transform 0.1s;
  color: #fff;
  user-select: none;
}
.hk-tile:hover { filter: brightness(1.1); transform: translateY(-1px); }
.hk-tile .room-number { font-size: 0.95rem; font-weight: 700; line-height: 1; }
.hkt-label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.88;
}
.hk-tile .room-rush-badge {
  position: static;
  transform: none;
  font-size: 0.48rem;
  padding: 1px 5px;
  margin-top: 0.05rem;
}
.hkt-badge-row {
  display: flex;
  gap: 0.2rem;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 0.9rem;
  margin-top: 0.1rem;
}
.hkt-badge {
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.hkt-badge-dnd  { background: rgba(0,0,0,0.35); color: #fff; }
.hkt-badge-rush   { background: #dc2626; color: #fff; }
.hkt-badge-rework { background: #fbbf24; color: #000; border: 2px solid #000; }
.hkt-assignee {
  font-size: 0.62rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* colour variants */
.hkt-available       { background: #374151; border: 1px dashed #6b7280; }
.hkt-stayover        { background: #2563eb; }
.hkt-stayover-clean  { background: #06b6d4; }
.hkt-stillin    { background: #dc2626; }
.hkt-departing  { background: #d97706; }
.hkt-dirty      { background: #dc2626; }
.hkt-assigned   { background: #7c3aed; }
.hkt-verify     { background: #16a34a; }

/* ── HK Two-Zone Layout ─────────────────────────────────────────────────── */
.hk-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.75rem;
  user-select: none;
}
.hk-zone-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hk-zone-count {
  background: var(--surface-2);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  color: var(--text-secondary);
}
.hk-zone-chevron { font-size: 0.7rem; color: var(--text-muted); }
.hk-empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── hk-card2: compact colored row card ────────────────────────────────── */
.hk-card2-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.hk-card2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: default;
  transition: filter 0.1s, box-shadow 0.1s;
  color: #fff;
  border: none;
  width: auto;
  flex-shrink: 0;
}
.hk-card2.hk-selectable { cursor: pointer; }
.hk-card2.hk-selectable:hover { filter: brightness(1.12); }
.hk-card2.selected { box-shadow: 0 0 0 3px #fff inset; filter: brightness(1.08); }
.hk-card2 .hk-card-checkbox { flex-shrink: 0; accent-color: #fff; }
.hk-card2-num      { font-weight: 700; font-size: 0.88rem; font-family: var(--font-display); white-space: nowrap; }
.hk-card2-meta     { font-size: 0.7rem; opacity: 0.8; white-space: nowrap; }
.hk-card2-assignee { font-size: 0.72rem; opacity: 0.9; margin-left: auto; }

/* tile type colors — mirrors overview tab STATUS_COLORS */
.hk-type-stillin   { background: #dc2626; }   /* red    — Guest Still In */
.hk-type-departing { background: #f59e0b; }   /* amber  — CheckoutDirty  */
.hk-type-stayover  { background: #3b82f6; }   /* blue   — Occupied       */

/* status badge overlay (Verify / Rework) on colored tile */
.hk-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  background: rgba(255,255,255,0.25);
  color: #fff;
  white-space: nowrap;
}

/* rush icon on colored tile */
.hk-tag-rush-on-color {
  font-size: 0.75rem;
  margin-left: auto;
  opacity: 0.9;
  animation: pulse-rush-icon 1.2s ease-in-out infinite;
}

/* verify / reject inline buttons */
.hk-verify-btn, .hk-reject-btn {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.hk-verify-btn { background: rgba(255,255,255,0.25); color: #fff; }
.hk-verify-btn:hover { background: rgba(255,255,255,0.4); }
.hk-reject-btn { background: rgba(0,0,0,0.2); color: #fff; }
.hk-reject-btn:hover { background: rgba(0,0,0,0.35); }

/* ── Worker (Cleaner) tile view ─────────────────────────────────────────── */
.worker-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  min-height: 72px;
  user-select: none;
}
.worker-tile:hover { filter: brightness(1.12); transform: translateY(-1px); }
.worker-tile:active { filter: brightness(0.9); transform: scale(0.96); }
.worker-tile .room-number { font-size: 1.3rem; font-weight: 700; }
.worker-tile-floor { font-size: 0.62rem; opacity: 0.85; color: #fff; }
.hkt-badge-rush   { animation: pulse-rush-icon   1.2s ease-in-out infinite; }
.hkt-badge-rework { animation: pulse-rework-icon 1.2s ease-in-out infinite; }

/* Maintenance badge on FD room tiles */
.room-maint-badge {
  position: absolute;
  bottom: 2px;
  right: 3px;
  background: #d97706;
  color: #fff;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  z-index: 2;
}
.room-maint-badge.reviewed {
  background: #374151;
  color: #9ca3af;
  border-color: #4b5563;
}


/* ── End of Day Report ──────────────────────────────────────────────────── */
.eod-container { max-width: 800px; }
.eod-container h2 { margin: 0 0 4px; }
.eod-date { color: var(--text-muted); margin: 0 0 20px; }

.eod-status { padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.eod-status--done { background: #065f4620; border: 1px solid #065f46; color: #6ee7b7; }
.eod-status .icon { font-size: 1.3rem; }

.eod-preflight { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 24px; }
.eod-preflight h3 { margin: 0 0 16px; }

.eod-stats { display: flex; gap: 20px; margin-bottom: 16px; }
.eod-stat { text-align: center; padding: 12px 20px; background: var(--bg); border-radius: 8px; min-width: 90px; }
.eod-stat-value { display: block; font-size: 1.6rem; font-weight: 700; }
.eod-stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.eod-stat--warn .eod-stat-value { color: #f59e0b; }

.eod-warning { background: #78350f30; border: 1px solid #d97706; color: #fbbf24; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.9rem; }
.eod-info { background: #1e3a5f40; border: 1px solid #3b82f6; color: #93c5fd; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.9rem; }

.eod-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 0.88rem; }
.eod-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.eod-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.eod-table--compact { font-size: 0.82rem; }
.eod-table--compact th, .eod-table--compact td { padding: 5px 8px; }

.eod-row-dnd { opacity: 0.55; }

.eod-history { margin-top: 28px; }
.eod-history h3 { margin: 0 0 12px; }

.eod-worker-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.eod-worker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.eod-worker-hours { font-size: 1.1rem; font-weight: 700; color: #60a5fa; }
.eod-worker-stats { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }

.badge--dnd { background: #92400e; color: #fbbf24; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge--verified { background: #065f46; color: #6ee7b7; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge--completed { background: #1e40af; color: #93c5fd; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge--assigned { background: #374151; color: #d1d5db; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge--rework { background: #7f1d1d; color: #fca5a5; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge--unassigned { background: #4b5563; color: #9ca3af; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }

.btn-warning { background: #d97706; color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-warning:hover { background: #b45309; }
.btn-sm { padding: 4px 12px; font-size: 0.82rem; }

/* ── Activity Log ───────────────────────────────────────────────────────── */
.activity-item { display:flex; align-items:center; justify-content:space-between; padding:0.65rem 0.85rem; border-bottom:1px solid var(--border); gap:0.75rem; }
.activity-item.activity-expired { opacity:0.45; }
.activity-body { display:flex; align-items:center; flex-wrap:wrap; gap:0.3rem; flex:1; min-width:0; }
.activity-desc { font-size:0.85rem; color:var(--text-primary); }
.activity-time { font-size:0.72rem; color:var(--text-muted); white-space:nowrap; }
.activity-no-undo { font-size:0.7rem; color:var(--text-muted); white-space:nowrap; }

/* ── Slide to Confirm ───────────────────────────────────────────────────── */
.slide-track {
  position: relative;
  width: 100%;
  height: 48px;
  background: #065f46;
  border-radius: 24px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.slide-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 24px;
  background: rgba(34, 197, 94, 0.3);
  border-radius: 24px;
  pointer-events: none;
  z-index: 1;
}
.slide-track-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
  transition: opacity 0.15s;
}
.slide-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #065f46;
  cursor: grab;
  transition: left 0.15s ease-out, background 0.15s;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.slide-thumb.dragging { cursor: grabbing; transition: none; }
.slide-track.confirmed { background: #22c55e; }
.slide-track.confirmed .slide-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 24px;
  background: rgba(34, 197, 94, 0.3);
  border-radius: 24px;
  pointer-events: none;
  z-index: 1;
}
.slide-track-label { opacity: 0; }
.slide-track.confirmed .slide-thumb { background: #fff; color: #22c55e; }

/* Worker page activity button */
.worker-activity-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.worker-activity-btn:hover { background: var(--border); }

/* ── Issue badge pulse ──────────────────────────────────────────────────── */
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hkt-badge-issue { animation: badge-pulse 1.5s ease-in-out infinite; }

/* ── Arriving today badge ───────────────────────────────────────────────── */
.room-arriving-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1.3;
  pointer-events: none;
  z-index: 1;
}

/* EOD cleaned-rooms type badges */
.eod-type-badge{display:inline-block;padding:0.15rem 0.5rem;border-radius:0.25rem;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;}
.eod-type-departure{background:#dc2626;color:#fff;}
.eod-type-stayover{background:#0ea5e9;color:#fff;}

/* ── UI Scale overflow protection ──────────────────────────────────────── */
.room-tile, .hk-tile, .worker-tile {
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-tile .room-number, .hk-tile .room-number, .worker-tile .room-number {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.room-tile .room-type-badge, .hkt-label, .hkt-assignee {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.hkt-badge {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar, .sidebar, .section-header, .modal {
  overflow-wrap: break-word;
  word-break: break-word;
}
.room-grid {
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)) !important;
}
.data-table th, .data-table td {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Smooth view transitions ──────────────────────────────────────────── */
.main-content, .todo-list {
  transition: opacity 0.15s ease;
}
.view-fading {
  opacity: 0;
}
