/* Scrum Master Assessment Tracker — site styles. Mobile-first; works at 360 px wide (NFR-05). */
:root {
    --app-navy: #14284b;
    --rating-strong-bg: #1e6b34;   /* white text: 6.6:1 (WCAG AA) */
    --rating-sound-bg: #1d4f91;    /* white text: 8.1:1 */
    --rating-ni-bg: #f0b429;       /* near-black text: 9.3:1 */
    --rating-gap-bg: #a4161a;      /* white text: 7.8:1 */
    --rating-none-bg: #5c636a;     /* white text: 6.1:1 */
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1 0 auto; }
.app-container { max-width: 1400px; }
.app-navbar { background: var(--app-navy); }
.app-navbar .nav-link { color: #fff; }
.app-navbar .nav-link:hover, .app-navbar .nav-link:focus { text-decoration: underline; color: #fff; }
.user-box { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: #fff !important; }
.role-chip { background: rgba(255,255,255,.15); border-radius: 1rem; padding: 0 .6rem; font-size: .85rem; }
.test-mode-banner { background: #fff3cd; color: #3d2f00; padding: .35rem 1rem; font-size: .9rem; border-bottom: 1px solid #e0c36a; }
.local-mode-banner { background: #f1f3f5; color: #343a40; padding: .2rem 1rem; font-size: .8rem; border-bottom: 1px solid #dee2e6; }
.skip-link { position: absolute; left: .5rem; top: .5rem; z-index: 1000; background: #fff; padding: .5rem; }
.app-footer { font-size: .85rem; color: #495057; border-top: 1px solid #dee2e6; padding: .75rem 0; }

h1 { font-size: 1.6rem; margin-bottom: .5rem; }
h2 { font-size: 1.25rem; }
a { color: #0b4fa8; }
:focus-visible { outline: 3px solid #0b4fa8; outline-offset: 2px; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.filters > div { min-width: 0; max-width: 100%; }
.filters .form-select { max-width: 100%; }
.status-line { color: #343a40; }
.narrow { max-width: 40rem; }
.status-page { max-width: 40rem; margin: 2rem auto; }
.form-panel { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: .5rem; padding: 1rem; margin-top: 1rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding-bottom: .5rem; border-bottom: 1px solid #dee2e6; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.kpi-card { background: #fff; border: 1px solid #ced4da; border-radius: .5rem; padding: .75rem; min-width: 0; overflow-wrap: anywhere; }
.kpi-label { font-size: .85rem; color: #495057; }
.kpi-value { font-size: 1.6rem; font-weight: 600; color: var(--app-navy); }
.kpi-value-sm { font-size: 1.2rem; }
.kpi-sub { font-size: .85rem; color: #495057; }

/* Ratings: colour always paired with the text label (NFR-06, AT-20). */
.rating { display: inline-block; padding: .1rem .5rem; border-radius: .25rem; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.rating-strong { background: var(--rating-strong-bg); color: #fff; }
.rating-sound { background: var(--rating-sound-bg); color: #fff; }
.rating-needs-improvement { background: var(--rating-ni-bg); color: #1a1a1a; }
.rating-priority-gap { background: var(--rating-gap-bg); color: #fff; }
.rating-not-rated { background: var(--rating-none-bg); color: #fff; }
.marker { display: inline-block; font-size: .75rem; border: 1px dashed #6c4a00; color: #5a3d00; background: #fff8e1; border-radius: .25rem; padding: 0 .3rem; margin-left: .25rem; white-space: nowrap; }

.outcome { font-weight: 600; }
.outcome-pass { color: #1e6b34; }
.outcome-fail { color: #a4161a; }
.outcome-na, .outcome-none { color: #495057; }
.flip-list { padding-left: 1.2rem; }
.flip-list li { margin-bottom: .35rem; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 992px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
.chart-panel { min-width: 0; }
.chart-box { position: relative; height: 260px; width: 100%; }
.chart-box-tall { height: 340px; }
.chart-box canvas { max-width: 100%; }

.rating-grid th, .rating-grid td { min-width: 7rem; }
.rating-grid th[scope="row"] { min-width: 10rem; font-weight: 500; }
.table-responsive { max-width: 100%; }

/* Assessment entry */
.running-score { position: sticky; top: 0; z-index: 10; background: #fff; padding: .5rem 0; border-bottom: 1px solid #dee2e6; margin-bottom: 1rem; }
@media (max-width: 767.98px) { .running-score { position: static; } }
.project-tabs { flex-wrap: wrap; }
.dimension-group { border: 1px solid #dee2e6; border-radius: .5rem; padding: .5rem .75rem; margin: 1rem 0; }
.dimension-group > legend { float: none; width: auto; font-size: 1.1rem; font-weight: 600; padding: 0 .4rem; margin-bottom: 0; }
.check-row { border-top: 1px solid #e9ecef; padding: .75rem 0; }
.check-row:first-of-type { border-top: 0; }
.check-code { font-weight: 700; margin-right: .35rem; }
.pass-line { font-size: .9rem; color: #1d4f91; }
.pass-line-label { font-weight: 600; }
.outcome-group { margin: .35rem 0; }
.missing-box { border: 1px solid #f0b429; background: #fffbeb; border-radius: .5rem; padding: .5rem .75rem; }
.missing-list { margin: .5rem 0 0; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #dee2e6; padding: .75rem 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; z-index: 10; }
.reopen-box { border: 1px solid #dee2e6; border-radius: .5rem; padding: 1rem; max-width: 40rem; }
.audit-old { color: #6b1014; }
.audit-new { color: #14532d; }

@media (max-width: 575.98px) {
    h1 { font-size: 1.35rem; }
    .kpi-value { font-size: 1.35rem; }
    .filters > div { flex: 1 1 100%; }
}

@media print {
    .app-navbar, .test-mode-banner, .local-mode-banner, .filters, .sticky-actions, .notice form { display: none !important; }
}
