/* LogicTrade Offerte module */
:root {
  --bg: #edf0f5;
  --surface: #ffffff;
  --surface-alt: #f4f6f9;
  --surface-muted: #fafafd;
  --border: #e1e5f0;
  --border-soft: #eef0f4;
  --border-line: #f1f2f3;

  --ink-900: #071b55;
  --ink-700: #252525;
  --ink-500: #6b7a94;
  --ink-400: #9aa5b8;
  --ink-300: #cccccc;

  --accent-green: #009a82;
  --accent-green-soft: #e5f5f3;
  --accent-blue: #0d35a0;
  --accent-blue-soft: #e2eaff;
  --accent-blue-glow: rgba(13, 53, 160, 0.22);
  --accent-magenta: #E6007E;
  --accent-magenta-soft: #FDE5F0;
  --danger: #ec5555;

  --shadow-card: 0 7px 16px 0 rgba(199, 202, 220, 0.10),
                 0 30px 30px 0 rgba(199, 202, 220, 0.09),
                 0 67px 40px 0 rgba(199, 202, 220, 0.05);
  --shadow-kpi-blue: 0 4px 14px 0 rgba(19, 80, 234, 0.06);
  --shadow-kpi-pink: 0 4px 14px 0 rgba(230, 0, 126, 0.09);
  --shadow-kpi-green: 0 4px 14px 0 rgba(0, 200, 146, 0.07);
  --shadow-kpi-purple: 0 4px 14px 0 rgba(170, 0, 255, 0.06);
  --shadow-panel: 4px 4px 15px 0 rgba(14, 34, 85, 0.05);

  --radius: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 55% at 50% -8%, rgba(195, 213, 255, 0.38) 0%, transparent 65%),
    linear-gradient(168deg, #f1f4fb 0%, #eaecf3 55%, #e7eaf1 100%);
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.032;
  pointer-events: none;
  z-index: -1;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink-700);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { background: transparent; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

input {
  font-family: inherit;
  color: inherit;
}

input:focus-visible {
  outline: none;
}

/* Focus-ring alleen tonen bij keyboard-interactie, niet na klik/touch. */
:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

html[data-input-modality="pointer"] .off-detail-page :focus,
html[data-input-modality="pointer"] .off-detail-page :focus-within {
  outline: none !important;
}

html[data-input-modality="pointer"] .off-detail-page [data-kbd-section]:focus-within,
html[data-input-modality="pointer"] .off-detail-page .items-row[tabindex]:focus,
html[data-input-modality="pointer"] .off-detail-page .items-row[data-kbd-section]:focus-within,
html[data-input-modality="pointer"] .off-detail-page .inline-select:focus,
html[data-input-modality="pointer"] .off-detail-page .inline-select:focus-visible,
html[data-input-modality="pointer"] .off-detail-page .inline-combo:focus-within,
html[data-input-modality="pointer"] .off-detail-page .svc-order-search__field:focus-within,
html[data-input-modality="pointer"] .off-detail-page .editable-text:focus,
html[data-input-modality="pointer"] .off-detail-page .cell-edit:focus,
html[data-input-modality="pointer"] .off-detail-page .cell-edit:focus-visible,
html[data-input-modality="pointer"] .off-detail-page .totals__pct-input:focus,
html[data-input-modality="pointer"] .off-detail-page .totals__pct-input:focus-visible,
html[data-input-modality="pointer"] .off-detail-page .totals__amt-input:focus,
html[data-input-modality="pointer"] .off-detail-page .totals__amt-input:focus-visible {
  box-shadow: none !important;
}

/* ── App layout ────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w, 230px) 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
  position: relative;
}
.app::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #1bc7ad 0%,
    #0d8c9e 28%,
    #0d35a0 64%,
    #ec4899 100%
  );
  z-index: 100;
  pointer-events: none;
}

/* ── Shell topbar ──────────────────────────────────────────────── */
.topbar-shell {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0;
  overflow: visible;
}

.topbar-shell__gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #1bc7ad 0%,
    #0d8c9e 28%,
    #0d35a0 64%,
    #ec4899 100%
  );
  pointer-events: none;
}

.topbar-shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 230px;
  flex-shrink: 0;
  height: 100%;
  padding: 0 18px;
  border-right: 1px solid var(--border);
}
.topbar-shell__name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #1bc7ad 0%, #0d35a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-shell__crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 24px;
  min-width: 0;
}
.topbar-shell__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  color: var(--ink-500);
  transition: background .15s ease, color .15s ease;
}
.topbar-shell__back:hover { background: var(--surface-alt); color: var(--accent-blue); }
.topbar-shell__crumb {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  padding: 0 6px;
}

.topbar-shell__title {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-shell__center {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}
.topbar-shell__right {
  flex: 1 1 0;
}

/* Assist pill */
.assist-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 50%, #fce7f3 100%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  transition: filter .15s ease, box-shadow .15s ease;
}
.assist-btn:hover {
  filter: brightness(1.02);
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.18);
}
.assist-btn__icon { color: #8b5cf6; }
.assist-btn__kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: var(--ink-500);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
}
.assist-btn--has-context { box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 4px 14px rgba(139, 92, 246, 0.18); }
.assist-btn--pulse { animation: assistPulse .9s ease; }
@keyframes assistPulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.45); }
  50%  { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.topbar-shell__right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-right: 16px;
}

/* Location pill */
.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-700);
  transition: background .15s ease;
}
.location-pill:hover { background: var(--surface-alt); }
.location-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--ink-500);
}
.location-pill__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.location-pill__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
}
.location-pill__sub {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.location-pill__caret { color: var(--ink-400); }

/* Bell + dot */
.topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--ink-700);
  transition: background .15s ease;
}
.topbar-icon-btn:hover { background: var(--surface-alt); }
.topbar-icon-btn__dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec4899;
  border: 2px solid var(--surface);
}

/* User cluster */
.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: var(--radius-md);
  color: var(--ink-700);
  transition: background .15s ease;
}
.topbar-user:hover { background: var(--surface-alt); }
.topbar-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--ink-500);
}
.topbar-user__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
}

@media (max-width: 1100px) {
  .topbar-shell { grid-template-columns: 230px auto 1fr auto auto; }
  .location-pill__text { display: none; }
  .topbar-shell__crumb { display: none; }
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-500);
  font-weight: 500;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  transition: background .15s ease;
}
.crumb:hover { background: var(--surface-alt); }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 24px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  padding: 6px 6px 22px;
  overflow: hidden;
}
.brand-img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.sidebar--collapsed .sidebar__brand { max-width: 26px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--ink-500);
  font-size: 13px;
  font-family: 'Open Sans', var(--font-sans);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  text-align: left;
  width: 100%;
  cursor: pointer;
  position: relative;
  border-left: 3px solid transparent;
}
.nav__item:hover { background: var(--accent-blue-soft); color: var(--accent-blue); }
.nav__item:hover .nav__icon { color: var(--accent-blue); }
.nav__item.is-active {
  background: var(--accent-blue-soft);
  color: var(--ink-700);
  font-weight: 600;
  border-left-color: var(--accent-blue);
}
.nav__item.is-active .nav__icon { color: var(--accent-blue); }
.nav__item.is-disabled { cursor: not-allowed; }
.nav__item.is-disabled:hover { background: transparent; color: var(--ink-500); }
.nav__item.is-disabled:hover .nav__icon { color: currentColor; }

.nav__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

/* ── Sidebar collapsed ─────────────────────────────────────────── */
.sidebar--collapsed {
  padding: 18px 10px 24px 10px;
  overflow: visible;
}
.sidebar--collapsed .sidebar__brand {
  justify-content: center;
  padding: 4px 0 22px;
}
.sidebar--collapsed .nav__item {
  justify-content: center;
  padding: 10px;
  gap: 0;
}
.sidebar__collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border-radius: var(--radius-md);
  color: var(--ink-400);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.sidebar__collapse-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

/* ── Main column ───────────────────────────────────────────────── */
.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page {
  padding: 32px 40px 64px;
  flex: 1;
  min-width: 0;
}
.off-detail-page {
  background:
    radial-gradient(ellipse 90% 45% at 50% -12%, rgba(204, 220, 255, 0.24) 0%, transparent 70%),
    linear-gradient(168deg, #f7f9fd 0%, #f3f6fb 55%, #eff3f9 100%);
}

@media (max-width: 1280px) {
  .page { padding: 24px 24px 48px; }
}

.page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: -0.4px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-green);
  color: white;
}
.btn--primary:hover { background: #00876f; }

.btn--secondary {
  background: var(--surface);
  border: 1px solid var(--ink-300);
  color: var(--ink-900);
}
.btn--secondary:hover { background: var(--surface-alt); border-color: var(--ink-400); }
.btn--secondary--made {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.btn--ghost {
  background: var(--surface);
  border: 1px solid var(--ink-300);
  color: var(--accent-blue);
}
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--ink-400); }

/* Tertiary: text-only, no chrome — for low-weight actions like Annuleren. */
.btn--text {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-500);
  padding: 0 10px;
}
.btn--text:hover { color: var(--ink-900); background: var(--surface-alt); }

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--accent-blue);
}
.btn--icon:hover { background: var(--surface-alt); }
.btn--icon.is-active { background: var(--border); }

.btn--split {
  display: inline-flex;
  background: var(--accent-green);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.btn--split > .btn--primary {
  border-radius: 0;
  background: var(--accent-green);
}
.btn--split > .btn--primary + .split-caret {
  border-left: 1px solid rgba(255,255,255,.18);
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background .15s ease;
}
.btn--split > .split-caret:hover { background: #00876f; }

/* ── Inzichten page ────────────────────────────────────────────── */
.insights-wrap { display: flex; flex-direction: column; gap: 24px; }
.insights-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 32px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(15,22,42,0.08), 0 1px 3px rgba(15,22,42,0.04);
  border: 1px solid var(--border-soft);
  color: var(--accent-blue);
}
.insights-hero__title { font-size: 20px; font-weight: 700; color: var(--ink-900); margin: 0 0 4px; }
.insights-hero__sub { font-size: 13px; color: var(--ink-500); margin: 0; }

.insights-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.insights-kpi {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(15,22,42,0.06);
  border: 1px solid var(--border-soft);
}
.insights-kpi__value { font-size: 22px; font-weight: 700; color: var(--ink-900); }
.insights-kpi__label { font-size: 11px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.5px; margin: 4px 0 6px; }
.insights-kpi__trend { font-size: 11px; color: var(--ink-400); }

.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.insights-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(15,22,42,0.06);
  border: 1px solid var(--border-soft);
}
.insights-card__head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 18px;
}
.insights-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-bottom: 24px;
  position: relative;
}
.insights-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.insights-bar-col__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.insights-bar-col__bar {
  width: 100%;
  background: var(--accent-blue-soft);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid var(--accent-blue);
  transition: background .15s;
  min-height: 4px;
}
.insights-bar-col__bar:hover { background: color-mix(in srgb, var(--accent-blue) 20%, white); }
.insights-bar-col__label { font-size: 10px; color: var(--ink-400); margin-top: 6px; position: absolute; bottom: 0; }
.insights-bar-col { position: relative; }

.insights-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-line);
  font-size: 12px;
}
.insights-row:last-child { border-bottom: none; }
.insights-row__rank { width: 16px; color: var(--ink-400); font-size: 11px; flex-shrink: 0; }
.insights-row__name { flex: 1; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insights-row__meta { color: var(--ink-400); font-size: 11px; flex-shrink: 0; }
.insights-row__amount { color: var(--ink-700); font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ── KPI cards ─────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--kpi-border, var(--border-soft));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi:hover { transform: translateY(-2px); }

/* ── Entrance animations ────────────────────────────────────────── */
@keyframes enter-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes enter-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-new {
  0%   { background: var(--accent-blue-soft); }
  100% { background: transparent; }
}
@keyframes pop-soft {
  0%   { transform: scale(0.96); opacity: 0; }
  60%  { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Page-level fade on mount.
   Note: opacity-only — transform would make .page a containing block for
   fixed descendants, breaking modal overlays. */
.page { animation: enter-fade .3s ease-out both; }

/* KPI cards: cascade fade-up */
.kpi-grid > .kpi {
  animation: enter-up .35s cubic-bezier(.2,.7,.3,1) both;
}
.kpi-grid > .kpi:nth-child(1) { animation-delay:   0ms; }
.kpi-grid > .kpi:nth-child(2) { animation-delay:  60ms; }
.kpi-grid > .kpi:nth-child(3) { animation-delay: 120ms; }
.kpi-grid > .kpi:nth-child(4) { animation-delay: 180ms; }

/* Table rows: short cascade fade-up (cap depth so filter changes feel snappy) */
.lt-table tbody tr {
  animation: enter-up .26s cubic-bezier(.2,.7,.3,1) both;
}
.lt-table tbody tr:nth-child(1)  { animation-delay:   0ms; }
.lt-table tbody tr:nth-child(2)  { animation-delay:  25ms; }
.lt-table tbody tr:nth-child(3)  { animation-delay:  50ms; }
.lt-table tbody tr:nth-child(4)  { animation-delay:  75ms; }
.lt-table tbody tr:nth-child(5)  { animation-delay: 100ms; }
.lt-table tbody tr:nth-child(6)  { animation-delay: 125ms; }
.lt-table tbody tr:nth-child(7)  { animation-delay: 150ms; }
.lt-table tbody tr:nth-child(8)  { animation-delay: 175ms; }
.lt-table tbody tr:nth-child(9)  { animation-delay: 200ms; }
.lt-table tbody tr:nth-child(10) { animation-delay: 220ms; }

/* Detail offerte paper: subtle fade-in as a whole.
   Note: opacity-only — using a transform here would make .detail-card
   a containing block for fixed descendants, breaking modal overlays. */
.detail-card { animation: enter-fade .42s ease-out both; }

/* Dropdown items (klant + artikel pickers): quick cascade */
.klant-dropdown .klant-result,
.artikel-dropdown .artikel-result {
  animation: enter-up .2s cubic-bezier(.2,.7,.3,1) both;
}
.klant-dropdown .klant-result:nth-child(1),
.artikel-dropdown .artikel-result:nth-child(1) { animation-delay:  0ms; }
.klant-dropdown .klant-result:nth-child(2),
.artikel-dropdown .artikel-result:nth-child(2) { animation-delay: 22ms; }
.klant-dropdown .klant-result:nth-child(3),
.artikel-dropdown .artikel-result:nth-child(3) { animation-delay: 44ms; }
.klant-dropdown .klant-result:nth-child(4),
.artikel-dropdown .artikel-result:nth-child(4) { animation-delay: 66ms; }
.klant-dropdown .klant-result:nth-child(5),
.artikel-dropdown .artikel-result:nth-child(5) { animation-delay: 88ms; }
.klant-dropdown .klant-result:nth-child(6),
.artikel-dropdown .artikel-result:nth-child(6) { animation-delay: 110ms; }
.klant-dropdown .klant-result:nth-child(7),
.artikel-dropdown .artikel-result:nth-child(7) { animation-delay: 132ms; }
.klant-dropdown .klant-result:nth-child(8),
.artikel-dropdown .artikel-result:nth-child(8) { animation-delay: 154ms; }

/* Newly-added line / group highlight */
.is-new { animation: pulse-new .9s ease-out both; }

/* Status pill change (re-trigger animation on key change) */
.pill--niet, .pill--definitief { animation: pop-soft .26s cubic-bezier(.2,.7,.3,1.2) both; }

/* Active-state press for buttons and chips (subtle) */
.btn:active, .btn--icon:active, .filter-chip__btn:active,
.add-row:active, .items-toolbar__btn:active,
.kpi--clickable:active { transform: scale(0.97); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.kpi--clickable { cursor: pointer; }
.kpi--blue {
  --kpi-accent: #0d35a0;
  --kpi-bg: rgba(13,53,160,0.04);
  --kpi-border: rgba(13,53,160,0.11);
  --kpi-pill: rgba(13,53,160,0.09);
  box-shadow: var(--shadow-kpi-blue);
}
.kpi--blue:hover { box-shadow: 0 10px 24px rgba(19,80,234,0.11), 0 3px 8px rgba(19,80,234,0.06); }
.kpi--pink {
  --kpi-accent: #E6007E;
  --kpi-bg: rgba(230,0,126,0.04);
  --kpi-border: rgba(230,0,126,0.11);
  --kpi-pill: rgba(230,0,126,0.09);
  box-shadow: none;
}
.kpi--pink:hover { box-shadow: 0 10px 24px rgba(230,0,126,0.15), 0 3px 8px rgba(230,0,126,0.07); }
.kpi--green {
  --kpi-accent: #0b7a66;
  --kpi-bg: rgba(11,122,102,0.04);
  --kpi-border: rgba(11,122,102,0.11);
  --kpi-pill: rgba(11,122,102,0.09);
  box-shadow: var(--shadow-kpi-green);
}
.kpi--green:hover { box-shadow: 0 10px 24px rgba(0,200,146,0.13), 0 3px 8px rgba(0,200,146,0.06); }
.kpi--purple {
  --kpi-accent: #6d28d9;
  --kpi-bg: rgba(109,40,217,0.04);
  --kpi-border: rgba(109,40,217,0.11);
  --kpi-pill: rgba(109,40,217,0.09);
  box-shadow: var(--shadow-kpi-purple);
}
.kpi--purple:hover { box-shadow: 0 10px 24px rgba(170,0,255,0.11), 0 3px 8px rgba(170,0,255,0.05); }
.kpi--active { outline: 2px solid rgba(230,0,126,0.4); outline-offset: 2px; }

.kpi__open-hint {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--kpi-accent, var(--ink-400));
  background: var(--kpi-pill, var(--border-soft));
  border-radius: 50%;
  opacity: 0;
  transition: opacity .15s ease;
}
.kpi--clickable:hover .kpi__open-hint { opacity: 1; }
.kpi__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-400);
}
.kpi__value {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.8px;
  line-height: 1;
}
.kpi__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi__trend {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(230,0,126,0.09);
  color: var(--accent-magenta);
  white-space: nowrap;
}
.kpi__period {
  font-size: 10px;
  color: var(--ink-300);
  white-space: nowrap;
}

/* ── Table card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

/* ── Card overflow — RULE ─────────────────────────────────────────────
   A `.card` clips by default (overflow: hidden) so children with
   backgrounds don't bleed past the rounded corners. But when the card
   contains a toolbar with filter chips (or any popover/menu that needs
   to escape *downward*), clipping kills the dropdown.

   Solution: auto-detect via :has() — any card that contains a filterbar
   (or an explicit overflow-opt-in toolbar) gets overflow: visible. No
   per-instance modifier required.

   If you need it manually (rare), add `.card--overflow`.

   This rule should not be removed. We've hit this bug twice (service
   board + offerte list). See STYLEGUIDE §4.5. */
.card:has(.filterbar),
.card:has(.toolbar--with-filters),
.card.card--overflow { overflow: visible; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-line);
}

.search {
  position: relative;
  flex: 0 0 360px;
  max-width: 100%;
}
.search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0 12px 0 36px;
  font-size: 13px;
  color: var(--ink-700);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(13, 53, 160, 0.1);
}
.search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-400);
  pointer-events: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
.chip:hover { background: #eaedf3; }
.chip__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--ink-400);
  font-size: 11px;
}
.chip__close:hover { background: var(--ink-300); color: var(--ink-700); }

.toolbar__spacer { flex: 1; }

/* Right-side action cluster inside the table card toolbar (+ Nieuw / ⋯ / view toggle) */
.toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Inline ghost-style toggle with label + switch (e.g. "Nieuwe weergave").
   Caption-tier label (§ 1.2) lets the switch itself be the visual anchor —
   the affordance is the toggle, not the word next to it. */
.view-toggle {
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-400);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.view-toggle:hover { background: var(--surface-alt); color: var(--ink-700); }
.view-toggle:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}
.view-toggle .switch { margin-left: 0; }

/* Right-aligned strip above an overview's body (KPIs / card). Hosts the
   global "Nieuwe weergave" preview toggle while the old UI lives alongside
   the new one. Sits at page level so it isn't duplicated inside every
   toolbar action cluster. */
.overview-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 16px;
  min-height: 28px;
}

/* ── Table ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.lt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.lt-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-500);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-line);
  background: #fafbfc;
  white-space: nowrap;
}
.lt-table thead th:last-child { text-align: right; }

.lt-table__sortable {
  cursor: pointer;
  user-select: none;
}
.lt-table__sortable:hover { color: var(--ink-700); }
.lt-table__sortable.is-sorted { color: var(--ink-900); }

.sort-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  opacity: 0;
  color: var(--ink-400);
  transition: opacity 0.15s, transform 0.15s, color 0.15s;
  vertical-align: middle;
}
.lt-table__sortable:hover .sort-indicator { opacity: 0.5; }
.sort-indicator.is-active { opacity: 1; color: var(--accent-blue); }
.sort-indicator.is-active.is-asc { transform: rotate(180deg); }

.lt-table tbody tr {
  border-bottom: 1px solid var(--border-line);
  transition: background .15s ease;
  cursor: pointer;
}
.lt-table tbody tr:hover {
  background: var(--surface-alt);
}
.lt-table tbody tr.is-context { background: #f0f3fa; }
.lt-table tbody tr.is-keyboard-active { background: var(--surface-alt); }

.lt-table td {
  padding: 14px 16px;
  vertical-align: top;
  color: var(--ink-700);
}
.lt-table td:last-child { text-align: right; }

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cell-muted { color: var(--ink-500); font-size: 11px; }

/* ── Status pill ───────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: box-shadow .18s ease, transform .12s ease, background .15s ease;
}
button.pill { cursor: pointer; }
button.pill:hover { transform: translateY(-1px); }

.pill--definitief {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-color: rgba(0, 154, 130, 0.14);
  box-shadow: 0 1px 3px rgba(0, 154, 130, 0.08);
}
button.pill--definitief:hover {
  background: #d6efe9;
  box-shadow: 0 2px 6px rgba(0, 154, 130, 0.14);
}

.pill--niet {
  background: var(--accent-magenta-soft);
  color: var(--accent-magenta);
  border-color: rgba(230, 0, 126, 0.14);
  box-shadow: 0 1px 3px rgba(230, 0, 126, 0.08);
}
button.pill--niet:hover {
  background: #FBD3E6;
  box-shadow: 0 2px 6px rgba(230, 0, 126, 0.14);
}
.pill__caret { width: 14px; height: 14px; opacity: 0.75; flex-shrink: 0; }

/* ── Filter bar ────────────────────────────────────────────────── */
/* Default: standalone bar (kept for backwards compat) */
.filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Inline mode — embedded in the toolbar next to the search input.
   The outer toolbar does NOT wrap (search/pipe/actions stay on one row).
   The filterbar inside wraps its own chips when there are too many. */
.toolbar--with-filters {
  flex-wrap: nowrap;
  column-gap: 12px;
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
}
.toolbar--with-filters .search {
  flex: 0 0 auto;
  min-width: 240px;
}
.toolbar--with-filters .filterbar {
  flex: 1 1 auto;
  padding: 0;
  border: none;
  background: transparent;
  min-width: 0;
  /* Keep chips on the first row aligned with search/actions; rows below stack. */
  row-gap: 8px;
  align-content: flex-start;
  align-self: stretch;
  align-items: center;
}
/* When the toolbar is in this inline mode, keep the actions top-anchored
   so they stay on the first row even when chips wrap to additional rows. */
.toolbar--with-filters .toolbar__actions { align-self: flex-start; margin-top: 0; height: 36px; align-items: center; }

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  overflow: visible;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.filter-chip:hover { border-color: var(--ink-300); }

.filter-chip__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 12px;
  font-size: 12px;
  color: var(--ink-700);
  border-radius: 999px 0 0 999px;
}
.filter-chip__btn.is-set { color: var(--accent-blue); font-weight: 500; }

.filter-chip__icon {
  display: inline-flex;
  color: var(--ink-500);
}
.filter-chip__btn.is-set .filter-chip__icon { color: var(--accent-magenta); }

.filter-chip__label { color: var(--ink-500); }
.filter-chip__btn.is-set .filter-chip__label { color: var(--ink-700); }

.filter-chip__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-chip__value--placeholder {
  background: transparent;
  color: var(--ink-400);
  font-weight: 400;
  padding: 0;
}
.filter-chip__more {
  background: rgba(13, 53, 160, 0.18);
  color: var(--accent-blue);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
}

.filter-chip__caret {
  width: 8px;
  height: 5px;
  color: var(--ink-400);
}

.filter-chip__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  border-left: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  color: var(--ink-400);
  transition: background .12s ease, color .12s ease;
}
.filter-chip__close:hover {
  background: #fde7e7;
  color: var(--danger);
}

/* Add filter button */
.filter-add { position: relative; }
.filter-add__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  border: 1px dashed var(--ink-300);
  background: transparent;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.filter-add__btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-style: solid;
}

.filter-clear {
  font-size: 11px;
  color: var(--ink-500);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 6px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-clear:hover { color: var(--danger); }

/* Filter picker (the "+ Filter" popover) */
.filter-picker {
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 220px;
  padding: 6px;
}
.filter-picker__head {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 10px 6px;
}
.filter-picker__empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
}

/* Filter dropdown */
.filter-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 240px;
  padding: 0;
  overflow: hidden;
}
.filter-dropdown--range { min-width: 280px; padding: 0; }

.filter-dropdown__head {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 14px 4px;
}

.filter-dropdown__search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--border-line);
}
.filter-dropdown__search input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 30px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
}
.filter-dropdown__search input:focus-visible { background: white; border-color: var(--accent-blue); }
.filter-dropdown__search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: var(--ink-400);
}

.filter-dropdown__list {
  max-height: 288px;
  overflow-y: auto;
  padding: 4px 4px 8px;
}
.filter-dropdown__empty {
  padding: 16px;
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
}

.filter-dropdown__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  width: 100%;
  text-align: left;
  font-size: 12px;
  color: var(--ink-700);
  transition: background .1s ease;
}
.filter-dropdown__opt:hover { background: var(--surface-alt); }
.filter-dropdown__opt.is-on { background: var(--accent-blue-soft); color: var(--accent-blue); font-weight: 500; }

.filter-dropdown__check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  background: white;
  transition: background .12s ease, border-color .12s ease;
}
.filter-dropdown__check.is-on {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.filter-dropdown__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-line);
  background: var(--surface-muted);
  font-size: 11px;
}
.filter-dropdown__clear {
  color: var(--ink-500);
  font-size: 11px;
}
.filter-dropdown__clear:hover { color: var(--danger); }
.filter-dropdown__count {
  margin-left: auto;
  color: var(--ink-500);
}
.filter-dropdown__apply {
  margin-left: auto;
  background: var(--accent-blue);
  color: white;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
}

.filter-range {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
}
.filter-range label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  font-size: 10px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-range input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink-700);
  background: white;
}
.filter-range input:focus-visible { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13,53,160,.1); }
.filter-range__sep {
  padding-bottom: 8px;
  color: var(--ink-400);
}

/* ── Pagination ────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 12px;
  color: var(--ink-500);
}
.pagination__pages { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pagination__count { font-size: 12px; color: var(--ink-500); }
.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover { background: var(--surface-alt); }
.page-btn.is-active { background: var(--accent-magenta); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page-size select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--ink-700);
  background: white;
  font-family: inherit;
}

/* ── Popover menus ─────────────────────────────────────────────── */
.menu {
  position: absolute;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 6px;
  min-width: 180px;
  animation: menu-in 0.12s ease-out;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink-700);
  width: 100%;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background .12s ease;
  white-space: nowrap;
}
.menu__item:hover { background: var(--surface-alt); }
.menu__item:disabled,
.menu__item[disabled] {
  color: var(--ink-400);
  cursor: not-allowed;
  background: transparent !important;
}
.menu__item:disabled .menu__icon,
.menu__item[disabled] .menu__icon { color: var(--ink-400); }
.menu__hint { color: var(--ink-400); font-style: italic; margin-left: 4px; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: #fff0f0; }
.menu__icon { width: 14px; height: 14px; color: var(--ink-500); flex-shrink: 0; }
.menu__item--danger .menu__icon { color: var(--danger); }

.menu__kbd {
  margin-left: auto;
  font-size: 9px;
  color: var(--ink-400);
  font-weight: 500;
  background: #eef0f4;
  padding: 2px 6px;
  border-radius: var(--radius);
}

.menu__caret {
  margin-left: auto;
  width: 10px;
  height: 10px;
  color: var(--ink-400);
}

.menu__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.menu__item-with-submenu { position: relative; }
.menu__item-with-submenu .menu {
  left: calc(100% + 4px);
  top: -6px;
}
/* Flip submenu to the left side when the parent menu is near the right edge. */
.menu--flip-sub .menu__item-with-submenu .menu {
  left: auto;
  right: calc(100% + 4px);
}

.menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  width: 100%;
  cursor: pointer;
  font-size: 12px;
}
.menu-toggle:hover { background: var(--surface-alt); }

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  background: var(--ink-300);
  border-radius: 999px;
  flex-shrink: 0;
  margin-left: auto;
  transition: background .15s ease;
}
.switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left .15s ease;
}
.switch.is-on { background: var(--accent-green); }
.switch.is-on::after { left: 16px; }

/* ── Detail layout ─────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: stretch;
}
.detail-grid > * { min-width: 0; }
@media (max-width: 1200px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(15, 22, 42, 0.08), 0 1px 3px rgba(15, 22, 42, 0.04);
  border: 1px solid var(--border-soft);
  padding: 32px 48px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-900);
}
.detail-header__sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-500);
}

.divider {
  height: 1px;
  background: var(--border-line);
  margin: 20px 0;
  border: 0;
}
.divider--strong { background: var(--ink-700); }

/* ── Info grid ─────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
}
@media (max-width: 720px) {
  .info-grid { grid-template-columns: 1fr; }
}

.info-block__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.info-block__line {
  font-size: 12px;
  color: var(--ink-700);
  display: flex;
  gap: 8px;
}
.info-block__line + .info-block__line { margin-top: 4px; }
.info-block__line--strong { font-weight: 700; margin-bottom: 4px; }

.info-block__row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.info-block__row + .info-block__row { margin-top: 10px; }
.info-block__row dt {
  flex: 0 0 90px;
  color: var(--ink-400);
}
.info-block__row dd {
  margin: 0;
  font-weight: 500;
  color: var(--ink-700);
  white-space: nowrap;
  min-width: 0;
}
.info-block__row dd .inline-select { white-space: nowrap; }

/* ── Items table ───────────────────────────────────────────────── */
/* Items grid — content (Omschrijving, name, etc.) starts flush with the
   surrounding paper-section labels (KLANT / DOCUMENT / OPMERKINGEN). The
   drag-handle is no longer a grid column; it floats absolute in the row's
   gutter (same "tools in the gutter" pattern as .items-group__remove). */
.items-head {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) 60px 80px 70px 100px;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-line);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.items-head__num,
.items-head__price,
.items-head__discount,
.items-head__total { text-align: right; }

.items-row {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) 60px 80px 70px 100px;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-line);
  align-items: start;
  position: relative;
  background: white;
  transition: background .12s ease;
}
.items-row:hover { background: var(--surface-muted); }
.items-row.is-dragging { opacity: 0.5; }
.items-row.is-drop-target { background: var(--accent-blue-soft); }

.items-row.is-highlight { background: var(--surface-alt); }

/* Onderliggende regels — ingesprongen child-rij + toggle op de parent */
.items-row--child {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 22px;
  background: var(--surface-muted);
}
.items-row--child:hover { background: var(--surface-alt); }
.items-row--child .item-name { font-weight: 600; color: var(--ink-600); }
.drag-handle--placeholder {
  position: absolute;
  left: -22px;
  top: 17px;
  width: 18px;
  height: 14px;
  pointer-events: none;
}
.item-child-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 5px;
  margin-right: 6px;
  border: 1px solid var(--border-line);
  border-radius: 4px;
  background: white;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  vertical-align: middle;
}
.item-child-toggle:hover { background: var(--surface-muted); color: var(--ink-700); border-color: var(--ink-300); }
.item-child-toggle svg { transition: transform .15s ease; }
.item-child-toggle.is-open svg { transform: rotate(-180deg); }
.item-child-toggle__count { line-height: 1; }

.drag-handle {
  position: absolute;
  left: -22px;
  top: 17px;
  width: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: var(--ink-400);
  cursor: grab;
  opacity: 0;
  transition: opacity .15s ease;
}
.items-row:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: 4px;
}
.item-meta {
  font-size: 12px;
  color: var(--ink-500);
  white-space: pre-line;
}

/* Per-line note — three states (display / add / edit). Lives below .item-meta
   in the description cell. Subtle by default, more visible when set. */
.item-notes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 6px;
}
.item-notes + .item-note-add { margin-top: 2px; opacity: 1; }
.item-notes .item-note,
.item-notes .item-note-edit { margin-top: 0; }
.item-note-add--secondary { opacity: 1; color: var(--ink-500); }
.item-note,
.item-note-add {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 6px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, opacity .12s ease;
  font-family: inherit;
  max-width: 100%;
}
.item-note {
  color: var(--ink-700);
  font-size: 11.5px;
  font-style: italic;
  font-weight: 500;
}
.item-note > svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--ink-400);
  opacity: 0;
  transition: color .12s ease, opacity .12s ease;
}
.item-note:hover { background: var(--surface-alt); }
.item-note:hover > svg { color: var(--accent-blue); opacity: 1; }
.item-note > span { white-space: pre-line; word-break: break-word; }
.item-note:disabled { cursor: default; }
.item-note:disabled:hover { background: transparent; }

.item-note-add {
  align-items: center;
  color: var(--ink-400);
  font-size: 11px;
  font-weight: 500;
  opacity: 0;
}
.item-note-add > svg { flex-shrink: 0; }
.items-row:hover .item-note-add { opacity: 1; }
.item-note-add:hover { color: var(--accent-blue); background: var(--accent-blue-soft); }

.item-note-edit {
  position: relative;
  margin-top: 6px;
}
.item-note-audience {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 6px;
  padding: 3px;
  background: var(--surface-alt);
  border-radius: var(--radius);
}
.item-note-audience__opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.item-note-audience__opt:hover { color: var(--ink-700); }
.item-note-audience__opt.is-active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.item-note-audience__opt--klant.is-active { color: var(--accent-blue); }
.item-note-audience__opt--leverancier.is-active { color: var(--accent-magenta); }
.item-note-audience__opt--intern.is-active { color: var(--accent-green); }
.item-note-audience__opt > svg { flex-shrink: 0; }

.item-note > svg.item-note__audience-icon { flex-shrink: 0; margin-top: 2px; opacity: 0.85; }
.item-note--klant .item-note__audience-icon { color: var(--accent-blue); }
.item-note--leverancier .item-note__audience-icon { color: var(--accent-magenta); }
.item-note--intern .item-note__audience-icon { color: var(--accent-green); }

.item-note-input {
  display: block;
  width: 100%;
  padding: 8px 32px 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-700);
  font-family: inherit;
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  resize: vertical;
  min-height: 56px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.item-note-input:focus-visible { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); }
.item-note-input::placeholder { color: var(--ink-400); font-style: italic; }

.item-note-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--ink-400);
  cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.item-note-delete:hover { color: var(--danger); background: rgba(236, 85, 85, 0.1); }

.item-num,
.item-price,
.item-discount,
.item-total {
  text-align: right;
  font-size: 12px;
  color: var(--ink-700);
  padding-top: 0;
}
.item-total { font-weight: 700; color: var(--ink-700); padding: 5px 7px 5px 0; }

.cell-edit {
  width: 100%;
  text-align: right;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 6px;
  font-size: 12px;
  background: transparent;
  font-family: inherit;
  color: var(--ink-700);
  transition: background .12s ease, border-color .12s ease;
}
.cell-edit:hover { background: white; border-color: var(--border); }
.cell-edit:focus-visible { background: white; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); }
.cell-edit[type="number"]::-webkit-inner-spin-button,
.cell-edit[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cell-edit[type="number"] { -moz-appearance: textfield; }

.add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  background: var(--surface);
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.add-row svg { transition: transform .25s ease; }
.add-row:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  border-style: solid;
  background: var(--accent-blue-soft);
  box-shadow: 0 4px 12px rgba(13, 53, 160, 0.08);
}
.add-row:not(.add-row--more):hover > svg { transform: rotate(90deg); }
.add-row-split:hover .add-row--main > svg { transform: rotate(90deg); }

/* ── Split add-row: "Regel toevoegen" (primary) + chevron menu ── */
.add-row-split {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-top: 12px;
  gap: 0;
}
.add-row-split .add-row { margin-top: 0; }
.add-row-split .add-row--main {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.add-row-split .add-row--more {
  flex: 0 0 auto;
  width: 44px;
  padding: 12px 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1.5px dashed var(--ink-300);
}
.add-row-split .add-row--more svg { transition: transform .2s ease; }
.add-row-split .add-row--more.is-open svg { transform: rotate(180deg); }
/* When the chevron half is hovered/open, color both halves consistently */
.add-row-split:hover .add-row--main,
.add-row-split:hover .add-row--more {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  border-style: solid;
  background: var(--accent-blue-soft);
  box-shadow: 0 4px 12px rgba(13, 53, 160, 0.08);
}
.add-row-split:hover .add-row--main { border-right: none; }
.add-row-split:hover .add-row--more { border-left: 1px solid rgba(13, 53, 160, 0.18); }
/* Make sure the icon spin on the main half still works on hover */
.add-row-split:hover .add-row--main svg { transform: rotate(90deg); }

.add-row-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(15, 22, 42, 0.12), 0 2px 6px rgba(15, 22, 42, 0.04);
  padding: 6px;
  z-index: 50;
  animation: menu-in 0.14s ease-out;
}
.add-row-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.add-row-menu__item:hover { background: var(--accent-blue-soft); color: var(--accent-blue); }
.add-row-menu__item svg { color: var(--ink-400); transition: color .12s ease; }
.add-row-menu__item:hover svg { color: var(--accent-blue); }
.items-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}
.items-toolbar__btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}
.items-toolbar__btn:active { transform: scale(0.97); }
.items-toolbar__btn svg { color: currentColor; }

/* ── Text line variant (free-form description + price) ─────────── */
/* Reads like a product row but the description is italic to signal free-form. */
.items-row--text { grid-template-columns: 1fr 100px; }
.items-row__text { grid-column: 1 / 2; }
.cell-edit--text {
  text-align: left;
  font-weight: 500;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-700);
  padding: 6px 8px;
  width: 100%;
}
.cell-edit--text::placeholder { color: var(--ink-300); font-style: italic; }

/* Drawer / paper-quote text line */
.paper-quote__items-row--text { grid-template-columns: 1fr 100px; }
.paper-quote__item-cell--text { grid-column: 1 / 2; font-style: italic; }

/* ── Item groups ───────────────────────────────────────────────── */
/* Quiet container — same surface as the rest, soft border, neutral header. */
.items-group {
  margin: 12px 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.items-group__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: background .15s ease;
  position: relative;
}
.items-group__header.is-dragging { opacity: 0.5; }
.items-group__header.is-drop-target { background: var(--accent-blue-soft); }
.items-group__header .drag-handle { top: 50%; transform: translateY(-50%); }
.items-group__header:hover .drag-handle { opacity: 1; }
.items-group__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.items-group__title .editable-text { min-width: 40px; }
.items-group__count {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-400);
  text-transform: none;
  letter-spacing: 0;
}
.items-group__subtotal {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  text-align: right;
}
.items-group__remove {
  position: absolute;
  top: 50%;
  right: -28px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--ink-400);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease, background .12s ease, color .12s ease;
}
.items-group:hover .items-group__remove,
.items-group__header:hover .items-group__remove { opacity: 1; }
.items-group__remove:hover { background: rgba(236, 85, 85, 0.1); color: var(--danger); }

.items-group__body { padding: 0; }
.items-group__body .items-row {
  border-bottom: 1px dashed var(--border-line);
  /* Inside a group card the boundary is the group's rounded border;
     reset the negative margin so hover-bg respects that boundary. */
  margin: 0;
  padding: 16px 14px;
}
.items-group__body .items-row:last-child { border-bottom: none; }

.items-group__empty {
  margin: 10px 14px;
  padding: 16px;
  font-size: 12px;
  color: var(--ink-400);
  font-style: italic;
  text-align: center;
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius);
  background: var(--surface-muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.items-group__empty.is-drop-target {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  font-style: normal;
  font-weight: 500;
}

/* ── Drawer (paper-quote) group label ──────────────────────────── */
.paper-quote__group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin: 8px 0 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface-muted);
  border-radius: var(--radius);
}

/* ── Totals ────────────────────────────────────────────────────── */
.totals {
  margin-top: 24px;
  margin-left: auto;
  width: 320px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  background: var(--surface-alt);
  border-radius: var(--radius-lg);
}
.totals__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 22px;
  font-size: 13px;
  color: var(--ink-500);
}
.totals__row > span:first-child {
  white-space: nowrap;
  text-align: left;
}
.totals__row > span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-700);
  text-align: right;
  justify-self: end;
}
.totals__row--strong {
  color: var(--ink-700);
  font-weight: 500;
}
.totals__row--strong > span:last-child {
  color: var(--ink-700);
  font-weight: 600;
}
.totals__row--discount span:last-child {
  font-weight: 500;
  color: var(--ink-500);
}
/* Korting row — inline editable */
.totals__row--korting { position: relative; }
.totals__korting-left {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
}
.totals__pct-input {
  width: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-700);
  text-align: center;
  outline: none;
  padding: 2px 4px;
  -moz-appearance: textfield;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.totals__pct-input:hover { background: white; border-color: var(--border); }
.totals__pct-input:focus-visible { background: white; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); }
.totals__pct-input::-webkit-outer-spin-button,
.totals__pct-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.totals__korting-right {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-500);
  justify-self: end;
}
.totals__amt-input {
  width: 80px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-700);
  text-align: right;
  outline: none;
  padding: 2px 0;
  -moz-appearance: textfield;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.totals__amt-input:hover { background: white; border-color: var(--border); padding: 2px 6px; width: 80px; }
.totals__amt-input:focus-visible { background: white; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); padding: 2px 6px; }
.totals__amt-input::-webkit-outer-spin-button,
.totals__amt-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.totals__korting-remove {
  position: absolute;
  right: -32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-md);
  color: var(--ink-400);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .12s, background .12s;
}
.totals__row--korting:hover .totals__korting-remove { opacity: 1; }
.totals__korting-remove:hover { color: var(--danger); background: rgba(220,30,30,0.08); }

/* Add-discount button — below Totaal */
.totals__add-discount {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-400);
  cursor: pointer;
  padding: 10px 0 2px;
  align-self: flex-end;
  border-top: 1px solid var(--border-line);
  width: 100%;
  justify-content: flex-end;
  transition: color .15s;
}
.totals__add-discount:hover { color: var(--accent-blue); }
.totals__row--grand {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: 6px;
}
.totals__row--grand > span:last-child {
  color: var(--accent-blue);
}

/* ── Voorwaarden / Files ───────────────────────────────────────── */
.terms-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: start;
}
@media (max-width: 720px) { .terms-grid { grid-template-columns: 1fr; } }

.terms-grid__head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.term-row {
  display: flex;
  align-items: baseline;
  font-size: 12px;
  gap: 12px;
}
.term-row + .term-row { margin-top: 10px; }
.term-row dt {
  flex: 0 0 120px;
  color: var(--ink-400);
}
.term-row dd {
  margin: 0;
  color: var(--ink-700);
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.term-row dd .inline-select { white-space: nowrap; }

/* ── Files dropzone ────────────────────────────────────────────────
   Container is always droppable. With files: tiles wrap inside it.
   Empty: one centered "drop or click" prompt fills the area. */
.dropzone {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  transition: background .12s ease, border-color .12s ease;
  cursor: pointer;
  min-height: 84px;
}
.dropzone.is-empty {
  align-items: center;
  justify-content: center;
}
.dropzone:hover {
  border-color: var(--ink-300);
  background: var(--surface-alt);
}
.dropzone.is-dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}
.dropzone__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  color: var(--ink-500);
  text-align: center;
  pointer-events: none;
}
.dropzone__empty svg { color: var(--ink-400); }
.dropzone.is-dragover .dropzone__empty { color: var(--accent-blue); }
.dropzone.is-dragover .dropzone__empty svg { color: var(--accent-blue); }
.dropzone__empty-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
}
.dropzone.is-dragover .dropzone__empty-title { color: var(--accent-blue); }
.dropzone__empty-sub { font-size: 12px; color: var(--ink-500); }
.dropzone__drop-hint {
  flex: 1 0 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  padding: 6px 0;
  pointer-events: none;
}

.file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  width: 220px;
  transition: border-color .12s ease, box-shadow .12s ease;
  cursor: default;
}
.file:hover { border-color: var(--ink-300); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.file__remove {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--ink-400);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
  flex-shrink: 0;
}
.file:hover .file__remove { opacity: 1; }
.file__remove:hover { background: var(--surface-alt); color: var(--danger); }
.file__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file__name {
  font-size: 12px;
  color: var(--ink-700);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file__meta {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}

/* ── Right panel — accordion (single card) ──────────────────── */
.side-panel--accordion {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 340px;
  flex-shrink: 0;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-panel__handle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-line);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: justify-content 0.22s ease;
}
.side-panel--collapsed .side-panel__handle {
  justify-content: center;
}
.side-panel__handle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: var(--radius);
  color: var(--ink-400);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.side-panel__handle-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

/* Accordion content wrapper */
.side-panel__content {
  flex: 1;
  min-width: 0;
  opacity: 1;
  transition: opacity 0.12s ease;
}
.side-panel--collapsed .side-panel__content {
  opacity: 0;
  pointer-events: none;
}

/* Icon strip — absolutely positioned, fades in when collapsed */
.side-panel__icon-strip {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.side-panel--collapsed .side-panel__icon-strip {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.14s ease 0.14s;
}
.side-panel__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  color: var(--ink-500);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  border-bottom: 1px solid var(--border-line);
}
.side-panel__icon-btn:last-child { border-bottom: none; }
.side-panel__icon-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

/* Collapsed state */
.side-panel--collapsed {
  width: 48px;
}

.acc {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border-line);
  overflow: hidden;
}
.acc:last-child { border-bottom: none; }
.acc.is-open { box-shadow: none; }

.acc__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  font: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .12s ease;
}
.acc__head:hover { background: var(--surface-alt); }

.acc__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border-radius: 0;
  color: var(--ink-500);
  flex-shrink: 0;
}
.acc.is-open .acc__icon { color: var(--accent-magenta); }

.acc__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.acc__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-md);
  background: var(--accent-magenta-soft);
  color: var(--accent-magenta);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.acc.is-open .acc__count { background: var(--accent-magenta-soft); color: var(--accent-magenta); }

.acc__sub {
  font-size: 11px;
  color: var(--ink-400);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  padding-left: 8px;
}

.acc__caret {
  width: 18px;
  height: 18px;
  color: var(--ink-400);
  flex-shrink: 0;
  transition: transform .18s ease, color .15s ease;
  margin-left: auto;
}
.acc__sub + .acc__caret { margin-left: 0; }
.acc__caret.is-open { transform: rotate(180deg); color: var(--ink-700); }

.acc__body {
  padding: 0 20px 18px 20px;
  border-top: none;
  margin-top: -4px;
  animation: acc-in .18s ease;
}
@keyframes acc-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.acc__empty {
  padding: 12px 0;
  color: var(--ink-400);
  font-size: 12px;
}

.acc__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.acc__add:hover {
  color: var(--ink-700);
  border-color: var(--ink-300);
  border-style: solid;
  background: var(--surface-alt);
}

.acc__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-blue);
  background: transparent;
  border: none;
  cursor: pointer;
}
.acc__link:hover { text-decoration: underline; }

.acc__kv { padding-top: 12px; }
.acc__kv-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
}
.acc__kv-row dt { color: var(--ink-400); margin: 0; }
.acc__kv-row dd { color: var(--ink-700); margin: 0; }

.line-notes {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.line-notes__head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.line-note { padding: 6px 0; border-top: 1px dashed var(--border-soft); }
.line-note:first-of-type { border-top: none; padding-top: 0; }
.line-note__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-900);
}
.line-note__title > svg { color: var(--accent-green); flex-shrink: 0; }
.line-note__text {
  margin: 4px 0 0 17px;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-700);
  white-space: pre-line;
}

.notes { padding-top: 10px; }
.note {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 2px solid var(--accent-blue-soft);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.note__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}
.note__head strong { color: var(--accent-blue); font-weight: 600; }
.note__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.note__meta span { color: var(--ink-400); }
.note__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius);
  color: var(--ink-400);
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.note:hover .note__delete { opacity: 1; }
.note__delete:hover { color: var(--danger); background: rgba(236, 85, 85, 0.08); }
.note p { margin: 0; font-size: 12px; color: var(--ink-700); line-height: 1.5; }

.activity { padding-top: 8px; }
.activity__row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--border-line);
}
.activity__row:last-child { border-bottom: none; }
.activity__row svg { color: var(--ink-400); }
.activity__row em { font-style: normal; font-size: 11px; color: var(--ink-400); }

.comms { padding-top: 10px; }
.comm {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-line);
}
.comm:last-child { border-bottom: none; }
.comm__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.comm__title { font-size: 12px; color: var(--ink-700); font-weight: 500; margin-bottom: 2px; }
.comm__meta { font-size: 11px; color: var(--ink-400); }

/* ── Right panel ───────────────────────────────────────────────── */
.side-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.side-tab {
  flex: 1;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  text-align: left;
  position: relative;
  transition: color .15s ease;
}
.side-tab:hover { color: var(--ink-700); }
.side-tab.is-active { color: var(--accent-blue); }
.side-tab.is-active::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: -1px;
  height: 2px;
  background: var(--accent-magenta);
  border-radius: var(--radius) var(--radius) 0 0;
}

.side-body { padding: 24px; }

.appt {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-line);
}
.appt:last-child { border-bottom: none; }
.appt__date {
  position: relative;
  flex: 0 0 56px;
  text-align: center;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 8px 0;
  font-weight: 600;
}
.appt__date small { display: block; font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
.appt__date span { display: block; font-size: 18px; line-height: 1.1; }
.appt__body { flex: 1; min-width: 0; }
.appt__title { font-size: 13px; font-weight: 500; color: var(--ink-700); display: inline-flex; align-items: center; gap: 8px; }
.appt__meta { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* Past appointments — quiet grey */
.appt--past .appt__date { background: var(--surface-alt); color: var(--ink-500); }
.appt--past .appt__title { color: var(--ink-500); }
.appt--past .appt__meta { color: var(--ink-400); }

/* Next upcoming — small green notification dot + subtle tag */
.appt--next .appt__date::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(0, 154, 130, 0.18);
}

.history {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hist {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}
.hist::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.hist:last-child::before { display: none; }
.hist__dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--accent-magenta);
  margin-top: 4px;
  flex-shrink: 0;
  z-index: 1;
}
.hist__dot--muted { border-color: var(--ink-300); }
.hist__body { flex: 1; min-width: 0; }
.hist__title { font-size: 12px; font-weight: 500; color: var(--ink-700); }
.hist__meta { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* ── Inline editable text ─────────────────────────────────────── */
.editable-text {
  cursor: text;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 2px 6px;
  margin: -2px -6px;
  transition: border-color .12s ease, background .12s ease;
}
.editable-text:hover { border-color: var(--border); background: white; }
.editable-text:focus-visible { border-color: var(--accent-blue); background: white; box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); }
/* Read-only cells / inline editors — no border, no background, "lock" cursor on hover. */
.editable-text--readonly,
.cell-edit--readonly {
  cursor: not-allowed;
  color: var(--ink-700);
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.cell-edit--readonly {
  display: inline-block;
  padding: 4px 6px;
  font-size: 12px;
}
.cell-edit--readonly.cell-edit--text { font-style: italic; font-weight: 500; font-size: 13px; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  padding: 12px 16px;
  background: var(--ink-700);
  color: white;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: toast-in .2s ease-out;
  max-width: 360px;
}
.toast--success { background: var(--accent-green); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Empty / placeholder ──────────────────────────────────────── */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}

/* ── Klant card (hover-actions on detail) ────────────────────── */
.klant-card {
  position: relative;
  border-radius: var(--radius-md);
  margin: -10px -12px;
  padding: 10px 12px;
  transition: background 120ms ease, box-shadow 120ms ease;
}
.klant-card:hover {
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}
.klant-card__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.klant-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
  box-shadow: 0 1px 2px rgba(13,53,160,.06);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.klant-card__btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}
.klant-card__btn--ghost:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Small × button at the top-right of the klant card to remove the klant. */
.klant-card__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(13,53,160,.06);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
  z-index: 2;
}
.klant-card:hover .klant-card__remove { opacity: 1; }
.klant-card__remove:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
/* When both pill + remove button are visible, give the pill room. */
.klant-card:hover .klant-card__actions { right: 42px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 252, 0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 80px 24px 24px;
  animation: modal-fade 160ms ease;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  width: min(640px, 100%);
  max-height: calc(100vh - 104px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(13, 30, 80, 0.18), 0 4px 16px rgba(13, 30, 80, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 200ms cubic-bezier(.2,.7,.3,1.2);
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 22px;
  background:
    linear-gradient(135deg,
      rgba(27, 199, 173, 0.14) 0%,
      rgba(13, 53, 160, 0.08) 38%,
      rgba(0, 154, 130, 0.09) 70%,
      rgba(230, 0, 126, 0.07) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.modal-card__eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  margin-bottom: 4px;
}
.modal-card__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.modal-card__head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-card__head-icon,
.modal-card__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.modal-card__head-icon:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.modal-card__close:hover {
  background: var(--surface-alt);
  color: var(--ink-900);
}

/* Header action chip (e.g. "Loskoppelen") — pill-shaped ghost with a subtle
   border so it reads as a real button (not a stray text-link), but quiet
   enough to sit next to the title without competing. Hovers danger-tinted. */
.modal-card__head-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.modal-card__head-link svg { color: var(--ink-400); transition: color .12s ease; }
.modal-card__head-link:hover {
  color: var(--danger);
  background: rgba(236, 85, 85, 0.06);
  border-color: rgba(236, 85, 85, 0.35);
}
.modal-card__head-link:hover svg { color: var(--danger); }
.modal-card__head-link:active { transform: scale(0.97); }

/* Neutral variant — same pill, blue-tinted hover instead of red.
   Used for non-destructive open/navigate actions (e.g. "Open volledige artikelkaart"). */
.modal-card__head-link--neutral:hover {
  color: var(--ink-900);
  background: var(--surface-alt);
  border-color: var(--ink-300);
}
.modal-card__head-link--neutral:hover svg { color: var(--ink-900); }

/* Input with an inline action button at the right (e.g. Naam + open-klantkaart) */
.modal-field__input-wrap { position: relative; display: block; width: 100%; }
.modal-field__input-wrap input { width: 100%; padding-right: 40px; }
.modal-field__inline-action {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--ink-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.modal-field__inline-action:hover { color: var(--accent-blue); background: var(--accent-blue-soft); }
.modal-card__body {
  padding: 22px 24px;
  overflow: auto;
  flex: 1;
}
.modal-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-muted);
}

/* ── Catalog overlay ──────────────────────────────────────────────────
   Oversized modal: full-viewport glass backdrop with a centered floating
   card. Reads like our standard modal but at catalog scale. Opened from
   the "Catalogus" button in the inline ArtikelAddRow. */
.catalog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(245, 245, 252, 0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 32px;
  animation: modal-fade 160ms ease;
}
.catalog-overlay__card {
  width: min(1200px, calc(100vw - 64px));
  height: min(820px, calc(100vh - 112px));
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(13, 30, 80, 0.18), 0 4px 16px rgba(13, 30, 80, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 220ms cubic-bezier(.2,.7,.3,1.2);
}
.catalog-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.catalog-overlay__title-block { min-width: 0; }
.catalog-overlay__eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}
.catalog-overlay__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.2px;
}
.catalog-overlay__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.catalog-overlay__close:hover { background: var(--surface-alt); color: var(--ink-900); }

.catalog-overlay__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

.catalog-overlay__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  text-align: center;
}
.catalog-overlay__placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.catalog-overlay__placeholder-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.2px;
}
.catalog-overlay__placeholder-sub {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-500);
}
.catalog-overlay__demo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Order modal — line selection + voorwaarden override before order. */
.order-modal { width: min(620px, 100%); }
.order-section + .order-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.order-section__head {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 10px;
}
/* Header row inside the line list — tri-state checkbox (none/some/all)
   selects/deselects everything. Reads as a list header, not a separate banner. */
.order-line--head {
  background: var(--surface-alt);
  cursor: pointer;
}
.order-line--head:hover { background: var(--surface-alt); }
.order-line--head .order-line__name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.order-line__total--muted {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
}
.order-lines {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.order-lines__empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}
.order-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  background: var(--surface);
  transition: background .12s ease, opacity .12s ease;
}
.order-line:last-child { border-bottom: none; }
.order-line:hover { background: var(--surface-alt); }
.order-line input[type="checkbox"] { margin: 0; cursor: pointer; }
.order-line:not(.is-active) { opacity: 0.55; }
.order-line__main { min-width: 0; }
.order-line__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-line__meta {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.order-line__total {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--ink-500);
}
.order-summary > strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.order-terms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.order-term {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.order-term > span {
  color: var(--ink-500);
  font-weight: 500;
}
.order-term:nth-child(1) { grid-column: 1 / -1; }

.order-supplier-note {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.order-supplier-note > svg { color: var(--ink-400); flex-shrink: 0; margin-top: 2px; }
.order-supplier-note__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.order-supplier-note__text {
  font-size: 12px;
  color: var(--ink-700);
  line-height: 1.5;
}

/* ── FormSelect — custom dropdown for modals (button trigger + popover).
   Replaces native <select> so the option list matches our visual language. */
.form-select { position: relative; }
.form-select__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-900);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.form-select__trigger:hover { border-color: var(--ink-300); }
.form-select.is-open .form-select__trigger,
.form-select__trigger:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(13, 53, 160, 0.1);
}
.form-select__icon {
  flex-shrink: 0;
  color: var(--ink-400);
}
.form-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-select__value.is-placeholder { color: var(--ink-400); }
.form-select__caret {
  flex-shrink: 0;
  color: var(--ink-400);
  transition: transform .15s ease;
}
.form-select.is-open .form-select__caret { transform: rotate(180deg); }
.form-select__menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(13, 30, 80, 0.10), 0 2px 8px rgba(13, 30, 80, 0.04);
  padding: 4px;
  animation: form-select-pop 120ms ease;
}
@keyframes form-select-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-select__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
  transition: background .1s ease;
}
.form-select__option:hover { background: var(--surface-alt); }
.form-select__option.is-active { background: var(--accent-blue-soft); color: var(--accent-blue); }
.form-select__option-label { flex: 1; min-width: 0; }
.form-select__option-sub {
  font-size: 11px;
  color: var(--ink-500);
  margin-left: 8px;
  flex-shrink: 0;
}
.form-select__option.is-active .form-select__option-sub { color: var(--accent-blue); opacity: 0.85; }
.form-select__check { color: var(--accent-blue); flex-shrink: 0; }

/* Sub-text option lives on its own line below the label, when `sub` exists. */
.form-select__option:has(.form-select__option-sub) {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.form-select__option:has(.form-select__option-sub) .form-select__option-sub {
  margin-left: 0;
}

/* ── Send modal (email editor) ──────────────────────────────────────── */
.send-modal { width: min(680px, 100%); }
.send-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.send-field {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.send-field--body {
  grid-template-columns: 80px 1fr;
  align-items: flex-start;
  padding-top: 12px;
  border-bottom: none;
}
.send-field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
}
.send-field__input,
.send-field__textarea {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  padding: 4px 0;
  outline: none;
  width: 100%;
}
.send-field__textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
  min-height: 140px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.send-field__textarea:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}
.send-field__add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--ink-500);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color .12s ease, background .12s ease;
}
.send-field__add:hover { color: var(--ink-900); background: var(--surface-alt); }

.send-attachments {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.send-attachments__head {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.send-attachments__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.send-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-400);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.send-chip:hover { color: var(--ink-700); border-color: var(--ink-300); }
.send-chip svg { color: currentColor; flex-shrink: 0; opacity: 0.85; }
.send-chip.is-active {
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-style: solid;
  color: var(--ink-700);
}
.send-chip.is-active svg { color: var(--ink-400); }
.send-chip__x {
  margin-left: 2px;
  padding: 2px;
  border-radius: 50%;
  width: 15px !important;
  height: 15px !important;
  box-sizing: border-box;
  background: transparent;
}
.send-chip:hover .send-chip__x { background: var(--surface); color: var(--ink-700); }
.send-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-500);
  cursor: pointer;
}
.send-toggle input { margin: 0; }
.send-toggle em { font-style: normal; color: var(--ink-400); }

.send-layout {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.send-layout__head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.send-layout__head svg { color: var(--ink-400); }

/* ── Artikelkaart modal ───────────────────────────────────────────────
   Unified glance + edit modal for any line. ~70% common content (image,
   qty, prijs, korting, totaal, specs); a conditional Configuratie
   section is shown for configurable lines. */
.artikelkaart-modal { width: min(720px, 100%); }
.artikelkaart-head-input {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin-left: -6px;
  font-family: inherit;
  color: var(--ink-900);
  transition: background .12s ease, border-color .12s ease;
}
.artikelkaart-head-input:hover { background: rgba(255,255,255,0.5); }
.artikelkaart-head-input:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--accent-blue);
}
.artikelkaart-head-input--title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.artikelkaart-head-input--meta,
.artikelkaart-head-meta {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 2px;
}
.artikelkaart-price-input {
  width: 110px;
  height: 32px;
  text-align: right;
  font-weight: 600;
  color: var(--ink-900);
}
.artikelkaart-dirty-note {
  font-size: 12px;
  color: var(--ink-500);
  font-style: italic;
  margin-left: 12px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.artikelkaart-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: stretch;
}
.artikelkaart-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--ink-300);
  min-height: 180px;
}
.artikelkaart-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.artikelkaart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-500);
  min-height: 32px;
}
.artikelkaart-summary__row > strong {
  color: var(--ink-900);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.artikelkaart-summary__row--grand {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--ink-700);
}
.artikelkaart-summary__row--grand > strong {
  color: var(--ink-900);
  font-size: 18px;
  font-weight: 700;
}
.artikelkaart-discount {
  width: 72px;
  height: 32px;
  text-align: right;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.artikelkaart-discount:hover { border-color: var(--ink-300); }
.artikelkaart-discount:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(13, 53, 160, 0.1);
}

/* Editable grand total — looks like the bold value, becomes a field on hover/focus.
   Editing back-computes line discount. */
.artikelkaart-total-input {
  width: 140px;
  height: 36px;
  padding: 0 10px;
  text-align: right;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.artikelkaart-total-input:hover {
  border-color: var(--border);
  background: var(--surface);
}
.artikelkaart-total-input:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(13, 53, 160, 0.1);
}

.artikelkaart-config {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.artikelkaart-config__head {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 12px;
}
.artikelkaart-fields {
  display: grid;
  grid-template-columns: 140px 1fr;
  column-gap: 16px;
  row-gap: 10px;
  align-items: center;
}
.artikelkaart-field {
  display: contents;
  font-size: 13px;
}
.artikelkaart-field > span {
  color: var(--ink-500);
  font-weight: 500;
  font-size: 13px;
}
.artikelkaart-select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-900);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa5b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.artikelkaart-select:hover { border-color: var(--ink-300); }
.artikelkaart-select:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(13, 53, 160, 0.1);
}
.artikelkaart-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.artikelkaart-select-wrap > .artikelkaart-select {
  flex: 1;
  width: 100%;
}
.artikelkaart-select--has-dot { padding-left: 34px; }
.artikelkaart-color-dot {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 22, 42, 0.12);
  pointer-events: none;
}

@media (max-width: 560px) {
  .artikelkaart-grid { grid-template-columns: 1fr; }
}

/* Quiet destructive link inside a modal body (e.g. "Klant loskoppelen") —
   bottom of the body, sub-action visual weight, danger color on hover. */
.modal-danger-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
}
.modal-danger-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.modal-danger-link:hover { color: var(--danger); background: rgba(236, 85, 85, 0.08); }

/* Subtle text-link inside a modal foot (e.g. "Open volledige klantkaart") */
.modal-foot__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.modal-foot__link:hover { color: var(--accent-blue); background: var(--accent-blue-soft); }

/* ── Unified Klantkaart modal — search mode ────────────────────────── */
.klantkaart-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0 36px 0 36px;
  margin-bottom: 16px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.klantkaart-search:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1); }
.klantkaart-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
}
.klantkaart-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-400);
  pointer-events: none;
}
.klantkaart-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-400);
  border-radius: var(--radius);
  cursor: pointer;
}
.klantkaart-search__clear:hover { background: var(--surface-alt); color: var(--ink-700); }

/* Prominent "Nieuwe klant aanmaken" action — sits between the search input
   and the results list. Common path for users, so given primary visual weight. */
.klantkaart-create {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-md);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease, transform .08s ease;
}
.klantkaart-create:hover {
  background: var(--surface);
  box-shadow: 0 4px 14px var(--accent-blue-glow);
}
.klantkaart-create:active { transform: scale(0.99); }
.klantkaart-create__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-blue);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.klantkaart-create__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.klantkaart-create__title { font-size: 13px; font-weight: 600; color: var(--accent-blue); }
.klantkaart-create__title em { font-style: normal; font-weight: 700; }
.klantkaart-create__sub { font-size: 11px; font-weight: 500; color: var(--ink-500); }

.klantkaart-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.klantkaart-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 380px;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}
.klantkaart-results__empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--ink-400);
  font-size: 12px;
  font-style: italic;
}
.klantkaart-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease, border-color .12s ease;
}
.klantkaart-result:hover { background: var(--surface-alt); }
.klantkaart-result__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.klantkaart-result__body { flex: 1; min-width: 0; }
.klantkaart-result__name { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.klantkaart-result__address { font-size: 11.5px; color: var(--ink-700); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.klantkaart-result__meta { font-size: 11px; color: var(--ink-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty-state "Klant koppelen" button on the offerte detail — full column width */
.klant-empty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.klant-empty__btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-style: solid;
}
.klant-empty__btn:disabled { cursor: not-allowed; opacity: 0.5; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.modal-field--span {
  grid-column: 1 / -1;
}
.modal-street-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.modal-street-row__name { flex: 1 1 auto; min-width: 0; }
.modal-street-row__num { flex: 0 0 120px; }
.modal-field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
}
.modal-field input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.modal-field input:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(75,99,238,0.16);
}

/* Optional shipping address toggle inside the new-klant grid.
   Collapsed: full-width dashed ghost row inviting expansion.
   Expanded: small section head with a quiet "Verwijderen" link. */
.modal-shipping-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  margin-top: 4px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-500);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.modal-shipping-toggle:hover {
  border-color: var(--ink-300);
  color: var(--ink-900);
  background: var(--surface-alt);
}
.modal-shipping-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.modal-shipping-head__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}
.modal-shipping-head__remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--ink-400);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: color .12s ease, background .12s ease;
}
.modal-shipping-head__remove:hover {
  color: var(--danger);
  background: rgba(236, 85, 85, 0.06);
}

.modal-section {
  margin-top: 22px;
}
.modal-section__head {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.modal-quotes {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.modal-quotes__row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 120ms ease;
}
.modal-quotes__row:last-child { border-bottom: none; }
.modal-quotes__row:hover { background: var(--surface-alt); }
.modal-quotes__id {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--ink-700);
}
.modal-quotes__row strong { color: var(--ink-900); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────
   TWEAKS — Density · Surface · Accent
   ───────────────────────────────────────────────────────────────── */

/* Density — applies to anything that opts in via these vars */
.lt-table tbody td { padding-top: var(--tw-row-pad, 16px); padding-bottom: var(--tw-row-pad, 16px); }
.acc__head { padding: var(--tw-acc-pad, 16px 20px); }
.acc__body { padding: var(--tw-acc-body, 0 20px 18px 20px); }
.detail-grid { gap: var(--tw-list-gap, 24px); }
.side-panel--accordion { font-size: calc(13px * var(--tw-font-scale, 1)); }
.acc__title { font-size: calc(13px * var(--tw-font-scale, 1)); }

/* Surface — Flat */
:root[data-surface="flat"] {
  --bg: #f1f3f8;
}
:root[data-surface="flat"] .detail-card,
:root[data-surface="flat"] .side-panel--accordion,
:root[data-surface="flat"] .lt-table-card,
:root[data-surface="flat"] .kpi-card {
  box-shadow: none;
  background: var(--surface);
}
:root[data-surface="flat"] .totals {
  background: color-mix(in oklch, var(--accent-blue-soft) 50%, var(--surface-alt));
}
:root[data-surface="flat"] .acc__head:hover {
  background: color-mix(in oklch, var(--accent-blue-soft) 30%, var(--surface));
}
:root[data-surface="flat"] .pill,
:root[data-surface="flat"] .chip {
  box-shadow: none;
}

/* Surface — Outlined */
:root[data-surface="outlined"] {
  --bg: #fafbfc;
}
:root[data-surface="outlined"] .detail-card,
:root[data-surface="outlined"] .side-panel--accordion,
:root[data-surface="outlined"] .lt-table-card,
:root[data-surface="outlined"] .kpi-card {
  box-shadow: none;
  border: 1px solid var(--border);
  background: var(--surface);
}
:root[data-surface="outlined"] .totals {
  background: var(--surface);
  border: 1px solid var(--border);
}
:root[data-surface="outlined"] .sidebar {
  border-right: 1px solid var(--border);
}
:root[data-surface="outlined"] .toolbar,
:root[data-surface="outlined"] .lt-table thead {
  border-bottom: 1px solid var(--border);
}

/* Accent — picks up --accent-blue / --accent-blue-soft / --ink-900
   set on :root by applyTweaks(). Selected sidebar item uses these. */

/* ── Topbar right helper (used inside .page__header) ─────────────── */
.topbar__right { display: flex; align-items: center; gap: 8px; position: relative; }


/* ── Minimal ghost icon button — invisible at rest, soft pill on hover ── */
.btn--icon-ghost {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink-500);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .22s ease;
}
.btn--icon-ghost:hover,
.btn--icon-ghost:focus-visible {
  background: white;
  color: var(--accent-blue);
  border-color: var(--border);
  box-shadow: 0 4px 14px var(--accent-blue-glow);
  z-index: 20;
}
.btn--icon-ghost:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}
.btn--icon-ghost > svg { flex: 0 0 auto; }
.btn--icon-ghost:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(13, 53, 160, 0.08);
}
.btn--icon-ghost--made { color: var(--accent-green); }
.btn--icon-ghost--made:hover { color: var(--accent-green); border-color: rgba(0, 154, 130, 0.25); box-shadow: 0 4px 14px rgba(0, 154, 130, 0.15); }

/* Vertical hairline used to separate the utility-icon cluster from the
   commit/primary action in an action bar (drawer head, detail page header).
   Replaces the bare 8px spacer — explicit visual punctuation when icons
   sit next to icons (drawer) or icons next to a text-button (detail). */
.icon-pipe {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.btn--icon[data-tooltip],
.btn--icon-ghost[data-tooltip] {
  position: relative;
}
.btn--icon[data-tooltip]::before,
.btn--icon-ghost[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  width: 8px;
  height: 8px;
  background: var(--ink-900);
  transform: translate(-50%, -2px) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  z-index: 41;
  transition: opacity .14s ease, transform .18s cubic-bezier(.2,.7,.3,1);
}
.btn--icon[data-tooltip]::after,
.btn--icon-ghost[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: var(--ink-900);
  color: white;
  box-shadow: 0 12px 28px rgba(15, 22, 42, 0.20), 0 3px 8px rgba(15, 22, 42, 0.08);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  z-index: 40;
  transition: opacity .14s ease, transform .18s cubic-bezier(.2,.7,.3,1);
}
.btn--icon[data-tooltip]:hover::before,
.btn--icon[data-tooltip]:focus-visible::before,
.btn--icon-ghost[data-tooltip]:hover::before,
.btn--icon-ghost[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}
.btn--icon[data-tooltip]:hover::after,
.btn--icon[data-tooltip]:focus-visible::after,
.btn--icon-ghost[data-tooltip]:hover::after,
.btn--icon-ghost[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.btn-made-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 2px var(--surface);
}

/* History link inside the timeline */
.hist__link {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-blue);
  transition: opacity .12s ease;
}
.hist__link:hover { opacity: 0.75; }

/* ── Customer-facing notes textarea ───────────────────────────────── */
.note-area {
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--surface);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.note-area::placeholder { color: var(--ink-400); }
.note-area:hover { border-color: var(--ink-300); }
.note-area:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

/* ── Visibility hints (Opmerkingen / Notities) ────────────────────── */
.field-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
}
.field-hint svg { width: 13px; height: 13px; flex-shrink: 0; }
.field-hint--positive { color: var(--accent-green); }
.field-hint--positive svg { color: var(--accent-green); }
.field-hint--neutral {
  display: flex;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--ink-500);
}
.field-hint--neutral svg { color: var(--ink-400); }

/* ── Opmerkingen section ──────────────────────────────────────────── */
.opmerkingen { padding-top: 4px; }
.opmerkingen__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.opmerkingen__head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.opmerkingen__tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.opmerkingen__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-400);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color .12s ease, background .12s ease;
}
.opmerkingen__tab svg { color: currentColor; flex-shrink: 0; opacity: 0.8; }
.opmerkingen__tab:hover { color: var(--ink-700); background: var(--surface-alt); }
.opmerkingen__tab.is-active {
  color: var(--ink-900);
  background: var(--surface-alt);
}
.opmerkingen__tab.is-active svg { opacity: 1; }
.opmerkingen__tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  margin-left: 2px;
}

/* ── Inline select / date trigger — looks like editable text + caret ── */
.inline-select-wrap {
  position: relative;
  display: inline-block;
}
.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 8px;
  margin: -4px -8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.inline-select:hover { border-color: var(--border); background: white; }
.inline-select.is-open,
.inline-select:focus-visible {
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 2px rgba(13, 53, 160, 0.1);
  outline: none;
}
.inline-select__caret {
  width: 14px;
  height: 14px;
  color: var(--ink-400);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.inline-select:hover .inline-select__caret,
.inline-select:focus-visible .inline-select__caret,
.inline-select.is-open .inline-select__caret { opacity: 1; }
.inline-select__placeholder { color: var(--ink-400); font-weight: 400; }
.inline-select__placeholder ~ .inline-select__caret { opacity: 1; }

.inline-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  /* Align with the trigger's box edge (which sits 8px left of visible text
     due to .inline-select's padding/negative-margin trick), not the
     wrapper's flow position — otherwise the dropdown lands 8px right of
     the hover/focus border. */
  left: -8px;
  min-width: max(100%, 220px);
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 4px;
  z-index: 30;
}
.inline-select-menu__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--ink-700);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.inline-select-menu__opt:hover,
.inline-select-menu__opt.is-focused { background: var(--surface-alt); }
.inline-select-menu__opt.is-selected { color: var(--accent-blue); font-weight: 500; }
.inline-select-menu__check {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: var(--accent-blue);
}
.inline-select-menu__check--placeholder { visibility: hidden; }

/* ── Calendar popover ─────────────────────────────────────────────── */
.inline-date-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 12px;
  z-index: 30;
  width: 260px;
}
.inline-date-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.inline-date-popover__head span {
  flex: 1;
  text-align: center;
  text-transform: capitalize;
}
.inline-date-popover__nav {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}
.inline-date-popover__nav:hover { background: var(--surface-alt); color: var(--ink-900); }
.inline-date-popover__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.inline-date-popover__weekdays > span {
  text-align: center;
  padding: 4px 0;
}
.inline-date-popover__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.inline-date-popover__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 12px;
  color: var(--ink-700);
  cursor: pointer;
  transition: background 0.1s;
}
.inline-date-popover__day.is-other-month { color: var(--ink-300); }
.inline-date-popover__day:hover { background: var(--surface-alt); }
.inline-date-popover__day.is-today {
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent-blue);
  color: var(--accent-blue);
}
.inline-date-popover__day.is-selected {
  background: var(--accent-blue);
  color: white;
  font-weight: 600;
  box-shadow: none;
}
.inline-date-popover__day.is-selected:hover { background: var(--accent-blue); }

/* ── Artikel-add: Catalogus button + cancellable variant ──────────── */
.artikel-catalogus-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid color-mix(in oklch, var(--accent-blue) 28%, transparent);
  border-radius: var(--radius-md);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.artikel-catalogus-btn svg { width: 15px; height: 15px; flex-shrink: 0; color: currentColor; }
.artikel-catalogus-btn:hover {
  background: color-mix(in oklch, var(--accent-blue-soft) 70%, var(--accent-blue) 30%);
  border-color: color-mix(in oklch, var(--accent-blue) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.artikel-add--cancellable { grid-template-columns: 1fr auto auto; }
.artikel-add__cancel {
  width: 32px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
}
.artikel-add__cancel:hover { color: var(--danger); background: var(--surface-alt); }

/* ── Catalog placeholder body ─────────────────────────────────────── */
.catalog-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}
.catalog-placeholder__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  display: grid;
  place-items: center;
}
.catalog-placeholder__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}
.catalog-placeholder__sub {
  font-size: 13px;
  color: var(--ink-500);
  max-width: 440px;
  line-height: 1.5;
}

/* ── Item-row remove button (just outside the right edge, hover-revealed) ── */
.item-remove-btn {
  position: absolute;
  top: 50%;
  right: -28px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-400);
  border-radius: var(--radius);
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.items-row:hover .item-remove-btn { opacity: 1; }
.item-remove-btn:hover { background: rgba(236, 85, 85, 0.1); color: var(--danger); }

/* ── Item name row — name + open button ───────────────────────────── */
.item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}
.item-name-row .item-name { margin-bottom: 0; min-width: 0; }

/* ── Config summary line below the product code ───────────────────── */
.item-config-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-blue);
  min-width: 0;
  max-width: 100%;
}
.item-config-summary--empty {
  color: var(--ink-400);
  font-style: italic;
}
.item-config-summary__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.item-config-summary__more {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  font-style: normal;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.item-config-summary__more:hover { color: var(--ink-900); }

.item-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--ink-400);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.items-row:hover .item-open-btn,
.item-open-btn:focus-visible { opacity: 1; }
.item-open-btn:hover { color: var(--accent-blue); background: var(--accent-blue-soft); }

/* ── Wider modal for product details ──────────────────────────────── */
.modal-card--wide { width: min(880px, 100%); }

/* ── Product detail modal ─────────────────────────────────────────── */
.product-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .product-modal-grid { grid-template-columns: 1fr; }
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f4f6f9 0%, #eaeef6 100%);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: #c8d0e0;
}

.product-config {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: var(--surface-muted);
  border-radius: var(--radius-lg);
}
.product-config__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-config__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}
.product-config__hint {
  font-size: 12px;
  color: var(--ink-700);
}

.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 0 var(--accent-blue);
  transition: box-shadow 0.15s, transform 0.1s;
}
.color-swatch:hover { transform: scale(1.06); }
.color-swatch.is-selected {
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--accent-blue);
}

.config-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.config-select:focus-visible {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-soft);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  width: fit-content;
}
.qty-stepper__btn {
  width: 36px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--ink-700);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}
.qty-stepper__btn:hover { background: var(--surface-alt); }
.qty-stepper__btn:disabled { color: var(--ink-300); cursor: not-allowed; background: transparent; }
.qty-stepper__value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.product-price-summary {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-500);
}
.product-price-row > strong {
  color: var(--ink-700);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.product-price-row--grand {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--ink-700);
}
.product-price-row--grand > strong {
  color: var(--ink-900);
  font-size: 18px;
  font-weight: 700;
}

/* ── Quick-view drawer (single-click on row) ──────────────────────── */
/* The drawer sits BELOW the topbar so the global Assist button stays
   accessible. Top offset = topbar height (56px). */
.drawer-overlay {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(245, 245, 252, 0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 25;
  animation: drawer-overlay-in 0.18s ease;
}
@keyframes drawer-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  height: calc(100vh - 56px);
  width: min(780px, 100vw);
  background: var(--bg);
  z-index: 26;
  box-shadow: -12px 0 40px rgba(15, 22, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.28s cubic-bezier(.2,.7,.3,1);
}
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  flex-shrink: 0;
}
.drawer__head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 36px 48px;
}
.drawer--view .drawer__body { padding-bottom: 0; }

.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
/* Ghost-text close — no chrome at rest, soft fill on hover. The bottom bar
   stays present (the primary CTA needs a home) but quieter so the paper
   keeps the visual weight. */
.drawer__footer-close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-500);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.drawer__footer-close:hover {
  background: color-mix(in oklch, var(--bg) 54%, white);
  color: var(--ink-900);
}
.drawer__footer-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-blue);
  color: white;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.drawer__footer-open:hover { background: var(--ink-900); }
.drawer__footer-open:active { transform: translateY(1px); }

/* Paper quote — looks like an actual printed quote */
.paper-quote {
  background: white;
  padding: 48px 52px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(15, 22, 42, 0.08), 0 1px 3px rgba(15, 22, 42, 0.04);
  font-size: 12px;
  color: var(--ink-700);
  line-height: 1.5;
  cursor: pointer;
  outline: none;
  transition: transform 0.22s cubic-bezier(.2,.7,.3,1), box-shadow 0.22s ease;
}
.paper-quote--hovered {
  transform: translateY(-5px);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--accent-blue) 12%, transparent),
    0 20px 48px rgba(13, 53, 160, 0.10),
    0 4px 10px rgba(15, 22, 42, 0.05);
}


.paper-quote__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.paper-quote__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.2px;
}
.paper-quote__sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-500);
}

.paper-quote__divider {
  height: 1px;
  background: var(--border-line);
  border: 0;
  margin: 24px 0;
}

.paper-quote__label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-900);
  margin-bottom: 12px;
}

.paper-quote__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.paper-quote__line { font-size: 12px; line-height: 1.55; }
.paper-quote__line--strong {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink-700);
}

.paper-quote__dl { margin: 0; }
.paper-quote__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
}
.paper-quote__row + .paper-quote__row { margin-top: 6px; }
.paper-quote__row dt {
  flex: 0 0 110px;
  color: var(--ink-500);
}
.paper-quote__row dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink-700);
}

/* Order banner — sticky strip just above the drawer footer when an order
   has been generated from the offerte. Clickable, navigates to the order.
   Neutral treatment: --surface-alt body with a small green dot for the
   "linked record" signal — same restraint the system uses elsewhere. */
.drawer__order-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-soft);
  color: var(--ink-700);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease;
}
.drawer__order-banner:hover { background: var(--surface-muted); }
.drawer__order-banner__icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer__order-banner__icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 2px var(--surface-alt);
}
.drawer__order-banner__body { flex: 1; min-width: 0; }
.drawer__order-banner__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.drawer__order-banner__meta {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.drawer__order-banner__status { color: var(--ink-700); font-weight: 500; }
.drawer__order-banner__chevron { color: var(--ink-400); flex-shrink: 0; }
.drawer__order-banner:hover .drawer__order-banner__chevron { color: var(--ink-700); }

.paper-quote__items-head {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 60px 90px 100px;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-line);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-500);
}
.paper-quote__items-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 60px 90px 100px;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-line);
  align-items: start;
}
.paper-quote__items-row:last-of-type { border-bottom: none; }

.paper-quote__num,
.paper-quote__price,
.paper-quote__total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.paper-quote__total { font-weight: 600; color: var(--ink-700); }
.paper-quote__item-name {
  font-weight: 600;
  color: var(--ink-700);
  font-size: 13px;
}
.paper-quote__item-meta {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.paper-quote__empty {
  padding: 24px 0;
  text-align: center;
  color: var(--ink-400);
  font-style: italic;
}

.paper-quote__totals {
  margin-top: 22px;
  margin-left: auto;
  width: 280px;
  background: linear-gradient(135deg, rgba(13, 53, 160, 0.04) 0%, rgba(0, 154, 130, 0.04) 100%);
  padding: 16px 18px;
  border-radius: var(--radius-md);
}
.paper-quote__totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-500);
  padding: 4px 0;
}
.paper-quote__totals-row > span:last-child {
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.paper-quote__totals-row--strong { color: var(--ink-700); font-weight: 500; }
.paper-quote__totals-row--strong > span:last-child { color: var(--ink-700); font-weight: 600; }
.paper-quote__totals-row--discount > span:last-child {
  color: var(--ink-500);
  font-weight: 500;
}
.paper-quote__totals-row--grand {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(13, 53, 160, 0.16);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-blue);
}
.paper-quote__totals-row--grand > span:last-child {
  color: var(--accent-blue);
  font-weight: 700;
}

.paper-quote__files {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.paper-quote__file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}
.paper-quote__file-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.paper-quote__file-name { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.paper-quote__file-meta { font-size: 11px; color: var(--ink-500); margin-top: 2px; }
.paper-quote__notes {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-700);
  white-space: pre-wrap;
}
.paper-quote__notes--empty { color: var(--ink-400); }

/* ── Page subtitle (count) ──────────────────────────────────────── */
.page__subtitle {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 4px;
}

/* ── Table styling refinements ──────────────────────────────────── */
.lt-table thead th.lt-table__num,
.lt-table td.lt-table__num { text-align: right; }

.lt-table td.lt-table__id {
  font-weight: 600;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
}
.lt-table__id-main { font-weight: 600; color: var(--accent-blue); }
.lt-table__id-sub  { font-size: 11px; font-weight: 400; color: var(--ink-500); margin-top: 2px; letter-spacing: 0; }

/* Klant cell — clickable, opens klantkaart. Two-line layout: name + address. */
.lt-table__klant-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: var(--radius);
  transition: color .12s ease;
}
.lt-table__klant-btn:hover .lt-table__klant-name { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 2px; }
.lt-table__klant-name { font-weight: 600; color: var(--ink-900); display: inline-flex; align-items: center; gap: 6px; }
.lt-table__klant-icon {
  color: var(--ink-400);
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
  flex-shrink: 0;
}
.lt-table tbody tr:hover .lt-table__klant-icon,
.lt-table__klant-btn:hover .lt-table__klant-icon { opacity: 1; color: var(--accent-blue); }
.lt-table__klant-sub  { font-size: 11px; font-weight: 400; color: var(--ink-500); }
.lt-table td.lt-table__strong {
  font-weight: 600;
  color: var(--ink-900);
}
.lt-table td.lt-table__amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-900);
}
.lt-table td.cell-muted {
  color: var(--ink-500);
  font-size: 12px;
}

/* Detail page header — actions reserve same column width as side panel */
.page__header--detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: center;
}
.page__header--detail .crumb { justify-self: start; }
.page__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
@media (max-width: 1200px) {
  .page__header--detail {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* ────────────────────────────────────────────────────────
   .lt-detail-page — softer hover/focus voor inline editors op
   "paper canvas" detail-pagina's.
   Elke editable inline (InlineSelect, InlineCombo, OrderSearch /
   BetreftSearch) deelt deze treatment:
     • rest  — geen border
     • hover — background: surface-alt, border blijft transparant
     • focus — background: surface, soft accent-blue ring (geen harde border)
   Selects/combos houden hun chevron als affordance. Modules opt-in door
   de class op het root .page element te zetten (bv. service-detail en
   planning-detail). Offerte-detail gebruikt nog de oude bordered look. */
.lt-detail-page .inline-select,
.lt-detail-page .inline-combo,
.lt-detail-page .svc-order-search__field {
  border-color: transparent;
}
.lt-detail-page .inline-select:hover,
.lt-detail-page .inline-combo:hover,
.lt-detail-page .svc-order-search__field:hover {
  background: var(--surface-alt);
  border-color: transparent;
  box-shadow: none;
}
.lt-detail-page .inline-select.is-open,
.lt-detail-page .inline-select:focus-visible,
.lt-detail-page .inline-combo:focus-within,
.lt-detail-page .svc-order-search__field:focus-within {
  background: var(--surface);
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent-blue-soft);
  outline: none;
}

/* ===== Old UI placeholder (shown when "Nieuwe weergave" is uitgeschakeld) ===== */
.old-ui {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  height: 100%;
  min-height: 100%;
}
.old-ui__bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.old-ui__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.old-ui__btn--ghost {
  background: var(--surface);
  color: var(--ink-700);
  border-color: var(--border-line);
}
.old-ui__btn--ghost:hover,
.old-ui__btn--ghost.is-active {
  background: var(--surface-alt);
}
.old-ui__btn--primary {
  background: #5cb85c;
  color: #fff;
}
.old-ui__btn--primary:hover { background: #4ca64c; }
.old-ui__canvas {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  min-height: 480px;
}

.old-ui__canvas { display: flex; align-items: center; justify-content: center; }
.old-ui__placeholder { text-align: center; color: var(--ink-400); padding: 24px; }
.old-ui__placeholder-title { font: 600 16px/1.3 var(--font-display); color: var(--ink-500); margin-bottom: 6px; }
.old-ui__placeholder-sub { font-size: 13px; color: var(--ink-400); }

/* Section keyboard navigation in offerte detail (↑/↓ tussen secties) */
.off-detail-page [data-kbd-section] {
  position: relative;
  border-radius: 6px;
  transition: box-shadow 120ms ease, background 120ms ease;
}
html[data-input-modality="keyboard"] .off-detail-page [data-kbd-section]:focus-within {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-blue, #2563eb);
}
.off-detail-page .page__header-actions[data-kbd-section]:focus-within {
  box-shadow: none;
}

/* Article rows are keyboard-selectable sections */
.items-row[tabindex] { outline: none; }
html[data-input-modality="keyboard"] .items-row[tabindex]:focus-visible,
html[data-input-modality="keyboard"] .items-row[data-kbd-section]:focus-within {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-blue, #2563eb);
  border-radius: 6px;
}

/* Aantal-cel: nummer + eenheid op één regel, eenheid direct achter het cijfer */
.cell-edit--qty {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}
.cell-edit--qty:hover, .cell-edit--qty:focus-visible { background: transparent; border: 0; box-shadow: none; }
.cell-edit--qty-input {
  width: auto;
  min-width: 36px;
  max-width: 60px;
  flex: 0 1 auto;
  text-align: right;
}
.cell-edit__unit {
  color: var(--ink-500);
  font-size: 12px;
  white-space: nowrap;
}
.cell-edit--readonly { white-space: nowrap; }

/* ===== View drawer — snelle acties (quick actions) menu ===== */
.drawer--view .drawer__head { display: none; }
.drawer--view .drawer__body {
  padding-top: 36px;
  display: flex;
  flex-direction: column;
}
.drawer--view .paper-quote {
  position: relative;
  padding-top: 32px;
  cursor: default;
  flex: 1 0 auto;
  min-height: calc(100% + 80px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.drawer--view .paper-quote__head { align-items: center; gap: 16px; }

.drawer--view .paper-quote__head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.drawer--view .paper-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  order: 2;
}
.drawer--view .paper-quote__head-right > .pill { order: 1; }
.paper-quick-actions .btn--icon-ghost {
  background: transparent;
  color: var(--ink-400, #64748b);
  transition: background-color 120ms ease, color 120ms ease;
}
.paper-quick-actions .btn--icon-ghost:hover,
.paper-quick-actions .btn--icon-ghost.is-active {
  background: rgba(7, 27, 85, .05);
  color: var(--accent-blue, #0d35a0);
}

.quick-actions-glass {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,.42));
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  animation: quickActionsGlassIn 220ms ease-out;
}
@keyframes quickActionsGlassIn { from { opacity: 0; } to { opacity: 1; } }

.drawer--view .quick-actions-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: quickActionsPanelIn 240ms cubic-bezier(.2,.8,.2,1);
}
@keyframes quickActionsPanelIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes paperQuoteOut {
  0%   { opacity: 1; transform: translateX(0)    rotate(0)       scale(1); }
  10%  { opacity: 1; transform: translateX(-6px) rotate(-1.2deg) scale(1); }
  22%  { opacity: 1; transform: translateX(6px)  rotate(1.2deg)  scale(1); }
  34%  { opacity: 1; transform: translateX(-4px) rotate(-.8deg)  scale(1); }
  46%  { opacity: 1; transform: translateX(4px)  rotate(.8deg)   scale(1); }
  55%  { opacity: 1; transform: translateX(0)    rotate(0)       scale(1); }
  100% { opacity: 0; transform: translateX(0)    rotate(0)       scale(.85); }
}
.drawer--view .paper-quote--deleting {
  animation: paperQuoteOut 520ms cubic-bezier(.2,.8,.2,1) forwards;
  transform-origin: center center;
  pointer-events: none;
}

.quick-actions-panel .a4-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink-900, #0b1b4d);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 140ms ease;
}
.quick-actions-panel .a4-btn svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--ink-500, #64748b); }
.quick-actions-panel .a4-btn:hover { background: rgba(7, 27, 85, .045); }
.quick-actions-panel .a4-btn:focus { outline: none; }
.quick-actions-panel .a4-btn:focus-visible {
  outline: none;
  background: color-mix(in oklch, var(--accent-blue, #0d35a0) 7%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--accent-blue, #0d35a0) 35%, transparent);
  border-radius: 10px;
}
.quick-actions-panel .a4-btn--danger:focus-visible {
  background: color-mix(in oklch, var(--danger, #dc2626) 7%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--danger, #dc2626) 35%, transparent);
}
.quick-actions-panel .a4-btn__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.quick-actions-panel .a4-btn__title {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  color: var(--ink-900, #0b1b4d);
  letter-spacing: -0.01em;
}
.quick-actions-panel .a4-btn__sub {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-500, #64748b);
}
.quick-actions-panel .a4-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(7, 27, 85, .08);
}
.quick-actions-panel .a4-btn--danger,
.quick-actions-panel .a4-btn--danger .a4-btn__title,
.quick-actions-panel .a4-btn--danger .a4-btn__sub { color: var(--danger, #dc2626); }
.quick-actions-panel .a4-btn--danger svg { color: var(--danger, #dc2626); }
.quick-actions-panel .a4-btn--danger:hover { background: rgba(220, 38, 38, .07); }
