/* ============================================================================
 * ZIVOX — admin dashboard styles
 *
 * Loaded only by the admin dashboard. Everything here is admin-specific; the
 * shell comes from backend-and-config/public/static/css/app.css and the
 * primitives from base.css.
 * ==========================================================================*/

/* ---------- Panels, toolbars and KPI strip ---------- */
/* ---------- Panels used across app screens ---------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-size: 18px; margin: 0; }
.panel-head p { font-size: 13px; color: var(--muted); margin: 3px 0 0; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .inp, .toolbar .sel { height: 38px; font-size: 13.5px; }
.toolbar .search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.toolbar .search .inp { padding-left: 34px; }

.kpi-strip { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 22px; }
@media (min-width: 760px) { .kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .kpi-strip { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Intern picker (issue certificate) ---------- */
/* ---------- Selected list (issue certificate) ---------- */
.pick-list { display: grid; gap: 6px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.pick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff; cursor: pointer;
  text-align: left; width: 100%;
  transition: border-color .18s var(--ease), background .18s var(--ease);
  position: relative;
}
.pick-item:hover { border-color: rgba(29, 111, 242, .3); }
.pick-item.sel {
  border-color: rgba(29, 111, 242, .45);
  background: var(--grad-soft);
}
.pick-item.sel::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.pick-item .nm { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.pick-item .sub { font-size: 11px; color: var(--faint); }

/* ---------- QR placement guide (legacy, kept for older saved templates) ---------- */
/* ---------- QR guide overlay ---------- */
.qr-stage { position: relative; }
.qr-guide {
  position: absolute; left: 50%; transform: translateX(-50%);
  border: 1.5px dashed #6366f1;
  border-radius: 4px;
  pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center;
}
.qr-guide span {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  background: #6366f1; color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}

/* ---------- Range slider ---------- */
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: rgba(20,40,90,.1); outline: none; }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: var(--sh-2); cursor: pointer; }
.rng::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: var(--sh-2); cursor: pointer; }

/* ---------- Sticky action bar ---------- */
/* ---------- Sticky action bar ---------- */
.sticky-bar {
  position: sticky; bottom: 0; z-index: 40;
  margin: 22px -16px -48px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  box-shadow: 0 -8px 24px -18px rgba(16, 30, 70, .3);
}
@media (min-width: 640px) { .sticky-bar { margin: 22px -28px -56px; padding: 14px 28px; } }
.sticky-bar .grow { flex: 1; min-width: 140px; font-size: 12.5px; color: var(--faint); }

/* ---------- Section blocks in forms ---------- */
/* ---------- Section blocks in forms ---------- */
.form-section { margin-bottom: 26px; }
.form-section > h3 {
  font-size: 14px; margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.form-section > .hint { margin: 0 0 16px; }

/* ---------- Stat donut (pure CSS conic) ---------- */
/* ---------- Stat donut (pure CSS conic) ---------- */
.donut {
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center;
  position: relative; flex: none;
}
.donut::after {
  content: ''; position: absolute; inset: 16px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 1px 3px rgba(16,30,70,.06);
}
.donut .dv { position: relative; z-index: 1; text-align: center; }
.donut .dv b { font-family: 'Sora', sans-serif; font-size: 22px; display: block; color: var(--ink); line-height: 1; }
.donut .dv span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---------- Manual certificate issuance workflow ---------- */
/* ---------- Manual certificate issuance workflow ---------- */

/* QR preview frame — fixed square so the downloaded image and the on-screen
   preview never disagree about proportions. */
.qr-frame {
  width: 200px; height: 200px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: var(--sh-2);
  display: grid; place-items: center; padding: 10px;
  transition: opacity .2s var(--ease);
}
.qr-frame img { width: 100%; height: 100%; display: block; border-radius: 6px; }
.qr-empty {
  font-size: 11.5px; color: var(--faint); text-align: center;
  line-height: 1.5; font-weight: 600;
}

/* A locked step stays visible (so the admin can see what is coming) but is
   clearly inert and cannot be interacted with until the ID is valid. */
.is-locked, #issue-step-3[data-locked="1"] #issue-step-3-body {
  opacity: .45;
  pointer-events: none;
  user-select: none;
}
#issue-step-3[data-locked="1"] .qr-frame { box-shadow: none; }

/* Review table for the publish confirmation */
.review-grid { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.review-row {
  display: grid;
  grid-template-columns: minmax(120px, 32%) 1fr;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  align-items: baseline;
}
.review-row:last-child { border-bottom: 0; }
.review-row:nth-child(odd) { background: rgba(246, 248, 253, .7); }
.review-row .rk { color: var(--faint); font-weight: 600; font-size: 12.5px; }
.review-row .rv { color: var(--ink); font-weight: 500; min-width: 0; }

/* Inline PDF preview */
.pdf-frame {
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #f6f8fd;
  height: 420px;
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* The generated-ID button and its old slider UI are gone; keep the icon button
   styling for the small utility buttons that remain in the panel heads. */
.btn-icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.btn-icon:hover { color: var(--brand-ink); border-color: rgba(29, 111, 242, .35); }

@media (max-width: 640px) {
  .qr-frame { width: 168px; height: 168px; }
  .review-row { grid-template-columns: 1fr; gap: 2px; }
  .pdf-frame { height: 320px; }
}
