/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-300: #93C5FD;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --green-50: #F0FDF4;
  --green-100: #DCFCE7;
  --green-500: #22C55E;
  --green-600: #16A34A;
  --green-700: #15803D;
  --red-50: #FEF2F2;
  --red-100: #FEE2E2;
  --red-200: #FECACA;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --red-700: #B91C1C;
  --amber-100: #FEF3C7;
  --amber-500: #F59E0B;
  --purple-50: #F5F3FF;
  --purple-100: #EDE9FE;
  --purple-500: #8B5CF6;
  --purple-700: #6D28D9;
  --bg: #F1F5F9;
  --card-bg: #FFFFFF;
  --surface: #F8FAFC;
  --surface-hover: #F1F5F9;
  --border: #E2E8F0;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
  --transition: 150ms ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text-primary);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.btn:hover { background: var(--surface-hover); border-color: var(--gray-300); }
.btn-primary { background: var(--blue-600); color: white; border-color: var(--blue-600); }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-danger { background: var(--red-500); color: white; border-color: var(--red-500); }
.btn-danger:hover { background: var(--red-600); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; width: 100%; justify-content: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: var(--radius);
  background: transparent; color: var(--gray-500); cursor: pointer;
  transition: all var(--transition); font-size: 20px;
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }

/* View toggle pills */
.view-toggle { display: flex; gap: 2px; background: var(--surface); border-radius: var(--radius); padding: 2px; }
.view-toggle-btn {
  padding: 5px 14px; border: none; border-radius: 6px;
  background: transparent; color: var(--gray-500); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all var(--transition);
}
.view-toggle-btn:hover { color: var(--gray-700); }
.view-toggle-btn.active { background: var(--card-bg); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ===== INPUTS ===== */
input[type="text"], input[type="password"], input[type="time"], input[type="date"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  color: var(--text-primary); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
textarea { resize: vertical; }

/* ===== SETUP VIEW ===== */
.setup-card, .pin-card {
  max-width: 520px; margin: 80px auto; padding: 40px;
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); text-align: center;
}
.setup-logo { margin-bottom: 20px; }
.setup-card h1, .pin-card h2 { margin-bottom: 8px; font-size: 24px; font-weight: 700; }
.setup-subtitle { color: var(--gray-500); margin-bottom: 32px; }
.setup-step {
  display: flex; gap: 16px; text-align: left;
  padding: 20px 0; border-top: 1px solid var(--gray-100);
}
.step-number {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-100); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.step-content { flex: 1; }
.step-content h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.step-content p { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.step-content a { color: var(--blue-600); }
.step-content textarea { min-height: 120px; font-family: 'Courier New', monospace; font-size: 12px; }
#setup-save-btn { margin-top: 24px; }
.pin-card input { margin: 16px 0; text-align: center; font-size: 24px; letter-spacing: 8px; }
.pin-card button { width: 100%; justify-content: center; }
.error-text { color: var(--red-500); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ===== TOP BAR ===== */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 12px; }
.top-bar-center { display: flex; align-items: center; gap: 8px; }
.app-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--gray-800);
}
.title-icon { width: 28px; height: 28px; }
.date-display { font-size: 14px; color: var(--gray-500); font-weight: 500; }

/* Floor tabs */
.floor-tabs { display: flex; gap: 4px; }
.floor-tab {
  padding: 6px 16px; border-radius: 20px; border: none;
  background: transparent; color: var(--gray-500);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.floor-tab:hover { background: var(--gray-100); color: var(--gray-700); }
.floor-tab.active { background: var(--blue-100); color: var(--blue-700); font-weight: 600; }

/* Date nav */
.date-picker-btn {
  border: none; background: transparent; font-size: 15px;
  font-weight: 600; color: var(--gray-800); cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius);
}
.date-picker-btn:hover { background: var(--gray-100); }
.room-title { font-size: 18px; font-weight: 700; }
.back-btn { margin-right: 4px; }

/* ===== VIEW TRANSITIONS ===== */
.view-container {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.view-fade-out {
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
}
.view-fade-in {
  opacity: 0; transform: translateY(-8px);
}
.view-fade-in.view-active {
  opacity: 1; transform: translateY(0);
}

/* ===== ROOM GRID ===== */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; padding: 20px 24px;
}
.room-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 0; cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
}
.room-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.room-card.occupied { border-color: var(--red-500); background: var(--red-50); }
.room-card.occupied:hover { border-color: var(--red-600); }
.room-card.upcoming { border-color: var(--green-700); background: var(--green-100); }
.room-card.upcoming:hover { border-color: #14532d; }
.room-card.available { border-color: var(--green-500); background: var(--green-50); }
.room-card.available:hover { border-color: var(--green-600); }

.room-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
}
.room-card-name {
  font-size: 14px; font-weight: 600; color: var(--gray-800);
}
.room-card-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 10px;
}
.status-occupied { background: var(--red-100); color: var(--red-700); }
.status-upcoming { background: var(--green-700); color: white; }
.status-available { background: var(--green-100); color: var(--green-600); }

.room-card-occupant {
  padding: 0 14px 6px; font-size: 12px; color: var(--red-700);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 20px;
}

/* Mini timeline in room card */
.mini-timeline {
  height: 32px; margin: 2px 14px 12px;
  background: var(--surface); border-radius: 4px;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.mini-block {
  position: absolute; top: 2px; bottom: 2px;
  background: var(--blue-300); border-radius: 3px;
  opacity: 0.7;
}
.mini-block.future { background: var(--blue-500); opacity: 0.9; }
.mini-block.current { background: var(--blue-600); opacity: 1; box-shadow: 0 0 0 1px var(--blue-700); }

/* ===== DAY SPLIT LAYOUT ===== */
.day-split-layout {
  display: flex; height: calc(100vh - 61px);
}
.day-split-calendar {
  flex: 1; overflow-y: auto; position: relative;
  border-right: 1px solid var(--border);
}
.day-split-panel {
  width: 340px; flex-shrink: 0; overflow-y: auto;
  background: var(--card-bg); padding: 20px;
  display: flex; flex-direction: column;
}
.day-split-panel h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
  color: var(--gray-800);
}
.day-split-panel .form-group { margin-bottom: 12px; }
.day-split-panel .form-row { margin-bottom: 0; }
.day-split-panel .btn-primary.btn-lg { margin-top: auto; }

@media (max-width: 768px) {
  .day-split-layout { flex-direction: column; }
  .day-split-calendar { flex: 1; border-right: none; border-bottom: 1px solid var(--gray-200); }
  .day-split-panel { width: 100%; height: 50%; }
}

/* ===== WEEK VIEW ===== */
.calendar-container {
  height: calc(100vh - 61px); overflow-y: auto;
  position: relative;
}

/* Week grid */
.week-view {
  display: flex; flex-direction: column; height: 100%;
}
.week-header {
  display: grid; grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg); position: sticky; top: 0; z-index: 10;
}
.week-header-cell {
  padding: 10px 4px; text-align: center;
  font-size: 12px; font-weight: 500; color: var(--gray-500);
  border-left: 1px solid var(--gray-100);
  cursor: pointer; transition: background var(--transition);
}
.week-header-cell:hover { background: var(--gray-50, #f8fafc); }
.week-header-cell .day-num {
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--gray-800);
  margin: 4px auto 0; width: 36px; height: 36px;
}
.week-header-cell.today .day-num {
  background: var(--blue-600); color: white;
  border-radius: 50%; font-size: 15px;
}
.week-header-corner { padding: 10px 4px; }

.week-body {
  display: grid; grid-template-columns: 60px repeat(7, 1fr);
  flex: 1; overflow-y: auto; position: relative;
  max-height: calc(100vh - 120px);
}
.week-time-col {
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.week-time-label {
  height: 60px; display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 0 6px; font-size: 10px; color: var(--gray-400); font-weight: 500;
  transform: translateY(-6px);
}
.week-day-col {
  position: relative; border-left: 1px solid var(--gray-100);
  min-height: calc(60px * 24); cursor: pointer;
}
.week-hour-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--gray-200);
  z-index: 1;
}

/* Week event blocks */
.week-event {
  position: absolute; left: 2px; right: 2px;
  border-radius: 4px; padding: 2px 4px;
  cursor: pointer; overflow: hidden;
  font-size: 11px; line-height: 1.3;
  transition: all var(--transition);
  z-index: 5;
  background: var(--blue-100); border-left: 3px solid var(--blue-500);
  color: var(--gray-800);
}
.week-event:hover { box-shadow: var(--shadow); z-index: 6; filter: brightness(0.95); }
.week-event.recurring { background: rgba(22, 163, 74, 0.2); border-left-color: #16a34a; }
.week-event-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-event-time { font-size: 10px; color: var(--gray-500); }

/* ===== MONTH VIEW ===== */
.month-view { padding: 16px 24px; }
.month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.month-header-cell {
  background: var(--surface); padding: 8px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.month-day {
  background: var(--card-bg); min-height: 90px; padding: 6px;
  cursor: pointer; transition: background var(--transition);
}
.month-day:hover { background: var(--surface-hover); }
.month-day.other-month { background: var(--surface); }
.month-day.other-month .month-day-num { color: var(--gray-300); }
.month-day.today { background: var(--blue-50); }
.month-day-num {
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 4px;
}
.month-day.today .month-day-num {
  background: var(--blue-600); color: white;
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.month-event-pip {
  display: block; padding: 1px 4px; margin-bottom: 2px;
  font-size: 10px; font-weight: 500; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.month-event-pip.booking { background: var(--blue-100); color: var(--blue-700); }
.month-event-pip.recurring { background: rgba(22, 163, 74, 0.25); color: #4ade80; }
.month-event-more {
  font-size: 10px; color: var(--gray-400); padding: 0 4px;
}

/* ===== DAY VIEW (used within week for single-day drill-down) ===== */
.day-view {
  display: flex; height: 100%;
}
.time-column {
  width: 60px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.time-label {
  height: 60px; display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 0 6px; font-size: 10px; color: var(--gray-400); font-weight: 500;
  transform: translateY(-6px);
}
.events-column {
  flex: 1; position: relative; min-height: calc(60px * 24);
  cursor: crosshair;
}
.hour-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--gray-200);
  z-index: 1;
}

/* Day event blocks */
.event-block {
  position: absolute; left: 4px; right: 4px;
  background: var(--blue-100); border-left: 3px solid var(--blue-500);
  border-radius: 4px; padding: 4px 8px;
  cursor: pointer; overflow: hidden;
  transition: all var(--transition);
  z-index: 5;
}
.event-block:hover { box-shadow: var(--shadow); z-index: 6; }
.event-block.recurring {
  background: rgba(22, 163, 74, 0.2); border-left-color: #16a34a;
}
.event-title {
  font-size: 12px; font-weight: 600; color: var(--gray-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-time {
  font-size: 10px; color: var(--gray-500); margin-top: 1px;
}
.event-details {
  font-size: 11px; color: var(--gray-500); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Drag-to-create preview block */
.drag-create-preview {
  position: absolute; left: 4px; right: 4px;
  background: var(--blue-100); border-left: 3px solid var(--blue-500);
  border-radius: 4px; opacity: 0.7;
  pointer-events: none; z-index: 8;
  display: flex; align-items: flex-start; padding: 4px 8px;
  font-size: 12px; color: var(--gray-500); font-weight: 500;
}
/* Quick-add title input on newly created block */
.quick-add-block {
  position: absolute; left: 4px; right: 4px;
  background: var(--blue-100); border-left: 3px solid var(--blue-500);
  border-radius: 4px; z-index: 15;
  padding: 4px 8px; display: flex; flex-direction: column; gap: 2px;
}
.quick-add-block input {
  border: none; outline: none; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  padding: 2px 0; font-family: inherit;
  width: 100%;
}
.quick-add-block .quick-add-time {
  font-size: 10px; color: var(--gray-500); font-weight: 500;
}

/* Now line (no dot) */
.now-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--red-500); z-index: 10;
  pointer-events: none;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(2px);
}
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 90%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-sm { max-width: 380px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 0 24px 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 24px 20px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-600); margin-bottom: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Toggle */
.toggle-label {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-size: 14px; font-weight: 500;
}
.toggle-input { display: none; }
.toggle-slider {
  width: 44px; height: 24px; background: var(--gray-300);
  border-radius: 12px; position: relative; transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle-input:checked + .toggle-slider { background: var(--blue-600); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Day picker */
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-btn {
  width: 42px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); color: var(--text-secondary);
}
.day-btn:hover { border-color: var(--blue-400); }
.day-btn.selected { background: var(--blue-600); color: white; border-color: var(--blue-600); }

/* Time input (split hour:minute:ampm) */
.time-input {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
  user-select: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.time-input:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.time-part {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  cursor: ns-resize; padding: 4px 6px; border-radius: 4px;
  min-width: 36px; text-align: center;
  transition: background var(--transition);
  position: relative;
}
.time-part:hover { background: var(--surface-hover); }
.time-part.dragging { background: var(--blue-100); }
.time-part.editing {
  cursor: text;
}
.time-part input {
  width: 36px; border: none; outline: none; background: transparent;
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  text-align: center; padding: 0;
}
.time-sep {
  font-size: 22px; font-weight: 700; color: var(--gray-400);
  padding: 0 1px;
}
.time-ampm {
  font-size: 14px; font-weight: 600; color: var(--blue-600);
  cursor: pointer; min-width: 32px;
}
.time-ampm:hover { background: var(--blue-100); }

/* Recurring button */
.recurring-btn {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  width: 100%; padding: 12px 16px; margin-top: 16px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-secondary);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.recurring-btn:hover {
  border-color: var(--purple-500); color: var(--purple-700);
  background: var(--purple-50);
}
.recurring-btn.active {
  border-style: solid; border-color: var(--purple-500);
  background: var(--purple-50); color: var(--purple-700);
}
.recurring-btn svg { flex-shrink: 0; }

/* Color picker */
.color-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.color-swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
  position: relative;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: var(--gray-800);
  box-shadow: 0 0 0 2px var(--bg);
}
.color-swatch.selected::after {
  content: ''; position: absolute; inset: 4px;
  border: 2px solid rgba(255,255,255,0.6); border-radius: 50%;
}

/* Mini timeline now-line (no dot) */
.mini-now-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--red-500); z-index: 5;
  pointer-events: none;
}

/* Autocomplete */
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md); z-index: 10;
  max-height: 150px; overflow-y: auto;
}
.autocomplete-item {
  padding: 8px 12px; font-size: 14px; cursor: pointer;
  transition: background var(--transition);
}
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--blue-50); color: var(--blue-700);
}
.autocomplete-hint {
  padding: 6px 12px; font-size: 11px; color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
}

/* Settings floor picker */
.settings-floor-picker {
  display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap;
}
.settings-floor-pick-btn {
  padding: 4px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.settings-floor-pick-btn.active {
  background: var(--blue-600); color: white; border-color: var(--blue-600);
}

/* Radio labels */
.radio-label {
  display: block; padding: 8px 0; font-size: 14px; cursor: pointer;
}
.radio-label input { margin-right: 8px; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 24px; }
.settings-section h4 { font-size: 14px; font-weight: 600; color: var(--gray-600); margin-bottom: 12px; }
.settings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.settings-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--surface);
  border-radius: var(--radius); font-size: 14px;
}
.settings-item input {
  border: none; background: transparent; font-size: 14px;
  padding: 0; flex: 1; font-weight: 500;
}
.settings-item input:focus { outline: none; }
.settings-item .delete-btn {
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--gray-400); cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.settings-item .delete-btn:hover { background: var(--red-100); color: var(--red-500); }
.settings-section .form-row { align-items: flex-end; }
.settings-section .form-row input { max-width: 200px; }

/* Theme picker */
.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-card {
  width: 80px; padding: 10px 8px; border-radius: var(--radius);
  border: 2px solid var(--border); cursor: pointer;
  text-align: center; font-size: 11px; font-weight: 600;
  transition: all var(--transition);
}
.theme-card:hover { border-color: var(--blue-400); transform: translateY(-1px); }
.theme-card.active { border-color: var(--blue-600); box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.theme-preview {
  height: 32px; border-radius: 4px; margin-bottom: 6px;
  display: flex; gap: 2px; overflow: hidden;
}
.theme-preview span { flex: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--gray-800); color: white; padding: 10px 20px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  z-index: 2000; opacity: 0; transition: opacity 300ms;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== OVERLAP WARNING ===== */
.overlap-warning {
  background: var(--amber-100, #FEF3C7); color: #92400E;
  border: 1px solid #F59E0B; border-radius: var(--radius);
  padding: 8px 12px; font-size: 13px; font-weight: 500;
  margin: 8px 0;
}

/* ===== TOUR / DEMO ===== */
#tour-overlay {
  position: fixed; inset: 0; z-index: 2500;
  pointer-events: none;
}
#tour-spotlight {
  position: absolute; border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  transition: all 0.35s ease;
  pointer-events: none;
}
#tour-tooltip {
  position: absolute; background: white; color: #1E293B;
  border-radius: 12px; padding: 20px 24px 16px;
  max-width: 360px; min-width: 260px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  pointer-events: auto;
  font-size: 14px; line-height: 1.5;
  z-index: 2600;
}
#tour-tooltip::before {
  content: ''; position: absolute; width: 12px; height: 12px;
  background: white; transform: rotate(45deg);
}
#tour-tooltip.arrow-top::before { top: -6px; left: 24px; }
#tour-tooltip.arrow-bottom::before { bottom: -6px; left: 24px; }
#tour-tooltip.arrow-left::before { left: -6px; top: 24px; }
#tour-tooltip.arrow-right::before { right: -6px; top: 24px; }
#tour-text { margin-bottom: 16px; }
#tour-text h4 { margin-bottom: 6px; font-size: 16px; }
#tour-footer {
  display: flex; align-items: center; justify-content: space-between;
}
#tour-step-count {
  font-size: 12px; color: #94A3B8;
}

/* ===== ANIMATIONS ===== */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.icon-btn svg { pointer-events: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 16px; }
  .top-bar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .top-bar-center { order: 3; width: 100%; justify-content: center; }
  .app-title { font-size: 16px; }
  .setup-card, .pin-card { margin: 24px 16px; padding: 24px; }
  .week-header, .week-body { grid-template-columns: 50px repeat(7, 1fr); }
}

@media (max-width: 480px) {
  .room-grid { grid-template-columns: repeat(2, 1fr); }
}
