/* Special Events — scoped styles for the staff workspace.
 *
 * Every selector is prefixed .he-* so this file cannot reach anything the rest
 * of the Hub owns. Design tokens come from styles.css; nothing here re-declares
 * a brand colour, so the workspace follows the Hub's light and dark themes
 * rather than carrying its own.
 *
 * No @import, no url() to a remote host: the live CSP is style-src 'self'.
 */

.he-root { color: var(--text); }

/* --- toolbar + status tabs ------------------------------------------------ */
.he-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.he-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.he-tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--text2);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.he-tab:hover { border-color: var(--border2); color: var(--text); }
.he-tab-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.he-tab-n { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* --- buttons -------------------------------------------------------------- */
.he-btn {
  border: 1px solid var(--border2); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.he-btn:hover { background: var(--surface2); }
.he-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.he-btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.he-btn-quiet { border-color: transparent; background: transparent; color: var(--text2); }
.he-btn-quiet:hover { background: var(--surface2); color: var(--text); }
/* Cancelling an event or a registration cannot be undone from this screen, so
   it does not look like the buttons beside it. */
.he-btn-danger { background: var(--danger-bg); border-color: var(--danger-br); color: var(--danger); }
.he-btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.he-btn:disabled, .he-attbtn:disabled { opacity: .55; cursor: default; }
.he-link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--navy3); cursor: pointer; text-align: left;
}
.he-link:hover { text-decoration: underline; }

/* --- tables --------------------------------------------------------------- */
.he-tablewrap { overflow-x: auto; }
.he-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.he-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text3); font-weight: 700; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.he-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.he-table tbody tr:hover { background: var(--surface2); }
.he-c-date { white-space: nowrap; }
.he-c-title { min-width: 260px; }
.he-c-cap { min-width: 180px; }
.he-c-act { text-align: right; white-space: nowrap; }
.he-c-n { color: var(--text3); font-variant-numeric: tabular-nums; width: 34px; }
.he-c-status { white-space: nowrap; width: 1%; }
.he-table-att td { vertical-align: top; }
/* The location under an event title. It is a <span> inside a table cell, so it
   needs an explicit block to sit on its own line rather than running on from
   the title. */
.he-sub { display: block; font-size: 12px; color: var(--text3); margin-top: 2px; }
/* The panel that stops a save: a DST-ambiguous time awaiting a choice, or a
   cancellation awaiting confirmation. It interrupts on purpose. */
.he-warn {
  border: 1px solid var(--warn-br); background: var(--warn-bg); color: var(--text);
  border-radius: 10px; padding: 14px 16px; margin: 14px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.he-warn .he-h4 { margin: 0; color: var(--warn); }
.he-warn p { margin: 0; font-size: 13px; }
.he-empty { padding: 28px 12px; text-align: center; color: var(--text3); }
.he-muted { color: var(--text3); }
.he-mail { color: var(--navy3); }

/* --- status pills --------------------------------------------------------- */
.he-pill {
  display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid transparent;
}
/* One rule per status the DATABASE can hold, named after the stored value, so a
   status can never render unstyled because the UI invented its own vocabulary.
   The five here are exactly hub_special_events.status. */
.he-pill-draft               { background: var(--canvas);   color: var(--text2); border-color: var(--border2); }
.he-pill-published           { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-br); }
.he-pill-registration_closed { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-br); }
.he-pill-cancelled           { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-br); }
.he-pill-completed           { background: var(--info-bg);   color: var(--info);   border-color: var(--info-br); }

/* --- detail --------------------------------------------------------------- */
.he-detail-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.he-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.he-h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; }
.he-h4 { margin: 24px 0 8px; font-size: 13px; text-transform: uppercase;
         letter-spacing: .06em; color: var(--text3); }
.he-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px; margin: 0 0 18px; font-size: 14px;
}
.he-meta dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
              color: var(--text3); font-weight: 700; margin-bottom: 2px; }
.he-meta dd { margin: 0; color: var(--text); }
/* The host roster lists inside .he-meta. No layout of their own: .he-meta is
   already auto-fit/minmax, so these collapse to one column on a phone. */
.he-names { margin: 0; padding-left: 18px; line-height: 1.7; }
.he-names li { overflow-wrap: anywhere; }
.he-desc { font-size: 14px; line-height: 1.65; color: var(--text2); max-width: 74ch; }
.he-desc p { margin: 0 0 12px; }
.he-qlist { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text2); line-height: 1.9; }
.he-req { color: var(--danger); font-size: 11px; font-weight: 700; text-transform: uppercase; }
/* A question the save-time validator will refuse. Shown, not hidden. */
.he-q-nolabel { color: var(--danger); font-style: italic; }
.he-ans { margin-bottom: 3px; }
.he-ans-q { color: var(--text3); }

/* --- notes ---------------------------------------------------------------- */
.he-note {
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.he-note-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-br); }
.he-note-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-br); }
.he-note-read { background: var(--info-bg); color: var(--info); border-color: var(--info-br); }
.he-hint { font-size: 12px; color: var(--text3); margin: 6px 0 0; line-height: 1.5; }

/* --- form ----------------------------------------------------------------- */
.he-form { max-width: 720px; }
.he-field { margin-bottom: 16px; }
.he-lab { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.he-input {
  width: 100%; border: 1px solid var(--border2); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); box-sizing: border-box;
}
.he-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.he-input:disabled { background: var(--surface2); color: var(--text3); }
.he-textarea { resize: vertical; line-height: 1.6; }
.he-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.he-formactions { display: flex; gap: 8px; margin-top: 8px; }

/* --- question editor ------------------------------------------------------ */
.he-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.he-qedit { list-style: none; margin: 0 0 14px; padding: 0; }
.he-q-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 6px; background: var(--surface);
}
.he-q-main { min-width: 0; }
.he-q-label { display: block; font-size: 14px; font-weight: 600; }
.he-q-meta { display: block; font-size: 12px; color: var(--text3); margin-top: 2px; }
.he-q-opts { font-size: 12px; color: var(--text2); margin-top: 4px; }
.he-q-del { color: var(--danger); flex: 0 0 auto; }
.he-q-del:hover { background: var(--danger-bg); }
.he-q-none {
  border: 1px dashed var(--border2); border-radius: 8px; padding: 14px;
  font-size: 13px; color: var(--text3); text-align: center;
}
.he-qadd {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; background: var(--surface2);
}
.he-qadd-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.he-qadd-opts { margin-top: 10px; }
.he-qadd .he-field { margin-bottom: 10px; }
.he-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); margin-bottom: 12px;
}

/* --- upcoming events listing ---------------------------------------------- */

/* --- attendance ----------------------------------------------------------- */
.he-attbtns { display: inline-flex; gap: 4px; }
.he-attbtn {
  border: 1px solid var(--border2); background: var(--surface); color: var(--text2);
  border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.he-attbtn:hover { background: var(--surface2); color: var(--text); }
.he-attbtn-yes-on {
  background: var(--ok-bg); border-color: var(--ok-br); color: var(--ok);
}
.he-attbtn-no-on {
  background: var(--warn-bg); border-color: var(--warn-br); color: var(--warn);
}
.he-att { font-size: 12px; font-weight: 600; }
.he-att-cancelled { color: var(--text3); }

/* --- accessibility -------------------------------------------------------- */
.he-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 720px) {
  .he-grid2, .he-qadd-grid { grid-template-columns: 1fr; }
  .he-toolbar { align-items: flex-start; flex-direction: column; }
}
