/* ============================================================
   S-PRESSO STAFF DASHBOARD — staff.css v2
   Staff Tab — payment-style layout
   ============================================================ */

/* ── TAB WRAPPER ─────────────────────────────────────────── */
.staff-wrap {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; max-width: 1400px; margin: 0 auto;
}

/* ── TOP BAR (title + centered add button) ───────────────── */
.staff-top-bar {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--white); border: 2px solid var(--gray-200);
  border-radius: 10px; padding: 16px;
  text-align: center;
}
.staff-tab-title {
  font-size: 17px; font-weight: 700; color: #1a365d;
}
.btn-add-staff {
  padding: 10px 28px;
  background: #1a365d;
  color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-add-staff:active { opacity: 0.8; }

/* ── METRICS ─────────────────────────────────────────────── */
.staff-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.staff-metric {
  background: var(--white); border: 2px solid var(--gray-200);
  border-radius: 10px; padding: 14px 16px;
}
.staff-metric-label {
  font-size: 0.72rem; font-weight: 700; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.staff-metric-value { font-size: 1.6rem; font-weight: 800; color: #1a365d; }
.staff-metric-gold  .staff-metric-value { color: #a07a22; }
.staff-metric-green .staff-metric-value { color: #10b981; }
.staff-metric-blue  .staff-metric-value { color: #2563eb; }
.staff-metric-pink  .staff-metric-value { color: #db2777; }

/* ── FILTER ROW ──────────────────────────────────────────── */
.staff-filter-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--white); border: 2px solid var(--gray-200);
  border-radius: 10px; padding: 12px 16px;
}
.staff-filter-pill {
  padding: 6px 16px; border-radius: 20px;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  font-size: 13px; font-weight: 600; color: #4a5568;
  cursor: pointer; transition: 0.15s; white-space: nowrap;
}
.staff-filter-pill.active {
  background: #1a365d; color: #fff; border-color: #1a365d;
}

/* ── PENDING SECTION ─────────────────────────────────────── */
.pending-section {
  background: #fffbeb; border: 2px solid #fde68a;
  border-radius: 10px; overflow: hidden;
}
.pending-section-header {
  background: #fef3c7; padding: 10px 16px;
  font-size: 12px; font-weight: 700; color: #92400e;
}
.pending-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid #fde68a; font-size: 13px;
}
.btn-activate {
  padding: 5px 14px; background: #10b981; color: #fff;
  border: none; border-radius: 6px; font-size: 12px;
  font-weight: 700; cursor: pointer;
}

/* ── SECTION DIVIDERS (Office / Front Desk / etc.) ───────── */
.staff-section-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0;
}
.staff-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: #6b7280; white-space: nowrap;
}
.staff-section-line {
  flex: 1; height: 1px; background: #e2e8f0;
}

/* ── GRID ────────────────────────────────────────────────── */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ── CARD ────────────────────────────────────────────────── */
.staff-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border: 2px solid var(--gray-200);
  transition: transform 0.15s, box-shadow 0.15s;
}
.staff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.staff-card-header {
  background: #1a365d; padding: 20px 16px 16px;
  text-align: center; position: relative;
}

/* Status badge */
.staff-status-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.staff-status-badge.active   { background: #10b981; color: #fff; }
.staff-status-badge.inactive { background: #6b7280; color: #fff; }

/* Birthday / warning icon */
.staff-bday-badge {
  position: absolute; top: 8px; right: 10px;
  font-size: 20px; line-height: 1;
}

/* QR button on card */
.staff-qr-btn {
  position: absolute; bottom: 10px; right: 10px;
  padding: 3px 10px; background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
  font-size: 11px; font-weight: 700; color: #d4af37;
  cursor: pointer; transition: 0.15s;
}
.staff-qr-btn:hover { background: rgba(255,255,255,0.25); }

/* Avatar */
.staff-avatar-wrap {
  width: 88px; height: 88px; margin: 0 auto 12px; position: relative;
}
.staff-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px solid #a07a22; object-fit: cover; display: block;
  cursor: pointer; transition: opacity 0.2s;
}
.staff-avatar:hover { opacity: 0.85; }
.staff-initials {
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px solid #a07a22; background: #2d4a7a;
  display: none; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: #d4af37;
  position: absolute; top: 0; left: 0;
}

.staff-card-name { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.staff-card-id   { color: #d4af37; font-size: 11px; letter-spacing: 1.5px; }

/* Card body */
.staff-card-body { padding: 14px 16px 12px; }
.staff-info-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #4a5568; margin-bottom: 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-info-icon { flex-shrink: 0; }

/* Tags */
.staff-card-tags {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; flex-wrap: wrap;
}
.staff-tag { padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.dept-office     { background: #ede9fe; color: #5b21b6; }
.dept-frontdesk  { background: #dbeafe; color: #1e40af; }
.dept-cleaning   { background: #d1fae5; color: #065f46; }
.dept-restaurant { background: #fef3c7; color: #92400e; }
.type-fulltime   { background: #dcfce7; color: #166534; }
.type-parttime   { background: #fef9c3; color: #854d0e; }

.staff-edit-btn {
  margin-left: auto; padding: 4px 12px;
  background: transparent; border: 1px solid #e2e8f0;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  color: #718096; cursor: pointer; transition: 0.15s;
}
.staff-edit-btn:hover { border-color: #a07a22; color: #a07a22; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.staff-empty {
  grid-column: 1 / -1; text-align: center;
  padding: 60px 20px; color: #9ca3af;
}
.staff-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── SKELETON ────────────────────────────────────────────── */
.staff-skeleton {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border: 2px solid var(--gray-200);
}
.sk-staff-header { height: 150px; background: #e2e8f0; animation: sk-pulse 1.5s infinite; }
.sk-staff-body   { padding: 14px 16px; }
.sk-staff-line {
  height: 11px; background: #e2e8f0; border-radius: 4px;
  margin-bottom: 10px; animation: sk-pulse 1.5s infinite;
}
.sk-staff-line.short { width: 55%; }
@keyframes sk-pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ── LIGHTBOX ────────────────────────────────────────────── */
.staff-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 2000; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.staff-lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 12px; border: 3px solid #a07a22;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── MODAL ───────────────────────────────────────────────── */
.staff-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;
}
.staff-modal {
  background: #fff; border-radius: 16px; width: 100%;
  max-width: 500px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.staff-modal-header {
  background: #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;
}
.staff-modal-title  { font-size: 15px; font-weight: 700; }
.staff-modal-close  { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 20px; cursor: pointer; }
.staff-modal-close:hover { color: #fff; }
.staff-modal-body   { padding: 20px; }
.staff-form-section {
  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 14px;
}
.staff-form-section:first-child { margin-top: 0; }
.staff-form-group   { margin-bottom: 14px; }
.staff-form-label   { display: block; font-size: 12px; font-weight: 600; color: #1a365d; margin-bottom: 5px; }
.staff-form-input, .staff-form-select {
  width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: #fff; color: #333; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
}
.staff-form-input:focus, .staff-form-select:focus { border-color: #a07a22; outline: none; }
.staff-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.staff-modal-footer {
  padding: 14px 20px; border-top: 1px solid #e2e8f0;
  display: flex; gap: 10px; justify-content: flex-end;
}
.btn-staff-save {
  padding: 10px 22px;
  background: linear-gradient(135deg, #a07a22, #d4af37);
  color: #fff; border: none; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn-staff-save:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-staff-cancel {
  padding: 10px 18px; background: #f1f5f9; color: #64748b;
  border: none; border-radius: 8px; font-weight: 600;
  font-size: 14px; cursor: pointer;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .staff-metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .staff-grid    { grid-template-columns: 1fr; }
  .staff-metrics { grid-template-columns: repeat(2, 1fr); }
  .staff-form-row { grid-template-columns: 1fr; }
}
.btn-staff-danger {
  padding: 8px 12px; background: #dc2626; color: #fff;
  border: none; border-radius: 8px; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.btn-staff-danger:hover { opacity: 0.85; }
.btn-staff-warning {
  padding: 8px 12px; background: #f59e0b; color: #fff;
  border: none; border-radius: 8px; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.btn-staff-warning:hover { opacity: 0.85; }


/* ── Step 4: position subtitle + language chips on card ── */
.staff-card-position {
  font-size: 12px;
  color: #fbbf24;
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.staff-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 4px 0;
}
.staff-lang-chip {
  display: inline-block;
  padding: 2px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  border-radius: 10px;
  font-weight: 500;
}


/* ── Step 5: Edit modal language picker chips ── */
.lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}
.lang-chips:empty { display: none; }
.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  background: #1e3a5f;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
}
.lang-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
.lang-chip-x:hover { background: rgba(255,255,255,0.35); }


/* ============ STAFF SUB-TAB NAV (matches pricing-mode-toggle) ============ */
.staff-sub-nav {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 2px;
}
.staff-sub-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}
.staff-sub-btn:hover { color: var(--navy-800); }
.staff-sub-btn.active {
  background: var(--navy-800);
  color: var(--white);
}
.staff-sub-content.hidden { display: none; }

/* ============ ACTIVITY LOG ============ */
.alog-filter-bar { margin-bottom: 14px; }
.alog-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-500);
  background: var(--white);
  border-radius: 12px;
}
.alog-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.alog-time {
  color: var(--gray-500);
  font-family: monospace;
  font-size: 0.78rem;
  min-width: 140px;
}
.alog-cat-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 90px;
  text-align: center;
}
.alog-who { font-weight: 600; color: var(--navy-800); min-width: 160px; }
.alog-action { color: var(--gray-700); font-family: monospace; font-size: 0.82rem; }
.alog-prop {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.75rem;
  font-family: monospace;
}
.alog-target {
  color: var(--gray-500);
  font-family: monospace;
  font-size: 0.78rem;
}
