/* ================================================================
   STAFF ROOM UI — Modern smartphone-optimized dark theme
   ================================================================ */

/* ---- Staff Mode: hide header & tab bar, full screen ---- */
body.staff-mode .header,
body.staff-mode .tab-bar {
  display: none !important;
}
body.staff-mode main {
  padding: 0;
  max-width: 100%;
}
body.staff-mode {
  background: #0f1117;
  color: #e8e8ee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Staff Top Bar ---- */
.staff-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #181a24;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.staff-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.staff-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #e8e8ee;
  font-size: 1.5rem;
  border: none;
  transition: background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.staff-back-btn:active {
  background: rgba(255,255,255,.16);
}
.staff-topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-topbar-subtitle {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  font-weight: 400;
}
.staff-reload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #e8e8ee;
  font-size: 1.2rem;
  border: none;
  transition: background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.staff-reload-btn:active {
  background: rgba(255,255,255,.16);
}

/* ---- Screen 1: Floor Select ---- */
.staff-greeting {
  padding: 24px 20px 8px;
}
.staff-greeting-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.staff-greeting-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.4);
  margin-top: 4px;
}

.staff-floor-list {
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staff-floor-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #1c1e2a;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background .15s, transform .08s;
  min-height: 80px;
  -webkit-tap-highlight-color: transparent;
}
.staff-floor-btn:active {
  background: #252838;
  transform: scale(0.98);
}
.staff-floor-btn .floor-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.staff-floor-btn .floor-num {
  font-size: 1.8rem;
  font-weight: 900;
  min-width: 52px;
  color: #fff;
}
.staff-floor-btn .floor-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staff-floor-btn .floor-count {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  font-weight: 500;
}
.staff-floor-progress {
  width: 100px;
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  overflow: hidden;
}
.staff-floor-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  transition: width .3s ease;
}
.staff-floor-btn .floor-arrow {
  color: rgba(255,255,255,.25);
  font-size: 1.5rem;
  font-weight: 300;
}

/* ---- Screen 2: Room List ---- */
.staff-summary-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px 6px;
  flex-wrap: wrap;
}
.staff-summary-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.staff-room-list {
  padding: 8px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.staff-room-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .08s;
  cursor: pointer;
  min-height: 72px;
  -webkit-tap-highlight-color: transparent;
}
.staff-room-row:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}
.staff-room-num {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  min-width: 68px;
  text-align: center;
  line-height: 1;
}
.staff-room-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.staff-room-bar {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.staff-room-status-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.staff-room-guest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}
.staff-guest-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.staff-guest-count {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}
.staff-front-memo {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border-left: 3px solid rgba(255,255,255,0.4);
  border-radius: 0 6px 6px 0;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}
.staff-room-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.staff-room-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.staff-room-icon.has-report {
  background: rgba(239,108,0,.2);
  color: #ef6c00;
}
.staff-room-icon.has-message {
  background: rgba(30,136,229,.2);
  color: #42a5f5;
}

/* ---- Screen 3: Room Detail (Full Screen) ---- */
.staff-detail {
  padding: 0 0 32px;
  min-height: 100vh;
}
.staff-detail-room-header {
  text-align: center;
  padding: 20px 16px 12px;
}
.staff-detail-room-num {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.staff-detail-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.staff-detail-room-status {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
}

/* Section titles */
.staff-section {
  padding: 0 16px;
  margin-top: 20px;
}
.staff-section-title {
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  padding-left: 4px;
}

/* Status buttons */
.staff-status-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.staff-status-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #1c1e2a;
  color: #e8e8ee;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all .15s;
  min-height: 60px;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  text-align: left;
}
.staff-status-btn:active {
  transform: scale(0.98);
}
.staff-status-btn.current {
  border-color: currentColor;
  background: rgba(255,255,255,.05);
}
.staff-status-dot-lg {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.staff-status-check {
  margin-left: auto;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity .15s;
}
.staff-status-btn.current .staff-status-check {
  opacity: 1;
}

/* ---- Problem Report Section ---- */
.staff-report-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: #1c1e2a;
  border: 2px dashed rgba(239,108,0,.3);
  color: #ef6c00;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  min-height: 60px;
  -webkit-tap-highlight-color: transparent;
}
.staff-report-trigger:active {
  background: rgba(239,108,0,.08);
  transform: scale(0.98);
}
.staff-report-trigger .trigger-icon {
  font-size: 1.5rem;
}

/* Report panel (expanded) */
.staff-report-panel {
  background: #1c1e2a;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.staff-report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.staff-report-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ef6c00;
}
.staff-report-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  border: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Camera area */
.staff-camera-area {
  padding: 16px;
}
.staff-camera-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef6c00, #f57c00);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  min-height: 60px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}
.staff-camera-btn:active {
  transform: scale(0.97);
}
.staff-camera-icon {
  font-size: 1.5rem;
}

/* Photo preview grid */
.staff-photos-grid {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  flex-wrap: wrap;
}
.staff-photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: #252838;
}
.staff-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.staff-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.staff-photo-add {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 2px dashed rgba(255,255,255,.15);
  color: rgba(255,255,255,.3);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Category chips */
.staff-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
}
.staff-category-chip {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.staff-category-chip:active {
  transform: scale(0.96);
}
.staff-category-chip.selected {
  background: rgba(239,108,0,.15);
  border-color: #ef6c00;
  color: #ef6c00;
}

/* Memo input */
.staff-memo-section {
  padding: 12px 16px 16px;
}
.staff-memo-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #e8e8ee;
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.staff-memo-input:focus {
  border-color: rgba(255,255,255,.25);
}
.staff-memo-input::placeholder {
  color: rgba(255,255,255,.25);
}

/* ---- Front Message Section ---- */
.staff-msg-group {
  margin-bottom: 16px;
}
.staff-msg-group-title {
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  margin-bottom: 8px;
  padding-left: 2px;
}
.staff-msg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.staff-msg-chip {
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.staff-msg-chip:active {
  transform: scale(0.96);
}
.staff-msg-chip.selected {
  background: rgba(30,136,229,.15);
  border-color: #42a5f5;
  color: #42a5f5;
}

/* Submit button */
.staff-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  min-height: 60px;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, opacity .15s;
}
.staff-submit-btn:active {
  transform: scale(0.97);
}
.staff-submit-btn:disabled {
  opacity: .4;
  cursor: default;
}
.staff-submit-btn:disabled:active {
  transform: none;
}

/* Sent badge on room list */
.staff-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(76,175,80,.15);
  color: #66bb6a;
  font-size: .7rem;
  font-weight: 700;
  margin-top: 4px;
}

/* ---- Toast (for staff mode) ---- */
.staff-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  background: #388e3c;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.staff-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Staff Modal Override (keep for compatibility) ---- */
body.staff-mode .modal-overlay {
  background: rgba(0,0,0,.7);
}
body.staff-mode .modal-content {
  background: #181a24;
  color: #e8e8ee;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  max-width: 420px;
  margin: auto;
}
body.staff-mode .modal-header {
  background: #1c1e2a;
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px;
}
body.staff-mode .modal-header h2 {
  color: #fff;
  font-size: 1.15rem;
}
body.staff-mode .btn-close {
  color: rgba(255,255,255,.5);
  font-size: 1.4rem;
}
body.staff-mode .modal-body {
  padding: 0;
}

/* ---- Hidden file inputs ---- */
.staff-file-input {
  display: none !important;
}

/* ---- Safe area padding for iPhone ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .staff-detail {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
  .staff-floor-list {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
  .staff-room-list {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

/* ---- Divider ---- */
.staff-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 8px 16px;
}

/* ---- Floor Dots (room status icons on floor select) ---- */
.staff-floor-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.staff-floor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Start Cleaning Button (Screen 3: before status) ---- */
.staff-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  min-height: 72px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}
.staff-start-btn:active {
  transform: scale(0.97);
}
.staff-start-icon {
  font-size: 1.5rem;
}

/* ---- Complete Cleaning Button (Screen 3: cleaning status) ---- */
.staff-complete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #388e3c, #4caf50);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  min-height: 72px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}
.staff-complete-btn:active {
  transform: scale(0.97);
}

/* ---- Done Message (Screen 3: done status) ---- */
.staff-done-message {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #4caf50;
  padding: 32px 16px;
}

/* ---- Detail Header extras ---- */
.staff-detail-guest {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  margin-top: 8px;
}
.staff-detail-memo {
  font-size: .9rem;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.1);
  border-left: 3px solid rgba(255,255,255,.4);
  border-radius: 0 8px 8px 0;
  padding: 6px 10px;
  margin: 10px auto 0;
  max-width: 280px;
  text-align: left;
  line-height: 1.4;
}
.staff-detail-inspection-flag {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  border-radius: 12px;
  background: rgba(255,152,0,.15);
  color: #ffb300;
  font-size: .9rem;
  font-weight: 700;
}

/* ---- Undo Button ---- */
.staff-undo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.staff-undo-btn:active {
  background: rgba(255,255,255,.15);
}

/* ---- Custom Confirm Dialog ---- */
.staff-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.staff-confirm-overlay.visible {
  opacity: 1;
}
.staff-confirm-dialog {
  background: #1c1e2a;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform .2s ease;
}
.staff-confirm-overlay.visible .staff-confirm-dialog {
  transform: scale(1);
}
.staff-confirm-msg {
  padding: 28px 24px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.5;
}
.staff-confirm-btns {
  display: flex;
  border-top: 1px solid rgba(255,255,255,.08);
}
.staff-confirm-cancel,
.staff-confirm-ok {
  flex: 1;
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.staff-confirm-cancel {
  background: transparent;
  color: rgba(255,255,255,.5);
  border-right: 1px solid rgba(255,255,255,.08);
}
.staff-confirm-cancel:active {
  background: rgba(255,255,255,.06);
}
.staff-confirm-ok {
  background: transparent;
  color: #42a5f5;
}
.staff-confirm-ok:active {
  background: rgba(66,165,245,.1);
}

/* ---- Inspection flag on room list bar ---- */
.staff-inspection-flag {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,152,0,.5);
  padding: 2px 8px;
  border-radius: 6px;
}
