/*
Executive Briefings — application styles.

Palette matches the generated PDF so the interface and its output read as one
system. Contrast is checked against WCAG 2.2 AA: 4.5:1 for normal text, 3:1 for
large text and interactive boundaries.

Neuro-inclusive defaults, per the house standard:
  - text is #1a2230 rather than pure black, on #fafbfc rather than pure white,
    because maximum contrast causes visual fatigue over long reading
  - no decorative animation by default
  - every transition is disabled under prefers-reduced-motion
  - focus is always visible; outline is never removed without a replacement
*/

:root {
  --navy:       #0B3560;
  --navy-dark:  #072441;
  --navy-bar:   #14395f;
  --green:      #2F8B46;
  --green-text: #2B8040;
  --ink:        #1a2230;
  --muted:      #5b6675;
  --rule:       #c9d4e0;
  --surface:    #ffffff;
  --page:       #fafbfc;
  --zebra:      #f5f8fa;
  --danger:     #a8200f;
  --attention-bg:   #fdf0e3;
  --attention-text: #a8500f;

  --radius: 4px;
  --gap: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Liberation Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

/* Focus is never removed. A keyboard user who cannot see where they are has no
   way to use the page at all. */
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

/* The skip link is visually hidden until focused, so a keyboard user can jump
   past the navigation without a sighted user seeing a stray link. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

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

/* ---- top bar ----------------------------------------------------------- */

.topbar {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--green);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav a {
  color: #dce6f2;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--green);
}

.inline-form { margin: 0; }

.link-button {
  background: none;
  border: none;
  color: #dce6f2;
  font: inherit;
  cursor: pointer;
  padding: 4px 0;
}
.link-button:hover { color: #fff; text-decoration: underline; }

/* ---- layout ------------------------------------------------------------ */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  margin: 0 0 20px;
}

h1 {
  font-size: 24px;
  color: var(--navy-dark);
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 var(--gap);
}

.card-narrow {
  max-width: 460px;
  margin: 40px auto;
}

.stack > * + * { margin-top: var(--gap); }

.row {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.muted { color: var(--muted); }

/* ---- forms ------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; }
.field-grow { flex: 1 1 auto; }

.field-checkbox {
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.field-checkbox label { font-weight: 400; }
.field-checkbox .field-help { flex-basis: 100%; margin: 0; }

label {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy-dark);
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
}

input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.field-help {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ---- buttons ----------------------------------------------------------- */

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy-dark);
  text-decoration: none;
  cursor: pointer;
  /* 44px is the house minimum touch target. A control smaller than a fingertip
     is a control that gets mis-tapped. */
  min-height: 44px;
  line-height: 24px;
}

.button:hover { background: var(--zebra); }

.button-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.button-primary:hover { background: var(--navy-dark); }

.button-small {
  padding: 6px 12px;
  min-height: 36px;
  font-size: 14px;
  line-height: 22px;
}

.button-danger { color: var(--danger); border-color: #e8c4bd; }
.button-danger:hover { background: #fdf1ef; }

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- tables ------------------------------------------------------------ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy-dark);
  background: #e8eef4;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid #e6ecf2;
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) td { background: var(--zebra); }

.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { text-align: right; white-space: nowrap; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef2f6;
  color: var(--muted);
}
.tag-shared { background: #e4f1e8; color: var(--green-text); }

/* ---- compose ----------------------------------------------------------- */

.section-card { border-left: 3px solid var(--navy); }

.section-head {
  display: flex;
  align-items: flex-end;
  gap: var(--gap);
  margin: 0 0 var(--gap);
}

.entry {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) minmax(150px, auto) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid #eef2f6;
}

.entries .entry:first-child { border-top: none; }

.actions-bar {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
}

.empty { text-align: center; color: var(--muted); }

/* ---- feedback ---------------------------------------------------------- */

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 0 0 var(--gap);
  border: 1px solid;
}
.flash-info  { background: #eef4fa; border-color: #c2d7ea; color: var(--navy-dark); }
.flash-error { background: #fdf1ef; border-color: #e8c4bd; color: var(--danger); }

.status { margin: 0; font-size: 14px; color: var(--muted); }
.status[data-kind="error"] { color: var(--danger); }
.status[data-kind="ok"]    { color: var(--green-text); }

/* ---- footer ------------------------------------------------------------ */

.footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: stretch; }
  .page-head { flex-direction: column; align-items: stretch; }
  .footer { flex-direction: column; gap: 4px; }
}

/* Motion is opt-out by default and fully disabled on request. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
