/* Bursary award agreement screens (UC-09, UC-10). Uses the theme tokens from app.css. */
.agr-page, .agr-modal, .agr-modal-backdrop { --agr-gold: var(--coe-gold, #F5B819); --agr-ink: var(--t-ink, #142033); --agr-ink2: var(--t-ink-2, #4A5568); --agr-ink3: var(--t-ink-3, #7A8699);
    --agr-line: var(--t-line, #E3E8EF); --agr-navy: var(--t-primary, #1B3069); --agr-soft: var(--t-primary-soft, #E8EDF8); }
.agr-page { max-width: 1320px; padding-bottom: 48px; font-family: var(--t-font, inherit); color: var(--agr-ink); }
.agr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 22px; flex-wrap: wrap; }
.agr-head h1 { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0 6px; color: var(--agr-ink); }
.agr-sub { color: var(--agr-ink2); margin: 0; max-width: 680px; }
.agr-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--agr-ink3); }
.agr-muted { color: var(--agr-ink2); font-size: 14px; }
.agr-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; color: var(--agr-ink2); white-space: nowrap; }
.agr-loading { color: var(--agr-ink2); padding: 32px 0; display: flex; gap: 10px; align-items: center; }
.agr-back { display: inline-flex; gap: 6px; align-items: center; color: var(--agr-ink2); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.agr-back:hover { color: var(--agr-navy); }

.agr-card { background: #fff; border: 1px solid var(--agr-line); border-radius: var(--t-radius, 14px); box-shadow: var(--t-shadow, 0 4px 16px rgba(16,24,40,.06)); }
.agr-card h2 { font-size: 18px; font-weight: 700; margin: 0; }

/* stat tiles */
.agr-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.agr-stats-2 { grid-template-columns: repeat(2, minmax(0, 260px)); }
.agr-stat { text-align: left; background: #fff; border: 1px solid var(--agr-line); border-radius: 12px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; cursor: pointer; }
.agr-stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone, var(--agr-navy)); }
.agr-stat:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16,24,40,.08); }
.agr-stat.on { border-color: var(--tone, var(--agr-navy)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--agr-navy)) 18%, transparent); }
.agr-stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.agr-stat-label { font-size: 13px; color: var(--agr-ink2); font-weight: 600; }
.agr-stat-pending { --tone: var(--agr-gold); } .agr-stat-info { --tone: #2E6BE6; } .agr-stat-warn { --tone: #E07B00; } .agr-stat-ok { --tone: var(--coe-green, #00804A); } .agr-stat-all { --tone: var(--agr-navy); }

/* list + panel */
.agr-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.agr-grid.with-panel { grid-template-columns: minmax(0, 1fr) 420px; }
.agr-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--agr-line); }
.agr-search { max-width: 260px; }
.agr-table { margin: 0; }
.agr-table > thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--agr-ink3); font-weight: 700; background: #FAFBFD; border-bottom: 1px solid var(--agr-line); padding: 10px 14px; }
.agr-table > tbody td { padding: 12px 14px; vertical-align: middle; border-color: var(--agr-line); }
.agr-table > tbody tr { cursor: pointer; transition: background .12s; }
.agr-table > tbody tr:hover { background: #F7F9FC; }
.agr-table > tbody tr.sel { background: #FFF8E1; box-shadow: inset 4px 0 0 var(--agr-gold); }
.agr-radio span { display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #C7CFDB; }
.agr-radio span.on { border-color: var(--agr-navy); background: radial-gradient(circle, var(--agr-navy) 0 4px, #fff 5px); }
.agr-person { display: flex; gap: 10px; align-items: center; }
.agr-person b { display: block; font-weight: 650; }
.agr-person small, .agr-two small { display: block; color: var(--agr-ink3); font-size: 12.5px; }
.agr-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #111; color: var(--agr-gold); flex: none; }
.agr-two span { display: block; font-weight: 550; }
.agr-note { font-size: 12px; color: var(--agr-ink3); margin-top: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-empty { text-align: center; color: var(--agr-ink3); padding: 42px 16px; }
.agr-empty i { font-size: 34px; display: block; margin-bottom: 8px; color: #C2CAD6; }
.agr-empty-lg { padding: 64px 24px; } .agr-empty-lg h2 { color: var(--agr-ink); margin-bottom: 6px; }

/* badges */
.agr-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--bg); color: var(--fg); }
.agr-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.agr-pending { --bg: #FFF4D6; --fg: #8A5A00; } .agr-draft { --bg: #EEF0F4; --fg: #4A5568; } .agr-info { --bg: #E6EEFF; --fg: #1E4FC2; }
.agr-warn { --bg: #FFEBD6; --fg: #A34F00; } .agr-ok { --bg: #E2F5EC; --fg: #00653A; } .agr-bad { --bg: #FDE7E8; --fg: #B21A20; }

/* side panel */
.agr-panel { padding: 18px 18px 20px; position: sticky; top: 16px; }
.agr-panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.agr-panel-head h2 { font-size: 20px; }
.agr-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; }
.agr-steps li { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--agr-ink3); padding: 8px 8px; border-radius: 10px; background: #F4F6FA; }
.agr-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #DDE3EC; color: #5B6678; flex: none; }
.agr-steps li.now { background: #111; color: #fff; } .agr-steps li.now span { background: var(--agr-gold); color: #111; }
.agr-steps li.done { color: var(--coe-green, #00804A); background: #E9F6EF; } .agr-steps li.done span { background: var(--coe-green, #00804A); color: #fff; }
.agr-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.agr-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--agr-ink2); }
.agr-form label small { font-weight: 500; color: var(--agr-ink3); }
.agr-form .form-control { font-weight: 500; color: var(--agr-ink); }
.agr-fieldset { display: flex; flex-direction: column; gap: 9px; padding: 14px; border: 1px solid var(--agr-line); border-radius: 12px; background: #FCFDFE; }
.agr-legend { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--agr-navy); }
.agr-legend small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--agr-ink3); }
.agr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agr-row2 > label, .agr-row2 .form-control { min-width: 0; }
.agr-row2 .form-control.is-invalid { border-color: #C0392B; }
.agr-check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; line-height: 1.4; }
.agr-check input { margin-top: 2px; flex: none; }
.agr-cta { margin-top: 6px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-weight: 700; }
.agr-generated, .agr-locked { text-align: center; padding: 8px 4px 2px; }
.agr-locked { text-align: left; }
.agr-generated-icon, .agr-result-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 4px auto 12px; font-size: 30px; background: #111; color: var(--agr-gold); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.agr-generated h3 { font-size: 20px; font-weight: 750; } .agr-generated p { color: var(--agr-ink2); }
.agr-dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 14px 0 16px; font-size: 14px; }
.agr-dl dt { color: var(--agr-ink3); font-weight: 600; } .agr-dl dd { margin: 0; font-weight: 550; }
.agr-dl-compact { padding: 12px 14px; background: #F7F9FC; border-radius: 12px; margin-top: 0; }

/* flashes */
.agr-flash { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.agr-flash > i { font-size: 18px; line-height: 1.2; } .agr-flash > div { flex: 1; } .agr-flash .btn-close { font-size: 11px; }
.agr-flash-ok { background: #E9F6EF; border-color: #BFE6D1; color: #0B5132; }
.agr-flash-bad { background: #FDECEC; border-color: #F6C8CA; color: #8E1B1F; }
.agr-flash-warn { background: #FFF6DE; border-color: #F6DE9C; color: #6E4A00; }

/* segmented control */
.agr-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: #EEF1F6; width: 100%; }
.agr-seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px 10px; font-weight: 650; color: var(--agr-ink2); display: inline-flex; gap: 7px; justify-content: center; align-items: center; transition: all .15s; }
.agr-seg button:hover { color: var(--agr-ink); }
.agr-seg button.on { background: #fff; color: var(--agr-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(16,24,40,.08); }
.agr-seg button.on.ok { background: var(--coe-green, #00804A); color: #fff; }
.agr-seg button.on.bad { background: var(--coe-red, #D2232A); color: #fff; }
.agr-seg-sm { width: auto; padding: 3px; } .agr-seg-sm button { padding: 4px 10px; font-size: 12.5px; }
.agr-seg-lg button { padding: 12px; font-size: 15px; }

/* signing layout */
.agr-sign-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.agr-decide { padding: 20px; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.agr-decide-title { font-size: 16px !important; margin-top: 2px !important; }
.agr-due { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: #FFF6DE; color: #6E4A00; font-size: 14px; }
.agr-due.soon { background: #FDECEC; color: #8E1B1F; } .agr-due.info { background: #E9EFFD; color: #1E3F9A; } .agr-due.ok { background: #E9F6EF; color: #0B5132; }
.agr-due > i { font-size: 18px; }

/* PDF preview */
.agr-pdf { background: #fff; border: 1px solid var(--agr-line); border-radius: var(--t-radius, 14px); overflow: hidden; box-shadow: var(--t-shadow); display: flex; flex-direction: column; }
.agr-pdf-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; background: #111; color: #fff; }
.agr-pdf-title { display: flex; gap: 8px; align-items: center; font-weight: 650; font-size: 14px; min-width: 0; }
.agr-pdf-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-pdf-title i { color: var(--agr-gold); font-size: 18px; }
.agr-pdf-actions { display: flex; gap: 8px; flex: none; }
.agr-pdf-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 650; text-decoration: none; color: #fff; border: 1px solid rgba(255,255,255,.35); transition: background .15s; }
.agr-pdf-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.agr-pdf-btn.gold { background: var(--agr-gold); border-color: var(--agr-gold); color: #111; }
.agr-pdf-btn.gold:hover { background: #FFC93A; color: #111; }
.agr-pdf-frame { width: 100%; height: min(78vh, 980px); min-height: 520px; border: 0; background: #525659; display: block; }

/* signature pad */
.agr-sig { display: flex; flex-direction: column; gap: 8px; }
.agr-sig-head { display: flex; justify-content: space-between; align-items: center; }
.agr-sig-label { font-size: 13px; font-weight: 700; color: var(--agr-ink2); }
.agr-sig-box { position: relative; border: 2px dashed #C7CFDB; border-radius: 14px; background: #fff; height: 170px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.agr-sig.has-ink .agr-sig-box { border-style: solid; border-color: var(--agr-navy); box-shadow: 0 0 0 4px var(--t-ring, rgba(27,48,105,.15)); }
.agr-sig-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.agr-sig-line { position: absolute; left: 18px; right: 18px; bottom: 38px; border-bottom: 1.5px solid #D5DBE5; pointer-events: none; }
.agr-sig-line span { position: absolute; left: 0; bottom: 2px; color: #A9B3C2; font-size: 14px; }
.agr-sig-hint { position: absolute; inset: 0 0 46px; display: grid; place-items: center; color: #A9B3C2; font-size: 14px; pointer-events: none; }
.agr-sig-foot { display: flex; justify-content: space-between; align-items: center; }
.agr-sig-foot .btn-link { text-decoration: none; font-weight: 600; }
.agr-sig-type { font-size: 15px; }

/* result states */
.agr-result { text-align: center; padding: 10px 4px; }
.agr-result h2 { font-size: 22px !important; margin-bottom: 8px !important; }
.agr-result p { color: var(--agr-ink2); }
.agr-result.ok .agr-result-icon { background: var(--coe-green, #00804A); color: #fff; }
.agr-result.bad .agr-result-icon { background: var(--coe-red, #D2232A); color: #fff; }
.agr-result.info .agr-result-icon { background: var(--agr-soft); color: var(--agr-navy); box-shadow: none; }

/* applicant cards */
.agr-cards { display: grid; gap: 16px; max-width: 860px; }
.agr-mine { padding: 20px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--tone, var(--agr-navy)); }
.agr-tone-info { --tone: #2E6BE6; } .agr-tone-warn { --tone: #E07B00; } .agr-tone-ok { --tone: var(--coe-green, #00804A); } .agr-tone-bad { --tone: var(--coe-red, #D2232A); }
.agr-mine-top { display: flex; gap: 14px; align-items: flex-start; }
.agr-doc-icon { width: 48px; height: 48px; border-radius: 12px; background: #111; color: var(--agr-gold); display: grid; place-items: center; font-size: 22px; flex: none; }
.agr-mine-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* modal */
.agr-modal-backdrop { position: fixed; inset: 0; background: rgba(9, 14, 28, .55); backdrop-filter: blur(3px); z-index: 1040; animation: agr-fade .15s ease-out; }
.agr-modal { position: fixed; z-index: 1050; inset: 3vh 3vw; background: #fff; border-radius: 18px; box-shadow: var(--t-shadow-lg, 0 24px 60px rgba(0,0,0,.25)); display: flex; flex-direction: column; overflow: hidden; animation: agr-pop .18s ease-out; }
.agr-modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 22px; border-bottom: 1px solid var(--agr-line); }
.agr-modal-head h2 { font-size: 20px; font-weight: 750; margin: 2px 0 0; }
.agr-modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; padding: 18px 22px; background: #F4F6FA; overflow: auto; }
.agr-modal-body .agr-pdf-frame { height: calc(94vh - 250px); min-height: 360px; }
.agr-modal-side { background: #fff; border: 1px solid var(--agr-line); border-radius: 14px; padding: 6px 16px 16px; align-self: start; }
.agr-modal-side .agr-dl { grid-template-columns: 1fr; gap: 2px; } .agr-modal-side .agr-dl dd { margin-bottom: 8px; }
.agr-side-note { font-size: 13.5px; color: var(--agr-ink2); background: #FFF6DE; border-radius: 10px; padding: 10px 12px; margin: 0; }
.agr-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--agr-line); }
.agr-modal-foot .btn-lg { min-width: 160px; font-weight: 700; }
.agr-confirm { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); padding: 28px; text-align: center; animation: agr-pop-c .18s ease-out; }
.agr-confirm h2 { font-size: 20px; font-weight: 750; line-height: 1.3; margin: 0 0 16px; }
.agr-confirm-icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 26px; background: #111; color: var(--agr-gold); }
.agr-confirm-icon.bad { background: var(--coe-red, #D2232A); color: #fff; }
.agr-confirm-doc { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--agr-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.agr-confirm-doc > i { font-size: 26px; color: var(--coe-red, #D2232A); }
.agr-confirm-doc > div { flex: 1; } .agr-confirm-doc b { display: block; } .agr-confirm-doc small { color: var(--agr-ink3); }
.agr-confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.agr-confirm-actions .btn { min-width: 150px; font-weight: 700; }
@keyframes agr-fade { from { opacity: 0; } }
@keyframes agr-pop { from { opacity: 0; transform: scale(.98); } }
@keyframes agr-pop-c { from { opacity: 0; transform: translate(-50%, -48%); } }

@media (max-width: 1100px) {
    .agr-grid.with-panel, .agr-sign-layout { grid-template-columns: 1fr; }
    .agr-panel, .agr-decide { position: static; }
    .agr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agr-modal-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .agr-head h1 { font-size: 24px; }
    .agr-table thead { display: none; }
    .agr-table td:nth-child(4) { display: none; }
    .agr-modal { inset: 0; border-radius: 0; }
    .agr-row2 { grid-template-columns: 1fr; }
}
