/* Module accents are screen-only; analytical status colors and exported reports retain their meaning. */
@media screen {
  :root { --theme-ink:#25484f; --theme-middle:#28595e; --theme-accent:#126a6c; --theme-detail:#087a82;
    --hero-text:#fff; --sidebar-text:#fff; --sidebar-hover:#ffffff14;
    --sidebar-bg:linear-gradient(165deg,var(--theme-ink),var(--theme-middle) 70%,var(--theme-accent));
    --canvas:color-mix(in srgb,var(--theme-accent) 4%,white);
  }
  :root[data-ui-theme="modulos"] { --sidebar-bg:linear-gradient(170deg,#242936,#303943 70%,#334547); }
  :root[data-ui-theme="blanco"] { --hero-text:#243447; --sidebar-text:#243447; --sidebar-hover:#eef1f5; --sidebar-bg:linear-gradient(160deg,#fff,#f6f8fa); --canvas:#f6f7f9; }
  body, [data-go], .section, .vp-module-preview, .metric, .stock-card {
    --module-accent:var(--theme-accent); --module-end:var(--theme-ink); --module-ink:var(--theme-ink);
  }
  :root[data-ui-theme="modulos"] :is(body,[data-go],.section,.vp-module-preview,.metric,.stock-card) {
    --module-accent:var(--local-accent,var(--theme-accent)); --module-end:var(--local-end,var(--theme-ink)); --module-ink:var(--local-ink,var(--theme-ink));
  }
  .section,.stock-card { --hero-bg:linear-gradient(115deg,var(--module-end),var(--module-accent)); }
  :root[data-ui-theme="blanco"] :is(.section,.stock-card) { --hero-bg:linear-gradient(115deg,#fff,#f3f5f8); }

  [data-go="tier"], #section-tier, .vp-module-preview[data-module="tier"], body[data-module="tier"] { --local-accent:#14788b; --local-end:#254b62; --local-ink:#254b62; }
  [data-go="dashboard"], #section-dashboard, .vp-module-preview[data-module="dashboard"], body[data-module="dashboard"] { --local-accent:#126a6c; --local-end:#25484f; --local-ink:#25484f; }
  [data-go="matrix"], #section-matrix, .vp-module-preview[data-module="matrix"], body[data-module="matrix"] { --local-accent:#6551ad; --local-end:#3c326d; --local-ink:#3c326d; }
  [data-go="new"], #section-new, .vp-module-preview[data-module="new"], body[data-module="new"] { --local-accent:#287a55; --local-end:#26513e; --local-ink:#26513e; }
  [data-go="bitacora"], #section-bitacora, .vp-module-preview[data-module="bitacora"], body[data-module="bitacora"] { --local-accent:#a64c3b; --local-end:#683c36; --local-ink:#683c36; }
  [data-go="intake"], #section-intake, .vp-module-preview[data-module="intake"], body[data-module="intake"] { --local-accent:#087a82; --local-end:#25505a; --local-ink:#25505a; }
  [data-go="search"], #section-search, .vp-module-preview[data-module="search"], body[data-module="search"] { --local-accent:#386494; --local-end:#2e435f; --local-ink:#2e435f; }
  [data-go="flowmaker"], #section-flowmaker, .vp-module-preview[data-module="flowmaker"], body[data-module="flowmaker"] { --local-accent:#7752a1; --local-end:#47345f; --local-ink:#47345f; }
  [data-go="ari"], #section-ari, .vp-module-preview[data-module="ari"], body[data-module="ari"] { --local-accent:#916316; --local-end:#655021; --local-ink:#655021; }
  [data-go="planning"], #section-planning, .vp-module-preview[data-module="planning"], body[data-module="planning"] { --local-accent:#a44468; --local-end:#64354c; --local-ink:#64354c; }
  [data-go="med"], #section-med, .vp-module-preview[data-module="med"], body[data-module="med"] { --local-accent:#087c73; --local-end:#225550; --local-ink:#225550; }
  [data-go="experience"], #section-experience, .vp-module-preview[data-module="experience"], body[data-module="experience"] { --local-accent:#a14579; --local-end:#61384f; --local-ink:#61384f; }
  [data-go="improvement"], #section-improvement, .vp-module-preview[data-module="improvement"], body[data-module="improvement"] { --local-accent:#267b53; --local-end:#2c513e; --local-ink:#2c513e; }
  [data-go="doe"], #section-doe, .vp-module-preview[data-module="doe"], body[data-module="doe"] { --local-accent:#6354b0; --local-end:#3e346a; --local-ink:#3e346a; }
  [data-go="asm"], #section-asm, .vp-module-preview[data-module="asm"], body[data-module="asm"] { --local-accent:#56762e; --local-end:#3e512c; --local-ink:#3e512c; }
  [data-go="database"], #section-database, .vp-module-preview[data-module="database"], body[data-module="database"] { --local-accent:#53647d; --local-end:#354252; --local-ink:#354252; }
  [data-go="stats"], #section-stats, .vp-module-preview[data-module="stats"], body[data-module="stats"] { --local-accent:#365da1; --local-end:#30446a; --local-ink:#30446a; }
  [data-go="stock"], #section-stock, .vp-module-preview[data-module="stock"], body[data-module="stock"] { --local-accent:#a05d22; --local-end:#68452b; --local-ink:#68452b; }
  [data-go="changes"], #section-changes, .vp-module-preview[data-module="changes"], body[data-module="changes"] { --local-accent:#825371; --local-end:#553a4d; --local-ink:#553a4d; }
  [data-go="users"], #section-users, .vp-module-preview[data-module="users"], body[data-module="users"] { --local-accent:#57616f; --local-end:#35404f; --local-ink:#35404f; }

  body.authenticated { background:var(--canvas); }
  body.authenticated .sidebar { background:var(--sidebar-bg); color:var(--sidebar-text); border-right:1px solid var(--module-border,#d9e1ea); }
  body.authenticated .nav button[data-go] { color:var(--sidebar-text); }
  body.authenticated .nav button[data-go] .nav-icon {
    color:var(--module-accent); background:color-mix(in srgb,var(--module-accent) 12%,white);
    box-shadow:inset 0 0 0 1px #ffffff66; border-radius:10px;
  }
  body.authenticated .nav button[data-go]:hover {
    background:var(--sidebar-hover);
    border-color:color-mix(in srgb,var(--module-accent) 52%,#ffffff30);
  }
  body.authenticated .nav button[data-go].active {
    background:var(--sidebar-hover);
    border-color:color-mix(in srgb,var(--module-accent) 48%,#ffffff35);
    box-shadow:inset 3px 0 color-mix(in srgb,var(--module-accent) 40%,white),0 4px 14px #00000010;
  }
  body.authenticated .nav button[data-go].active .nav-icon { background:#fff; }
  body.authenticated .nav button[data-go]:focus-visible { outline:2px solid var(--sidebar-text); outline-offset:2px; }
  body.authenticated > main > .topbar { border-bottom:3px solid color-mix(in srgb,var(--module-accent) 42%,white); background:linear-gradient(100deg,#fff 55%,color-mix(in srgb,var(--module-accent) 6%,white)); }
  body.authenticated > main > .topbar h2 { color:var(--module-ink); }
  .section {
    --blue:var(--module-accent); --navy:var(--module-ink); --navy-2:var(--module-end);
    --med-blue:var(--module-accent); --med-teal:var(--module-accent);
    --module-soft:color-mix(in srgb,var(--module-accent) 7%,white);
    --module-border:color-mix(in srgb,var(--module-accent) 22%,white);
  }
  body.authenticated .content .section .card { border-color:var(--module-border); box-shadow:0 3px 6px #30343b03,0 12px 30px #30343b07; }
  .section .card > h3, .section .card-title-row h3, .section .study-form h3 { color:var(--module-ink); }
  body.authenticated .section .btn.primary {
    background:linear-gradient(115deg,var(--module-accent),var(--module-end)); color:#fff;
    box-shadow:0 3px 10px color-mix(in srgb,var(--module-accent) 18%,transparent);
  }
  body.authenticated .section .btn.secondary { background:var(--module-soft); border-color:var(--module-border); color:var(--module-ink); }
  .section .btn[data-go] { --module-soft:color-mix(in srgb,var(--module-accent) 9%,white); --module-border:color-mix(in srgb,var(--module-accent) 28%,white); }
  .section :is(input,select,textarea):focus-visible { border-color:var(--module-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--module-accent) 15%,transparent); }
  body .section input:is([type="checkbox"],[type="radio"]):not(.experience-star input) { accent-color:var(--module-accent); }
  body.authenticated .section :is(.med-hero,.study-hero,.bit-heading,.intake-hero) {
    background:var(--hero-bg);
    color:var(--hero-text); border-color:var(--module-border); box-shadow:0 10px 26px color-mix(in srgb,var(--module-accent) 14%,transparent);
  }
  body.authenticated .section :is(.med-hero,.study-hero,.bit-heading,.intake-hero) :is(h1,h2,h3,p,small,strong,.med-user,.bit-account,.intake-kicker) { color:var(--hero-text); }
  .section .study-symbol { background:#ffffff1c; border:1px solid #ffffff2e; }
  body.authenticated #section-bitacora .bit-heading { background:var(--hero-bg); }
  .section .matrix-hero { background:linear-gradient(110deg,#fff,var(--module-soft)); border-left:5px solid var(--module-accent); }
  .section .matrix-entry-start, .section .study-empty { background:var(--module-soft); border-color:var(--module-border); color:var(--module-ink); }
  .section .med-step b { background:var(--module-soft); color:var(--module-accent); }
  #section-med .med-workflow { background:#fff; border-color:var(--module-border); }
  #section-med .med-workflow > button.active { background:var(--module-soft); color:var(--module-ink); border-color:var(--module-accent); }
  #section-med .med-workflow > button.active b, #section-med .med-tab.active { background:var(--module-accent); border-color:var(--module-accent); color:#fff; }
  #section-med .med-review-progress { background:var(--module-soft); border-color:var(--module-accent); color:var(--module-ink); }
  #section-med .med-data-summary strong, #section-med .med-key-metrics strong, #section-med .med-manual > summary { color:var(--module-ink); }
  #section-med .med-file .med-file-icon { color:var(--module-accent); background:var(--module-soft); }
  .section .med-lot-head { background:var(--module-soft); }
  .section .study-table-wrap th, #section-med .med-loaded-table th { background:var(--module-end); color:#fff; }
  #section-improvement .mc-review { border-left-color:var(--module-accent); background:var(--module-soft); }
  #section-improvement .mc-review h3 { color:var(--module-ink); }
  #section-improvement .mc-tools label:has(input:checked) { border-color:var(--module-accent); background:var(--module-soft); }
  body.authenticated .section .stock-card { --local-accent:#a05d22; --local-end:#68452b; --local-ink:#68452b; background:var(--hero-bg); color:var(--hero-text); }
  body.authenticated .section .stock-card :is(h3,.subtitle,label,.help,.stock-label) { color:var(--hero-text); }
  body.authenticated .section .stock-card .btn.secondary { background:#fff; color:var(--module-ink); border-color:var(--module-border); }
  .section .metric { border-top:3px solid var(--module-accent); }
  #section-dashboard .metric:nth-child(5n+1) { --local-accent:#087c73; --local-ink:#225550; }
  #section-dashboard .metric:nth-child(5n+2) { --local-accent:#6551ad; --local-ink:#3c326d; }
  #section-dashboard .metric:nth-child(5n+3) { --local-accent:#a05d22; --local-ink:#68452b; }
  #section-dashboard .metric:nth-child(5n+4) { --local-accent:#a44468; --local-ink:#64354c; }
  #section-dashboard .metric:nth-child(5n+5) { --local-accent:#56762e; --local-ink:#3e512c; }
  .vp-module-preview { --blue:var(--module-accent); --navy:var(--module-ink); }
  .vp-module-preview__scene { background:radial-gradient(circle at 1px 1px,color-mix(in srgb,var(--module-accent) 14%,white) 1px,transparent 1.5px) 0 0/12px 12px,color-mix(in srgb,var(--module-accent) 4%,white); border-color:color-mix(in srgb,var(--module-accent) 18%,white); }
  .vp-module-preview__soft { fill:color-mix(in srgb,var(--module-accent) 12%,white); }
  .vp-module-preview__water { fill:color-mix(in srgb,var(--module-accent) 42%,white); }
  .vp-module-preview__tags span { background:color-mix(in srgb,var(--module-accent) 8%,white); color:var(--module-ink); }
  .vp-preview-dmaic__phase circle { fill:var(--module-accent); }
  .vp-preview-dmaic__cycle { stroke:var(--module-accent); }
  @media (prefers-reduced-motion:no-preference) { .nav button[data-go] { transition:background .16s ease,border-color .16s ease; } }
}
