/* One look for the whole portal (Bart, 30 October 2026: "het moet veel
   overzichtelijker en intuïtiever. dat geldt voor heel het portaal. het
   design moet strakker en mooier"). Loaded last on every page, so the
   portal, the planning and the quote, margin, invoice, measurement and user
   pages read as one app: the Slowfeeder house colours and Montserrat (never
   another palette or font, see the house-style rule), one calm card, one
   kind of button (orange), one menu, tables that read easily, few colours
   so the ones that are left mean something.

   The older stylesheets keep their own rules; this file only sets the
   shared values and evens out the parts every page has. */

:root, .pt-page {
  --ink: #1e1f20;
  --muted: #6b6e66;
  --brand: #5e7244;
  --brand-2: #4a5a36;
  --leaf: #93c242;
  --accent: #e68230;
  --accent-2: #cf6f1f;
  --paper: #ffffff;
  --canvas: #f3f1ee;
  --line: #e6e2da;
  --soft: #f8f7f4;
  --good: #4f7a1f;
  --warn: #a8600f;
  --bad: #b7463a;
  --sf: #5e7244;
  --rp: #e68230;
  --be: #f2b27c;
  --good-bg: #eef4e4;
  --warn-bg: #fcf1e6;
  --bad-bg: #f9ebe8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 31, 32, .05);
  --ring: 0 0 0 3px rgba(147, 194, 66, .45);
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
.pt-page, .q-page { font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
strong, b { font-weight: 700; }
/* Figures line up under each other. */
.num, .pt-kpi strong, .metric strong, .pt-number strong, .t td, .pt-prow, .pt-orders strong { font-variant-numeric: tabular-nums; }

/* ---- Headings: one size per level, no shouting ---- */
.pt-top-title h1, .view-head h1, .q-page .content h1, .content > h1, .view-title, .day-line {
  font-size: clamp(1.4rem, 2.2vw, 1.7rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.view-head { margin: 0 0 1.25rem; }
.view-head p, .pt-intro { max-width: 70ch; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.card h3, .pt-card-head h3, .pt-attention-head h3, .pt-shop-head h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.005em; }
.pt-cols h4, .pt-insight-body h4, .pt-margin h4, .pt-onderweg h3, .pt-shop-spark small {
  font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* ---- The menu on the left: the same on every page ---- */
.pt-side, .sidebar { background: var(--brand-2); background-image: none; color: #f3f1ee; }
.pt-side-logos a, .sidebar-logo { min-height: 44px; padding: .55rem .8rem; border-radius: 10px; justify-content: flex-start; }
.pt-side-logos a.slowfeeder, .sidebar-logo.slowfeeder { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.pt-side-logos a.rijplaten, .sidebar-logo.rijplaten { background: #fff; }
.pt-side-logos img, .sidebar-logo img { height: 28px; max-height: 28px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
/* The Slowfeeder logo is thin white letters on a wide canvas: only legible a size up. */
.pt-side-logos a.slowfeeder, .sidebar-logo.slowfeeder { padding: .2rem .6rem; }
.pt-side-logos a.slowfeeder img, .sidebar-logo.slowfeeder img { height: 44px; max-height: 44px; }
.sidebar-brand { border-bottom-color: rgba(255, 255, 255, .1); }
.sidebar-brand strong { font-size: .95rem; font-weight: 700; }

.pt-menu a, .nav-item { position: relative; min-height: 42px; border-radius: 9px; color: rgba(243, 241, 238, .8); font-size: .9rem; font-weight: 600; }
.pt-menu a:hover, .nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.pt-menu a[aria-current], .nav-item.active { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 700; box-shadow: none; }
.pt-menu a[aria-current]::before, .nav-item.active::before {
  content: ""; position: absolute; left: -.8rem; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--leaf); }
.pt-menu a[aria-current] svg, .nav-item.active svg { color: var(--leaf); }
.pt-menu svg, .nav-item svg { width: 19px; height: 19px; opacity: .85; }
.pt-badge, .nav-count { min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; display: inline-grid; place-items: center; border-radius: 999px;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; }
.pt-badge.warn, .nav-count { background: var(--accent); color: #fff; }
.pt-badge.bad { background: #d4523f; }
.pt-side-foot, .sidebar-foot { border-top-color: rgba(255, 255, 255, .1); }
.sidebar-foot .sync-text { color: rgba(243, 241, 238, .65); }
/* The buttons at the foot of the menu (Uitloggen, Ververs, Mail ophalen): quiet
   on the green, whatever kind of button they are elsewhere. */
.sidebar-foot .button, .pt-side-foot .button { background: transparent !important; color: rgba(243, 241, 238, .9) !important; border: 1px solid rgba(255, 255, 255, .24) !important; }
.sidebar-foot .button:hover, .pt-side-foot .button:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; border-color: rgba(255, 255, 255, .4) !important; }

/* ---- The bar at the top of the portal ---- */
.pt-top { background: rgba(243, 241, 238, .92); border-bottom-color: var(--line); }
.pt-top-title p { font-size: .82rem; }
.pt-stamp { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.pt-tabs a { font-size: .86rem; font-weight: 600; }
.pt-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- Cards ---- */
.card, .pt-card, .pt-attention, .metric, .pt-kpi, .sync-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 1.1rem 1.2rem; }
.pt-card-head { padding: 1rem 1.2rem .35rem; }
.pt-head { padding: .95rem 1.2rem; }
.pt-head:hover { background: var(--soft); }
.pt-shop { border-top: 1px solid var(--line); }
.pt-shop-head { padding-top: 1.05rem; }
.pt-shop-logo { width: 76px; height: 36px; border-radius: 8px; }
.pt-shop::before { content: ""; display: block; height: 3px; background: var(--sf); }
.pt-shop.rp::before { background: var(--rp); }
.pt-shop.be::before { background: var(--be); }
.pt-shop-stats div { background: var(--soft); border: 1px solid #efece6; border-radius: 10px; }
.pt-shop-stats span { font-size: .76rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.pt-shop-stats strong { font-size: 1.3rem; font-weight: 700; }

/* ---- Key figures: a label, a number, one line under it ---- */
.pt-kpi, .metric { padding: 1rem 1.1rem; border-top: 1px solid var(--line); border-left-width: 1px; }
.pt-kpi span, .metric span { font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.pt-kpi strong, .metric strong { margin-top: .15rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.pt-kpi small, .metric small { font-size: .78rem; color: var(--muted); }
.pt-kpi.accent { border-top-color: var(--line); }
.pt-kpi.accent span { color: var(--accent-2); }
.pt-kpi.up small { color: var(--good); font-weight: 600; }
.pt-kpi.down small { color: var(--bad); font-weight: 600; }
.metric.include, .metric.review, .metric.urgent { border-left-width: 3px; }
.metric.review { border-left-color: var(--accent); }

/* The numbers that lead somewhere (planning, quotes): white, the urgent
   ones by their colour only. */
.pt-number { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .75rem .85rem; transition: border-color .15s, box-shadow .15s; }
.pt-number:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.pt-number strong { font-size: 1.55rem; font-weight: 700; }
.pt-number span { font-weight: 600; font-size: .84rem; }
.pt-number.warn, .pt-number.bad { background: var(--paper); border-color: var(--line); }
.pt-number.warn strong { color: var(--accent-2); }
.pt-number.bad strong, .pt-number.bad small { color: var(--bad); }
.pt-number.warn::after, .pt-number.bad::after { content: ""; display: block; order: -1; width: 8px; height: 8px; margin-bottom: .35rem; border-radius: 50%; background: var(--accent); }
.pt-number.bad::after { background: var(--bad); }

/* ---- What asks for attention: a calm list, the count in a coloured dot ---- */
.pt-attention { border-left: 1px solid var(--line); padding: 1rem 1.2rem .6rem; }
.pt-attention-head h3 { font-weight: 700; }
.pt-attention ul { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 1.6rem; margin-top: .45rem; }
.pt-attention li a { padding: .62rem 2.4rem .62rem .1rem; border: 0; border-bottom: 1px solid #efece6; border-radius: 0; background: transparent; font-size: .88rem; }
.pt-attention li a:hover { background: transparent; border-color: #efece6; }
.pt-attention li a:hover span { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }
.pt-attention li b { min-width: 1.7rem; height: 1.7rem; background: var(--good-bg); color: var(--good); font-size: .78rem; font-weight: 700; }
.pt-attention li.warn b { background: var(--warn-bg); color: var(--accent-2); }
.pt-attention li.bad b { background: var(--bad-bg); color: var(--bad); }
.pt-attention li.bad a { background: transparent; border-color: #efece6; }
.pt-attention li i { color: #b9b4ab; font-weight: 600; }
.pt-attention-close { opacity: 0; transition: opacity .15s; }
.pt-attention li:hover .pt-attention-close, .pt-attention-close:focus-visible { opacity: 1; }
.pt-attention li.more button { border: 0; border-radius: 8px; justify-content: flex-start; text-align: left; color: var(--brand-2); font-weight: 600; }
.pt-attention li.more button:hover { background: var(--soft); }
@media (hover: none) { .pt-attention-close { opacity: 1; } }

/* ---- Buttons: orange for the main action, white for the rest ---- */
.button, .pt-btn, .pt-refresh { border-radius: 8px; font-weight: 600; letter-spacing: 0; }
.q-page .button:not(.secondary):not(.subtle-action):not(.ghost):not(.danger), .button.primary, .pt-btn, .pt-page .login-card .button {
  background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.q-page .button:not(.secondary):not(.subtle-action):not(.ghost):not(.danger):hover, .button.primary:hover, .pt-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.button.secondary, .button.subtle-action, .button.ghost, .pt-refresh, .pt-btn.light {
  background: #fff; color: var(--ink); border: 1px solid #d9d4cb; }
.button.secondary:hover, .button.subtle-action:hover, .button.ghost:hover, .pt-refresh:hover, .pt-btn.light:hover { border-color: var(--brand); color: var(--brand-2); background: #fff; }
.button.manual-action { background: var(--brand); color: #fff; }
.button:disabled, .pt-refresh:disabled { opacity: .5; }

/* ---- Fields ---- */
input, select, textarea, .q-page input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .q-page select, .q-page textarea {
  border-color: #d9d4cb; border-radius: 8px; }
input:focus, select:focus, textarea:focus, .q-page input:focus, .q-page select:focus, .q-page textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--brand); }

/* ---- Chips, filters, switches ---- */
.chip-button { min-height: 34px; padding: .25rem .85rem; border-color: #d9d4cb; font-weight: 600; font-size: .86rem; }
.chip-button:hover { border-color: var(--brand); }
.chip-button.active { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.pt-seg button { font-weight: 600; }
.view-toggle button.active { background: var(--brand-2); }
.badge-s, .chip, .pt-chip { font-weight: 600; }
.badge-s.ok, .chip.ok, .pt-chip.ok { background: var(--good-bg); color: var(--good); }
.badge-s.warn, .chip.warn { background: var(--warn-bg); color: var(--warn); }
.badge-s.bad, .chip.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- Messages ---- */
.alert, .pt-alert { border: 1px solid var(--line); border-radius: 10px; }
.alert.warn, .pt-alert { background: var(--warn-bg); border-color: #f1d3b3; color: #6b3d12; }
.alert.bad { background: var(--bad-bg); border-color: #ecc9c2; }
.alert.ok { background: var(--good-bg); border-color: #d4e4bd; }
.pt-alert:hover { border-color: var(--accent); }

/* ---- Tables: a quiet head, room per row, a hint of the row under the mouse ---- */
.t th, .pt-table th, .pt-prow.head { font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.t th { padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.t td { padding: .6rem .6rem; border-bottom: 1px solid #efece6; }
.t tbody tr:hover td { background: #faf9f6; }
.pt-prow .rank { font-weight: 700; }
.pt-prow:nth-child(2) .rank, .pt-prow:nth-child(3) .rank, .pt-prow:nth-child(4) .rank { background: var(--brand-2); }
.mbar { height: 22px; border-radius: 6px; background: #f1efea; }
.mbar-fill.ok { background: #c9df9f; }
.mbar-fill.warn { background: #f4cf9f; }
.mbar-fill.bad { background: #eeb0a6; }
.mbar-text { line-height: 22px; font-weight: 700; font-size: .82rem; }

/* ---- Lists ---- */
.pt-list li, .pt-orders li { border-bottom-color: #efece6; }
.pt-links a, .pt-shop-links a { border-color: #d9d4cb; color: var(--ink); font-weight: 600; }
.pt-links a:hover, .pt-shop-links a:hover { border-color: var(--brand); background: #fff; color: var(--brand-2); }

/* ---- The toast ---- */
.toast { background: var(--ink); border-radius: 10px; font-weight: 600; }
.toast.error { background: var(--bad); }

/* ---- On a phone the menu is the bar at the bottom ---- */
@media (max-width: 860px) {
  .pt-menu a[aria-current]::before, .nav-item.active::before { display: none; }
  .nav-item.active { background: rgba(255, 255, 255, .16); }
  /* Small labels under the icons, and every item on one row, however many
     the role has (the planner's ninth used to wrap to a second row). */
  .nav-item { font-size: .6rem; font-weight: 600; letter-spacing: -.01em; }
  .sidebar-nav, .q-page .sidebar-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .pt-kpi strong, .metric strong { font-size: 1.35rem; }
}
