:root {
  --page-pad: 16px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
#app { min-height: 100dvh; display: flex; flex-direction: column; }

.header {
  background: var(--primary);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header h1 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.header-right { display: flex; align-items: center; gap: 6px; }
.hdr-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.hdr-icon-btn:hover { background: rgba(255,255,255,.28); }
.hdr-lang-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.hdr-lang-btn:hover { background: rgba(255,255,255,.25); }

.main { flex: 1; padding: 16px; padding-bottom: 80px; max-width: 800px; margin: 0 auto; width: 100%; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 100;
  box-shadow: 0 -1px 0 rgba(0,0,0,.06), 0 -4px 12px rgba(0,0,0,.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  gap: 3px;
  transition: color .15s;
  position: relative;
}
.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform .2s;
}
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item.active::before { transform: scaleX(1); }
.nav-item svg { width: 20px; height: 20px; }

/* ── LOGIN ── */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { display: flex; align-items: center; justify-content: center; margin: 0 auto; width: 64px; height: 64px; }
.login-logo h2 { font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-logo p { color: var(--gray-600); font-size: 14px; }

/* ── CARDS ── */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px; }

/* ── TASK CARDS (redesigned) ── */
.task-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 2px 12px rgba(0,0,0,.04);
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.task-card:active  { transform: scale(.985); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.task-card:hover   { box-shadow: 0 4px 20px rgba(0,0,0,.1); transform: translateY(-1px); }
.task-card.status-cancelled { opacity: .55; }

/* Top accent stripe */
.task-stripe {
  height: 4px;
}
/* cleaning stripes by status */
.task-card.type-cleaning.status-pending     .task-stripe { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.task-card.type-cleaning.status-accepted    .task-stripe { background: linear-gradient(90deg,#2563eb,#6366f1); }
.task-card.type-cleaning.status-in_progress .task-stripe { background: linear-gradient(90deg,#7c3aed,#a855f7); }
.task-card.type-cleaning.status-completed   .task-stripe { background: linear-gradient(90deg,#16a34a,#22c55e); }
.task-card.type-cleaning.status-cancelled   .task-stripe { background: var(--gray-200); }
/* inspection stripes by status */
.task-card.type-inspection.status-pending     .task-stripe { background: linear-gradient(90deg,#0891b2,#06b6d4); }
.task-card.type-inspection.status-accepted    .task-stripe { background: linear-gradient(90deg,#059669,#10b981); }
.task-card.type-inspection.status-in_progress .task-stripe { background: linear-gradient(90deg,#0284c7,#38bdf8); }
.task-card.type-inspection.status-completed   .task-stripe { background: linear-gradient(90deg,#16a34a,#4ade80); }
.task-card.type-inspection.status-cancelled   .task-stripe { background: var(--gray-200); }
/* mid-stay stripes by status */
.task-card.type-midstay.status-pending     .task-stripe { background: linear-gradient(90deg,#0891b2,#22d3ee); }
.task-card.type-midstay.status-accepted    .task-stripe { background: linear-gradient(90deg,#0284c7,#38bdf8); }
.task-card.type-midstay.status-in_progress .task-stripe { background: linear-gradient(90deg,#0369a1,#7dd3fc); }
.task-card.type-midstay.status-completed   .task-stripe { background: linear-gradient(90deg,#0e7490,#a5f3fc); }
.task-card.type-midstay.status-cancelled   .task-stripe { background: var(--gray-200); }
/* maintenance stripes by status */
.task-card.type-maintenance.status-pending     .task-stripe { background: linear-gradient(90deg,#d97706,#f59e0b); }
.task-card.type-maintenance.status-accepted    .task-stripe { background: linear-gradient(90deg,#b45309,#fbbf24); }
.task-card.type-maintenance.status-in_progress .task-stripe { background: linear-gradient(90deg,#92400e,#fcd34d); }
.task-card.type-maintenance.status-completed   .task-stripe { background: linear-gradient(90deg,#78350f,#fde68a); }
.task-card.type-maintenance.status-cancelled   .task-stripe { background: var(--gray-200); }

.task-card-body { padding: 14px 16px 16px; }

/* Type + status row */
.task-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.task-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 3px 9px;
  border-radius: 20px;
}
.pill-cleaning   { background: #eff6ff; color: #1d4ed8; }
.pill-inspection { background: #ecfdf5; color: #065f46; }
.pill-midstay    { background: #ecfeff; color: #0e7490; }
.pill-laundry      { background: #fdf4ff; color: #7e22ce; }
.pill-maintenance  { background: #fffbeb; color: #92400e; }
.pill-cancelled  { background: var(--gray-100); color: var(--gray-600); }

.task-property { font-size: 16px; font-weight: 700; color: var(--gray-800); line-height: 1.3; margin-bottom: 5px; }
.task-date-row {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-date-row .date-chip {
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.task-date-row .due-chip {
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}

/* Meta grid */
.task-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.task-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  padding: 3px 8px;
  border-radius: 6px;
}
.task-meta-chip.highlight { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); font-weight: 600; }

/* Assigned maid row */
.task-assigned-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.task-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.task-assigned-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }

.task-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.task-card-body .task-meta { display: none; } /* hide old meta */

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-accepted   { background: #dbeafe; color: #1e40af; }
.badge-in_progress{ background: #ede9fe; color: #6d28d9; }
.badge-completed  { background: #d1fae5; color: #065f46; }
.badge-cancelled  { background: var(--gray-100); color: var(--gray-500); }

/* Status dot indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.status-indicator::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-indicator.pending::before    { background: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.status-indicator.accepted::before   { background: #3b82f6; box-shadow: 0 0 0 2px #dbeafe; }
.status-indicator.in_progress::before{ background: #8b5cf6; box-shadow: 0 0 0 2px #ede9fe; animation: pulse-dot 1.5s ease-in-out infinite; }
.status-indicator.completed::before  { background: #22c55e; box-shadow: 0 0 0 2px #d1fae5; }
.status-indicator.cancelled::before  { background: var(--gray-400); }
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 2px #ede9fe; }
  50%      { box-shadow: 0 0 0 4px #ede9fe; }
}

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: white;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); }
select.form-control { 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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success   { background: var(--success); color: white; }
.btn-danger    { background: var(--danger); color: white; }
.btn-outline   { background: transparent; border: 1.5px solid var(--gray-200); color: var(--gray-800); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost     { background: transparent; color: var(--primary); }
.btn-sm        { padding: 8px 14px; font-size: 13px; }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: .5; cursor: not-allowed; transform: none; }
.active-filter { background: var(--primary) !important; border-color: var(--primary) !important; color: white !important; }

/* ── TABS ── */
.tabs { display: flex; background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; padding: 4px; gap: 2px; }
.tab { flex: 1; padding: 10px 8px; border: none; background: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; color: var(--gray-600); transition: all .15s; }
.tab.active { background: var(--primary); color: white; }

/* ── AVAILABILITY TOGGLE ── */
.avail-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: white;
  border: none;
}
.avail-toggle .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f87171;
  transition: background .2s;
}
.avail-toggle.available .dot { background: #4ade80; }

/* ── CHECKLIST ── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.checklist-item:last-child { border-bottom: none; }
.check-box {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.checklist-item.checked .check-box {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.checklist-item.checked .check-label { text-decoration: line-through; color: var(--gray-400); }
.check-label { font-size: 15px; }

/* ── PHOTO UPLOAD ── */
.photo-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
}
.photo-upload-area:hover { border-color: var(--primary); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.photo-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  width: 100%;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.center { align-items: center; }
.modal {
  background: white;
  border-radius: 20px 20px 16px 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 24px;
}
.modal-overlay.center .modal { border-radius: 16px; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ── SECTION HEADERS ── */
.section-title { font-size: 16px; font-weight: 700; margin: 20px 0 12px; }

/* ── LIST ITEMS (maids, properties) ── */
.list-item {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-item-info h4 { font-size: 15px; font-weight: 600; }
.list-item-info p  { font-size: 13px; color: var(--gray-600); margin-top: 2px; }
.list-item-actions { display: flex; gap: 8px; }

/* ── STATUS DOT ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.dot-available   { background: var(--success); }
.dot-unavailable { background: var(--gray-400); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-400);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--gray-800);
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── LOADING ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-page { display: flex; align-items: center; justify-content: center; min-height: 200px; }

/* ── UTILITIES ── */
.hidden    { display: none !important; }
.text-muted  { color: var(--gray-600); }
.text-small  { font-size: 13px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.bold  { font-weight: 600; }

/* ── MAID ACTIVE TASK HERO ── */
.active-task-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.active-task-hero h3 { font-size: 18px; font-weight: 700; }
.active-task-hero p  { opacity: .85; margin-top: 4px; font-size: 14px; }
.active-task-hero .btn-row { display: flex; gap: 8px; margin-top: 16px; }
.active-task-hero .btn-white {
  background: white;
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  flex: 1;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  background: var(--gray-100);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 20px;
  transition: width .3s;
}

/* ── CALENDAR ── */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 56px;
  z-index: 50;
  flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cal-month-label { font-size: 17px; font-weight: 700; min-width: 160px; text-align: center; }

/* ── MONTH GRID CALENDAR ── */
.month-grid {
  width: 100%;
  border-left: 1px solid var(--gray-200);
  background: white;
}
.month-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
  position: sticky;
  top: 97px; /* header + toolbar */
  z-index: 10;
}
.mgh-cell {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  padding: 10px 0;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-right: 1px solid var(--gray-200);
}
.mgh-cell:last-child { border-right: none; }

/* Week row */
.month-week {
  position: relative;
  border-bottom: 1px solid var(--gray-200);
}

/* Day cells background layer */
.month-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 100%;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.month-cell {
  border-right: 1px solid var(--gray-200);
  padding: 6px 8px;
  background: white;
}
.month-cell:last-child { border-right: none; }
.month-cell.other-month { background: var(--gray-50); }
.month-cell.weekend { background: #fafbfc; }

/* Day number */
.mday-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: 50%;
}
.mday-num.is-today {
  background: var(--primary);
  color: white;
  font-weight: 700;
}
.mday-num.is-other { color: var(--gray-400); font-weight: 400; }

/* Bars overlay layer */
.month-bars {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* Reservation bar */
.res-bar {
  position: absolute;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  pointer-events: all;
  user-select: none;
  transition: filter .12s, transform .1s;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.res-bar:hover  { filter: brightness(.93); }
.res-bar:active { transform: scale(.99); }
.res-bar-name   { overflow: hidden; text-overflow: ellipsis; }

.res-bar.s-pending    { background: #fff8e7; color: #92400e; border: 1.5px solid #fcd34d; }
.res-bar.s-accepted   { background: #e8f3ff; color: #1e40af; border: 1.5px solid #93c5fd; }
.res-bar.s-in_progress{ background: #f0edff; color: #4c1d95; border: 1.5px solid #c4b5fd; }
.res-bar.s-completed  { background: #edfbf1; color: #14532d; border: 1.5px solid #86efac; }
.res-bar.s-cancelled  { background: #f3f4f6; color: #9ca3af; border: 1.5px dashed #d1d5db; opacity: .6; }

/* Task dot in all-properties timeline */
.tl-task-dot {
  position: absolute;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  border: 1.5px solid rgba(0,0,0,.15);
  z-index: 2;
}
.tl-task-dot:hover { transform: translateX(-50%) scale(1.4); }

/* Task chip inside day cell */
.cal-task-chip {
  display: block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  margin-top: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-task-chip:hover { filter: brightness(.93); }

/* ── WEEK SCHEDULE / SCROLLABLE TIMELINE ── */
.ws-res-bar {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: filter .1s;
}
.ws-res-bar:hover { filter: brightness(.93); }
.ws-res-bar.s-pending    { background: #fff8e7; color: #92400e; border: 1.5px solid #fcd34d; }
.ws-res-bar.s-accepted   { background: #e8f3ff; color: #1e40af; border: 1.5px solid #93c5fd; }
.ws-res-bar.s-in_progress{ background: #f0edff; color: #4c1d95; border: 1.5px solid #c4b5fd; }
.ws-res-bar.s-completed  { background: #edfbf1; color: #14532d; border: 1.5px solid #86efac; }
.ws-res-bar.owner-block  {
  background: repeating-linear-gradient(-45deg,#e5e7eb,#e5e7eb 4px,#f3f4f6 4px,#f3f4f6 10px);
  color: #9ca3af; border: 1.5px solid #d1d5db; cursor: default;
}
.ws-res-bar.owner-block:hover { filter: none; }
.ws-bar-guest { overflow: hidden; text-overflow: ellipsis; }
.ws-day-clickable { cursor: pointer; }
.ws-day-clickable:hover { background: rgba(37,99,235,.06) !important; }
.ws-day-add-btn {
  display: none; position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%); font-size: 11px; color: var(--primary);
  font-weight: 700; white-space: nowrap; pointer-events: none;
}
.ws-day-clickable:hover .ws-day-add-btn { display: block; }
.ws-task-card {
  background: white;
  border-radius: 8px;
  padding: 5px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  cursor: pointer;
  border-left: 3px solid var(--gray-300);
  margin-bottom: 4px;
}
.ws-task-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.ws-task-card.ws-status-pending     { border-left-color: #fcd34d; }
.ws-task-card.ws-status-accepted    { border-left-color: #93c5fd; }
.ws-task-card.ws-status-in_progress { border-left-color: #c4b5fd; }
.ws-task-card.ws-status-completed   { border-left-color: #86efac; }
.ws-task-type  { font-size: 11px; font-weight: 700; color: var(--gray-800); margin-bottom: 2px; }
.ws-task-maid  { font-size: 10px; color: var(--gray-600); margin-bottom: 3px; }
.ws-unassigned { color: var(--gray-400); font-style: italic; }
.ws-task-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.ws-task-badge.ws-status-pending     { background: #fef9c3; color: #854d0e; }
.ws-task-badge.ws-status-accepted    { background: #dbeafe; color: #1e40af; }
.ws-task-badge.ws-status-in_progress { background: #ede9fe; color: #5b21b6; }
.ws-task-badge.ws-status-completed   { background: #dcfce7; color: #166534; }

/* ── ALL-PROPERTIES CALENDAR VIEW ── */
.all-props-header {
  grid-template-columns: 140px repeat(7, 1fr) !important;
}
.mgh-prop-col {
  border-right: 1px solid var(--gray-200);
}
.all-props-week {
  border-bottom: 1px solid var(--gray-200);
}
.all-props-dates {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  border-bottom: 1px solid var(--gray-100);
}
.ap-date-cell {
  min-height: 28px;
  padding: 2px 4px;
}
.ap-prop-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-top: 1px solid var(--gray-100);
  position: relative;
}
.ap-prop-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 4px 8px;
  border-right: 1px solid var(--gray-200);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  background: var(--gray-50);
}
.ap-prop-label:hover { color: var(--primary); text-decoration: underline; }
.ap-prop-bars {
  position: relative;
}
.ap-cells-bg {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 100%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ap-bg-cell {
  border-right: 1px solid var(--gray-100);
}
.ap-bg-cell:last-child { border-right: none; }
.ap-bg-cell.weekend { background: #fafbfc; }

/* Tablet / desktop adjustments */
@media (min-width: 640px) {
  :root { --page-pad: 20px; }
  .main { padding: 20px; padding-bottom: 28px; max-width: 100%; }
  .bottom-nav { justify-content: center; }
  .bottom-nav .nav-item { min-width: 72px; padding: 8px 12px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  :root { --page-pad: 24px; }
  .main { padding: 24px; padding-bottom: 32px; }
}
@media (min-width: 1100px) {
  :root { --page-pad: 32px; }
  .main { padding: 28px 32px; padding-bottom: 32px; }
}

/* ── STARS ── */
.star-row { display: flex; gap: 3px; }
.star-row-sm { display: flex; align-items: center; gap: 3px; }
.star { font-size: 22px; transition: color .1s; }
.star-filled { color: #f59e0b; }
.star-empty  { color: #d1d5db; }
.star-inline { color: #f59e0b; font-size: 14px; letter-spacing: 1px; }

/* ── STAR PICKER (rating modal) ── */
.star-picker { display: flex; gap: 6px; justify-content: center; }
.star-pick {
  font-size: 36px;
  color: #d1d5db;
  cursor: pointer;
  transition: color .15s, transform .1s;
}
.star-pick:hover,
.star-pick.active { color: #f59e0b; transform: scale(1.15); }

/* ── NAV BADGE ── */
.nav-badge {
  position: absolute;
  top: 6px;
  right: 50%;
  transform: translateX(12px);
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-item { position: relative; }

/* ── AVAILABILITY CALENDAR ── */
.avail-cal { border-radius: var(--radius-sm); overflow: hidden; }
.avail-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.avail-cal-header > div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 6px 0;
}
.avail-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 6px;
  background: white;
}
.avail-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  transition: background .15s, border-color .15s;
  position: relative;
}
.avail-cell:active { transform: scale(.93); }
.avail-cell.avail-pad { background: transparent; border-color: transparent; cursor: default; }
.avail-cell.unavail { background: #fef2f2; border-color: #fca5a5; }
.avail-cell.is-today { border-width: 2px; border-color: var(--primary); }
.avail-day { font-size: 14px; font-weight: 600; }
.avail-off { font-size: 9px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .3px; }

/* ── MISC HELPERS ── */
.mt-4  { margin-top: 4px; }

/* Full-bleed utility — breaks out of .main padding */
.full-bleed { margin-left: calc(-1 * var(--page-pad)); margin-right: calc(-1 * var(--page-pad)); }
.full-bleed-pad { padding-left: var(--page-pad); padding-right: var(--page-pad); }

/* ── DARK MODE ── */
/* ── DARK MODE BASE ── */
body.dark-mode {
  --gray-50:  #1a2133;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --primary-light: #1e3a5f;
  --success-light: #0f291a;
  --warning-light: #2a1f0a;
  --danger-light:  #2a0f0f;
  background: #0d1117;
  color: #e2e8f0;
  color-scheme: dark;
}

/* ── Base components ── */
body.dark-mode .card  { background: #161d2b !important; border-color: #273044 !important; color: #e2e8f0; }
body.dark-mode .card-body { background: #161d2b !important; }
body.dark-mode .header { background: #1a2a5e !important; }
body.dark-mode .hdr-icon-btn, body.dark-mode .hdr-lang-btn { color: rgba(255,255,255,.85) !important; }
body.dark-mode .bottom-nav { background: #161d2b !important; border-color: #273044 !important; }
body.dark-mode .nav-item { color: #475569 !important; }
body.dark-mode .nav-item.active, body.dark-mode .nav-item:active { color: #60a5fa !important; }
body.dark-mode .nav-item.active::before { background: #60a5fa; }
body.dark-mode .form-control { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }
body.dark-mode input, body.dark-mode textarea, body.dark-mode select { background: #1e293b !important; color: #e2e8f0 !important; border-color: #334155 !important; }
body.dark-mode .list-item  { background: #161d2b !important; border-color: #273044 !important; color: #e2e8f0; }
body.dark-mode .modal      { background: #161d2b !important; color: #e2e8f0 !important; }
body.dark-mode .modal-overlay { background: rgba(0,0,0,.75) !important; }
body.dark-mode .modal-sheet   { background: #161d2b !important; color: #e2e8f0 !important; }
body.dark-mode .btn-outline   { color: #94a3b8 !important; border-color: #334155 !important; background: #1e293b !important; }
body.dark-mode .btn-ghost     { color: #94a3b8 !important; background: transparent !important; }
body.dark-mode .btn           { color: inherit; }
body.dark-mode .section-title { color: #64748b !important; border-color: #273044 !important; }
body.dark-mode .badge         { opacity: .9; }
body.dark-mode .tab           { background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important; }
body.dark-mode .tab.active    { background: #2563eb !important; color: white !important; }
body.dark-mode .tabs          { background: #161d2b !important; border-color: #273044 !important; }

/* ── Task cards ── */
body.dark-mode .task-card      { background: #161d2b !important; border-color: #273044 !important; box-shadow: 0 1px 4px rgba(0,0,0,.4) !important; }
body.dark-mode .task-card-body { background: #161d2b !important; }
body.dark-mode .task-meta-chip { background: #1e293b !important; border-color: #334155 !important; color: #94a3b8 !important; }
body.dark-mode .task-meta-chip.highlight { background: #1a2e1a !important; color: #4ade80 !important; }
body.dark-mode .date-chip, body.dark-mode .due-chip { background: #1e293b !important; color: #94a3b8 !important; }

/* ── Calendar ── */
body.dark-mode .ws-scroll-wrap { background: #0d1117 !important; }
body.dark-mode .ws-prop-col    { background: #161d2b !important; border-color: #273044 !important; color: #e2e8f0; }
body.dark-mode .ws-day         { background: #0d1117 !important; border-color: #1e2d40 !important; }
body.dark-mode .ws-day.is-weekend-col { background: #111827 !important; }
body.dark-mode .ws-day.is-today-col   { background: #1a2e5c !important; }
body.dark-mode .ws-head-day    { background: #161d2b !important; border-color: #273044 !important; color: #94a3b8 !important; }
body.dark-mode .ws-head-day.is-today-col { background: #1a2e5c !important; color: #60a5fa !important; }
body.dark-mode .ws-prop-label  { color: #e2e8f0 !important; }
body.dark-mode .ws-task-chip   { background: #1e293b !important; color: #e2e8f0 !important; border-color: #334155 !important; }
body.dark-mode .cal-toolbar    { background: #161d2b !important; border-color: #273044 !important; }
body.dark-mode .cal-month-label { color: #e2e8f0 !important; }
body.dark-mode .ws-day-clickable:hover { background: rgba(96,165,250,.08) !important; }

/* ── Dashboard inline-styled elements — match common patterns ── */
body.dark-mode #admin-dash-wrap { background: transparent !important; }
/* Stat boxes */
body.dark-mode #admin-dash-wrap > div > div[style*="background:white"],
body.dark-mode #admin-dash-wrap > div > div[style*="background: white"] { background: #161d2b !important; box-shadow: 0 1px 4px rgba(0,0,0,.5) !important; color: #e2e8f0 !important; }
/* Property status pills */
body.dark-mode div[style*="background:white"][style*="border-radius:10px"] { background: #1e293b !important; border-color: #334155 !important; }

/* Earnings page */
body.dark-mode #earn-wrap *[style*="background:white"],
body.dark-mode #earn-wrap *[style*="background: white"] { background: #161d2b !important; }
body.dark-mode #earn-wrap { background: transparent !important; color: #e2e8f0; }
body.dark-mode #earn-chart-inner { background: #161d2b !important; border-radius: 12px; }

/* Payroll page */
body.dark-mode #payroll-summary *[style*="background:white"],
body.dark-mode #payroll-summary *[style*="background: white"] { background: #161d2b !important; }

/* Booking sheet */
body.dark-mode .modal-sheet *[style*="background:var(--gray-50)"] { background: #1e293b !important; }

/* Generic: any white bg inside dark app */
body.dark-mode *[style*="background:white"] { background: #1e293b !important; }
body.dark-mode *[style*="background: white"] { background: #1e293b !important; }
body.dark-mode *[style*="background:#fff"] { background: #1e293b !important; }
body.dark-mode *[style*="background: #fff"] { background: #1e293b !important; }
body.dark-mode *[style*="background:#f9fafb"] { background: #1a2133 !important; }
body.dark-mode *[style*="background:#f3f4f6"] { background: #1a2133 !important; }
body.dark-mode *[style*="background:#eff6ff"] { background: #1a2e5c !important; }
/* Calendar weekend/today column cells */
body.dark-mode *[style*="background:#fafbfc"] { background: #131b2e !important; }
body.dark-mode *[style*="background:#f5f5f5"] { background: #131b2e !important; }
body.dark-mode *[style*="background:#f0f7ff"] { background: #172444 !important; }
body.dark-mode *[style*="background:#fafafa"] { background: #131b2e !important; }

/* Text color fixes for inline-styled elements */
body.dark-mode *[style*="color:#111"] { color: #e2e8f0 !important; }
body.dark-mode *[style*="color: #111"] { color: #e2e8f0 !important; }
body.dark-mode *[style*="color:#374151"] { color: #cbd5e1 !important; }
body.dark-mode *[style*="color:#1f2937"] { color: #e2e8f0 !important; }
body.dark-mode *[style*="color:#6b7280"] { color: #94a3b8 !important; }

/* Border color fixes */
body.dark-mode *[style*="border-color:#e5e7eb"],
body.dark-mode *[style*="border: 1px solid #e5e7eb"],
body.dark-mode *[style*="border:1px solid #e5e7eb"],
body.dark-mode *[style*="border-bottom:1px solid #f0f0f0"],
body.dark-mode *[style*="border-top:1px solid #f0f0f0"] { border-color: #273044 !important; }

/* ── Cleaning section sub-nav ── */
.cleaning-subnav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cleaning-subnav::-webkit-scrollbar { display: none; }
.csn-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: transparent;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.csn-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.csn-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
body.dark-mode .cleaning-subnav { border-color: #273044; }
body.dark-mode .csn-btn { border-color: #334155; color: #64748b; }
body.dark-mode .csn-btn:hover { background: #1e293b; color: #94a3b8; }
body.dark-mode .csn-btn.active { background: #2563eb; border-color: #2563eb; color: white; }

/* ── Calendar task cards (background:white set in CSS, not inline) ── */
body.dark-mode .ws-task-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
}
body.dark-mode .ws-task-type  { color: #e2e8f0 !important; }
body.dark-mode .ws-task-maid  { color: #94a3b8 !important; }
body.dark-mode .ws-unassigned { color: #64748b !important; font-style: italic; }
body.dark-mode .ws-task-badge                              { background: #273044 !important; color: #94a3b8 !important; }
body.dark-mode .ws-task-badge.ws-status-pending            { background: #3d2e08 !important; color: #fcd34d !important; }
body.dark-mode .ws-task-badge.ws-status-accepted           { background: #1e3a5c !important; color: #93c5fd !important; }
body.dark-mode .ws-task-badge.ws-status-in_progress        { background: #2d1e4f !important; color: #c4b5fd !important; }
body.dark-mode .ws-task-badge.ws-status-completed          { background: #1a2e1a !important; color: #86efac !important; }
body.dark-mode .cal-task-chip { background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important; }

/* ── Property status pills (occupied green, arriving yellow, vacant white) ── */
body.dark-mode *[style*="background:#f0fdf4"] { background: #0f2a1a !important; border-color: #166534 !important; }
body.dark-mode *[style*="background:#fffbeb"] { background: #2a1f08 !important; border-color: #92400e !important; }

/* ── Alert / notice banners ── */
body.dark-mode *[style*="background:#fef2f2"] { background: #2a1010 !important; border-color: #7f1d1d !important; }
body.dark-mode *[style*="background:#fef9c3"] { background: #2a2210 !important; border-color: #713f12 !important; }

/* ── More text colors ── */
body.dark-mode *[style*="color:#9ca3af"] { color: #64748b !important; }
body.dark-mode *[style*="color:#dc2626"] { color: #f87171 !important; }

/* Login page stays light */
body.dark-mode .login-page { background: linear-gradient(135deg,#1a2e6b 0%,#2563eb 100%) !important; }
body.dark-mode .login-card { background: #161d2b !important; }

/* Active task hero — gradients are fine */
body.dark-mode .active-task-hero { opacity: .92; }
/* .dark-toggle-btn replaced by .hdr-icon-btn */

/* ── GLOBAL SEARCH ── */
.search-btn {
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 34px; height: 34px;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.search-btn:hover { background: rgba(255,255,255,.25); }
.search-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 60px;
}
.search-box {
  width: min(600px, 95vw);
  background: white; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}
body.dark-mode .search-box { background: #1e293b; }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--gray-200);
}
.search-input-wrap input {
  flex: 1; border: none; outline: none; font-size: 16px;
  background: transparent; color: inherit;
}
.search-results { max-height: 60vh; overflow-y: auto; }
.search-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gray-400);
  padding: 8px 16px 4px;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer; transition: background .15s;
}
.search-result-item:hover { background: var(--gray-50); }
body.dark-mode .search-result-item:hover { background: #2d3748; }
.search-result-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.search-result-main { font-size: 14px; font-weight: 600; }
.search-result-sub { font-size: 12px; color: var(--gray-400); }
.search-empty { padding: 24px; text-align: center; color: var(--gray-400); font-size: 14px; }

/* ── COUNTDOWN TIMER ── */
.task-countdown {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  background: #fef3c7; color: #92400e;
}
.task-countdown.urgent { background: #fee2e2; color: #991b1b; }
.task-countdown.done   { background: #d1fae5; color: #065f46; }

/* ── INVENTORY ── */
.inv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
}
.inv-item:last-child { border-bottom: none; }
.inv-qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--gray-200); background: white;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.inv-qty { min-width: 28px; text-align: center; font-weight: 700; font-size: 15px; }
.inv-low { color: var(--danger); }
.inv-ok  { color: var(--success); }

/* ── WA BUTTON ── */
.btn-wa {
  background: #25d366; color: white; border: none;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; display: inline-flex;
  align-items: center; gap: 6px;
}

/* ════════════════════════════════════════════
   NEW FEATURES CSS (Features 1–20)
   ════════════════════════════════════════════ */

/* Feature 1: Photo documentation */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.photo-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s;
}
.photo-thumb:hover { opacity: .85; }
.photo-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.photo-type-before { background: #fde68a; color: #92400e; }
.photo-type-after  { background: #bbf7d0; color: #14532d; }

/* Feature 2: Checklist progress is already styled, ensure .progress-bar exists */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 3px;
  transition: width .3s ease;
}

/* Feature 4: Bulk action bar */
.bulk-action-bar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-select-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--gray-300);
  background: white;
  flex-shrink: 0;
  cursor: pointer;
}

/* Feature 6: Comment thread */
.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  max-width: 85%;
  align-self: flex-start;
  font-size: 13px;
}
.comment-bubble.mine {
  background: var(--primary-light);
  border-color: #bfdbfe;
  align-self: flex-end;
}

/* Feature 14: Lost & Found status badges already use .badge */

/* Feature 16: Gap alert cards */
.gap-alert-card {
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.gap-alert-card.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

/* Feature 18: Seasonal heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.heatmap-cell {
  border-radius: 4px;
  padding: 6px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  transition: opacity .15s;
}

/* Feature 20: Swipe gestures */
.task-card {
  position: relative;
  overflow: hidden;
}
.swipe-right-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #16a34a, transparent);
  display: flex;
  align-items: center;
  padding-left: 16px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity .1s;
  z-index: 1;
}
.swipe-right-bg::before { content: '▶ Start'; }

.swipe-left-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #dc2626, transparent);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 16px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity .1s;
  z-index: 1;
}
.swipe-left-bg::before { content: '⚠ Issue'; }

/* Feature 19: Offline banner (injected by JS, styles just in case) */
#offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9999;
  display: none;
}

/* Dark mode extras for new features */
.dark-mode .bulk-action-bar { background: #1e3a5f; border-color: #2563eb; }
.dark-mode .comment-bubble  { background: #1f2937; border-color: #374151; }
.dark-mode .comment-bubble.mine { background: #1e3a5f; border-color: #2563eb; }


/* ── 21 New Features ─────────────────────────────────── */

/* Feature N7: Time Clock Widget */
#time-clock-widget { padding: 0 16px; }

/* ── Desktop / Sidebar Mode ─────────────────────────────── */
@media (min-width: 1024px) {

  /* ── Sidebar (fixed left panel) ── */
  body.is-tablet .bottom-nav {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0 0 20px;
    overflow-y: auto;
    overflow-x: hidden;
    border-top: none;
    border-right: 1px solid rgba(0,0,0,.08);
    box-shadow: none;
    scrollbar-width: none;
    background: white;
    z-index: 200;
  }
  body.is-tablet .bottom-nav::-webkit-scrollbar { display: none; }
  body.is-tablet .bottom-nav .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 20px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    border-radius: 0;
    min-width: unset;
  }
  body.is-tablet .bottom-nav .nav-item span:first-child { font-size: 18px !important; flex-shrink: 0; }
  body.is-tablet .bottom-nav .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
  body.is-tablet .bottom-nav .nav-item::before {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 3px; height: auto;
    border-radius: 0 2px 2px 0;
    background: var(--primary);
  }
  body.is-tablet .bottom-nav .nav-item.active { background: rgba(37,99,235,.07); color: var(--primary); font-weight: 600; }
  body.is-tablet .bottom-nav .nav-item.active::before { transform: scaleX(1); }
  body.is-tablet .sidebar-brand { display: block !important; }

  /* ── App shell: offset by sidebar, scroll inside #app ── */
  body.is-tablet #app {
    margin-left: 220px;
    height: 100vh;
    overflow-y: auto;      /* #app is the scroll container */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Header: sticky inside the scrollable #app (not fixed to viewport) */
  body.is-tablet .header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100;
  }

  /* Main: full width, natural height, proper padding */
  body.is-tablet .main {
    max-width: none !important;
    padding: 28px 36px 60px !important;
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Dashboard grid cells must have min-width:0 to prevent overflow */
  body.is-tablet #admin-dash-wrap .dash-col { min-width: 0; overflow: hidden; }

  /* Zero page-level paddings */
  body.is-tablet #page-admin,
  body.is-tablet #page-admin-earnings { padding: 0 !important; }
  body.is-tablet #page-admin-calendar { padding: 0 !important; }

  /* Tasks 2-col */
  body.is-tablet #admin-tasks-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  body.is-tablet .task-card { margin-bottom: 0; }

  /* Dark mode */
  body.dark-mode.is-tablet .bottom-nav { background: #161d2b; border-color: #273044; }
  body.dark-mode.is-tablet .bottom-nav .nav-item.active { background: rgba(96,165,250,.1); }
}

/* ── Property Status Grid ── */
.prop-status-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.prop-status-grid::-webkit-scrollbar { display: none; }
.prop-status-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: default;
}
/* Desktop: wrap into grid, all visible, no scroll */
@media (min-width: 1024px) {
  body.is-tablet .prop-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  body.is-tablet .prop-status-card {
    flex: unset;
  }
}
body.dark-mode .prop-status-card { color: #e2e8f0; }

/* ── Dashboard cards ── */
.dash-stat-card {
  background: white;
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.04);
  transition: box-shadow .15s, transform .15s;
}
.dash-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
.dash-stat-label { font-size: 10px; color: #9ca3af; margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dash-section-label { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.dash-action-btn {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.dash-action-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
body.dark-mode .dash-stat-card { background: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .dash-action-btn { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }

/* ── Sidebar branding block ── */
.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  margin-bottom: 8px;
}
.sidebar-brand-name { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.sidebar-brand-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
body.dark-mode .sidebar-brand { border-color: #273044; }
body.dark-mode .sidebar-brand-name { color: #e2e8f0; }

/* Progress bar reuse */
.progress-bar { background: #e5e7eb; border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--primary); height: 100%; border-radius: 4px; transition: width .3s; }

/* Maid schedule grid */
.sched-grid table { width: 100%; border-collapse: collapse; }
.sched-grid th, .sched-grid td { border: 1px solid #e5e7eb; padding: 4px 6px; font-size: 11px; }

/* Access code reveal */
.code-hidden { letter-spacing: 2px; }

/* Guestbook stars */
.gb-star-active { color: #f59e0b; }

/* Dark mode additions */
.dark-mode #time-clock-widget .btn-white { color: white; }

/* ── PRINT styles ── */
@media print {
  #admin-nav, #maid-nav, #modal-container, .btn, button { display: none !important; }
  body { background: white; }
  #main-content { padding: 0; }
  .hidden { display: none !important; }
  * { box-shadow: none !important; }
}
