/* ==========================================================================
   PharmaLab · pharmalab.css
   Tokens (light + dark), base, typography, shell and components.
   Brand DNA: Halor shell (Cloud bg, white 26px cards, 44px pills, Halor Blue
   as the only accent, Ink for dark surfaces, 135° stripes, tabular numerals).
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand palette (Halor Brand Guidelines) */
  --pl-blue: #0C2DC9;
  --pl-blue-2: #2342D6;
  --pl-blue-3: #6E84F0;
  --pl-blue-tint: #E7EBFA;
  --pl-ink: #0E1116;
  --pl-ink-2: #171B23;
  --pl-graphite: #353A46;
  --pl-slate: #6C7382;
  --pl-silver: #B7BBC2;
  --pl-line: #DDE0E7;
  --pl-mist: #E9EAEC;
  --pl-cloud: #F3F4F6;
  --pl-white: #FFFFFF;

  /* Semantic */
  --bg: var(--pl-cloud);
  --surface: var(--pl-white);
  --surface-2: var(--pl-cloud);
  --surface-3: var(--pl-mist);
  --text: var(--pl-ink);
  --text-2: var(--pl-graphite);
  --muted: var(--pl-slate);
  --faint: var(--pl-silver);
  --border: var(--pl-line);
  --border-soft: #EBEDF1;
  --control-border: #CDD1D9;
  --row-hover: #F7F8FA;
  --hover: rgba(14, 17, 22, .045);
  --primary: var(--pl-blue);
  --primary-2: var(--pl-blue-2);
  --primary-ink: #FFFFFF;
  --primary-soft: var(--pl-blue-tint);
  --primary-hover: #0A25AA;
  --primary-glow: rgba(12, 45, 201, .55);
  --dark: var(--pl-ink);
  --dark-2: var(--pl-ink-2);
  --on-dark: #FFFFFF;
  --focus: rgba(12, 45, 201, .35);
  /* Focus ring (SPEC §1 amendment): a solid 2px ring + 2px offset that reads on any surface.
     Halor Blue on light surfaces (9,6:1 on white); white on Ink / blue surfaces (see "on dark" below). */
  --focus-ring: var(--pl-blue);
  --overlay: rgba(14, 17, 22, .38);

  /* Primary used as TEXT or icon-only (links, chip-info, delta.up, filter chips, eyebrows).
     Fills (buttons, active pill, chart series) keep --primary. */
  --primary-text: var(--pl-blue);
  /* Muted text on --surface-2 / --bg (table header row): 5,32:1 on #F3F4F6. --muted stays for text on white. */
  --muted-2: #5E6573;

  /* Functional status. --ok/--warn/--danger stay for dots, bars, icons and fills;
     the *-text tokens are for words on the soft backgrounds (chips, tags, deltas, errors): ≥ 5,2:1 (SPEC §2 amendment). */
  --ok: #1F8A5B;      --ok-soft: #E3F4EC;      --ok-text: #16704A;
  --warn: #B7791F;    --warn-soft: #FBF1DC;    --warn-text: #8A5A12;
  --danger: #C2412D;  --danger-soft: #FBE6E2;  --danger-text: #A83522;
  --info: var(--primary); --info-soft: var(--primary-soft); --info-text: var(--primary-text);
  /* Bright status on Ink surfaces (sidebar badges, toasts) */
  --danger-on-dark: #E5664F;
  --side-badge-bg: rgba(255, 255, 255, .12);
  --side-badge-hot: var(--danger-on-dark);

  /* Chart series */
  --c1: var(--primary);
  --c2: var(--text);
  --c3: var(--pl-blue-3);
  --c4: var(--pl-silver);
  --c5: var(--pl-slate);
  --c6: var(--surface-3);

  /* Stripes (135°) */
  --stripe-blue: repeating-linear-gradient(135deg, var(--pl-blue) 0 5px, var(--pl-blue-2) 5px 10px);
  --stripe-ink: repeating-linear-gradient(135deg, var(--pl-ink) 0 5px, #2A2F3A 5px 10px);
  --stripe-gray: repeating-linear-gradient(135deg, var(--pl-mist) 0 5px, var(--pl-cloud) 5px 10px);

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;
  /* Text fields (input, select in forms, input-group, textarea). Toolbar filters and selects in bars are pills. */
  --r-ctl: 14px;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(14, 17, 22, .04);
  --sh-2: 0 8px 28px rgba(14, 17, 22, .08);
  --sh-pop: 0 18px 48px rgba(14, 17, 22, .16);
  --sh-ring: 0 0 0 1px rgba(14, 17, 22, .06);

  /* Controls */
  --ctl: 44px;
  --ctl-sm: 36px;
  --ctl-lg: 52px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 160ms;
  --t: 260ms;
  --t-slow: 520ms;

  /* Shell */
  --side-w: 264px;
  --side-w-rail: 88px;
  --side-bg: var(--pl-ink);
  --gap: 14px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236C7382' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4 4L18.5 7.5'/%3E%3C/svg%3E");
  --dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6.5 12h11'/%3E%3C/svg%3E");

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0A0C10;
  --surface: #12151C;
  --surface-2: #181C25;
  --surface-3: #20242F;
  --text: #F2F3F5;
  --text-2: #C9CDD6;
  --muted: #8A91A0;
  --faint: #5A6170;
  --border: #262B36;
  --border-soft: #1E222B;
  --control-border: #333947;
  --row-hover: #161A22;
  --hover: rgba(255, 255, 255, .05);
  --primary: #4A63F0;
  --primary-2: #5C74F5;
  --primary-soft: rgba(74, 99, 240, .16);
  --primary-hover: #5C74F5;
  --primary-glow: rgba(74, 99, 240, .45);
  --dark: #05070A;
  --dark-2: #0D1016;
  --focus: rgba(92, 116, 245, .5);
  --focus-ring: #8496FF;
  --overlay: rgba(3, 4, 6, .62);
  --primary-text: #8496FF;   /* 6,77:1 on #12151C, 6,32:1 on #181C25 */
  --muted-2: var(--muted);

  --ok: #3DB27D;      --ok-soft: rgba(61, 178, 125, .14);  --ok-text: #4CC38D;
  --warn: #E3A73F;    --warn-soft: rgba(227, 167, 63, .14); --warn-text: #EDB65A;
  --danger: #EC6A53;  --danger-soft: rgba(236, 106, 83, .15); --danger-text: #F2826D;

  --c4: #6B7282;
  --c5: #9AA1AF;

  --stripe-blue: repeating-linear-gradient(135deg, #3F58E8 0 5px, #5068F2 5px 10px);
  --stripe-ink: repeating-linear-gradient(135deg, #D9DCE3 0 5px, #B3B8C3 5px 10px);
  --stripe-gray: repeating-linear-gradient(135deg, #20242F 0 5px, #181C25 5px 10px);

  --sh-1: 0 0 0 1px rgba(255, 255, 255, .045), 0 1px 2px rgba(0, 0, 0, .35);
  --sh-2: 0 0 0 1px rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .45);
  --sh-pop: 0 0 0 1px rgba(255, 255, 255, .07), 0 24px 64px rgba(0, 0, 0, .6);
  --sh-ring: 0 0 0 1px rgba(255, 255, 255, .07);

  --side-bg: #05070A;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A91A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

[data-density="compact"] {
  --ctl: 38px;
  --ctl-sm: 32px;
  --ctl-lg: 46px;
  --gap: 12px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  overflow-x: clip;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: not-allowed; }
input, textarea, select { margin: 0; }
table { border-collapse: collapse; }
hr { border: 0; height: 1px; background: var(--border-soft); margin: 16px 0; }
[hidden] { display: none !important; }
::selection { background: rgba(12, 45, 201, .16); }
[data-theme="dark"] ::selection { background: rgba(74, 99, 240, .32); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* On Ink and blue surfaces the ring turns white
   (the ring is drawn on the surrounding surface, so the token follows the container, not the control) */
.pl-side, .card-hero, .card-blue, .bulkbar, .pl-toast, .pl-rolebar, .side-promo { --focus-ring: #FFFFFF; }
a.card-hero:focus-visible, a.card-blue:focus-visible, button.card-hero:focus-visible, .cat-card:focus-visible { outline-color: var(--primary-text); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.pl-drawer:focus, .pl-modal:focus, .pl-cmdk:focus, .tour-card:focus, .pl-menu:focus, .pl-pop:focus, .pl-main:focus, [tabindex="-1"]:focus { outline: none; }

* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--faint) 70%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--faint) 60%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ic {
  width: 18px; height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 22px; height: 22px; }

/* Typography */
.t-display { font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -.035em; }
h1, .t-h1 { font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; }
h2, .t-h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h3, .t-h3 { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; }
h4, .t-h4 { font-size: 15px; line-height: 1.4; font-weight: 600; }
.t-body { font-size: 14px; font-weight: 500; }
.t-lead { font-size: 16px; line-height: 1.55; color: var(--text-2); }
.t-small { font-size: 12.5px; font-weight: 500; }
.t-micro { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.num, .t-num-font { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.cents { color: var(--muted); }
/* Silver cents only at display sizes (hero/KPI values, 30–46px), as in the Halor shell */
.kpi-value .cents, .t-display .cents, .ds-cents-big .cents, .ans-value .cents, .ai-card-value .cents, .cat-count .cents { color: var(--faint); }
/* Currency gap survives negative tracking: "R$ 1.214.951" (word-spacing also applies to the no-break space) */
/* Bold and numeric runs too: at 600–700 the font's space is narrow, so "R$ 1.214.951" read as "R$1.214.951" */
.num, .t-num, b, strong { word-spacing: .1em; }
.t-display, .kpi-value, .ans-value, .ai-card-value, .cat-count, .stat-value, .t-h1, h1 { word-spacing: .12em; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.faint { color: var(--faint); }
.strong, b, strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: .92em; }
.t-ok { color: var(--ok-text); } .t-warn { color: var(--warn-text); } .t-danger { color: var(--danger-text); } .t-primary { color: var(--primary-text); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.kbd, kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), inset 0 -1.5px 0 var(--border);
  color: var(--muted);
  font: 600 11.5px/1 var(--font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link { color: var(--primary-text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ic { width: 16px; height: 16px; }

.divider { height: 1px; background: var(--border-soft); border: 0; margin: 16px 0; }
.dot:not(.chip):not(.tag) { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot-ok:not(.chip), .dot.dot-ok:not(.chip):not(.tag) { background: var(--ok); } .dot-warn:not(.chip), .dot.dot-warn:not(.chip):not(.tag) { background: var(--warn); } .dot-danger:not(.chip), .dot.dot-danger:not(.chip):not(.tag) { background: var(--danger); } .dot-info:not(.chip), .dot-primary:not(.chip), .dot.dot-info:not(.chip):not(.tag), .dot.dot-primary:not(.chip):not(.tag) { background: var(--primary); } .dot-ink:not(.chip), .dot.dot-ink:not(.chip):not(.tag) { background: var(--text); }
.dot.pulse:not(.chip) { position: relative; }
.dot.pulse:not(.chip)::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: currentColor; color: inherit; opacity: 0; animation: pl-ping 1.8s var(--ease) infinite; }
.dot-ok.pulse::after { background: var(--ok); } .dot-info.pulse::after, .dot-primary.pulse::after { background: var(--primary); } .dot-warn.pulse::after { background: var(--warn); } .dot-danger.pulse::after { background: var(--danger); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.spacer { flex: 1 1 auto; }
.grid { display: grid; gap: var(--gap); min-width: 0; }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 2px 2px; }
.section-head h2 { font-size: 20px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2, .span-3 { grid-column: auto; } }

/* Responsive visibility */
@media (max-width: 640px) { .hide-mobile { display: none !important; } }
@media (min-width: 641px) { .show-mobile { display: none !important; } }

/* Mode and density visibility */
[data-mode="simple"] .adv-only { display: none !important; }
[data-mode="advanced"] .simple-only { display: none !important; }

/* 3. Shell ----------------------------------------------------------------- */
.pl-app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--gap);
  padding: 14px;
  min-height: 100vh;
  max-width: calc(1680px + var(--side-w) + 42px);
  margin: 0 auto;
  align-items: start;
}
.pl-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; width: 100%; max-width: 1680px; }
.pl-main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; padding-bottom: 40px; outline: none; }
.pl-main > [data-view] { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.view-in { animation: pl-view-in var(--t) var(--ease) both; }

.pl-stripe-top { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--stripe-blue); z-index: 120; pointer-events: none; }

/* Sidebar */
.pl-side:focus { outline: none; }
.pl-side {
  position: sticky;
  top: 14px;
  width: var(--side-w);
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  border-radius: var(--r-lg);
  background: var(--side-bg);
  color: #fff;
  z-index: 30;
  overflow: hidden;
  isolation: isolate;
  transition: width var(--t) var(--ease), transform var(--t) var(--ease);
  box-shadow: 0 1px 2px rgba(14, 17, 22, .12), 0 16px 40px -18px rgba(14, 17, 22, .45);
}
.pl-side::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 42% at 0% 0%, rgba(74, 99, 240, .20) 0%, rgba(74, 99, 240, 0) 70%),
    radial-gradient(90% 30% at 100% 100%, rgba(74, 99, 240, .12) 0%, rgba(74, 99, 240, 0) 70%);
}
.pl-side::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.side-inner { display: flex; flex-direction: column; height: 100%; padding: 16px; min-width: 0; }

.side-head { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding-left: 10px; margin-bottom: 14px; flex: none; }
.side-logo { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 12px; transition: opacity var(--t-fast); }
.side-logo .pl-wordmark { transition: opacity var(--t-fast) var(--ease); }
.side-logo > svg, .pl-mark { flex: none; }
.side-logo > .pl-logo { min-width: 0; overflow: hidden; }
.side-toggle {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: rgba(255, 255, 255, .55); flex: none;
  transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
.side-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-toggle .ic { width: 19px; height: 19px; }

.side-tag {
  display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; margin: -4px 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .8);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; flex: none;
}
.side-tag::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--stripe-blue); flex: none; }

.side-tenant {
  position: relative; display: flex; align-items: center; gap: 10px;
  width: 100%; height: 56px; padding: 0 12px 0 10px; margin-left: 0; margin-bottom: 12px;
  border-radius: 18px; background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  color: #fff; text-align: left; flex: none; overflow: hidden;
  transition: background var(--t-fast), width var(--t) var(--ease), height var(--t) var(--ease), margin var(--t) var(--ease), padding var(--t) var(--ease), border-radius var(--t) var(--ease);
}
.side-tenant:hover { background: rgba(255, 255, 255, .085); }
.tenant-av {
  position: relative; width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(145deg, #2B4AE6, #0C2DC9); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.tenant-av::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: #2FBF7F; box-shadow: 0 0 0 2.5px var(--side-bg); }
.tenant-av.is-warn::after { background: #E3A73F; }
.tenant-txt { min-width: 0; flex: 1; transition: opacity var(--t-fast); }
.tenant-name { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-env { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .55); margin-top: 3px; white-space: nowrap; }
.tenant-env .dot { width: 6px; height: 6px; background: #2FBF7F; }
.side-tenant > .ic { color: rgba(255, 255, 255, .45); width: 16px; height: 16px; transition: opacity var(--t-fast); }

.side-search {
  display: none; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; margin-bottom: 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .6); flex: none;
}
.side-search .ic { width: 18px; height: 18px; }

.side-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  margin: 0 -16px; padding: 6px 16px 12px;
  scrollbar-width: none; overscroll-behavior: contain;
  --fade-t: 12px; --fade-b: 28px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-t), #000 calc(100% - var(--fade-b)), transparent 100%);
}
.side-scroll.at-top { --fade-t: 0px; }
.side-scroll.at-end { --fade-b: 0px; }
/* A thin scrollbar appears on hover, so a scrollable menu never looks complete when it is not */
.side-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.side-scroll:hover, .side-scroll:focus-within { scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: transparent; border: 0; border-radius: 6px; }
.side-scroll:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }
.side-nav { flex: none; }

.side-group + .side-group { margin-top: 8px; }
.side-label {
  position: relative; display: flex; align-items: center; height: 24px; padding: 0 18px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: rgba(255, 255, 255, .38); white-space: nowrap;
}
.side-label > span { transition: opacity var(--t-fast); }
.side-label::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 1px; margin-left: -11px; background: rgba(255, 255, 255, .14); opacity: 0; transition: opacity var(--t-fast); }

.side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; height: 36px; padding: 0 12px 0 18px; margin-left: 0;
  border-radius: 999px; color: rgba(255, 255, 255, .7);
  font-size: 14px; font-weight: 500; white-space: nowrap; text-align: left;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), width var(--t) var(--ease), height var(--t) var(--ease), padding var(--t) var(--ease), margin var(--t) var(--ease);
}
.side-link + .side-link, .side-sub > .side-link + .side-link { margin-top: 2px; }
.side-link .ic { width: 20px; height: 20px; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.is-active {
  background: var(--pl-blue); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
[data-theme="dark"] .side-link.is-active { background: #2F4BEA; }
.side-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--t-fast); }
.side-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px; background: var(--side-badge-bg); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none;
  transition: opacity var(--t-fast);
}
.side-badge.is-hot { background: var(--side-badge-hot); }
.side-link.is-active .side-badge { background: rgba(255, 255, 255, .22); }
.side-link .side-chev { width: 16px; height: 16px; color: rgba(255, 255, 255, .4); transition: transform var(--t) var(--ease), opacity var(--t-fast); margin-left: auto; }
.side-env.is-open .side-chev { transform: rotate(180deg); }
.side-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t) var(--ease); }
.side-sub > div { overflow: hidden; min-height: 0; }
.side-env.is-open .side-sub { grid-template-rows: 1fr; }
.side-sub .side-link { height: 36px; font-size: 13.5px; color: rgba(255, 255, 255, .62); }
.side-sub > div { padding-top: 2px; }
.side-sub .side-link .ic { width: 18px; height: 18px; margin-left: 1px; }

.side-promo {
  position: relative; flex: none; overflow: hidden; isolation: isolate;
  padding: 16px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(110, 132, 240, .55) 0%, rgba(110, 132, 240, 0) 55%),
    linear-gradient(160deg, #2747E6 0%, #0C2DC9 48%, #071C86 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 24px -16px rgba(12, 45, 201, .9);
  transition: width var(--t) var(--ease), height var(--t) var(--ease), padding var(--t) var(--ease), margin var(--t) var(--ease), border-radius var(--t) var(--ease);
}
.side-promo::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .075) 0 6px, transparent 6px 12px);
  -webkit-mask-image: radial-gradient(120% 100% at 100% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(120% 100% at 100% 0%, #000 0%, transparent 62%);
}
.promo-top { display: flex; align-items: center; gap: 10px; }
.promo-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); flex: none; }
.promo-ic .ic { width: 18px; height: 18px; }
.promo-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.promo-title small { display: block; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .6); letter-spacing: 0; margin-top: 1px; }
.promo-text { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .8); margin-top: 12px; font-weight: 500; }
.promo-btn {
  margin-top: 12px; width: 100%; height: 36px; border-radius: 999px; background: #fff; color: var(--pl-ink);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.promo-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); }
.promo-btn .ic { width: 16px; height: 16px; }
.promo-body { transition: opacity var(--t-fast); }
.promo-rail { display: none; }
/* Compact Lab IA (short screens): one row, icon tile + two short lines */
.promo-mini { display: none; align-items: center; gap: 9px; width: 100%; height: 100%; min-width: 0; padding: 0 8px 0 6px; color: #fff; text-align: left; border-radius: inherit; }
.promo-mini .promo-ic { width: 32px; height: 32px; border-radius: 10px; }
.promo-mini .promo-ic .ic { width: 16px; height: 16px; }
.promo-mini-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.promo-mini-txt b { font-size: 13px; font-weight: 700; white-space: nowrap; }
.promo-mini-txt span { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-mini > .ic { display: none; }

/* Foot: pinned below the scroll area, so the Lab IA card and Ajuda / Sair never fall below the fold */
.side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); flex: none; }
.side-foot-row { display: flex; align-items: center; gap: 6px; }
.side-foot-row .side-link { flex: 1; }
.side-foot-row .side-link.is-icon { flex: none; width: 40px; padding: 0; justify-content: center; }
.side-foot-row .side-link.is-icon .side-text { display: none; }

/* Short viewports (laptops at 900px and below, the mobile drawer): tighter rhythm, compact Lab IA
   in the same row as Ajuda and Sair. At 1440×900 the 15 admin links + Ambientes fit without scrolling. */
@media (max-height: 960px) {
  .side-inner { padding: 14px; }
  .side-head { height: 40px; margin-bottom: 10px; }
  .side-tenant { height: 48px; margin-bottom: 8px; border-radius: 16px; }
  .side-tenant .tenant-av { width: 32px; height: 32px; border-radius: 11px; font-size: 11.5px; }
  .side-scroll { margin: 0 -14px; padding: 4px 14px 8px; --fade-b: 22px; }
  .side-label { height: 20px; font-size: 10.5px; }
  .side-group + .side-group { margin-top: 6px; }
  .side-link { height: 34px; }
  .side-link + .side-link, .side-sub > .side-link + .side-link { margin-top: 1px; }
  .side-sub .side-link { height: 32px; }
  .side-foot { margin-top: 6px; padding-top: 8px; }
  .side-promo { padding: 14px; }
  .promo-text { margin-top: 8px; }
}
/* .is-mini is set by PL.shell when the full card would push the menu into scrolling:
   the Lab IA card becomes one row next to Ajuda and Sair */
.side-foot.is-mini { flex-direction: row; align-items: center; gap: 4px; }
.side-foot.is-mini .side-promo { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0; border-radius: 15px; }
.side-foot.is-mini .promo-body { display: none; }
.side-foot.is-mini .promo-mini { display: flex; }
.side-foot.is-mini .side-foot-row { flex: none; gap: 2px; }
.side-foot.is-mini .side-foot-row .side-link { flex: none; width: 38px; height: 38px; padding: 0; justify-content: center; }
.side-foot.is-mini .side-foot-row .side-link .side-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logo */
.pl-logo { display: inline-flex; align-items: center; gap: calc(var(--logo-size, 32px) * .3); color: var(--text); white-space: nowrap; }
.pl-logo svg { width: var(--logo-size, 32px); height: var(--logo-size, 32px); flex: none; display: block; }
.pl-wordmark { font-family: var(--font); font-weight: 800; letter-spacing: -.035em; font-size: calc(var(--logo-size, 32px) * .62); line-height: 1; }
.pl-wordmark .pl-dot { color: var(--pl-blue); }
.pl-logo--light { color: #fff; }
.pl-logo--light .pl-dot { color: #5E77F7; }
[data-theme="dark"] .pl-logo--dark .pl-dot { color: #6A80F7; }
.pl-logo--onblue .pl-dot { color: #fff; opacity: .9; }

/* Variants */
[data-variant="supplier"] { --side-bg: #0C2DC9; }
[data-variant="supplier"] .pl-side { box-shadow: 0 16px 40px -18px rgba(12, 45, 201, .7); }
[data-variant="supplier"] .pl-side::before { background: radial-gradient(120% 50% at 0% 0%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 70%), repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 6px, transparent 6px 12px); }
[data-variant="supplier"] .side-link { color: rgba(255, 255, 255, .82); }
[data-variant="supplier"] .side-link:hover { background: rgba(255, 255, 255, .1); }
[data-variant="supplier"] .side-link.is-active { background: #fff; color: var(--pl-blue); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .5); }
[data-variant="supplier"] .side-link.is-active .side-badge { background: var(--pl-blue-tint); color: var(--pl-blue); }
[data-variant="supplier"] .side-label { color: rgba(255, 255, 255, .55); }
[data-variant="supplier"] .side-tenant { background: rgba(255, 255, 255, .1); }
[data-variant="supplier"] .tenant-av { background: #fff; color: var(--pl-blue); }
[data-variant="supplier"] .side-promo { background: radial-gradient(120% 90% at 100% 0%, rgba(74, 99, 240, .5) 0%, transparent 55%), linear-gradient(160deg, #171B23, #0E1116); }
[data-theme="dark"][data-variant="supplier"] { --side-bg: #1E36C2; }

/* Topbar */
.pl-top {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 76px; padding: 12px 14px 12px 24px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  z-index: 20;
}
.top-btn.top-burger { display: none; }
.top-heading { flex: 1 0 auto; max-width: 44%; min-width: 0; margin-right: 6px; }
.top-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-title { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 2px; }
.top-mode { flex: none; }
.top-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; min-width: 0; }
.top-sub .ic { width: 13px; height: 13px; color: var(--faint); stroke-width: 2.2; }
.top-sub span:last-child { color: var(--text-2); }
.top-search {
  flex: 0 1 360px; min-width: 170px; height: var(--ctl);
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.top-search:hover { background: var(--surface-3); }
.top-search > span:not(.kbd) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top-search .kbd { background: var(--surface); }
.top-search .ic { color: var(--text-2); }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.top-btn {
  position: relative; width: var(--ctl); height: var(--ctl); border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.top-btn:hover { background: var(--surface-3); }
.top-btn:active { transform: scale(.96); }
.top-btn .ic { width: 20px; height: 20px; }
.top-btn .top-dot { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2.5px var(--surface-2); }
.top-btn:hover .top-dot { box-shadow: 0 0 0 2.5px var(--surface-3); }
.top-btn.is-ai { background: var(--primary-soft); color: var(--primary-text); }
.top-btn.is-ai:hover { background: var(--primary); color: #fff; }
.top-pill {
  height: var(--ctl); padding: 0 14px 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; flex: none;
  transition: background var(--t-fast);
}
.top-pill:hover { background: var(--surface-3); }
.top-pill .ic { width: 18px; height: 18px; }
.top-pill .ic:last-child { width: 15px; height: 15px; color: var(--muted); }
.top-pill.is-on { background: var(--dark); color: #fff; }
[data-theme="dark"] .top-pill.is-on { background: var(--primary); }
.top-pill.is-on .ic:last-child { color: rgba(255, 255, 255, .6); }
.top-user {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px 0 4px; margin-left: 2px;
  border-radius: 999px; text-align: left; flex: none; transition: background var(--t-fast);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}
.top-user:hover { background: var(--surface-2); }
.top-user .avatar { width: 42px; height: 42px; font-size: 14px; }
.top-user-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.top-user-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.top-user-role { font-size: 12px; color: var(--muted); white-space: nowrap; }
.top-user > .ic { width: 16px; height: 16px; color: var(--muted); }

/* Role banner */
.pl-rolebar {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 6px 6px 8px;
  border-radius: 999px; background: var(--dark); color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); position: relative; overflow: hidden; isolation: isolate;
  animation: pl-drop-in var(--t) var(--ease) both;
}
.pl-rolebar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 45, 201, .5), rgba(12, 45, 201, 0) 45%); }
.rolebar-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--stripe-blue); flex: none; }
.rolebar-ic .ic { width: 16px; height: 16px; }
.rolebar-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rolebar-txt b { font-weight: 700; }
.rolebar-txt .sep { color: rgba(255, 255, 255, .35); margin: 0 6px; }
.rolebar-txt .ctx { color: rgba(255, 255, 255, .7); }
.rolebar-exit { height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: none; transition: background var(--t-fast); }
.rolebar-exit:hover { background: rgba(255, 255, 255, .18); }
.rolebar-exit .ic { width: 15px; height: 15px; }

/* Subnav */
.pl-subnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.pl-subnav .tabs { flex: 0 1 auto; min-width: 0; }
.sub-actions { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.pl-subnav.no-tabs { justify-content: flex-end; }
/* Subnav fit (PL.shell measures it): when the tabs no longer fit, secondary actions collapse to icon
   circles (.is-tight), then the primary too (.is-tighter). The tab strip fades at the edge that scrolls. */
@media (min-width: 980px) {
  .pl-subnav.is-tight .sub-actions .btn.is-collapsible:not(.btn-primary), .pl-subnav.is-tighter .sub-actions .btn.is-collapsible { width: var(--ctl); min-width: var(--ctl); padding: 0; gap: 0; }
  .pl-subnav.is-tight .sub-actions .btn.is-collapsible:not(.btn-primary) > span, .pl-subnav.is-tighter .sub-actions .btn.is-collapsible > span { display: none; }
  .pl-subnav.is-dense .tabs { gap: 6px; }
  .pl-subnav.is-dense .tab { padding: 0 14px; }
  .pl-subnav .tabs.has-more:not(.at-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
  .pl-subnav .tabs.has-more:not(.at-start):not(.at-end) { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
  .pl-subnav .tabs.has-more.at-end:not(.at-start) { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px); mask-image: linear-gradient(to right, transparent, #000 44px); }
}

.pl-scrim { position: fixed; inset: 0; background: var(--overlay); opacity: 0; pointer-events: none; z-index: 79; transition: opacity var(--t) var(--ease); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.pl-guard { margin-bottom: 0; }

/* Collapsed rail (desktop only) */
@media (min-width: 980px) {
  [data-side="collapsed"] .pl-side { width: var(--side-w-rail); }
  /* Head becomes a column: the mark, then an always-visible expand button (touch and beginners) */
  [data-side="collapsed"] .side-head { flex-direction: column; align-items: flex-start; height: auto; gap: 8px; padding-left: 10px; }
  [data-side="collapsed"] .side-logo .pl-wordmark { opacity: 0; width: 0; }
  [data-side="collapsed"] .side-logo > .pl-logo { display: none; }
  [data-side="collapsed"] .side-toggle { position: static; margin: 0; width: 36px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8); opacity: 1; }
  [data-side="collapsed"] .side-toggle:hover { background: rgba(255, 255, 255, .16); color: #fff; }
  [data-side="collapsed"] .side-toggle .ic { transform: scaleX(-1); }
  [data-side="collapsed"] .side-tag { width: 48px; margin-left: 4px; padding: 0; justify-content: center; color: transparent; }
  [data-side="collapsed"] .side-tag::before { margin: 0; }
  [data-side="collapsed"] .side-tenant { width: 48px; height: 48px; margin-left: 4px; padding: 0 6px; border-radius: 50%; }
  [data-side="collapsed"] .tenant-av { border-radius: 50%; }
  [data-side="collapsed"] .tenant-txt, [data-side="collapsed"] .side-tenant > .ic { opacity: 0; }
  [data-side="collapsed"] .side-label > span { opacity: 0; }
  [data-side="collapsed"] .side-label::before { opacity: 1; }
  [data-side="collapsed"] .side-group:first-child .side-label { display: none; }
  [data-side="collapsed"] .side-link { width: 48px; height: 48px; padding: 0 0 0 14px; margin-left: 4px; }
  [data-side="collapsed"] .side-text, [data-side="collapsed"] .side-chev { opacity: 0; }
  /* Count badges keep the same tokens in both states */
  [data-side="collapsed"] .side-badge {
    position: absolute; top: 2px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px;
    background: #3A4150; box-shadow: 0 0 0 2px var(--side-bg);
  }
  [data-side="collapsed"] .side-badge.is-hot { background: var(--side-badge-hot); }
  [data-side="collapsed"] .side-link.is-active .side-badge { background: #fff; color: var(--pl-blue); }
  [data-side="collapsed"] .side-sub { display: none; }
  [data-side="collapsed"] .side-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  [data-side="collapsed"] .side-promo { flex: none; width: 48px; height: 48px; margin-left: 4px; padding: 0; border-radius: 50%; cursor: pointer; }
  [data-side="collapsed"] .promo-body, [data-side="collapsed"] .promo-mini { display: none !important; }
  [data-side="collapsed"] .promo-rail { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; border-radius: inherit; }
  [data-side="collapsed"] .promo-rail .ic { width: 20px; height: 20px; }
  [data-side="collapsed"] .side-foot-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  [data-side="collapsed"] .side-foot-row .side-link, [data-side="collapsed"] .side-foot-row .side-link.is-icon { flex: none; width: 48px; height: 48px; padding-left: 14px; justify-content: flex-start; }
  [data-side="collapsed"] .side-foot-row .side-link.is-icon .side-text { display: block; }
}
@media (min-width: 980px) and (max-height: 960px) {
  [data-side="collapsed"] .side-link, [data-side="collapsed"] .side-foot-row .side-link, [data-side="collapsed"] .side-foot-row .side-link.is-icon { width: 44px; height: 44px; padding-left: 12px; margin-left: 6px; }
  [data-side="collapsed"] .side-promo { width: 44px; height: 44px; margin-left: 6px; }
  [data-side="collapsed"] .side-tenant { width: 44px; height: 44px; margin-left: 6px; padding: 0 4px; }
  [data-side="collapsed"] .side-label { height: 14px; }
}

/* Topbar responsive */
@media (max-width: 1365px) { .top-search { flex-basis: 280px; } .top-search .kbd { display: none; } }
@media (max-width: 1240px) {
  .top-pill .top-pill-txt, .top-pill .ic:last-child { display: none; }
  .top-pill { width: var(--ctl); padding: 0; justify-content: center; }
  .top-user-txt { display: none; }
  .top-user { padding-right: 8px; }
}
@media (max-width: 1120px) {
  .top-search { flex: none; width: var(--ctl); min-width: 0; padding: 0; justify-content: center; }
  .top-search > span:not(.kbd), .top-search .kbd { display: none; }
}

/* Mobile: off-canvas sidebar */
@media (max-width: 979.98px) {
  .pl-app { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .pl-col { gap: 12px; }
  .pl-side {
    position: fixed; top: 10px; left: 10px; bottom: 10px; height: auto;
    width: min(300px, calc(100vw - 52px));
    transform: translateX(calc(-100% - 24px)); z-index: 80; visibility: hidden;
    transition: transform var(--t) var(--ease), visibility 0s linear var(--t);
  }
  .pl-side-open .pl-side { transform: none; visibility: visible; transition: transform var(--t) var(--ease), visibility 0s; }
  .pl-side-open .pl-scrim { opacity: 1; pointer-events: auto; }
  .side-search { display: flex; }
  .side-toggle .ic { display: none; }
  .side-toggle::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E") center / contain no-repeat; }
  .pl-top { min-height: 64px; padding: 10px 10px 10px 10px; border-radius: 22px; gap: 8px; }
  .top-btn.top-burger { display: grid; }
  .top-search, .top-pill, .top-theme, .top-btn.is-ai, .top-user-txt, .top-user > .ic, .top-mode { display: none; }
  .top-title { font-size: 18px; }
  .top-sub { display: none; }
  .top-heading { margin-left: 2px; flex: 1 1 auto; max-width: none; }
  .top-user { height: auto; padding: 0; margin: 0; box-shadow: none; }
  .top-user:hover { background: none; }
  .top-user .avatar { width: 40px; height: 40px; }
  .pl-subnav { flex-direction: column; align-items: stretch; gap: 10px; }
  .pl-subnav .tabs { margin-right: -10px; padding-right: 10px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .sub-actions { justify-content: flex-start; margin-left: 0; }
  .pl-rolebar { border-radius: 18px; align-items: center; }
  .rolebar-txt { white-space: normal; font-size: 12.5px; line-height: 1.35; }
}
@media (max-width: 480px) {
  .sub-actions > .btn { flex: 1 1 auto; }
  .sub-actions > .btn-icon, .sub-actions > .btn.is-icon { flex: none; }
  .rolebar-exit span { display: none; }
  .rolebar-exit { width: 32px; padding: 0; justify-content: center; }
}

/* 4. Buttons --------------------------------------------------------------- */
.btn, .btn-icon {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border); --b-hover: var(--surface-2);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctl); border-radius: 999px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -.005em;
  white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none; flex: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.btn { padding: 0 20px; }
.btn .ic { width: 18px; height: 18px; }
.btn > .ic:first-child { margin-left: -4px; }
.btn > .ic:last-child:not(:first-child) { margin-right: -4px; }
.btn-icon { width: var(--ctl); padding: 0; }
.btn-icon .ic { width: 20px; height: 20px; }
.btn:hover, .btn-icon:hover { background: var(--b-hover); }
.btn:active, .btn-icon:active { transform: translateY(1px) scale(.985); }
.btn:disabled, .btn-icon:disabled, .btn[aria-disabled="true"], .btn-icon[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-primary { --b-bg: var(--primary); --b-fg: var(--primary-ink); --b-bd: transparent; --b-hover: var(--primary-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { box-shadow: 0 6px 16px -8px rgba(12, 45, 201, .45), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-dark { --b-bg: var(--pl-ink); --b-fg: #fff; --b-bd: transparent; --b-hover: #262B36; }
[data-theme="dark"] .btn-dark { --b-bg: #F2F3F5; --b-fg: #0A0C10; --b-hover: #FFFFFF; }
.btn-soft { --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: transparent; --b-hover: var(--surface-3); }
.btn-outline { --b-bg: transparent; --b-fg: var(--text); --b-bd: var(--border); --b-hover: var(--surface-2); }
.btn-ghost { --b-bg: transparent; --b-fg: var(--text-2); --b-bd: transparent; --b-hover: var(--hover); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger); --b-bd: transparent; --b-hover: color-mix(in srgb, var(--danger-soft) 70%, var(--danger) 14%); }
.btn-white { --b-bg: #fff; --b-fg: var(--pl-ink); --b-bd: transparent; --b-hover: #F3F4F6; }
/* On a --surface-2 row or panel (insight rows, queue items, soft cards): a raised surface button that reads in both
   themes. .btn-white stays for Ink, blue and photo surfaces only (it is pure white in dark mode too). */
.btn-raised { --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-soft); --b-hover: var(--surface-3); }
[data-theme="dark"] .btn-raised { --b-bd: var(--border); }
/* In dark mode a white button inside a tinted alert, a secret field or a soft card turns into a raised dark button
   (pure white there was the loudest thing on screen). On Ink, blue and photo surfaces it stays white. */
[data-theme="dark"] .alert .btn-white, [data-theme="dark"] .input-secret .btn-white, [data-theme="dark"] .card-soft .btn-white { --b-bg: rgba(255, 255, 255, .1); --b-fg: var(--text); --b-bd: rgba(255, 255, 255, .12); --b-hover: rgba(255, 255, 255, .16); }
.btn-sm { height: var(--ctl-sm); font-size: 13px; }
.btn.btn-sm { padding: 0 14px; gap: 6px; }
.btn-icon.btn-sm { width: var(--ctl-sm); }
.btn-icon.btn-sm .ic { width: 18px; height: 18px; }
.btn.btn-sm .ic { width: 16px; height: 16px; }
.btn-lg { height: var(--ctl-lg); font-size: 15px; }
.btn.btn-lg { padding: 0 26px; }
.btn-icon.btn-lg { width: var(--ctl-lg); }
.btn-block { width: 100%; }
.btn.is-loading, .btn-icon.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after, .btn-icon.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid var(--b-fg); border-right-color: transparent;
  animation: pl-spin .7s linear infinite;
}
.btn-group { display: inline-flex; align-items: center; }
.btn-group > .btn, .btn-group > .btn-icon { border-radius: 0; }
.btn-group > :first-child { border-radius: 999px 0 0 999px; }
.btn-group > :last-child { border-radius: 0 999px 999px 0; }
.btn-group > * + * { margin-left: -1px; }
.btn-group > .btn-primary + .btn-primary { margin-left: 1px; }
.btn .badge { margin-right: -6px; }
.btn-primary .badge { background: rgba(255, 255, 255, .22); }

.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 56px; height: 56px; border-radius: 50%;
  display: none; place-items: center; background: var(--primary); color: #fff;
  box-shadow: 0 14px 30px -10px var(--primary-glow);
}
.fab .ic { width: 24px; height: 24px; stroke-width: 2.2; }
@media (max-width: 979.98px) { .fab { display: grid; } }
.fab.is-demo { position: static; display: grid; }
.pl-has-bulk .fab { bottom: 86px; }

/* 5. Cards ----------------------------------------------------------------- */
.card { position: relative; min-width: 0; background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-width: 0; }
.card-head > :first-child { min-width: 0; }
.card-title { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 500; }
.card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.card-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.card-soft { background: var(--surface-2); box-shadow: none; }
@media (max-width: 640px) { .card { padding: 20px; } .card-head { flex-wrap: wrap; } .card-head > :first-child { flex: 1 1 220px; } .card-actions { flex-wrap: wrap; } }
.card-flat { box-shadow: none; }
.card-pad-0 { padding: 0; }
.card.lift, a.card, .card-link { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.card.lift:hover, a.card:hover, .card-link:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

.card-hero {
  background-color: var(--pl-ink); color: #fff; isolation: isolate; overflow: hidden;
  background-image: radial-gradient(130% 120% at 100% 0%, rgba(35, 66, 214, .66) 0%, rgba(12, 45, 201, .20) 36%, rgba(12, 45, 201, 0) 62%);
  box-shadow: 0 16px 36px -18px rgba(14, 17, 22, .6);
}
.card-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 10px);
  -webkit-mask-image: radial-gradient(120% 120% at 100% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 120% at 100% 0%, #000 0%, transparent 70%);
}
/* Dark theme: the hero keeps its own surface (deep Halor Blue), so "the first card is dark" still reads */
[data-theme="dark"] .card-hero {
  background-color: #0B0F22;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(92, 116, 245, .45), transparent 55%), linear-gradient(150deg, #1A2793 0%, #0E1550 55%, #0B0F22 100%);
  box-shadow: 0 0 0 1px rgba(132, 150, 255, .28), 0 16px 36px -18px rgba(0, 0, 0, .8);
}
[data-theme="dark"] .card-hero.kpi:hover { box-shadow: 0 0 0 1px rgba(132, 150, 255, .4), 0 22px 44px -18px rgba(0, 0, 0, .85); }
.card-hero .card-sub, .card-blue .card-sub { color: rgba(255, 255, 255, .62); }
.card-hero .muted, .card-blue .muted { color: rgba(255, 255, 255, .6); }
.card-hero .cents, .card-blue .cents { color: rgba(255, 255, 255, .42); }
.card-hero .btn-ghost, .card-blue .btn-ghost { --b-fg: rgba(255, 255, 255, .7); --b-hover: rgba(255, 255, 255, .1); }
.card-hero .btn-ghost:hover, .card-blue .btn-ghost:hover { color: #fff; }
.card-hero .card-foot, .card-blue .card-foot { border-top-color: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .6); }
.card-blue {
  background-color: var(--pl-blue); color: #fff; isolation: isolate; overflow: hidden;
  background-image: radial-gradient(120% 120% at 100% 0%, rgba(110, 132, 240, .5), transparent 55%);
  box-shadow: 0 16px 36px -18px rgba(12, 45, 201, .8);
}
.card-blue::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 5px, transparent 5px 10px); -webkit-mask-image: radial-gradient(100% 100% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(100% 100% at 100% 0%, #000, transparent 70%); }

/* KPI */
.kpi { display: flex; flex-direction: column; overflow: hidden; isolation: isolate; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.card-hero.kpi:hover { box-shadow: 0 22px 44px -18px rgba(14, 17, 22, .7); }
.kpi-top { display: flex; align-items: center; gap: 6px; min-height: 42px; }
.kpi-top > .kpi-ic { margin-right: auto; }
.kpi-top > .btn-icon { margin-right: -8px; color: var(--muted); }
.kpi-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text); }
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi-ic.is-blue { background: var(--primary); color: #fff; }
.kpi-ic.is-soft { background: var(--primary-soft); color: var(--primary-text); }
.kpi-ic.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.kpi-ic.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.kpi-ic.is-ok { background: var(--ok-soft); color: var(--ok-text); }
.kpi-label { margin-top: 18px; color: var(--muted); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { margin-top: 4px; font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font-size: .55em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi-foot { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-foot b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
/* a foot written as a sentence (inline <b>, links): flows as text instead of flex items */
.kpi-foot.is-text { display: block; }
.kpi-mark { position: absolute; right: -30px; bottom: -34px; z-index: -1; color: var(--text); opacity: .04; pointer-events: none; transform: rotate(-8deg); line-height: 0; -webkit-mask-image: linear-gradient(225deg, #000 35%, transparent 75%); mask-image: linear-gradient(225deg, #000 35%, transparent 75%); }
.kpi-mark .ic { width: 104px; height: 104px; stroke-width: 1.3; }
.kpi-spark { height: 36px; margin-top: 12px; }
.card-hero.kpi .kpi-ic { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.card-hero .kpi-label { color: rgba(255, 255, 255, .64); }
.card-hero .kpi-foot { color: rgba(255, 255, 255, .56); }
.card-hero .kpi-foot b { color: #fff; }
.card-hero .kpi-mark { color: #fff; opacity: .08; }
.card-hero .kpi-top > .btn-icon { color: rgba(255, 255, 255, .6); }
.card-hero .delta.up, .card-blue .delta.up { background: rgba(110, 132, 240, .22); color: #D3DBFF; }
.card-hero .delta.down, .card-blue .delta.down { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
.card-hero .hint, .card-blue .hint { color: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25); }
.card-hero .chip-info, .card-blue .chip-info { background: rgba(110, 132, 240, .22); color: #D3DBFF; }
.kpi-row { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-row.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) { .kpi-row.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .kpi-row, .kpi-row.cols-3, .kpi-row.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .kpi-row, .kpi-row.cols-3, .kpi-row.cols-5 {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin: 0 -10px; padding: 2px 10px 8px; scrollbar-width: none; scroll-padding: 0 10px;
  }
  .kpi-row::-webkit-scrollbar { display: none; }
  .kpi-row > * { flex: 0 0 78%; scroll-snap-align: start; }
  .kpi-value { font-size: 26px; }
}

/* Deltas */
.delta { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px 0 6px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; flex: none; }
.delta .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.delta.up { background: var(--primary-soft); color: var(--primary-text); }
.delta.down { background: var(--surface-3); color: var(--text-2); }
.delta.good { background: var(--ok-soft); color: var(--ok-text); }
.delta.bad { background: var(--danger-soft); color: var(--danger-text); }
.delta.warn { background: var(--warn-soft); color: var(--warn-text); }
.delta.flat { background: var(--surface-2); color: var(--muted); }

/* Category cards (Pharmly category grid) */
.cat-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cat-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -10px; padding: 2px 10px 8px; scrollbar-width: none; scroll-padding: 0 10px; } .cat-grid > * { flex: 0 0 72%; scroll-snap-align: start; } }
.cat-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: 12px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); text-align: left; width: 100%; cursor: pointer; overflow: hidden; isolation: isolate; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease); }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.cat-title { font-size: 13.5px; font-weight: 600; color: var(--text-2); grid-column: 1; }
.cat-count { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 12px; grid-column: 1; line-height: 1.1; }
.cat-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 12px; grid-column: 1 / -1; flex-wrap: wrap; }
.cat-ic { grid-column: 2; grid-row: 1 / 3; align-self: end; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.cat-ic .ic { width: 20px; height: 20px; }
.cat-card.is-active { background-color: var(--pl-ink); color: #fff; background-image: radial-gradient(120% 120% at 100% 0%, rgba(35, 66, 214, .6), transparent 60%); box-shadow: 0 16px 36px -18px rgba(14, 17, 22, .6); }
[data-theme="dark"] .cat-card.is-active { background-color: #0B0F22; background-image: radial-gradient(120% 90% at 100% 0%, rgba(92, 116, 245, .4), transparent 55%), linear-gradient(150deg, #1A2793 0%, #0E1550 60%, #0B0F22 100%); box-shadow: 0 0 0 1px rgba(132, 150, 255, .28); }
.cat-card.is-active .cat-title { color: rgba(255, 255, 255, .72); }
.cat-card.is-active .cat-foot { color: rgba(255, 255, 255, .56); }
.cat-card.is-active .cat-ic { background: var(--primary); color: #fff; }
.cat-card.is-active .delta.up { background: rgba(110, 132, 240, .22); color: #D3DBFF; }
.cat-card.is-active .delta.down { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }

/* Settings rows (Pharmly settings) */
.settings { display: flex; flex-direction: column; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.set-row:first-child { padding-top: 4px; }
.set-row:last-child { border-bottom: 0; padding-bottom: 4px; }
.set-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.set-desc { font-size: 13px; color: var(--muted); margin-top: 2px; max-width: 640px; }
.set-control { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
@media (max-width: 560px) { .set-row { grid-template-columns: minmax(0, 1fr); gap: 10px; } .set-control { justify-content: flex-start; } .set-row:has(.switch:only-child) { grid-template-columns: minmax(0, 1fr) auto; } }

/* 6. Chips, tags, avatars --------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--surface-2); color: var(--text-2); flex: none; vertical-align: middle; }
.chip .ic { width: 14px; height: 14px; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip-ok { background: var(--ok-soft); color: var(--ok-text); }
.chip-warn { background: var(--warn-soft); color: var(--warn-text); }
.chip-danger { background: var(--danger-soft); color: var(--danger-text); }
.chip-info { background: var(--primary-soft); color: var(--primary-text); }
.chip-ok.dot::before { background: var(--ok); } .chip-warn.dot::before { background: var(--warn); } .chip-danger.dot::before { background: var(--danger); } .chip-info.dot::before { background: var(--primary); }
.chip-neutral { background: var(--surface-3); color: var(--text-2); }
.chip-dark { background: var(--pl-ink); color: #fff; }
[data-theme="dark"] .chip-dark { background: #F2F3F5; color: #0A0C10; }
.chip-outline { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.chip-lg { height: 30px; padding: 0 12px; font-size: 13px; }
.chip-sm { height: 20px; padding: 0 8px; font-size: 11px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); white-space: nowrap; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.chip-btn:hover { background: var(--surface-2); color: var(--text); }
.chip-btn[aria-pressed="true"], .chip-btn.is-active { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.chip-btn .ic { width: 15px; height: 15px; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .01em; line-height: 1; white-space: nowrap; background: var(--surface-3); color: var(--text-2); flex: none; vertical-align: middle; }
.tag .ic { width: 12px; height: 12px; stroke-width: 2; }
.tag-info, .tag-blue { background: var(--primary-soft); color: var(--primary-text); }
.tag-ok { background: var(--ok-soft); color: var(--ok-text); }
.tag-warn { background: var(--warn-soft); color: var(--warn-text); }
.tag-danger { background: var(--danger-soft); color: var(--danger-text); }
.tag-dark { background: var(--pl-ink); color: #fff; }
[data-theme="dark"] .tag-dark { background: #2A2F3A; }
.tag-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.tag-stripe { background: var(--stripe-blue); color: #fff; }

.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: #fff; background: var(--pl-blue); user-select: none; vertical-align: middle; line-height: 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar-lg { width: 48px; height: 48px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.av-1 { background: var(--pl-blue); color: #fff; }
.av-2 { background: var(--pl-ink); color: #fff; }
.av-3 { background: var(--pl-graphite); color: #fff; }
.av-4 { background: var(--pl-slate); color: #fff; }
.av-5 { background: var(--pl-silver); color: var(--pl-ink); }
.av-6 { background: var(--pl-blue-3); color: var(--pl-ink); }
[data-theme="dark"] .av-1 { background: #3F58E8; }
[data-theme="dark"] .av-2 { background: #2A2F3A; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
[data-theme="dark"] .av-3 { background: #454B59; }
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--surface) !important; }
.avatar-group .avatar + .avatar { margin-left: -8px; }
.avatar-group .avatar-sm + .avatar-sm, .avatar-group .avatar-xs + .avatar-xs { margin-left: -6px; }
.avatar-group .avatar.more { background: var(--surface-3); color: var(--text-2); }

/* 7. Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field-label .opt { color: var(--muted); font-weight: 500; }
.field-label .req { color: var(--danger-text); }
.field-help { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--danger-text); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.field-error .ic { width: 15px; height: 15px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

.input, .select, .textarea {
  width: 100%; min-width: 0; height: var(--ctl); padding: 0 14px;
  border-radius: var(--r-ctl); border: 1px solid var(--control-border);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--control-border) 55%, var(--muted)); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"], .field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.input[aria-invalid="true"]:focus, .field.has-error .input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input[readonly] { background: var(--surface-2); }
.input-sm, .select.input-sm { height: var(--ctl-sm); border-radius: var(--r-sm); font-size: 13px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px; cursor: pointer; text-overflow: ellipsis; }
.select.pill, .select-pill { border-radius: 999px; padding-left: 16px; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }

.input-group { display: flex; align-items: stretch; min-width: 0; height: var(--ctl); border-radius: var(--r-ctl); border: 1px solid var(--control-border); background: var(--surface); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.field.has-error .input-group, .input-group:has(.input[aria-invalid="true"]) { border-color: var(--danger); }
.field.has-error .input-group:focus-within, .input-group:has(.input[aria-invalid="true"]):focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.field.has-error .input-group .addon { color: var(--danger-text); }
.input-group .input { border: 0; border-radius: 0; height: 100%; box-shadow: none !important; background: transparent; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.input-group .addon:first-child { border-right: 1px solid var(--border-soft); }
.input-group .addon:last-child { border-left: 1px solid var(--border-soft); }
.input-group .btn { height: 100%; border-radius: 0; border: 0; }

.search { display: flex; align-items: center; gap: 10px; height: var(--ctl); min-width: 0; padding: 0 16px; border-radius: 999px; border: 1px solid var(--control-border); background: var(--surface); color: var(--muted); transition: border-color var(--t-fast), box-shadow var(--t-fast); cursor: text; }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; }
.search input::placeholder { color: var(--muted); }
.search .ic { width: 18px; height: 18px; color: var(--text-2); }
.search .kbd { margin-right: -6px; }
.search.is-soft { background: var(--surface-2); border-color: transparent; }

.switch { appearance: none; -webkit-appearance: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 999px; background: #CDD1D9; cursor: pointer; flex: none; vertical-align: middle; transition: background var(--t-fast) var(--ease); }
[data-theme="dark"] .switch { background: #333947; }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(14, 17, 22, .28); transition: transform var(--t) var(--ease); }
.switch:checked { background: var(--primary); }
.switch:checked::before { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }

.check, .radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.35; min-width: 0; }
input.check, .check > input[type="checkbox"], input.radio, .radio > input[type="radio"], .table input[type="checkbox"], .insight-tasks input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0;
  border: 1.5px solid var(--faint); background: var(--surface); cursor: pointer; vertical-align: middle;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
[data-theme="dark"] input.check, [data-theme="dark"] .check > input[type="checkbox"], [data-theme="dark"] .table input[type="checkbox"], [data-theme="dark"] .insight-tasks input[type="checkbox"], [data-theme="dark"] .radio > input[type="radio"] { border-color: #4A5060; }
input.check, .check > input[type="checkbox"], .table input[type="checkbox"], .insight-tasks input[type="checkbox"] { border-radius: 6px; }
input.radio, .radio > input[type="radio"] { border-radius: 50%; }
input.check:checked, .check > input:checked, .table input[type="checkbox"]:checked, .insight-tasks input:checked { background: var(--primary) var(--check) center / 14px no-repeat; border-color: var(--primary); }
input.check:indeterminate, .check > input:indeterminate, .table input[type="checkbox"]:indeterminate { background: var(--primary) var(--dash) center / 14px no-repeat; border-color: var(--primary); }
input.radio:checked, .radio > input:checked { background: var(--primary); border-color: var(--primary); box-shadow: inset 0 0 0 3.5px var(--surface); }
input.check:hover, .check:hover > input, .radio:hover > input { border-color: var(--primary); }
.check > input:focus-visible, input.check:focus-visible, .radio > input:focus-visible, .table input[type="checkbox"]:focus-visible, .insight-tasks input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.check > input:disabled, .radio > input:disabled { opacity: .5; cursor: not-allowed; }
/* A .switch inside a table keeps the switch look (the table checkbox rule above must not restyle it) */
.table input.switch[type="checkbox"] { width: 42px; height: 24px; border: 0; border-radius: 999px; background: #CDD1D9; }
[data-theme="dark"] .table input.switch[type="checkbox"] { background: #333947; border: 0; }
.table input.switch[type="checkbox"]:checked { background: var(--primary); }
.table input.switch[type="checkbox"]:hover { border: 0; }

.segmented { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { height: calc(var(--ctl) - 10px); padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(14, 17, 22, .1), 0 0 0 1px rgba(14, 17, 22, .03); }
[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--surface-3); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.segmented button .ic { width: 16px; height: 16px; }
.segmented.is-sm button { height: 28px; padding: 0 12px; font-size: 12.5px; }

.qty { display: inline-flex; align-items: center; height: var(--ctl-sm); padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); flex: none; }
.qty button { width: calc(var(--ctl-sm) - 6px); height: calc(var(--ctl-sm) - 6px); border-radius: 50%; display: grid; place-items: center; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1; transition: background var(--t-fast); }
.qty button:hover { background: var(--surface); box-shadow: 0 1px 2px rgba(14, 17, 22, .08); }
.qty button:disabled { opacity: .35; }
.qty button .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.qty input { width: 34px; height: 100%; border: 0; outline: none; background: transparent; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; color: var(--text); }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty:focus-within { box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px var(--focus); }
.qty button:focus-visible { outline-offset: 0; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 28px 20px; border-radius: var(--r-md); border: 1.5px dashed var(--control-border); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast); position: relative; }
.dropzone:hover { border-color: var(--primary); }
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); transform: scale(1.005); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--primary-text); box-shadow: var(--sh-1); margin-bottom: 6px; }
.dz-ic .ic { width: 22px; height: 22px; }
.dz-title { color: var(--text); font-weight: 700; font-size: 14.5px; }
.dz-text { font-size: 12.5px; }
.dropzone.is-over .dz-title { color: var(--primary-text); }

.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 56px; border-radius: var(--r-ctl); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); caret-color: var(--primary); }
.otp input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.otp input.is-filled { border-color: color-mix(in srgb, var(--primary) 45%, var(--control-border)); }
.otp.is-error input { border-color: var(--danger); animation: pl-shake .35s var(--ease); }
.otp .otp-sep { align-self: center; width: 10px; height: 2px; background: var(--border); border-radius: 2px; }
@media (max-width: 400px) { .otp { gap: 6px; } .otp input { width: 40px; height: 50px; font-size: 19px; } }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none; cursor: pointer; background: linear-gradient(to right, var(--primary) 0, var(--primary) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 2px 8px rgba(14, 17, 22, .2); transition: transform var(--t-fast); }
.range::-webkit-slider-thumb:hover { transform: scale(1.08); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 2px 8px rgba(14, 17, 22, .2); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus-ring); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus-ring); }

.input-secret { display: flex; align-items: center; gap: 10px; min-width: 0; height: var(--ctl); padding: 0 5px 0 14px; border-radius: var(--r-ctl); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); }
.input-secret > .ic { color: var(--muted); }
.secret-val { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 13.5px; letter-spacing: .06em; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-secret .btn { margin-left: auto; height: calc(var(--ctl) - 10px); }

/* 8. Tabs ------------------------------------------------------------------ */
.tabs { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 20px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.tab:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-3)); }
.tab .ic { width: 17px; height: 17px; }
.tab.active, .tab[aria-selected="true"] { background: var(--primary); color: #fff; font-weight: 600; box-shadow: none; }
.tab .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.tab.active .count, .tab[aria-selected="true"] .count { background: rgba(255, 255, 255, .2); color: #fff; }
.card .tabs .tab, .drawer-body .tabs .tab, .pl-modal .tabs .tab { background: var(--surface-2); }
.card .tabs .tab:hover { background: var(--surface-3); }
.card .tabs .tab .count { background: var(--surface); }
.card .tabs .tab.active, .card .tabs .tab[aria-selected="true"], .drawer-body .tabs .tab.active, .drawer-body .tabs .tab[aria-selected="true"] { background: var(--primary); }
.card .tabs .tab.active .count { background: rgba(255, 255, 255, .2); }
.tabs.is-sm .tab { height: var(--ctl-sm); padding: 0 14px; font-size: 13px; }

.tabs-line { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 0; margin: 0; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line > .tab, .card .tabs-line > .tab, .drawer-body .tabs-line > .tab { height: 42px; padding: 0 1px; border-radius: 0; background: none; color: var(--muted); font-weight: 600; box-shadow: none; }
.tabs-line > .tab:hover, .card .tabs-line > .tab:hover { color: var(--text); background: none; }
.tabs-line > .tab.active, .tabs-line > .tab[aria-selected="true"], .card .tabs-line > .tab.active, .card .tabs-line > .tab[aria-selected="true"] { color: var(--text); background: none; box-shadow: none; }
.tabs-line > .tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transition: transform var(--t) var(--ease); }
.tabs-line > .tab.active::after, .tabs-line > .tab[aria-selected="true"]::after { transform: scaleX(1); }
.tabs-line > .tab .count, .card .tabs-line > .tab .count { background: var(--surface-2); color: var(--muted); height: 20px; min-width: 20px; font-size: 11px; }
.tabs-line > .tab.active .count, .card .tabs-line > .tab.active .count { background: var(--primary-soft); color: var(--primary-text); }

/* 9. Table, toolbar, pager, bulkbar ----------------------------------------- */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r-md); -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
.table-wrap.is-sticky { max-height: 560px; overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; color: var(--text); }
.table th { position: sticky; top: 0; z-index: 1; height: 44px; padding: 0 12px; background: var(--surface-2); color: var(--muted-2); font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; vertical-align: middle; }
.table th:not(:last-child) { box-shadow: 1px 0 0 0 var(--surface-2); }
.table th:first-child { border-radius: 12px 0 0 12px; padding-left: 16px; }
.table th:last-child { border-radius: 0 12px 12px 0; padding-right: 16px; }
.table th.t-num, .table td.t-num { text-align: right; }
.table th button.sort, .th-sort { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: inherit; border-radius: 6px; }
.table th button.sort .ic, .th-sort .ic { width: 14px; height: 14px; opacity: .6; }
.table th[aria-sort] { color: var(--text); }
.table td { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; background: transparent; white-space: nowrap; transition: background var(--t-fast); }
.table td.t-wrap, .table .t-wrap { white-space: normal; min-width: 220px; }
.table td:first-child { padding-left: 16px; }
.table td:last-child { padding-right: 16px; }
.table tbody tr:last-child td { border-bottom-color: transparent; }
.table tbody tr:hover td { background: var(--row-hover); border-bottom-color: transparent; }
.table tbody tr:has(+ tr:hover) td { border-bottom-color: transparent; }
.table tbody tr:hover td:first-child, .table tbody tr.is-selected td:first-child { border-radius: 12px 0 0 12px; }
.table tbody tr:hover td:last-child, .table tbody tr.is-selected td:last-child { border-radius: 0 12px 12px 0; }
.table tbody tr.is-selected td { background: var(--primary-soft); border-bottom-color: transparent; }
.table tbody tr.is-clickable { cursor: pointer; }
.table .t-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .t-strong, .t-strong { font-weight: 600; }
.t-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.t-dose, .t-inline { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; white-space: nowrap; }
/* Long names: one line with ellipsis (put the full name in title=""). The second line goes in .t-sub. */
.t-name { display: block; max-width: 172px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-name.is-wide { max-width: 320px; }
.t-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
/* Name + dose (+ tag) on ONE line, the name ellipsizes first: "Magnésio dimalato 300 mg" */
.t-line { display: flex; align-items: baseline; gap: 4px; min-width: 0; max-width: 220px; white-space: nowrap; }
.t-line > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.t-line > .t-dose, .t-line > .tag { flex: none; margin-left: 0; }
.t-line > .tag { align-self: center; margin-left: 2px; }
.t-id { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-check { width: 44px; padding-right: 0 !important; }
.t-actions { text-align: right; white-space: nowrap; width: 1%; }
.t-actions .btn-icon { width: 32px; height: 32px; color: var(--muted); border: 0; background: transparent; }
.t-actions .btn-icon:hover { background: var(--surface-3); color: var(--text); }
.t-actions .btn-icon .ic { width: 18px; height: 18px; }
.t-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-cell .t-thumb { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.t-cell .t-thumb .ic { width: 18px; height: 18px; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }
.tw-progress { height: 4px; margin: 10px auto 0; width: 120px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; display: none; }
.tw-progress > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--text-2); transition: transform 80ms linear; }
.table-wrap.has-overflow + .tw-progress { display: block; }
/* Frozen columns. .sticky-start pins the first column (and the next one when the first is .t-check);
   .sticky-end pins the last column (row actions). Cells get an opaque background (--tw-bg, the card
   surface by default) and an edge shadow while content scrolls under them. */
.table-wrap { --tw-bg: var(--surface); }
.table-wrap.sticky-start .table tr > :first-child, .table-wrap.sticky-start .table tr > .t-check:first-child + *,
.table-wrap.sticky-end .table tr > :last-child { position: sticky; z-index: 2; background-color: var(--tw-bg); }
.table-wrap.sticky-start .table tr > :first-child { left: 0; }
.table-wrap.sticky-start .table tr > .t-check:first-child + * { left: var(--tw-c1, 44px); }
.table-wrap.sticky-end .table tr > :last-child { right: 0; }
.table-wrap.sticky-start .table th:first-child, .table-wrap.sticky-start .table tr > th.t-check:first-child + th,
.table-wrap.sticky-end .table th:last-child { z-index: 3; background: var(--surface-2); }
.table-wrap.sticky-start .table tbody tr:hover > :is(:first-child, .t-check:first-child + *), .table-wrap.sticky-end .table tbody tr:hover > :last-child { background: linear-gradient(var(--row-hover), var(--row-hover)), var(--tw-bg); }
.table-wrap.sticky-start .table tbody tr.is-selected > :is(:first-child, .t-check:first-child + *), .table-wrap.sticky-end .table tbody tr.is-selected > :last-child { background: linear-gradient(var(--primary-soft), var(--primary-soft)), var(--tw-bg); }
.table-wrap.sticky-start.has-overflow:not(.at-start) .table tr > :first-child:not(.t-check),
.table-wrap.sticky-start.has-overflow:not(.at-start) .table tr > .t-check:first-child + * { box-shadow: 10px 0 12px -10px rgba(14, 17, 22, .28); clip-path: inset(0 -24px 0 0); }
.table-wrap.sticky-end.has-overflow:not(.at-end) .table tr > :last-child { box-shadow: -10px 0 12px -10px rgba(14, 17, 22, .28); clip-path: inset(0 0 0 -24px); }
[data-theme="dark"] .table-wrap.sticky-start.has-overflow:not(.at-start) .table tr > :first-child:not(.t-check),
[data-theme="dark"] .table-wrap.sticky-start.has-overflow:not(.at-start) .table tr > .t-check:first-child + * { box-shadow: 10px 0 12px -10px rgba(0, 0, 0, .7); }
[data-theme="dark"] .table-wrap.sticky-end.has-overflow:not(.at-end) .table tr > :last-child { box-shadow: -10px 0 12px -10px rgba(0, 0, 0, .7); }
/* Auto sticky tables (more than 12 rows) fade at the bottom while there are more rows below */
.table-wrap.is-sticky:not(.at-bottom) { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), rgba(0, 0, 0, .25)); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), rgba(0, 0, 0, .25)); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; min-width: 0; }
.toolbar .search { flex: 1 1 240px; max-width: 380px; }
.toolbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.toolbar-spacer { flex: 1 1 auto; }
.toolbar .select { width: auto; border-radius: 999px; padding-left: 16px; }
@media (max-width: 640px) {
  .toolbar { gap: 8px; }
  .toolbar-end { display: contents; }
  .toolbar .search { max-width: none; flex: 1 1 150px; }
  /* secondary buttons with a label become icon circles (the label stays for screen readers) */
  .toolbar .btn:not(.btn-primary):not(.keep-label):has(> .ic) { width: var(--ctl); padding: 0; gap: 0; }
  .toolbar .btn:not(.btn-primary):not(.keep-label):has(> .ic) > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .toolbar .btn:not(.btn-primary):not(.keep-label):has(> .ic) > .ic:first-child { margin: 0; }
  .toolbar .btn:not(.btn-primary):not(.keep-label):has(> .ic) > .ic + .ic { display: none; }
  .toolbar .btn:not(.btn-primary) .badge { position: absolute; top: -4px; right: -4px; margin: 0; }
  /* the toolbar primary becomes the round "+" of SPEC §7; when the page has a floating .fab it hides */
  .toolbar .btn-primary:not(.keep-label):has(> .ic) { width: var(--ctl); padding: 0; gap: 0; }
  .toolbar .btn-primary:not(.keep-label):has(> .ic) > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .toolbar .btn-primary:not(.keep-label):has(> .ic) > .ic:first-child { margin: 0; width: 20px; height: 20px; }
  body:has(.fab:not(.is-demo)) .toolbar .btn-primary, .toolbar .btn-primary.fab-mobile { display: none; }
  .toolbar .select { flex: 0 1 auto; }
}

/* Period stepper (Pharmly "Este mês ▾" with ‹ › circles):
   <div class="period"><button class="btn-icon btn-sm btn-outline" aria-label="Período anterior">‹</button>
   <select class="select select-pill">…</select><button class="btn-icon btn-sm btn-outline" aria-label="Próximo período">›</button></div> */
.period { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.period .select { width: auto; height: var(--ctl-sm); border-radius: 999px; padding-left: 14px; font-weight: 600; font-size: 13px; }
.period .btn-icon { flex: none; }
.filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-toggle { display: none; }
@media (max-width: 640px) {
  .filter-toggle:not([hidden]) { display: inline-flex; }
  .filter-toggle .ic:last-child { width: 14px; height: 14px; transition: transform var(--t-fast); }
  .filter-toggle[aria-expanded="true"] .ic:last-child { transform: rotate(180deg); }
  .filter-chips:not(.is-open) { display: none; }
  .filter-chips.is-open { margin-top: 8px; }
}
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 5px 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: opacity var(--t-fast), transform var(--t-fast); }
.filter-chip b { font-weight: 700; }
.filter-chip .fc-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.filter-chip .fc-x:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.filter-chip .fc-x .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.filter-chip.is-removing { opacity: 0; transform: scale(.9); }
.filter-clear { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; border-radius: 6px; }
.filter-clear:hover { color: var(--text); }

.views { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; min-width: 0; max-width: 100%; }
.views::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .views { margin-right: -20px; padding-right: 20px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); } }
.view-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.view-pill:hover { color: var(--text); background: var(--surface-2); }
.view-pill[aria-pressed="true"], .view-pill.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.view-pill .count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-pill .ic { width: 15px; height: 15px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 13px; }
.pager-size { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pager-size b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager-size .select { width: auto; height: 32px; padding: 0 30px 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; background-position: right 9px center; background-size: 14px; }
.pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-pages button, .pager-pages a, .pager-pages span { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background var(--t-fast), color var(--t-fast); }
.pager-pages button:hover, .pager-pages a:hover { background: var(--surface-3); color: var(--text); }
.pager-pages .active, .pager-pages [aria-current="page"] { background: var(--primary); color: #fff; }
.pager-pages .active:hover, .pager-pages [aria-current="page"]:hover { background: var(--primary); color: #fff; }
.pager-pages .gap { background: none; min-width: 20px; padding: 0; color: var(--muted); }
.pager-pages button:disabled { opacity: .4; }
.pager-pages .ic { width: 16px; height: 16px; }

.bulkbar {
  position: fixed; left: 50%; bottom: 22px; z-index: 70;
  display: flex; align-items: center; gap: 4px; padding: 7px 7px 7px 18px; max-width: calc(100vw - 24px);
  border-radius: 999px; background: #0E1116; color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px -12px rgba(14, 17, 22, .55);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; visibility: hidden;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease), visibility 0s linear var(--t);
}
[data-theme="dark"] .bulkbar { background: #20242F; }
.bulkbar.show, .bulkbar.is-open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.bulkbar-count { font-weight: 700; font-size: 13.5px; white-space: nowrap; margin-right: 8px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 8px; }
.bulkbar-count i { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--pl-blue); font-style: normal; font-size: 12px; }
.bulkbar .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .14); margin: 0 4px; flex: none; }
.bulkbar .btn, .bulkbar .btn-icon { --b-bg: transparent; --b-fg: #fff; --b-bd: transparent; --b-hover: rgba(255, 255, 255, .1); height: 36px; }
.bulkbar .btn { padding: 0 14px; font-size: 13px; }
.bulkbar .btn-icon { width: 36px; color: rgba(255, 255, 255, .7); }
.bulkbar .btn-primary { --b-bg: var(--pl-blue); --b-hover: var(--pl-blue-2); }
.bulkbar-actions { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
@media (max-width: 640px) {
  .bulkbar { left: 12px; right: 12px; bottom: 12px; transform: translateY(calc(100% + 40px)); border-radius: 22px; padding-left: 14px; }
  .bulkbar.show, .bulkbar.is-open { transform: none; }
  .bulkbar .btn .ic + span, .bulkbar .btn .ic + .bulk-lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bulkbar .btn:has(.ic) { width: 40px; padding: 0; }
}
/* Toasts stack above an open bulk bar */
.pl-has-bulk .pl-toasts { bottom: 86px; }

/* 10. Lists, timeline, steps, kanban ---------------------------------------- */
.list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.list-row, .asset { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; text-align: left; width: 100%; transition: background var(--t-fast), transform var(--t-fast); }
a.list-row:hover, button.list-row:hover, a.asset:hover, button.asset:hover { background: var(--surface-3); }
.list-row.no-ic, .asset.no-ic { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; }
.list-ic, .asset-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.list-ic .ic, .asset-ic .ic { width: 20px; height: 20px; }
.list-ic.is-dark, .asset-ic.is-dark, .asset-ic.dark { background: var(--pl-ink); color: #fff; }
[data-theme="dark"] .list-ic.is-dark, [data-theme="dark"] .asset-ic.is-dark, [data-theme="dark"] .asset-ic.dark { background: #2A2F3A; }
.list-ic.is-blue, .asset-ic.is-blue, .asset-ic.blue { background: var(--primary); color: #fff; }
.list-ic.is-soft, .asset-ic.is-soft { background: var(--primary-soft); color: var(--primary-text); }
.list-ic.is-ok { background: var(--ok-soft); color: var(--ok-text); } .list-ic.is-warn { background: var(--warn-soft); color: var(--warn-text); } .list-ic.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.list-main { min-width: 0; }
.list-title, .asset-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub, .asset-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-end, .asset-r { text-align: right; font-variant-numeric: tabular-nums; }
.list-end .list-title, .asset-r .asset-name { font-variant-numeric: tabular-nums; }
.share { height: 4px; width: 72px; margin: 7px 0 0 auto; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.share i { display: block; height: 100%; border-radius: 4px; background: var(--primary); width: var(--v, 50%); }
.list.is-plain { gap: 0; }
.list.is-plain .list-row { background: none; border-radius: 0; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.list.is-plain .list-row:last-child { border-bottom: 0; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; padding: 0 0 20px 34px; min-width: 0; }
.tl-item::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--border-soft); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot, .tl-item:not(:has(.tl-dot))::after { position: absolute; left: 4px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--faint); display: grid; place-items: center; color: #fff; }
.tl-item:not(:has(.tl-dot))::after { content: ""; }
.tl-dot .ic { width: 10px; height: 10px; stroke-width: 3; }
.tl-item.is-done .tl-dot, .tl-item.is-done::after { background: var(--primary); box-shadow: none; }
.tl-item.is-done::before { background: color-mix(in srgb, var(--primary) 35%, var(--border-soft)); }
.tl-item.is-current .tl-dot, .tl-item.is-current::after { box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 4px var(--primary-soft); background: var(--surface); }
.tl-item.is-ok .tl-dot, .tl-item.is-ok::after { background: var(--ok); box-shadow: none; }
.tl-item.is-warn .tl-dot, .tl-item.is-warn::after { background: var(--warn); box-shadow: none; }
.tl-item.is-danger .tl-dot, .tl-item.is-danger::after { background: var(--danger); box-shadow: none; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-body { margin-top: 8px; }

.steps { display: flex; align-items: flex-start; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; min-width: 0; }
.steps::-webkit-scrollbar { display: none; }
.step { position: relative; flex: 1 1 0; min-width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 4px; text-align: center; }
.step::before { content: ""; position: absolute; top: 14px; left: calc(-50% + 20px); right: calc(50% + 20px); height: 2px; border-radius: 2px; background: var(--border); }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--primary); }
.step-dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 2px var(--border); color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-dot .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.step.done .step-dot { background: var(--primary); box-shadow: none; color: #fff; }
.step.done .step-dot:empty::after { content: ""; width: 14px; height: 14px; background: var(--check) center / contain no-repeat; }
.step.current .step-dot { box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 5px var(--primary-soft); color: var(--primary-text); }
.step.current .step-dot:empty::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.step.is-danger .step-dot { box-shadow: inset 0 0 0 2px var(--danger), 0 0 0 5px var(--danger-soft); color: var(--danger-text); }
.step-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.step.todo .step-label { color: var(--muted); font-weight: 500; }
.step-meta { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.step.current .step-meta { color: var(--primary-text); font-weight: 600; }
.steps.is-yampi-split .step.is-yampi .step-dot { box-shadow: inset 0 0 0 2px var(--border); }

.kanban { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; min-width: 0; }
.kb-col { flex: 0 0 296px; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface-3) 72%, transparent); scroll-snap-align: start; transition: background var(--t-fast), box-shadow var(--t-fast); min-width: 0; }
[data-theme="dark"] .kb-col { background: #0F1218; box-shadow: inset 0 0 0 1px var(--border-soft); }
.kb-col.is-over { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.kb-col-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot name count" "sla sla total"; align-items: center; column-gap: 8px; row-gap: 6px; min-height: 58px; padding: 6px 8px 2px; }
.kb-col-head > .kb-dot { grid-area: dot; }
.kb-col-head > .kb-col-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kb-col-head > .kb-count { grid-area: count; }
.kb-col-head > .kb-total { grid-area: total; margin-left: 0; text-align: right; }
.kb-col-head > .kb-sla { grid-area: sla; min-width: 0; }
.kb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--primary)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--primary)) 18%, transparent); }
.kb-col-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.kb-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kb-total { margin-left: auto; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-sla { display: block; font-size: 11.5px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-sla .ic { vertical-align: -2px; margin-right: 5px; }
.kb-sla .ic { width: 13px; height: 13px; }
.kb-origin { font-size: 10.5px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 48px; }
.kb-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); cursor: grab; text-align: left; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t-fast); }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kb-card:active { cursor: grabbing; }
.kb-card.is-dragging { opacity: .5; transform: rotate(1.5deg); }
.kb-card.is-late::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--danger); }
.kb-card.is-warn::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--warn); }
.kb-card:focus-visible { outline-offset: 2px; }
.kb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-id { font-size: 12.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-amount { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-customer { font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.kb-meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kb-meta .avatar { width: 22px; height: 22px; font-size: 9px; }
.kb-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-time { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-time .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.kb-time.is-ok, .kb-time.ok { background: var(--surface-2); color: var(--text-2); }
.kb-time.is-warn, .kb-time.warn { background: var(--warn-soft); color: var(--warn-text); }
.kb-time.is-danger, .kb-time.danger { background: var(--danger-soft); color: var(--danger-text); }
.kb-empty { padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1.5px dashed var(--border); border-radius: 14px; }
@media (max-width: 640px) { .kanban { margin: 0 -10px; padding-left: 10px; padding-right: 10px; } .kb-col { flex-basis: 84%; } }

/* 11. Feedback: empty, skeleton, alert, insight, progress ------------------ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; max-width: 460px; margin: 0 auto; }
.empty-ic { position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; background: var(--surface-2); color: var(--primary-text); }
.empty-ic::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1.5px dashed var(--border); }
.empty-ic .ic { width: 28px; height: 28px; stroke-width: 1.7; }
.empty-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.empty-text { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.empty-actions, .empty .btn { margin-top: 10px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.empty-actions .btn { margin-top: 0; }
.empty.is-sm { padding: 24px 16px; }
.empty.is-sm .empty-ic { width: 52px; height: 52px; }
.empty.is-sm .empty-ic .ic { width: 22px; height: 22px; }

.skeleton { position: relative; overflow: hidden; display: block; border-radius: 10px; background: var(--surface-3); min-height: 12px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: pl-shimmer 1.4s ease-in-out infinite; }
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
.skeleton-text { height: 12px; border-radius: 6px; margin: 6px 0; }
.skeleton-title { height: 20px; width: 50%; border-radius: 8px; }
.skeleton-circle { border-radius: 50%; width: 40px; height: 40px; }
.skeleton-card { height: 140px; border-radius: var(--r-lg); }

.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px 14px 14px 16px; border-radius: var(--r-md); background: var(--info-soft); color: var(--text); }
.alert > .ic, .alert-ic { width: 20px; height: 20px; margin-top: 1px; color: var(--primary-text); }
.alert-title { font-weight: 700; font-size: 14px; line-height: 1.35; }
.alert-text { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.alert-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; align-self: center; }
.alert-actions .btn { height: var(--ctl-sm); padding: 0 14px; font-size: 13px; }
.alert-info { background: var(--info-soft); } .alert-info > .ic { color: var(--primary-text); }
.alert-ok { background: var(--ok-soft); } .alert-ok > .ic, .alert-ok .alert-ic { color: var(--ok-text); }
.alert-warn { background: var(--warn-soft); } .alert-warn > .ic, .alert-warn .alert-ic { color: var(--warn-text); }
.alert-danger { background: var(--danger-soft); } .alert-danger > .ic, .alert-danger .alert-ic { color: var(--danger-text); }
.alert.is-outline { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
@media (max-width: 640px) { .alert { grid-template-columns: auto minmax(0, 1fr); } .alert-actions { grid-column: 2; justify-self: start; } }

.insight { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-1); min-width: 0; overflow: hidden; }
.insight-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.insight-head .chip-info .ic { color: var(--primary-text); }
.insight-sev { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.insight-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.insight-text { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.insight-text b, .insight-text strong { color: var(--text); font-variant-numeric: tabular-nums; }
.insight-action { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.insight-action .t-micro { color: var(--primary-text); display: flex; align-items: center; gap: 6px; }
.insight-action .t-micro .ic { width: 14px; height: 14px; }
.insight-action p { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.insight-action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.insight-tasks { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.insight-tasks label { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; cursor: pointer; line-height: 1.45; }
.insight-tasks input { margin-top: 1px !important; }
.insight-tasks input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.insight-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.insight-foot .spacer { flex: 1; }
.insight-foot .btn-icon { width: 30px; height: 30px; color: var(--muted); border: 0; background: transparent; }
.insight-foot .btn-icon:hover { background: var(--surface-2); color: var(--text); }
.insight-foot .btn-icon[aria-pressed="true"] { color: var(--primary-text); background: var(--primary-soft); }
.insight-foot .btn-icon .ic { width: 16px; height: 16px; }

.progress { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.progress::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 0%); border-radius: inherit; background: var(--primary); transition: width var(--t-slow) var(--ease); }
.progress > i, .progress > span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 0%); border-radius: inherit; background: var(--primary); }
.progress.is-stripe::before { background: var(--stripe-blue); }
.progress.is-ink::before { background: var(--text); }
.progress.is-ok::before { background: var(--ok); } .progress.is-warn::before { background: var(--warn); } .progress.is-danger::before { background: var(--danger); }
/* Realised plus projection: .progress.has-proj with --v (solid) and --proj (striped, behind it);
   a goal tick is a child <i class="progress-goal" style="--goal:80%"></i> */
.progress.has-proj::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--proj, 0%); border-radius: inherit; background: var(--stripe-blue); opacity: .5; }
.progress.has-proj::before { z-index: 1; }
.progress > .progress-goal { left: var(--goal, 100%); right: auto; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); z-index: 2; }
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }
.progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.progress-label b { color: var(--text); font-variant-numeric: tabular-nums; }

.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }

/* Hint (KPI glossary) */
.hint { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; flex: none; color: var(--muted); font-size: 10.5px; font-weight: 800; line-height: 1; box-shadow: inset 0 0 0 1.5px var(--border); cursor: help; transition: color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); vertical-align: middle; }
.hint:hover, .hint[aria-expanded="true"] { color: var(--primary-text); box-shadow: inset 0 0 0 1.5px var(--primary); background: var(--primary-soft); }

/* 12. Floating layers -------------------------------------------------------- */
.pl-tip {
  position: fixed; z-index: 140; left: 0; top: 0; max-width: 280px; padding: 7px 11px; border-radius: 10px;
  background: var(--pl-ink); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.003em;
  pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity 120ms var(--ease), transform 120ms var(--ease);
  box-shadow: 0 8px 24px -8px rgba(14, 17, 22, .45);
}
[data-theme="dark"] .pl-tip { background: #2A2F3A; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 24px -8px rgba(0, 0, 0, .7); }
.pl-tip.is-on { opacity: 1; transform: none; }
.pl-tip .kbd { height: 18px; min-width: 18px; font-size: 10.5px; margin-left: 6px; background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }

.pl-menu, .pl-pop {
  position: fixed; z-index: 130; left: 0; top: 0; min-width: 220px; max-width: min(340px, calc(100vw - 16px));
  max-height: calc(100vh - 24px); overflow-y: auto;
  padding: 6px; border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: var(--sh-pop), var(--sh-ring);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right;
  transition: opacity 140ms var(--ease), transform 180ms var(--ease);
}
.pl-menu.is-open, .pl-pop.is-open { opacity: 1; transform: none; }
.pl-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px 8px 10px; border-radius: 12px; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; transition: background 100ms; }
.pl-menu-item > .ic { width: 18px; height: 18px; color: var(--text-2); }
.pl-menu-item:hover, .pl-menu-item.is-focus { background: var(--surface-2); outline: none; }
.pl-menu-item:focus-visible { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary-text); outline: none; }
.pl-menu-item .mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-menu-item .mi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-menu-item .mi-sub { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-menu-item .mi-meta { margin-left: auto; color: var(--muted); font-size: 12px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.pl-menu-item .mi-check { margin-left: auto; color: var(--primary-text); width: 17px; height: 17px; stroke-width: 2.3; }
.pl-menu-item.is-checked { font-weight: 600; }
.pl-menu-item.is-danger, .pl-menu-item.is-danger > .ic { color: var(--danger-text); }
.pl-menu-item.is-danger:hover { background: var(--danger-soft); }
.pl-menu-item:disabled, .pl-menu-item[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.pl-menu-sep { height: 1px; margin: 6px 8px; background: var(--border-soft); }
.pl-menu-head { padding: 10px 12px 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pl-menu-note { padding: 8px 12px 8px 10px; font-size: 12px; color: var(--muted); line-height: 1.45; display: flex; gap: 8px; }
.pl-menu-note .ic { width: 15px; height: 15px; margin-top: 1px; color: var(--faint); }
.pl-menu-user { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.pl-menu-user .mu-name { font-weight: 700; font-size: 14px; }
.pl-menu-user .mu-mail { font-size: 12px; color: var(--muted); }
.pl-pop { padding: 16px; width: 300px; }
.pop-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.pop-title .ic { width: 16px; height: 16px; color: var(--primary-text); }
.pop-text { font-size: 13px; color: var(--text-2); line-height: 1.55; margin-top: 6px; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); }

.pl-layer { position: fixed; inset: 0; z-index: 90; }
.pl-overlay { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity var(--t) var(--ease); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pl-layer.is-open .pl-overlay { opacity: 1; }
.pl-lock, .pl-lock body { overflow: hidden; }

.pl-drawer {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(var(--dw, 560px), calc(100vw - 24px));
  display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--sh-pop); overflow: hidden;
  transform: translateX(calc(100% + 24px)); transition: transform var(--t) var(--ease);
}
.pl-layer.is-open .pl-drawer { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 16px 24px; border-bottom: 1px solid var(--border-soft); flex: none; }
.drawer-titles { flex: 1; min-width: 0; padding-top: 4px; }
.drawer-title { font-size: 19px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; display: flex; align-items: center; gap: 10px; }
.drawer-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.drawer-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 24px 24px; overscroll-behavior: contain; }
.drawer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 16px 16px 24px; border-top: 1px solid var(--border-soft); flex: none; flex-wrap: wrap; }
.drawer-foot:empty { display: none; }
.drawer-foot .note { margin-right: auto; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .pl-drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100% - 40px); height: calc(100% - 40px); transform: translateY(calc(100% + 24px)); } .drawer-head { padding: 16px 12px 14px 18px; } .drawer-body { padding: 16px 18px 20px; } .drawer-foot { padding: 12px 12px 14px 18px; } }

.pl-modal-layer { display: grid; place-items: center; padding: 16px; z-index: 95; }
.pl-modal {
  position: relative; width: min(var(--mw, 520px), 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--sh-pop); overflow: hidden;
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.pl-layer.is-open .pl-modal { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 16px 6px 24px; }
.modal-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.modal-ic.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.modal-ic.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.modal-ic.is-ok { background: var(--ok-soft); color: var(--ok-text); }
.modal-ic .ic { width: 22px; height: 22px; }
.modal-title { flex: 1; font-size: 19px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; padding-top: 8px; }
.modal-body { padding: 10px 24px 22px; overflow-y: auto; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 16px 16px 24px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.modal-foot:empty { display: none; }
@media (max-width: 480px) { .modal-foot .btn { flex: 1; } }

.pl-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 135; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; max-width: calc(100vw - 24px); transition: bottom var(--t) var(--ease); }
.pl-toast {
  position: relative; pointer-events: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  width: 380px; max-width: 100%; padding: 14px 10px 14px 14px; border-radius: 18px; overflow: hidden;
  background: #0E1116; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px -14px rgba(14, 17, 22, .6);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
[data-theme="dark"] .pl-toast { background: #20242F; }
.pl-toast.is-open { opacity: 1; transform: none; }
.toast-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(110, 132, 240, .2); color: #9DB0FF; flex: none; }
.toast-ic .ic { width: 18px; height: 18px; }
.pl-toast.tone-ok .toast-ic { background: rgba(61, 178, 125, .18); color: #5DD39E; }
.pl-toast.tone-warn .toast-ic { background: rgba(227, 167, 63, .18); color: #F2BE5C; }
.pl-toast.tone-danger .toast-ic { background: rgba(236, 106, 83, .2); color: #FF8B74; }
.toast-body { min-width: 0; padding-top: 1px; }
.toast-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.toast-text { font-size: 13px; color: rgba(255, 255, 255, .7); line-height: 1.45; margin-top: 2px; }
.toast-end { display: flex; align-items: center; gap: 2px; }
.toast-action { height: 32px; padding: 0 12px; border-radius: 999px; color: #A9B8FF; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background var(--t-fast); }
.toast-action:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.toast-x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: rgba(255, 255, 255, .5); }
.toast-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.toast-x .ic { width: 16px; height: 16px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(110, 132, 240, .8); transform-origin: left; animation: pl-toast-bar var(--dur, 5s) linear forwards; }
.pl-toast:hover .toast-bar, .pl-toast:focus-within .toast-bar { animation-play-state: paused; }
@media (max-width: 640px) { .pl-toasts { left: 10px; right: 10px; bottom: 10px; align-items: stretch; } .pl-toast { width: auto; } .pl-has-bulk .pl-toasts { bottom: 80px; } }

/* Command palette */
.pl-cmdk-layer { z-index: 96; }
.pl-cmdk {
  position: absolute; left: 50%; top: 11vh; width: min(700px, calc(100vw - 24px)); max-height: min(640px, 80vh);
  display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); color: var(--text);
  box-shadow: var(--sh-pop), var(--sh-ring); overflow: hidden;
  opacity: 0; transform: translate(-50%, -8px) scale(.985); transition: opacity 180ms var(--ease), transform 220ms var(--ease);
}
.pl-layer.is-open .pl-cmdk { opacity: 1; transform: translate(-50%, 0); }
.cmdk-input-row { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--border-soft); flex: none; }
.cmdk-input-row > .ic { width: 20px; height: 20px; color: var(--text-2); }
.cmdk-input-row.is-ai > .ic { color: var(--primary-text); }
.cmdk-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 17px; font-weight: 500; color: var(--text); letter-spacing: -.01em; }
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-mode { transition: opacity var(--t-fast), transform var(--t-fast); }
.cmdk-mode[hidden] { display: inline-flex !important; opacity: 0; transform: scale(.9); pointer-events: none; }
.cmdk-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 8px 10px; overscroll-behavior: contain; scroll-padding: 8px; }
.cmdk-group + .cmdk-group { margin-top: 6px; }
.cmdk-label { padding: 10px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px 6px 8px; border-radius: 14px; color: var(--text); text-align: left; cursor: pointer; transition: background 80ms; }
.cmdk-item.is-active { background: var(--surface-2); }
.cmdk-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; transition: background 80ms, color 80ms; }
.cmdk-item.is-active .cmdk-ic { background: var(--primary); color: #fff; }
.cmdk-ic .ic { width: 18px; height: 18px; }
.cmdk-ic.is-ai { background: var(--primary-soft); color: var(--primary-text); }
.cmdk-ic.avatar { border-radius: 50%; font-size: 11px; }
.cmdk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmdk-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-title mark { background: none; color: var(--primary-text); font-weight: 700; }
.cmdk-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cmdk-end { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; flex: none; }
.cmdk-end .ic { width: 16px; height: 16px; opacity: 0; transition: opacity 80ms; }
.cmdk-item.is-active .cmdk-end .ic { opacity: 1; }
.cmdk-empty { padding: 36px 20px 40px; text-align: center; color: var(--muted); font-size: 13.5px; }
.cmdk-empty b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }
.cmdk-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px 10px 20px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; flex: none; background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cmdk-foot .kbd { height: 20px; min-width: 20px; font-size: 11px; }
.cmdk-foot .cf-ai { margin-left: auto; color: var(--muted); }
.cmdk-foot .cf-ai .ic { width: 14px; height: 14px; color: var(--primary-text); }
@media (max-width: 640px) { .pl-cmdk { top: 10px; max-height: calc(100vh - 20px); border-radius: 20px; } .cmdk-foot span:not(.cf-ai) { display: none; } .cmdk-foot .cf-ai { margin-left: 0; } }

.cmdk-answer {
  position: relative; display: block; width: 100%; text-align: left; margin: 4px 0 6px; padding: 18px 18px 14px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(180deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 35%, var(--surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent); overflow: hidden; isolation: isolate;
  animation: pl-pop-in var(--t) var(--ease) both;
}
.cmdk-answer.is-active { box-shadow: inset 0 0 0 2px var(--primary); }
.cmdk-answer::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, transparent) 0 2px, transparent 2px 9px); -webkit-mask-image: radial-gradient(70% 120% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(70% 120% at 100% 0%, #000, transparent 70%); }
.ans-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ans-top .chip { background: var(--surface); color: var(--primary-text); box-shadow: 0 1px 2px rgba(14, 17, 22, .06); }
.ans-q { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ans-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 14px; }
.ans-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ans-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ans-spark { width: 150px; height: 44px; flex: none; color: var(--primary-text); }
.ans-text { font-size: 14px; line-height: 1.55; color: var(--text-2); margin-top: 12px; }
.ans-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--primary) 12%, transparent); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ans-foot .ic { width: 14px; height: 14px; }
.ans-open { color: var(--primary-text); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.ans-none { font-size: 13.5px; color: var(--text-2); margin-top: 10px; line-height: 1.55; }
@media (max-width: 520px) { .ans-spark { display: none; } }

/* Lab IA assistant */
.pl-ai .drawer-head { padding-bottom: 14px; }
.pl-ai .drawer-foot { display: block; padding: 0; border-top: 0; }
.ai-av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--stripe-blue); color: #fff; flex: none; box-shadow: 0 8px 18px -10px var(--primary-glow); }
.ai-av .ic { width: 18px; height: 18px; }
.ai-av.is-sm { width: 28px; height: 28px; border-radius: 10px; }
.ai-av.is-sm .ic { width: 15px; height: 15px; }
.pl-ai .drawer-body { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface) 240px); }
.ai-thread { display: flex; flex-direction: column; gap: 16px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; animation: pl-pop-in var(--t) var(--ease) both; }
.ai-msg.is-user { justify-content: flex-end; }
.ai-bubble { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 14px; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; }
.ai-msg.is-user .ai-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.ai-msg.is-bot .ai-bubble { background: var(--surface); color: var(--text); border-top-left-radius: 6px; box-shadow: var(--sh-1), var(--sh-ring); }
.ai-msg.is-bot .ai-content { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: calc(100% - 38px); }
.ai-msg.is-bot .ai-content .ai-bubble { max-width: 100%; }
.ai-caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--primary); animation: pl-blink 1s steps(2) infinite; }
.ai-typing { display: inline-flex; gap: 5px; padding: 15px 16px; border-radius: 18px; border-top-left-radius: 6px; background: var(--surface); box-shadow: var(--sh-1), var(--sh-ring); }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .35; animation: pl-typing 1.1s var(--ease) infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
.ai-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 14px; padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1), var(--sh-ring); animation: pl-pop-in var(--t) var(--ease) both; }
.ai-card-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
@media (max-width: 640px) { .ai-card { grid-template-columns: minmax(0, 1fr); } .ai-card-spark { width: 100%; height: 40px; } .cmdk-foot .cf-ai { white-space: normal; line-height: 1.35; } }
.ai-card-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ai-card-spark { width: 120px; height: 40px; color: var(--primary-text); }
.ai-card-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ai-card-foot .ic { width: 14px; height: 14px; }
.ai-msg-tools { display: flex; gap: 2px; margin-left: -4px; }
.ai-msg-tools .btn-icon { width: 28px; height: 28px; color: var(--muted); border: 0; background: transparent; }
.ai-msg-tools .btn-icon:hover { background: var(--surface-2); color: var(--text); }
.ai-msg-tools .btn-icon[aria-pressed="true"] { color: var(--primary-text); }
.ai-msg-tools .btn-icon .ic { width: 15px; height: 15px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chips .chip-btn { height: auto; min-height: 34px; padding: 7px 14px; white-space: normal; text-align: left; line-height: 1.35; }
.ai-chips-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-chips-label .ic { width: 14px; height: 14px; color: var(--primary-text); }
.ai-composer { padding: 12px 16px 14px; border-top: 1px solid var(--border-soft); flex: none; }
.ai-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 22px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); transition: box-shadow var(--t-fast); }
.ai-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--primary), 0 0 0 3px var(--focus); }
.ai-box textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 140px; padding: 9px 0; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font-size: 14px; line-height: 1.45; }
.ai-box textarea::placeholder { color: var(--muted); }
.ai-box .btn-icon { width: 38px; height: 38px; }
.ai-note { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }
.ai-note .ic { width: 13px; height: 13px; }
.ai-ctx { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; margin-top: 6px; max-width: 100%; }
.ai-ctx .ic { width: 13px; height: 13px; }

/* Notifications */
.pl-notify .drawer-body { padding: 8px 12px 16px; }
.notif-group + .notif-group { margin-top: 8px; }
.notif-label { padding: 12px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.notif { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border-radius: 16px; color: var(--text); transition: background var(--t-fast); }
.notif:hover { background: var(--surface-2); }
.notif-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.notif-ic .ic { width: 18px; height: 18px; }
.notif-ic.tone-ok { background: var(--ok-soft); color: var(--ok-text); }
.notif-ic.tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.notif-ic.tone-danger { background: var(--danger-soft); color: var(--danger-text); }
.notif-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.notif-text { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.notif-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.notif:not(.is-unread) .notif-dot { visibility: hidden; }
.notif:not(.is-unread) .notif-title { font-weight: 500; color: var(--text-2); }

/* Tour */
.pl-tour { position: fixed; inset: 0; z-index: 97; }
.tour-hole { position: absolute; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(8, 10, 14, .58), 0 0 0 2px var(--primary), 0 0 0 7px rgba(74, 99, 240, .28); transition: left var(--t-slow) var(--ease), top var(--t-slow) var(--ease), width var(--t-slow) var(--ease), height var(--t-slow) var(--ease), border-radius var(--t-slow) var(--ease); pointer-events: none; }
.tour-hole.is-none { box-shadow: 0 0 0 9999px rgba(8, 10, 14, .58); width: 0; height: 0; }
.tour-card { position: absolute; width: min(340px, calc(100vw - 24px)); padding: 18px 18px 14px; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--sh-pop), var(--sh-ring); transition: left var(--t-slow) var(--ease), top var(--t-slow) var(--ease), opacity var(--t) var(--ease); }
.tour-count { display: flex; align-items: center; gap: 8px; color: var(--primary-text); }
.tour-count .ic { width: 14px; height: 14px; }
.tour-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-top: 8px; line-height: 1.3; }
.tour-text { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-top: 6px; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tour-dots { display: flex; gap: 5px; margin-right: auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--surface-3); transition: width var(--t) var(--ease), background var(--t); }
.tour-dots i.on { width: 18px; background: var(--primary); }
.tour-card .btn { height: 36px; font-size: 13px; padding: 0 14px; }

/* Shortcuts list */
.sc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--text); }
.sc-keys { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.sc-head { margin: 4px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sc-list + .sc-head { margin-top: 18px; }
@media (max-width: 560px) { .sc-list { grid-template-columns: minmax(0, 1fr); } }

/* 13. Motion --------------------------------------------------------------- */
.reveal.in { animation: pl-reveal 480ms var(--ease) both; }
.lift { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.lift:hover { transform: translateY(-2px); }
.pl-theming body, .pl-theming .pl-app, .pl-theming .pl-side, .pl-theming .pl-top, .pl-theming .card, .pl-theming .kpi, .pl-theming .table th, .pl-theming .table td, .pl-theming .btn, .pl-theming .chip, .pl-theming .tab, .pl-theming .input, .pl-theming .select, .pl-theming .list-row, .pl-theming .kb-col, .pl-theming .kb-card { transition: background-color 240ms var(--ease), color 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease); }

@keyframes pl-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pl-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pl-pop-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pl-drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pl-spin { to { transform: rotate(360deg); } }
@keyframes pl-shimmer { to { transform: translateX(100%); } }
@keyframes pl-ping { 0% { transform: scale(.6); opacity: .55; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes pl-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes pl-blink { 50% { opacity: 0; } }
@keyframes pl-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pl-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton::after, .dot.pulse::after, .ai-caret { animation: none !important; }
  .reveal.in, .view-in { animation: none !important; }
  .kpi:hover, .card.lift:hover, .cat-card:hover, .kb-card:hover, a.card:hover { transform: none; }
}
/* Same rules when the page is opened with ?reduced=1 (PL.reduced() is true and <html> gets .pl-reduced) */
.pl-reduced *, .pl-reduced *::before, .pl-reduced *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
.pl-reduced .skeleton::after, .pl-reduced .dot.pulse::after, .pl-reduced .ai-caret, .pl-reduced .reveal.in, .pl-reduced .view-in { animation: none !important; }
.pl-reduced .kpi:hover, .pl-reduced .card.lift:hover, .pl-reduced .cat-card:hover, .pl-reduced .kb-card:hover, .pl-reduced a.card:hover { transform: none; }

/* 13b. Shared pieces promoted from the screens ------------------------------ */
/* Tab intro: one short lead under the subnav, an optional title only when it says more than the tab label
   (a period, a scope, a greeting), and an optional meta on the right.
   <div class="view-intro"><div class="view-intro-main"><h2 class="view-intro-title">…</h2><p class="view-intro-text">…</p></div><div class="view-intro-end">…</div></div> */
.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; margin: 0 2px; min-width: 0; }
.view-intro-main { flex: 1 1 520px; min-width: 0; }
.view-intro-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; color: var(--text); text-wrap: balance; }
.view-intro-text, .view-intro > p { margin: 0; max-width: 860px; color: var(--muted); font-size: 13.5px; line-height: 1.55; text-wrap: pretty; }
.view-intro b, .view-intro strong { color: var(--text-2); font-weight: 600; }
.view-intro-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .view-intro-title { font-size: 18px; } .view-intro-end { width: 100%; } }
/* Stage chip (PL.stageChip): neutral chip + stage colour dot, the same on every screen */
.chip-stage { gap: 7px; background: var(--surface-3); color: var(--text); }
.chip-stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--primary)); flex: none; }
.chip-stage.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.chip-stage.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.chip-stage.is-done { background: var(--ok-soft); color: var(--ok-text); }
.chip-stage-orig { margin-left: 2px; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; background: var(--surface); color: var(--muted-2); }
/* Pill inside a sentence (a clickable number in a Lab IA brief, a highlighted count): .text-pill, .is-danger / .is-warn.
   Trailing punctuation goes in <span class="punct">.</span> right after it: the pill's right padding closes up so it
   reads "12 receitas chegaram." and never "chegaram ." */
.text-pill { display: inline; padding: 1px 7px 2px; margin: 0 1px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background var(--t-fast), color var(--t-fast); }
a.text-pill:hover { background: var(--primary); color: #fff; }
.text-pill.is-danger { background: var(--danger-soft); color: var(--danger-text); }
a.text-pill.is-danger:hover { background: var(--danger); color: #fff; }
.text-pill.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.text-pill:has(+ .punct) { padding-right: 3px; margin-right: 0; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.punct { margin-left: 0; }
/* Summary list (subtotal, descontos, frete, total): <dl class="sum-list"><div><dt>…</dt><dd>…</dd></div>…<div class="is-total">…</div></dl> */
.sum-list { margin: 0; display: grid; gap: 8px; }
.sum-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.sum-list dt, .sum-list dd { margin: 0; }
.sum-list dt { min-width: 0; }
.sum-list dd { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--text); font-weight: 500; }
.sum-list .is-neg dd { color: var(--ok-text); }
.sum-list .is-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 15px; }
.sum-list .is-total dd { font-weight: 700; }
.sum-list.is-soft { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); }
/* on Ink surfaces (.card-hero, the order total panel) */
.sum-list.on-ink > div { color: rgba(255, 255, 255, .62); }
.sum-list.on-ink dd { color: #fff; }
.sum-list.on-ink .is-neg dd { color: #fff; }
.sum-list.on-ink .is-total { border-top-color: rgba(255, 255, 255, .14); color: #fff; }
/* Product art (PL.productArt): packaging drawing on a tinted tile */
.product-art { --art: 48px; width: var(--art); height: var(--art); border-radius: calc(var(--art) * .3); flex: none; display: inline-grid; vertical-align: middle; place-items: center; overflow: hidden; background: var(--art-bg, var(--surface-2)); }
.product-art svg { width: 84%; height: 84%; display: block; }
.product-art-sm { --art: 36px; }
.product-art-lg { --art: 84px; }
[data-theme="dark"] .product-art { background: color-mix(in srgb, var(--art-bg, #888) 22%, var(--surface-2)); }
/* Tenant mark (PL.brand.tenantMark) */
.tenant-mark { --tm: 42px; --tm-fg: #FFFFFF; width: var(--tm); height: var(--tm); border-radius: calc(var(--tm) * .33); background: var(--pl-ink, #0E1116); display: inline-grid; vertical-align: middle; place-items: center; flex: none; }
.tenant-mark svg { width: 62%; height: 62%; display: block; }
[data-theme="dark"] .tenant-mark { --tm-fg: #0E1116; background: #F2F3F5; }
/* QR code (PL.qr): always dark modules on white, with a soft frame */
.qr { --qr: 168px; display: inline-grid; place-items: center; width: var(--qr); max-width: 100%; aspect-ratio: 1; padding: 8px; border-radius: 16px; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border); flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.is-empty { padding: 16px; font-size: 12.5px; color: #6C7382; text-align: center; }

/* 14. Density: compact ------------------------------------------------------ */
[data-density="compact"] .card { padding: 18px; }
[data-density="compact"] .insight { padding: 18px; }
[data-density="compact"] .table td { height: 44px; padding-top: 4px; padding-bottom: 4px; }
[data-density="compact"] .table th { height: 38px; }
[data-density="compact"] .pl-top { min-height: 64px; }
[data-density="compact"] .side-link { height: 36px; }
[data-density="compact"] .side-tenant { height: 50px; }
[data-density="compact"] .kpi-label { margin-top: 12px; }
[data-density="compact"] .kpi-value { font-size: 26px; }
[data-density="compact"] .list-row, [data-density="compact"] .asset { padding-top: 8px; padding-bottom: 8px; }
[data-density="compact"] .card-head { margin-bottom: 14px; }
@media (min-width: 980px) { [data-density="compact"][data-side="collapsed"] .side-link { height: 44px; width: 44px; margin-left: 6px; padding-left: 12px; } }

/* 15. Print ------------------------------------------------------------------ */
@media print {
  .pl-side, .pl-top, .pl-subnav, .bulkbar, .pl-toasts, .fab, .pl-rolebar { display: none !important; }
  .pl-app { display: block; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* Role helpers for "Ver como": .role-sells marks selling actions (Novo pedido) that a supplier never sees */
[data-role="fornecedor"] .role-sells { display: none !important; }

/* Search highlight (PL.hl) */
mark.hl { background: color-mix(in srgb, var(--primary) 16%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; box-shadow: 0 1px 0 var(--primary); animation: pl-hl-in .5s var(--ease, ease) both; }
@keyframes pl-hl-in { from { background: color-mix(in srgb, var(--primary) 40%, transparent); } }
@media (prefers-reduced-motion: reduce) { mark.hl { animation: none; } }
.pl-reduced mark.hl { animation: none; }
