/* HPERD Admin CMS — admin-only styling layer on top of Tailwind CDN. */

body { font-family: 'Inter', sans-serif; }
h1, h2, h3, .font-display { font-family: 'Poppins', 'Inter', sans-serif; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(212,160,23,0.16); color: #D4A017; font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.card-panel {
  background: #fff;
  border: 1px solid rgba(15,45,82,0.06);
  border-radius: 1.1rem;
  box-shadow: 0 4px 20px rgba(15,45,82,0.06);
  padding: 1.5rem;
}

.view-panel.hidden { display: none; }

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #4B5B68;
  margin-bottom: 0.35rem;
}
.field-input {
  width: 100%;
  border: 1px solid rgba(15,45,82,0.15);
  border-radius: 0.7rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.field-input:focus { border-color: #D4A017; box-shadow: 0 0 0 3px rgba(212,160,23,0.18); }

.type-pill {
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1.5px solid rgba(15,45,82,0.15);
  color: #4B5B68;
  transition: all 0.2s;
}
.type-pill.active { background: #0F2D52; border-color: #0F2D52; color: #fff; }

.btn-gold {
  background: #D4A017;
  color: #0A1F3A;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  transition: background 0.2s, transform 0.2s;
}
.btn-gold:hover { background: #c19112; }

.btn-outline-sm {
  border: 1.5px solid rgba(15,45,82,0.2);
  color: #0F2D52;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: background 0.2s;
}
.btn-outline-sm:hover { background: #F2F4F6; }

.dropzone {
  border: 1.5px dashed rgba(15,45,82,0.25);
  border-radius: 0.9rem;
  padding: 0.75rem;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone.dragover { border-color: #D4A017; background: rgba(212,160,23,0.06); }

.toast-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-item.toast-in { opacity: 1; transform: translateY(0); }

.media-tile {
  border: 1px solid rgba(15,45,82,0.08);
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}
.media-tile:hover { box-shadow: 0 10px 24px rgba(15,45,82,0.12); transform: translateY(-2px); }

.gallery-thumb {
  position: relative;
  border-radius: 0.6rem;
  overflow: hidden;
  aspect-ratio: 1;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb button {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(10,31,58,0.75);
  color: #fff;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1;
}

/* ---------------------------------------------------------- UPLOAD PROGRESS */
.upload-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.upload-stack:empty { display: none; }
.upload-stack.mt-3 { margin-top: 0.75rem; }

.upload-row {
  background: #F2F4F6;
  border: 1px solid rgba(15,45,82,0.08);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  transition: opacity 0.25s ease;
}
.upload-track {
  height: 8px;
  margin-top: 0.45rem;
  background: rgba(15,45,82,0.1);
  border-radius: 9999px;
  overflow: hidden;
}
.upload-bar {
  height: 100%;
  width: 0;
  background: #0F766E;
  border-radius: 9999px;
  transition: width 0.15s linear;
}
.upload-note { margin-top: 0.3rem; font-size: 11px; color: #4B5B68; }

.upload-row[data-state="processing"] .upload-bar {
  background-image: linear-gradient(45deg, rgba(255,255,255,0.3) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.3) 75%, transparent 75%);
  background-size: 16px 16px;
  animation: upload-stripes 0.8s linear infinite;
}
.upload-row[data-state="done"] .upload-bar { background: #15803D; }
.upload-row[data-state="done"] .upload-note { color: #15803D; }
.upload-row[data-state="error"] .upload-bar { background: #DC2626; }
.upload-row[data-state="error"] .upload-note { color: #DC2626; }
@keyframes upload-stripes { to { background-position: 16px 0; } }

/* ---------------------------------------------------------- REQUIRED / MISSING FIELDS */
.req-star { color: #DC2626; font-weight: 700; margin-left: 2px; }

.field-missing,
.field-missing.field-input {
  border-color: #DC2626 !important;
  background: rgba(220,38,38,0.04);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.14);
}
.panel-missing {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.14), 0 4px 20px rgba(15,45,82,0.06);
}
.field-error-msg { margin-top: 0.3rem; font-size: 0.75rem; font-weight: 500; color: #DC2626; }
.field-error-msg::before { content: '\26A0\00a0'; }

.checklist-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.checklist-item .dot {
  width: 16px; height: 16px; border-radius: 9999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; color: #fff; background: #CBD5DC;
}
.checklist-item.ok .dot { background: #15803D; }
.checklist-item.missing { color: #B91C1C; font-weight: 500; cursor: pointer; }
.checklist-item.missing .dot { background: #DC2626; }
.checklist-item.missing:hover { text-decoration: underline; }

/* ---------------------------------------------------------- PUBLISH OPTIONS DIALOG */
.pub-option {
  display: flex; align-items: flex-start; gap: 0.75rem;
  border: 1.5px solid rgba(15,45,82,0.15);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pub-option:hover { background: #F2F4F6; }
.pub-option:has(input:checked) { border-color: #D4A017; background: rgba(212,160,23,0.08); }
.pub-option input { margin-top: 0.2rem; accent-color: #0F2D52; }

/* Course participants: "Updated" column is hidden until the filter checkbox is ticked */
.part-hide-updated .part-col-updated { display: none; }
#participantEditModal:not(.hidden) { display: flex; }

/* ===== Dashboard strips (charts.js) ===== */
.viz-strip { margin-bottom: 1.25rem; }
.viz-strip-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.viz-strip-head h3 { font-family: 'Poppins', 'Inter', sans-serif; font-weight: 600; color: #0F2D52; font-size: .95rem; }
.viz-strip-head h3 span { margin-left: .6rem; font: 400 .72rem 'Inter', sans-serif; color: #4B5B68; }
.viz-toggle { font-size: .75rem; font-weight: 500; color: #0F766E; }
.viz-toggle:hover { text-decoration: underline; }
.viz-strip-body.hidden { display: none; }

.viz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.viz-tile { background: #fff; border: 1px solid rgba(15,45,82,.07); border-radius: 1rem; padding: .95rem 1.1rem; box-shadow: 0 2px 10px rgba(15,45,82,.04); }
.viz-tile-attn { border-color: rgba(212,160,23,.55); background: #fffdf5; }
.viz-tile-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #4B5B68; font-weight: 500; }
.viz-tile-value { font: 600 1.85rem/1.15 'Poppins', 'Inter', sans-serif; color: #0F2D52; margin-top: .2rem; }
.viz-tile-note { font-size: .72rem; color: #4B5B68; margin-top: .15rem; }

.viz-grid { display: grid; gap: .75rem; }
@media (min-width: 768px)  { .viz-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .viz-grid-3 { grid-template-columns: repeat(3, 1fr); } .viz-grid-5 { grid-template-columns: repeat(5, 1fr); } .viz-span-3 { grid-column: span 3; } .viz-span-2 { grid-column: span 2; } }

.viz-card { background: #fff; border: 1px solid rgba(15,45,82,.07); border-radius: 1rem; padding: 1.1rem 1.2rem; box-shadow: 0 2px 10px rgba(15,45,82,.04); min-width: 0; }
.viz-card-title { font-size: .85rem; font-weight: 600; color: #0F2D52; }
.viz-card-sub { font-size: .72rem; color: #4B5B68; margin: .1rem 0 .8rem; }
.viz-card-title + .viz-seg, .viz-card-title + .viz-hbars, .viz-card-title + .viz-cols { margin-top: .8rem; }
.viz-empty { font-size: .8rem; color: #4B5B68; padding: 1rem 0; }

/* segmented bar */
.viz-seg { display: flex; gap: 2px; height: 2.6rem; border-radius: .6rem; overflow: hidden; }
.viz-seg-thin { height: .8rem; border-radius: 9999px; }
.viz-seg-part { display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 600; min-width: 4px; }
.viz-seg-empty { align-items: center; justify-content: center; background: #F2F4F6; color: #4B5B68; font-size: .78rem; }
.viz-legend { margin-top: .85rem; display: grid; gap: .4rem; }
.viz-legend li { display: flex; align-items: center; gap: .55rem; font-size: .8rem; color: #1A2733; }
.viz-swatch { width: .7rem; height: .7rem; border-radius: 3px; flex: none; }
.viz-legend-name { flex: 1; color: #4B5B68; }
.viz-legend-val { font-weight: 600; color: #0F2D52; }
.viz-legend-val small { font-weight: 400; color: #4B5B68; }

/* ranked horizontal bars */
.viz-hbars { display: grid; gap: .45rem; padding-right: .25rem; }
.viz-hrow { display: grid; grid-template-columns: minmax(4.2rem, var(--viz-lw, 7.5rem)) 1fr 2.6rem; align-items: center; gap: .6rem; width: 100%; text-align: left; border: 0; background: none; border-radius: .4rem; padding: .1rem .25rem; font: inherit; }
.viz-hrow-click:hover { background: #F2F4F6; }
.viz-hlabel { font-size: .78rem; color: #1A2733; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viz-htrack { height: .7rem; background: rgba(15,118,110,.1); border-radius: 0 .35rem .35rem 0; overflow: hidden; }
.viz-hfill { display: block; height: 100%; background: #0F766E; border-radius: 0 .35rem .35rem 0; }
.viz-hval { font-size: .78rem; font-weight: 600; color: #0F2D52; text-align: right; }

/* columns */
.viz-cols { display: flex; align-items: flex-end; gap: 6px; padding-top: .25rem; border-bottom: 1px solid rgba(15,45,82,.15); }
.viz-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; padding-bottom: 1.35rem; }
.viz-col-bar { width: 100%; max-width: 2.4rem; background: #0F766E; border-radius: 4px 4px 0 0; transition: opacity .15s; }
.viz-col:hover .viz-col-bar { opacity: .75; }
.viz-col-val { font-size: .72rem; font-weight: 600; color: #0F2D52; height: 1rem; }
.viz-col-lab { position: absolute; bottom: 0; font-size: .68rem; color: #4B5B68; white-space: nowrap; }

/* table view + tooltip */
.viz-table { margin-top: .8rem; font-size: .75rem; }
.viz-table summary { cursor: pointer; color: #4B5B68; }
.viz-table summary:hover { color: #0F2D52; }
.viz-table table { width: 100%; margin-top: .4rem; border-collapse: collapse; max-height: 12rem; display: block; overflow: auto; }
.viz-table th { text-align: left; font-weight: 500; color: #4B5B68; padding: .2rem .6rem .2rem 0; }
.viz-table td { padding: .2rem .6rem .2rem 0; border-top: 1px solid rgba(15,45,82,.06); color: #1A2733; }
.viz-tip { position: fixed; z-index: 90; display: none; pointer-events: none; background: #0A1F3A; color: #fff; font-size: .75rem; padding: .35rem .6rem; border-radius: .5rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 18rem; }

/* Desktop sidebar can be hidden: the main area takes the freed width */
@media (min-width: 1024px) {
  #sidebar { transition: margin-left .3s ease, transform .3s ease; }
  body.sidebar-collapsed #sidebar { margin-left: -16rem; }
}
body.sidebar-collapsed #menuToggleStrip { opacity: 0; }
