/* Río Huatanay · interfaz de centro de control: jerarquía y medidas consistentes. */
body[data-theme="dark"] {
  --rh-bg: #111820;
  --rh-surface: #19232c;
  --rh-raised: #202b35;
  --rh-border: #384751;
  --rh-text: #edf2f5;
  --rh-muted: #b4c0c8;
  --rh-accent: #58a5e0;
  --rh-accent-soft: #203b50;
  --ui-bg: var(--rh-bg);
  --ui-panel: var(--rh-surface);
  --ui-panel-solid: var(--rh-surface);
  --ui-panel-soft: var(--rh-raised);
  --ui-panel-raised: #26333d;
  --ui-border: var(--rh-border);
  --ui-text: var(--rh-text);
  --ui-muted: var(--rh-muted);
  --ui-accent: var(--rh-accent);
  --ui-accent-strong: #7db9e7;
  --ui-accent-soft: var(--rh-accent-soft);
  --ui-hover: #243440;
  --ui-control: #131c23;
  --ui-table-head: #26343e;
  --ui-row: #19232c;
  --ui-row-alt: #1c2730;
  --ui-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  background: var(--rh-bg) !important;
  color: var(--rh-text) !important;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif !important;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-theme="dark"]::before { display: none !important; }
body[data-theme="dark"] :is(button, input, select, textarea, table) { font-family: inherit !important; }
body[data-theme="dark"] :is(button, input, select, textarea) { font-size: 13px; }
body[data-theme="dark"] #main,
body[data-theme="dark"] .workspace { background: transparent !important; }

/* Barra de aplicación y pestañas superiores. */
body[data-theme="dark"] .app-header {
  min-height: 64px;
  height: 64px;
  padding: 8px 24px;
  border: 0;
  border-bottom: 1px solid #303d47;
  background: #17212a !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body[data-theme="dark"] .app-header::after { display: none; }
body[data-theme="dark"] .identity { gap: 16px; }
body[data-theme="dark"] .identity > img { width: 190px; max-width: 21vw; height: 42px; }
body[data-theme="dark"] .product-name {
  gap: 3px;
  padding-left: 16px;
  color: #f0f3f6;
  font-size: 14px;
  letter-spacing: .025em;
}
body[data-theme="dark"] .product-name small { color: #b4c0c8; font-size: 11px; letter-spacing: .04em; }
body[data-theme="dark"] .account { color: var(--rh-text); }
body[data-theme="dark"] .account strong { font-size: 13px; }
body[data-theme="dark"] .account small { color: var(--rh-muted); font-size: 12px; }
body[data-theme="dark"] .header-actions { gap: 8px; }
body[data-theme="dark"] .header-actions .header-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #43515b;
  border-radius: 5px;
  background: #202c35;
  color: #e6edf1;
  font-size: 13px;
  font-weight: 500;
}
body[data-theme="dark"] .header-actions .header-button:hover { background: #2a3843; border-color: #61717d; }
body[data-theme="dark"] .window-tabs {
  min-height: 48px;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid #303d47;
  background: #17212a;
  backdrop-filter: none;
}
body[data-theme="dark"] .window-tab-group,
body[data-theme="dark"] .admin-tabs { gap: 0; }
body[data-theme="dark"] .admin-tabs { margin-left: 12px; padding-left: 12px; border-left: 1px solid #384751; }
body[data-theme="dark"] .nav-group-label { padding: 0 12px 0 4px; color: #aab7c0; font-size: 11px; letter-spacing: .035em; }
body[data-theme="dark"] .window-tabs button[data-view] {
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #c2cdd4;
  font-size: 13px;
  font-weight: 500;
}
body[data-theme="dark"] .window-tabs button[data-view]:hover { background: #202b34; color: #fff; }
body[data-theme="dark"] .window-tabs button[data-view].selected {
  border-bottom-color: var(--rh-accent);
  background: #202b34;
  color: #fff;
  box-shadow: none;
}
body[data-theme="dark"] .window-tabs button[data-view].selected::after { display: none; }
body[data-theme="dark"] .online-users { border-left-color: #384751; color: #c2cdd4; font-size: 12px; }
body[data-theme="dark"] .online-users-list { border-color: var(--rh-border); border-radius: 6px; background: #202b35; color: var(--rh-text); box-shadow: var(--ui-shadow); }

/* Ancho de trabajo y títulos con una escala breve y predecible. */
body[data-theme="dark"] #main {
  width: min(calc(100% - 48px), 1600px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px 0 40px;
  color: var(--rh-text);
}
body[data-theme="dark"] .page-title,
body[data-theme="dark"] .demo-title.ops-hero {
  display: flex;
  align-items: center;
  min-height: 132px;
  margin: 0 0 18px;
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  background: var(--rh-surface);
  box-shadow: none;
  backdrop-filter: none;
}
body[data-theme="dark"] .ops-hero::before,
body[data-theme="dark"] .ops-hero::after,
body[data-theme="dark"] .ops-hero-art { display: none !important; }
body[data-theme="dark"].demo-mode .ins-view > .page-title { display: none !important; }
body[data-theme="dark"] .ops-hero-copy { position: relative; z-index: 1; max-width: 100%; }
body[data-theme="dark"] .page-title h1,
body[data-theme="dark"] .ops-hero h1,
body[data-theme="dark"] .demo-title.ops-hero h2 {
  margin: 4px 0 6px;
  color: var(--rh-text) !important;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}
body[data-theme="dark"] .page-title .eyebrow,
body[data-theme="dark"] .demo-title.ops-hero small {
  margin: 0;
  color: #a9c2d2 !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}
body[data-theme="dark"] .page-title .muted,
body[data-theme="dark"] .demo-title.ops-hero p {
  margin: 0;
  color: var(--rh-muted) !important;
  font-size: 14px;
  line-height: 1.5;
}
body[data-theme="dark"] .ops-hero-actions { gap: 12px; margin-top: 12px; }
body[data-theme="dark"] .ops-hero-actions .ops-live,
body[data-theme="dark"] .demo-title .ops-live { gap: 7px; color: #bfccd3; font-size: 12px; font-weight: 500; letter-spacing: .025em; }
body[data-theme="dark"] .ops-live i { width: 8px; height: 8px; background: #5aa985; box-shadow: none; }

/* Superficies sólidas, bordes sutiles y elevación uniforme. */
body[data-theme="dark"] :is(.card, .work-ribbon, .work-sheet, .ins-view .card, .view > .card) {
  border: 1px solid var(--rh-border) !important;
  border-radius: 7px;
  background: var(--rh-surface) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14) !important;
  backdrop-filter: none !important;
}
body[data-theme="dark"] .card,
body[data-theme="dark"] .ins-view .card,
body[data-theme="dark"] .work-ribbon,
body[data-theme="dark"] .work-sheet { color: var(--rh-text); }
body[data-theme="dark"] .ins-view :is(h1, h2, h3, h4) { color: var(--rh-text) !important; }
body[data-theme="dark"] .ins-view p,
body[data-theme="dark"] .ins-view label,
body[data-theme="dark"] .ins-view .ins-status { color: #c1ccd2; }
body[data-theme="dark"] .ins-view small,
body[data-theme="dark"] .ins-view .muted,
body[data-theme="dark"] .ins-view .ins-card-title small { color: #b4c0c8 !important; }
body[data-theme="dark"] .ins-view .card:hover,
body[data-theme="dark"] .ins-view > section.card:hover { transform: none; border-color: #52616c !important; box-shadow: 0 2px 7px rgba(0, 0, 0, .18) !important; }

/* Filtros y acciones: mismos altos, radios y tamaños de texto. */
body[data-theme="dark"] label,
body[data-theme="dark"] .ins-toolbar.card label,
body[data-theme="dark"] .ins-work-machines .fields label,
body[data-theme="dark"] .ins-work-performance .fields label { color: #c1ccd2 !important; font-size: 12px; }
body[data-theme="dark"] :is(input, select, textarea) {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #46545e;
  border-radius: 5px;
  background: #131c23;
  color: var(--rh-text);
}
body[data-theme="dark"] :is(input, select, textarea):focus { outline: 2px solid #58a5e0; outline-offset: 1px; border-color: #58a5e0; }
body[data-theme="dark"] :is(input, textarea)::placeholder { color: #9baab3; opacity: 1; }
body[data-theme="dark"] button {
  min-height: 34px;
  border: 1px solid #46545e;
  border-radius: 5px;
  background: #202b35;
  color: #e6edf1;
  font-size: 13px;
  font-weight: 500;
  transition: background-color .14s ease, border-color .14s ease;
}
body[data-theme="dark"] button:hover { background: #2a3843; border-color: #61717d; transform: none; }
body[data-theme="dark"] button.primary,
body[data-theme="dark"] .ins-toolbar.card button.primary,
body[data-theme="dark"] .ins-publish .primary {
  border-color: #4b96cd;
  background: #286d9e;
  color: #fff;
  box-shadow: none;
}
body[data-theme="dark"] button.primary:hover,
body[data-theme="dark"] .ins-toolbar.card button.primary:hover { background: #317dad; }
body[data-theme="dark"] button:disabled { color: #91a0a9; background: #1a242c; border-color: #33414a; }
body[data-theme="dark"] #login.login-layout {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .82fr);
  background: transparent;
}
body[data-theme="dark"] #login.login-layout::before,
body[data-theme="dark"] #login .brand::before,
body[data-theme="dark"] #login .brand::after { display: none !important; animation: none !important; }
body[data-theme="dark"] #login .brand {
  min-height: min(690px, calc(100vh - 56px));
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid #384751;
  border-radius: 7px 0 0 7px;
  background: #17232c;
  box-shadow: none;
}
body[data-theme="dark"] #login .brand > img { width: min(280px, 100%); filter: none; }
body[data-theme="dark"] #login .brand-copy { max-width: 470px; }
body[data-theme="dark"] #login .brand .eyebrow { color: #a9c2d2; font-size: 12px; letter-spacing: .04em; }
body[data-theme="dark"] #login .brand h1 { color: #edf2f5; font-size: 36px; font-weight: 600; letter-spacing: -.02em; line-height: 1.18; }
body[data-theme="dark"] #login .brand p:not(.eyebrow) { max-width: 420px; color: #c1ccd2; font-size: 15px; line-height: 1.6; }
body[data-theme="dark"] #login .brand > small { color: #b4c0c8; font-size: 12px; }
body[data-theme="dark"] #login .login-status { border: 1px solid #46545e; border-radius: 5px; background: #202b35; color: #d5dfe4; font-size: 13px; }
body[data-theme="dark"] #login .login-status span { background: #5aa985; box-shadow: none; }
body[data-theme="dark"] #login .access {
  padding: 28px;
  border: 1px solid #384751;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #1b252e;
  backdrop-filter: none;
}
body[data-theme="dark"] #login .access form {
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid #3b4a54;
  border-radius: 7px;
  background: #202b35;
  box-shadow: none;
}
body[data-theme="dark"] #login .login-badge { gap: 9px; margin-bottom: 22px; color: #b4c0c8; font-size: 12px; letter-spacing: .035em; }
body[data-theme="dark"] #login .login-badge img { border-radius: 4px; }
body[data-theme="dark"] #login .access h2 { margin-bottom: 6px; color: var(--rh-text); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
body[data-theme="dark"] #login .access .muted { margin-bottom: 22px; color: var(--rh-muted); font-size: 14px; }
body[data-theme="dark"] #login .access label { gap: 6px; margin-bottom: 15px; color: #c1ccd2; font-size: 13px; font-weight: 500; }
body[data-theme="dark"] #login .access input { height: 40px; border-radius: 5px; background: #131c23; color: var(--rh-text); font-size: 14px; }
body[data-theme="dark"] #login .access #loginBtn { height: 40px; border: 1px solid #4b96cd; border-radius: 5px; background: #286d9e; box-shadow: none; font-size: 14px; font-weight: 600; }
body[data-theme="dark"] #login .access #loginBtn:hover { background: #317dad; transform: none; }
body[data-theme="dark"] #login .access #forgotPassword,
body[data-theme="dark"] #login .access #signupToggle { color: #9bc9e9; font-size: 13px; }
body[data-theme="dark"] #login .login-footer { margin-top: 24px; padding-top: 12px; border-color: #3b4a54; color: #b4c0c8; font-size: 11px; letter-spacing: .04em; }
body[data-theme="dark"] .ins-toolbar.card {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--rh-border) !important;
  border-radius: 7px;
  background: var(--rh-surface) !important;
  box-shadow: none !important;
}
body[data-theme="dark"] .ins-toolbar.card label { display: grid; gap: 6px; }
body[data-theme="dark"] .ins-toolbar.card :is(input, select, button) { height: 38px; }
body[data-theme="dark"] .ins-toolbar.card .primary { background: #286d9e; }
body[data-theme="dark"] .ins-status { min-height: 18px; margin: 4px 0 12px; color: #c1ccd2; font-size: 12px; }
body[data-theme="dark"] .demo-banner {
  padding: 10px 24px;
  border-bottom: 1px solid #34424c;
  border-left: 3px solid #58a5e0;
  background: #1a252e !important;
  color: #d2dce1 !important;
  font-size: 13px;
  line-height: 1.45;
}
body[data-theme="dark"] .demo-banner strong { color: #9bc9e9; font-weight: 600; }

/* Indicadores de igual altura y una escala de lectura compartida. */
body[data-theme="dark"] .ins-view#view-dashboard #insKpis,
body[data-theme="dark"] .ins-view#view-dashboard #insRatios { position: relative; padding-top: 26px; }
body[data-theme="dark"] .ins-view#view-dashboard #insKpis::before,
body[data-theme="dark"] .ins-view#view-dashboard #insRatios::before,
body[data-theme="dark"] .ins-view#view-dashboard > .ins-donut-grid::before,
body[data-theme="dark"] .ins-view#view-dashboard > .ins-grid::before {
  position: absolute;
  top: 0;
  left: 1px;
  color: #b4c0c8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .025em;
}
body[data-theme="dark"] .ins-view#view-dashboard #insKpis::before { content: "Resumen del período"; }
body[data-theme="dark"] .ins-view#view-dashboard #insRatios::before { content: "Índices de productividad"; }
body[data-theme="dark"] .ins-view#view-dashboard > .ins-donut-grid::before { content: "Distribución de recursos"; }
body[data-theme="dark"] .ins-view#view-dashboard > .ins-grid::before { content: "Tendencia diaria"; }
body[data-theme="dark"] .ins-view#view-dashboard > .ins-donut-grid,
body[data-theme="dark"] .ins-view#view-dashboard > .ins-grid { position: relative; padding-top: 26px; }
body[data-theme="dark"] .ins-kpis { gap: 12px; margin: 8px 0 18px; }
body[data-theme="dark"] .ins-kpis article {
  min-width: 0;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--rh-border) !important;
  border-radius: 7px;
  background: var(--rh-surface) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14) !important;
  animation: none !important;
}
body[data-theme="dark"] .ins-kpis article::before { position: absolute; top: 14px; bottom: 14px; left: 0; width: 3px; background: #58a5e0; content: ""; }
body[data-theme="dark"] .ins-kpis article::after { display: none !important; }
body[data-theme="dark"] .ins-kpis article small { color: #c1ccd2 !important; font-size: 13px; }
body[data-theme="dark"] .ins-kpis article strong { margin: 8px 0 5px; color: #f0f4f6 !important; font-size: 29px; font-weight: 600; letter-spacing: -.02em; }
body[data-theme="dark"] .ins-kpis article span { color: #b4c0c8 !important; font-size: 12px; line-height: 1.45; }
body[data-theme="dark"] .ins-ratios { gap: 12px; margin: 4px 0 18px; }
body[data-theme="dark"] .ins-ratios article {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--rh-border) !important;
  border-radius: 7px;
  background: var(--rh-surface) !important;
  box-shadow: none;
}
body[data-theme="dark"] .ins-ratio-mark { width: 36px; height: 36px; border-radius: 5px; background: #263d4d !important; color: #9bc9e9 !important; font-size: 17px; }
body[data-theme="dark"] .ins-ratios small,
body[data-theme="dark"] .ins-ratios span:not(.ins-ratio-mark) { color: #b4c0c8 !important; font-size: 12px; }
body[data-theme="dark"] .ins-ratios strong { margin: 4px 0; color: var(--rh-text) !important; font-size: 22px; font-weight: 600; }

/* Gráficos y tablas comparten encabezados, bordes y legibilidad. */
body[data-theme="dark"] .ins-section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #34424c;
}
body[data-theme="dark"] .ins-section-heading > span { display: none; }
body[data-theme="dark"] .ins-section-heading strong { color: var(--rh-text); font-size: 16px; font-weight: 600; }
body[data-theme="dark"] .ins-section-heading small { color: var(--rh-muted); font-size: 12px; }
body[data-theme="dark"] .ins-donut-grid { gap: 12px; margin: 0 0 18px; }
body[data-theme="dark"] .ins-donut-grid > .card,
body[data-theme="dark"] .ins-grid > .card,
body[data-theme="dark"] .ins-view > section.card { min-width: 0; padding: 18px; }
body[data-theme="dark"] .ins-donut-grid.ins-production-donuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body[data-theme="dark"] .ins-card-title {
  min-height: 42px;
  margin: 0 0 12px;
  padding: 0 0 10px;
  align-items: center;
  border-bottom: 1px solid #34424c;
}
body[data-theme="dark"] .ins-card-title h2 { margin: 0; color: var(--rh-text) !important; font-size: 16px; font-weight: 600; }
body[data-theme="dark"] .ins-card-title small { color: var(--rh-muted) !important; font-size: 12px; }
body[data-theme="dark"] .ins-grid { gap: 12px; margin: 0 0 18px; }
body[data-theme="dark"] .ins-grid > .card { min-width: 0; padding: 18px; }
body[data-theme="dark"] .ins-ring-base { stroke: #34424c; }
body[data-theme="dark"] .ins-ring-number { fill: #edf2f5; }
body[data-theme="dark"] .ins-ring-caption,
body[data-theme="dark"] .ins-axis { fill: #b4c0c8; }
body[data-theme="dark"] .ins-value-label { fill: #d6e0e5; }
body[data-theme="dark"] .ins-gridline { stroke: #36444e; }
body[data-theme="dark"] .ins-ring-legend button { color: #c1ccd2; font-size: 12px; }
body[data-theme="dark"] .ins-ring-legend button:hover { background: #26343e; }
body[data-theme="dark"] .ins-ring-legend strong { color: #edf2f5; font-size: 12px; }
body[data-theme="dark"] .ins-bar-track { background: #33414b; }
body[data-theme="dark"] .ins-bar-track i { background: #58a5e0; }
body[data-theme="dark"] .ins-chart-types { padding: 2px; border: 1px solid #3a4852; border-radius: 5px; background: #151f27; }
body[data-theme="dark"] .ins-chart-types button { min-height: 30px; padding: 4px 9px; border: 0; border-radius: 3px; background: transparent; color: #c1ccd2; font-size: 12px; }
body[data-theme="dark"] .ins-chart-types button.active { background: #2b3d4a; color: #fff; box-shadow: none; }
body[data-theme="dark"] .ins-view .tablewrap { border: 1px solid var(--rh-border); border-radius: 5px; overflow: auto; }
body[data-theme="dark"] .ins-view table { font-size: 13px; }
body[data-theme="dark"] .ins-view th { padding: 10px 12px; background: #26343e !important; color: #e2e9ed !important; font-size: 12px; font-weight: 600; }
body[data-theme="dark"] .ins-view td { padding: 10px 12px; color: #d6e0e5 !important; font-size: 13px; line-height: 1.45; }
body[data-theme="dark"] .ins-view td small,
body[data-theme="dark"] .ins-view td strong { color: #c1ccd2 !important; font-size: 12px; line-height: 1.45; }
body[data-theme="dark"] .ins-view tbody tr:nth-child(even) { background: #1c2730; }
body[data-theme="dark"] .ins-view tbody tr:hover { background: #243440; }
body[data-theme="dark"] .ins-empty,
body[data-theme="dark"] .ins-note,
body[data-theme="dark"] .ins-performance-note { border-color: #46545e; border-radius: 5px; background: #202b35; color: #c1ccd2; }
body[data-theme="dark"] .ins-performance-note p { color: #c1ccd2; font-size: 13px; }
body[data-theme="dark"] .ins-performance-head h3 { color: #e4ebef; font-size: 14px; }
body[data-theme="dark"] .ins-performance-meta { color: #b4c0c8; font-size: 12px; }
body[data-theme="dark"] .ins-multi-legend span { color: #c1ccd2; font-size: 12px; }

@media (max-width: 1100px) {
  body[data-theme="dark"] .ins-toolbar.card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-theme="dark"] .ins-donut-grid.ins-production-donuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body[data-theme="dark"] #login.login-layout { width: 100%; padding: 12px; grid-template-columns: 1fr; gap: 10px; }
  body[data-theme="dark"] #login .brand { min-height: 0; padding: 20px; border-radius: 7px; }
  body[data-theme="dark"] #login .brand > img { width: min(220px, 65vw); }
  body[data-theme="dark"] #login .brand-copy { margin: 14px 0 0; }
  body[data-theme="dark"] #login .brand h1 { font-size: 28px; }
  body[data-theme="dark"] #login .brand p:not(.eyebrow) { font-size: 14px; }
  body[data-theme="dark"] #login .brand > small { display: none; }
  body[data-theme="dark"] #login .access { padding: 12px; border: 1px solid #384751; border-radius: 7px; }
  body[data-theme="dark"] #login .access form { padding: 20px; }
  body[data-theme="dark"] .app-header { min-height: 60px; height: auto; padding: 8px 14px; }
  body[data-theme="dark"] .identity > img { width: 150px; max-width: 30vw; }
  body[data-theme="dark"] .window-tabs { min-height: 46px; padding: 0 10px; }
  body[data-theme="dark"] .window-tabs button[data-view] { min-height: 46px; padding: 0 12px; font-size: 12px; }
  body[data-theme="dark"] .admin-tabs { margin-left: 4px; padding-left: 4px; }
  body[data-theme="dark"] .nav-group-label { display: none; }
  body[data-theme="dark"] #main { width: calc(100% - 28px); padding: 16px 0 28px; }
  body[data-theme="dark"] .page-title,
  body[data-theme="dark"] .demo-title.ops-hero { min-height: 112px; margin-bottom: 14px; padding: 16px; }
  body[data-theme="dark"] .page-title h1,
  body[data-theme="dark"] .ops-hero h1,
  body[data-theme="dark"] .demo-title.ops-hero h2 { font-size: 23px; }
  body[data-theme="dark"] .ins-toolbar.card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  body[data-theme="dark"] .ins-toolbar.card button { grid-column: 1 / -1; }
  body[data-theme="dark"] .ins-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-theme="dark"] .ins-ratios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-theme="dark"] .ins-donut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-theme="dark"] .ins-donut-grid.ins-production-donuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-theme="dark"] .ins-donut-grid > .card,
  body[data-theme="dark"] .ins-grid > .card,
  body[data-theme="dark"] .ins-view > section.card { padding: 14px; }
}
@media (max-width: 520px) {
  body[data-theme="dark"] .app-header { align-items: center; gap: 8px; padding: 8px 10px; }
  body[data-theme="dark"] .identity { gap: 8px; }
  body[data-theme="dark"] .identity > img { width: 108px; height: 32px; }
  body[data-theme="dark"] .product-name { padding-left: 8px; font-size: 11px; white-space: normal; }
  body[data-theme="dark"] .product-name small { font-size: 10px; }
  body[data-theme="dark"] .header-actions .header-button { min-height: 32px; padding: 5px 7px; font-size: 12px; }
  body[data-theme="dark"] .account { display: none; }
  body[data-theme="dark"] .online-users { max-width: 120px; }
  body[data-theme="dark"] .online-users summary { max-width: 115px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  body[data-theme="dark"] .demo-banner { padding: 9px 12px; font-size: 12px; }
  body[data-theme="dark"] .ins-kpis article { height: 132px; min-height: 132px; padding: 12px; }
  body[data-theme="dark"] .ins-kpis article small { font-size: 12px; }
  body[data-theme="dark"] .ins-kpis article strong { font-size: 24px; }
  body[data-theme="dark"] .ins-kpis article span { font-size: 11px; }
  body[data-theme="dark"] .ins-donut-grid,
  body[data-theme="dark"] .ins-donut-grid.ins-production-donuts,
  body[data-theme="dark"] .ins-grid { grid-template-columns: 1fr; }
  body[data-theme="dark"] .ins-donut-grid > .card:last-child { grid-column: auto; }
  body[data-theme="dark"] .ins-view table { min-width: 620px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="dark"] .ops-hero::after,
  body[data-theme="dark"] .ops-hero-art,
  body[data-theme="dark"] .ins-kpis article { animation: none !important; }
  body[data-theme="dark"] .ins-view .card,
  body[data-theme="dark"] button { transition: none !important; }
}

/* Registro y análisis en formato de hoja de cálculo. */
body[data-theme="dark"] .sheet-formula-bar,
body[data-theme="dark"] .demo-formula-bar { display:grid; grid-template-columns:68px 24px minmax(140px,1fr) auto; align-items:center; gap:8px; min-height:44px; padding:5px 10px; border-block:1px solid #35434d; background:#141d25; color:#dce5ea; }
body[data-theme="dark"] .sheet-name-box { display:inline-flex; min-height:30px; align-items:center; justify-content:center; padding:0 8px; border:1px solid #53636d; border-radius:3px; background:#1c2831; color:#e8f0f4; font-size:12px; font-weight:600; }
body[data-theme="dark"] .sheet-fx { color:#9eb0ba; font:italic 600 13px Georgia,serif; text-align:center; }
body[data-theme="dark"] .sheet-formula-bar input,
body[data-theme="dark"] .demo-formula-bar input { width:100%; min-width:0; min-height:30px; padding:5px 8px; border:1px solid #35444e; border-radius:3px; background:#10181f; color:#e6edf1; font-size:12px; }
body[data-theme="dark"] .sheet-formula-bar small,
body[data-theme="dark"] .demo-formula-bar small { color:#aab7bf; font-size:11px; white-space:nowrap; }
body[data-theme="dark"] .worksheet-col-letter { display:block; margin-bottom:4px; color:#a9bac4; font-size:10px; font-weight:600; }
body[data-theme="dark"] .daily-table th,
body[data-theme="dark"] .daily-table td { border-right:1px solid #303e48; border-bottom:1px solid #303e48; }
body[data-theme="dark"] .daily-table th { height:52px; padding:7px 9px; background:#202c35; color:#e4ebef; }
body[data-theme="dark"] .daily-table .row-control,
body[data-theme="dark"] .daily-table .row-actions { background:#18232b; color:#a8b8c1; }
body[data-theme="dark"] .daily-table th.row-control,
body[data-theme="dark"] .daily-table th.row-actions { background:#202c35; }
body[data-theme="dark"] .daily-table .worksheet-row-number { display:inline-block; min-width:22px; color:#a8b8c1; font-size:11px; font-variant-numeric:tabular-nums; }
body[data-theme="dark"] .daily-table td,
body[data-theme="dark"] .daily-table .activity-col { background:#17222a; color:#e1e9ed; }
body[data-theme="dark"] .daily-table tbody tr:nth-child(even) td { background:#1a2730; }
body[data-theme="dark"] .daily-table .activity-col>span { color:#e1e9ed; }
body[data-theme="dark"] .daily-table .activity-col>small { color:#adbdc6; }
body[data-theme="dark"] .daily-table input:not([type="checkbox"]),
body[data-theme="dark"] .daily-table select { height:40px; background:transparent; color:#e6edf1; }
body[data-theme="dark"] .daily-table input:focus,
body[data-theme="dark"] .daily-table select:focus { position:relative; z-index:4; background:#172b39; outline:2px solid #58a5e0; outline-offset:-2px; }
body[data-theme="dark"] .daily-table td:focus-within { background:#172b39; }
body[data-theme="dark"] .daily-table td.field-qty input { color:#9ed0f4; font-weight:600; }
body[data-theme="dark"] .daily-table .row-selected td,
body[data-theme="dark"] .daily-table .row-selected .row-control,
body[data-theme="dark"] .daily-table .row-selected .row-actions,
body[data-theme="dark"] .daily-table .row-selected .field-qty { background:#203747; }

body[data-theme="dark"] .ins-sheet-data { margin-top:11px; border:1px solid #35434d; border-radius:4px; background:#151f27; overflow:hidden; }
body[data-theme="dark"] .ins-sheet-data>summary { display:flex; min-height:37px; align-items:center; justify-content:space-between; gap:12px; padding:7px 10px; cursor:pointer; list-style:none; color:#dce5ea; font-size:12px; }
body[data-theme="dark"] .ins-sheet-data>summary::-webkit-details-marker { display:none; }
body[data-theme="dark"] .ins-sheet-data>summary::before { content:"▸"; margin-right:3px; color:#8dbce0; }
body[data-theme="dark"] .ins-sheet-data[open]>summary::before { content:"▾"; }
body[data-theme="dark"] .ins-sheet-data>summary strong { margin-right:auto; font-weight:500; }
body[data-theme="dark"] .ins-sheet-data>summary span { color:#9fc6e3; font-size:11px; }
body[data-theme="dark"] .ins-sheet-scroll { max-height:260px; overflow:auto; border-top:1px solid #303e48; }
body[data-theme="dark"] .ins-view table.ins-sheet-grid { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
body[data-theme="dark"] .ins-view .ins-sheet-grid th,
body[data-theme="dark"] .ins-view .ins-sheet-grid td { min-width:100px; padding:7px 10px; border-right:1px solid #303e48; border-bottom:1px solid #303e48; background:#18232b; color:#dce5ea !important; line-height:1.35; }
body[data-theme="dark"] .ins-view .ins-sheet-grid thead th { position:sticky; top:0; z-index:2; min-width:120px; background:#26343e !important; color:#eaf1f4 !important; font-weight:500; }
body[data-theme="dark"] .ins-view .ins-sheet-grid thead th span { display:block; margin-bottom:3px; color:#9eb4c0; font-size:10px; }
body[data-theme="dark"] .ins-view .ins-sheet-grid thead th b { font-weight:500; }
body[data-theme="dark"] .ins-view .ins-sheet-grid tr>:first-child { position:sticky; left:0; z-index:3; width:40px; min-width:40px; background:#202c35 !important; color:#aebdc6 !important; text-align:center; font-size:11px; font-weight:500; }
body[data-theme="dark"] .ins-view .ins-sheet-grid td.is-number { text-align:right; font-variant-numeric:tabular-nums; }
body[data-theme="dark"] .ins-view .ins-sheet-grid tbody tr:nth-child(even) td { background:#1b2831; }
body[data-theme="dark"] .ins-view .ins-sheet-grid tbody tr:hover td { background:#243541; }

body[data-theme="dark"] .demo-workbook { padding:0 !important; overflow:hidden; }
body[data-theme="dark"] .demo-workbook-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; border-bottom:1px solid #35434d; background:#1b2730; }
body[data-theme="dark"] .demo-workbook-head strong { display:block; color:#eef3f6; font-size:13px; letter-spacing:.035em; }
body[data-theme="dark"] .demo-workbook-head small { display:block; margin-top:3px; color:#aab8c1; font-size:11px; }
body[data-theme="dark"] .demo-workbook-actions { display:flex; gap:7px; flex-wrap:wrap; }
body[data-theme="dark"] .demo-workbook-actions button { min-height:32px; padding:5px 9px; font-size:12px; }
body[data-theme="dark"] .demo-sheet-scroll { max-height:480px; overflow:auto; }
body[data-theme="dark"] .demo-entry-table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
body[data-theme="dark"] .demo-entry-table th,
body[data-theme="dark"] .demo-entry-table td { min-width:94px; height:42px; padding:0; border-right:1px solid #303e48; border-bottom:1px solid #303e48; background:#17222a; color:#dce5ea; vertical-align:middle; }
body[data-theme="dark"] .demo-entry-table thead th { position:sticky; top:0; z-index:2; min-width:120px; height:48px; padding:6px 9px; background:#26343e; text-align:left; font-weight:500; white-space:nowrap; }
body[data-theme="dark"] .demo-entry-table thead th span { display:block; margin-bottom:3px; color:#9eb4c0; font-size:10px; }
body[data-theme="dark"] .demo-entry-table .demo-row-head,
body[data-theme="dark"] .demo-entry-table tbody th { position:sticky; left:0; z-index:3; width:42px; min-width:42px; background:#202c35; color:#aebdc6; text-align:center; font-size:11px; font-weight:500; }
body[data-theme="dark"] .demo-entry-table tbody td.demo-activity { min-width:270px; padding:7px 10px; color:#e8eef2; }
body[data-theme="dark"] .demo-entry-table tbody input { width:100%; height:40px; min-height:40px; padding:7px 9px; border:0; border-radius:0; background:transparent; color:#e4ebef; font-size:12px; }
body[data-theme="dark"] .demo-entry-table tbody input:focus { outline:2px solid #58a5e0; outline-offset:-2px; background:#172b39; }
body[data-theme="dark"] .demo-entry-table tbody tr:nth-child(even) td { background:#1a2730; }
body[data-theme="dark"] .demo-entry-table tbody tr.demo-row-selected td { background:#203747; }
body[data-theme="dark"] .demo-sheet-tabs { display:flex; gap:0; padding:8px 12px 0; border-top:1px solid #35434d; background:#151e25; }
body[data-theme="dark"] .demo-sheet-tabs button { min-height:34px; padding:6px 12px; border:1px solid #35434d; border-bottom:0; border-radius:4px 4px 0 0; background:#18232b; color:#c0cbd2; font-size:12px; }
body[data-theme="dark"] .demo-sheet-tabs button.selected { background:#26343e; color:#fff; border-color:#4e6070; }
body[data-theme="dark"] .demo-sheet-note { margin:0; padding:9px 12px; color:#aab8c1; background:#151e25; font-size:11px; }
body[data-theme="dark"] .demo-sheet-filters { align-items:end; }
body[data-theme="dark"] .demo-sheet-filters input,
body[data-theme="dark"] .demo-sheet-filters select { min-width:150px; }
body[data-theme="dark"] .demo-sheet-stamp { padding:7px 10px; border:1px solid #475b68; color:#b7c7cf; font-size:11px; font-weight:600; letter-spacing:.04em; }
@media (max-width:700px) {
 body[data-theme="dark"] .sheet-formula-bar,
 body[data-theme="dark"] .demo-formula-bar { grid-template-columns:58px 20px minmax(80px,1fr); }
 body[data-theme="dark"] .sheet-formula-bar small,
 body[data-theme="dark"] .demo-formula-bar small { display:none; }
 body[data-theme="dark"] .demo-workbook-head { align-items:start; flex-direction:column; }
}

body[data-theme="dark"] .daily-table .row-control { width:74px; min-width:74px; }
body[data-theme="dark"] .daily-table .activity-col { left:74px; }
body[data-theme="dark"] .daily-table .field-qty { left:309px; }
body[data-theme="dark"] .demo-sheet-tabs>span { display:inline-flex; align-items:center; min-height:34px; padding:6px 12px; border:1px solid #4e6070; border-bottom:0; border-radius:4px 4px 0 0; background:#26343e; color:#fff; font-size:12px; }

/* Medidas equilibradas: lectura cómoda y gráficos sin dominar el panel. */
.ins-view .ins-chart-scroll > .ins-xy {
  max-width: 800px;
  margin-inline: auto;
}
