/* Palette and type follow takomaparkmd.gov (CivicPlus theme):
   navy #084890, green #12803d, gold #fcb82b, Poppins. */
:root {
  --fg: #1a1a1a;
  --muted: #555;
  --border: #c9ced6;
  --navy: #084890;
  --green: #12803d;
  --gold: #fcb82b;
  --page-bg: #f2f4f7;
  --accent: var(--navy);
  --done: var(--green);
  --pending: #6b6b6b;
  --error-bg: #fde2e2;
  --error-fg: #8a1f1f;
  font-family: Poppins, "Noto Sans Ethiopic", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--fg);
  line-height: 1.5;
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); }
/* Focus rings need 3:1 against what's around them (WCAG 1.4.11):
   navy on light backgrounds, white on the green strip and footer. */
a:focus-visible, button:focus-visible, input:focus-visible, main:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
.city-strip a:focus-visible, .site-footer a:focus-visible {
  outline-color: #fff;
}
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
}
.skip-link:focus { top: 0; outline-color: var(--gold); }

.demo-banner {
  background: #c62828;
  color: #fff;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
}

/* --- City header ------------------------------------------------------- */

.site-header {
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}
.site-header-inner,
.city-strip-inner,
.site-footer-inner,
main {
  max-width: 760px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-seal { display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-city {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brand-app {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.35rem;
}

.lang-switcher {
  display: flex;
  gap: 0.4rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.lang-switcher a,
.lang-switcher .current {
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--navy);
  border-radius: 999px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 500;
}
.lang-switcher .current {
  background: var(--navy);
  color: #fff;
}
.lang-switcher a:hover { background: #e8eef7; }

.city-strip { background: var(--green); }
.city-strip-inner { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.city-strip a {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}
.city-strip a:hover { text-decoration: underline; }

/* --- Page body --------------------------------------------------------- */

main {
  flex: 1 0 auto;
  width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
main > section {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  padding: 1.25rem 1.5rem 1.5rem;
}
.page-title {
  color: var(--navy);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
main h2 { color: var(--green); font-weight: 600; }

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

.site-footer {
  background: var(--green);
  color: #fff;
}
.site-footer-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.footer-seal { flex: none; }
.footer-contact h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
}
.footer-contact p { margin: 0 0 0.75rem; font-size: 0.95rem; }
.site-footer a { color: #fff; }

@media (max-width: 480px) {
  .brand-seal { width: 48px; height: 48px; }
  .brand-app { font-size: 1.15rem; }
  .page-title { font-size: 1.5rem; }
  main > section { padding: 1rem; }
  .footer-seal { width: 56px; height: 56px; }
}

/* --- Admin header ------------------------------------------------------ */

.site-header-admin .brand-app { font-size: 1.1rem; }

form label {
  display: block;
  margin: 0.75rem 0;
  font-weight: 500;
}

.hint {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

/* Text boxes only: radio buttons, checkboxes and the file picker keep
   their own size, beside their labels. */
form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]) {
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin-top: 0.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
}

button {
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: #063a74; }

.error {
  padding: 0.75rem 1rem;
  background: var(--error-bg);
  color: var(--error-fg);
  border-radius: 4px;
  margin: 0.75rem 0;
}

.warning {
  padding: 0.6rem 0.9rem;
  background: #fff4e1;
  color: #6b4a00;
  border-left: 4px solid #e0a500;
  border-radius: 4px;
  margin: 0.75rem 0;
}

/* An action's outcome on the admin dashboard, e.g. after a clear. */
.notice {
  padding: 0.6rem 0.9rem;
  background: #e3f5e8;
  color: #0e6b33;
  border-left: 4px solid var(--green);
  border-radius: 4px;
  margin: 0.75rem 0;
}

.status {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-weight: 500;
}
/* Darker than --green so it stays above 4.5:1 on the tinted background. */
.status-delivered { background: #e3f5e8; color: #0e6b33; }
.status-in-progress { background: #e6f0fa; color: var(--accent); }
.status-pending { background: #f2f2f2; color: var(--muted); }

.timeline {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.timeline li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.timeline li.done .label { color: var(--done); font-weight: 500; }
.timeline li.pending { color: var(--pending); }
.timeline .time { font-variant-numeric: tabular-nums; }

.privacy-note { color: var(--muted); margin-top: 1.5rem; }
.updated-note { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 1rem; }
.cf-turnstile { margin: 0.75rem 0; }

/* --- Admin area ------------------------------------------------------- */

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.4rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.admin-nav a { color: var(--accent); text-decoration: none; white-space: nowrap; }
.admin-nav .admin-user { margin-left: auto; color: var(--muted); }
.admin-nav .logout-form { margin: 0; }
.link-button {
  background: none; color: var(--accent); border: 0;
  padding: 0; cursor: pointer; font: inherit; text-decoration: underline;
}

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

/* One row: "Drop a .csv or .xlsx file here, or [Choose File]". The file
   input is hidden but still focusable and required; its label is the
   button. Wraps only where the row doesn't fit. */
.dropzone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #fff;
}
.dropzone.drag { border-color: var(--accent); background: #eef5fb; }
.dropzone .file-button {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.dropzone .file-button:hover { background: #e8eef7; }
.dropzone input:focus-visible + .file-button { outline: 3px solid var(--navy); outline-offset: 2px; }
.dropzone #file-name { overflow-wrap: anywhere; }
.dropzone #file-name:empty { display: none; }
.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;
}

fieldset { border: 1px solid var(--border); border-radius: 4px; padding: 0.75rem; }
fieldset legend { padding: 0 0.3rem; font-weight: 500; }
/* One option per row, the button to the left of its label. */
fieldset label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-weight: 400;
}
fieldset input[type="radio"] { flex: none; margin: 0; }

.summary-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.25rem 1rem;
  margin: 0.5rem 0 1rem;
}
.summary-grid dt { color: var(--muted); }
.summary-grid dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;  /* the SHA-256 */
}

.chip {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  background: #eef2f6;
  border-radius: 10px;
  font-size: 0.85rem;
}

.diff-table, .audit-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}
.diff-table th, .diff-table td,
.audit-table th, .audit-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
/* A table wider than the card scrolls inside it, never the whole page. */
.table-scroll { overflow-x: auto; margin: 0.5rem 0 1rem; }
.table-scroll > table { margin: 0; }
/* Times stay on one line; file names and details wrap instead. */
.audit-table td.time, .activity-table th[scope="row"] { white-space: nowrap; }
.audit-table td.file, .audit-table td.details { overflow-wrap: anywhere; min-width: 10rem; }
/* Activity page: an hour at or past an alert threshold (also says "over"). */
.activity-table td.over { background: #fdeeee; color: #8a1f1f; }
.row-added { background: #eef9f0; }
.row-removed { background: #fdeeee; }
.row-changed { background: #fff8e1; }
.old { color: #8a1f1f; }
.new { color: var(--done); }

/* Wraps on a phone; buttons line up along the bottom, so Discard sits
   beside Commit even when the backward-moves checkbox is above Commit. */
.actions { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.actions > a { align-self: center; }
.inline-form { display: inline; }
button.danger { background: #8a1f1f; }
button.danger:hover { background: #6e1818; }
button.link-button:hover { background: none; }

