/* Generated by scripts/flow-theme.ts from @flowpostproduction/design@0.9.0
   (dist/theme.css + dist/motion.css, vendored in vendor/flow-design-system/0.9.0).
   Do not edit by hand. Light and dark follow prefers-color-scheme. */

:root {
  --radius: 0.625rem;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --card: #ffffff;
  --card-foreground: #151515;
  --popover: #ffffff;
  --popover-foreground: #151515;
  --primary: #151515;
  --primary-foreground: #f5f5f5;
  --secondary: #e3e1e8;
  --secondary-foreground: #151515;
  --muted: #ececec;
  --muted-foreground: #666666;
  --accent: #e3e1e8;
  --accent-foreground: #151515;
  --destructive: #c10009;
  --border: #e0e0e0;
  --input: #8a8a8a;
  --ring: #078c9a;
  --chart-1: #078c9a;
  --chart-2: #e0282e;
  --chart-3: #3b64d6;
  --chart-4: #a87300;
  --chart-5: #c2459e;
  --sidebar: #ffffff;
  --sidebar-foreground: #151515;
  --sidebar-primary: #151515;
  --sidebar-primary-foreground: #f5f5f5;
  --sidebar-accent: #ececec;
  --sidebar-accent-foreground: #151515;
  --sidebar-border: #e0e0e0;
  --sidebar-ring: #078c9a;
  --background: #f5f5f5;
  --foreground: #151515;
  --success: #0b7030;
  --warning: #8f5400;
  --info: #05707c;
  --proposal: #6a3fd0;
  --brand: #078c9a;
  --flow-duration-instant: 0ms;
  --flow-duration-fast: 150ms;
  --flow-duration-base: 200ms;
  --flow-duration-slow: 300ms;
  --flow-duration-slower: 500ms;
  --flow-duration-progress: 1000ms;
  --flow-duration-spin: 2000ms;
  --flow-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --flow-ease-enter: cubic-bezier(0.215, 0.61, 0.355, 1);
  --flow-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --flow-distance-sm: 4px;
  --flow-distance-md: 8px;
  --flow-distance-lg: 16px;
  --flow-scale-enter: 0.98;
  --flow-stagger: 40ms;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
  --font-sans: var(--font-montserrat), sans-serif;
  --font-heading: var(--font-sans);
  --font-display: var(--font-montserrat), sans-serif;
  --font-mono: var(--font-flow-mono), ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --background: #0a0a0a;
    --foreground: #f5f5f5;
    --card: #1d1d1d;
    --card-foreground: #f5f5f5;
    --popover: #1d1d1d;
    --popover-foreground: #f5f5f5;
    --primary: #f5f5f5;
    --primary-foreground: #151515;
    --secondary: #2a2a2e;
    --secondary-foreground: #f5f5f5;
    --muted: #262626;
    --muted-foreground: #8c8c8c;
    --accent: #262626;
    --accent-foreground: #f5f5f5;
    --destructive: #ff7979;
    --border: oklch(1 0 0 / 15%);
    --input: oklch(1 0 0 / 35%);
    --ring: #74f8fc;
    --chart-1: #0f9fae;
    --chart-2: #e0393f;
    --chart-3: #4870dc;
    --chart-4: #b98100;
    --chart-5: #c4519c;
    --sidebar: #000000;
    --sidebar-foreground: #d4d4d4;
    --sidebar-primary: #f5f5f5;
    --sidebar-primary-foreground: #151515;
    --sidebar-accent: #1f1f1f;
    --sidebar-accent-foreground: #f5f5f5;
    --sidebar-border: oklch(1 0 0 / 8%);
    --sidebar-ring: #74f8fc;
    --success: oklch(0.723 0.219 149.579);
    --warning: #f2a93b;
    --info: #74f8fc;
    --proposal: #b69cff;
    --brand: #74f8fc;
  }
}
  :root:where([data-theme="dark"]) {
    --background: #0a0a0a;
    --foreground: #f5f5f5;
    --card: #1d1d1d;
    --card-foreground: #f5f5f5;
    --popover: #1d1d1d;
    --popover-foreground: #f5f5f5;
    --primary: #f5f5f5;
    --primary-foreground: #151515;
    --secondary: #2a2a2e;
    --secondary-foreground: #f5f5f5;
    --muted: #262626;
    --muted-foreground: #8c8c8c;
    --accent: #262626;
    --accent-foreground: #f5f5f5;
    --destructive: #ff7979;
    --border: oklch(1 0 0 / 15%);
    --input: oklch(1 0 0 / 35%);
    --ring: #74f8fc;
    --chart-1: #0f9fae;
    --chart-2: #e0393f;
    --chart-3: #4870dc;
    --chart-4: #b98100;
    --chart-5: #c4519c;
    --sidebar: #000000;
    --sidebar-foreground: #d4d4d4;
    --sidebar-primary: #f5f5f5;
    --sidebar-primary-foreground: #151515;
    --sidebar-accent: #1f1f1f;
    --sidebar-accent-foreground: #f5f5f5;
    --sidebar-border: oklch(1 0 0 / 8%);
    --sidebar-ring: #74f8fc;
    --success: oklch(0.723 0.219 149.579);
    --warning: #f2a93b;
    --info: #74f8fc;
    --proposal: #b69cff;
    --brand: #74f8fc;
  }


.font-display {
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking, normal);
}

@media (pointer: coarse) {
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 1.25rem;
    min-height: 1.25rem;
  }
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.text-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.text-kpi {
  font-family: var(--font-montserrat), sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

@keyframes flow-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

@keyframes flow-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
  }

@keyframes flow-slide-up {
    from { opacity: 0; transform: translateY(var(--flow-distance-md)); }
    to { opacity: 1; transform: translateY(0); }
  }

@keyframes flow-scale-in {
    from { opacity: 0; transform: scale(var(--flow-scale-enter)); }
    to { opacity: 1; transform: scale(1); }
  }

@keyframes flow-spin {
    to { transform: rotate(360deg); }
  }

@media (prefers-reduced-motion: reduce) {
  :root {
    --flow-duration-instant: 0ms;
    --flow-duration-fast: 0ms;
    --flow-duration-base: 0ms;
    --flow-duration-slow: 0ms;
    --flow-duration-slower: 0ms;
    --flow-duration-progress: 0ms;
    --flow-duration-spin: 0ms;
    --flow-distance-sm: 0px;
    --flow-distance-md: 0px;
    --flow-distance-lg: 0px;
    --flow-scale-enter: 1;
    --flow-stagger: 0ms;
  }
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* FlowOS · Flow design system components in plain CSS.
   Follows the shadcn radix-nova look of @flowpostproduction/design@0.9.0
   (Button, Input, NativeSelect, Card, Table, Badge, Alert, Empty, Sidebar).
   Only design tokens from theme.generated.css: no palette colours, no hex.
   Served after theme.generated.css as /flow.css. */

/* Fonts: the files that next/font/google serves for the Flow theme, self-hosted. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("/flow/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("/flow/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/flow/fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/flow/fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* next/font sets these variables in the React apps. */
  --font-montserrat: "Montserrat";
  --font-flow-mono: "Geist Mono";
  --sidebar-width: 15rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
  }
}
  :root:where([data-theme="dark"]) {
    color-scheme: dark;
  }


/* Base (the theme's @layer base, plus a minimal reset). */
*,
::before,
::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
  outline-color: var(--ring);
}
html {
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.flow {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.flow :where(h1, h2, h3, p, ul, fieldset, figure) {
  margin: 0;
}
.flow :where(fieldset) {
  padding: 0;
  min-width: 0;
}
.flow :where(a) {
  color: inherit;
  text-decoration: none;
}
.flow :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
.flow :where(button, summary, select, label:has(input[type="checkbox"])) {
  cursor: pointer;
}
.flow :where(img, svg) {
  display: block;
}
.flow :where(small) {
  font-size: 0.75rem;
}
/* One focus style, at full strength (design system 0.9.0: the half-opacity
   ring was about 1.8:1; WCAG 1.4.11 asks 3:1). */
.flow :focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.mono {
  font-family: var(--font-mono);
}
.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.flow-muted {
  color: var(--muted-foreground);
}

/* Skip link */
.flow-skip {
  position: fixed;
  top: -5rem;
  left: 0.5rem;
  z-index: 50;
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--popover-foreground);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 0 0 1px var(--border);
}
.flow-skip:focus {
  top: 0.5rem;
}

/* Brand: FLOW wordmark (currentColor) + product name. */
.flow-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  color: var(--foreground);
}
.flow-wordmark {
  height: 1rem;
  width: auto;
}
.flow-brand-name {
  font-size: 1.125rem;
  line-height: 1.2;
}

/* App shell: sidebar + content. */
.flow-shell {
  display: flex;
  min-height: 100vh;
}
/* The column paints the sidebar for the full page height; the aside sticks. */
.flow-sidebar-column {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
}
.flow-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100vh;
  overflow-y: auto;
  padding: 0.75rem;
  color: var(--sidebar-foreground);
}
.flow-sidebar > .flow-brand {
  padding: 0.25rem 0.5rem 0;
}
.flow-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.flow-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.flow-nav-group > .text-eyebrow {
  padding: 0.5rem 0.5rem 0.25rem;
  color: var(--muted-foreground);
}
.flow-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 2rem;
  padding: 0 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
  color: color-mix(in oklab, var(--sidebar-foreground) 80%, transparent);
  transition: background-color var(--flow-duration-fast) var(--flow-ease-standard),
    color var(--flow-duration-fast) var(--flow-ease-standard);
}
.flow-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-nav-item:hover,
.flow-nav-item[aria-current="page"] {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}
.flow-nav-item:focus-visible {
  outline: 2px solid var(--sidebar-ring);
  outline-offset: 0;
}
.flow-sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}
.flow-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
}
.flow-account form {
  margin-left: auto;
}
.flow-account-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.flow-account-name strong,
.flow-account-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-account-name strong {
  font-weight: 500;
}
.flow-account-name small {
  color: var(--muted-foreground);
}
.flow-account-name:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.flow-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
}
.flow-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.flow-topbar {
  display: none;
}
.flow-main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Mobile: the sidebar becomes a top bar with a menu (details, no JS). */
@media (max-width: 767px) {
  .flow-sidebar-column {
    display: none;
  }
  .flow-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
  }
  .flow-topbar .flow-brand {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  .flow-topbar .flow-brand-name {
    font-size: 1rem;
  }
  .flow-main {
    padding: 1.25rem 1rem 2.5rem;
    gap: 1.25rem;
  }
}
.flow-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  font-weight: 500;
  list-style: none;
}
.flow-menu > summary::-webkit-details-marker {
  display: none;
}
.flow-menu[open] > summary {
  background: var(--muted);
}
.flow-menu-panel {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: calc(100% + 0.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow:
    0 0 0 1px var(--border),
    0 10px 30px -10px color-mix(in oklab, var(--foreground) 25%, transparent);
  animation: flow-scale-in var(--flow-duration-base) var(--flow-ease-enter) both;
}
.flow-menu-panel .flow-account {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Page header: eyebrow + display title. */
.flow-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.flow-page-header .text-eyebrow {
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.flow-page-header h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  line-height: 1.15;
}
.flow-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.flow-footnote {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

/* Card */
.card,
.management-section,
.manage-editor,
.review-card,
.management-main > section#editor {
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent);
}
.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1rem 0;
}
.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
}
.card-header p {
  color: var(--muted-foreground);
}

/* Buttons: primary is black/white, the rest outline or ghost. */
.flow .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--flow-duration-fast) var(--flow-ease-standard),
    color var(--flow-duration-fast) var(--flow-ease-standard),
    border-color var(--flow-duration-fast) var(--flow-ease-standard);
}
.flow .button:hover {
  background: var(--muted);
}
.flow .button:active {
  transform: translateY(1px);
}
.flow .button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-color: var(--ring);
}
.flow .button:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.flow .button.primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
}
.flow .button.primary:hover {
  background: color-mix(in oklab, var(--primary) 80%, transparent);
}
.flow .button.ghost {
  border-color: transparent;
  background: transparent;
}
.flow .button.ghost:hover {
  background: var(--muted);
}
.flow .button.small {
  height: 2rem;
  padding: 0 0.625rem;
  font-size: 0.8125rem;
}
.flow .button.large {
  height: 2.5rem;
  padding: 0 1rem;
}
.flow .button.full {
  width: 100%;
}
.flow .button.icon-only {
  width: 2rem;
  height: 2rem;
  padding: 0;
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .flow .button:not(.primary):not(.ghost) {
    border-color: var(--input);
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }
  :where(:root:not([data-theme="light"])) .flow .button:not(.primary):not(.ghost):hover {
    background: color-mix(in oklab, var(--input) 50%, transparent);
  }
}
  :where(:root[data-theme="dark"]) .flow .button:not(.primary):not(.ghost) {
    border-color: var(--input);
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }
  :where(:root[data-theme="dark"]) .flow .button:not(.primary):not(.ghost):hover {
    background: color-mix(in oklab, var(--input) 50%, transparent);
  }


/* Badge: status always with icon and label. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  height: 1.375rem;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge .icon {
  width: 0.75rem;
  height: 0.75rem;
}
.badge-default {
  background: var(--primary);
  color: var(--primary-foreground);
}
.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.badge-outline {
  border-color: var(--border);
  color: var(--muted-foreground);
}
.badge-success {
  background: color-mix(in oklab, var(--success) 10%, transparent);
  color: var(--success);
}
.badge-info {
  background: color-mix(in oklab, var(--info) 10%, transparent);
  color: var(--info);
}
.badge-warning {
  background: color-mix(in oklab, var(--warning) 10%, transparent);
  color: var(--warning);
}
.badge-destructive {
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .badge-success {
    background: color-mix(in oklab, var(--success) 20%, transparent);
  }
  :where(:root:not([data-theme="light"])) .badge-info {
    background: color-mix(in oklab, var(--info) 20%, transparent);
  }
  :where(:root:not([data-theme="light"])) .badge-warning {
    background: color-mix(in oklab, var(--warning) 20%, transparent);
  }
  :where(:root:not([data-theme="light"])) .badge-destructive {
    background: color-mix(in oklab, var(--destructive) 20%, transparent);
  }
}
  :where(:root[data-theme="dark"]) .badge-success {
    background: color-mix(in oklab, var(--success) 20%, transparent);
  }
  :where(:root[data-theme="dark"]) .badge-info {
    background: color-mix(in oklab, var(--info) 20%, transparent);
  }
  :where(:root[data-theme="dark"]) .badge-warning {
    background: color-mix(in oklab, var(--warning) 20%, transparent);
  }
  :where(:root[data-theme="dark"]) .badge-destructive {
    background: color-mix(in oklab, var(--destructive) 20%, transparent);
  }


/* Alert */
.flow-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  line-height: 1.45;
}
.flow-alert > .icon {
  margin-top: 0.125rem;
  color: var(--muted-foreground);
}
.flow-alert-warning > .icon {
  color: var(--warning);
}
.flow-alert-destructive {
  color: var(--destructive);
  border-color: color-mix(in oklab, var(--destructive) 30%, transparent);
}
.flow-alert-destructive > .icon {
  color: var(--destructive);
}

/* Empty state */
.flow-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
}
.flow-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
}
.flow-empty-title {
  color: var(--foreground);
  font-weight: 500;
}
.flow .empty {
  padding: 2rem 1.5rem;
  color: var(--muted-foreground);
}

/* Fields: clear border, padding, label close to the value. */
.flow :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]), select) {
  display: block;
  width: 100%;
  min-width: 0;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 400;
  transition: border-color var(--flow-duration-fast) var(--flow-ease-standard),
    box-shadow var(--flow-duration-fast) var(--flow-ease-standard);
}
.flow :where(input, select)::placeholder {
  color: var(--muted-foreground);
}
/* Outline, not a transitioned box-shadow: the ring is there the moment the
   field has focus. */
.flow :where(input, select):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-color: var(--ring);
}
.flow input[readonly] {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: default;
}
.flow input:user-invalid {
  border-color: var(--destructive);
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .flow :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select) {
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }
}
  :where(:root[data-theme="dark"]) .flow :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select) {
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }

.flow select {
  appearance: none;
  padding-right: 2rem;
}
.flow select option {
  background: var(--popover);
  color: var(--popover-foreground);
}
.select-wrap {
  position: relative;
  display: block;
}
.select-chevron {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}
.flow input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}
.flow input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}
.flow input[type="file"] {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.flow input[type="file"]::file-selector-button {
  height: 2rem;
  margin-right: 0.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

/* Forms (shared by profile and management). */
.manage-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  padding: 1rem;
}
.manage-form > label,
.manage-editor-body > form > label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  font-weight: 500;
}
.manage-form > :is(fieldset, details, .flow-alert, p, .form-actions, .manage-confirm, ul),
.manage-form > button {
  grid-column: 1 / -1;
}
.manage-form > button {
  justify-self: start;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.manage-form .form-actions {
  padding-top: 0.25rem;
}
.field-help {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.cap-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.25rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cap-options legend {
  padding: 0 0.375rem;
  font-weight: 600;
}
.cap-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.25rem 0.375rem;
  border-radius: calc(var(--radius) - 4px);
  font-weight: 400;
}
.cap-options label:hover {
  background: var(--muted);
}
.cap-options input:disabled + span {
  color: var(--muted-foreground);
}
.manage-form details.full-width {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.manage-form details.full-width > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-weight: 500;
  list-style: none;
}
.manage-form details.full-width > summary::-webkit-details-marker {
  display: none;
}
.manage-form details.full-width > .manage-form {
  padding: 0 0.75rem 0.75rem;
}
.manage-form > label.manage-confirm,
.manage-confirm {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

/* Management */
.management-main .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1rem 0;
}
.management-main h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.management-main h3 {
  font-size: 0.875rem;
  font-weight: 600;
}
.section-heading > a:not(.button) {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.625rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.section-heading > a:not(.button):hover {
  background: var(--muted);
}
.management-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.management-section > h2 {
  padding: 1rem 1rem 0.75rem;
}
.management-section > .flow-alert {
  margin: 0 1rem 1rem;
}
.management-section > .manage-editor,
.management-section > section.manage-editor {
  margin: 0 1rem 0.75rem;
  box-shadow: none;
  border: 1px solid var(--border);
}
.management-search {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}
.management-search input {
  max-width: 24rem;
}
.flow-table {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
.management-section > .flow-table:last-child {
  border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px);
}
/* Edge-to-edge table, then the blocks below keep the card's 1rem inset and gap. */
.management-section > .flow-table:not(:last-child) {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.management-section > .manage-editor:last-child {
  margin-bottom: 1rem;
}
.section-intro {
  margin: -0.25rem 1rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Systeem → Platformbeheer: every user in one list, rights as badges, edit in the row. */
.platform-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.platform-list > li + li {
  border-top: 1px solid var(--border);
}
.platform-row > summary {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: 3rem;
  padding: 0.625rem 1rem;
  list-style: none;
  cursor: pointer;
}
.platform-row > summary::-webkit-details-marker {
  display: none;
}
.platform-row > summary:hover {
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}
.platform-user {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.platform-rights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.platform-none {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.platform-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
}
.platform-row[open] .summary-chevron {
  transform: rotate(180deg);
}
.platform-row[open] > summary {
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}
.platform-row-body {
  border-top: 1px solid var(--border);
}
.management-section > .platform-list:last-child > li:last-child .platform-row,
.management-section > .platform-list:last-child > li:last-child .platform-row > summary {
  border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px);
}
.flow-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.flow-table th {
  height: 2.5rem;
  padding: 0 1rem;
  text-align: left;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.flow-table td {
  padding: 0.625rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.flow-table tbody tr:last-child td {
  border-bottom: 0;
}
.flow-table tbody tr:nth-child(even):not(.row-empty) {
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}
.flow-table tbody tr:not(.row-empty):hover {
  background: color-mix(in oklab, var(--muted) 80%, transparent);
}
.flow-table td small {
  display: block;
  color: var(--muted-foreground);
}
.flow-table .cell-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.assignment-gap {
  height: 0.375rem;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
}
.pagination span {
  margin-right: auto;
}
.management-main > section#editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  scroll-margin-top: 1rem;
}
.management-main > section#editor > h2 {
  padding: 1rem 1rem 0;
}
.management-main > section#editor > .manage-editor,
.management-main > section#editor > div.manage-editor {
  margin: 0 1rem;
  box-shadow: none;
  border: 1px solid var(--border);
}
div.manage-editor > h3,
div.manage-editor > p,
section.manage-editor > h3,
.management-section > .manage-editor > h3,
.management-section > div.manage-editor > p,
.management-section > div.manage-editor > a {
  margin: 1rem 1rem 0;
}
.management-section > div.manage-editor {
  padding-bottom: 1rem;
}
.management-section > div.manage-editor > a {
  display: inline-flex;
}
div.manage-editor > .button {
  margin: 0 1rem 1rem;
}
div.manage-editor > p:last-child {
  margin-bottom: 1rem;
}
details.manage-editor > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  list-style: none;
  border-radius: inherit;
}
details.manage-editor > summary::-webkit-details-marker {
  display: none;
}
details.manage-editor > summary > span:first-child {
  flex: 1;
  min-width: 0;
}
details.manage-editor > summary:hover {
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}
.summary-chevron {
  color: var(--muted-foreground);
  transition: transform var(--flow-duration-fast) var(--flow-ease-standard);
}
details[open] > summary > .summary-chevron {
  transform: rotate(180deg);
}
details.manage-editor[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.manage-editor-body > p,
.manage-editor-body > .flow-alert {
  margin: 1rem 1rem 0;
}
.manage-editor-body > p:last-child {
  margin-bottom: 1rem;
}
.manage-editor-body .manage-editor {
  margin: 0 1rem 1rem;
  border: 1px solid var(--border);
  box-shadow: none;
}
.manage-editor-body > .manage-form + .manage-form {
  border-top: 1px solid var(--border);
}
.service-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0 1rem 1rem;
  list-style: none;
}
.service-tasks li {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
}
.service-tasks:empty {
  display: none;
}

/* System section tabs */
.system-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 0.25rem;
  border-radius: var(--radius);
  background: var(--muted);
}
.system-nav a {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
  font-weight: 500;
  white-space: nowrap;
}
.system-nav a:hover {
  color: var(--foreground);
}
.system-nav a[aria-current="page"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--foreground) 10%, transparent);
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .system-nav a[aria-current="page"] {
    background: color-mix(in oklab, var(--input) 30%, transparent);
    box-shadow: 0 0 0 1px var(--input);
  }
}
  :where(:root[data-theme="dark"]) .system-nav a[aria-current="page"] {
    background: color-mix(in oklab, var(--input) 30%, transparent);
    box-shadow: 0 0 0 1px var(--input);
  }


/* Company logos (branding.js keeps working on the same elements). */
section.manage-editor {
  padding-bottom: 1rem;
}
section.manage-editor > form {
  max-width: 40rem;
  display: grid;
  gap: 0.875rem;
  padding: 0.75rem 1rem 0;
}
section.manage-editor > form > label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-weight: 500;
}
section.manage-editor > form output {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.suite-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  overflow: hidden;
}
.suite-logo-preview:empty::before {
  content: "Geen logo";
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.suite-logo-preview img {
  max-width: 100%;
  height: auto;
}
.flow p[role="alert"] {
  color: var(--destructive);
  font-weight: 500;
}
.flow p[role="alert"]:empty {
  display: none;
}

/* Review */
.review-card {
  gap: 0;
}
.review-card > .flow-table {
  margin-bottom: 1rem;
}
.review-card > .manage-form {
  border-top: 1px solid var(--border);
}

/* Portal: app tiles */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}
.app-tile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  animation: flow-slide-up var(--flow-duration-base) var(--flow-ease-enter) both;
  transition: box-shadow var(--flow-duration-fast) var(--flow-ease-standard);
}
.app-tile:hover {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 20%, transparent);
}
.app-tile:not([data-tone="0"]):hover {
  box-shadow:
    inset 0 3px 0 var(--app-tone),
    0 0 0 1px color-mix(in oklab, var(--foreground) 20%, transparent);
}
.app-tile-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.app-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
  font-weight: 700;
  font-size: 1.125rem;
}
/* Suite colour per app (chart tokens), on the icon and a thin top edge. */
.app-tile[data-tone="1"] { --app-tone: var(--chart-1); }
.app-tile[data-tone="2"] { --app-tone: var(--chart-2); }
.app-tile[data-tone="3"] { --app-tone: var(--chart-3); }
.app-tile[data-tone="4"] { --app-tone: var(--chart-4); }
.app-tile[data-tone="5"] { --app-tone: var(--chart-5); }
.app-tile:not([data-tone="0"]) {
  box-shadow: inset 0 3px 0 var(--app-tone);
}
.app-tile:not([data-tone="0"]) .app-tile-icon {
  background: color-mix(in oklab, var(--app-tone) 16%, transparent);
  color: var(--app-tone);
}
.app-tile-icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}
.app-tile-title {
  min-width: 0;
}
.app-tile-title h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.app-tile-text {
  color: var(--muted-foreground);
  flex: 1;
}
.app-tile-actions {
  display: flex;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* Profile */
.flow-form-card {
  max-width: 44rem;
}

/* Auth / notice: centered card */
.flow-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.flow-auth-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 24rem;
}
.flow-auth-inner > .flow-brand {
  align-items: center;
}
.flow-auth-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 1.75rem 1.5rem;
  animation: flow-scale-in var(--flow-duration-base) var(--flow-ease-enter) both;
}
.flow-auth-card > .text-eyebrow {
  color: var(--muted-foreground);
  margin-bottom: -0.5rem;
}
.flow-auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}
.flow-auth-card > a.button {
  align-self: flex-start;
}
.flow-auth-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.flow-auth-note .icon {
  width: 0.875rem;
  height: 0.875rem;
}
.flow-auth-foot {
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.flow-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--muted);
}

@media (max-width: 767px) {
  .manage-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow-page-header h1 {
    font-size: 1.5rem;
  }
  .management-search input {
    max-width: none;
  }
  /* Stacked table rows: label next to value, no horizontal page scroll. */
  .flow-table {
    overflow-x: visible;
  }
  .flow-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .flow-table table,
  .flow-table tbody,
  .flow-table tr,
  .flow-table td {
    display: block;
  }
  .flow-table tbody tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }
  .flow-table tbody tr:last-child {
    border-bottom: 0;
  }
  .flow-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.25rem 1rem;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }
  .flow-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted-foreground);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-top: 0.125rem;
  }
  .flow-table td.cell-actions {
    display: flex;
    justify-content: flex-start;
    width: auto;
    padding-top: 0.5rem;
  }
  .flow-table tr.row-empty td {
    display: block;
  }
  .system-nav {
    width: 100%;
  }
  .platform-row > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .platform-rights {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Systeem → Back-ups: one card per app, compact label/value lists. */
.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1rem;
  align-items: start;
}
.backup-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  min-width: 0;
}
.management-section > .backup-grid,
.management-section > .backup-job {
  margin: 0 1rem 1rem;
}
.backup-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.backup-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.management-main .backup-card-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.backup-card-title p {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.backup-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
.backup-facts > div {
  display: grid;
  grid-template-columns: minmax(9rem, 38%) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.backup-facts dt {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.backup-facts dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
}
.backup-facts dd small {
  color: var(--muted-foreground);
}
.backup-note {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.backup-actions .manage-form {
  padding: 0;
}
.backup-card > .manage-form {
  padding: 0;
}
.backup-card .manage-editor-body > .manage-form {
  padding: 0.75rem 1rem 1rem;
}
.backup-checks {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}
.backup-checks li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.backup-restore > summary > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 40rem) {
  .backup-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }
  .backup-card {
    padding: 1rem;
  }
}
.backup-card .select-wrap,
.backup-card .select-wrap select {
  width: 100%;
  max-width: 22rem;
}
.review-card > .backup-facts,
.review-card > .backup-checks {
  margin: 0 1rem 1rem;
}

/* Beheer: hints (CSS-only tooltip; the text is in the DOM and linked with
   aria-describedby, shown on hover and on keyboard focus). */
.hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.hint-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.125rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: help;
}
.hint-trigger:hover {
  color: var(--foreground);
  background: var(--muted);
}
.hint-trigger .icon {
  width: 0.9375rem;
  height: 0.9375rem;
}
.hint > .badge[tabindex] {
  cursor: help;
}
.hint-bubble {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.375rem);
  left: 0;
  width: max-content;
  max-width: min(18rem, calc(100vw - 3rem));
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow:
    0 0 0 1px var(--border),
    0 4px 12px color-mix(in oklab, var(--foreground) 12%, transparent);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  text-align: left;
  /* display:none while closed: no layout width (no sideways scroll on a
     phone); aria-describedby still reads hidden text. */
  display: none;
  pointer-events: none;
}
.hint:hover > .hint-bubble,
.hint:focus-within > .hint-bubble {
  display: block;
  animation: flow-fade-in var(--flow-duration-fast) var(--flow-ease-enter);
}
.cell-actions .hint-bubble,
.chip-list .hint:last-child .hint-bubble {
  left: auto;
  right: 0;
}

/* Feedback after saving (role="status"). */
.flow-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in oklab, var(--success) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--success) 8%, var(--card));
  color: var(--card-foreground);
  animation: flow-fade-in var(--flow-duration-base) var(--flow-ease-enter);
}
.flow-toast > .icon {
  flex: none;
  margin-top: 0.125rem;
  color: var(--success);
}

/* Bedrijven */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}
.table-link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in oklab, var(--foreground) 25%, transparent);
}
.table-link:hover {
  text-decoration-color: currentColor;
}
.manage-form > .field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.manage-form > .field > label,
.field-label {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}
.field-value {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
}
.field-error {
  color: var(--destructive);
  font-size: 0.8125rem;
  font-weight: 500;
}
.manage-form > label:has(.hint),
.manage-form > fieldset legend {
  align-items: flex-start;
}
.manage-form > fieldset legend {
  display: inline-flex;
  align-items: center;
}
.cap-option {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
.cap-option > label {
  flex: 1;
}
.row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}
.inline-form {
  display: inline;
}
.flow .button.destructive {
  border-color: var(--destructive);
  background: var(--destructive);
  color: var(--primary-foreground);
}
.flow .button.destructive:hover {
  background: color-mix(in oklab, var(--destructive) 88%, var(--foreground));
}
/* "Ontkoppelen" is an outline button; red only in the confirmation (UX-FOS-07). */
.danger-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.danger-details > summary::-webkit-details-marker {
  display: none;
}

.danger-details[open] {
  width: min(24rem, 80vw);
  text-align: left;
  white-space: normal;
}
.danger-body {
  margin-top: 0.375rem;
  border: 1px solid color-mix(in oklab, var(--destructive) 30%, transparent);
  border-radius: var(--radius);
}
.danger-body > p {
  padding: 0.75rem 0.75rem 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.danger-body > .manage-form {
  grid-template-columns: minmax(0, 1fr);
  padding: 0.75rem;
}
.tech-details {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
}
.tech-details > summary {
  width: fit-content;
  color: var(--muted-foreground);
  cursor: pointer;
}
.facts {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  gap: 0.25rem 1rem;
  max-width: 48rem;
  margin: 0.5rem 0 0;
}
.facts dt {
  display: inline-flex;
  align-items: center;
  color: var(--muted-foreground);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.company-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  color: var(--muted-foreground);
  font-weight: 500;
}
.back-link:hover {
  color: var(--foreground);
}
.management-main .company-title {
  font-size: 1.25rem;
}
.danger-zone {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--destructive) 35%, transparent);
}
/* Bedrijf → Algemeen: the logo inside the one form. */
.logo-field {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.logo-field > legend {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.375rem;
  padding: 0;
  font-weight: 500;
}
.logo-field .suite-logo-preview {
  max-width: 34rem;
}
.logo-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.logo-picker > .file-button {
  flex-direction: row;
}
.logo-scale {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 34rem;
  font-weight: 500;
}
.logo-scale output {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.logo-field > p[role="alert"]:empty {
  display: none;
}
/* Apps as full rows (UX-FOS-06): no empty half next to a short card. */
.app-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0 1rem 1rem;
}
.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}
.app-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}
.app-card-head p {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.app-card > details.manage-editor {
  box-shadow: none;
  border: 1px solid var(--border);
}
@media (max-width: 767px) {
  .row-actions {
    align-items: flex-start;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts dd {
    margin-bottom: 0.375rem;
  }
  .danger-details[open] {
    width: 100%;
  }
  .flow-table .hint-bubble {
    left: auto;
    right: 0;
    max-width: min(16rem, calc(100vw - 6rem));
  }
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .flow .button.destructive:not(.primary):not(.ghost) {
    border-color: var(--destructive);
    background: var(--destructive);
    color: var(--background);
  }
}
  :where(:root[data-theme="dark"]) .flow .button.destructive:not(.primary):not(.ghost) {
    border-color: var(--destructive);
    background: var(--destructive);
    color: var(--background);
  }

/* Own file button (no English browser text "Choose File"). */
.file-button {
  position: relative;
  width: fit-content;
  cursor: pointer;
}
.file-button:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Touch screens (design system 0.9.0): 44 px targets for everything clickable.
   The theme does this for the kit's data-slot components; FlowOS renders plain
   HTML, so its own controls get the same minimum here. min-height wins over a
   fixed height. */
@media (pointer: coarse) {
  .flow .button,
  .flow :where(button, summary, [role="tab"]),
  .flow :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]), select, textarea),
  .flow-menu-panel :where(a, button),
  .hint-trigger,
  .table-link,
  .back-link,
  .file-button {
    min-height: 2.75rem;
  }
  .hint-trigger {
    min-width: 2.75rem;
  }
  .flow-nav-item {
    min-height: 2.875rem;
  }
  /* Focusable status chips (hint on focus), folded details and the logo
     slider are tapped too. */
  .hint > .badge[tabindex],
  .tech-details > summary,
  .flow input[type="range"] {
    min-height: 2.75rem;
  }
  .hint > .badge[tabindex] {
    display: inline-flex;
    align-items: center;
  }
  .flow-account .button {
    min-width: 2.75rem;
  }
  .flow-topbar .flow-brand {
    min-height: 2.75rem;
    justify-content: center;
  }
  .table-link,
  .flow-table a:not(.button) {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
  .flow input[type="checkbox"],
  .flow input[type="radio"] {
    min-width: 1.25rem;
    min-height: 1.25rem;
  }
  .flow label:has(> input[type="checkbox"]),
  .flow label:has(> input[type="radio"]) {
    min-height: 2.75rem;
    align-items: center;
  }
}
/* ADR-003: "Feedback naar …" in the company wizard and on the app card. */
.cap-options .app-choice {
  display: grid;
  align-content: start;
}
.cap-options .feedback-switch {
  padding-left: 2rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.app-choice:has(> label > input:not(:checked)) .feedback-switch {
  display: none;
}
.feedback-panel {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.feedback-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.feedback-companies {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feedback-companies li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}
.feedback-companies li > span:first-child {
  flex: 1 1 10rem;
}
.feedback-companies .manage-form {
  display: block;
  margin: 0;
  padding: 0;
}
.feedback-companies li {
  border-bottom: 1px solid var(--border);
}
.feedback-companies li:last-child {
  border-bottom: 0;
}
.flow .button.toggle-button {
  width: 7rem;
}
.feedback-companies .form-actions {
  margin: 0;
}
/* ADR-003: feedback button (sidebar and mobile menu) and the /feedback page. */
.flow-feedback {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-bottom: 0.5rem;
}
/* The /feedback page follows @flow/feedback (flow-design-system 0.10.0):
   card spacing 1rem, one column with gap 1rem, bordered fields, the error
   under its field, a segmented choice for the kind, a styled file button. */
.feedback-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.feedback-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.feedback-form,
.feedback-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.feedback-field,
.feedback-kind {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.feedback-field > label,
.feedback-kind > legend,
.feedback-shot h3 {
  margin-bottom: 0;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
}
.feedback-kind > legend {
  margin-bottom: 0.375rem;
}
.feedback-kind-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.feedback-kind-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--flow-duration-fast) var(--flow-ease-standard),
    color var(--flow-duration-fast) var(--flow-ease-standard);
}
.feedback-kind-options label:hover {
  background: var(--muted);
}
.feedback-kind-options label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}
.feedback-kind-options label:has(input:focus-visible) {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.flow .feedback-form textarea {
  display: block;
  width: 100%;
  min-height: 7.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.875rem;
  resize: vertical;
}
.flow .feedback-form textarea::placeholder {
  color: var(--muted-foreground);
}
.flow .feedback-form textarea:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-color: var(--ring);
}
.flow .feedback-form :is(input, textarea)[aria-invalid="true"] {
  border-color: var(--destructive);
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .flow .feedback-form textarea {
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }
}
  :where(:root[data-theme="dark"]) .flow .feedback-form textarea {
    background: color-mix(in oklab, var(--input) 30%, transparent);
  }

.feedback-count {
  align-self: flex-end;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.feedback-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  font-size: 0.875rem;
}
.feedback-secret {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--warning) 10%, transparent);
}
.feedback-secret[hidden] {
  display: none;
}
.feedback-secret > p:first-child {
  display: flex;
  gap: 0.5rem;
  color: var(--warning);
  font-size: 0.875rem;
}
.feedback-secret > p:first-child > .icon {
  margin-top: 0.125rem;
}
.feedback-shot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.feedback-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.feedback-file > label.button {
  cursor: pointer;
}
.feedback-file:has(input:focus-visible) > label.button {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.feedback-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feedback-file > [hidden] {
  display: none;
}
.feedback-failure {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
  font-size: 0.875rem;
}
.feedback-failure[hidden] {
  display: none;
}
.feedback-preview {
  display: grid;
  gap: 0.5rem;
}
.feedback-preview[hidden] {
  display: none;
}
.feedback-preview canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: crosshair;
  touch-action: none;
}
.feedback-status:empty {
  display: none;
}
.feedback-status {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.feedback-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feedback-list li {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.feedback-list li:last-child {
  border-bottom: 0;
}
.feedback-report {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.375rem 0.75rem;
}
.feedback-report > p {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.feedback-report-title {
  font-weight: 500;
}
.feedback-withdraw {
  align-self: flex-start;
}

/* Visually hidden fields (file button, segmented choice) stay hidden even
   where field styles set a width. */
.flow input.sr-only,
.flow input[type="file"].sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
}

/* Codes for whoever needs them (app/labels.ts technicalDetails), folded. */
.tech-details {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.tech-details > summary {
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
  text-underline-offset: 2px;
}
.tech-details ul {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
}
.tech-details code {
  overflow-wrap: anywhere;
}

/* Historiek (UX-FOS-03): filters on one row, one item per change; on a
   phone two lines: what + when, then who · about what. */
.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
.history-filters > label:not(.manage-confirm) {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 11rem;
  font-weight: 500;
}
.history-filters > .manage-confirm {
  min-height: 2.25rem;
}
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "what when" "who who";
  gap: 0.125rem 1rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
}
.history-what {
  grid-area: what;
  min-width: 0;
  font-weight: 500;
}
.history-what small {
  display: block;
  color: var(--muted-foreground);
  font-weight: 400;
  overflow-wrap: anywhere;
}
.history-when {
  grid-area: when;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-who {
  grid-area: who;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) {
  .history-item {
    grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 16rem);
    grid-template-areas: "when what who";
    align-items: baseline;
  }
  .history-what small {
    display: inline;
  }
  .history-what small::before {
    content: " · ";
  }
}
@media (max-width: 767px) {
  .history-filters > label:not(.manage-confirm) {
    flex: 1 1 100%;
  }
  .history-what small {
    display: none;
  }
}

/* Step-up warn mode (UX-FOS-04): one line, the link to register a key;
   on a phone at most 48px high (two short lines of small text). */
.step-up-banner {
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.step-up-banner > .icon {
  margin-top: 0;
}
.step-up-banner a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .step-up-banner {
    max-height: 3rem;
    overflow: hidden;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
  }
}

/* 403 and 429 inside Beheer (UX-FOS-05). */
.management-section.error-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
}
.management-section.error-section > h2 {
  padding: 0;
}
.error-section > .error-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--muted-foreground);
}
.error-section > .form-actions {
  margin-top: 0.5rem;
}
.review-card > .review-text {
  padding: 0 1rem 1rem;
}

/* A fieldset with an error (UX-FOS-09: no app chosen in Bedrijf toevoegen). */
.cap-options.has-error {
  border-color: var(--destructive);
}
.cap-options > .field-error {
  grid-column: 1 / -1;
}

/* Back-ups (UX-FOS-12): one status line per app FlowOS does not drive. */
.backup-lines {
  margin: 0 1rem 1rem;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.backup-line {
  display: grid;
  grid-template-columns: minmax(6rem, 10rem) auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.backup-line:last-child {
  border-bottom: 0;
}
.backup-line-name {
  font-weight: 500;
}
.backup-line-text {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
@media (max-width: 767px) {
  .backup-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .backup-line-text {
    grid-column: 1 / -1;
  }
}

/* Company chooser when opening an app (B8). */
.company-chooser {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.company-chooser fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.company-choice {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.company-choice:has(input:checked) {
  border-color: var(--primary);
}
