/* Opmaak van het kantoorscherm. Kleuren komen uit static/css/theme.css. */

/* De pagina is precies één scherm hoog: nooit scrollen op het kantoorscherm */
.page { height: 100vh; display: flex; flex-direction: column; padding: 1.25rem 1.5rem; gap: 1rem; }

/* ---- Kopbalk ---- */
.clock { font-size: 2rem; font-weight: 600; line-height: 1; }
.pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-good); margin-right: .35rem;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ---- De statuscheck loopt niet: rode balk, en de gegevens eronder vervagen (beslissing H9) ---- */
.stale-banner {
  --c: var(--status-critical);
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem; border-radius: 12px;
  border: 2px solid var(--status-critical);
  background: color-mix(in srgb, var(--status-critical) 14%, transparent);
  font-size: 1.05rem;
}
.stale-banner .ico { color: #fff; }
.is-stale .attention, .is-stale .healthy { opacity: .45; }
.is-stale .pulse { background: var(--status-critical); animation: none; }

/* ---- Twee zones: bovenaan problemen, onderaan gezonde klanten ---- */
.zone-title { font-size: 1rem; font-weight: 600; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.attention { flex: 1.35; min-height: 0; display: flex; flex-direction: column; }
.healthy   { flex: 1;    min-height: 0; display: flex; flex-direction: column; }
.count {
  margin-left: auto; min-width: 2rem; text-align: center;
  font-weight: 600; font-size: .9rem; border-radius: 999px; padding: .1rem .55rem;
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}
.empty { color: var(--text-muted); font-size: .95rem; text-align: center; padding: 1.5rem 0; }

/* ---- Kolommen Kritiek / Middel / Laag ---- */
.attention-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.column {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--c);
  border-radius: 14px;
  padding: .9rem;
}
.column-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.column-title { font-size: 1.15rem; font-weight: 600; margin: 0; }

/* Kleur per status: altijd samen met een icoon en een woord, nooit kleur alleen */
.col-ok       { --c: var(--status-good); }
.col-critical { --c: var(--status-critical); }
.col-medium   { --c: var(--status-serious); }
.col-low      { --c: var(--status-warning); }

.ico {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: var(--c);
}
.ico.small { width: 18px; height: 18px; font-size: 11px; }
.col-ok .ico, .col-critical .ico { color: #fff; }
.col-medium .ico, .col-low .ico { color: #0b0b0b; }

/* ---- Vierkante probleemkaarten (aantal per rij berekend in office_screen.js) ---- */
.cards {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--per-row, 2), minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.cards.is-empty { display: block; }
.client-card {
  aspect-ratio: 1 / 1;
  container-type: inline-size;      /* tekst schaalt mee met de grootte van de kaart */
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c);
  border-radius: 10px;
  overflow: hidden;
}
.card-inner {
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4cqw;
  padding: 8cqw;
}
.client-name {
  font-size: clamp(10px, 10cqw, 20px); font-weight: 600; line-height: 1.2; margin: 0;
  hyphens: auto; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.problem {
  flex: 1; color: var(--text-secondary); font-size: clamp(9px, 7.5cqw, 15px); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; justify-content: space-between; gap: .5rem;
  color: var(--text-muted); font-size: clamp(9px, 6.5cqw, 13px); font-variant-numeric: tabular-nums;
}
/* Kleine kaart: alleen de naam */
@container (max-width: 120px) { .problem, .card-foot { display: none; } }

/* Net kritiek geworden: de kaart licht even op */
.client-card.is-new { animation: highlight 1.6s ease-in-out infinite; }
@keyframes highlight {
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-critical) 55%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse, .client-card.is-new { animation: none; }
  .client-card.is-new { box-shadow: 0 0 0 3px var(--status-critical); }
}

/* ---- Kleine tegels voor gezonde klanten (grootte berekend in office_screen.js) ---- */
.healthy-box {
  flex: 1; min-height: 0;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--status-good);
  border-radius: 14px;
  padding: .9rem;
}
.tiles {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--columns, 8), minmax(0, 1fr));
  grid-auto-rows: var(--tile-height, 48px);
  gap: 8px;
  align-content: start;
}
.tile {
  container-type: inline-size;
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 .65rem;
  min-width: 0;
}
.tile-name { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tile-note { color: var(--text-muted); font-size: .75rem; white-space: nowrap; }
@container (max-width: 220px) { .tile-note { display: none; } }
/* Niet gecontroleerd: grijs, zodat het nooit lijkt alsof alles in orde is (beslissing H9) */
.tile.is-unchecked { --c: var(--text-muted); color: var(--text-muted); border-style: dashed; }

/* ---- Alleen voor een beheerder: een klant aanklikken (beslissing #95) ---- */
/* stretched-link (Bootstrap) legt een onzichtbare laag van de link over de hele kaart of tegel */
.client-card, .tile { position: relative; }
.client-link { color: inherit; text-decoration: none; }
.client-link:focus-visible { outline: none; }  /* de rand komt op de kaart zelf, hieronder */
/* outline i.p.v. border: de gekleurde rand links (de prioriteit) blijft zoals ze is */
.client-card:has(.client-link:hover), .tile:has(.client-link:hover) {
  outline: 2px solid var(--text-muted); outline-offset: 1px;
}
.client-card:has(.client-link:focus-visible), .tile:has(.client-link:focus-visible) {
  outline: 3px solid var(--text-primary); outline-offset: 2px;
}
