/* ============================================
   Admin console styles
============================================ */

body.admin-page { background: var(--bg); }

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* Stat tiles */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-tile {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}
.stat-tile.gold   { border-left-color: var(--gold); }
.stat-tile.red    { border-left-color: var(--red); }
.stat-tile.sky    { border-left-color: var(--sky); }
.stat-label {
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.stat-value {
  font-size: 30px; font-weight: 800; color: var(--navy);
  line-height: 1.1; margin-top: 2px;
}
.stat-trend { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Tabs */
.admin-tabs {
  display: flex; gap: 4px;
  background: #fff;
  padding: 10px 14px 0;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow-x: auto;
}
.admin-tab {
  padding: 10px 18px;
  font-weight: 600; font-size: 14px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.admin-tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.admin-tab:hover:not(.active) { color: var(--navy); }

.admin-tab-pane {
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 18px;
}
.admin-tab-pane.active { display: block; }

/* Toolbar inside tabs */
.admin-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-toolbar input[type=search] { flex: 1; min-width: 220px; }
.admin-toolbar select { max-width: 180px; }
.user-actions .role-select { padding: 4px 6px; font-size: 0.85em; max-width: 130px; }

/* Table */
.table-wrap { overflow-x: auto; }
.admin-tab-pane table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-tab-pane table th {
  text-align: left;
  background: #f5f7fb;
  color: var(--navy);
  padding: 10px 12px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1.5px solid var(--border);
  position: sticky; top: 0;
}
.admin-tab-pane table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-tab-pane table tr:hover td { background: #fafbfd; }
.admin-tab-pane table td:last-child { text-align: right; }
.row-action {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--navy);
  background: #fff;
}
.row-action:hover { border-color: var(--blue); background: var(--type-presentation-bg); }
.row-action.danger { color: var(--red-text); border-color: #f4caca; }
.row-action.danger:hover { background: var(--type-workshop-bg); }

/* Pending speaker request: tint the row so it stands out in the user list. */
.admin-tab-pane table tr.row-pending td { background: #fffaf0; }
.admin-tab-pane table tr.row-pending:hover td { background: #fff4d6; }
/* Inline decision buttons (Approve / Decline / Delete). Compact + right-
   aligned; override the global .btn-primary width:100% so they sit in a row. */
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-actions .btn-primary,
.user-actions .btn-secondary {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Inline form */
.admin-inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.admin-inline-form .full { grid-column: 1 / -1; }
.admin-inline-form button { grid-column: 1 / -1; max-width: 240px; }

/* Stats list (sessions tab) */
.session-stat-row {
  display: flex; gap: 14px; align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.session-stat-row:last-child { border-bottom: none; }
.session-stat-row .meta {
  flex: 1; min-width: 0;
}
.session-stat-row .title {
  font-weight: 700; color: var(--navy);
  margin: 0 0 2px;
}
.session-stat-row .sub {
  font-size: 12px; color: var(--muted);
}
.session-stat-row .bar {
  width: 240px;
  height: 10px;
  background: var(--border); border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.session-stat-row .bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 999px;
  transition: width .3s;
}
.session-stat-row .counts {
  display: flex; gap: 10px;
  font-size: 12px;
}
.session-stat-row .count-pill {
  background: #f5f7fb;
  padding: 3px 8px; border-radius: 4px;
  color: var(--navy);
  font-weight: 600;
}
.session-stat-row .count-pill.virtual { background: var(--type-reception-bg); color: var(--blue); }
.session-stat-row .count-pill.in-person { background: var(--type-in-person-bg); color: var(--type-in-person); }
.session-stat-row .total-count {
  font-weight: 800;
  color: var(--navy);
  font-size: 22px;
  min-width: 40px; text-align: right;
}

/* Ratings list */
.rating-row {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.rating-row:last-child { border-bottom: none; }
.rating-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.rating-header strong { color: var(--navy); }
.rating-stars-display {
  color: var(--gold); font-size: 18px; letter-spacing: 2px;
}
.rating-stars-display .empty { color: var(--border); }
.rating-comments {
  display: grid; gap: 6px;
  margin-top: 10px;
}
.rating-comment {
  background: #f5f7fb;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  border-left: 3px solid var(--sky);
}
.rating-comment .author {
  color: var(--muted); font-size: 11px;
}
.rating-comment-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px;
}
.rating-delete-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
}
.rating-delete-btn:hover { background: #fee; color: #c00; }
.rating-empty { text-align: center; color: var(--muted); padding: 30px; }

.role-pill {
  display: inline-block;
  background: var(--type-presentation-bg);
  color: var(--blue-text);
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .5px;
}
.role-pill.admin { background: #f7e8e7; color: var(--red-text); }
.role-pill.speaker { background: var(--type-client-day-bg); color: var(--gold-dark); }
.role-pill.client { background: var(--type-client-day-bg); color: var(--gold-dark); }
.role-pill.vendor { background: var(--type-reception-bg); color: var(--blue); }
.role-pill.contractor { background: #eef1f6; color: var(--muted); }

/* Header tweaks */
.admin-page .header-right .btn-text {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
}
.admin-page .header-right .btn-text:hover {
  background: rgba(255,255,255,.1);
}

@media (max-width: 720px) {
  .admin-shell { padding: 14px; }
  .admin-inline-form { grid-template-columns: 1fr; }
  .admin-tab { padding: 8px 14px; font-size: 13px; }
  .session-stat-row { flex-wrap: wrap; }
  .session-stat-row .bar { width: 100%; }
}

/* ---- Edit Speaker modal ---- */
/* Wider than the default small modal (lots of fields), and scrollable so a
   long form never runs off-screen. */
.edit-speaker-content {
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
#edit-speaker-who { margin: -6px 0 14px; }
.session-assign-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 12px;
  margin: 8px 0 4px;
}
.session-assign-fieldset legend {
  font-size: 12px; font-weight: 700; color: var(--navy); padding: 0 6px;
}
.session-checkboxes { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.session-day-group { margin-bottom: 8px; }
/* Sticky so the day stays visible while scrolling its sessions. */
.session-day-label {
  position: sticky; top: 0; z-index: 1;
  margin: 0 0 4px; padding: 5px 8px; border-radius: 4px;
  background: #eef1f6; color: var(--navy);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
/* Single column — one checkbox per session. Compact rows keep it tight.
   NOTE: these rows are <label>s, so the global form rules in styles.css
   (`input{width:100%;padding:10px 12px}`, `label{margin-bottom:14px}`,
   `label>span{display:block;font-weight:600}`) all leak in and must be
   overridden here, or the checkbox renders huge and shoves the text. */
.session-day-items { display: flex; flex-direction: column; gap: 2px; }
.session-check {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0;
  padding: 5px 6px; border-radius: 6px; font-size: 12.5px; line-height: 1.35; cursor: pointer;
}
.session-check:hover { background: #f5f7fb; }
.session-check input {
  width: auto; min-width: 0; padding: 0; margin: 1px 0 0; flex: none; align-self: flex-start;
}
.session-check .sc-body {
  display: block; flex: 1; min-width: 0; margin: 0;
  font-size: 12.5px; font-weight: 400; color: var(--text);
}
.session-check .sc-time { font-weight: 700; color: var(--navy); }
.session-check .sc-room { color: var(--muted); }

/* Headshot control in the editor */
.edit-speaker-photo-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.edit-speaker-photo-preview {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none;
  background: #eef1f6; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}
.edit-speaker-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.edit-speaker-photo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photo-pick-label { width: auto; padding: 7px 14px; font-size: 13px; cursor: pointer; margin: 0; }

/* Per-session speaker picker (Sessions tab) */
#session-speakers-list .ss-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 10px 4px; border-bottom: 1px solid #eef0f4;
}
#session-speakers-list .ss-session { flex: 0 0 38%; min-width: 0; }
#session-speakers-list .ss-session strong { display: block; }
#session-speakers-list .ss-presenters { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
#session-speakers-list .ss-presenter {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 0; border-top: 1px dashed #eef0f4;
}
#session-speakers-list .ss-presenter:first-child { border-top: 0; }
#session-speakers-list .ss-cat { font-weight: 600; color: #374151; }
#session-speakers-list .ss-cat em { font-weight: 400; }
#session-speakers-list .ss-assigned,
#session-speakers-list .ss-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#session-speakers-list .ss-assigned { color: #1a7f47; }
#session-speakers-list .ss-name { font-weight: 600; }
#session-speakers-list .ss-sub { color: #6b7280; font-size: 0.85em; }
#session-speakers-list select.ss-link-select { max-width: 260px; padding: 4px 8px; }
