/* ============================================================
   dtaCompost Â· hoja de estilo Ãºnica
   DiseÃ±o: producto local-first, claro y legible.
   ============================================================ */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f5f8f6;
  --bg-deep: #eaf0ec;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #eef4f0;
  --ink: #14251d;
  --ink-soft: #34473d;
  --muted: #66786e;
  --muted-2: #87978e;
  --line: #e1e9e4;
  --line-strong: #cbd8d0;
  --brand: #0f7a55;
  --brand-strong: #075d40;
  --brand-soft: #e6f4ed;
  --brand-tint: #f2faf6;
  --accent: #c97818;
  --accent-strong: #9d5b0d;
  --accent-soft: #fff2df;
  --success: #1f8058;
  --success-soft: #e5f5ec;
  --warning: #a86a12;
  --warning-soft: #fff4e0;
  --danger: #b2473c;
  --danger-soft: #fbe9e6;
  --critical: #a93e31;
  --critical-soft: #fbe7e2;
  --info: #356c80;
  --info-soft: #e9f2f5;
  --ring-track: #e4ece7;
  --shadow-xs: 0 1px 2px rgba(20, 37, 29, 0.04);
  --shadow-sm: 0 4px 16px rgba(20, 37, 29, 0.05);
  --shadow-md: 0 16px 40px rgba(20, 37, 29, 0.08);
  --shadow-lg: 0 28px 80px rgba(15, 34, 24, 0.18);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sidebar: 236px;
  --max: 1360px;
  --mobile-nav: 68px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1210;
  --bg-deep: #080e0b;
  --surface: #121c17;
  --surface-2: #17231d;
  --surface-3: #1e2d25;
  --ink: #edf3ef;
  --ink-soft: #c8d5cc;
  --muted: #94a69a;
  --muted-2: #6f8377;
  --line: #25352c;
  --line-strong: #35493d;
  --brand: #6ecf9f;
  --brand-strong: #9be4bd;
  --brand-soft: #17362a;
  --brand-tint: #10251c;
  --accent: #e6a35b;
  --accent-strong: #f4c184;
  --accent-soft: #352817;
  --success: #6ecf9f;
  --success-soft: #17362a;
  --warning: #e0b063;
  --warning-soft: #352a19;
  --danger: #e5968b;
  --danger-soft: #3a2521;
  --critical: #f09c90;
  --critical-soft: #3d2320;
  --info: #8fc3d2;
  --info-soft: #1a2f34;
  --ring-track: #273a2f;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
  background: var(--bg);
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

h1 {
  font-size: clamp(1.85rem, 2.2vw, 2.35rem);
}

h2 {
  font-size: 1.22rem;
}

h3 {
  font-size: 1.05rem;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

code {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.88em;
}

pre {
  margin: 0;
}

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 400;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.dot-sep {
  color: var(--muted-2);
}

.spacer {
  flex: 1;
}

.hide-md {
  display: inline-flex;
}

.icon {
  flex: 0 0 auto;
}

/* ============================================================
   Boot / fatal
   ============================================================ */

.boot-screen,
.fatal-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card {
  width: min(440px, 100%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 44px 36px 34px;
  box-shadow: var(--shadow-md);
}

.boot-mark {
  color: var(--brand);
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.boot-card h1 {
  margin: 8px 0 8px;
  font-size: 1.7rem;
}

.boot-card p {
  color: var(--muted);
  font-size: 13px;
}

.boot-progress {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin: 28px 0 12px;
}

.boot-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  animation: boot-slide 1.25s ease-in-out infinite;
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(300%); }
}

.boot-steps {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.fatal-card {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-md);
}

.fatal-logo {
  color: var(--brand);
  margin-bottom: 16px;
}

.fatal-card h1 {
  margin: 8px 0 12px;
}

.fatal-card > p {
  color: var(--muted);
}

.fatal__hint {
  background: var(--warning-soft);
  color: var(--ink-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 13px;
}

.fatal-actions {
  margin: 22px 0 12px;
}

.fatal-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.fatal-details pre {
  max-height: 220px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  white-space: pre-wrap;
}

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 999;
  background: var(--critical);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
}

/* ============================================================
   Shell
   ============================================================ */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  padding: 2px 8px 0;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  color: var(--brand);
  flex: 0 0 auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__text strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand__text small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

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

.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.nav__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav__item.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: color-mix(in srgb, var(--brand) 18%, transparent);
}

[data-theme="dark"] .nav__item.is-active {
  color: var(--brand-strong);
}

.nav__icon {
  display: inline-flex;
  color: currentColor;
  opacity: 0.9;
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.local-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 11px;
}

.local-card__icon {
  color: var(--brand);
}

.local-card div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.local-card strong {
  font-size: 11px;
  font-weight: 700;
}

.local-card small {
  color: var(--muted);
  font-size: 9.5px;
}

.local-card .status-dot {
  margin-left: auto;
}

.sidebar__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.sidebar__meta a {
  color: var(--muted-2);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10, 16, 12, 0.5);
  backdrop-filter: blur(2px);
}

.main-wrap {
  min-height: 100vh;
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 10px 30px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar__crumb {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.topbar__eyebrow {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.topbar__section {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.topbar__spacer {
  flex: 1;
}

.batch-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.batch-switch__label {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.batch-switch__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 9px 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  color: var(--muted);
  max-width: 310px;
}

.batch-switch__control select {
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  padding: 0 20px 0 0;
  max-width: 250px;
  cursor: pointer;
}

.batch-switch__control > .icon:last-child {
  position: absolute;
  right: 8px;
  pointer-events: none;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.menu-btn {
  display: none;
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 30px;
  background: var(--warning-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 25%, transparent);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.pending-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 30px;
  background: var(--info-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
  color: var(--ink-soft);
  font-size: 12px;
}

.pending-banner strong {
  color: var(--ink);
}

.pending-banner .btn {
  margin-left: 10px;
}

.pending-banner__close {
  width: 28px;
  height: 28px;
  margin-left: 2px;
}

.view-root {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 30px 80px;
  outline: none;
}

.view-root.is-entering {
  animation: view-in 0.28s ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.view-loading {
  min-height: 55vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   Buttons and controls
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 24%, transparent);
}

.btn--primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, #000);
  color: #fff;
}

.btn--danger-text {
  color: var(--danger);
}

.btn--sm {
  min-height: 34px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 9px;
}

.btn--xs {
  min-height: 28px;
  padding: 0 9px;
  font-size: 10.5px;
  border-radius: 7px;
}

.btn--block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn--outline {
  border-color: var(--line);
  background: var(--surface);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
}

.text-link:hover {
  color: var(--brand-strong);
}

.range-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
}

.range-switch__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  min-height: 26px;
  padding: 0 9px;
  font-size: 10.5px;
  font-weight: 700;
}

.range-switch__btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* Badges, chips, dots */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--neutral {
  background: var(--surface-3);
  color: var(--muted);
  border-color: var(--line);
}

.badge--success,
.badge--good {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 20%, transparent);
}

.badge--warning,
.badge--amber {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 22%, transparent);
}

.badge--critical,
.badge--danger {
  background: var(--critical-soft);
  color: var(--critical);
  border-color: color-mix(in srgb, var(--critical) 22%, transparent);
}

.badge--info {
  background: var(--info-soft);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 20%, transparent);
}

.badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.batch-hero .chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
}

.batch-hero .badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.method-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--brand);
}

.batch-hero .method-tag {
  color: #c7e9d3;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 8%, transparent);
}

.status-dot--success,
.status-dot--good {
  background: var(--success);
  color: var(--success);
}

.status-dot--warning {
  background: var(--warning);
  color: var(--warning);
}

.status-dot--critical,
.status-dot--danger {
  background: var(--danger);
  color: var(--danger);
}

.status-dot--info {
  background: var(--info);
  color: var(--info);
}

.status-dot--neutral {
  background: var(--muted-2);
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status-text--success,
.status-text--good { color: var(--success); }
.status-text--warning { color: var(--warning); }
.status-text--critical,
.status-text--danger { color: var(--danger); }
.status-text--info { color: var(--info); }
.status-text--neutral { color: var(--muted); }

/* ============================================================
   Page head, cards, sections
   ============================================================ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 2px;
}

.page-head h1 {
  margin-top: 4px;
}

.page-head p {
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.page-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.card__title h2 {
  font-size: 1.12rem;
  margin-top: 2px;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.icon-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}

.icon-bubble--success { background: var(--success-soft); color: var(--success); }
.icon-bubble--info { background: var(--info-soft); color: var(--info); }
.icon-bubble--warning,
.icon-bubble--amber { background: var(--warning-soft); color: var(--warning); }
.icon-bubble--critical,
.icon-bubble--danger { background: var(--critical-soft); color: var(--critical); }
.icon-bubble--neutral { background: var(--surface-2); color: var(--muted); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 1.14rem;
  margin-top: 2px;
}

/* ============================================================
   Batch hero
   ============================================================ */

.batch-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 27px 28px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% -30%, rgba(255, 255, 255, 0.2), transparent 46%),
    radial-gradient(circle at 8% 120%, rgba(184, 110, 40, 0.35), transparent 42%),
    linear-gradient(135deg, #195a43 0%, #246d51 56%, #2b7658 100%);
  color: #fff;
  box-shadow: 0 18px 44px rgba(24, 73, 54, 0.24);
}

.batch-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -100px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.batch-hero__main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.batch-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.batch-hero .eyebrow {
  color: #c7e9d3;
}

.batch-hero h1 {
  color: #fff;
  max-width: 720px;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

.batch-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.batch-hero__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
}

.batch-hero__side {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.batch-hero__ring {
  display: flex;
  flex: 0 0 auto;
}

.batch-hero__last {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.batch-hero__last small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.batch-hero__last strong {
  font-family: var(--font-display);
  font-size: 23px;
  margin-top: 3px;
}

.batch-hero__last span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.batch-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.batch-hero .btn--primary {
  background: #f0c06b;
  color: #263023;
  box-shadow: none;
}

.batch-hero .btn--primary:hover {
  background: #f7d18a;
  color: #1f291f;
}

.batch-hero .btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.batch-hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.batch-hero .icon-btn--outline {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.batch-hero .icon-btn--outline:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.batch-hero .progress-ring__label strong,
.batch-hero .progress-ring__label small {
  color: #fff;
}

.batch-hero .progress-ring__label small {
  color: rgba(255, 255, 255, 0.65);
}

/* ============================================================
   Insight bar
   ============================================================ */

.insight-bar {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.insight-bar--success { border-left-color: var(--success); background: color-mix(in srgb, var(--success-soft) 55%, var(--surface)); }
.insight-bar--warning { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface)); }
.insight-bar--critical { border-left-color: var(--critical); background: color-mix(in srgb, var(--critical-soft) 62%, var(--surface)); }
.insight-bar--neutral { border-left-color: var(--line-strong); }

.insight-bar__icon {
  display: inline-flex;
  color: var(--ink-soft);
}

.insight-bar > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.insight-bar strong {
  font-size: 12.5px;
}

.insight-bar span {
  color: var(--muted);
  font-size: 11.5px;
}

.insight-bar__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

/* ============================================================
   Metrics
   ============================================================ */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 11px;
  box-shadow: var(--shadow-xs);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--line);
}

.metric-card--success::before { background: var(--success); }
.metric-card--warning::before { background: var(--warning); }
.metric-card--critical::before { background: var(--critical); }
.metric-card--info::before { background: var(--info); }

.metric-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.metric-card__icon {
  color: var(--muted);
  display: inline-flex;
}

.metric-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card__status {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.metric-card__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 10px 0 8px;
}

.metric-card__value strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-card__value span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.metric-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.metric-card__target {
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sparkline {
  width: 58px;
  height: 20px;
  opacity: 0.8;
  flex: 0 0 auto;
}

.sparkline-empty {
  color: var(--muted-2);
  font-size: 11px;
}

/* ============================================================
   Dashboard grid
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 366px;
  gap: 18px;
  align-items: start;
}

.dashboard-grid__main,
.dashboard-grid__side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.dashboard-grid__side {
  position: sticky;
  top: 86px;
}

.chart-card {
  overflow: hidden;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
  margin: -2px 0 8px;
}

.chart-legend.compact {
  gap: 10px;
  margin: 0;
}

.chart-legend__right {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 9.5px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.legend-dot--line {
  height: 2px;
  width: 13px;
  background: var(--accent);
  border-radius: 2px;
}

.legend-dot--band {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 250px;
}

.time-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 5;
  opacity: 0.8;
}

.chart-axis {
  fill: var(--muted-2);
  font-size: 10px;
  font-family: var(--font-sans);
}

.chart-band {
  fill: color-mix(in srgb, var(--success) 12%, transparent);
}

.chart-band--danger {
  fill: color-mix(in srgb, var(--danger) 9%, transparent);
}

.chart-threshold {
  stroke: var(--success);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
  opacity: 0.7;
}

.chart-threshold-label {
  fill: var(--success);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-sans);
}

.chart-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  stroke: var(--surface);
  stroke-width: 2.5;
}

.chart-hover {
  stroke: var(--muted-2);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
}

.chart-hover.is-visible {
  opacity: 0.5;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 9.5px;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tooltip span {
  opacity: 0.65;
}

.chart-tooltip strong {
  font-size: 11px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* ============================================================
   Assistant
   ============================================================ */

.assistant-card {
  border-top: 3px solid var(--line-strong);
}

.assistant-card--success { border-top-color: var(--success); background: linear-gradient(180deg, color-mix(in srgb, var(--success-soft) 40%, var(--surface)) 0, var(--surface) 140px); }
.assistant-card--warning { border-top-color: var(--warning); background: linear-gradient(180deg, color-mix(in srgb, var(--warning-soft) 45%, var(--surface)) 0, var(--surface) 150px); }
.assistant-card--critical { border-top-color: var(--critical); background: linear-gradient(180deg, color-mix(in srgb, var(--critical-soft) 50%, var(--surface)) 0, var(--surface) 160px); }
.assistant-card--neutral { border-top-color: var(--line-strong); }

.assistant-card .card__head {
  margin-bottom: 8px;
}

.assistant-card__summary {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 13px;
}

.action-box {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.action-box__icon {
  display: inline-flex;
  color: var(--accent-strong);
  margin-top: 1px;
}

.action-box div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.action-box small {
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-box strong {
  font-size: 12px;
}

.action-box p {
  color: var(--ink-soft);
  font-size: 11.5px;
  margin-top: 3px;
  line-height: 1.45;
}

.action-box--calm {
  border-color: color-mix(in srgb, var(--success) 20%, var(--line));
  background: var(--success-soft);
}

.action-box--calm .action-box__icon,
.action-box--calm small {
  color: var(--success);
}

.finding-list {
  list-style: none;
  margin: 13px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.finding {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.finding:last-child {
  border-bottom: 0;
}

.finding__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  margin-top: 5px;
  flex: 0 0 auto;
}

.finding--critical .finding__dot { background: var(--critical); }
.finding--warning .finding__dot { background: var(--warning); }
.finding--info .finding__dot { background: var(--info); }

.finding div {
  flex: 1;
  min-width: 0;
}

.finding strong {
  font-size: 11.5px;
}

.finding p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
  margin-top: 1px;
}

.finding__value {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 2px 5px;
}

/* ============================================================
   Compliance
   ============================================================ */

.compliance-card__body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.compliance-card__detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.progress-ring {
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
}

.progress-ring__label {
  position: relative;
  text-align: center;
  line-height: 1;
}

.progress-ring__label strong {
  display: block;
  font-family: var(--font-display);
  font-size: calc(var(--ring-size) * 0.24);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.progress-ring__label strong span {
  font-size: 0.55em;
  color: var(--muted);
}

.progress-ring__label small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-row__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-row__label strong {
  color: var(--ink);
  font-size: 10.5px;
}

.progress-row small {
  color: var(--muted-2);
  font-size: 9px;
}

.bar {
  height: 7px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width 0.45s ease;
}

.bar--amber > span {
  background: var(--accent);
}

.bar--mini {
  height: 5px;
  width: 90px;
}

.bar--auto {
  height: 6px;
}

.compliance-card__message {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   Timeline
   ============================================================ */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line);
}

.timeline__item {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 8px 0;
}

.timeline__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.timeline__item--critical .timeline__icon { color: var(--critical); background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 18%, var(--line)); }
.timeline__item--warning .timeline__icon { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 18%, var(--line)); }
.timeline__item--success .timeline__icon { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 18%, var(--line)); }
.timeline__item--info .timeline__icon { color: var(--info); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 18%, var(--line)); }

.timeline__body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.timeline__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline__meta time {
  text-transform: none;
  letter-spacing: 0;
}

.timeline__body > strong {
  display: block;
  font-size: 11.5px;
  margin-top: 1px;
}

.timeline__body > p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.42;
  margin-top: 2px;
}

.timeline__action {
  color: var(--brand) !important;
  display: flex;
  align-items: flex-start;
  gap: 3px;
  margin-top: 4px !important;
}

.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 11.5px;
}

/* ============================================================
   Mini stats / stat strip
   ============================================================ */

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--line);
}

.mini-stat {
  background: var(--surface);
  padding: 12px 14px;
}

.mini-stat small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mini-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  margin-top: 2px;
}

.mini-stat strong span {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 10px;
}

.mini-stat .small-value {
  font-family: var(--font-sans);
  font-size: 11px;
  margin-top: 5px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  margin-top: 2px;
}

/* ============================================================
   Empty states, feature grid
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 34px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.empty-state--page {
  min-height: 55vh;
  justify-content: center;
  margin: 22px 0;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 7px;
}

.empty-state__icon--danger {
  background: var(--critical-soft);
  color: var(--critical);
}

.empty-state h1,
.empty-state h2 {
  max-width: 580px;
}

.empty-state p {
  max-width: 560px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.empty-state .button-row {
  margin-top: 13px;
  justify-content: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.feature > span {
  display: inline-flex;
  color: var(--brand);
  margin-bottom: 8px;
}

.feature strong {
  display: block;
  font-size: 12px;
}

.feature p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 3px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filter-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 650;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.filter-tab span {
  background: var(--surface-3);
  color: var(--muted);
  border-radius: 99px;
  padding: 1px 6px;
  font-size: 9px;
}

.filter-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.filter-tab.is-active span {
  background: var(--brand-soft);
  color: var(--brand);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  color: var(--muted);
  min-width: 260px;
}

.search-box--grow {
  flex: 1;
  min-width: 220px;
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

/* ============================================================
   Batch cards
   ============================================================ */

.batch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.batch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.batch-card:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.batch-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-card__method {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--brand);
  flex: 0 0 auto;
}

.batch-card__method--green { background: var(--success-soft); color: var(--success); }
.batch-card__method--blue { background: var(--info-soft); color: var(--info); }
.batch-card__method--amber { background: var(--warning-soft); color: var(--warning); }
.batch-card__method--rose { background: var(--critical-soft); color: var(--critical); }
.batch-card__method--slate { background: var(--surface-3); color: var(--muted); }

.batch-card__id {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.batch-card__code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.batch-card__method-name {
  font-size: 11px;
  font-weight: 700;
}

.batch-card__badges {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
}

.batch-card h2 {
  font-size: 1.22rem;
  margin-top: 2px;
}

.batch-card__meta {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.batch-card__stats > div {
  background: var(--surface-2);
  padding: 8px 10px;
}

.batch-card__stats small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.batch-card__stats strong {
  font-size: 13px;
  font-weight: 700;
}

.batch-card__stats strong span {
  color: var(--muted-2);
  font-size: 9px;
}

.batch-card__progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.batch-card__progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9.5px;
}

.batch-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 1px;
}

.demo-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  padding: 0 4px;
}

.demo-hint p {
  line-height: 1.45;
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.alert-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning);
  background: var(--warning-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  flex-wrap: wrap;
}

.alert-strip--critical {
  border-left-color: var(--critical);
  background: var(--critical-soft);
}

.alert-strip__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.alert-strip__items {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 99px;
  padding: 2px 8px 2px 3px;
  max-width: 320px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alert-chip .badge {
  flex: 0 0 auto;
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alert-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.alert-list__item:last-child {
  border-bottom: 0;
}

.alert-list__item p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.alert-list__item small {
  display: block;
  color: var(--brand);
  font-size: 10.5px;
  margin-top: 3px;
}

.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.simple-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}

.simple-list li:last-child {
  border-bottom: 0;
}

.simple-list__date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.definition-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin: 0 0 12px;
}

.definition-list div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.definition-list dt {
  color: var(--muted);
}

.definition-list dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  min-width: 640px;
}

.data-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-soft) 28%, transparent);
}

.data-table td strong {
  font-weight: 700;
}

.inline-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 650;
}

/* ============================================================
   Forms
   ============================================================ */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  grid-column: span 12;
  min-width: 0;
}

.field--wide { grid-column: span 12; }
.field--half { grid-column: span 6; }
.field--third { grid-column: span 4; }
.field--quarter { grid-column: span 3; }

.field > label,
.field > span:first-child {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field__req {
  color: var(--danger);
  margin-left: 3px;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__control input,
.field__control select,
.field__control textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 12px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.field textarea {
  min-height: 74px;
  resize: vertical;
  line-height: 1.45;
}

.field__control input:focus,
.field__control select:focus,
.field__control textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.field__control input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field__control select {
  appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field__unit {
  position: absolute;
  right: 11px;
  color: var(--muted-2);
  font-size: 10px;
  pointer-events: none;
}

.field__control:has(.field__unit) input {
  padding-right: 42px;
}

.field__hint {
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.35;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 9px;
  min-height: 39px;
}

.field--inline > span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.field--inline input,
.field--inline select {
  border: 0;
  box-shadow: none;
  min-height: 30px;
  padding: 4px 5px;
  background: transparent;
  width: auto;
  min-width: 80px;
}

.field--inline input:focus,
.field--inline select:focus {
  box-shadow: none;
}

.field--checkbox {
  justify-content: center;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11.5px;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}

.segmented__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.segmented__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.segmented__item:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.form-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--info-soft);
  color: var(--ink-soft);
  border: 1px solid color-mix(in srgb, var(--info) 16%, var(--line));
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.form-note .icon {
  color: var(--info);
  margin-top: 1px;
}

.form-note--soft {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

.form-note--soft .icon {
  color: var(--muted);
}

.form-hint {
  color: var(--muted);
  font-size: 11px;
}

.form-error {
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid color-mix(in srgb, var(--critical) 22%, var(--line));
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 11.5px;
  font-weight: 600;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-2);
}

.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 8px;
}

.reading-advanced {
  background: var(--surface-2);
}

.reading-advanced[open] summary {
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.method-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.method-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.method-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.method-pick.is-selected {
  border-color: var(--brand);
  background: var(--brand-tint);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent);
}

.method-pick__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--brand);
  flex: 0 0 auto;
}

.method-pick__body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.method-pick__body strong {
  font-size: 11.5px;
}

.method-pick__body small {
  color: var(--muted);
  font-size: 9.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.method-preview {
  color: var(--muted);
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.install-guide {
  font-size: 12.5px;
  line-height: 1.55;
}

.install-guide ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0;
}

/* ============================================================
   Modals and toasts
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(12, 18, 14, 0.52);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.modal-overlay.is-visible {
  opacity: 1;
}

.modal {
  width: min(700px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.99);
  transition: transform 0.18s ease;
  overflow: hidden;
}

.modal-overlay.is-visible .modal {
  transform: translateY(0) scale(1);
}

.modal--sm { width: min(460px, 100%); }
.modal--lg { width: min(860px, 100%); }
.modal--xl { width: min(1020px, 100%); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  font-size: 1.42rem;
}

.modal__head p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.modal__body {
  padding: 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 13px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.modal__foot .spacer {
  flex: 1;
}

.modal__error {
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid color-mix(in srgb, var(--critical) 22%, var(--line));
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 11.5px;
  margin-bottom: 12px;
}

.modal.is-busy .modal__body {
  opacity: 0.7;
  pointer-events: none;
}

.modal__close {
  margin: -3px -5px 0 0;
}

.confirm-text {
  font-size: 13px;
  line-height: 1.55;
}

.confirm-details {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item--danger {
  color: var(--danger);
}

.menu-item--danger:hover {
  background: var(--critical-soft);
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 0.22s ease both;
}

.toast.is-leaving {
  animation: toast-out 0.18s ease both;
}

.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--critical { border-left-color: var(--critical); }

.toast__icon {
  display: inline-flex;
  color: var(--info);
  margin-top: 1px;
}

.toast--success .toast__icon { color: var(--success); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--critical .toast__icon { color: var(--critical); }

.toast__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11.5px;
  line-height: 1.4;
  flex: 1;
}

.toast__body strong {
  font-size: 11.5px;
}

.toast__body span {
  color: var(--muted);
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  padding: 1px;
  display: inline-flex;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

/* ============================================================
   Logbook
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.log-day {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.log-day:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.log-day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}

.log-day__head h2 {
  font-size: 1.05rem;
}

.log-day__head span {
  color: var(--muted);
  font-size: 10px;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.log-entry {
  display: grid;
  grid-template-columns: 48px 38px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.log-entry:last-child {
  border-bottom: 0;
}

.log-entry:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.log-entry__time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding-top: 9px;
}

.log-entry__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}

.log-entry--critical .log-entry__icon { background: var(--critical-soft); color: var(--critical); }
.log-entry--warning .log-entry__icon { background: var(--warning-soft); color: var(--warning); }
.log-entry--success .log-entry__icon { background: var(--success-soft); color: var(--success); }

.log-entry__body {
  min-width: 0;
}

.log-entry__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.log-entry__meta a {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 9px;
}

.log-entry__body > strong {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.log-entry__body > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 2px;
}

.log-entry__action {
  color: var(--brand) !important;
}

.log-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-size: 10px;
  padding: 0 4px;
}

/* ============================================================
   Sensors
   ============================================================ */

.sensor-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 18px;
  align-items: start;
}

.sensor-status-card {
  min-height: 100%;
}

.status-orb {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--muted);
  flex: 0 0 auto;
}

.status-orb--success { background: var(--success-soft); color: var(--success); }
.status-orb--warning { background: var(--warning-soft); color: var(--warning); }
.status-orb--critical { background: var(--critical-soft); color: var(--critical); }
.status-orb--info { background: var(--info-soft); color: var(--info); }

.sensor-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.sensor-status-grid > div {
  background: var(--surface-2);
  padding: 9px 11px;
}

.sensor-status-grid small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sensor-status-grid strong {
  font-size: 12px;
}

.inline-ok,
.inline-error,
.inline-warning,
.inline-info {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 11px;
  line-height: 1.45;
  margin: 10px 0;
}

.inline-ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 18%, var(--line));
}

.inline-error {
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid color-mix(in srgb, var(--critical) 18%, var(--line));
}

.inline-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 18%, var(--line));
}

.inline-info {
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 18%, var(--line));
}

.inline-ok span,
.inline-error span,
.inline-warning span,
.inline-info span {
  color: var(--ink-soft);
}

.test-result,
.import-result {
  margin-top: 12px;
}

.code-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink-soft);
  overflow-x: auto;
  max-height: 260px;
}

.settings-card .form {
  gap: 12px;
}

.settings-card .form-actions {
  justify-content: flex-start;
}

.sensor-table td {
  vertical-align: middle;
}

.integration-card .code-block {
  margin-bottom: 10px;
}

/* ============================================================
   Methods
   ============================================================ */

.active-method-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, var(--brand-tint), var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.active-method-banner__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}

.active-method-banner > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.active-method-banner h2 {
  font-size: 1.15rem;
  margin-top: 2px;
}

.active-method-banner p {
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.method-card.is-active {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 8%, transparent);
}

.method-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.method-card__head > div {
  flex: 1;
  min-width: 0;
}

.method-card__head h2 {
  font-size: 1.1rem;
}

.method-card__head .muted {
  display: block;
  margin-top: 2px;
}

.method-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--brand);
  flex: 0 0 auto;
}

.method-card__icon--green { background: var(--success-soft); color: var(--success); }
.method-card__icon--blue { background: var(--info-soft); color: var(--info); }
.method-card__icon--amber { background: var(--warning-soft); color: var(--warning); }
.method-card__icon--rose { background: var(--critical-soft); color: var(--critical); }
.method-card__icon--slate { background: var(--surface-3); color: var(--muted); }

.method-card > p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.method-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  margin: 12px 0;
}

.method-facts div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
  font-size: 10px;
}

.method-facts dt {
  color: var(--muted);
}

.method-facts dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
}

.method-card__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mini-label {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.method-card__cols ul {
  margin: 4px 0 0;
  padding-left: 14px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.knowledge-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.knowledge-list strong {
  color: var(--ink);
}

.note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--warning-soft);
  color: var(--ink-soft);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 12px;
}

.note .icon {
  color: var(--warning);
  margin-top: 1px;
}

.note--soft {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.note--soft .icon {
  color: var(--muted);
}

.recipe-result {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.recipe-result__numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.recipe-result__numbers > div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
}

.recipe-result__numbers small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recipe-result__numbers strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  margin-top: 1px;
}

/* ============================================================
   Reports
   ============================================================ */

.report-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.action-card__icon {
  display: inline-flex;
  color: var(--brand);
  margin-bottom: 2px;
}

.action-card h2 {
  font-size: 1.15rem;
}

.action-card p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  flex: 1;
}

.action-card .button-row {
  margin-top: 4px;
}

.action-card .field--inline {
  width: 100%;
}

.action-card .field--inline select {
  flex: 1;
  min-width: 0;
}

.audit-table td {
  font-size: 10.5px;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.check-list .icon {
  color: var(--success);
}

/* ============================================================
   Settings
   ============================================================ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0 12px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.status-line .icon {
  color: var(--muted-2);
}

.status-line strong {
  margin-left: auto;
  color: var(--ink);
  text-align: right;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.diagnostic-grid > div {
  background: var(--surface-2);
  padding: 9px 11px;
}

.diagnostic-grid small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.diagnostic-grid strong {
  font-size: 11.5px;
}

.diagnostic-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.diagnostic-details summary {
  cursor: pointer;
  margin-bottom: 8px;
}

.about-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  max-width: 850px;
}

.about-card .check-list {
  margin: 12px 0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: color-mix(in srgb, var(--critical) 30%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--critical-soft) 45%, var(--surface)), var(--surface));
}

.danger-zone h2 {
  margin-top: 2px;
}

.danger-zone p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  max-width: 680px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1360px) {
  :root {
    --sidebar: 230px;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card__status {
    display: inline-flex;
  }

  .stat-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .dashboard-grid__side {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .dashboard-grid__side .mini-stats {
    grid-column: span 2;
  }

  .batch-hero {
    flex-direction: column;
  }

  .batch-hero__side {
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    justify-content: flex-start;
  }

  .batch-hero__actions {
    flex-direction: row;
    margin-left: auto;
  }

  .sensor-layout {
    grid-template-columns: 1fr;
  }

  .diagnostic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1020px) {
  .topbar {
    padding: 10px 20px;
  }

  .view-root {
    padding: 22px 20px 70px;
  }

  .batch-switch__label {
    display: none;
  }

  .batch-switch__control {
    max-width: 240px;
  }

  .batch-switch__control select {
    max-width: 190px;
  }

  .two-col,
  .method-grid,
  .report-actions-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .batch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
    width: 270px;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-btn {
    display: inline-flex;
  }

  .topbar__crumb {
    display: none;
  }

  .topbar {
    gap: 9px;
  }

  .batch-switch {
    margin-left: auto;
  }

  .topbar__spacer {
    display: none;
  }

  .hide-md {
    display: none;
  }

  .batch-switch__control {
    max-width: 200px;
  }

  .batch-switch__control select {
    max-width: 155px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-head__actions {
    justify-content: flex-start;
  }

  .dashboard-grid__side {
    grid-template-columns: 1fr;
  }

  .dashboard-grid__side .mini-stats {
    grid-column: auto;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .danger-zone {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
  }

  .log-entry {
    grid-template-columns: 40px 34px minmax(0, 1fr);
    gap: 8px;
    padding: 11px;
  }
}

@media (max-width: 640px) {
  .view-root {
    padding: 16px 14px 60px;
  }

  .topbar {
    min-height: 60px;
    padding: 8px 12px;
  }

  .topbar__actions .btn span {
    display: none;
  }

  .topbar__actions .btn {
    padding: 0 10px;
  }

  .batch-switch__control {
    height: 36px;
    max-width: 156px;
  }

  .batch-switch__control select {
    max-width: 115px;
    font-size: 10.5px;
  }

  .batch-switch__control > .icon:first-child {
    display: none;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card__value strong {
    font-size: 24px;
  }

  .batch-hero {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
  }

  .batch-hero h1 {
    font-size: 1.65rem;
  }

  .batch-hero__side {
    flex-wrap: wrap;
    gap: 14px;
  }

  .batch-hero__actions {
    margin-left: 0;
    width: 100%;
  }

  .batch-hero__actions .btn {
    flex: 1;
  }

  .insight-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .insight-bar__meta {
    margin-left: 30px;
    width: 100%;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius);
  }

  .compliance-card__body {
    flex-direction: column;
    align-items: flex-start;
  }

  .compliance-card__detail {
    width: 100%;
  }

  .definition-list {
    grid-template-columns: 1fr;
  }

  .method-picker {
    grid-template-columns: 1fr;
  }

  .field--half,
  .field--third,
  .field--quarter {
    grid-column: span 12;
  }

  .method-card__cols {
    grid-template-columns: 1fr;
  }

  .method-facts {
    grid-template-columns: 1fr;
  }

  .sensor-status-grid {
    grid-template-columns: 1fr;
  }

  .diagnostic-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .field--inline {
    width: 100%;
  }

  .field--inline select,
  .field--inline input {
    flex: 1;
    width: 100%;
  }

  .search-box {
    min-width: 0;
  }

  .log-entry {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .log-entry__time {
    grid-column: 2;
    padding-top: 0;
    font-size: 9px;
  }

  .log-entry__icon {
    grid-row: span 2;
  }

  .fact-grid,
  .recipe-result__numbers {
    grid-template-columns: 1fr;
  }

  .chart-container {
    min-height: 160px;
  }

  .chart-empty {
    min-height: 160px;
  }

  .toast-root {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .modal {
    border-radius: var(--radius-lg);
  }

  .modal__head,
  .modal__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal__foot {
    padding: 12px 16px 15px;
  }

  .modal__foot .btn {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .batch-card__stats {
    grid-template-columns: 1fr 1fr;
  }

  .batch-card__stats > div:last-child {
    grid-column: span 2;
  }

  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toast-root,
  .modal-overlay,
  .page-head__actions,
  .button-row,
  .tabs {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0;
  }

  .view-root {
    max-width: none;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .card,
  .batch-hero {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ============================================================
   UI 2.0 Â· capa de producto
   ============================================================ */

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  gap: 22px;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand {
  padding: 2px 8px 4px;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.brand-mark svg {
  width: 36px;
  height: 36px;
}

.brand__text strong {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand__text small {
  font-size: 10.5px;
  margin-top: 2px;
}

.nav {
  gap: 4px;
}

.nav__item {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav__item:hover {
  background: var(--surface-2);
}

.nav__item.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 0;
}

.nav__icon {
  opacity: 1;
}

.sidebar__footer {
  gap: 10px;
}

.local-card {
  padding: 10px 11px;
  border-radius: 14px;
  background: var(--surface-2);
}

.local-card strong {
  font-size: 11.5px;
}

.local-card small {
  font-size: 10px;
}

.sidebar__meta {
  font-size: 10.5px;
  padding: 0 6px;
}

.topbar {
  min-height: 64px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar__eyebrow {
  display: none;
}

.topbar__section {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.batch-switch__label {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.batch-switch__control {
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border-color: transparent;
  max-width: 320px;
}

.batch-switch__control:focus-within {
  border-color: var(--brand);
  background: var(--surface);
}

.batch-switch__control select {
  font-size: 13px;
  font-weight: 600;
  max-width: 260px;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

.btn--xs {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 9px;
}

.btn--primary {
  box-shadow: none;
  background: var(--brand);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
}

.icon-btn {
  border-radius: 11px;
}

.view-root {
  padding: 28px 28px 84px;
}

.page {
  gap: 18px;
}

.page-head {
  align-items: flex-start;
  padding: 2px 2px 4px;
}

.page-head h1 {
  font-size: clamp(1.65rem, 2vw, 2rem);
  margin-top: 2px;
}

.page-head p {
  max-width: 680px;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 5px;
}

.page-head__actions {
  padding-top: 4px;
}

.page-head__actions .btn,
.page-head .btn {
  min-height: 38px;
}

.card {
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: none;
  border-color: var(--line);
}

.card__head {
  margin-bottom: 16px;
}

.card__title {
  gap: 11px;
}

.card__title h2 {
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  margin-top: 1px;
}

.icon-bubble {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.section-head {
  align-items: center;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 1.05rem;
}

/* Hero: de tarjeta oscura a resumen limpio */
.batch-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--brand-tint) 0%, var(--surface) 58%);
  color: var(--ink);
  box-shadow: none;
}

.batch-hero::after {
  display: none;
}

.batch-hero__main {
  min-width: 0;
}

.batch-hero__eyebrow {
  margin-bottom: 6px;
}

.batch-hero .eyebrow {
  color: var(--brand);
}

.batch-hero h1 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  letter-spacing: -0.04em;
  max-width: none;
}

.batch-hero__meta {
  color: var(--muted);
  font-size: 12.5px;
  gap: 6px;
  margin-top: 7px;
}

.batch-hero .method-tag {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.batch-hero__chips {
  gap: 6px;
  margin-top: 14px;
}

.batch-hero .chip {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
  font-size: 11.5px;
  padding: 5px 9px;
}

.batch-hero__side {
  gap: 18px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.batch-hero__ring .progress-ring {
  width: 96px;
}

.batch-hero .progress-ring__label strong {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 22px;
}

.batch-hero .progress-ring__label small {
  color: var(--muted);
  font-size: 10px;
}

.batch-hero__last small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.batch-hero__last strong {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.batch-hero__last span {
  color: var(--muted);
  font-size: 10.5px;
}

.batch-hero__actions {
  gap: 6px;
}

.batch-hero .btn--primary {
  background: var(--brand);
  color: #fff;
}

.batch-hero .btn--primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

.batch-hero .btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.batch-hero .btn--ghost:hover {
  background: var(--surface-2);
}

/* KPIs */
.metric-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px 16px 13px;
  border-radius: 16px;
  box-shadow: none;
}

.metric-card::before {
  height: 2px;
  opacity: 0.85;
}

.metric-card__head {
  gap: 7px;
}

.metric-card__label {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
}

.metric-card__icon {
  color: var(--muted);
}

.metric-card__status {
  display: inline-flex;
  font-size: 10.5px;
}

.metric-card__value {
  margin: 14px 0 10px;
}

.metric-card__value strong {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.055em;
}

.metric-card__value span {
  font-size: 12px;
}

.metric-card__foot {
  padding-top: 9px;
}

.metric-card__target {
  font-size: 10.5px;
}

.sparkline {
  width: 64px;
  height: 22px;
}

/* Grid */
.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.dashboard-grid__main,
.dashboard-grid__side {
  gap: 18px;
}

.dashboard-grid__side {
  top: 82px;
}

.chart-legend {
  font-size: 11.5px;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-legend__right {
  font-size: 10.5px;
}

.range-switch {
  border-radius: 10px;
}

.range-switch__btn {
  font-size: 11.5px;
}

.chart-container {
  min-height: 230px;
}

/* Insight y asistente */
.insight-bar {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: none;
}

.insight-bar strong {
  font-size: 14px;
}

.insight-bar span {
  font-size: 12.5px;
}

.assistant-card {
  border-radius: var(--radius-lg);
}

.assistant-card__summary {
  font-size: 13.5px;
  line-height: 1.6;
}

.action-box {
  border-radius: 14px;
}

.action-box strong {
  font-size: 14px;
}

.action-box p {
  font-size: 12.5px;
}

.finding-list {
  gap: 10px;
}

.finding strong {
  font-size: 12.5px;
}

.finding p {
  font-size: 11.5px;
}

/* Formas y controles */
input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}

.field label,
.field__label {
  font-size: 12px;
}

.field__hint,
.field__error {
  font-size: 11.5px;
}

/* NavegaciÃ³n mÃ³vil */
.mobile-nav {
  display: none;
}

@media (max-width: 1180px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid__side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: static;
  }

  .batch-hero {
    grid-template-columns: 1fr;
  }

  .batch-hero__side {
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .batch-hero__actions {
    margin-left: auto;
    flex-direction: row;
  }
}

@media (max-width: 860px) {
  .sidebar {
    width: min(280px, 84vw);
  }

  .menu-btn {
    display: none;
  }

  .main-wrap {
    margin-left: 0;
  }

  .topbar {
    padding: 9px 14px;
    gap: 8px;
  }

  .batch-switch {
    margin-left: 0;
    min-width: 0;
  }

  .batch-switch__control {
    max-width: 188px;
    height: 38px;
  }

  .batch-switch__control select {
    font-size: 12px;
    max-width: 145px;
  }

  .topbar__actions {
    margin-left: auto;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    min-height: var(--mobile-nav);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 650;
    text-align: center;
  }

  .mobile-nav__item .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-nav__item.is-active {
    color: var(--brand-strong);
    background: var(--brand-soft);
  }

  .mobile-nav__item:hover {
    color: var(--brand);
    background: var(--surface-2);
  }

  .view-root {
    padding: 18px 14px calc(var(--mobile-nav) + 30px + env(safe-area-inset-bottom));
  }

  .page {
    gap: 14px;
  }

  .page-head {
    flex-direction: column;
    gap: 10px;
  }

  .page-head h1 {
    font-size: 1.7rem;
  }

  .page-head__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .page-head__actions .btn {
    flex: 1;
  }

  .card {
    padding: 16px;
    border-radius: 18px;
  }

  .batch-hero {
    padding: 20px;
    border-radius: 22px;
  }

  .batch-hero h1 {
    font-size: 1.55rem;
  }

  .batch-hero__side {
    flex-wrap: wrap;
    gap: 14px;
  }

  .batch-hero__actions {
    width: 100%;
    margin-left: 0;
  }

  .batch-hero__actions .btn {
    flex: 1;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    padding: 14px 13px 11px;
  }

  .metric-card__label {
    font-size: 11.5px;
  }

  .metric-card__value strong {
    font-size: 28px;
  }

  .metric-card__status {
    font-size: 9.5px;
  }

  .sparkline {
    width: 44px;
    height: 17px;
  }

  .dashboard-grid__side {
    grid-template-columns: 1fr;
  }

  .insight-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .insight-bar__meta {
    margin-left: 0;
    width: 100%;
  }

  .chart-container {
    min-height: 190px;
  }

  .toast-root {
    bottom: calc(var(--mobile-nav) + 10px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-hero__chips .chip:nth-child(2) {
    display: none;
  }
}

@media print {
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .dashboard-grid__main,
  .dashboard-grid__side {
    display: contents;
  }

  .dashboard-grid__main > .chart-card {
    order: 1;
  }

  .dashboard-grid__side > [data-live="advisor"] {
    order: 2;
  }

  .dashboard-grid__side > [data-live="compliance"] {
    order: 3;
  }

  .dashboard-grid__main > .card:not(.chart-card) {
    order: 4;
  }

  .timeline__item:nth-child(n + 5) {
    display: none;
  }
}

@media (max-width: 640px) {
  .metric-card__head {
    align-items: flex-start;
  }

  .metric-card__label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
  }

  .metric-card__status {
    width: 8px;
    min-width: 8px;
    margin-left: auto;
    font-size: 0;
    gap: 0;
    overflow: hidden;
  }

  .metric-card__status .status-dot {
    width: 8px;
    height: 8px;
  }

  .batch-hero__side {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .batch-hero__actions {
    grid-column: 1 / -1;
  }

  .batch-hero__last {
    min-width: 0;
  }

  .timeline {
    gap: 12px;
  }

  .timeline__item {
    padding-bottom: 12px;
  }
}

@media (max-width: 640px) {
  .batch-hero__ring {
    display: none;
  }

  .batch-hero__side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
  }

  .batch-hero__last {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
  }

  .batch-hero__last small {
    width: 100%;
  }

  .batch-hero__last strong {
    font-size: 22px;
  }

  .batch-hero__actions {
    width: 100%;
  }
}

@media (max-width: 860px) {
  .batch-switch__control {
    max-width: 220px;
  }

  .batch-switch__control select {
    max-width: 190px;
  }
}

/* Detalles de producto */
.batch-hero .badge {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.batch-hero .badge--success {
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.batch-hero .badge--warning,
.batch-hero .badge--amber {
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
  background: var(--warning-soft);
  color: var(--warning);
}

.batch-hero .badge--info {
  border-color: color-mix(in srgb, var(--info) 25%, transparent);
  background: var(--info-soft);
  color: var(--info);
}

.batch-hero .badge--critical,
.batch-hero .badge--danger {
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.field--checkbox {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.checkbox {
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.checkbox input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

.field--checkbox .field__hint {
  display: block;
  padding-left: 30px;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.table-wrap {
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.data-table {
  font-size: 13px;
  min-width: 720px;
}

.data-table th {
  font-size: 10px;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 11px 12px;
}

@media (max-width: 640px) {
  .data-table {
    font-size: 13px;
  }

  .table-wrap--stack {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table--stack {
    display: block;
    min-width: 0;
  }

  .data-table--stack thead {
    display: none;
  }

  .data-table--stack tbody {
    display: grid;
    gap: 10px;
  }

  .data-table--stack tr {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .data-table--stack td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  .data-table--stack td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 650;
    text-align: left;
  }

  .data-table--stack td:first-child {
    display: block;
    padding: 0 0 9px;
    margin-bottom: 3px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14.5px;
  }

  .data-table--stack td:first-child::before,
  .data-table--stack td.data-table__action::before {
    display: none;
  }

  .data-table--stack td.data-table__action {
    justify-content: flex-end;
    padding-top: 9px;
  }

  .data-table--stack td > .inline-progress {
    flex: 1;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .data-table--stack tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
  }

  .data-table--stack td:first-child,
  .data-table--stack td.data-table__action {
    grid-column: 1 / -1;
  }

  .data-table--stack td::before {
    flex-basis: 45%;
  }
}

@media (max-width: 640px) {
  .data-table--stack td {
    flex-wrap: wrap;
  }

  .data-table--stack .badge {
    white-space: normal;
    text-align: right;
  }
}

.batch-hero .progress-ring__label small {
  display: none;
}

@supports (padding: max(0px)) {
  @media (max-width: 860px) {
    .topbar {
      padding-top: max(9px, env(safe-area-inset-top));
    }
  }
}


@media (max-width: 640px) {
  .sensor-table tr {
    display: block;
  }

  .sensor-table td:nth-child(3),
  .sensor-table td:nth-child(5) {
    display: none;
  }

  .sensor-table td::before {
    flex-basis: 42%;
  }
}

/* Compartir aplicación */
.sidebar-share {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 14px;
  background: var(--brand-tint);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
}

.sidebar-share:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--brand-soft);
}

.sidebar-share__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--brand-strong);
  background: var(--surface);
}

.sidebar-share span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-share strong {
  font-size: 12px;
  font-weight: 750;
}

.sidebar-share small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.share-dialog {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-qr-card {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.share-qr {
  display: grid;
  place-items: center;
  width: 178px;
  aspect-ratio: 1;
  padding: 9px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.share-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.share-qr-card__copy h3 {
  margin: 5px 0 4px;
  font-size: 1.08rem;
}

.share-qr-card__copy p {
  max-width: 280px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.share-local-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 25%, var(--line));
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.share-local-note .icon {
  margin-top: 1px;
  color: var(--warning);
}

.share-link-block label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.share-native {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
}

.share-native:hover {
  background: var(--brand-strong);
}

.share-section-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 82px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.share-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.share-option__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.share-option__mark--whatsapp { background: #25d366; }
.share-option__mark--telegram { background: #229ed9; }
.share-option__mark--facebook { background: #1877f2; font-size: 19px; }
.share-option__mark--x { background: #111; }
.share-option__mark--linkedin { background: #0a66c2; font-size: 11px; }
.share-option__mark--reddit { background: #ff4500; }
.share-option__mark--email { background: var(--accent); font-size: 18px; }
.share-option__mark--sms { background: var(--info); font-size: 9px; text-transform: lowercase; }

@media (max-width: 640px) {
  .share-qr-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .share-qr {
    width: min(168px, 60vw);
    margin: 0 auto;
  }

  .share-qr-card__copy p {
    margin-right: auto;
    margin-left: auto;
  }

  .share-link-row {
    flex-direction: column;
  }

  .share-link-row .btn {
    width: 100%;
  }

  .share-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-option {
    min-height: 74px;
  }
}
