@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/backoffice/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* {
  box-sizing: border-box;
}

/* The sticky top bar (phones) would cover the section a form jumps to. */
html {
  scroll-padding-top: calc(var(--touch-min) + var(--space-4) + var(--space-4));
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-4);
  z-index: 50;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--navy-900);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: calc(var(--touch-min) + var(--space-4));
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  border-radius: var(--radius-control);
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
}

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

.icon-button:active {
  background: var(--surface-alt);
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--action-primary);
  color: var(--on-action-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Below 900px (the Design System's bp-md) the sidebar is a drawer: a popover the top bar's button
   opens without scripts. From 900px it is always there and the top bar goes away. */
.sidebar {
  inset: 0 auto 0 0;
  display: none;
  flex-direction: column;
  width: min(20rem, 85vw);
  height: 100%;
  margin: 0;
  padding: var(--space-4);
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  overflow-y: auto;
}

.sidebar:popover-open {
  display: flex;
}

.sidebar::backdrop {
  background: var(--scrim);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--touch-min);
  margin-bottom: var(--space-4);
}

.sidebar-nav {
  flex: 1;
}

.nav-group + .nav-group {
  margin-top: var(--space-6);
}

.nav-group-label {
  margin: 0 0 var(--space-1);
  padding: 0 var(--space-3);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-transform: uppercase;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg);
}

.nav-item[aria-current="page"] {
  background: var(--teal-50);
  color: var(--teal-800);
  font-weight: 700;
}

.nav-item[aria-current="page"]:hover {
  background: var(--teal-100);
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.account {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.account-who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--navy-900);
  color: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.account-text {
  min-width: 0;
}

.account-name,
.account-role {
  margin: 0;
  overflow-wrap: anywhere;
}

.account-name {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.account-role {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.sidebar-form {
  margin: 0;
}

.nav-action {
  font-weight: 400;
}

/* The page takes the room next to the sidebar, up to content-max, from its left edge. */
.page {
  max-width: var(--content-max);
  margin: 0;
  padding: var(--space-6) var(--space-4) var(--space-12);
}

.page:focus {
  outline: none;
}

/* The login and the code: one card in the middle of the screen, under the brand. */
.signed-out .page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  min-height: 100vh;
  min-height: 100svh;
  max-width: none;
}

.signed-out .brand {
  font-size: 32px;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.auth-card h1 {
  font-size: 22px;
}

.auth-card .form {
  max-width: none;
}

/* A page of sections (the detail pages) lays them out in as many columns as fit; everything else
   on it (title, back link, notices) and the sections marked wide take the whole row. */
.page:has(> .section) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: var(--space-4);
  align-items: start;
}

.page:has(> .section) > :not(.section),
.page:has(> .section) > .section-wide {
  grid-column: 1 / -1;
}

.page:has(> .section) > * {
  margin-block: 0;
}

.section-narrow {
  max-width: 36rem;
}

.home-group + .home-group {
  margin-top: var(--space-8);
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  height: 100%;
  min-height: var(--touch-min);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-strong);
  text-decoration: none;
}

.home-card:hover {
  background: var(--bg);
}

.home-card-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--teal-50);
  color: var(--teal-800);
}

.home-card-text {
  display: grid;
  flex: 1;
  gap: var(--space-1);
  min-width: 0;
}

.home-card-title {
  font-weight: 700;
}

.home-card-caption {
  color: var(--text-muted);
  font-size: 14px;
}

.home-card .count {
  flex: none;
}

@media (min-width: 900px) {
  .with-sidebar .topbar {
    display: none;
  }

  .with-sidebar {
    padding-left: 16.5rem;
  }

  html:has(.with-sidebar) {
    scroll-padding-top: 0;
  }

  .with-sidebar .sidebar {
    position: fixed;
    display: flex;
    width: 16.5rem;
  }

  /* A drawer left open while the window grows has nothing to dim and nothing to close. */
  .with-sidebar .sidebar::backdrop {
    background: transparent;
    pointer-events: none;
  }

  .with-sidebar .sidebar-close {
    display: none;
  }

  .with-sidebar .page {
    padding: var(--space-8) var(--space-8) var(--space-12);
  }

  .auth-card {
    padding: var(--space-8);
  }
}

/* Without popover support the menu can't open, so on a phone it is just there, above the page. */
@supports not selector(:popover-open) {
  @media (max-width: 899.98px) {
    .with-sidebar .sidebar {
      position: static;
      display: flex;
      width: auto;
      height: auto;
      border-right: 0;
      border-bottom: 1px solid var(--border);
    }

    .with-sidebar .topbar .icon-button,
    .with-sidebar .sidebar-close {
      display: none;
    }
  }
}

h1 {
  margin: 0 0 var(--space-4);
  color: var(--text-strong);
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 var(--space-2);
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.form {
  display: grid;
  gap: var(--space-4);
  max-width: 28rem;
}

.form .button {
  justify-self: start;
}

.auth-card .form .button {
  justify-self: stretch;
}

.field {
  display: grid;
  gap: var(--space-2);
}

label {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select {
  min-height: var(--input-height);
}

::placeholder {
  color: var(--ink-300);
}

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

[aria-invalid="true"] {
  border-color: var(--danger);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
fieldset[aria-invalid="true"] {
  outline: 2px solid var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-6);
  border: 1.5px solid transparent;
  border-radius: var(--radius-control);
  background: var(--action-primary);
  color: var(--on-action-primary);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

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

.button:active {
  background: var(--action-primary-pressed);
}

.button-quiet {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
}

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

.button-quiet:active {
  background: var(--surface-alt);
}

.button-danger,
.button-danger:hover,
.button-danger:active {
  background: var(--danger);
}

.button:disabled {
  border-color: transparent;
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

.message {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-control);
}

.message-alert {
  background: var(--danger-soft);
  color: var(--danger);
}

.message-notice {
  background: var(--success-soft);
  color: var(--success);
}

a {
  color: var(--text-link);
}


.muted {
  margin: 0;
  color: var(--text-muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.thumb {
  flex: none;
  width: 6rem;
  height: 4.5rem;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--surface-alt);
}

.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  font-size: 14px;
  text-align: center;
}

.card-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: var(--space-1);
  justify-items: start;
  min-width: 0;
}

.card-body.wide {
  justify-items: stretch;
}

.card-title {
  margin: 0;
}

.paging {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.paging form {
  margin: 0;
}

.section {
  margin: 0 0 var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-control);
}

.photos-grid {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
}

.facts dt {
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  color: var(--text-body);
  font-size: 16px;
  font-weight: 400;
}

.choice input {
  flex: none;
  width: var(--space-6);
  height: var(--space-6);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-6);
}

/* The rows of the markup are just groups: on a wide screen all the fields share one row. */
.filters .row {
  display: contents;
}

.filters .field {
  flex: 1 1 12rem;
  max-width: 24rem;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0 0 var(--space-4);
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.chip:hover {
  background: var(--bg);
}

.chip[aria-current="page"] {
  border-color: var(--action-primary);
  background: var(--teal-50);
  color: var(--teal-800);
}

.chip[aria-current="page"]:hover {
  background: var(--teal-100);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

.contact a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
}

.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.badge-active,
.badge-paper-current {
  background: var(--success-soft);
  color: var(--success);
}

.badge-disabled,
.badge-paper-expired,
.badge-alert {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-paper-expiring {
  background: var(--warning-soft);
  color: var(--warning);
}

.papers {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

.free-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history {
  margin: 0;
  padding-left: var(--space-6);
}
