/* CheveSoft · propuesta original aprobada, carbón / dorado / luz azul acero.
   El tema solo afecta la pantalla. Las plantillas de impresión conservan su diseño. */
@property --cheve-light-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes cheve-perimeter { to { --cheve-light-angle: 360deg; } }
@media screen {
  body.cheve-brand {
    --ink: #f3eee5; --muted: #b8b9b8; --line: #3c4247;
    --primary: #d8b575; --bg: #111419; --good: #9cdeb6; --bad: #ffaaa5;
    --cheve-panel: #20262a; --cheve-field: #171d21;
    --cheve-gold: linear-gradient(120deg, #f1d69b 0%, #d5ac66 48%, #b48c4d 100%);
    color-scheme: dark;
    background: radial-gradient(ellipse at 65% 0, #242a2e55, transparent 60%), var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, sans-serif;
    accent-color: #d8b575;
  }
  body.cheve-brand *, body.cheve-brand *::before, body.cheve-brand *::after { box-sizing: border-box; }
  body.cheve-brand [hidden] { display: none !important; }
  body.cheve-brand :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid #a9d9f1; outline-offset: 3px;
  }
  body.cheve-brand :is(button, input, select, textarea):disabled { cursor: not-allowed; opacity: .5; }
  body.cheve-brand ::selection { color: #111419; background: #e4c38b; }
  body.cheve-brand ::-webkit-scrollbar { width: 7px; height: 7px; }
  body.cheve-brand ::-webkit-scrollbar-track { background: #151a1e; }
  body.cheve-brand ::-webkit-scrollbar-thumb { background: #50585e; border-radius: 8px; }
  body.cheve-brand .cheve-light-frame {
    position: fixed; inset: 5px; z-index: 80; pointer-events: none;
    border: 1px solid #527d9366; border-radius: 16px;
  }
  .cheve-light-frame::after {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
    background: conic-gradient(from var(--cheve-light-angle), transparent 0 270deg,
      #33566b44 305deg, #80b7d4 342deg, #d8f2ff 347deg, transparent 351deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: cheve-perimeter 16s linear infinite;
  }
  body.cheve-brand .cheve-brand-signature { display: block; width: 100%; height: auto; }
  body.cheve-brand .cheve-sidebar-brand { padding: 20px 18px; border-top: 1px solid #ffffff12; flex: 0 0 auto; }
  body.cheve-brand .cheve-sidebar-brand img { max-width: 175px; }
  body.cheve-brand :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    background-color: var(--cheve-field); color: var(--ink); border-color: #596168;
  }
  body.cheve-brand :is(input, textarea)::placeholder { color: #a0a6aa; opacity: 1; }
  body.cheve-brand :is(input, select, textarea):focus { border-color: #d8b575; }
  body.cheve-brand input:-webkit-autofill {
    -webkit-text-fill-color: #f3eee5; -webkit-box-shadow: 0 0 0 1000px #20262a inset;
    caret-color: #f3eee5;
  }
  body.cheve-brand dialog { background: #20262a; color: var(--ink); border-color: var(--line); }
  body.cheve-brand dialog::backdrop { background: #05090bc4; backdrop-filter: blur(4px); }

  /* Caja: misma estructura y controles, nueva jerarquía visual. */
  body.cheve-brand #appHeader {
    height: 56px; background: linear-gradient(110deg, #20262a, #101417 75%);
    border-bottom: 1px solid #515457; box-shadow: 0 4px 22px #0003;
  }
  body.cheve-brand #appHeader > div { padding-inline: 20px; }
  body.cheve-brand #appHeader .font-manrope { font-size: 19px; letter-spacing: -.3px; text-transform: none; }
  body.cheve-brand #appHeader :is(a, button) { min-height: 34px; }
  body.cheve-brand #appHeader .top-nav-item { font-size: 12px; color: #e6e5e1; }
  body.cheve-brand #nombreLocalHeader {
    background: #c5a46b10; border: 1px solid #c5a46b; color: #f1d69b; border-radius: 7px;
  }
  body.cheve-brand #appSidebar {
    width: 216px; background: linear-gradient(120deg, #1c2327, #12171a 80%); border-color: #41484d;
  }
  body.cheve-brand #appSidebar > div:first-child { background: transparent; padding-block: 18px; }
  body.cheve-brand #appSidebar > div:nth-child(2) { padding-block: 17px; }
  body.cheve-brand #appSidebar nav :is(a, button) { min-height: 44px; margin-bottom: 5px; color: #e8e6df; }
  body.cheve-brand #appSidebar nav button { background: transparent; border-color: transparent; }
  body.cheve-brand #appSidebar nav :is(a, button):hover { background: #ffffff08; }
  body.cheve-brand #appSidebar .sidebar-item.active {
    color: #f7e2b6; background: linear-gradient(100deg, #c5a46b38, #c5a46b13);
    box-shadow: inset 4px 0 #e5bd74; border: 1px solid #c5a46b55; font-weight: 700;
  }
  body.cheve-brand #appMain { background: transparent; padding: 22px; }
  body.cheve-brand #appRightPanel { background: #1b2125; border-color: #41484d; }
  body.cheve-brand #appFooter { background: #12171a; border-top: 1px solid #42484c; height: 42px; }
  body.cheve-brand #appFooter > div { color: #c3c4c1; }
  body.cheve-brand #btnCambiarAreaTop {
    background: linear-gradient(120deg, #30383d, #1a2024); color: #f3eee5; border-color: #4d565c;
  }
  body.cheve-brand #btnCobrarTop {
    background: var(--cheve-gold); color: #17130c; border: 1px solid #eed6a4;
  }
  body.cheve-brand #fiscalHealthBanner:not(.hidden) {
    margin: 0 0 22px; border: 1px solid #955c38; border-radius: 11px;
    padding: 13px 18px; background: linear-gradient(110deg, #52241e, #2f1b19); color: #ffe5d8;
  }
  body.cheve-brand #fiscalHealthBanner.bg-sky-50 { background: #172c39; border-color: #5c849a; color: #c5e2f3; }
  body.cheve-brand #fiscalHealthBanner a { background: var(--cheve-gold); color: #1c1713; border-color: #e5c88f; }
  body.cheve-brand .cheve-dashboard { --cheve-card-gap: 14px; }
  body.cheve-brand .cheve-dashboard > div:first-child { align-items: center; margin-bottom: 22px; }
  body.cheve-brand .cheve-dashboard h1 { font-size: clamp(25px, 2.1vw, 36px); letter-spacing: -.7px; }
  body.cheve-brand .cheve-dashboard .cheve-dashboard-badge { display: none; }
  body.cheve-brand .cheve-dashboard [data-mod-action] {
    min-height: 40px; padding-inline: 14px; font-size: 12px; border-radius: 9px;
    border: 1px solid #4a5359; background: linear-gradient(120deg, #30383d, #1a2024); color: #f3eee5;
    box-shadow: inset 0 1px #ffffff0c, 0 3px 8px #0002;
  }
  body.cheve-brand .cheve-dashboard :is([data-mod-action=dashboard-cobrar], [data-mod-action=propinas-retirar]:not(:disabled)) {
    background: var(--cheve-gold); color: #1b160d; border-color: #f0d8a0;
    box-shadow: 0 0 15px #d7ac641f, inset 0 1px #fff7c7;
  }
  body.cheve-brand .resumen-operacion-grid { gap: var(--cheve-card-gap); margin-bottom: 20px; }
  body.cheve-brand .cheve-summary-card {
    background: linear-gradient(120deg, #2a3237, #1b2125); border: 1px solid #495157;
    color: #f3eee5; border-radius: 11px; padding: 16px 18px; min-height: 152px;
    box-shadow: inset 0 1px #ffffff0a, 0 5px 16px #0002;
  }
  body.cheve-brand .cheve-summary-card > div:first-child { flex-direction: column-reverse; gap: 9px; }
  body.cheve-brand .cheve-summary-card > div > p { font-size: 12px; text-transform: none; letter-spacing: 0; }
  body.cheve-brand .cheve-summary-card > div > span { font-size: 25px; }
  body.cheve-brand .cheve-summary-card > p:first-of-type { font-size: clamp(22px, 2.1vw, 30px); margin-top: 13px; white-space: nowrap; }
  body.cheve-brand .cheve-summary-card--sales {
    border-color: #d4a75a; background: linear-gradient(130deg, #44381c, #27251c 60%, #3b301a);
    box-shadow: inset 0 1px 5px #f1ce8c50, 0 0 18px #d8aa4115;
  }
  body.cheve-brand .cheve-summary-card--sales > div { color: #f1d18c; }
  body.cheve-brand .cheve-summary-card [data-mod-action] { min-height: 28px; font-size: 10px; padding-inline: 6px; }
  body.cheve-brand .cheve-dashboard > .grid { gap: 16px; margin-top: 16px; }
  body.cheve-brand .cheve-dashboard > .grid > section {
    background: linear-gradient(120deg, #242c31, #171e22); border: 1px solid #454e54;
    border-radius: 12px; padding: 19px 22px;
  }
  body.cheve-brand .cheve-dashboard h3 { font-size: 20px; margin-bottom: 20px; }
  body.cheve-brand .cheve-payment-row { margin-block: 19px; }
  body.cheve-brand .cheve-payment-row > div:first-child > span { font-size: 14px; color: #ede9e2; }
  body.cheve-brand .cheve-payment-track { height: 8px; background: #414c53; }
  body.cheve-brand .cheve-payment-fill { background: var(--cheve-gold) !important; box-shadow: inset 0 1px #ffe2a7; }
  body.cheve-brand .cheve-salon-row { background: linear-gradient(120deg, #2a3237, #20272b); border-radius: 8px; min-height: 48px; }
  body.cheve-brand .cheve-salon-row b { color: #f3eee5; }
  body.cheve-brand .cheve-salon-row .text-red-700 { color: #ffaaa5; }

  /* Componentes operativos: se conservan estados, tamaños y selectores. */
  body.cheve-brand :is(.panel, .metrics > div, .notice, .ca-card, .ca-banner, .tg-card, .tg-stat,
    .insumo-card, .insumo-ficha, .warehouse-module, .tg-day, .tg-search-results, .tg-unit-options) {
    background-color: #20262a; color: var(--ink); border-color: var(--line);
  }
  body.cheve-brand :is(.muted, .ca-muted, .tg small, .tg-empty, .tg-extra, .footnote, .brand small) { color: var(--muted); }
  body.cheve-brand :is(.warehouse-header, .warehouse-panel-content) { background: #171d21; border-color: var(--line); }
  body.cheve-brand :is(.warehouse-button, .warehouse-tools a, .warehouse-tools button, .area-button, .tg button, .ca button) {
    color: #f3eee5; background-color: #272f34; border-color: #4d565c;
  }
  body.cheve-brand :is(.warehouse-module, .area-button):hover { background: #30383d; }
  body.cheve-brand :is(.warehouse-module[aria-current=page], .area-button[aria-pressed=true]) {
    background: #c5a46b22; border-color: #c5a46b; color: #f1d69b;
  }
  body.cheve-brand :is(.warehouse-module-icon, .chip, .mark, .tg-badge) { background: #c5a46b22; color: #e9c78e; }
  body.cheve-brand :is(button.primary, .tg button.tg-primary, .ca button.ca-primary, .confirmacion-aceptar) {
    background: var(--cheve-gold); color: #1b160d; border-color: #e3c590;
  }
  body.cheve-brand :is(th, thead, .tg-history-filters, .tg-day.tg-out) { background: #171d21; color: #bdc3c6; border-color: var(--line); }
  body.cheve-brand :is(td, th, .tg-credit, .tg-items, .tg-agenda-row) { border-color: var(--line); }
  body.cheve-brand :is(.tg, .ca, .tg-dialog, .tg-dialog-body, .confirmacion-contenido) { color: var(--ink); }
  body.cheve-brand :is(.tg-dialog, .tg-dialog-body, .tg-unit-control, .confirmacion-acciones) { background: #20262a; border-color: var(--line); }
  body.cheve-brand .tg .tg-unit-control input { background: transparent; }
  body.cheve-brand :is(.tg-record-action span, .tg-alert, .tg-day button) { background: #2a3237; color: #e4e5e1; }
  body.cheve-brand :is(.tg-credit > strong, .tg-eyebrow, .eyebrow) { color: #d8b575; }
  body.cheve-brand :is(.tg-error, .tg-late, .notice.bad) { background: #44231f; color: #ffb0a8; border-color: #9c594f; }
  body.cheve-brand .tg .tg-alert::before { color: #f3eee5; }
  body.cheve-brand .tg .tg-alert::after { color: #b8b9b8; }
  body.cheve-brand #modalConfirmacionSistema { background: #20262a; color: var(--ink); border-color: var(--line); }
  body.cheve-brand .confirmacion-contenido p { color: #c0c3c4; }
  body.cheve-brand :is(.confirmacion-icono, .confirmacion-cerrar) { background: #c5a46b22; color: #e5c58e; }
  body.cheve-brand .confirmacion-acciones button:not(.confirmacion-aceptar) { background: #30383d; color: #f3eee5; border-color: #50585e; }

  /* Acceso: composición de la primera propuesta, con formulario real intacto. */
  body.cheve-login { min-height: 100dvh; padding: 0; display: block; }
  .cheve-login .cheve-login-layout { display: grid; grid-template-columns: 55fr 45fr; min-height: 100dvh; width: 100%; max-width: none; }
  .cheve-login .cheve-login-story { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 100px); display: flex; flex-direction: column; }
  .cheve-login .cheve-login-story > img { width: min(440px, 88%); position: relative; z-index: 1; }
  .cheve-login .cheve-login-copy { position: relative; z-index: 1; margin-top: clamp(50px, 8vh, 95px); }
  .cheve-login-copy h2 { font: 700 clamp(40px, 4.6vw, 76px)/1.12 Manrope, Inter, sans-serif; letter-spacing: -2px; margin: 0; }
  .cheve-login-copy h2 span { display: block; color: #dcba7b; }
  .cheve-login-copy h2::after { content: ''; display: block; width: 64px; height: 3px; background: var(--cheve-gold); margin: 28px 0; }
  .cheve-login-copy p { color: #e7e5de; font-size: clamp(18px, 1.8vw, 28px); line-height: 1.4; }
  .cheve-login .cheve-login-art { position: absolute; bottom: 0; left: 0; width: 100%; height: 65%; opacity: .95; pointer-events: none; }
  .cheve-login .cheve-login-story-footer { position: relative; z-index: 1; margin-top: auto; padding-top: 160px; display: flex; flex-wrap: wrap; gap: 20px; color: #e2e1da; font-size: 13px; }
  .cheve-login-story-footer span { letter-spacing: .21em; font-size: 11px; }
  .cheve-login-story-footer a { color: inherit; border-left: 1px solid #c5a46b; padding-left: 20px; }
  .cheve-login .cheve-login-panel { display: flex; align-items: center; border-left: 1px solid #c5a46b55; padding: 52px clamp(34px, 5vw, 82px); background: radial-gradient(ellipse at top left, #31383e50, transparent 75%); }
  .cheve-login .cheve-login-card { width: 100%; max-width: 560px; margin: auto; background: transparent; padding: 0; box-shadow: none; }
  .cheve-login .cheve-login-heading { background: transparent; border: 0; align-items: flex-start; text-align: left; margin-bottom: 30px; }
  .cheve-login .cheve-login-eyebrow { display: flex; align-items: center; gap: 22px; width: 100%; color: #d9dcdd; font-size: 13px; letter-spacing: .18em; }
  .cheve-login-eyebrow::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, #dbbb79, transparent); }
  .cheve-login .cheve-login-heading h1 { font-size: clamp(36px, 3.5vw, 58px); color: #f5f1e9; margin: 12px 0 30px; }
  .cheve-login .cheve-login-welcome { font: 700 clamp(25px, 2.4vw, 38px)/1.2 Manrope, Inter, sans-serif; color: #f5f1e9; }
  .cheve-login #loginSubtitle { color: #c7cbcc; font-size: 16px; margin-top: 10px; }
  .cheve-login #loginForm label { text-transform: none; letter-spacing: 0; font-size: 16px; color: #eeeae3; margin: 0 0 9px; }
  .cheve-login #loginForm :is(input:not([aria-hidden]), select) { min-height: 54px; border: 1px solid #687078; border-radius: 9px; font-size: 16px; background: linear-gradient(110deg, #2c3338, #1c2226); }
  .cheve-login #btnLogin { min-height: 62px; font-size: 18px; background: var(--cheve-gold); color: #19150e; border: 1px solid #f1d69b; box-shadow: inset 0 1px #fff2be, 0 8px 24px #0003; }
  .cheve-login #errorMsg { color: #ffb7b1; background: #442421; border: 1px solid #97594f; border-radius: 8px; padding: 10px; }
  .cheve-login .cheve-login-authorized { color: #c8cbcb; text-align: center; font-size: 13px; margin-top: 24px; }
  .cheve-login .cheve-login-footer { margin-top: 32px; padding-top: 24px; border-top: 1px solid #c5a46b55; }
  .cheve-login .cheve-login-footer p { color: #d2d2ce; font-size: 13px; }

  @media (max-width: 1199px) {
    body.cheve-brand #appHeader .font-manrope { font-size: 15px; }
    body.cheve-brand #appHeader > div { padding-inline: 12px; gap: 8px; }
    body.cheve-brand #appSidebar { width: 190px; }
    body.cheve-brand #appMain { padding: 18px; }
    body.cheve-brand #fiscalHealthBanner:not(.hidden) { margin-left: 0; }
    body.cheve-brand .cheve-summary-card { min-height: 135px; }
  }
  @media (max-width: 850px) {
    .cheve-login .cheve-login-layout { grid-template-columns: 1fr; }
    .cheve-login .cheve-login-story { padding: 34px 30px 24px; }
    .cheve-login .cheve-login-story > img { width: 230px; }
    .cheve-login .cheve-login-copy { margin-top: 26px; }
    .cheve-login-copy h2 { font-size: 34px; letter-spacing: -1px; }
    .cheve-login-copy h2 span { display: inline; }
    .cheve-login-copy h2::after { margin: 16px 0; }
    .cheve-login-copy p { font-size: 16px; }
    .cheve-login .cheve-login-story-footer { display: none; }
    .cheve-login .cheve-login-art { height: 90%; opacity: .35; }
    .cheve-login .cheve-login-panel { padding: 28px 30px 38px; border-left: 0; border-top: 1px solid #c5a46b40; }
    .cheve-login .cheve-login-heading h1 { font-size: 32px; margin-bottom: 20px; }
    .cheve-login .cheve-login-heading { margin-bottom: 22px; }
  }
  @media (max-width: 767px) {
    body.cheve-brand #appHeader { height: auto; min-height: 52px; }
    body.cheve-brand #appHeader > div { flex-wrap: wrap; padding-block: 8px; gap: 7px; }
    body.cheve-brand #appSidebar { width: 66px; }
    body.cheve-brand #appSidebar > div:not(.cheve-sidebar-brand) { display: none; }
    body.cheve-brand #appSidebar nav :is(a, button) { font-size: 0; padding: 10px; justify-content: center; gap: 0; }
    body.cheve-brand #appSidebar nav .material-symbols-outlined { font-size: 23px; }
    body.cheve-brand #appSidebar .cheve-sidebar-brand { padding: 13px; }
    body.cheve-brand #appSidebar .cheve-brand-signature { width: 40px; height: 40px; max-width: 100%; }
    body.cheve-brand #appSidebar .cheve-sidebar-brand { overflow: hidden; }
    body.cheve-brand #fiscalHealthBanner:not(.hidden) { margin: 0 0 16px; padding: 10px; font-size: 12px; flex-direction: column; }
    body.cheve-brand #fiscalHealthBanner > div .text-xs { font-size: 11px; }
    body.cheve-brand #fiscalHealthBanner a { font-size: 10px; padding: 7px; align-self: flex-end; }
    body.cheve-brand #appMain { padding: 12px; }
    body.cheve-brand .cheve-summary-card { padding: 12px; min-height: 135px; }
    body.cheve-brand .cheve-summary-card > p:first-of-type { font-size: 21px; }
    body.cheve-brand .cheve-dashboard > .grid > section { padding: 15px; }
    body.cheve-brand .cheve-dashboard [data-mod-action] { min-height: 38px; font-size: 11px; padding-inline: 9px; }
    body.cheve-brand #appFooter { height: auto; min-height: 34px; padding: 8px 12px; }
    body.cheve-brand #appFooter > div { font-size: 9px; flex-wrap: wrap; gap: 5px; }
    body.cheve-brand #appRightPanel:not(.hidden) { position: fixed; inset: 60px 10px 44px 76px; width: auto; z-index: 30; border: 1px solid #647079; border-radius: 12px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .cheve-light-frame::after { animation: none; --cheve-light-angle: 45deg; }
  }
  @media (forced-colors: active) { body.cheve-brand .cheve-light-frame { display: none; } }
}
@media print { .cheve-light-frame, .cheve-sidebar-brand, .cheve-login-story { display: none !important; } }
