/*
 * The permit system of Gemeente Zuidhoek, as `Schermen v210` draws it (`O-1083`).
 *
 * Every number here is read off the drawing's inline styles, frame by frame, and the frame is named beside the rule.
 * It is deliberately not Documinds: another letter, a cool ground, corners of 3 and the municipality's blue.
 */

@font-face {
  font-family: "Source Sans 3";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --ground: #f1f3f6;
  --ink: #1b2430;
  --ink-soft: #3b4654;
  --muted: #5b6675;
  --line: #d6dce4;
  --field-line: #b9c2ce;
  --head-row: #f6f8fa;
  --blue: #1e4d7b;
  --blue-deep: #163a5e;
  --gold: #d99a1e;
  --band: #1b2430;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  block-size: 100%;
}

body {
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

/* The head (210a): 56 high, the municipality's blue, the arms and the name, the two places, the initial. */
.head {
  position: relative;
  flex: none;
  block-size: 56px;
  background: var(--blue);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px 0 20px;
}
.head-name {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.head-name img {
  display: block;
}
.head-name span {
  display: grid;
  line-height: 1.15;
}
.head-name strong {
  font: 600 15px var(--serif);
  color: #fff;
}
.head-name small {
  font: 12px var(--sans);
  color: rgba(255, 255, 255, 0.78);
}
.head nav {
  display: flex;
  margin-inline-start: 8px;
}
.head nav a {
  block-size: 56px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-block-end: 3px solid transparent;
  border-block-start: 3px solid transparent;
  color: #fff;
  opacity: 0.82;
  font: 400 14.5px var(--sans);
  text-decoration: none;
}
.head nav a[aria-current="page"] {
  border-block-end-color: var(--gold);
  opacity: 1;
  font-weight: 600;
}
.head-menu {
  margin-inline-start: auto;
  position: relative;
}
.head-menu > button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: none;
  border: 0;
  padding: 0;
  font: 13px var(--sans);
  cursor: pointer;
}
.initial {
  inline-size: 30px;
  block-size: 30px;
  border-radius: 50%;
  background: var(--blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 13px var(--sans);
}
.caret {
  font-size: 11px;
  opacity: 0.8;
}

/* The page below the head. The case page lets its band stand at the foot (210c), so the page scrolls in between. */
.page {
  flex: 1;
  min-block-size: 0;
  overflow: auto;
}
main {
  padding: 24px;
  max-inline-size: 1240px;
}
.case-main {
  padding: 20px 24px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.title-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-block-end: 16px;
}
h1 {
  margin: 0;
  font: 600 24px/1.2 var(--sans);
  letter-spacing: -0.005em;
}
.under-title {
  margin-block-start: 2px;
  color: var(--muted);
  font-size: 13.5px;
}

/* Buttons and fields at 36 and 38, corners of 3. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  block-size: 36px;
  padding: 0 14px;
  border-radius: 3px;
  border: 1px solid var(--field-line);
  background: #fff;
  color: var(--ink);
  font: 600 14px var(--sans);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.button:disabled {
  cursor: default;
  opacity: 0.55;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 250px;
  block-size: 36px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  color: var(--muted);
}
.search input {
  border: 0;
  outline: 0;
  font: 14px var(--sans);
  inline-size: 100%;
  color: var(--ink);
}

/* A card: white on the grey, one line round it. */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 18px;
  border-block-end: 1px solid var(--line);
}
.card-head h2 {
  margin: 0;
  font: 600 15px var(--sans);
}
.card-head .count {
  margin-inline-start: auto;
  font-size: 13px;
  color: var(--muted);
}

/* Werkvoorraad (210a): Zaak 108 · Aanvrager · Status 178 · Ontvangen 84. */
.cases {
  overflow: hidden;
}
.cases .row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 178px 84px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-block-start: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.cases .row:first-of-type {
  border-block-start: 0;
}
.cases .row:hover {
  background: var(--head-row);
}
.cases .row.fresh {
  background: #fffbef;
}
.cases .row.header {
  padding: 9px 16px;
  background: var(--head-row);
  border-block-end: 1px solid var(--line);
  font: 600 12.5px var(--sans);
  color: var(--muted);
}
.cases .number {
  font: 600 14px var(--sans);
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.cases .who {
  display: grid;
  min-inline-size: 0;
}
.cases .who strong,
.cases .who span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cases .who strong {
  font-weight: 600;
}
.cases .who span {
  font-size: 13px;
  color: var(--muted);
}
.cases .received {
  text-align: end;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13.5px;
}
.cases .activity {
  display: none;
}

/* A status: a pill with its dot, five colours, one per status. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  block-size: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font: 600 12.5px var(--sans);
  white-space: nowrap;
  background: var(--status-ground);
  color: var(--status-ink);
}
.status::before {
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--status-ink);
}
.status[data-status="received"] {
  --status-ground: #e8eef5;
  --status-ink: #1e4d7b;
}
.status[data-status="handling"] {
  --status-ground: #e2f1f0;
  --status-ink: #1f6f6f;
}
.status[data-status="awaiting"] {
  --status-ground: #fbf0d9;
  --status-ink: #8a5a00;
}
.status[data-status="deciding"] {
  --status-ground: #eeebf7;
  --status-ink: #5a4a96;
}
.status[data-status="granted"] {
  --status-ground: #e4f2e8;
  --status-ink: #2e7046;
}

/* Nieuwe aanvraag (210b): fieldsets of two columns, fields of 38. */
.form {
  padding: 0 20px;
}
.form fieldset {
  border: 0;
  margin: 0;
  padding: 16px 0 18px;
  border-block-start: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form fieldset:first-of-type {
  border-block-start: 0;
}
.form legend {
  padding: 0;
  float: inline-start;
  inline-size: 100%;
  margin-block-end: 2px;
  font: 600 15px var(--sans);
  grid-column: 1 / -1;
}
.form label,
.form .choice {
  display: grid;
  gap: 5px;
  align-content: start;
}
.form .wide {
  grid-column: span 2;
}
.form .label {
  font: 600 13.5px var(--sans);
}
.form input,
.form select,
.form textarea {
  block-size: 38px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  font: 14.5px/1.45 var(--sans);
  color: var(--ink);
  inline-size: 100%;
}
.form textarea {
  block-size: 84px;
  padding-block-start: 8px;
  resize: block;
}
.form .hint {
  font-size: 12.5px;
  color: var(--muted);
}
.form .error {
  font-size: 12.5px;
  color: #b3261e;
}
.segmented {
  display: inline-flex;
  border: 0;
  margin: 0;
  padding: 0;
}
.segmented input {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
}
.segmented span {
  block-size: 38px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--field-line);
  background: #fff;
  color: var(--ink);
  font: 600 14px var(--sans);
  cursor: pointer;
}
.segmented label:first-of-type span {
  border-radius: 3px 0 0 3px;
}
.segmented label:last-of-type span {
  border-inline-start: 0;
  border-radius: 0 3px 3px 0;
}
.segmented input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.form-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 16px;
  border-block-start: 1px solid var(--line);
}
.form-foot p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-inline-size: 330px;
}
.form-foot .buttons {
  margin-inline-start: auto;
  display: flex;
  gap: 8px;
}

/* Zaak (210c). */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-block-end: 8px;
}
.crumbs a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.case-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-block-end: 14px;
}
.case-head > div:first-child {
  min-inline-size: 0;
}
.case-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.case-sub {
  margin-block-start: 3px;
  color: var(--muted);
  font-size: 14px;
}
.case-act {
  margin-inline-start: auto;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.case-act .note {
  font-size: 12.5px;
  color: var(--muted);
}

/* The line with what Documinds does: four states, each its own colour (210c, 210f). */
.run-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 13.5px;
  margin-block-end: 14px;
}
.run-state strong {
  font-weight: 600;
}
.run-state time {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 12.5px;
}
.run-state[data-state="done"] {
  background: #e4f2e8;
  color: #2e7046;
}
.run-state[data-state="running"] {
  background: #e8eef5;
  color: #1e4d7b;
}
.run-state[data-state="waiting"] {
  background: #eeebf7;
  color: #5a4a96;
}
.run-state[data-state="failed"] {
  background: #fbe9e7;
  color: #b3261e;
}

.documents {
  padding: 4px 18px 6px;
}
.document {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-block-start: 1px solid var(--line);
}
.document:first-child {
  border-block-start: 0;
}
.pdf-mark {
  flex: none;
  inline-size: 28px;
  block-size: 34px;
  border: 1px solid var(--field-line);
  border-radius: 2px;
  background: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-block-end: 3px;
  font: 700 8.5px var(--sans);
  color: #b3261e;
}
.document .what {
  display: grid;
  min-inline-size: 0;
  flex: 1;
}
.document .what strong {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}
.document .what span {
  font-size: 13px;
  color: var(--muted);
}
.new-mark {
  font: 700 11px var(--sans);
  padding: 1px 7px;
  border-radius: 2px;
  background: #fbf1da;
  color: #7a5200;
  border: 1px solid #ebc977;
}
.link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.facts {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.facts div {
  display: grid;
  gap: 1px;
  align-content: start;
}
.facts .all {
  grid-column: span 3;
}
.facts dt {
  font-size: 12.5px;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-size: 14px;
}

.timeline {
  padding: 10px 18px 12px;
  margin: 0;
  list-style: none;
}
.timeline li {
  display: grid;
  grid-template-columns: 96px 14px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
}
.timeline time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.timeline .dot {
  position: relative;
}
.timeline .dot::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  inset-block-start: 6px;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
}
.timeline li:first-child .dot::before {
  background: var(--blue);
}
.timeline .event {
  display: grid;
}
.timeline .event strong {
  font-weight: 600;
}
.timeline .event span {
  font-size: 13px;
  color: var(--muted);
}

/* The band of traffic (210c): fixed to the window's foot, dark, a gold edge, at most four lines that scroll. */
.band {
  flex: none;
  background: var(--band);
  color: #fff;
  font: 14px/1.45 var(--sans);
  border-block-start: 3px solid var(--gold);
}
.band-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}
.band-head strong {
  font: 600 13.5px var(--sans);
}
.band-head span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}
.band-head button {
  margin-inline-start: auto;
  font: 12.5px var(--sans);
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: 0;
  cursor: pointer;
}
.band-lines {
  max-block-size: calc(4 * 50px);
  overflow-block: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.band[data-folded="true"] .band-lines {
  display: none;
}
.band-lines li {
  display: grid;
  grid-template-columns: 60px 40px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 7px 16px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
  align-items: baseline;
}
.band-lines time {
  font: 12px var(--mono);
  color: rgba(255, 255, 255, 0.62);
}
.direction {
  justify-self: start;
  font: 700 10.5px var(--sans);
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--band);
}
.direction[data-direction="in"] {
  background: #8fb8e0;
}
.direction[data-direction="out"] {
  background: var(--gold);
}
.direction[data-direction="lost"] {
  background: #e8a19b;
}
.band-lines .said {
  color: #fff;
  font-size: 13.5px;
}
.band-lines .route {
  grid-column: 3;
  font: 11.5px/1.5 var(--mono);
  color: rgba(255, 255, 255, 0.62);
  overflow-wrap: anywhere;
}

/* Alone on the screen (210h): from about 1100 the case has two columns, Documenten on the right. */
@media (min-width: 1100px) {
  .case-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .case-columns .side {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .case-columns > .card {
    margin: 0;
  }
  .cases .row {
    grid-template-columns: 108px minmax(0, 1fr) 260px 178px 84px;
  }
  .cases .activity {
    display: block;
    color: var(--muted);
    font-size: 13.5px;
  }
  .cases .who span {
    display: none;
  }
}
.stack {
  display: grid;
  gap: 12px;
}

/* The menu under the initial (210g). */
.menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 44px;
  inline-size: 240px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(27, 36, 48, 0.18);
  padding: 6px 0;
  font: 14px var(--sans);
  color: var(--ink);
  z-index: 3;
}
.menu-who {
  padding: 8px 14px 10px;
  border-block-end: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.menu-who strong {
  color: var(--ink);
  font-weight: 600;
}
.menu a,
.menu button {
  display: block;
  inline-size: 100%;
  padding: 9px 14px;
  background: none;
  border: 0;
  text-align: start;
  font: 14px var(--sans);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.menu a:hover,
.menu button:hover,
.menu a:focus-visible,
.menu button:focus-visible {
  background: #e8eef5;
  outline: 0;
}
.menu form {
  margin: 0;
}
.menu .menu-last {
  border-block-start: 1px solid var(--line);
}

/* A window (210e, 210g): white, corners of 3, on a dark veil. */
.dialog {
  inline-size: min(540px, calc(100vi - 32px));
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(27, 36, 48, 0.35);
  margin-block-start: 72px;
}
.dialog.narrow {
  inline-size: min(480px, calc(100vi - 32px));
}
.dialog.narrow form {
  padding: 18px 20px 16px;
}
.dialog::backdrop,
.viewer::backdrop {
  background: rgba(27, 36, 48, 0.55);
}
.dialog h2 {
  margin: 0 0 8px;
  font: 600 18px var(--sans);
}
.dialog p {
  margin: 0 0 8px;
}
.quiet {
  color: var(--muted);
  font-size: 13.5px;
}
.dialog-head {
  padding: 16px 20px 4px;
  display: flex;
}
.dialog-head > span {
  display: grid;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-x {
  margin-inline-start: auto;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  align-self: flex-start;
}
.dialog-body {
  border: 0;
  margin: 0;
  padding: 12px 20px 4px;
  display: grid;
  gap: 8px;
}
.dialog-body legend {
  padding: 0;
  margin-block-end: 8px;
  font: 600 14.5px var(--sans);
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
}
.dialog.narrow .dialog-foot {
  padding: 8px 0 0;
}
.option {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 3px;
}
.option-choice {
  display: flex;
  gap: 10px;
  cursor: pointer;
}
.option:has(input:checked) {
  border-color: var(--blue);
  background: #e8eef5;
}
.option-choice input {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}
.option-choice > span {
  display: grid;
  gap: 2px;
  flex: 1;
}
.option strong {
  font-weight: 600;
}
.missing {
  display: none;
  gap: 8px;
  margin-block-start: 10px;
  margin-inline-start: 28px;
}
.option:has(input:checked) .missing {
  display: grid;
}
.label {
  font: 600 13.5px var(--sans);
  color: var(--ink);
}
.missing-line {
  display: flex;
  gap: 6px;
  align-items: center;
}
.missing-line input,
.before input {
  flex: 1;
  block-size: 36px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  font: 14px var(--sans);
  color: var(--ink);
}
.missing-line input:focus,
.before input:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 77, 123, 0.25);
  outline: 0;
}
.missing-x {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0 4px;
  cursor: pointer;
}
.missing .link {
  justify-self: start;
}
.before {
  display: grid;
  gap: 5px;
  margin-block-start: 4px;
  inline-size: 200px;
}
.error {
  color: #b3261e;
  font-size: 13px;
}

/* The pdf over the case, inside the window (210d). */
.viewer {
  inline-size: min(900px, calc(100vi - 32px));
  block-size: calc(100vb - 48px);
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #525659;
  box-shadow: 0 16px 48px rgba(27, 36, 48, 0.35);
}
.viewer[open] {
  display: flex;
  flex-direction: column;
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-block-end: 1px solid var(--line);
}
.viewer-bar > span {
  display: flex;
  gap: 4px;
  align-items: baseline;
}
.viewer-bar .button {
  margin-inline-start: auto;
}
.viewer iframe {
  flex: 1;
  border: 0;
  inline-size: 100%;
}

/* The line's mark and the search's glass, drawn rather than fetched. */
.run-mark {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.run-state form {
  margin: 0;
}
.search-mark {
  inline-size: 12px;
  block-size: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  flex: none;
}

/* Inloggen: the arms and the name on the blue (O-1083 (9), not drawn). */
body.login {
  background: var(--blue);
  align-items: center;
  justify-content: center;
}
.login-card {
  inline-size: min(360px, calc(100vi - 32px));
  background: #fff;
  border-radius: 3px;
  padding: 28px 24px 24px;
  display: grid;
  justify-items: center;
  gap: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.login-card h1 {
  font: 600 20px var(--serif);
  margin-block-start: 10px;
}
.login-card p {
  margin: 0 0 12px;
  color: var(--muted);
}
.login-card form {
  display: grid;
  gap: 12px;
  inline-size: 100%;
}
.login-card label {
  display: grid;
  gap: 5px;
}
.login-card input {
  block-size: 38px;
  padding: 0 10px;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  font: 14.5px var(--sans);
}
.login-card .button {
  justify-content: center;
}
