/* SalesBridge huisstijl: Puvi, de drie gewichten die de interface gebruikt.
   Light en Italic zijn weggelaten - ze komen in het portaal niet voor en zouden
   alleen laadtijd kosten. */
@font-face { font-family: 'Puvi'; src: url('assets/fonts/Puvi-Regular.ttf') format('truetype');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Puvi'; src: url('assets/fonts/Puvi-Semibold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Puvi'; src: url('assets/fonts/Puvi-Bold.ttf') format('truetype');     font-weight: 700; font-style: normal; font-display: swap; }

/* ZPortals on Catalyst - portal styling.
   Colours come from Customization > Design and are injected as CSS variables at
   runtime, so an admin recolours the portal without touching this file. */

:root {
  --zp-primary: #2563eb;
  --zp-menu-bg: #111827;
  --zp-menu-text: #e5e7eb;
  --zp-button: #2563eb;
  --zp-button-text: #ffffff;
  --zp-body-bg: #f6f7f9;
  --zp-font: #111827;
  --zp-filter-bar: #ffffff;
  --zp-menu-width: 260px;
  --zp-portal-width: 1280px;
  --zp-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --zp-radius: 10px;
  --zp-border: #D6D6D6;
  --zp-accent: #04c4d9;      /* alleen als accentlijn, nooit als vlak */
  --zp-muted: #6b7280;
  --zp-danger: #dc2626;
  --zp-success: #16a34a;
  --zp-warning: #d97706;
  --zp-surface: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--zp-font-family);
  background: var(--zp-body-bg);
  color: var(--zp-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--zp-primary); }

/* ---------- boot ---------- */
.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--zp-border); border-top-color: var(--zp-primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--zp-menu-width); flex: 0 0 var(--zp-menu-width);
  background: var(--zp-menu-bg); color: var(--zp-menu-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  padding: 20px 18px; display: flex; align-items: center; gap: 10px; font-weight: 700;
  border-bottom: 2px solid var(--zp-accent);
}
.sidebar__brand img { max-height: 34px; max-width: 150px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px; }
.navitem {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none;
  background: none; border: 0; font: inherit; cursor: pointer; text-align: start;
}
.navitem:hover { background: rgba(255,255,255,.08); }
.navitem--active { background: var(--zp-primary); color: #fff; }
.navitem--child { padding-inline-start: 34px; font-size: 14px; }
.sidebar__footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.12); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: var(--zp-surface); border-bottom: 1px solid var(--zp-border);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-weight: 650; font-size: 17px; margin-inline-end: auto; }
.content { padding: 24px 20px 64px; width: 100%; max-width: var(--zp-portal-width); margin: 0 auto; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--zp-button); color: var(--zp-button-text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--zp-font); border-color: var(--zp-border); }
.btn--danger { background: var(--zp-danger); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--link { background: none; border: 0; color: var(--zp-primary); padding: 0; font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 13.5px; }
.field .hint { color: var(--zp-muted); font-size: 12.5px; }
.field .err { color: var(--zp-danger); font-size: 12.5px; }
input, select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--zp-border);
  border-radius: 8px; background: #fff; color: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--zp-primary); outline-offset: 1px; }
input[type=checkbox] { width: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }

/* ---------- surfaces ---------- */
.card { background: var(--zp-surface); border: 1px solid var(--zp-border); border-radius: var(--zp-radius); padding: 20px; }
.card + .card { margin-top: 16px; }
/* Inside a grid the gap already does the spacing; the sibling margin would push
   the second card down and break the top alignment of the row. */
.grid .card + .card { margin-top: 0; }
.card__title { font-weight: 600; margin: 0 0 14px; font-size: 16px; color: var(--zp-primary); }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.filterbar {
  background: var(--zp-filter-bar); border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius); padding: 12px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
}
.filterbar .field { margin: 0; min-width: 170px; }

/* ---------- table ---------- */
.tablewrap { overflow-x: auto; background: var(--zp-surface); border: 1px solid var(--zp-border); border-radius: var(--zp-radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--zp-border); }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--zp-muted); white-space: nowrap; }
th button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
tbody tr:hover { background: #fafbfc; }
tbody tr[data-clickable] { cursor: pointer; }
td.num { text-align: end; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eef2ff; color: #3730a3; }
.badge--ok { background: #dcfce7; color: #14532d; }
.badge--warn { background: #fef3c7; color: #78350f; }
.badge--err { background: #fee2e2; color: #7f1d1d; }
.badge--muted { background: #f3f4f6; color: #374151; }

.empty { text-align: center; padding: 48px 20px; color: var(--zp-muted); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 16px 0; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--zp-body-bg); }
.auth__box {
  width: 100%; max-width: 420px; background: var(--zp-surface);
  border: 1px solid var(--zp-border); border-radius: 14px; padding: 32px;
  border-top: 3px solid var(--zp-accent);
}
.auth__logo { text-align: center; margin-bottom: 20px; }
.auth__logo img { max-height: 48px; }
.auth h1 { font-size: 21px; margin: 0 0 6px; }
.auth p.lead { color: var(--zp-muted); margin: 0 0 22px; }
.auth__links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: #111827; color: #fff; padding: 12px 16px; border-radius: 10px;
  max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: rise .2s ease-out;
}
.toast--error { background: var(--zp-danger); }
.toast--success { background: var(--zp-success); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- modal ---------- */
.modal__backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: grid; place-items: center; padding: 20px; z-index: 90; }
.modal { background: var(--zp-surface); border-radius: 14px; padding: 24px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- language switcher ---------- */
.langswitch { display: flex; gap: 4px; }
.langswitch button {
  border: 1px solid var(--zp-border); background: var(--zp-surface); color: inherit;
  border-radius: 7px; padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; text-transform: uppercase;
}
.langswitch button[aria-pressed="true"] { background: var(--zp-primary); color: #fff; border-color: var(--zp-primary); }

/* ---------- elements (banners, embeds, quick links) ---------- */
.element--banner { border-radius: var(--zp-radius); overflow: hidden; }
.element--banner img { width: 100%; display: block; }
.element--embed iframe { width: 100%; min-height: 460px; border: 0; border-radius: var(--zp-radius); }
.quicklinks {
  /* A grid, not a flex row: equal columns line the buttons up on both edges
     instead of leaving a ragged right end where each label happens to stop. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px;
}
.quicklinks .btn { width: 100%; }

/* ---------- gallery (public directory) ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gallery__card { background: var(--zp-surface); border: 1px solid var(--zp-border); border-radius: var(--zp-radius); overflow: hidden; }
.gallery__card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.gallery__body { padding: 14px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--zp-border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px;
  font: inherit; font-weight: 600; color: var(--zp-muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--zp-primary); border-bottom-color: var(--zp-primary); }
.stat { background: var(--zp-surface); border: 1px solid var(--zp-border); border-radius: var(--zp-radius); padding: 18px; }
.stat__value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--zp-muted); font-size: 13px; }

/* ---------- responsive ---------- */
.menubtn { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; transform: translateX(-102%); transition: transform .2s; }
  html[dir="rtl"] .sidebar { transform: translateX(102%); }
  .sidebar[data-open="true"] { transform: none; }
  .menubtn { display: inline-flex; }
  .content { padding: 16px 14px 56px; }
}

/* On a phone the top bar asked for 538px inside a 375px screen, which dragged
   the whole page sideways - every screen, not just this one. The bar now wraps:
   the language switch drops to a row of its own and the account button keeps
   its icon but loses the name, which is on the page it opens anyway. */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .topbar__title { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .langswitch { order: 1; flex: 1 0 100%; }
  .topbar .langswitch button { flex: 1; }
  .topbar__name { display: none; }
}

/* A last line of defence. Nothing should reach past the viewport, but one long
   unbroken word in customer data must not be able to shift the whole layout. */
.main, .content { max-width: 100%; }
.content { overflow-wrap: break-word; }

/* Respect the reader's motion preference. */
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- rich text editor ---------- */
.editor { border: 1px solid var(--zp-border); border-radius: 8px; background: #fff; overflow: hidden; }
.editor:focus-within { outline: 2px solid var(--zp-primary); outline-offset: 1px; }
.editor__toolbar {
  display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--zp-border);
  background: #fafbfc; flex-wrap: wrap;
}
.editor__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; border-radius: 6px;
  background: transparent; color: var(--zp-font); cursor: pointer;
}
.editor__btn:hover { background: rgba(0,0,0,.07); }
.editor__area { min-height: 140px; padding: 11px; outline: none; line-height: 1.55; }
.editor__area:empty::before { content: attr(data-placeholder); color: var(--zp-muted); }
.editor__area p { margin: 0 0 8px; }
.editor__area ul, .editor__area ol { margin: 0 0 8px; padding-inline-start: 22px; }
.editor__area a { color: var(--zp-primary); }
.editor__images {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 10px;
  border-top: 1px solid var(--zp-border); background: #fafbfc;
}
.editor__thumb { position: relative; margin: 0; width: 96px; }
.editor__thumb img {
  width: 96px; height: 72px; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid var(--zp-border);
}
.editor__thumb figcaption { font-size: 11px; color: var(--zp-muted); text-align: center; margin-top: 3px; }
.editor__thumb-remove {
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px;
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--zp-border);
  background: #fff; color: var(--zp-danger); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}

/* ---------- KPI tiles ----------
   Figures, not charts: the number carries the weight, the label explains it,
   and a status colour only appears beside a word that says what it means. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--zp-surface); border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius); padding: 18px; height: 100%;
}
.kpi__value {
  font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--zp-font);
  /* One figure box for every tile, whatever it holds, so the labels beneath
     them sit on one line across the row. */
  display: flex; align-items: flex-end; min-height: 33px;
}
.kpi__value--text { font-size: 20px; line-height: 1.25; }
.kpi__label { color: var(--zp-muted); font-size: 13.5px; margin-top: 4px; }
.kpi__note { display: block; margin-top: 8px; font-size: 13px; color: var(--zp-muted); font-variant-numeric: tabular-nums; }
.kpi__status { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.kpi__status--critical { color: #d03b3b; }
.kpi__status--warning  { color: #96690b; }   /* darkened for contrast on a light surface */
.kpi__status--good     { color: #0ca30c; }
.kpi__link { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start; cursor: pointer; font: inherit; }
.kpi__link:hover .kpi { border-color: var(--zp-primary); }
.kpi__link:focus-visible { outline: 2px solid var(--zp-primary); outline-offset: 2px; border-radius: var(--zp-radius); }
