/*
 * Training platform additions on top of base.css: course states, the
 * dashboard's figures and bars, the attendance grid and the public page.
 *
 * Brand: the National Center's green and grey lead; Colleges of Excellence,
 * which runs the programme, appears beside it.
 *
 * Dashboard colours (validated as an ordinal one-hue pair, light surface):
 *   registered #6dbb8d (light), certified #166938 (dark), target = ink tick.
 * Single-series bars use #1f8a4c. Text never wears a data colour.
 */

:root {
    --v-registered: #6dbb8d;
    --v-certified: #166938;
    --v-single: #1f8a4c;
    --v-grid: #E3E6EE;
    --v-track: #E8F1EB;
}

.ac-tag--info { background: #E4F3F8; color: #1F6A82; }
.ac-tag--done { background: #E3F5EE; color: #146C4E; }
.ac-tag--danger { background: #FDECEC; color: #A32020; }

.ac-footer a { color: var(--ac-muted); text-decoration: none; }
.ac-footer a:hover { color: var(--ac-blue); }

/* ---------- key/value facts ---------- */

.ac-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 22px; margin: 0; }
.ac-facts dt { font-size: 12.5px; color: var(--ac-muted); font-weight: 600; }
.ac-facts dd { margin: 2px 0 0; color: var(--ac-ink); font-weight: 600; }

/* ---------- dashboard ---------- */

.v-hero { display: grid; grid-template-columns: minmax(240px, 1.1fr) 2fr; gap: 26px; align-items: center; }
@media (max-width: 991px) { .v-hero { grid-template-columns: 1fr; } }
.v-hero__label { font-size: 13.5px; color: var(--ac-muted); font-weight: 600; }
.v-hero__num { font-size: 52px; font-weight: 700; line-height: 1.05; color: var(--ac-ink); }
.v-hero__of { font-size: 15px; color: var(--ac-text); margin-top: 4px; }

.v-meter { height: 12px; border-radius: 6px; background: var(--v-track); overflow: hidden; margin-top: 14px; }
.v-meter > span { display: block; height: 100%; background: var(--v-certified); border-radius: 6px; }
.v-meter + .v-meter__legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ac-muted); margin-top: 6px; }

.v-years { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.v-year { border: 1px solid var(--ac-line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.v-year:hover { border-color: var(--ac-blue); color: inherit; }
.v-year.is-active { border-color: var(--ac-navy); box-shadow: inset 0 0 0 1px var(--ac-navy); }
.v-year__y { font-weight: 700; color: var(--ac-ink); }
.v-year__n { font-size: 22px; font-weight: 700; color: var(--ac-ink); margin-top: 2px; }
.v-year__t { font-size: 12.5px; color: var(--ac-muted); }

.v-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ac-text); }
.v-legend span { display: inline-flex; align-items: center; gap: 6px; }
.v-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.v-legend i.is-tick { width: 3px; height: 14px; border-radius: 1px; background: var(--ac-ink); }

/* monthly columns: registered (light) behind certified (dark), target tick */
.v-cols { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 8px; margin-top: 14px; }
.v-cols__axis { position: relative; height: 220px; font-size: 11.5px; color: var(--ac-muted); font-variant-numeric: tabular-nums; }
.v-cols__axis span { position: absolute; inset-inline-end: 0; transform: translateY(50%); }
.v-cols__plot { position: relative; height: 220px; display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; border-bottom: 1px solid #C9D0DD; }
.v-cols__grid { position: absolute; inset-inline: 0; height: 0; border-top: 1px solid var(--v-grid); }
.v-col { position: relative; height: 100%; display: flex; justify-content: center; align-items: flex-end; outline: none; }
.v-col:hover, .v-col:focus-visible { background: rgba(22, 105, 56, .05); }
.v-col__bar { position: absolute; bottom: 0; width: min(24px, 60%); border-radius: 4px 4px 0 0; }
.v-col__bar--reg { background: var(--v-registered); }
.v-col__bar--cert { background: var(--v-certified); width: min(14px, 36%); }
.v-col__tick { position: absolute; width: min(32px, 76%); height: 3px; background: var(--ac-ink); border-radius: 2px; transform: translateY(50%); }
.v-cols__months { grid-column: 2; display: grid; grid-template-columns: repeat(12, 1fr); font-size: 11.5px; color: var(--ac-muted); text-align: center; margin-top: 6px; }

/* horizontal bullet rows: registered behind certified, target tick */
.v-rows { display: flex; flex-direction: column; gap: 12px; }
.v-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr minmax(92px, auto); gap: 12px; align-items: center; outline: none; border-radius: 8px; }
.v-row:hover, .v-row:focus-visible { background: rgba(22, 105, 56, .05); }
.v-row__name { font-weight: 600; color: var(--ac-ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-row__track { position: relative; height: 22px; }
.v-row__bar { position: absolute; inset-inline-start: 0; top: 0; height: 22px; border-start-end-radius: 4px; border-end-end-radius: 4px; }
.v-row__bar--reg { background: var(--v-registered); }
.v-row__bar--cert { background: var(--v-certified); top: 5px; height: 12px; }
.v-row__bar--single { background: var(--v-single); height: 14px; top: 4px; }
.v-row__tick { position: absolute; top: -3px; width: 3px; height: 28px; background: var(--ac-ink); border-radius: 2px; }
.v-row__val { font-size: 13px; color: var(--ac-text); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.v-row__val strong { color: var(--ac-ink); }
.v-rows--compact .v-row { grid-template-columns: minmax(90px, 1fr) 1.6fr 44px; }
.v-rows--compact .v-row__track { height: 14px; }

.v-tip { position: fixed; z-index: 2000; pointer-events: none; background: #fff; border: 1px solid var(--ac-line); box-shadow: 0 10px 28px rgba(24, 33, 61, .16); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--ac-text); min-width: 150px; }
.v-tip__title { font-weight: 700; color: var(--ac-ink); margin-bottom: 4px; }
.v-tip__row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.v-tip__row b { color: var(--ac-ink); font-variant-numeric: tabular-nums; }
.v-tip__key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }

.v-table summary { cursor: pointer; font-size: 13px; color: var(--ac-blue); font-weight: 600; margin-top: 12px; }
.v-table table { margin-top: 10px; font-size: 13px; }

/* ---------- attendance and results grid ---------- */

.ac-grid-table td, .ac-grid-table th { text-align: center; }
.ac-grid-table td:first-child, .ac-grid-table th:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 210px; }
.ac-grid-table th:first-child { background: var(--ac-soft); }
.ac-grid-table input[type="number"] { width: 72px; text-align: center; padding: 4px 6px; min-height: 34px; }
.ac-grid-table .form-check-input { margin: 0; width: 1.3em; height: 1.3em; }
.ac-grid-table th.is-sep, .ac-grid-table td.is-sep { border-inline-start: 2px solid var(--ac-line); }

/* ---------- the waiting list picker on a course ---------- */

.ac-picklist { max-height: 340px; overflow-y: auto; border: 1px solid var(--ac-line); border-radius: 10px; }
.ac-picklist label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--ac-line); margin: 0; cursor: pointer; }
.ac-picklist label:last-child { border-bottom: 0; }
.ac-picklist label:hover { background: var(--ac-soft); }

/* ---------- targets grid ---------- */

.ac-plan input { width: 64px; text-align: center; padding: 4px; min-height: 34px; }
.ac-plan td, .ac-plan th { text-align: center; padding: 6px; }
.ac-plan td:first-child, .ac-plan th:first-child { text-align: start; }
.ac-plan .actual { display: block; font-size: 11px; color: var(--ac-muted); margin-top: 2px; }

/* ---------- brand bar: the two logos on white, above the green menu ---------- */

.ac-brandbar { background: #fff; border-bottom: 3px solid var(--ac-orange); }
.ac-brandbar__row { display: flex; align-items: center; gap: 18px; max-width: 1480px; margin-inline: auto; padding: 10px 24px; }
.ac-brandbar__main { height: 52px; width: auto; display: block; }
.ac-brandbar__title { display: flex; flex-direction: column; line-height: 1.25; text-decoration: none; padding-inline-start: 18px; border-inline-start: 1px solid #DDE3DF; }
.ac-brandbar__title strong { color: var(--ac-navy); font-size: 17px; font-weight: 700; }
.ac-brandbar__title small { color: var(--ac-grey); font-size: 12.5px; }
.ac-brandbar__exec { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; color: var(--ac-grey); font-size: 12px; font-weight: 600; text-decoration: none; }
.ac-brandbar__exec img { height: 54px; width: auto; display: block; }
@media (max-width: 767px) {
    .ac-brandbar__row { padding: 8px 16px; gap: 12px; }
    .ac-brandbar__main { height: 40px; }
    .ac-brandbar__title { display: none; }
    .ac-brandbar__exec img { height: 34px; }
    .ac-brandbar__exec span { display: none; }
}
.ac-top .ac-top__row { min-height: 54px; }

/* ---------- public registration ---------- */

.pub-body { background: var(--ac-bg); }
.pub-top { background: #fff; border-bottom: 3px solid var(--ac-orange); }
.pub-top__row { max-width: 980px; margin-inline: auto; display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
.pub-top__main { height: 52px; width: auto; }
.pub-top__exec { display: flex; align-items: center; gap: 8px; color: var(--ac-grey); font-size: 12px; font-weight: 600; }
.pub-top__exec img { height: 50px; width: auto; }
.pub-top__lang { margin-inline-start: auto; color: var(--ac-navy); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.pub-top__lang:hover { color: var(--ac-navy); text-decoration: underline; }
.pub-band { background: var(--ac-navy); color: #fff; }
.pub-band__row { max-width: 980px; margin-inline: auto; padding: 14px 20px; }
.pub-band__row strong { font-size: 17px; display: block; }
.pub-band__row small { opacity: .8; font-size: 12.5px; }
@media (max-width: 575px) { .pub-top__main { height: 40px; } .pub-top__exec img { height: 32px; } .pub-top__exec span { display: none; } }
.pub-main { max-width: 980px; margin-inline: auto; padding: 26px 20px 40px; }
.pub-hero { margin-bottom: 18px; }
.pub-hero h1 { font-size: 24px; margin: 0 0 6px; }
.pub-hero p { color: var(--ac-muted); margin: 0; }
.pub-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pub-course { position: relative; display: block; border: 1.5px solid var(--ac-line); border-radius: 12px; padding: 12px 14px; background: #fff; cursor: pointer; margin: 0; }
.pub-course:hover { border-color: #AEB6C6; }
.pub-course input { position: absolute; opacity: 0; }
.pub-course:has(input:checked) { border-color: var(--ac-navy); box-shadow: 0 0 0 3px rgba(22, 105, 56, .14); }
.pub-course:has(input:focus-visible) { outline: 2px solid var(--ac-blue); outline-offset: 2px; }
.pub-course__date { font-weight: 700; color: var(--ac-ink); }
.pub-course__meta { font-size: 12.5px; color: var(--ac-muted); margin-top: 3px; }
.pub-course__seats { font-size: 12.5px; color: #146C4E; font-weight: 600; margin-top: 6px; }
.pub-systems { display: flex; flex-wrap: wrap; gap: 10px 22px; }
@media (max-width: 575px) { .pub-main { padding: 18px 16px 32px; } }

/* ---- course evaluation: answers summed up (course page, reports) ---- */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px 28px; }
.ev-q { min-width: 0; padding: 12px 0; border-top: 1px solid var(--ac-line, #e6ebe8); }
.ev-q__title { font-size: 14px; font-weight: 600; margin: 0 0 2px; color: var(--ac-ink, #1d2b24); line-height: 1.5; }
.ev-q__meta { font-size: 12.5px; color: var(--ac-muted, #6b7a72); margin-bottom: 8px; }
.ev-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; }
.ev-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ac-ink, #1d2b24); }
.ev-row__bar { height: 8px; border-radius: 4px; background: var(--ac-soft, #eef2f0); overflow: hidden; }
.ev-row__bar > span { display: block; height: 100%; border-radius: 4px; background: #1f8a4c; min-width: 2px; }
.ev-row__n { white-space: nowrap; color: var(--ac-ink, #1d2b24); }
.ev-row__n small { color: var(--ac-muted, #6b7a72); }
.ev-text summary { cursor: pointer; font-size: 13px; color: #146C4E; }
.ev-text ul { margin: 8px 0 0; padding-inline-start: 18px; font-size: 13px; max-height: 260px; overflow: auto; }
.ev-text li { padding: 3px 0; }

/* ---- dashboard: courses by city, as the programme reports them ---- */
.dc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dc-table th, .dc-table td { border: 1px solid #D5DED8; padding: 7px 12px; text-align: center; white-space: nowrap; }
.dc-table thead th { background: var(--ac-navy, #166938); color: #fff; font-weight: 700; }
.dc-table tbody th { font-weight: 700; text-align: start; }
.dc-table tbody tr:nth-child(even) td, .dc-table tbody tr:nth-child(even) th { background: #FAFCFB; }
.dc-table tfoot th, .dc-table tfoot td { background: #E8F3EC; font-weight: 700; }
.dc-table a { color: inherit; text-decoration: none; }
.dc-table td a { color: var(--ac-navy, #166938); font-weight: 700; }
.dc-table a:hover { text-decoration: underline; }
