/* ============================================================================
   dashboard-red.css                                               VERSION 1.14
   Dashboard Red Flags Tool

   Accessibility notes
     - every text color below is at least 4.5:1 against its background
     - focus is always visible, and never removed
     - nothing relies on color alone; the word "red" is stated in the text
     - the report area prints cleanly with the controls hidden

   CHANGELOG
     1.14 2026-10-07  Styled the new indicator-level Save controls alongside
                      Edit, including matching compact sizing and the existing
                      disabled and visible-focus behavior.
     1.13 2026-09-25  Removed the deleted session-help paragraph's styling;
                      the live save/validation status remains in the action
                      row for accessible feedback.
     1.12 2026-09-25  Separated the report actions from the goal panel and
                      strengthened the buttons with consistent spacing, a
                      44-pixel minimum height, and a subtle shadow.
     1.11 2026-09-25  Added accessible indicator-heading controls, numeric
                      Change inputs, disabled-button treatment, and visible
                      validation/status messaging for session-only goal edits.
     1.10 2026-08-26  The status bar no longer shows: .status is replaced by
                      .status-live (hidden, still an ARIA live region) and
                      .status-error (revealed, for a failure the user must
                      see). Dropped .data-note with the element it styled.
     1.9  2026-08-26  Branded header and footer moved into their own
                      css/branding.css, following the Chronic tool's pattern.
                      The old .page-header / .tagline / .page-footer rules are
                      gone with the elements they styled. body loses its side
                      padding so the coloured bands can reach the window edge;
                      <main> takes that padding instead.
     1.8  2026-08-26  Added .rpt-site, the fourth heading level the printed
                      layout needs for a school name under an indicator.
     1.7  2026-08-26  Print now uses #print-report, the two-section layout,
                      and hides the merged on-screen report. Each section
                      starts a new page.
     1.6  2026-08-26  Removed the .goal-warning rules with the paragraph they
                      styled. The goal panel is a bare control now and does
                      not print at all -- the target color reaches paper
                      through the report's subtitle instead.
     1.5  2026-08-26  Removed the mode-radio and points-box rules with the
                      controls they styled -- the goal is always set by target
                      color now. American spelling for "color".
     1.4  2026-08-26  The goal panel moved above the report and became a
                      control panel only, so its print rules changed: the
                      controls are dropped, the explanation of the last
                      column is kept, and it no longer forces a page break.
                      The old .groups definition list is gone -- group rows
                      are table rows now.
     1.3  2026-08-25  Styles for the three-year LCAP goal panel: the mode
                      radios, the goal table, the two-column warning, and the
                      collapsible school-site section. The site section is
                      forced open for printing -- a printout must never be
                      shorter than the document it claims to be.
     1.2  2026-08-25  Added .rpt-school for the school name inside an
                      indicator, on screen and in print.
     1.1  2026-08-25  Replaced .check-row with .scope-note; the
                      supplementary-group checkbox is gone.
     1.0  2026-08-25  First version.
   ========================================================================== */

:root {
  --ink:        #1a1a1a;   /* 15.3:1 on white */
  --ink-soft:   #4a4a4a;   /*  8.1:1 on white */
  --navy:       #1f3864;   /* 11.0:1 on white */
  --navy-mid:   #2f5496;   /*  6.7:1 on white */
  --rule:       #c9cfd8;
  --panel:      #f4f6f9;
  --focus:      #0b5fff;
  --page:       #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* No side padding on the body: the header and footer are full-bleed coloured
     bands (see branding.css) and must reach the window edge. The side padding
     lives on <main> instead. */
  padding: 0 0 4rem;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ focus -- */

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
.report:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  left: .5rem;
  top: .5rem;
}

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

/* ------------------------------------------------------------------ page -- */

/* The header and footer bands live in branding.css. What used to be
   .page-header / .tagline / .page-footer here is gone -- those elements are
   .site-header and .site-footer now, and styling them in two files would mean
   two places to look when the banner is wrong. */

main {
  max-width: 62rem;
  margin: 0 auto;
  /* the side padding the body gave up, so the bands can be full-bleed */
  padding-inline: clamp(1rem, 3.5vw, 4rem);
}

/* --------------------------------------------------------------- controls -- */

.controls {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 1.5rem 0 1rem;
}
.controls h2 {
  margin: 0 0 .85rem;
  font-size: 1.15rem;
  color: var(--navy);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.field { flex: 1 1 20rem; min-width: 0; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: .3rem;
}

select {
  width: 100%;
  max-width: 100%;
  padding: .5rem .6rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #6b7280;
  border-radius: 4px;
}
select:disabled {
  background: #e9ecef;
  color: #55595e;
}

.field-hint {
  margin: .4rem 0 0;
  font-size: .875rem;
  color: var(--ink-soft);
}

.scope-note {
  margin: 1.1rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  font-size: .9rem;
  color: var(--ink-soft);
  max-width: 46rem;
}

/* The page's ARIA live region. Normally carries visually-hidden alongside, so
   routine progress is announced to a screen reader without a bar appearing on
   screen. app.js swaps in .status-error when the user must actually see
   something -- a data file that will not load, or a deep link matching no LEA.

   The error state is bordered and labelled in words, never colour alone. */
.status-live { margin: 0 0 1rem; }

.status-error {
  display: block;
  padding: .7rem .9rem;
  border: 2px solid #a1121e;
  border-left-width: 6px;
  border-radius: 4px;
  background: #fdf2f3;
  color: #7a0d17;          /* 8.2:1 on #fdf2f3 */
  font-size: .95rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------- actions -- */

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem .8rem;
  margin: 1.5rem 0 1.75rem;
}
.actions[hidden] { display: none; }
button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 4px;
  padding: .55rem 1.1rem;
  margin-right: .6rem;
  cursor: pointer;
}
button:hover { background: var(--navy-mid); }
button:disabled {
  color: #5d6773;
  background: #e7e9ec;
  border-color: #aeb4bb;
  cursor: not-allowed;
}
.actions button {
  min-height: 44px;
  margin-right: 0;
  padding: .65rem 1.3rem;
  box-shadow: 0 2px 5px rgba(18, 45, 78, .18);
}
.edit-status {
  flex: 0 0 100%;
  min-height: 1.4em;
  margin: 0;
  color: var(--navy);
  font-weight: 600;
}
.edit-status.is-error { color: #7a0d17; }

/* ----------------------------------------------------------------- report -- */

.report:focus { outline: none; }

.rpt-title {
  margin: 1.5rem 0 .2rem;
  font-size: 1.6rem;
  color: var(--navy);
}
.rpt-subtitle {
  margin: 0 0 .6rem;
  color: var(--ink-soft);
}
.rpt-note {
  margin: .4rem 0 1rem;
  font-size: .9rem;
  color: var(--ink-soft);
  max-width: 46rem;
}
.rpt-entity {
  margin: 1.9rem 0 .5rem;
  padding-bottom: .25rem;
  font-size: 1.25rem;
  color: var(--navy);
  border-bottom: 1px solid var(--navy);
}
.rpt-ind {
  margin: 1rem 0 .3rem;
  font-size: 1.02rem;
  color: var(--navy-mid);
}
.indicator-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.indicator-heading .rpt-ind { margin: 0; }
.edit-indicator,
.save-indicator {
  padding: .28rem .7rem;
  margin: 0;
  font-size: .86rem;
  color: var(--navy);
  background: #fff;
}
.edit-indicator:hover,
.save-indicator:hover:not(:disabled) { color: #fff; }
/* school name inside an indicator, in the school-sites section */
.rpt-school {
  margin: .7rem 0 .15rem 1rem;
  font-size: .97rem;
  color: var(--ink);
}
/* fourth level, used only by the printed layout: a school name sitting under
   an indicator inside the School Sites half of a section */
.rpt-site {
  margin: .6rem 0 .1rem 1.5rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--ink);
}

.groups {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0 .5rem;
  margin: 0 0 .35rem 1rem;
  max-width: 20rem;
}
.groups dt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.groups dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.legend {
  border-collapse: collapse;
  margin: .5rem 0 1rem 1rem;
  font-size: .925rem;
}
.legend th,
.legend td {
  text-align: left;
  padding: .22rem .9rem .22rem 0;
  border-bottom: 1px solid var(--rule);
}
.legend thead th { color: var(--navy); }
.legend tbody th { font-weight: 600; width: 5rem; }

/* ------------------------------------------- three-year LCAP goal panel -- */

.goal-panel {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.35rem 1.5rem;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--navy);
  border-radius: 6px;
  background: #fbfcfe;
}
.goal-panel h2 {
  margin: 0 0 .4rem;
  font-size: 1.3rem;
  color: var(--navy);
}
.goal-intro {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  max-width: 46rem;
}


.goal-table {
  border-collapse: collapse;
  margin: .35rem 0 1rem 1rem;
  font-size: .925rem;
}
.goal-table th,
.goal-table td {
  text-align: left;
  padding: .28rem 1.1rem .28rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.goal-table thead th {
  color: var(--navy);
  border-bottom: 2px solid var(--navy-mid);
  white-space: nowrap;
}
.goal-table tbody th {
  font-weight: 600;
  width: 5rem;
  font-variant-numeric: tabular-nums;
}
.goal-table td.num { font-variant-numeric: tabular-nums; }
.goal-change-input {
  width: 7.25rem;
  max-width: 100%;
  box-sizing: border-box;
  padding: .3rem .4rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  border: 1px solid #66717e;
  border-radius: 3px;
}
.goal-change-input[aria-invalid="true"] {
  border-color: #a1121e;
  box-shadow: 0 0 0 1px #a1121e;
}

/* School-site goals: collapsed on screen, always open on paper. */
.site-goals {
  margin: 1rem 0 0;
  padding: .5rem .9rem .9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
}
.site-goals > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  padding: .35rem 0;
}
.site-goals > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* The two-section layout used for printing and for the Word file. It holds
   the same rows as #report in a different arrangement, so exactly one of the
   two is ever visible: this one on paper, #report on screen. */
.print-only { display: none; }


/* ------------------------------------------------------------------ print -- */

@media print {
  .controls,
  .actions,
  .status-live,
  .skip-link { display: none !important; }

  body { padding: 0; font-size: 11pt; }
  main  { max-width: none; padding-inline: 0; }

  /* The branded header and footer DO print -- they identify the document, and
     branding.css turns the coloured bands white with black text and gives the
     reversed county logo a dark panel so it does not vanish on white paper.
     Only their sizes are set here. */
  .site-header h1        { font-size: 14pt; }
  .header-description    { font-size: 10pt; }
  .site-header           { padding: 0 0 10px; }
  .site-header .header-content,
  .footer-content        { padding-inline: 0; }
  .site-footer           { margin-top: 1.5rem; padding: 10px 0 0; }
  .site-footer p         { font-size: 9pt; }
  .team-logo             { width: min(220px, 40%); }

  .rpt-title  { font-size: 16pt; color: #000; }
  .rpt-entity { font-size: 12.5pt; color: #000; page-break-after: avoid; }
  .rpt-ind    { font-size: 11pt;  color: #000; page-break-after: avoid; }
  .rpt-school { font-size: 10.5pt; color: #000; page-break-after: avoid; }
  .rpt-site   { font-size: 10pt;   color: #000; page-break-after: avoid; }
  .groups     { page-break-inside: avoid; }
  .legend     { page-break-inside: avoid; }

  /* The goal panel is now nothing but a control, so none of it prints. The
     target color it selected still reaches paper -- buildPrintBlocks() names
     it in the subtitle and in the Section 2 column heading, precisely because
     this rule hides the dropdown. Without those a printout would show a goal
     column with no way to tell which color it aims at. */
  .goal-panel { display: none !important; }

  /* SWAP THE TWO LAYOUTS. On screen each group is one row carrying its current
     figure and its goal together; on paper the same groups appear twice, in a
     current section and a goals section, because an LCAP is written by copying
     one block of figures and then the other. Printing the screen layout as
     well would duplicate every number on the page. */
  #report     { display: none !important; }
  .print-only { display: block !important; }

  /* Section 1 and Section 2 each start a page, so a section can be handed to
     someone on its own. */
  .print-only .rpt-entity { page-break-before: always; }
  .print-only .rpt-entity:first-of-type { page-break-before: avoid; }

  .goal-table { font-size: 9.5pt; page-break-inside: avoid; }
  .goal-table thead th { color: #000; }

  /* A printout must never be shorter than the document it claims to be, so
     the collapsed school-site section is opened for printing. CSS cannot be
     trusted to do that -- browsers hide <details> content through the shadow
     tree, not through a rule a stylesheet can override -- so app.js sets the
     `open` property on beforeprint and puts it back afterwards. All this does
     is make the opened section look like part of the document. */
  .site-goals { border: 0; padding: 0; background: none; }
  .site-goals > summary {
    list-style: none;
    font-size: 11pt;
    color: #000;
    page-break-after: avoid;
  }
  .site-goals > summary::-webkit-details-marker { display: none; }
}
