/* =============================================
   Staff Panel Styles
   ============================================= */

/* ── Header (role-colored banner) ── */
.staff-header{
  display:flex;
  align-items:center;
  gap:16px;
  padding:20px 24px;
  border-radius:var(--radius);
  background:var(--role-bg, #f8f9fa);
  border:1px solid var(--role-border, var(--border));
  margin-bottom:20px;
}
.staff-header-icon{
  font-size:40px;
  line-height:1;
  width:56px;
  height:56px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:rgba(255,255,255,.7);
  border:1px solid var(--role-border, var(--border));
  flex-shrink:0;
}
.staff-header-title{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:var(--role-color, var(--text));
}
.staff-header-sub{
  margin:4px 0 0;
  font-size:13px;
  color:var(--muted);
}

/* ── Stats grid (admin) ── */
.staff-stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(130px, 1fr));
  gap:12px;
  margin-bottom:20px;
}
.staff-stat-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  text-align:center;
  border-top:3px solid var(--accent, var(--primary));
}
.staff-stat-value{
  font-size:28px;
  font-weight:900;
  color:var(--accent, var(--primary));
  line-height:1.1;
}
.staff-stat-label{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* ── Tabs ── */
.staff-tabs{
  display:flex;
  gap:4px;
  border-bottom:2px solid var(--border);
  margin-bottom:16px;
  padding-bottom:0;
  overflow-x:auto;
}
.staff-tab{
  padding:8px 16px;
  border:none;
  background:none;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  color:var(--muted);
  border-bottom:2px solid transparent;
  margin-bottom:-2px;
  white-space:nowrap;
  transition:color .15s, border-color .15s;
}
.staff-tab:hover{
  color:var(--text);
}
.staff-tab.active{
  color:var(--role-color, var(--primary));
  border-bottom-color:var(--role-color, var(--primary));
}
.staff-tab-content{
  display:none;
}
.staff-tab-content.active{
  display:block;
}

/* ── Card ── */
.staff-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px 20px;
  margin-bottom:14px;
}
.staff-card h3{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
}

/* ── Section ── */
.staff-section{
  margin-bottom:20px;
}
.staff-section h3{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
}

/* ── Search row ── */
.staff-search-row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:12px;
}
.staff-search-row .input{
  flex:1;
}

/* ── Form grids ── */
.staff-form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:8px;
  align-items:end;
}
.staff-form-col{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* ── User list ── */
.staff-user-list{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.staff-user-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:var(--soft, #fbfcff);
  border:1px solid var(--border);
  text-decoration:none;
  color:var(--text);
  transition:background .12s;
  flex-wrap:wrap;
}
.staff-user-row:hover{
  background:rgba(37,99,235,.04);
  text-decoration:none;
}
.staff-user-name{
  font-weight:600;
  min-width:80px;
}
.staff-user-level{
  font-size:12px;
  color:var(--muted);
}

/* ── Badges ── */
.staff-badge{
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:2px 8px;
  border-radius:6px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
}
.staff-badge--admin{
  background:#fef2f2;
  color:#dc2626;
  border:1px solid #fecaca;
}
.staff-badge--police{
  background:#eff6ff;
  color:#2563eb;
  border:1px solid #bfdbfe;
}
.staff-badge--moderator{
  background:#ecfdf5;
  color:#059669;
  border:1px solid #a7f3d0;
}
.staff-badge--curator{
  background:#fffbeb;
  color:#d97706;
  border:1px solid #fde68a;
}

/* ── Tables ── */
.staff-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.staff-table th{
  text-align:left;
  font-weight:600;
  color:var(--muted);
  padding:8px 10px;
  border-bottom:2px solid var(--border);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.staff-table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
.staff-table tr:last-child td{
  border-bottom:none;
}
.staff-action-code{
  background:rgba(2,6,23,.05);
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
}
.staff-log-details{
  max-width:200px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ── Alerts ── */
.staff-alert{
  padding:12px 16px;
  border-radius:10px;
  font-size:13px;
  line-height:1.5;
}
.staff-alert--danger{
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#991b1b;
}
.staff-alert--warning{
  background:#fffbeb;
  border:1px solid #fde68a;
  color:#92400e;
}
.staff-alert--info{
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e40af;
}

/* ── DL (definition list) ── */
.staff-dl{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:6px 12px;
  font-size:13px;
  margin:0;
}
.staff-dl dt{
  color:var(--muted);
  font-weight:500;
}
.staff-dl dd{
  margin:0;
  font-weight:600;
}

/* ── User detail grid ── */
.staff-user-detail-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:14px;
  margin-bottom:16px;
}

/* ── Actions section ── */
.staff-actions-section{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:14px;
  margin-bottom:16px;
}

/* ── Quick actions (police) ── */
.staff-quick-actions{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));
  gap:14px;
  margin-bottom:20px;
}

/* ── Role actions ── */
.staff-role-actions{
  display:flex;
  gap:6px;
  align-items:center;
  margin-left:auto;
}
.staff-role-actions .input{
  width:160px;
  padding:6px 8px;
  font-size:12px;
}

/* ── Tournament cards ── */
.staff-tournament-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.staff-tournament-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px 20px;
}
.staff-tournament-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:8px;
}
.staff-tournament-header h4{
  margin:0;
  font-size:16px;
  font-weight:700;
}
.staff-tournament-meta{
  display:flex;
  gap:16px;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
  flex-wrap:wrap;
}
.staff-tournament-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}

/* Tournament status pills */
.staff-tournament-status{
  display:inline-flex;
  padding:2px 10px;
  border-radius:20px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.03em;
}
.staff-tournament-status--draft{
  background:#f1f5f9;
  color:#475569;
}
.staff-tournament-status--registration{
  background:#dbeafe;
  color:#1e40af;
}
.staff-tournament-status--in_progress{
  background:#dcfce7;
  color:#166534;
}
.staff-tournament-status--finished{
  background:#f3e8ff;
  color:#6b21a8;
}
.staff-tournament-status--cancelled{
  background:#fee2e2;
  color:#991b1b;
}

/* Participant status */
.staff-participant-status{
  font-size:11px;
  font-weight:600;
  padding:1px 6px;
  border-radius:4px;
}
.staff-participant-status--registered{
  background:#dbeafe;
  color:#1e40af;
}
.staff-participant-status--checked_in{
  background:#dcfce7;
  color:#166534;
}
.staff-participant-status--eliminated{
  background:#fee2e2;
  color:#991b1b;
}
.staff-participant-status--winner{
  background:#fef9c3;
  color:#854d0e;
}
.staff-participant-status--disqualified{
  background:#f1f5f9;
  color:#64748b;
  text-decoration:line-through;
}

/* ── Btn small helper ── */
.btn.small{
  padding:4px 10px;
  font-size:12px;
  border-radius:8px;
}

/* ── Role-specific panel tints ── */
.staff-admin .staff-tabs .staff-tab.active{
  color:#dc2626;
  border-bottom-color:#dc2626;
}
.staff-police .staff-tabs .staff-tab.active{
  color:#2563eb;
  border-bottom-color:#2563eb;
}
.staff-moderator .staff-tabs .staff-tab.active{
  color:#059669;
  border-bottom-color:#059669;
}
.staff-curator .staff-tabs .staff-tab.active{
  color:#d97706;
  border-bottom-color:#d97706;
}

/* Admin panel — red accent on stat cards by default */
.staff-admin .staff-stat-card{
  --accent:#dc2626;
}

/* ── News management ── */
.staff-news-form textarea.input{
  min-height:80px;
}
.staff-news-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.staff-news-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--card);
  transition:background .12s;
  flex-wrap:wrap;
}
.staff-news-row:hover{
  background:rgba(37,99,235,.02);
}
.staff-news-row__main{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  min-width:0;
}
.staff-news-row__badge{
  font-size:24px;
  flex-shrink:0;
  line-height:1;
}
.staff-news-row__info{
  min-width:0;
  flex:1;
}
.staff-news-row__title{
  font-weight:700;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.staff-news-row__meta{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:3px;
  font-size:12px;
  flex-wrap:wrap;
}
.staff-news-row__actions{
  display:flex;
  gap:6px;
  flex-shrink:0;
  flex-wrap:wrap;
}

/* News edit modal (inline) */
.staff-news-edit-overlay{
  position:fixed;
  inset:0;
  z-index:950;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(2,6,23,.3);
}
.staff-news-edit-dialog{
  width:min(600px, 100%);
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 20px 60px rgba(2,6,23,.18);
  padding:24px;
}
.staff-news-edit-dialog h3{
  margin:0 0 16px;
  font-size:18px;
}
.staff-news-edit-dialog .form-row{
  margin-top:12px;
}
.staff-news-edit-actions{
  display:flex;
  gap:10px;
  margin-top:16px;
  justify-content:flex-end;
}

/* ── Responsive ── */
@media (max-width:640px){
  .staff-header{
    flex-direction:column;
    text-align:center;
    padding:16px;
  }
  .staff-stats-grid{
    grid-template-columns:repeat(2, 1fr);
  }
  .staff-form-grid{
    grid-template-columns:1fr;
  }
  .staff-user-detail-grid,
  .staff-actions-section,
  .staff-quick-actions{
    grid-template-columns:1fr;
  }
  .staff-role-actions{
    margin-left:0;
    margin-top:6px;
    width:100%;
  }
  .staff-dl{
    grid-template-columns:1fr;
  }
  .staff-dl dt{
    margin-top:6px;
  }
  .staff-news-row{
    flex-direction:column;
    align-items:flex-start;
  }
  .staff-news-row__actions{
    width:100%;
  }
  .staff-news-form .staff-form-grid{
    grid-template-columns:1fr !important;
  }
}

/* Autocomplete (roaming species/item) */
.staff-autocomplete-list{
  position:absolute;
  z-index:100;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  max-height:220px;
  overflow-y:auto;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  margin-top:2px;
}
.staff-autocomplete-item{
  padding:8px 12px;
  cursor:pointer;
  font-size:14px;
}
.staff-autocomplete-item:hover{
  background:var(--bg-soft);
}
.staff-autocomplete-wrap{ position:relative; }
