/* ===== START: Original courses.css (kept as-is) ===== */
/* Elevana Training – courses (merged + refreshed)
   Brand: Midnight Blue #241E4A, Pigment Green #4DB053, Raspberry #D40E43, Ink #1A1A1A  */

:root{
  --ink:#1A1A1A;
  --mid:#241E4A;
  --green:#4DB053;
  --rasp:#D40E43;

  --today: #f2ffd2;            /* today highlight bg */

  --bg:#ECEFF4;                /* slightly darker page bg */
  --panel:#ffffff;             /* cards, main surfaces */
  --panel-2:#F6F7FB;           /* subtable/backdrop surface */
  --border:#D8DEE6;            /* borders */
  --header:#EAEFFA;            /* table header bg */
  --hover:#F2F7FF;             /* row hover */
  --text:#1A1A1A;              /* body text (Ink) */
  --missing: rgba(212,14,67,.08);           /* missing data (Raspberry) */
  
  --fc-bg: #fff;
  --fc-border: #D8DCE6;
  --fc-text: #1F2330;
  --fc-muted: #8B93A7;
  --fc-focus: #3B82F6;          /* accent blue */
  --fc-shadow: 0 1px 0 rgba(0,0,0,.02) inset;
  --ring: 0 0 0 3px rgba(59,130,246,.18);
}

/* Base — merged with your generic style.css (uses Poppins) */
html,body{
  font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background-color:var(--bg);
  color:var(--text);
  margin:0;
}
.page{
  max-width: 80%;            /* looks good on 1080p/1440p */
  margin: 32px auto;
  padding: 0 16px;
}

/* Text inputs & selects inside table cells */
table input[type="text"],
table input[type="email"],
table input[type="number"],
table input[type="date"],
table input[type="time"],
table select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;

  appearance: none;
  font: inherit;
  color: var(--fc-text);
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 10px;
  padding: .55rem .7rem;
  height: 2.25rem;               /* ~36px crisp touch size */
  line-height: 1.2;

  box-shadow: var(--fc-shadow);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

/* Select dropdown caret */
table select {
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%,
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5rem 100%;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

/* Hover / focus */
table input:focus,
table select:focus {
  outline: none;
  border-color: var(--fc-focus);
  box-shadow: var(--ring);
}

/* Placeholder + disabled/read-only */
::placeholder { color: var(--fc-muted); }
table input[readonly],
table input:disabled,
table select:disabled {
  background: #F6F7FB;
  color: #9AA3B2;
  cursor: not-allowed;
}

/* Optional states */
.is-invalid { border-color: #EF4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important; }
.is-success { border-color: #22C55E !important; box-shadow: 0 0 0 3px rgba(34,197,94,.15) !important; }

/* Base checkbox reset */
table input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--fc-border);
  border-radius: 6px;
  background: var(--fc-bg);
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  margin: 0;                     /* keeps alignment tight in cells */
}

/* Focus ring */
table input[type="checkbox"]:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--fc-focus);
}

/* Checkmark */
table input[type="checkbox"]::after{
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform .12s ease;
  background: var(--fc-focus);
  clip-path: polygon(14% 54%, 0 68%, 40% 100%, 100% 28%, 86% 14%, 40% 72%);
}

/* Checked state */
table input[type="checkbox"]:checked{
  border-color: var(--fc-focus);
  background: #EEF4FF;
}
table input[type="checkbox"]:checked::after{ transform: scale(1); }

/* Disabled */
table input[type="checkbox"]:disabled{
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

.has-help { position: relative; overflow: visible; }  /* anchor popover */

.col-help { display:inline-block; margin-left:.35rem; }
.col-help > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  line-height: 1;
  user-select: none;
}
.col-help > summary::-webkit-details-marker { display: none; }

/* the popover panel */
.col-help .popover{
  position: absolute;
  left: 50%;
  top: calc(100% + .4rem);
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: .7em .9em;
  border-radius: .45em;
  font-size: .85em;
  line-height: 1.4;
  max-width: 36ch;              /* wraps nicely; no horizontal scroll */
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  z-index: 1000;
}
details:not([open]) .popover { display: none; }

.flash-messages{
  margin: 16px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.flash-message{
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(36,30,74,.08);
  padding: 14px 18px;
}
.flash-message.is-success{
  border-left-color: var(--green);
}
.flash-message.is-error{
  border-left-color: var(--rasp);
}
.flash-summary{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.flash-label{
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  font-weight: 600;
}
.flash-title{
  font-weight: 600;
  font-size: 1rem;
}
.flash-toggle{
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--mid);
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  font: 500 0.85rem/1 'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  transition: background-color .2s ease, color .2s ease;
}
.flash-toggle:hover,
.flash-toggle:focus{
  background-color: rgba(36,30,74,.08);
  color: var(--mid);
}
.flash-details{
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

h1{
  color:var(--bg);
  font-weight:600;
  letter-spacing:.2px;
  margin:4px 0 0px;
}

/* Top nav */
.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 12px 16px;
  background: #0f172a; /* slate-900 */
}

.topnav a,
.topnav form button {
  color: #e5e7eb;
  text-decoration: none;
  font: 500 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  padding: 6px 8px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.topnav a:hover,
.topnav form button:hover {
  background: rgba(255, 255, 255, .08);
}

.topnav a.active {
  background: #1f2937; /* gray-800 */
}

.topnav .spacer {
  flex: 1;
  text-align: center;
  color: #ffffff;
}

/* Filters bar becomes a soft card */
form.filters{
  display:flex; 
  gap:10px; 
  align-items:center; 
  flex-wrap:wrap;
  background:var(--panel);
  padding:12px; border:1px solid var(--border);
  border-radius:14px; box-shadow:0 4px 14px rgba(36,30,74,.06);
  margin:12px 0 16px;
}
form.filters input[type="text"], form.filters select{
  padding:10px 12px; border:1px solid var(--border); border-radius:10px;
  background:#fff; outline:none;
}
form.filters button{
  background-color:var(--green); color:#fff; border:none; border-radius:10px;
  padding:10px 16px; cursor:pointer; font-weight:500;
  box-shadow:0 2px 8px rgba(77,176,83,.25);
}
form.filters button:hover{ filter:brightness(.95); }

/* Table card */
.table-wrap{
  background:var(--panel); 
  border:1px solid var(--border);
  border-radius:14px; 
  box-shadow:0 6px 18px rgba(36,30,74,.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table{
  width:100%; 
  border-collapse:separate; 
  border-spacing:0;
  table-layout: auto;
}

table input, table select { width: 100%; max-width: 100%; box-sizing: border-box; }
thead th{
  position:sticky; 
  top:0; 
  z-index:2;
  background:var(--header); 
  color:#3a3e55;
  font-weight:600; 
  text-transform:none;
  border-bottom:1px solid var(--border);
}
th, td{ 
  padding:10px 12px; 
  border-bottom:1px solid var(--border); 
  word-break: break-word;
}
tbody tr:nth-child(even){ background:#FAFBFD; }
tbody tr.parent:hover{ background:var(--hover); }
tbody tr.today{ background:var(--today) !important; }

.section-row th{
  background:var(--rasp);
  text-align:center;
  color: #fff;
  font-weight:600;
  font-size:1rem;
  padding:12px 16px;
  border-bottom:2px solid var(--border);
}

td.missing {
  background: var(--missing, #D40E43) !important;
  color: #fff;
  font-weight: 600;
}

/* --- Textarea styling --- */
textarea {
  width: 96%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s ease-in-out;
}

/* Subtle highlight on hover */
textarea:hover {
  border-color: #999;
}

/* Blue glow on focus */
textarea:focus {
  border-color: #3B82F6; /* Tailwind blue-500 */
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
  outline: none;
}

/* Optional: placeholder text color */
textarea::placeholder {
  color: #aaa;
}

/* External link icon for links that open in a new tab */
a[target="_blank"] {
  position: relative;
  padding-right: 1.1em; /* space for the icon */
}

a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.2em;
  vertical-align: text-top;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M14 3h7v7h-2V7.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3zM5 5h5v2H7v10h10v-3h2v5H5z'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M14 3h7v7h-2V7.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3zM5 5h5v2H7v10h10v-3h2v5H5z'/></svg>") no-repeat center / contain;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  background: #f5f5f7;
  color: #111;
  cursor: pointer;
  transition: transform .02s ease, box-shadow .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { background: #efeff2; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Primary look */
.btn-primary {
  background: #2563eb;           /* Tailwind-ish blue-600 */
  color: #fff;
  box-shadow: 0 2px 10px rgba(37,99,235,.2);
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { background: #1e40af; }

/* First column (twisty) */
td.twisty{ width:2.5rem; }
summary{
  list-style:none; cursor:pointer; display:inline-flex; align-items:center; gap:.25rem;
}
summary::marker{ content:""; }
summary::before{ content:"▶"; display:inline-block; width:1rem; color:#6b7280; }
details[open] summary::before{ content:"▼"; }

/* Child row reveal (smooth; honours reduced motion) */
.child>td{ padding:0; border-top:none; background:transparent; }
.reveal{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .28s ease; }

.reveal__content{ overflow:hidden; }
.reveal__content>*{
  opacity:0; transform:translateY(-2px);
  transition:opacity .18s ease, transform .18s ease;
}
.parent:has(details[open]) + .child .reveal{ grid-template-rows:1fr; }
.parent:has(details[open]) + .child .reveal__content>*{ opacity:1; transform:none; }

/* Subtable card (centred) */
.subrow{
  padding:12px 16px; background:linear-gradient(0deg,rgba(36,30,74,.05),rgba(36,30,74,.05));
}
.subcard{
  width:min(1024px, calc(100% - 32px));
  margin:0 auto 10px auto;
  background:var(--panel-2);
  border:1px dashed var(--border);
  border-radius:14px;
  box-shadow: inset 0 0 0 1px rgba(36,30,74,.03), 0 4px 10px rgba(36,30,74,.05);
  padding:12px;
}
.subcard strong{ display:block; color:var(--mid); margin:4px 8px 8px; }
.subtable{ width:100%; border-collapse:separate; border-spacing:0; }
.subtable td {
  border:1px dashed #cfd6e4; 
  padding:.5rem .75rem; 
  background:#fff; 
  border-radius:8px;
}

/* Links inside headers keep your current behaviour */
th a{ text-decoration:none; color:inherit; }

/* Focus states & accessibility */
summary:focus, a:focus, button:focus, select:focus, input:focus{
  outline:2px solid var(--green); outline-offset:2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .reveal{ transition:none; }
  .reveal__content>*{ transition:none; }
}

/* ANS action button + result */
.action-cell { 
  white-space: nowrap; 
}

/* Result card */
.ans-result {
  white-space: normal;           /* don't keep one-line blocks */
  overflow-wrap: anywhere;       /* wrap long unbroken strings */
  word-break: break-word;        /* fallback for older engines */
  margin-top: .5rem;
  max-width: 560px;
  border: 1px solid #e5e7eb;
  border-radius: .7rem;
  background: #fafafa;
  padding: .75rem .9rem;
  font: 400 13px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #111;
}
/* Title line + badge */
.ans-result .title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .35rem;
  font-weight: 700; font-size: 13px;
}
.ans-result .badge {
  padding: .15rem .5rem; border-radius: 999px; font-weight: 700; font-size: 11px;
}
.badge.ok    { background: #dcfce7; color: #166534; }   /* green */
.badge.error { background: #fee2e2; color: #991b1b; }   /* red  */

/* Key/value list */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .25rem .75rem; }
.kv .k { color: #6b7280; }   /* gray-500 */
.kv .v { color: #111; }

/* expected|actual cell */
.ea { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  align-items: center;
  text-align: center;
  font-variant-numeric: tabular-nums; /* keeps numbers aligned */
}
.ea-expected { text-align: left; }
.ea-actual   { text-align: left; font-weight: 600; }

/* colours (tweak to your palette) */
.ea-actual.ok   { color: var(--green); }  /* green */
.ea-actual.over { color: var(--rasp); }  /* red  */

#saveEditsBtn.is-busy { opacity: .6; pointer-events: none; }
#saveEditsBtn .btn-spinner{ display:none; width:1em; height:1em; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; margin-left:.5em; vertical-align:-2px; animation:spin .6s linear infinite;}
#saveEditsBtn.is-loading .btn-spinner{ display:inline-block; }
@keyframes spin{ to { transform: rotate(360deg); } }

#deleteBtn.is-busy { opacity: .6; pointer-events: none; }
#deleteBtn .btn-spinner{ display:none; width:1em; height:1em; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; margin-left:.5em; vertical-align:-2px; animation:spin .6s linear infinite;}
#deleteBtn.is-loading .btn-spinner{ display:inline-block; }
@keyframes spin{ to { transform: rotate(360deg); } }

.enrol-delegates-btn.is-busy { opacity: .6; pointer-events: none; }
.enrol-delegates-btn .btn-spinner { display:none; width:1em; height:1em; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; margin-left:.5em; vertical-align:-2px; animation:spin .6s linear infinite; }
.enrol-delegates-btn.is-loading .btn-spinner { display:inline-block; }

@media (max-width: 768px){
  .action-cell{ white-space: normal; }    /* was nowrap */
  th, td{ padding: 8px 10px; }            /* a bit tighter */
  table input, table select{
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ===== END: Original courses.css ===== */

/* ===== START: Appended style.css (scoped under .index-scope) ===== */
.index-scope {
      font-family: 'Poppins', sans-serif;
      background-color: #F9F9F9;
      color: #1A1A1A;
      padding: 40px;
      max-width: 700px;
      margin: auto;
    }.index-scope h2, .index-scope .pre-form-text, .index-scope .post-results-text {
      color: #241E4A;
    }.index-scope .hidden { display: none; }.index-scope .fade { transition: opacity 0.5s ease, transform 0.5s ease; opacity: 0; transform: translateY(10px); }.index-scope .visible { opacity: 1; transform: translateY(0); }.index-scope .errorMessage { color: #D40E43; margin-top: 10px; }.index-scope form {
      background: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
      margin-bottom: 30px;
    }.index-scope input[type="file"], .index-scope input[type="email"], .index-scope input[type="text"] {
      padding: 10px;
      margin-bottom: 20px;
      border: 1px solid #ccc;
      border-radius: 4px;
      width: 100%;
      box-sizing: border-box;
    }.index-scope button {
      background-color: #4DB053;
      color: white;
      padding: 12px 24px;
      border: none;
      border-radius: 4px;
      font-size: 16px;
      cursor: pointer;
      transition: background-color 0.3s;
    }.index-scope button:hover { background-color: #3f9444; }.index-scope .loading, .index-scope .post-processing { display: none; text-align: center; margin-top: 20px; }.index-scope .status-ok { color: #4DB053; }.index-scope .status-fail { color: #D40E43; }.index-scope .info-row { background-color: #eef2ff; color: #241E4A; }.index-scope .warning-row { background-color: #fff5e6; color: #8a6d3b; }.index-scope .error-row { background-color: #ffe5e5; color: #D40E43; }.index-scope .critical-row { background-color: #ffe0eb; color: #B31153; }.index-scope .faded { background-color: #f2f2f2 !important; color: #999 !important; text-decoration: line-through; }.index-scope .result-group, .index-scope .summary-groupvalid, .index-scope .summary-groupinvalid, .index-scope .post-validation-actions {
      background: #fff;
      margin-bottom: 20px;
      padding: 15px;
      border-radius: 6px;
      box-shadow: 0 0 5px rgba(0,0,0,0.05);
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.5s ease, transform 0.5s ease;
    }.index-scope .result-group { border-left: 5px solid #241E4A; }.index-scope .summary-groupvalid { border-left: 5px solid #4DB053; }.index-scope .summary-groupinvalid { border-left: 5px solid #D40E43; }.index-scope .post-validation-actions { border-left: 5px solid #4DB053; }.index-scope .post-validation-actions.fade-in {
      opacity: 1;
      transform: translateY(0);
    }.index-scope .result-group.visible, .index-scope .summary-groupvalid.visible, .index-scope .summary-groupinvalid.visible { opacity: 1; transform: translateY(0); }.index-scope table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px;
      margin-bottom: 30px;
    }.index-scope th, .index-scope td {
      padding: 6px 10px; 
      border: 1px solid #ccc; 
      text-align: left;
    }.index-scope th { 
      background: #f0f0f0; 
    }.index-scope .summary-table td:first-child { width: 150px; }.index-scope .issue-table td:first-child { width: 30px; }
    
  
/* ===== END: Appended style.css (scoped) ===== */
