/* CheveSoft v2: indigo surfaces, local pointer light and compact dashboard.
   Decorative effects are screen-only and never reduce content opacity. */
@media screen {
  body.cheve-brand {
    --cheve-panel: #29243d;
    --cheve-field: #211e30;
    --cheve-raised: #342d49;
    --cheve-line: #534b69;
    --line: #534b69;
    --muted: #c3bdcf;
    --cheve-board-art: url('/brand/chevesoft-placa-relieve.webp');
    --cheve-board-size: 1024px 576px;
    background: radial-gradient(ellipse at 78% 5%, #33264e40, transparent 55%), #101318;
  }

  /* The substrate sits behind the panels. Both perimeter masks share the frame's
     dimensions and clock, so the reflection stays aligned around all four corners. */
  body.cheve-brand { isolation: isolate; }
  .cheve-board {
    position: fixed; inset: 5px; z-index: -1; border-radius: 16px;
    overflow: hidden; pointer-events: none;
  }
  .cheve-board[data-cheve-lit=true] { clip-path: var(--cheve-control-cutout, none); }
  .cheve-board::before, .cheve-board::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: var(--cheve-board-art) 0 0 / var(--cheve-board-size) repeat;
  }
  .cheve-board::before {
    mask-image: radial-gradient(circle 126px at var(--cheve-pointer-x, -200px) var(--cheve-pointer-y, -200px),
      #000 0 12%, #000b 45%, transparent);
    opacity: 0; transition: opacity 160ms ease-out;
  }
  .cheve-board[data-cheve-lit=true]::before { opacity: .84; }
  .cheve-board::after {
    --edge-reach: #000 0, #0009 8px, transparent 23px,
      transparent calc(100% - 23px), #0009 calc(100% - 8px), #000;
    mask-image: conic-gradient(from var(--cheve-light-angle), transparent 340deg,
      #000 346deg, transparent 349deg), linear-gradient(to right, var(--edge-reach)),
      linear-gradient(to bottom, var(--edge-reach));
    mask-composite: intersect, add;
    opacity: .24;
    animation: cheve-perimeter 16s linear infinite;
  }
  body.cheve-brand .cheve-light-frame::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    --edge-falloff: #0008, #0003 4px, transparent 14px,
      transparent calc(100% - 14px), #0003 calc(100% - 4px), #0008;
    background: conic-gradient(from var(--cheve-light-angle), transparent 315deg,
      #5688ad24 332deg, #81b8de89 345.6deg, transparent 348.5deg);
    mask-image: linear-gradient(to right, var(--edge-falloff)), linear-gradient(to bottom, var(--edge-falloff));
    animation: cheve-perimeter 16s linear infinite;
  }
  body.cheve-brand .cheve-light-frame::after {
    padding: 1px;
    background: conic-gradient(from var(--cheve-light-angle), transparent 294deg,
      #46647d16 309deg, #6791ad62 329deg, #93c1dfca 342deg,
      #c6e5fb 346deg, #98c2e194 346.8deg, transparent 348deg);
  }
  body.cheve-brand :is(.panel, .metrics > div, .insumo-card, .insumo-ficha, .supply-card, .ca-card, .tg-card, .tg-stat, .warehouse-module) {
    background: linear-gradient(125deg, #332b48, #242133);
    border-color: var(--cheve-line);
    box-shadow: inset 0 1px #e5dcff0b, 0 5px 18px #05050b24;
  }
  body.cheve-brand :is(dialog, .tg-dialog, .tg-dialog-body, .confirmacion-contenido, #modalConfirmacionSistema) {
    background: #29243d; border-color: var(--cheve-line);
  }
  body.cheve-brand :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    background-color: var(--cheve-field); border-color: #665b7c;
  }
  body.cheve-brand :is(th, thead) { background-color: #1d1b29; color: #d4cede; }
  body.cheve-brand :is(td, th) { border-color: #51475f66; }

  /* Opt-in surfaces get a behind-content layer. No DOM child or business state changes. */
  body.cheve-brand :is(.cheve-summary-card, .cheve-dashboard > .grid > section,
    .cheve-login-panel, .panel, .insumo-card, .supply-card, .ca-card, .tg-card) {
    position: relative; isolation: isolate;
  }
  /* Every painted panel uses the approved Movimientos treatment. Preserve fixed,
     sticky and native dialog positioning; only static containers need an anchor. */
  body.cheve-brand .cheve-reactive { isolation: isolate; }
  :where(body.cheve-brand .cheve-reactive-anchor) { position: relative; }
  body.cheve-brand .cheve-reactive::after {
    content: ''; position: absolute; inset: 0; z-index: -1;
    border-radius: inherit; pointer-events: none; opacity: 0;
    --spot: var(--cheve-pointer-x, 50%) var(--cheve-pointer-y, 50%);
    background: radial-gradient(circle 85px at var(--spot), #8294c31a, transparent),
      var(--cheve-board-art) var(--cheve-art-x, 0px) var(--cheve-art-y, 0px) / var(--cheve-board-size) repeat;
    mix-blend-mode: screen;
    mask-image: radial-gradient(ellipse 85px 60px at var(--spot), #000 8%, #000c 42%, transparent);
    clip-path: var(--cheve-control-cutout, none);
    transition: opacity 150ms ease-out;
  }
  body.cheve-brand .cheve-reactive[data-cheve-lit=true]::after {
    opacity: .26; translate: var(--cheve-scroll-x, 0px) var(--cheve-scroll-y, 0px);
  }
  /* Place the tracks above the opaque folds but below the logo and copy. */
  .cheve-login .cheve-login-story.cheve-reactive::after { z-index: 0; }
  /* Inset strokes stay visible inside scrollable menus and preserve semantic fills. */
  body.cheve-brand {
    --cheve-control-ring: inset 1.5px 0 0 #76c4ef, inset -1.5px 0 0 #b598e3,
      inset 0 0 0 1.5px #9babe0, 0 0 8px #8292d62d;
  }
  body.cheve-brand :is(button, a, input, select, textarea, [role=button]) {
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  }
  @media (hover: hover) and (pointer: fine) {
    body.cheve-brand :is(button, a[href], [role=button], input:is([type=button],[type=submit],[type=reset]),
      .warehouse-button, .area-button):not(:disabled, [aria-disabled=true]):hover {
      border-color: #959ec9 !important;
      box-shadow: var(--cheve-control-ring) !important;
    }
  }
  body.cheve-brand :is(button, a[href], input, select, textarea, [role=button]):focus-visible {
    outline: 2px solid #9ed7ff; outline-offset: 2px;
    box-shadow: var(--cheve-control-ring) !important;
  }
  body.cheve-brand :is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus {
    border-color: #9f9ce6 !important;
    box-shadow: var(--cheve-control-ring) !important;
  }
  /* Fit the content itself at 100%: no zoom, transforms, hidden fields or clipped rows. */
  body.cheve-brand #appMain { padding: 16px 20px; }
  body.cheve-brand #appHeader { height: 52px; }
  body.cheve-brand #appSidebar { width: 202px; }
  body.cheve-brand #appSidebar > div:first-child { padding-block: 14px; }
  body.cheve-brand #appSidebar > div:nth-child(2) { padding-block: 13px; }
  body.cheve-brand #appSidebar nav :is(a, button) { min-height: 40px; margin-bottom: 3px; }
  body.cheve-brand #appFooter { height: 36px; }
  body.cheve-brand #fiscalHealthBanner:not(.hidden) { margin-bottom: 15px; padding: 10px 14px; }
  body.cheve-brand .cheve-dashboard { --cheve-card-gap: 11px; }
  body.cheve-brand .cheve-dashboard > div:first-child { margin-bottom: 14px; gap: 12px; }
  body.cheve-brand .cheve-dashboard h1 { font-size: clamp(24px, 1.9vw, 30px); }
  body.cheve-brand .cheve-dashboard [data-mod-action] { min-height: 34px; padding-inline: 11px; font-size: 12px; }
  body.cheve-brand .resumen-operacion-grid { margin-bottom: 12px; }
  body.cheve-brand .cheve-summary-card {
    min-height: 108px; padding: 12px 14px;
    background: linear-gradient(125deg, #352d4c, #272236);
    border-color: #5b4f73; box-shadow: inset 0 1px #e9dcff0d, 0 4px 14px #0002;
  }
  body.cheve-brand .cheve-summary-card > div:first-child { flex-direction: row; align-items: center; gap: 8px; }
  body.cheve-brand .cheve-summary-card > div > p { font-size: 11px; line-height: 1.3; }
  body.cheve-brand .cheve-summary-card > div > span { font-size: 21px; flex-shrink: 0; }
  body.cheve-brand .cheve-summary-card > p:first-of-type { font-size: clamp(21px, 1.65vw, 26px); margin-top: 8px; line-height: 1.15; }
  body.cheve-brand .cheve-summary-card > p:not(:first-of-type) { margin-top: 5px; font-size: 10px; }
  body.cheve-brand .cheve-summary-card > div:last-child:not(:first-child) { margin-top: 6px; }
  body.cheve-brand .cheve-summary-card--sales {
    background: linear-gradient(120deg, #473b35, #30283c 70%);
    border-color: #b9995d; box-shadow: inset 0 1px #efd6a240, 0 4px 14px #0002;
  }
  body.cheve-brand .cheve-summary-card [data-mod-action] { min-height: 26px; font-size: 10px; }
  body.cheve-brand .cheve-dashboard > .grid { gap: 12px; margin-top: 12px; }
  body.cheve-brand .cheve-dashboard > .grid > section {
    background: linear-gradient(115deg, #30293f, #231f30);
    border-color: #514760; padding: 14px 16px;
  }
  body.cheve-brand .cheve-dashboard h3 { font-size: 17px; margin-bottom: 12px; line-height: 1.3; }
  body.cheve-brand .cheve-payment-row { margin-block: 10px; }
  body.cheve-brand .cheve-payment-row:last-child { margin-bottom: 2px; }
  body.cheve-brand .cheve-payment-row > div:first-child { margin-bottom: 6px; }
  body.cheve-brand .cheve-payment-row > div:first-child > span { font-size: 13px; }
  body.cheve-brand .cheve-payment-track { height: 6px; background: #514765; }
  body.cheve-brand .cheve-salon-row { min-height: 36px; padding: 7px 10px; line-height: 1.25; background: #3b324a85; }
  body.cheve-brand .cheve-salon-row span { font-size: 12px; }
  body.cheve-brand .cheve-salon-row b { font-size: 17px; line-height: 1.2; }
  body.cheve-brand .cheve-dashboard table { font-size: 12px; }
  body.cheve-brand .cheve-dashboard :is(td, th) { padding: 9px 10px; line-height: 1.35; }
  body.cheve-brand .cheve-dashboard td .text-xs { font-size: 11px; }
  body.cheve-brand .cheve-dashboard [data-mod-action=dashboard-mov-filtro] {
    min-height: 30px; font-size: 11px; padding: 6px 9px;
  }
  body.cheve-brand .cheve-dashboard [data-mod-action=dashboard-mov-filtro].bg-primary {
    color: #19150e; background: var(--cheve-gold); border-color: #dfc185;
  }

  /* Recover the sculpted, lit material of the approved access illustration. */
  .cheve-login .cheve-login-story {
    background: radial-gradient(ellipse at 90% 60%, #8c69301b, transparent 58%), linear-gradient(135deg, #10131a, #0b0f14);
    padding: clamp(34px, 5vw, 88px);
  }
  .cheve-login .cheve-login-story > img { filter: drop-shadow(0 2px 8px #d2a25b20); }
  .cheve-login .cheve-login-copy { margin-top: clamp(38px, 6vh, 76px); }
  .cheve-login-copy h2 { text-shadow: 0 3px 14px #0006; }
  .cheve-login-copy h2 span {
    color: #e2bb76; background: linear-gradient(115deg, #ffe4af, #d5a052 55%, #edcd91);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .cheve-login .cheve-login-art { height: 47%; opacity: 1; }
  .cheve-login .cheve-login-story-footer { padding-top: 140px; }
  .cheve-login .cheve-login-panel {
    padding: 38px clamp(30px, 4.8vw, 80px);
    background: radial-gradient(ellipse at 65% 15%, #43325c80, transparent 75%), linear-gradient(135deg, #252037, #171724 80%);
    box-shadow: inset 1px 0 #f0d39b30, inset 0 0 65px #0606104d;
  }
  .cheve-login .cheve-login-heading { margin-bottom: 26px; }
  .cheve-login .cheve-login-heading h1 { margin-bottom: 26px; }
  .cheve-login #loginForm :is(input:not([aria-hidden]), select) {
    background: linear-gradient(110deg, #342d45, #252032); border-color: #746683;
    box-shadow: inset 0 1px #eadfff12, 0 4px 12px #07050c26;
  }
  .cheve-login #btnLogin {
    background: linear-gradient(120deg, #f1d49a, #d7ab60 48%, #c19147);
    border-radius: 10px; min-height: 58px;
    box-shadow: inset 0 1px 1px #fff1c3, 0 6px 22px #d5a4541c, 0 8px 20px #0003;
  }
  .cheve-login .cheve-login-footer { margin-top: 26px; padding-top: 20px; }
  @media (min-width: 1200px) {
    body.cheve-brand .cheve-dashboard > .grid { grid-template-columns: minmax(0, 1fr) 284px; }
  }
  @media (max-width: 1199px) and (min-width: 768px) {
    body.cheve-brand #appSidebar { width: 180px; }
    body.cheve-brand #appMain { padding: 14px; }
  }
  @media (max-width: 850px) {
    .cheve-login .cheve-login-story { padding: 28px 28px 24px; }
    .cheve-login .cheve-login-copy { margin-top: 24px; }
    .cheve-login .cheve-login-art { height: 100%; opacity: .45; }
    .cheve-login .cheve-login-panel { padding: 28px; }
  }
  @media (max-width: 767px) {
    body.cheve-brand #appHeader { height: auto; }
    body.cheve-brand #appSidebar { width: 66px; }
    body.cheve-brand #appMain { padding: 12px 10px; }
    body.cheve-brand #appFooter { height: auto; }
    body.cheve-brand .cheve-summary-card { padding: 11px; min-height: 100px; }
    body.cheve-brand .cheve-summary-card > p:first-of-type { font-size: 21px; }
    body.cheve-brand .cheve-dashboard [data-mod-action] { min-height: 38px; }
    body.cheve-brand .cheve-dashboard > .grid > section { padding: 13px; }
  }
  @media (prefers-reduced-motion: reduce) {
    body.cheve-brand .cheve-light-frame::before, .cheve-board { display: none; animation: none; }
    body.cheve-brand .cheve-light-frame::after { animation: none; opacity: .35; }
    body.cheve-brand .cheve-reactive::after { display: none; }
    body.cheve-brand :is(button, a, input, select, textarea) { transition: none; }
  }
  @media (forced-colors: active) {
    .cheve-board { display: none; }
    body.cheve-brand .cheve-reactive::after { display: none; }
    .cheve-login-copy h2 span { -webkit-text-fill-color: currentColor; background: none; }
  }
}
@media print { .cheve-board, .cheve-reactive::after { display: none !important; } }
