/* Shared design system for the Staff module (staff-facing pages).
   Violet -> Fuchsia -> Rose gradient, white rounded cards, soft shadows.
   Mirrors mess/assets/mess.css / library/assets/library.css structure with a staff- prefix. */

:root {
  --staff-violet: #7c3aed;
  --staff-primary: #9333ea;
  --staff-rose: #db2777;
  --staff-green: #16a34a;
  --staff-ink: #2e1065;
  --staff-muted: #8b7f9e;
  --staff-bg: #faf5ff;
  --staff-card-radius: 20px;
}

* { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, .staff-brand-text, .staff-btn-primary { font-family: 'Poppins', sans-serif; }

/* ---------- Auth / registration pages ---------- */
.staff-auth-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 35%, #a855f7 70%, #db2777 100%);
  background-attachment: fixed;
}

.staff-auth-shell { width: 100%; max-width: 430px; }
.staff-auth-shell.staff-auth-wide { max-width: 760px; }

.staff-brand-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.staff-brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; backdrop-filter: blur(6px);
}
.staff-brand-logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: contain;
  background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.35);
  padding: 4px; flex-shrink: 0;
}
.staff-brand-text { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .04em; line-height: 1.1; text-align: left; }
.staff-brand-text small { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .14em; color: rgba(255,255,255,.75); }

.staff-auth-card {
  background: #fff;
  border-radius: var(--staff-card-radius);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(80,20,140,.35);
  animation: staffPop .35s ease-out;
}
@keyframes staffPop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }

.staff-input-icon { position: relative; }
.staff-input-icon > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--staff-primary); z-index: 2; }
.staff-input-icon .form-control, .staff-input-icon .form-select { padding-left: 2.4rem; border-radius: 12px; border: 1.5px solid #ede4fb; background: #faf7ff; }
.staff-input-icon .form-control:focus, .staff-input-icon .form-select:focus { border-color: var(--staff-primary); box-shadow: 0 0 0 4px rgba(147,51,234,.12); background: #fff; }
.staff-input-icon input[type="password"], .staff-input-icon input[type="text"].staff-password-revealed { padding-right: 2.4rem; }
.staff-input-icon .password-toggle-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: none; background: none; color: #8b7f9e; padding: .2rem; line-height: 1; cursor: pointer;
}
.staff-input-icon .password-toggle-btn:hover { color: var(--staff-primary); }

.staff-btn-primary {
  background: linear-gradient(120deg, var(--staff-violet), var(--staff-primary) 55%, var(--staff-rose));
  background-size: 200% 200%;
  border: none; color: #fff; font-weight: 700;
  padding: .75rem 1rem; border-radius: 12px;
  box-shadow: 0 10px 24px rgba(147,51,234,.35);
  transition: transform .15s, box-shadow .15s, background-position .4s;
}
.staff-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(147,51,234,.45); background-position: 100% 0; color: #fff; }
.staff-btn-primary:disabled { opacity: .7; transform: none; cursor: not-allowed; }

.staff-link { color: var(--staff-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.staff-link:hover { text-decoration: underline; color: var(--staff-rose); }

.staff-req { color: #ef4444; }

/* ---------- App shell (header + bottom nav + content) ---------- */
body.staff-app-body {
  background: var(--staff-bg);
  min-height: 100vh;
  margin: 0;
  padding-bottom: 90px; /* clears the floating bottom nav */
}

.staff-card {
  background: #fff; border-radius: var(--staff-card-radius);
  box-shadow: 0 8px 24px rgba(80,20,140,.08); border: 1px solid rgba(80,20,140,.05);
}

.staff-app-header {
  background: linear-gradient(120deg, var(--staff-violet), var(--staff-primary) 60%, var(--staff-rose));
  color: #fff;
  padding: 14px 16px 20px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 28px rgba(147,51,234,.28);
  position: sticky; top: 0; z-index: 1030;
}
.staff-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.staff-profile-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.staff-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Poppins', sans-serif;
}
.staff-profile-link .staff-greet-name { font-weight: 700; font-family: 'Poppins', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.staff-profile-link .staff-greet-sub { font-size: .68rem; opacity: .8; }
.staff-header-icons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.staff-header-icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; text-decoration: none; transition: background .15s; cursor: pointer;
}
.staff-header-icon-btn:hover { background: rgba(255,255,255,.3); color: #fff; }
.staff-header-badge {
  position: absolute; top: -4px; right: -4px; background: #fff; color: var(--staff-primary); font-size: .62rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.staff-coin-badge {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 38px; padding: 0 12px; border-radius: 19px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; text-decoration: none; transition: background .15s;
}
.staff-coin-badge:hover { background: rgba(255,255,255,.3); color: #fff; }
.staff-coin-icon { font-size: 1rem; line-height: 1; }
.staff-coin-amount { font-weight: 800; font-family: 'Poppins', sans-serif; font-size: .9rem; white-space: nowrap; }

.staff-app-content { max-width: 720px; margin: 0 auto; padding: 16px; }

.staff-bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(80,20,140,.2);
  display: flex; gap: 2px; border-radius: 22px; padding: 6px;
  border: 1px solid rgba(237,228,251,.8);
  overflow-x: auto;
}
.staff-bottom-nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: .5rem 0; color: #8b7f9e; text-decoration: none; font-size: .6rem; font-weight: 700;
  border-radius: 16px; transition: color .2s, background .2s, box-shadow .2s; white-space: nowrap; min-width: 52px;
}
.staff-bottom-nav-link i { font-size: 1.15rem; transition: transform .2s; }
.staff-bottom-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-primary));
  box-shadow: 0 8px 18px rgba(147,51,234,.35);
}
.staff-bottom-nav-link.active i { transform: translateY(-1px) scale(1.08); }
.staff-bottom-nav-link:not(.active):hover { color: var(--staff-primary); background: var(--staff-bg); }

.staff-fab {
  position: fixed; right: 18px; bottom: 88px; z-index: 1060;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-rose));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  box-shadow: 0 14px 30px rgba(147,51,234,.4); text-decoration: none;
}
.staff-fab:hover { color: #fff; transform: translateY(-2px); }

/* ---------- Home dashboard ---------- */
.staff-stat-grid { margin-top: 12px; }
.staff-stat-card {
  background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 10px 26px rgba(80,20,140,.1);
  height: 100%;
}
.staff-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; margin-bottom: 10px;
}
.staff-stat-value { font-size: 1.25rem; font-weight: 800; font-family: 'Poppins', sans-serif; line-height: 1.2; }
.staff-stat-label { font-size: .74rem; color: #8b7f9e; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Profile page ---------- */
.staff-profile-hero {
  position: relative; overflow: hidden; text-align: center; border-radius: 22px; padding: 30px 20px;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-primary) 55%, var(--staff-rose));
  color: #fff; box-shadow: 0 14px 34px rgba(147,51,234,.3);
}
.staff-profile-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.staff-profile-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.staff-profile-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }
.staff-profile-hero-avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; font-family: 'Poppins', sans-serif;
}
.staff-profile-status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff;
}
.staff-profile-status-pill i { font-size: .5rem; color: #f1f5f9; }
.staff-profile-status-pill.is-active i { color: #4ade80; }

.staff-info-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1e9fb; }
.staff-info-row:last-child { border-bottom: none; padding-bottom: 2px; }
.staff-info-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--staff-bg); color: var(--staff-primary); box-shadow: inset 0 0 0 1.5px #ede4fb;
  display: flex; align-items: center; justify-content: center;
}
.staff-info-label { font-size: .68rem; color: var(--staff-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.staff-info-value { font-weight: 700; color: var(--staff-ink); }

.staff-history-row {
  display: flex; align-items: center; gap: 10px; background: var(--staff-bg);
  border-radius: 14px; padding: 10px 14px;
}
.staff-history-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #fff; color: var(--staff-primary); box-shadow: inset 0 0 0 1.5px #ede4fb;
  display: flex; align-items: center; justify-content: center;
}
.staff-history-body { flex: 1; min-width: 0; }
.staff-history-status { font-size: .68rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.staff-history-status-present { background: #dcfce7; color: #15803d; }
.staff-history-status-late { background: #fef3c7; color: #92400e; }
.staff-history-status-half_day { background: #fef3c7; color: #92400e; }
.staff-history-status-absent { background: #fee2e2; color: #b91c1c; }

/* ---------- Modern confirm / success modal (replaces native window.confirm) ---------- */
.staff-confirm-modal { border: none; border-radius: 22px; overflow: hidden; }
.staff-confirm-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-primary));
  color: #fff; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(147,51,234,.3);
}

.staff-success-modal { border: none; border-radius: 24px; overflow: hidden; }
.staff-success-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-primary) 55%, var(--staff-rose));
  color: #fff; text-align: center; padding: 34px 20px 42px;
}
.staff-success-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.staff-success-blob-1 { width: 140px; height: 140px; top: -60px; right: -40px; }
.staff-success-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(219,39,119,.25); }
.staff-success-check {
  position: relative; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--staff-primary);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  margin: 0 auto 14px; box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

/* ---------- QR Scanner page ---------- */
.verified-stamp {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; letter-spacing: .05em;
  color: var(--staff-green); border: 2px solid var(--staff-green); border-radius: .6rem;
  padding: .35rem .9rem; transform: rotate(-3deg); font-size: 1.05rem;
}
.verified-stamp-invalid { color: #dc2626; border-color: #dc2626; }

/* ---------- Attendance report rows ---------- */
.staff-report-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1e9fb; }
.staff-report-row:last-child { border-bottom: none; padding-bottom: 2px; }
.staff-report-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--staff-violet), var(--staff-primary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; font-family: 'Poppins', sans-serif;
}
.staff-report-body { flex: 1; min-width: 0; }
.staff-report-name { font-weight: 700; color: var(--staff-ink); font-size: .88rem; }
.staff-report-code { font-size: .7rem; color: var(--staff-muted); }
.staff-report-metrics { display: flex; gap: 6px; flex-shrink: 0; }
.staff-report-metric {
  min-width: 30px; text-align: center; border-radius: 8px; padding: 3px 6px; font-size: .74rem; font-weight: 800;
}
.staff-report-metric-label { display: block; font-size: .55rem; font-weight: 700; opacity: .75; text-transform: uppercase; }

/* ---------- Complaints & Help (mirrors mess's complaint-* classes) ---------- */
.staff-mode-group { display: flex; gap: 8px; background: var(--staff-bg); border-radius: 14px; padding: 4px; }
.staff-mode-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 11px; border: none; background: transparent;
  color: var(--staff-muted); font-weight: 700; font-size: .85rem; transition: background .15s, color .15s;
}
.staff-mode-btn.active { background: #fff; color: var(--staff-primary); box-shadow: 0 4px 12px rgba(147,51,234,.15); }

.staff-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.staff-category-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: 12px; border: 1.5px solid #ede4fb; background: var(--staff-bg); color: var(--staff-ink);
  font-size: .66rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .15s, background .15s, color .15s;
}
.staff-category-chip i { font-size: 1.05rem; color: var(--staff-primary); }
.staff-category-chip:hover { border-color: var(--staff-primary); }
.staff-category-chip.active {
  background: linear-gradient(120deg, var(--staff-violet), var(--staff-primary) 60%, var(--staff-rose));
  border-color: transparent; color: #fff;
}
.staff-category-chip.active i { color: #fff; }

.staff-photo-dropzone {
  border: 2px dashed #ede4fb; border-radius: 16px; background: var(--staff-bg);
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--staff-muted); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.staff-photo-dropzone:hover { border-color: var(--staff-primary); background: #fff; }
.staff-photo-dropzone img { max-width: 100%; max-height: 180px; display: block; }
.staff-photo-thumb { max-height: 130px; border-radius: 12px; border: 1px solid #ede4fb; display: block; }

.staff-complaint-reply {
  background: var(--staff-bg); border-radius: 12px; padding: 10px 12px; font-size: .85rem;
  border-left: 3px solid var(--staff-primary); margin-top: 6px;
}
.staff-complaint-reply i { color: var(--staff-primary); }

/* Voice recorder - used both by staff (voice complaint) and admin (voice
   reply); .recording pulses the mic button red while capturing. */
.staff-record-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: 14px; border: 1.5px dashed #ede4fb;
  background: var(--staff-bg); color: var(--staff-primary); font-weight: 700; font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.staff-record-btn:hover { border-color: var(--staff-primary); }
.staff-record-btn.recording {
  border-style: solid; border-color: #dc2626; background: #fef2f2; color: #dc2626;
  animation: staffRecordPulse 1.4s ease-in-out infinite;
}
@keyframes staffRecordPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.staff-record-timer { font-variant-numeric: tabular-nums; }
.staff-audio-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.staff-audio-preview audio { flex: 1; height: 36px; }

::placeholder { color: #c4b8dc; opacity: 1; }
