/*
 * Twinfield MCP by AAdditum: the look on top of Basecoat (shadcn/ui as plain HTML).
 * Light only. Each colour of the logo means one thing: blue for actions, links and navigation,
 * green for what went well, orange for what needs attention. Every colour is darker than in the
 * logo so text on white keeps a contrast of 4.5:1 or more.
 * Pages carry no inline styles (the policy forbids them): everything they need is a class here.
 */

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/pt-sans-400.woff2) format('woff2');
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/pt-sans-700.woff2) format('woff2');
}
@font-face {
  font-family: 'Dosis';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/dosis-700.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --font-sans: 'PT Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Dosis', 'PT Sans', system-ui, sans-serif;
  --background: #ffffff;
  --foreground: #262a2e;
  --card: #ffffff;
  --card-foreground: #262a2e;
  --popover: #ffffff;
  --popover-foreground: #262a2e;
  --primary: #2563a6;
  --primary-foreground: #ffffff;
  --secondary: #e8f1fa;
  --secondary-foreground: #2563a6;
  --muted: #eff3f6;
  --muted-foreground: #5b6670;
  --accent: #e8f1fa;
  --accent-foreground: #2563a6;
  --destructive: #c0392b;
  --border: #dde3ea;
  --input: #c5ced8;
  --ring: #2563a6;
  --sidebar: #ffffff;
  --sidebar-foreground: #262a2e;
  --sidebar-primary: #2563a6;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e8f1fa;
  --sidebar-accent-foreground: #2563a6;
  --sidebar-border: #dde3ea;
  --sidebar-ring: #2563a6;
  --surface: #f6f8fa;
  --good: #1d7a43;
  --attention-bg: #fdf1dc;
  --attention-fg: #8f5300;
}

body.app {
  margin: 0;
  background: var(--surface);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.app h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.app h2 {
  font-size: 17px;
  font-weight: 700;
}
.app h3 {
  font-size: 15px;
  font-weight: 700;
}
.app a:not(.btn, .item, .nav-link, .brand, .badge) {
  color: var(--primary);
  text-underline-offset: 3px;
}
.app code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
.app .btn {
  font-weight: 700;
}
.app .btn[data-variant='destructive-outline'] {
  border: 1px solid color-mix(in oklab, var(--destructive) 45%, transparent);
  background: var(--background);
  color: var(--destructive);
}
.app .btn[data-variant='destructive-outline']:hover {
  background: color-mix(in oklab, var(--destructive) 8%, var(--background));
}
.muted {
  color: var(--muted-foreground);
}
.small {
  font-size: 13px;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Status: always a word, and a dot or icon next to the colour. */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
}
.app .badge {
  gap: 6px;
}
.app .badge.good {
  border-color: color-mix(in oklab, var(--good) 35%, transparent);
  background: var(--background);
  color: var(--good);
}
.app .badge.attention {
  border-color: transparent;
  background: var(--attention-bg);
  color: var(--attention-fg);
}
.app .badge.quiet {
  border-color: var(--border);
  background: var(--background);
  color: var(--muted-foreground);
}

/* ---------- Simple pages: login, consent, errors, the landing page and the account ---------- */

.simple-main {
  box-sizing: border-box;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.simple-main .brand img {
  display: block;
  width: 180px;
  height: auto;
}
.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0;
}
.prose ul {
  padding-left: 20px;
}
.prose h2 {
  margin: 14px 0 0;
}
.prose h3 {
  margin: 8px 0 0;
}
.prose .table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.prose table.capabilities th {
  width: 32%;
  white-space: normal;
  vertical-align: top;
}
.prose table.capabilities td {
  white-space: normal;
  vertical-align: top;
}
.status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 12px;
  white-space: nowrap;
}
.status.available {
  background: #e3f3e9;
  color: var(--good);
}
.status.partial {
  background: var(--attention-bg);
  color: var(--attention-fg);
}
.status.planned {
  background: var(--muted);
  color: var(--muted-foreground);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- The admin pages: a sidebar on a wide screen, a menu button on a phone ---------- */

.shell {
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  box-sizing: border-box;
  padding: 0 12px 0 4px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.topbar .btn {
  width: 44px;
  height: 44px;
}
.topbar img {
  width: 28px;
  height: 28px;
}
.topbar-title {
  font-weight: 700;
  font-size: 16px;
}

.menu-panel {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 12px;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
}
.menu-panel[popover] {
  inset: 0 auto 0 0;
  width: min(300px, 86vw);
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15);
}
.menu-panel[popover]:not(:popover-open) {
  display: none;
}
.menu-panel[popover]::backdrop {
  background: rgb(10 20 30 / 0.45);
}
.menu-close {
  align-self: flex-end;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 8px;
  text-decoration: none;
}
.brand img {
  display: block;
  width: 180px;
  height: auto;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-foreground);
  text-decoration: none;
}
.nav-link:hover {
  background: var(--muted);
}
.nav-link[aria-current='page'] {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  font-weight: 700;
}
.nav-link svg {
  flex: none;
}
.menu-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-border);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  min-width: 0;
}
.who span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.menu-links form {
  margin: 0;
}

.content {
  box-sizing: border-box;
  min-width: 0;
  padding: 20px 16px 48px;
}
.content-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
  }
  .topbar,
  .menu-close {
    display: none;
  }
  /* On a wide screen the menu is always there: shown in place, never as a popover. */
  .menu-panel[popover],
  .menu-panel[popover]:not(:popover-open) {
    inset: auto;
    position: sticky;
    top: 0;
    display: flex;
    width: auto;
    height: 100vh;
    box-shadow: none;
    border-right: 1px solid var(--sidebar-border);
  }
  .content {
    padding: 32px 40px 56px;
  }
}

/* ---------- Building blocks of the admin pages ---------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-header > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 420px;
}
.page-header p {
  margin: 0;
  max-width: 680px;
  color: var(--muted-foreground);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section > h2 {
  margin: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label {
  font-size: 13px;
  color: var(--muted-foreground);
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.stat-value small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.stat-note {
  font-size: 12px;
  color: var(--muted-foreground);
}
.columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}
.columns > .wide {
  flex: 2 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.columns > .narrow {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.card.flush {
  padding-bottom: 0;
  gap: 16px;
}
.card.flush > .table-container,
.card.flush > .rows {
  border-top: 1px solid var(--border);
}
.card.flush > footer.note {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted-foreground);
}
.card.danger {
  border-color: color-mix(in oklab, var(--destructive) 35%, transparent);
}
.table th:first-child,
.table td:first-child {
  padding-left: 24px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 24px;
}
.table td.wrap {
  white-space: normal;
  min-width: 260px;
}
.table tr.dim {
  opacity: 0.6;
}
.cell-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.cell-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.row-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.row-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* A list of people or things that each open their own page: the same on a phone and a desk. */
.rows {
  display: flex;
  flex-direction: column;
}
.rows > .item {
  border-radius: 0;
  padding-left: 24px;
  padding-right: 24px;
}
.rows > .item + .item {
  border-top: 1px solid var(--border);
}
.rows .item aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.icon-attention {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--attention-bg);
  color: var(--attention-fg);
}

.kv {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}
.kv > div + div {
  border-top: 1px solid var(--border);
}
.kv dt {
  color: var(--muted-foreground);
}
.kv dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
.kv.legend > div {
  justify-content: flex-start;
  align-items: baseline;
}
.kv.legend dt {
  flex: none;
  width: 84px;
}
.kv.legend dd {
  font-weight: 400;
  text-align: left;
}
.events {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.events li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 0;
}
.events li + li {
  border-top: 1px solid var(--border);
}
.events .when {
  font-size: 12px;
  color: var(--muted-foreground);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
/* A filter in one row above the cards: the choices say what they are. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-bar select {
  width: auto;
  max-width: 100%;
}
.inline-form .field {
  flex: 1 1 240px;
  min-width: 0;
}
.inline-form select {
  width: 100%;
}
.textarea-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* Rights of a role: one row per part, with its level. */
.rights {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.rights li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  font-size: 14px;
}
.rights li + li {
  border-top: 1px solid var(--border);
}

/* One part of a role while composing it: what it covers, and geen, concept or volledig. */
.group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}
.group-row > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.group-row details {
  font-size: 12px;
}
.group-row details p {
  margin: 6px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.7;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}
.group-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.group-choice .note {
  max-width: 260px;
  font-size: 12px;
  text-align: right;
  color: var(--muted-foreground);
}
.segmented {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--muted);
}
.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--muted-foreground);
  cursor: pointer;
  white-space: nowrap;
}
.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.segmented label:has(input:checked) {
  background: var(--background);
  color: var(--foreground);
  font-weight: 700;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.08),
    0 0 0 1px var(--border);
}
.segmented label:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}
.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .group-choice {
    width: 100%;
    align-items: stretch;
  }
  .group-choice .segmented {
    display: flex;
  }
  .group-choice .segmented label {
    flex: 1;
    min-height: 44px;
  }
  .group-choice .note {
    max-width: none;
    text-align: left;
  }
}

/* Calls per day: an SVG bar per day, its value in a tooltip and in the list below it. */
/* Basecoat's .chart is a 16:9 box for its own charts; these grow with their content. */
.chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  aspect-ratio: auto;
}
.chart-plot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
}
.chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  font-size: 11px;
  line-height: 1;
  color: var(--muted-foreground);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.chart svg {
  display: block;
  width: 100%;
  height: 160px;
}
.chart .grid {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart .bar {
  fill: var(--primary);
}
.chart .bar:hover {
  fill: #1e5490;
}
/*
 * The cost per model, stacked: a model keeps its colour by its place in the catalog. AAdditum's
 * blue first, then the colour-blind-safe order of the chat's charts.
 */
.chart .bar.series-1,
.series-key.series-1 {
  fill: #2563a6;
  background: #2563a6;
}
.chart .bar.series-2,
.series-key.series-2 {
  fill: #eb6834;
  background: #eb6834;
}
.chart .bar.series-3,
.series-key.series-3 {
  fill: #1baf7a;
  background: #1baf7a;
}
.chart .bar.series-4,
.series-key.series-4 {
  fill: #eda100;
  background: #eda100;
}
.chart .bar.series-5,
.series-key.series-5 {
  fill: #e87ba4;
  background: #e87ba4;
}
.chart .bar.series-6,
.series-key.series-6 {
  fill: #008300;
  background: #008300;
}
.chart .bar[class*='series-']:hover {
  opacity: 0.8;
}
.series-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted-foreground);
}
.series-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.series-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
/* A meter with its figure next to it, in a table cell. */
.budget {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  white-space: nowrap;
}
.budget .meter {
  width: 90px;
  flex-shrink: 0;
}
.chart-dates {
  display: flex;
  justify-content: space-between;
  margin-left: 40px;
  font-size: 11px;
  color: var(--muted-foreground);
}
.chart details {
  font-size: 13px;
}
.chart details ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 24px;
}
.chart details li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.meter {
  display: block;
  width: 100%;
  height: 6px;
}
.meter .track {
  fill: var(--muted);
}
.meter .fill {
  fill: var(--primary);
}

/* A request for access from the public site. */
.card.dim {
  opacity: 0.72;
}
.application-message {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--border);
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
