/* ============================================================
   S-PRESSO STAFF DASHBOARD — housekeeping.css v1
   Housekeeping tab — Rooms / Staff / Log
============================================================ */

/* ── SUB-TABS ─────────────────────────────────────────────── */
.hk-sub-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--white); padding: 4px; border-radius: 10px;
  box-shadow: var(--shadow-sm); width: fit-content;
}
.hk-sub-btn {
  padding: 7px 18px; border-radius: 7px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; color: var(--gray-500);
  border: none; background: none; font-family: var(--font-sans);
}
.hk-sub-btn.active { background: var(--navy-800); color: var(--white); }

/* ── STATS ROW ────────────────────────────────────────────── */
.hk-stats-row {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.hk-stat-pill {
  background: var(--white); border-radius: 10px; padding: 9px 14px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.hk-stat-num { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.hk-stat-lbl { font-size: 0.68rem; color: var(--gray-400); line-height: 1.4; }

/* ── FILTER BAR ───────────────────────────────────────────── */
.hk-filter-bar {
  background: var(--white); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.hk-filter-group { display: flex; flex-direction: column; gap: 4px; }
.hk-filter-label {
  font-size: 0.62rem; color: var(--gray-400);
  text-transform: uppercase; font-weight: 600;
}
.hk-filter-select {
  padding: 7px 10px; border: 1px solid var(--gray-200);
  border-radius: 7px; font-size: 0.82rem; color: var(--navy-800);
  background: #f8fafc; min-width: 140px; font-family: var(--font-sans);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.hk-btn {
  padding: 7px 14px; border-radius: 7px; border: none;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans);
}
.hk-btn-gold    { background: var(--gold-600); color: var(--white); }
.hk-btn-outline { background: var(--white); color: var(--gray-600); border: 1px solid var(--gray-200); }
.hk-btn-sm      { padding: 4px 10px; font-size: 0.75rem; }

/* ── PROPERTY SECTION ─────────────────────────────────────── */
.hk-prop-section  { margin-bottom: 24px; }
.hk-prop-header   {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-border);
}
.hk-prop-name  { font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.hk-prop-count {
  background: #f1f5f9; color: var(--gray-500);
  font-size: 0.72rem; padding: 2px 8px;
  border-radius: 99px; font-weight: 600;
}
.hk-prop-progress {
  margin-left: auto; display: flex; align-items: center;
  gap: 8px; font-size: 0.75rem; color: var(--gray-500);
}
.hk-progress-bar  { width: 100px; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.hk-progress-fill { height: 100%; background: #22c55e; border-radius: 3px; transition: width 0.3s; }

/* ── ROOM ROW ─────────────────────────────────────────────── */
.hk-room-row {
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: 9px; padding: 10px 14px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  transition: border-color 0.15s;
}
.hk-room-row:hover  { border-color: var(--gold-600); }
.hk-room-row.hk-done { opacity: 0.5; }
.hk-room-row.hk-priority { border-color: #eab308; background: #fefce8; }
.hk-room-row.hk-stay-clean { border-color: #ec4899; background: #fdf2f8; }

.hk-room-num {
  font-size: 1.1rem; font-weight: 800;
  color: var(--navy-800); min-width: 48px;
}

/* ── STATUS BADGES ────────────────────────────────────────── */
.hk-badge {
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.hk-badge-dirty     { background: #fef9c3; color: #854d0e; }
.hk-badge-clean     { background: #dbeafe; color: #1e40af; }
.hk-badge-inspected { background: #dcfce7; color: #166534; }
.hk-badge-stay      { background: #fbcfe8; color: #9d174d; }

/* ── FLAG TAGS ────────────────────────────────────────────── */
.hk-flag {
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase;
}
.hk-flag-late      { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.hk-flag-early     { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.hk-flag-stayclean { background: #fce7f3; color: #9d174d; border: 1px solid #f9a8d4; }

/* ── CLEANER ASSIGN ───────────────────────────────────────── */
.hk-cleaner-select {
  padding: 5px 8px; border: 1px solid var(--gray-200);
  border-radius: 6px; font-size: 0.78rem;
  color: var(--navy-800); background: #f8fafc;
  min-width: 120px; font-family: var(--font-sans);
}
.hk-cleaner-tag {
  font-size: 0.75rem; font-weight: 600; color: var(--navy-800);
  background: #eff6ff; padding: 3px 9px;
  border-radius: 99px; border: 1px solid #bfdbfe;
}

/* ── ROOM ACTION BUTTONS ──────────────────────────────────── */
.hk-room-actions { display: flex; gap: 6px; margin-left: auto; }
.hk-act-btn {
  padding: 5px 10px; border-radius: 6px; border: none;
  font-size: 0.75rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans);
}
.hk-act-clean       { background: #dbeafe; color: #1e40af; }
.hk-act-inspect     { background: #dcfce7; color: #166534; }
.hk-act-priority    { background: #fee2e2; color: #991b1b; }
.hk-act-priority-on { background: #f97316; color: var(--white); }

/* ── STAY DATE PICKER ─────────────────────────────────────── */
.hk-stay-date {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex-wrap: wrap;
}
.hk-stay-date-lbl { font-size: 0.72rem; color: var(--gray-500); }
.hk-date-input {
  padding: 4px 8px; border: 1px solid var(--gray-200);
  border-radius: 6px; font-size: 0.75rem;
  color: var(--navy-800); background: #f8fafc;
  font-family: var(--font-sans);
}

/* ── STAFF TAB ────────────────────────────────────────────── */
.hk-add-staff-row {
  display: flex; gap: 8px; align-items: flex-end;
  margin-bottom: 20px; background: var(--white);
  padding: 14px 16px; border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.hk-add-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--gray-200); border-radius: 7px;
  font-size: 0.85rem; font-family: var(--font-sans);
  color: var(--navy-800);
}
.hk-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.hk-cleaners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.hk-cleaner-card {
  background: var(--white); border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--gray-200);
}
.hk-cleaner-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.hk-cleaner-avatar {
  width: 36px; height: 36px; border-radius: 99px;
  background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.hk-cleaner-name  { font-size: 0.95rem; font-weight: 700; color: var(--navy-800); }
.hk-cleaner-rooms { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.hk-remove-btn {
  background: none; border: none; color: #ef4444;
  font-size: 0.75rem; cursor: pointer; font-weight: 600;
  margin-left: auto; font-family: var(--font-sans);
}
.hk-cleaner-body  { display: flex; gap: 8px; align-items: flex-start; }
.hk-link-box {
  padding: 5px 8px; border: 1px solid var(--gray-200);
  border-radius: 6px; font-size: 0.68rem; color: var(--gray-500);
  background: #f8fafc; font-family: monospace;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  margin-bottom: 8px; max-width: 100%;
}
.hk-cleaner-btns  { display: flex; gap: 6px; margin-bottom: 8px; }
.hk-qr-wrap       { margin-top: 8px; }
.hk-qr-wrap img   { border-radius: 6px; border: 1px solid var(--gray-200); }
.hk-add-card {
  background: #f8fafc; border: 2px dashed var(--gray-200);
  border-radius: 10px; min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--gray-500);
  cursor: pointer; font-weight: 600;
}
.hk-add-card:hover { border-color: var(--gold-600); color: var(--gold-600); }
.hk-empty-staff {
  grid-column: 1/-1; text-align: center;
  padding: 40px; color: var(--gray-400); font-size: 0.85rem;
}

/* ── LOG TAB ──────────────────────────────────────────────── */
.hk-log-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.hk-log-table th {
  background: #f8fafc; padding: 10px 14px;
  font-size: 0.68rem; color: var(--gray-400);
  text-transform: uppercase; font-weight: 700;
  text-align: left; border-bottom: 1px solid var(--gray-200);
}
.hk-log-table td {
  padding: 9px 14px; font-size: 0.8rem;
  border-bottom: 1px solid #f1f5f9; color: var(--navy-800);
}
.hk-log-table tr:last-child td { border-bottom: none; }
.hk-log-action {
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}
.hk-log-assigned  { background: #eff6ff; color: #1e40af; }
.hk-log-cleaned   { background: #dbeafe; color: #1e40af; }
.hk-log-inspected { background: #dcfce7; color: #166534; }
.hk-log-other     { background: #f1f5f9; color: var(--gray-500); }

/* ── HIDDEN UTILITY ───────────────────────────────────────── */
.hidden { display: none !important; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hk-filter-bar    { flex-direction: column; align-items: stretch; }
  .hk-filter-group  { width: 100%; }
  .hk-filter-select { min-width: 0; width: 100%; }
  .hk-room-actions  { margin-left: 0; width: 100%; }
  .hk-stay-date     { margin-left: 0; width: 100%; }
  .hk-cleaners-grid { grid-template-columns: 1fr; }
  .hk-log-table th,
  .hk-log-table td  { padding: 7px 10px; font-size: 0.75rem; }
  .hk-prop-header   { flex-wrap: wrap; }
  .hk-prop-progress { margin-left: 0; width: 100%; justify-content: center; }
  .hk-progress-bar  { width: 80px; }
}

/* Clean/Inspect active state (match hk-act-priority-on pattern) */
.hk-act-clean-on   { background: #3b82f6; color: var(--white); }
.hk-act-inspect-on { background: #10b981; color: var(--white); }

/* ──────────────────────────────────────────────────────────────
   Stay cleaning — multi-date chip list (replaces single picker)
   Shown in-row on Stay-status rooms on the Housekeeping tab.
   ────────────────────────────────────────────────────────────── */
.hk-stay-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hk-stay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hk-clean-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 8px;
  font-size: 0.8rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hk-clean-chip-x {
  background: none;
  border: 0;
  color: #047857;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.9rem;
  line-height: 1;
  transition: color 0.15s;
}

.hk-clean-chip-x:hover {
  color: #dc2626;
}

.hk-stay-empty {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.hk-stay-add {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hk-stay-add .hk-date-input {
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}

/* ──────────────────────────────────────────────────────────────
   Stay Cleaned — "done today" visual states
   Green flag replaces pink when today's stay cleaning is completed.
   Button flips between "Mark Stay Cleaned" (pink) and "Undo" (green).
   ────────────────────────────────────────────────────────────── */
.hk-flag-stayclean-done {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.hk-act-stayclean {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #f9a8d4;
}
.hk-act-stayclean:hover {
  background: #fce7f3;
}

.hk-act-stayclean-done {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.hk-act-stayclean-done:hover {
  background: #bbf7d0;
}


/* ============================================================
   CLEANING SESSION (CS) MODAL  (Patch 2)
============================================================ */
.hk-session-btn {
  background: linear-gradient(135deg, #a07a22, #d4af37);
  color: #fff; border: none; border-radius: 7px;
  padding: 4px 10px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans);
  display: inline-flex; align-items: center; gap: 4px;
}
.hk-session-btn:hover { opacity: 0.92; }

.cs-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 16px;
}
.cs-modal {
  background: #fff; border-radius: 16px; width: 100%;
  max-width: 560px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.cs-modal-header {
  background: var(--navy-800, #1a365d); color: #fff; padding: 18px 20px;
  border-radius: 16px 16px 0 0;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 1;
}
.cs-modal-title { font-size: 15px; font-weight: 700; }
.cs-modal-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.cs-modal-close:hover { color: #fff; }
.cs-modal-body { padding: 20px; }
.cs-modal-footer {
  padding: 14px 20px; border-top: 1px solid #e2e8f0;
  display: flex; gap: 10px; justify-content: flex-end;
}
.cs-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #6b7280; padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0; margin: 20px 0 12px;
}
.cs-section-label:first-child { margin-top: 0; }
.cs-chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-chip {
  background: #f1f5f9; color: #64748b; border: 1.5px solid #e2e8f0;
  border-radius: 99px; padding: 6px 14px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; font-family: var(--font-sans);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.cs-chip:hover { border-color: #a07a22; }
.cs-chip.active {
  background: linear-gradient(135deg, #a07a22, #d4af37);
  color: #fff; border-color: #a07a22;
}
.cs-empty {
  padding: 12px; background: #f8fafc; border-radius: 8px;
  color: #6b7280; font-size: 0.85rem; text-align: center;
}
.cs-result-summary {
  background: #f0fdf4; border: 1.5px solid #86efac;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.cs-result-ok    { color: #15803d; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.cs-result-meta  { color: #166534; font-size: 0.78rem; }
.cs-link-box {
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: var(--navy-800, #1a365d);
  word-break: break-all; margin-bottom: 10px;
}
.cs-result-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-qr-wrap {
  margin-top: 14px; padding: 14px; background: #f8fafc;
  border-radius: 10px; text-align: center;
}
.cs-qr-wrap.hidden { display: none; }

@media (max-width: 600px) {
  .cs-modal { max-width: 100%; border-radius: 12px; }
}


/* Cleaning Session — mobile polish (Patch 2 fixes) */
.cs-chip {
  min-height: 38px;       /* tap target */
  display: inline-flex; align-items: center;
}
.cs-modal-footer {
  flex-wrap: wrap;
}
.cs-result-btns .hk-btn { flex: 1 1 auto; min-height: 40px; }
@media (max-width: 480px) {
  .cs-modal-body   { padding: 16px; }
  .cs-modal-header { padding: 14px 16px; }
  .cs-modal-footer { padding: 12px 16px; }
  .cs-modal-footer .btn-staff-save,
  .cs-modal-footer .btn-staff-cancel { flex: 1 1 auto; min-height: 44px; }
  .cs-chip { padding: 8px 14px; font-size: 0.86rem; }
  .cs-link-box { font-size: 0.72rem; }
}
