/*
 * Gewichtenportaal – stijlen
 *
 * Opbouw:
 *  1. Tokens (kleuren, radius)
 *  2. Basis & layout
 *  3. Componenten (knoppen, meldingen, badges, voortgang)
 *  4. Login
 *  5. Klant: orderlijst en weegformulier
 *  6. Beheer: navigatie, filters, statistieken, tabellen, formulieren
 *  6b. Beveiliging: bovenbalk, 2FA-scherm, reset
 *  7. Responsief
 *
 * Alle klassen hebben het prefix "gp-" om conflicten met het thema te voorkomen.
 */

/* 1. Tokens ------------------------------------------------------------ */
:root {
  --gp-ink: #17232f;
  --gp-muted: #647180;
  --gp-bg: #f3f7f5;
  --gp-card: #ffffff;
  --gp-line: #dbe5e1;
  --gp-accent: #087c67;
  --gp-accent-dark: #075e50;
  --gp-soft: #e7f5f1;
  --gp-danger: #b3261e;
  --gp-radius: 18px;
  --gp-shadow: 0 8px 28px rgba(27, 57, 48, .06);
}

/* 2. Basis & layout ---------------------------------------------------- */
.gp-app-body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 85% 0, rgba(32, 183, 148, .13), transparent 32%), var(--gp-bg); }
.gp-shell { box-sizing: border-box; width: min(100%, 920px); margin: 24px auto; padding: 22px; color: var(--gp-ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.gp-shell--wide { width: min(100%, 1180px); }
.gp-shell * { box-sizing: border-box; }
.gp-topbar, .gp-brand { display: flex; align-items: center; }
.gp-topbar { justify-content: space-between; margin-bottom: 28px; }
.gp-brand { gap: 11px; }
.gp-brand strong, .gp-brand small { display: block; line-height: 1.2; }
.gp-brand small { margin-top: 3px; color: var(--gp-muted); font-size: 12px; }
.gp-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--gp-accent); color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 8px 22px rgba(8, 124, 103, .22); }
.gp-logout, .gp-back, .gp-note-toggle { color: var(--gp-accent); font-weight: 700; text-decoration: none; }
.gp-back { display: inline-block; margin-bottom: 14px; font-size: 14px; }
.gp-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.gp-intro h1, .gp-login h1 { margin: 5px 0 6px; font-size: clamp(26px, 5vw, 38px); line-height: 1.1; }
.gp-intro p, .gp-login p { margin: 0; color: var(--gp-muted); }
.gp-eyebrow { color: var(--gp-accent); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.gp-sku { color: var(--gp-muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.gp-muted { color: #8f9a95; }
.gp-section-title { margin: 30px 0 12px; font-size: 19px; }
.gp-section-title small { color: var(--gp-muted); font-weight: 600; }

/* 3. Componenten ------------------------------------------------------- */
.gp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font: 750 14px/1 inherit; text-decoration: none; cursor: pointer; }
.gp-btn--primary { background: var(--gp-accent); color: #fff; }
.gp-btn--primary:hover { background: var(--gp-accent-dark); }
.gp-btn--ghost { border-color: var(--gp-line); background: #fff; color: var(--gp-accent-dark); }
.gp-btn--danger { border-color: #f1c9c6; background: #fff; color: var(--gp-danger); }
.gp-btn--block { width: 100%; }
.gp-btn:disabled { opacity: .6; cursor: wait; }
.gp-icon-btn { width: 40px; height: 40px; border: 1px solid var(--gp-line); border-radius: 10px; background: #fff; color: var(--gp-muted); font-size: 20px; cursor: pointer; }

.gp-alert, .gp-empty, .gp-note-box { margin: 0 0 18px; padding: 14px 16px; border-radius: 13px; }
.gp-alert--success { background: #e5f6ed; color: #17653b; }
.gp-alert--error { background: #fce8e7; color: #9b281f; }
.gp-alert--info { background: #e8f1fb; color: #1f4f7f; }
.gp-empty { border: 1px dashed var(--gp-line); background: #fff; color: var(--gp-muted); }
.gp-note-box { border: 1px solid #f0e2b6; background: #fffaf0; color: #6b5413; }

.gp-badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.gp-badge--open { background: #eef2f6; color: #3f5163; }
.gp-badge--in_progress { background: #fff3d6; color: #8a5a00; }
.gp-badge--submitted { background: #e1f0ff; color: #1d5fa5; }
.gp-badge--closed { background: #e5f6ed; color: #17653b; }
.gp-badge--cancelled { background: #f4e4e3; color: #8f2a22; }

.gp-progress { min-width: 110px; }
.gp-progress__bar { height: 6px; overflow: hidden; border-radius: 99px; background: #e8eeeb; }
.gp-progress__bar span { display: block; height: 100%; border-radius: inherit; background: var(--gp-accent); }
.gp-progress small { display: block; margin-top: 4px; color: var(--gp-muted); font-size: 11px; }

/* 4. Login ------------------------------------------------------------- */
.gp-login { max-width: 460px; margin-top: 8vh; padding: 32px; border: 1px solid var(--gp-line); border-radius: 24px; background: #fff; box-shadow: 0 16px 50px rgba(25, 55, 47, .1); }
.gp-login .gp-brand { margin-bottom: 30px; }
.gp-login .gp-alert { margin: 20px 0 0; }
.gp-login form { margin-top: 24px; }
.gp-login label { display: block; margin-bottom: 6px; font-weight: 700; }
.gp-login input[type=text], .gp-login input[type=password] { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--gp-line); border-radius: 11px; font: inherit; }
.gp-login-remember label { font-weight: 400; color: var(--gp-muted); }

/* 5. Klant: orderlijst ------------------------------------------------- */
.gp-tabs { display: inline-flex; gap: 6px; margin-bottom: 16px; padding: 5px; border: 1px solid var(--gp-line); border-radius: 14px; background: #fff; }
.gp-tabs a { padding: 9px 14px; border-radius: 10px; color: var(--gp-muted); font-size: 14px; font-weight: 750; text-decoration: none; }
.gp-tabs a.is-active { background: var(--gp-accent); color: #fff; }
.gp-count { display: inline-block; min-width: 22px; margin-left: 4px; padding: 2px 6px; border-radius: 99px; background: rgba(0, 0, 0, .07); font-size: 11px; text-align: center; }
.gp-tabs a.is-active .gp-count { background: rgba(255, 255, 255, .22); }

.gp-order-list, .gp-line-list { display: grid; gap: 12px; }
.gp-order-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; padding: 18px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: var(--gp-card); box-shadow: var(--gp-shadow); color: inherit; text-decoration: none; }
.gp-order-card:hover, .gp-order-card:focus-visible { border-color: var(--gp-accent); }
.gp-order-card h2 { margin: 3px 0 5px; font-size: 18px; line-height: 1.25; }
.gp-order-card small { color: var(--gp-muted); }
.gp-order-card__side { display: grid; justify-items: end; align-content: center; gap: 8px; }

/* 5b. Klant: weegformulier --------------------------------------------- */
.gp-line-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; padding: 18px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: var(--gp-card); box-shadow: var(--gp-shadow); }
.gp-line-card h2 { margin: 3px 0 4px; font-size: 18px; line-height: 1.25; }
.gp-line-card small { display: block; color: var(--gp-muted); }
.gp-line-card__weight { align-self: center; font-size: 20px; }
.gp-note-toggle { margin-top: 6px; padding: 0; border: 0; background: none; font-size: 12px; cursor: pointer; }
.gp-weight-input { display: flex; align-items: center; gap: 8px; align-self: center; }
.gp-weight-input input { width: 140px; height: 52px; padding: 6px 12px; border: 1px solid var(--gp-line); border-radius: 12px; background: #f8faf9; color: var(--gp-ink); font: 700 20px/1 inherit; text-align: right; }
.gp-weight-input input:focus { border-color: var(--gp-accent); outline: 3px solid rgba(8, 124, 103, .15); background: #fff; }
.gp-weight-input input.is-invalid { border-color: var(--gp-danger); background: #fff5f4; }
.gp-weight-input span { color: var(--gp-muted); font-weight: 700; }
.gp-note { display: none; grid-column: 1 / -1; }
.gp-note.is-open { display: block; }
.gp-note label { display: block; color: var(--gp-muted); font-size: 12px; font-weight: 700; }
.gp-note textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--gp-line); border-radius: 12px; resize: vertical; font: inherit; }
.gp-total-row { display: flex; justify-content: space-between; margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--gp-soft); font-size: 18px; }

.gp-submit-bar { position: sticky; z-index: 5; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 12px 12px 12px 18px; border-radius: 17px; background: rgba(23, 35, 47, .96); box-shadow: 0 12px 40px rgba(0, 0, 0, .22); color: #fff; backdrop-filter: blur(12px); }
.gp-submit-bar__info span { display: block; font-size: 15px; }
.gp-submit-bar__info small { color: #c5d0d5; }
.gp-submit-bar__buttons { display: flex; gap: 8px; }
.gp-submit-bar .gp-btn--ghost { border-color: rgba(255, 255, 255, .25); background: transparent; color: #fff; }
.gp-submit-bar .gp-btn--primary { background: #20b794; }

/* 6. Beheer ------------------------------------------------------------ */
.gp-manager-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: -8px 0 24px; padding: 6px; border: 1px solid var(--gp-line); border-radius: 15px; background: #fff; }
.gp-manager-nav a { padding: 11px 12px; border-radius: 10px; color: var(--gp-muted); font-size: 14px; font-weight: 750; text-align: center; text-decoration: none; }
.gp-manager-nav a:hover { background: var(--gp-bg); color: var(--gp-accent-dark); }
.gp-manager-nav a.is-active { background: var(--gp-accent); color: #fff; }

.gp-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 18px; padding: 16px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: #fff; }
.gp-filter label, .gp-form label { display: block; color: var(--gp-muted); font-size: 12px; font-weight: 750; }
.gp-filter input, .gp-filter select, .gp-form input, .gp-form select, .gp-form textarea { display: block; width: 100%; min-height: 43px; margin-top: 5px; padding: 8px 10px; border: 1px solid var(--gp-line); border-radius: 10px; background: #fbfdfc; color: var(--gp-ink); font: inherit; }

.gp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.gp-stat { padding: 18px; border: 1px solid var(--gp-line); border-radius: 17px; background: linear-gradient(145deg, #fff, #f8fbfa); box-shadow: var(--gp-shadow); }
.gp-stat span { display: block; color: var(--gp-muted); font-size: 12px; font-weight: 700; }
.gp-stat strong { display: block; margin: 5px 0 3px; font-size: 26px; line-height: 1.1; }
.gp-stat small { color: var(--gp-muted); font-size: 12px; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
.gp-actions form { margin: 0; }

.gp-table-wrap { overflow-x: auto; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: #fff; box-shadow: var(--gp-shadow); }
.gp-table { width: 100%; min-width: 720px; border: 0; border-collapse: collapse; font-size: 14px; }
.gp-table th, .gp-table td { padding: 12px 14px; border-bottom: 1px solid #edf1ef; text-align: left; vertical-align: middle; }
.gp-table thead th { background: #f6faf8; color: var(--gp-muted); font-size: 12px; white-space: nowrap; }
.gp-table tbody tr:hover { background: #fbfdfc; }
.gp-table a { color: var(--gp-accent-dark); font-weight: 750; text-decoration: none; }
.gp-table .gp-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gp-table__total { background: var(--gp-soft); font-weight: 800; }

.gp-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.gp-meta div { padding: 12px 14px; border: 1px solid var(--gp-line); border-radius: 13px; background: #fff; }
.gp-meta dt { color: var(--gp-muted); font-size: 12px; font-weight: 700; }
.gp-meta dd { margin: 4px 0 0; font-weight: 700; }

.gp-log { margin: 0; padding: 0; list-style: none; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: #fff; }
.gp-log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 11px 14px; border-bottom: 1px solid #edf1ef; font-size: 14px; }
.gp-log li:last-child { border-bottom: 0; }
.gp-log time { color: var(--gp-muted); font-variant-numeric: tabular-nums; }
.gp-log small { margin-left: auto; color: var(--gp-muted); }

.gp-card { padding: 22px; border: 1px solid var(--gp-line); border-radius: 20px; background: #fff; box-shadow: var(--gp-shadow); }
.gp-card h2 { margin: 0 0 16px; font-size: 20px; }
.gp-stack { display: grid; gap: 18px; max-width: 720px; margin: 0 auto; }
.gp-form { display: grid; gap: 12px; }
.gp-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gp-form__full { grid-column: 1 / -1; }
.gp-form__footer { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--gp-line); }
.gp-order-lines { display: grid; gap: 10px; }
.gp-order-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--gp-line); border-radius: 13px; background: #fbfdfc; }
.gp-order-line [data-gp-remove-line] { margin-bottom: 2px; }
[data-gp-add-line] { justify-self: start; }

.gp-list { border-top: 1px solid var(--gp-line); }
.gp-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--gp-line); }
.gp-list strong, .gp-list small { display: block; }
.gp-list small { margin-top: 3px; color: var(--gp-muted); }
.gp-list a { color: var(--gp-accent-dark); font-size: 12px; font-weight: 750; text-decoration: none; }

/* 6b. Beveiliging (2FA, sinds 1.1.0) ---------------------------------- */
.gp-topbar-links { display: flex; align-items: center; gap: 18px; }
.gp-topbar-link { color: var(--gp-muted); font-weight: 700; text-decoration: none; }
.gp-topbar-link:hover { color: var(--gp-accent-dark); }
.gp-security .gp-card { margin-bottom: 18px; }
.gp-security-steps ol { margin: 0; padding-left: 20px; line-height: 1.6; }
.gp-security-help { font-size: 14px; }
/* Formulier van WP 2FA binnen de portaalstijl houden. */
.gp-security-form .wp-2fa-shortcode-wrapper { max-width: 100%; overflow-x: auto; }
/* De herinnering van WP 2FA ("Remind me on next login") geldt niet in het portaal: de poort laat niets door zonder 2FA. Onze eigen uitleg staat erboven. */
.gp-security-form .wp-2fa-nag { display: none; }
/* Koppen in het lettertype van het portaal, ook als het thema (bijv. via theme.json) een ander koplettertype zet. */
.gp-shell h1, .gp-shell h2, .gp-shell h3, .gp-shell h4,
.gp-app-body h1, .gp-app-body h2, .gp-app-body h3, .gp-app-body h4 { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.gp-security-form .button, .gp-security-form button.button-primary { min-height: 40px; border-radius: 10px; }
.gp-security-form img { max-width: 100%; height: auto; }
.gp-row-actions { display: flex; align-items: flex-start; gap: 14px; }
.gp-reset-2fa summary { color: var(--gp-danger); font-size: 12px; font-weight: 750; cursor: pointer; }
.gp-reset-2fa form { display: grid; gap: 8px; width: min(320px, 70vw); margin-top: 8px; }
.gp-reset-2fa label { color: var(--gp-muted); font-size: 12px; font-weight: 750; }
.gp-reset-2fa input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--gp-line); border-radius: 10px; font: inherit; }

/* 7. Responsief -------------------------------------------------------- */
@media (max-width: 860px) {
  .gp-filter { grid-template-columns: 1fr 1fr; }
  .gp-filter button { grid-column: 1 / -1; }
  .gp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gp-shell { margin: 0 auto; padding: 16px 14px 110px; }
  .gp-topbar { margin-bottom: 22px; }
  .gp-intro { flex-direction: column; gap: 10px; }
  .gp-tabs { display: flex; }
  .gp-tabs a { flex: 1; text-align: center; }
  .gp-order-card { grid-template-columns: 1fr; }
  .gp-order-card__side { grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; }
  .gp-line-card { grid-template-columns: 1fr; padding: 16px 14px; }
  .gp-weight-input input { flex: 1; width: auto; }
  .gp-submit-bar { bottom: 10px; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .gp-submit-bar__info { display: flex; justify-content: space-between; align-items: baseline; }
  .gp-submit-bar__buttons .gp-btn { flex: 1; }
  .gp-manager-nav { grid-template-columns: 1fr 1fr; margin-top: -4px; }
  .gp-form__grid, .gp-filter { grid-template-columns: 1fr; }
  .gp-order-line { grid-template-columns: 1fr auto; }
  .gp-order-line label:first-child { grid-column: 1 / -1; }
  .gp-card { padding: 18px 15px; }
  .gp-list > .gp-customer-row { flex-direction: column; align-items: stretch; }
  .gp-topbar-links { gap: 12px; }
  .gp-shell.gp-login { width: calc(100% - 28px); margin: 5vh auto 24px; padding: 26px 21px; }
  .gp-login h1, .gp-login p { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: no-preference) {
  .gp-alert { animation: gp-in .25s ease-out; }
  .gp-order-card, .gp-line-card { transition: border-color .15s ease, box-shadow .15s ease; }
  .gp-line-card:focus-within { box-shadow: 0 12px 34px rgba(27, 57, 48, .1); }
  @keyframes gp-in { from { opacity: 0; transform: translateY(-6px); } }
}
