:root {
  --bg: #f4f6f2;
  --app-background: #f4f6f2;
  --panel: #ffffff;
  --theme-surface-soft: #ffffff;
  --text: #000000;
  --muted: #000000;
  --line: #dfe5dc;
  --accent: #1f8a70;
  --accent-strong: #126b56;
  --danger: #b42318;
  --warning: #b7791f;
  --shadow: 0 20px 50px rgba(26, 39, 33, 0.12);
  --control-height: 42px;
  --dialog-padding: 20px;
  --dialog-gap: 18px;
  --app-scale: 1;
}

/* Acceso JP Sistema: renovación visual. Los selectores, campos y flujo de
   autenticación se conservan; este bloque solo define su presentación. */
.auth-screen {
  min-height: 100vh;
  padding: clamp(24px, 3.1vw, 40px);
  background: linear-gradient(135deg, #e9f8fa 0%, #f8fbfc 50%, #eaf3f9 100%);
}

.auth-layout {
  width: min(1200px, 100%);
  min-height: min(774px, calc(100vh - 80px));
  grid-template-columns: minmax(0, 1.58fr) minmax(405px, 1fr);
  border: 0;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(8, 52, 70, .17);
}

.auth-showcase {
  min-height: 0;
  padding: clamp(46px, 4.7vw, 70px) clamp(38px, 4.1vw, 58px) 43px;
  background:
    linear-gradient(90deg, rgba(0, 46, 64, .97) 0%, rgba(1, 61, 79, .88) 42%, rgba(0, 39, 55, .40) 100%),
    url("img/jpsistema-login-hero.png") center / cover no-repeat;
}

.auth-showcase::after { display: none; }
.auth-brand { gap: 13px; }
.auth-brand .brand-mark {
  width: clamp(142px, 13vw, 190px);
  height: clamp(142px, 13vw, 190px);
  margin-bottom: 13px;
  padding: 8px;
  border: 0;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 17px 35px rgba(0, 14, 25, .27);
}

.auth-brand h1 { font-size: clamp(46px, 4.6vw, 65px); letter-spacing: -2.6px; }
.auth-brand h1 span { color: #10d7f2; }
.auth-brand .auth-kicker {
  padding: 8px 15px;
  border-radius: 999px;
  color: #d9fbff;
  background: rgba(19, 159, 181, .38);
  box-shadow: inset 0 0 0 1px rgba(126, 240, 255, .18);
  font-size: 11px;
  letter-spacing: 1.35px;
}

.auth-brand p { max-width: 472px; color: rgba(241, 251, 255, .89); font-size: 17px; line-height: 1.48; }
.auth-highlights { gap: 14px; }
.auth-highlights article { min-height: 178px; align-content: start; gap: 9px; padding: 20px 17px; border-color: rgba(161, 238, 255, .2); border-radius: 17px; background: rgba(3, 42, 59, .45); box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.auth-highlights span { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 2px; border-radius: 12px; color: #16b75c; background: #c9ffde; font-size: 28px; line-height: 1; }
.auth-highlights article:nth-child(2) span { color: #1687dc; background: #d7ecff; }
.auth-highlights article:nth-child(3) span { color: #ff7b22; background: #ffe0c9; }
.auth-highlights strong { font-size: 15px; }
.auth-highlights small { color: rgba(238, 249, 252, .79); font-size: 12px; line-height: 1.42; }
.auth-showcase-note { display: flex; align-items: center; gap: 13px; margin: -14px 0 0; color: rgba(228, 247, 252, .74); font-size: 12px; }
.auth-showcase-note i { width: 36px; height: 4px; flex: 0 0 auto; border-radius: 999px; background: #12d4ed; }

.auth-access {
  position: relative;
  overflow: hidden;
  padding: clamp(45px, 5.4vw, 76px) clamp(34px, 4.3vw, 62px) 36px;
  background: linear-gradient(145deg, #fff 0%, #fff 72%, #edfaff 100%);
}

.auth-access::after { content: ""; position: absolute; right: -70px; bottom: -105px; width: 380px; height: 220px; border-radius: 52% 0 0; background: radial-gradient(ellipse at 45% 0%, rgba(71, 211, 231, .25), transparent 63%); pointer-events: none; }
.auth-card { position: relative; z-index: 1; width: min(365px, 100%); gap: 20px; }
.auth-card-head { gap: 5px; }
.auth-card .eyebrow { color: #048ea2; font-size: 11px; letter-spacing: .8px; }
.auth-card-head h2 { color: #10203c; font-size: 37px; letter-spacing: -.055em; }
.auth-card-head p:last-child { max-width: 325px; color: #75859e; font-size: 15px; line-height: 1.42; }
.auth-card .auth-form { gap: 16px; }
.auth-card .auth-form label { display: grid; gap: 7px; }
.auth-card .auth-form label > span { color: #17243d; font-size: 11px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }
.auth-input-wrap,.auth-card .password-field { position: relative; display: block; }
.auth-card input { width: 100%; min-height: 51px; padding: 0 48px; border: 1px solid #d8e0eb; border-radius: 11px; color: #20314c; background: #fafcff; box-shadow: none; font-size: 14px; }
.auth-card input:focus { border-color: #0aa5b7; box-shadow: 0 0 0 3px rgba(0, 165, 183, .12); }
.auth-card input::placeholder { color: #8c9ab0; }
.auth-input-icon { position: absolute; z-index: 1; top: 50%; left: 16px; display: grid; width: 20px; height: 20px; place-items: center; transform: translateY(-50%); color: #5d7090; font-size: 23px; font-style: normal; line-height: 1; pointer-events: none; }.auth-input-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-card .password-field input { padding-right: 48px; }
.auth-card .password-toggle { z-index: 2; right: 8px; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 0; color: #5d7090; background: transparent; box-shadow: none; font-size: 0; }
.auth-card .password-toggle::after { content: "◉"; font-size: 17px; line-height: 1; }
.auth-card .password-toggle:hover,.auth-card .password-toggle.is-visible { color: #078fa0; background: #e5fbfd; }
.auth-submit { min-height: 54px; margin-top: 3px; border-radius: 10px; background: linear-gradient(100deg, #008a9e, #06a7b9); box-shadow: 0 10px 20px rgba(0, 141, 158, .22); font-size: 16px; }
.auth-submit::before { content: "➜"; display: inline-block; margin-right: 11px; color: #bdf5f8; font-size: 25px; line-height: 0; vertical-align: -2px; }
.auth-support { gap: 13px; padding: 13px 15px; border: 0; border-radius: 11px; background: linear-gradient(100deg, #e1fbf3, #effcf8); }
.auth-support span { width: 32px; height: 32px; flex-basis: 32px; background: #10bd72; font-size: 17px; }
.auth-support p { color: #188055; font-size: 12px; line-height: 1.35; }
.auth-note { padding-top: 15px; border-top: 1px solid #e2e7ee; color: #8090a6; font-size: 11px; text-align: center; }
.auth-footer-brand { display: flex; align-items: center; justify-content: center; gap: 7px; color: #102e52; font-size: 17px; font-weight: 800; text-align: left; }
.auth-footer-brand img { width: 31px; height: 31px; object-fit: contain; }
.auth-footer-brand strong { color: #028ca1; }
.auth-footer-brand small { display: block; margin-top: 1px; color: #718098; font-size: 7px; font-weight: 700; }

@media (max-width: 1080px) and (min-width: 721px) {
  .auth-layout { width: min(720px, 100%); grid-template-columns: 1fr; }
  .auth-showcase { min-height: 510px; }.auth-access { padding: 48px 36px; }
}

@media (max-width: 720px) {
  .auth-screen { display: block; min-height: 100svh; padding: 0; background: #06384d; }
  .auth-layout { width: 100%; min-height: 100svh; display: block; overflow: visible; border-radius: 0; background: transparent; box-shadow: none; }
  .auth-showcase { min-height: 675px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 54px 30px 48px; background: linear-gradient(90deg, rgba(0, 42, 59, .95), rgba(0, 52, 70, .52)), url("img/jpsistema-login-hero.png") 61% center / auto 100% no-repeat; }
  .auth-brand { gap: 10px; }.auth-brand .brand-mark { width: 148px; height: 148px; margin-bottom: 7px; padding: 7px; border-radius: 22px; }.auth-brand .auth-kicker { padding: 7px 12px; font-size: 9px; letter-spacing: 1px; }.auth-brand h1 { font-size: 43px; letter-spacing: -1.8px; }.auth-brand p { max-width: 290px; font-size: 16px; line-height: 1.45; }
  .auth-highlights { gap: 9px; }.auth-highlights article { min-height: 152px; gap: 7px; padding: 13px 11px; border-radius: 14px; }.auth-highlights span { width: 39px; height: 39px; border-radius: 10px; font-size: 24px; }.auth-highlights strong { font-size: 12px; }.auth-highlights small { font-size: 10px; line-height: 1.3; }.auth-showcase-note { margin: -3px 0 0; font-size: 10px; }.auth-showcase-note i { width: 31px; }
  .auth-access { min-height: 0; margin: -35px 13px 0; padding: 30px 22px 31px; border-radius: 23px 23px 0 0; background: linear-gradient(150deg, #fff, #f5fcff); }.auth-access::after { width: 280px; height: 150px; right: -80px; bottom: -70px; }.auth-card { gap: 17px; width: 100%; }.auth-card-head h2 { font-size: 32px; }.auth-card-head p:last-child { font-size: 14px; }.auth-card .auth-form { gap: 14px; }.auth-card input { min-height: 50px; }.auth-submit { min-height: 54px; }.auth-note { padding-top: 13px; }.auth-footer-brand { padding-top: 1px; }
}

/* Formulario moderno de productos */
#productDialog:not([open]) { display: none !important; }
#productDialog {
  width: min(1450px, calc(100vw - 46px));
  height: min(920px, calc((100vh - 30px) / var(--app-scale)));
  border: 1px solid #dce9f7;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f8fbff 68%, #f2f8ff);
  box-shadow: 0 28px 75px rgba(31, 74, 124, .22);
}
#productDialog::backdrop { background: rgba(20, 42, 68, .35); backdrop-filter: blur(3px); }
#productDialog #productForm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; height: 100%; max-height: none; padding: 22px 26px 16px; overflow: hidden; }
#productDialog .product-dialog-head { align-items: flex-start; margin: 0; }
#productDialog .product-dialog-head > div { min-width: 0; }
#productDialog .product-dialog-head h2 { margin: 3px 0 4px; color: #0c1c54; font-size: clamp(30px, 2.7vw, 42px); letter-spacing: -.045em; }
#productDialog .product-dialog-head .eyebrow { color: #008d82; }
.product-dialog-subtitle { margin: 0; color: #56709d; font-size: 15px; font-weight: 500; }
#productDialog .product-dialog-head > .icon-button { width: 48px; min-width: 48px; height: 48px; border-color: #d5e3f5; border-radius: 13px; color: #0c215b; background: rgba(255,255,255,.88); font-size: 29px; }
.product-mobile-back { display: none !important; }

.product-form-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(310px, .78fr); grid-template-areas: "fields media" "color media" "public media"; align-content: start; gap: 12px 16px; min-height: 0; overflow: auto; padding: 2px 4px 4px 0; }
.product-main-fields { grid-area: fields; align-self: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; overflow: visible; border: 1px solid #dfebf8; border-radius: 17px; background: rgba(255,255,255,.78); }
.product-field-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px; min-width: 0; min-height: 99px; padding: 14px 18px; border-right: 1px solid #e7eff8; border-bottom: 1px solid #e7eff8; }
.product-field-card:nth-child(even) { border-right: 0; }
.product-barcode-card { grid-column: 1 / -1; }
.product-barcode-scan-button { display: none; border: 0; cursor: pointer; }
.product-barcode-scan-hint { display: none; }
.product-barcode-content { display: grid; min-width: 0; gap: 5px; }
.product-barcode-content > label { display: grid; min-width: 0; gap: 6px; }
.product-field-card > label { display: grid; min-width: 0; gap: 6px; }
.product-field-card label > span,.product-color-section strong,.product-media-title { color: #16336b; font-size: 14px; font-weight: 800; text-transform: none; }
.product-field-card small { color: #58719c; font-size: 11px; font-weight: 600; line-height: 1.35; text-transform: none; }
.product-field-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 15px; font-size: 27px; font-weight: 900; }
.product-icon-green { color: #079c7a; background: #e4f9f1; }
.product-icon-blue { color: #0875de; background: #e7f2ff; }
#productDialog input,#productDialog select { min-height: 48px; border: 1px solid #d6e3f3; border-radius: 10px; color: #10245b; background: #fff; font-size: 15px; font-weight: 700; }
#productDialog input::placeholder { color: #7387ad; font-weight: 500; }
#productDialog input:disabled,#productDialog select:disabled { color: #71809b; background: #f7f9fc; opacity: 1; }
#productDialog :is(.category-picker, .product-supplier-picker) { grid-template-columns: minmax(0, 1fr) 62px; gap: 12px; }
#productDialog :is(.add-category-button, .add-product-supplier-button) { width: 62px; height: 48px; border-radius: 12px; background: linear-gradient(145deg, #13ad8d, #078eb3); box-shadow: 0 8px 18px rgba(5, 143, 154, .18); }
.product-supplier-card small { display: block; margin-top: 6px; color: #6d819f; font-size: 11px; font-weight: 600; line-height: 1.3; }
#productDialog .new-category-row { grid-column: 1 / -1; border-radius: 13px; }
.product-affix-input { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; }
.product-affix-input b { display: grid; min-width: 58px; place-items: center; border: 1px solid #d6e3f3; border-right: 0; border-radius: 10px 0 0 10px; color: #3f628e; background: #f3f8fe; font-size: 15px; }
.product-affix-input input { border-radius: 0 10px 10px 0 !important; }
.product-affix-suffix { grid-template-columns: minmax(0, 1fr) auto; }
.product-affix-suffix b { order: 2; border: 1px solid #d6e3f3; border-left: 0; border-radius: 0 10px 10px 0; }
.product-affix-suffix input { border-radius: 10px 0 0 10px !important; }
.product-total-card { background: linear-gradient(125deg, #f4fffb, #effaf7); }
.product-total-native { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.product-total-display { color: #275879; font-size: 22px; font-weight: 900; }

.product-media-panel { grid-area: media; display: grid; align-content: start; gap: 10px; padding: 13px; border: 1px solid #e0ebf8; border-radius: 17px; background: rgba(255,255,255,.8); }
.product-upload-card { display: grid; gap: 11px; }
.product-upload-card > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-upload-dropzone { position: relative; display: grid; min-height: 180px; place-items: center; align-content: center; gap: 5px; overflow: hidden; border: 1.5px dashed #b9d6fb; border-radius: 14px; padding: 0; color: #13245a; background: linear-gradient(145deg, #fff, #f6faff); font: inherit; text-align: center; cursor: pointer; }
.product-upload-dropzone small { color: #5c78a7; font-size: 12px; text-transform: none; }
.product-upload-icon { display: grid; width: 60px; height: 60px; place-items: center; border-radius: 50%; color: #8cb7e9; background: #eaf3ff; font-size: 31px; }
#productImagePreview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product-upload-dropzone.has-image .product-upload-icon,.product-upload-dropzone.has-image strong,.product-upload-dropzone.has-image small { display: none; }
.product-upload-actions { display: grid; grid-template-columns: 1fr; gap: 8px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.product-upload-actions b { display: grid; min-height: 43px; place-items: center; border: 1px solid #d4e4f7; border-radius: 10px; color: #104b9b; background: #f5f9ff; font-size: 12px; }
#imageHint { color: #677fa7; font-size: 10px; font-weight: 600; text-transform: none; }
.product-image-picker-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 24px 58px rgba(17, 49, 91, .28); }
.product-image-picker-dialog::backdrop { background: rgba(14, 36, 64, .5); backdrop-filter: blur(3px); }
.product-image-picker-body { position: relative; display: grid; justify-items: center; gap: 11px; padding: 28px; color: #183267; text-align: center; }
.product-image-picker-close { position: absolute; top: 13px; right: 13px; width: 42px; height: 42px; border-color: #d6e5f7; color: #16336b; background: #fff; font-size: 26px; }
.product-image-picker-icon { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 19px; color: #0875de; background: #e7f2ff; font-size: 34px; }
.product-image-picker-body .eyebrow { margin: 2px 0 0; color: #098e80; }
.product-image-picker-body h2 { margin: 0; font-size: 23px; }
.product-image-picker-body > p:last-of-type { max-width: 330px; margin: 0; color: #63789c; line-height: 1.45; }
.product-image-picker-actions { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 7px; }
.product-image-picker-actions button { min-height: 49px; }
@media (max-width: 420px) { .product-image-picker-actions { grid-template-columns: 1fr 1fr; }.product-image-picker-actions .ghost-button { grid-column: 1 / -1; } }
.product-live-preview { display: grid; gap: 10px; padding: 12px; border: 1px solid #e2ecf8; border-radius: 14px; background: linear-gradient(145deg, #fff, #f2f8ff); }
.product-live-preview-card { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 13px; align-items: center; }
.product-preview-image { display: grid; width: 94px; height: 94px; place-items: center; border: 1px solid #d8e7f8; border-radius: 16px; color: #84afe2; background: #fff; font-size: 42px; }
.product-live-preview-card > div { display: grid; gap: 4px; min-width: 0; color: #6078a1; font-size: 12px; }
.product-live-preview-card strong { overflow: hidden; color: #0e2059; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.product-live-preview-card em { justify-self: start; padding: 4px 10px; border-radius: 999px; color: #18843e; background: #ddf7e5; font-size: 11px; font-style: normal; font-weight: 800; }
.product-live-preview-card b { color: #203b70; }
.product-label-preview { width: 100%; min-height: 42px; color: #1252a1; background: #edf5ff; }

.product-color-section { grid-area: color; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 86px; padding: 10px 18px; border: 1px solid #dfebf8; border-radius: 15px; background: rgba(255,255,255,.78); }
.product-color-section > div { display: grid; gap: 9px; }
.product-color-options { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.product-color-swatch,#productDialog #productColor { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #d8e5f4; cursor: pointer; }
.product-color-swatch.active { box-shadow: 0 0 0 3px #9cdabd; }
.product-color-swatch.active::after { content: "✓"; color: #fff; font-size: 19px; font-weight: 900; }
#productDialog #productColor { overflow: hidden; background: #fff; }
.product-public-catalog-field { grid-area: public; margin: 0; }
#productDialog .product-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
#productDialog .product-dialog-actions button { min-width: 118px; min-height: 48px; border-radius: 11px; }
#productDialog #saveProductBtn { min-width: 220px; background: linear-gradient(115deg, #12a88d, #078bc0); box-shadow: 0 10px 22px rgba(6, 143, 165, .2); }

/* Escritorio: el código ocupa una fila clara, con la cámara a su derecha. */
@media (min-width: 721px) {
  #productDialog .product-barcode-card {
    grid-template-columns: 64px minmax(320px, 1fr) 64px;
    min-height: 99px;
  }
  #productDialog .product-barcode-static-icon { grid-column: 1; grid-row: 1; }
  #productDialog .product-barcode-content { grid-column: 2; grid-row: 1; width: 100%; }
  #productDialog .product-barcode-scan-button {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 15px;
    color: #0875de;
    background: linear-gradient(135deg, #edf5ff, #dfeeff);
  }
  #productDialog .product-barcode-scan-button .catalog-scan-icon { width: 28px; height: 28px; stroke-width: 2.25; }
  #productDialog .product-barcode-content input { width: 100%; }
}

/* Directorio de administradores: jerarquía visual de accesos, datos y
   acciones. Las reglas viven al final para prevalecer sobre el listado
   administrativo genérico sin alterar los demás módulos. */
.super-admin-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; }
.super-admin-hero .eyebrow { margin:0 0 8px; color:#008576; font-size:12px; font-weight:900; text-transform:uppercase; }
.super-admin-hero h2 { margin:0; color:#09234a; font-size:clamp(30px,3vw,44px); line-height:1.06; letter-spacing:-.045em; }
.super-admin-hero p:not(.eyebrow) { max-width:880px; margin:10px 0 0; color:#61718f; font-size:16px; font-weight:650; line-height:1.45; }
.super-admin-new-button { min-height:60px; flex:0 0 auto; padding-inline:24px; border:0; border-radius:12px; color:#fff; background:linear-gradient(130deg,#008f7c,#007b71); box-shadow:0 13px 25px rgba(0,126,111,.22); font-size:15px; }
.super-admin-new-button span { margin-right:8px; font-size:24px; vertical-align:-2px; }
.super-admin-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.super-admin-stat { display:flex; align-items:center; gap:14px; min-height:108px; padding:16px; border:1px solid #dce8ed; border-radius:12px; background:linear-gradient(135deg,#f8fffe,#effafa); }
.super-admin-stat > span { display:grid; width:54px; height:54px; flex:0 0 auto; place-items:center; border-radius:13px; color:#007f70; background:#d7f8ed; font-size:28px; font-weight:900; }
.super-admin-stat div { display:grid; grid-template-columns:auto 1fr; column-gap:8px; align-items:baseline; }
.super-admin-stat strong { color:#082851; font-size:35px; line-height:1; }
.super-admin-stat b { color:#102b51; font-size:14px; }
.super-admin-stat small { grid-column:1/-1; margin-top:7px; color:#5d7190; font-size:11px; font-weight:650; }
.super-admin-stat-green { background:linear-gradient(135deg,#f4fff9,#e9fbf1); }.super-admin-stat-green > span { color:#078b55; background:#d8f9e4; }
.super-admin-stat-orange { background:linear-gradient(135deg,#fffaf1,#fff5e5); }.super-admin-stat-orange > span { color:#ee8b00; background:#fff0ce; }
.super-admin-stat-blue { background:linear-gradient(135deg,#f4faff,#e9f5ff); }.super-admin-stat-blue > span { color:#0978e6; background:#dceeff; }
.super-admin-directory { display:flex; flex-direction:column; min-height:0; height:100%; padding:22px; border:1px solid #dce7ee; border-radius:16px; background:rgba(255,255,255,.91); box-shadow:0 12px 28px rgba(34,67,93,.06); }
.super-admin-directory-head { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.super-admin-directory-title { display:flex; align-items:center; gap:14px; }.super-admin-directory-title>span { display:grid; width:58px; height:58px; place-items:center; border-radius:15px; color:#008577; background:linear-gradient(135deg,#ddfbf4,#cdf3e8); font-size:30px; }.super-admin-directory-title p { margin:0 0 3px; color:#087b72; font-size:11px; font-weight:900; }.super-admin-directory-title h3 { margin:0; color:#0a2954; font-size:23px; letter-spacing:-.03em; }
.super-admin-filters { display:flex; align-items:stretch; gap:12px; }.super-admin-search { display:flex; align-items:center; min-width:320px; min-height:51px; gap:11px; padding:0 15px; border:1px solid #d5e1ed; border-radius:11px; color:#0b315e; background:#fff; }.super-admin-search span { font-size:27px; line-height:1; }.super-admin-search input { min-width:0; flex:1; border:0; outline:0; color:#1e3559; background:transparent; font-size:14px; }.super-admin-status { position:relative; display:grid; gap:0; min-width:155px; padding:7px 12px 0; border:1px solid #d5e1ed; border-radius:11px; background:#fff; }.super-admin-status span { position:absolute; top:-9px; left:12px; padding:0 4px; color:#657590; background:#fff; font-size:11px; font-weight:800; }.super-admin-status select { min-height:38px; border:0; outline:0; color:#173458; background:transparent; font-size:14px; font-weight:750; }
.super-admin-list-label { display:flex; justify-content:flex-end; min-height:22px; margin:10px 0 7px; color:#5a6e8e; font-size:12px; }.super-admin-list-label strong { font-weight:750; }
.super-admin-card-grid { display:grid; min-height:0; flex:1; grid-template-rows:repeat(2,minmax(0,1fr)); gap:14px; }
.super-admin-card { display:grid; grid-template-columns:minmax(360px,1.55fr) minmax(190px,.7fr) minmax(190px,.62fr); align-items:center; gap:20px; padding:16px 20px; border:1px solid #dce6ef; border-radius:15px; background:linear-gradient(105deg,#fff,#fbfdff); box-shadow:0 5px 13px rgba(26,58,88,.035); }
.super-admin-card-identity { display:flex; align-items:center; min-width:0; gap:16px; }.super-admin-avatar { display:grid; width:72px; height:72px; flex:0 0 auto; place-items:center; border-radius:50%; color:#008371; background:linear-gradient(135deg,#d5f8ed,#ebfbf8); font-size:29px; font-weight:900; }.super-admin-card-identity h4 { margin:0 0 5px; color:#08264d; font-size:20px; }.super-admin-badges { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:8px; }.super-admin-badges span { padding:6px 10px; border-radius:7px; color:#fff; background:linear-gradient(120deg,#009983,#008270); font-size:11px; font-weight:900; }.super-admin-badges small { padding:6px 9px; border-radius:7px; color:#395174; background:#eaf0f8; font-size:11px; font-weight:750; }.super-admin-card-identity p { display:flex; align-items:center; gap:8px; margin:5px 0 0; overflow-wrap:anywhere; color:#365171; font-size:13px; font-weight:650; }.super-admin-card-identity p b { color:#14365f; font-size:15px; }.super-admin-card-identity p.is-active { color:#008464; font-weight:850; }.super-admin-card-identity p.is-suspended { color:#c84b4b; font-weight:850; }.super-admin-card-identity p i { color:#6a7b92; font-style:normal; }
.super-admin-card-meta { display:grid; gap:13px; padding:4px 19px; border-inline:1px solid #e2eaf2; }.super-admin-card-meta p { display:grid; grid-template-columns:25px 1fr; column-gap:8px; margin:0; color:#55708e; font-size:11px; }.super-admin-card-meta p>b { grid-row:1/3; color:#0d345f; font-size:19px; }.super-admin-card-meta span { color:#637a98; }.super-admin-card-meta strong { color:#183558; font-size:13px; }
.super-admin-card-actions { display:grid; gap:8px; }.super-admin-card-actions button { min-height:41px; border-radius:9px; font-size:13px; }.super-admin-card-actions .secondary-button { border-color:#bfe8df; color:#007569; background:linear-gradient(90deg,#effcf7,#ecfaf7); }.super-admin-card-actions .ghost-button { border-color:#d3dfed; color:#123b68; background:#fff; }.super-admin-own-account { padding:11px; border-radius:9px; color:#52708d; background:#f1f6fb; font-size:12px; font-weight:750; text-align:center; }

@media (min-width:721px) { .super-mode .super-users-panel { grid-template-rows:auto auto minmax(0,1fr); gap:18px; padding:clamp(24px,2.4vw,38px); } .super-mode .super-users-panel #superAdminUserList { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; } }
@media (max-width:1040px) and (min-width:721px) { .super-admin-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-directory-head { align-items:flex-start; flex-direction:column; }.super-admin-filters { width:100%; }.super-admin-search { flex:1; }.super-admin-card { grid-template-columns:minmax(280px,1fr) minmax(180px,.7fr); }.super-admin-card-actions { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-card-meta { border-right:0; } }
@media (max-width:720px) { .super-mode .super-users-panel { padding:18px 14px 94px; background:linear-gradient(180deg,#f9fffd,#f4f9ff); }.super-admin-hero { display:block; }.super-admin-hero h2 { font-size:31px; }.super-admin-hero p:not(.eyebrow) { margin-top:7px; font-size:14px; }.super-admin-new-button { position:fixed; z-index:3; right:18px; bottom:16px; left:18px; min-height:57px; justify-content:center; box-shadow:0 10px 26px rgba(0,108,98,.29); }.super-admin-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:16px; }.super-admin-stat { min-height:98px; gap:10px; padding:12px; border-radius:12px; }.super-admin-stat>span { width:46px; height:46px; border-radius:12px; font-size:24px; }.super-admin-stat div { display:block; }.super-admin-stat strong { display:block; font-size:29px; }.super-admin-stat b { display:block; margin-top:3px; font-size:12px; }.super-admin-stat small { display:block; margin-top:4px; font-size:10px; line-height:1.25; }.super-admin-directory { height:auto; margin-top:16px; padding:13px; border-radius:14px; }.super-admin-directory-head { display:block; }.super-admin-directory-title { gap:10px; }.super-admin-directory-title>span { width:46px; height:46px; border-radius:12px; font-size:25px; }.super-admin-directory-title h3 { font-size:19px; }.super-admin-filters { display:grid; gap:10px; margin-top:15px; }.super-admin-search { min-width:0; min-height:48px; }.super-admin-status { min-height:53px; }.super-admin-list-label { justify-content:flex-end; margin:13px 2px 8px; }.super-admin-card-grid { display:grid; gap:12px; }.super-admin-card { display:block; padding:16px; border-radius:14px; }.super-admin-card + .super-admin-card { margin-top:0; }.super-admin-card-identity { align-items:flex-start; gap:13px; }.super-admin-avatar { width:64px; height:64px; font-size:25px; }.super-admin-card-identity h4 { font-size:18px; }.super-admin-card-identity p { font-size:13px; }.super-admin-card-meta { grid-template-columns:1fr; gap:8px; margin:15px 0 12px; padding:12px; border:0; border-radius:10px; background:#f3f8fc; }.super-admin-card-meta p { grid-template-columns:23px 1fr; }.super-admin-card-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-card-actions button:first-child { grid-column:1/-1; }.super-admin-card-actions button { min-height:43px; padding-inline:7px; font-size:12px; }.super-admin-own-account { grid-column:1/-1; } }

/* Vencimientos es un módulo de trabajo, no un cuadro pequeño: en escritorio
   ocupa casi todo el viewport físico, incluso con la escala visual de la app. */
@media (min-width:721px) {
  #expiringInventoryDialog.expiring-inventory-dialog {
    width: calc(100dvw / var(--app-scale) - 32px);
    height: calc(100dvh / var(--app-scale) - 32px);
    max-width: none;
    max-height: none;
    margin: 16px auto;
    border-radius: 20px;
  }

  #expiringInventoryDialog .expiring-inventory-body {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    height: 100%;
    padding: 28px 32px 22px;
    overflow: hidden;
  }

  #expiringInventoryDialog .expiring-inventory-list {
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 2px 5px 2px 0;
  }
}

/* El listado es el único bloque elástico del diálogo.  Esta regla se deja al
   final para prevalecer sobre las versiones visuales anteriores del módulo. */
@media (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-body {
    display:grid;
    height:100%;
    min-height:0;
    grid-template-rows:auto auto minmax(0,1fr);
    overflow:hidden;
  }
  #expiringInventoryDialog .expiring-inventory-table-shell {
    display:grid;
    height:100%;
    min-height:0;
    grid-template-rows:43px minmax(0,1fr) 55px;
  }
  #expiringInventoryDialog .expiring-inventory-list {
    min-height:0;
    height:100%;
    align-content:stretch;
    grid-auto-rows:minmax(44px,1fr);
  }
  #expiringInventoryDialog .expiring-inventory-row { min-height:44px; }
}

/* Superficies de Proveedores: directorio y formulario a pantalla completa. */
@media (min-width:721px) {
  #suppliersDialog[open].suppliers-dialog { position:fixed; inset:0; box-sizing:border-box; width:calc(100dvw / var(--app-scale)); min-width:calc(100dvw / var(--app-scale)); max-width:none; height:calc(100dvh / var(--app-scale)); min-height:calc(100dvh / var(--app-scale)); max-height:none; margin:0; border-radius:0; }
  #suppliersDialog .client-directory-body { display:grid; grid-template-rows:auto minmax(0,1fr) auto; height:100%; min-height:0; overflow:hidden; }
  #suppliersDialog .client-directory-workspace { min-height:0; overflow:auto; }
  #supplierDialog[open] { position:fixed; inset:0; box-sizing:border-box; width:calc(100dvw / var(--app-scale)); min-width:calc(100dvw / var(--app-scale)); max-width:none; height:calc(100dvh / var(--app-scale)); min-height:calc(100dvh / var(--app-scale)); max-height:none; margin:0; border-radius:0; }
  #supplierDialog #supplierForm { display:grid; grid-template-rows:auto minmax(0,1fr) auto; height:100%; min-height:0; overflow:hidden; }
  #supplierDialog .form-grid { min-height:0; overflow:auto; }
}

/* Vista ampliada al tocar una foto del control de vencimientos. */
#expiringInventoryDialog .expiry-product-photo.has-photo { cursor:zoom-in; border:0; }
.expiring-image-lightbox { width:min(900px,calc(100dvw - 32px)); max-width:none; max-height:calc(100dvh - 32px); padding:0; border:0; border-radius:16px; background:transparent; box-shadow:none; }
.expiring-image-lightbox::backdrop { background:rgba(3,20,31,.78); backdrop-filter:blur(3px); }
.expiring-image-lightbox figure { display:grid; max-width:100%; max-height:calc(100dvh - 52px); gap:10px; margin:0; padding:12px; border-radius:16px; background:#fff; }
.expiring-image-lightbox img { display:block; max-width:100%; max-height:calc(100dvh - 118px); margin:auto; border-radius:10px; object-fit:contain; }
.expiring-image-lightbox figcaption { overflow:hidden; color:#102b52; font-weight:800; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:720px) { .expiring-image-lightbox { width:calc(100dvw - 22px); }.expiring-image-lightbox figure { padding:9px; }.expiring-image-lightbox img { max-height:calc(100dvh - 86px); } }

.expiry-summary-card.active { outline:3px solid rgba(0,137,119,.2); box-shadow:0 9px 20px rgba(0,112,99,.14); }

/* Distribución compacta del listado: diez filas por página en escritorio y
   el espacio restante reservado para datos, no para adornos. */
@media (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-body { grid-template-rows:auto auto minmax(0,1fr) auto; gap:10px; padding:14px 22px 12px; overflow:hidden; }
  #expiringInventoryDialog .dialog-head h2 { font-size:28px; }
  #expiringInventoryDialog .expiring-inventory-overview { display:flex; align-items:center; gap:16px; min-width:0; }
  #expiringInventoryDialog .expiring-inventory-summary { flex:0 0 510px; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  #expiringInventoryDialog .expiry-summary-card { grid-template-columns:38px minmax(0,1fr); min-height:64px; gap:9px; padding:9px 11px; border-radius:11px; }
  #expiringInventoryDialog .expiry-summary-card>span { width:38px; height:38px; border-radius:10px; font-size:20px; }
  #expiringInventoryDialog .expiry-summary-card strong { font-size:21px; }
  #expiringInventoryDialog .expiry-summary-card b { font-size:11px; line-height:1.1; }
  #expiringInventoryDialog .expiring-inventory-toolbar { flex:1; min-width:0; gap:10px; }
  #expiringInventoryDialog .expiring-inventory-filters { flex:0 0 auto; gap:6px; }
  #expiringInventoryDialog .expiring-inventory-filters button { min-height:42px; padding:0 11px; font-size:12px; }
  #expiringInventoryDialog .expiring-inventory-search { flex:1; width:auto; min-width:220px; min-height:42px; }
  #expiringInventoryDialog .expiring-inventory-table-shell { display:grid; min-height:0; grid-template-rows:43px minmax(0,1fr) 55px; }
  #expiringInventoryDialog .expiring-inventory-table-head,#expiringInventoryDialog .expiring-inventory-row { grid-template-columns:26px 22px minmax(155px,1.3fr) minmax(128px,.95fr) minmax(102px,.75fr) minmax(112px,.85fr) minmax(91px,.7fr) minmax(84px,.65fr) minmax(128px,.9fr) 42px; column-gap:10px; }
  #expiringInventoryDialog .expiring-inventory-table-head { min-height:43px; padding:0 16px; font-size:10px; }
  #expiringInventoryDialog .expiring-inventory-list { min-height:0; grid-auto-rows:44px; overflow:auto; }
  #expiringInventoryDialog .expiring-inventory-row { min-height:44px; padding:0 16px; }
  #expiringInventoryDialog .expiry-row-select { width:17px; height:17px; }
  #expiringInventoryDialog .expiry-row-number { color:#52708e; font-size:12px; }
  #expiringInventoryDialog .expiring-inventory-product { gap:8px; }
  #expiringInventoryDialog .expiry-product-photo { width:36px; height:36px; border-radius:7px; font-size:11px; }
  #expiringInventoryDialog .expiring-inventory-product div,#expiringInventoryDialog .expiry-code { gap:1px; }
  #expiringInventoryDialog .expiring-inventory-product strong,#expiringInventoryDialog .expiry-code strong { font-size:12px; }
  #expiringInventoryDialog .expiring-inventory-product small,#expiringInventoryDialog .expiry-code small { font-size:10px; }
  #expiringInventoryDialog .expiry-category { padding:5px 8px; font-size:10px; }
  #expiringInventoryDialog .expiry-date,#expiringInventoryDialog .expiry-quantity { font-size:12px; }
  #expiringInventoryDialog .expiry-days { font-size:13px; }
  #expiringInventoryDialog .expiring-inventory-status { padding:6px 8px; font-size:10px; }
  #expiringInventoryDialog .expiry-action { width:34px; min-width:34px; height:34px; font-size:13px; }
  #expiringInventoryDialog .expiring-inventory-table-footer { min-height:55px; padding:0 16px; font-size:12px; }
  #expiringInventoryDialog .expiry-pagination { display:flex; align-items:center; gap:8px; }
  #expiringInventoryDialog .expiry-pagination label { display:flex; align-items:center; gap:6px; white-space:nowrap; }
  #expiringInventoryDialog .expiry-pagination select { min-height:34px; padding:0 8px; border:1px solid #d2dfea; border-radius:8px; color:#15375e; background:#fff; }
  #expiringInventoryDialog .expiring-inventory-body>.dialog-actions { align-items:center; min-height:49px; }
  #expiringInventoryDialog .expiring-inventory-body>.dialog-actions button { min-height:43px; }
}
@media (max-width:1100px) and (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-overview { align-items:flex-start; flex-direction:column; gap:8px; }
  #expiringInventoryDialog .expiring-inventory-summary { flex-basis:auto; width:100%; }
  #expiringInventoryDialog .expiring-inventory-toolbar { width:100%; }
  #expiringInventoryDialog .expiring-inventory-table-head,#expiringInventoryDialog .expiring-inventory-row { grid-template-columns:26px 22px minmax(150px,1.25fr) minmax(110px,.8fr) minmax(100px,.75fr) minmax(84px,.64fr) minmax(118px,.85fr) 40px; }
  #expiringInventoryDialog .expiring-inventory-table-head span:nth-child(5),#expiringInventoryDialog .expiring-inventory-row>.expiry-category,#expiringInventoryDialog .expiring-inventory-table-head span:nth-child(7),#expiringInventoryDialog .expiring-inventory-row>.expiry-days { display:none; }
}
@media (max-width:720px) {
  #expiringInventoryDialog .expiring-inventory-overview { display:grid; gap:10px; }
  #expiringInventoryDialog .expiring-inventory-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #expiringInventoryDialog .expiry-summary-card { grid-template-columns:1fr; min-height:70px; gap:3px; text-align:center; }
  #expiringInventoryDialog .expiry-summary-card>span { display:none; }
  #expiringInventoryDialog .expiry-summary-card strong { font-size:23px; }
  #expiringInventoryDialog .expiry-summary-card b { font-size:10px; }
  #expiringInventoryDialog .expiring-inventory-toolbar { display:grid; }
  #expiringInventoryDialog .expiring-inventory-filters { overflow-x:auto; }
  #expiringInventoryDialog .expiring-inventory-row { grid-template-columns:25px 19px minmax(0,1fr) 38px; gap:7px; }
  #expiringInventoryDialog .expiry-row-select { grid-column:1; grid-row:1; }
  #expiringInventoryDialog .expiry-row-number { grid-column:2; grid-row:1; color:#5d7493; font-size:11px; }
  #expiringInventoryDialog .expiring-inventory-product { grid-column:3; grid-row:1; }
  #expiringInventoryDialog .expiry-action { grid-column:4; grid-row:1; }
  #expiringInventoryDialog .expiry-code,#expiringInventoryDialog .expiry-date,#expiringInventoryDialog .expiry-days,#expiringInventoryDialog .expiry-quantity,#expiringInventoryDialog .expiring-inventory-status { grid-column:3 / -1; }
  #expiringInventoryDialog .expiry-code { grid-row:2; }
  #expiringInventoryDialog .expiry-date { grid-row:3; }
  #expiringInventoryDialog .expiry-days { grid-row:3; justify-self:end; }
  #expiringInventoryDialog .expiry-quantity { grid-row:4; }
  #expiringInventoryDialog .expiring-inventory-status { grid-row:4; justify-self:end; }
  #expiringInventoryDialog .expiring-inventory-table-footer { display:grid; gap:8px; }
  #expiringInventoryDialog .expiry-pagination { justify-content:flex-end; }
}

/* Las acciones viven en el encabezado; la tabla toma íntegramente el resto
   de la ventana para que el inventario no quede relegado a una franja. */
#expiringInventoryDialog .expiring-inventory-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:9px; }
#expiringInventoryDialog .expiring-inventory-head-actions .secondary-button,#expiringInventoryDialog .expiring-inventory-head-actions .primary-button { min-height:42px; padding-inline:15px; border-radius:10px; white-space:nowrap; }
@media (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-body { grid-template-rows:auto auto minmax(0,1fr); height:100%; align-content:stretch; }
  #expiringInventoryDialog .expiring-inventory-table-shell { align-self:stretch; height:100%; min-height:0; grid-template-rows:43px minmax(0,1fr) 55px; }
  #expiringInventoryDialog .expiring-inventory-list { height:100%; min-height:0; }
}
@media (max-width:720px) {
  #expiringInventoryDialog .expiring-inventory-head-actions { gap:6px; }
  #expiringInventoryDialog .expiring-inventory-head-actions .secondary-button { display:inline-flex; min-height:40px; padding-inline:9px; font-size:11px; }
  #expiringInventoryDialog .expiring-inventory-head-actions .primary-button { display:none; }
}

/* En móvil, el disparador de Operaciones es un botón de icono fijo. Evita que
   el texto nativo de <summary> compita por espacio con el avatar y los accesos. */
@media (max-width: 720px) {
  .app-shell:not(.super-mode) #operationsMenu {
    display: block;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    flex: 0 0 48px;
  }
  .app-shell:not(.super-mode) #operationsMenu > summary {
    position: relative;
    display: grid;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 44px;
    min-height: 44px;
    overflow: hidden;
    padding: 0;
    place-items: center;
    text-indent: -9999px;
    white-space: nowrap;
  }
  .app-shell:not(.super-mode) #operationsMenu > summary::before {
    position: static;
    display: block;
    margin: 0;
    color: #fff;
    content: "☰";
    font-size: 24px;
    line-height: 1;
    text-indent: 0;
  }
  .app-shell:not(.super-mode) #operationsMenu > summary::after { display: none; }
}

/* Módulo de vencimientos: prioriza la fecha y las unidades aprovechables de
   cada lote, con una versión apilada y legible para teléfono. */
.expiring-inventory-dialog { width:min(980px,calc(100vw - 32px)); max-width:980px; }
.expiring-inventory-body { gap:18px; }
.expiring-inventory-subtitle { max-width:620px; margin:5px 0 0; color:#58708e; font-size:14px; line-height:1.4; }
.expiring-inventory-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.expiring-inventory-summary article { display:flex; align-items:center; gap:12px; min-height:84px; padding:14px; border:1px solid #dde8ef; border-radius:12px; background:linear-gradient(135deg,#fffdf8,#fff8e9); }
.expiring-inventory-summary article:nth-child(2) { background:linear-gradient(135deg,#f7fbff,#edf7ff); }.expiring-inventory-summary article:nth-child(3) { background:linear-gradient(135deg,#f8fffc,#eefaf5); }
.expiring-inventory-summary span { display:grid; width:42px; height:42px; flex:0 0 auto; place-items:center; border-radius:11px; color:#bd4027; background:#ffe8df; font-size:23px; font-weight:900; }.expiring-inventory-summary article:nth-child(2) span { color:#1477bd; background:#ddecfb; }.expiring-inventory-summary article:nth-child(3) span { color:#087d63; background:#dff7ed; }
.expiring-inventory-summary div { display:grid; gap:2px; }.expiring-inventory-summary strong { color:#102d56; font-size:28px; line-height:1; }.expiring-inventory-summary small { color:#617691; font-size:12px; font-weight:700; }
.expiring-inventory-filters { display:flex; flex-wrap:wrap; gap:8px; }.expiring-inventory-filters button { min-height:39px; border-radius:9px; color:#315377; background:#f4f8fc; font-size:13px; }.expiring-inventory-filters button.active { color:#fff; border-color:#008a76; background:#008a76; }
.expiring-inventory-list { display:grid; gap:9px; max-height:48vh; overflow:auto; padding-right:3px; }.expiring-inventory-row { display:grid; grid-template-columns:44px minmax(170px,1.5fr) minmax(115px,.8fr) minmax(100px,.65fr) auto; align-items:center; gap:14px; padding:13px 15px; border:1px solid #dfe9f0; border-radius:11px; background:#fff; }.expiring-inventory-icon { display:grid; width:44px; height:44px; place-items:center; border-radius:11px; color:#a26a10; background:#fff2d4; font-size:24px; font-weight:900; }.expiring-inventory-product { display:grid; min-width:0; gap:3px; }.expiring-inventory-product strong { overflow:hidden; color:#102a52; font-size:15px; text-overflow:ellipsis; white-space:nowrap; }.expiring-inventory-product span,.expiring-inventory-row small { color:#647895; font-size:12px; }.expiring-inventory-row > div:not(.expiring-inventory-product) { display:grid; gap:3px; }.expiring-inventory-row > div:not(.expiring-inventory-product) strong { color:#19395e; font-size:13px; }.expiring-inventory-status { padding:8px 10px; border-radius:999px; font-size:12px; font-weight:850; white-space:nowrap; }.expiring-inventory-status.expired { color:#b32d35; background:#ffe8e9; }.expiring-inventory-status.urgent { color:#bd5b0a; background:#fff0d8; }.expiring-inventory-status.soon { color:#916304; background:#fff6ce; }.expiring-inventory-status.upcoming { color:#11755d; background:#e4f8ef; }
@media (max-width:720px) { .expiring-inventory-dialog { width:100%; max-width:none; margin:0; border-radius:0; }.expiring-inventory-body { min-height:100dvh; padding:calc(19px + env(safe-area-inset-top)) 15px calc(16px + env(safe-area-inset-bottom)); }.expiring-inventory-body .dialog-head { align-items:flex-start; }.expiring-inventory-body .dialog-head h2 { font-size:27px; }.expiring-inventory-subtitle { font-size:13px; }.expiring-inventory-summary { gap:8px; }.expiring-inventory-summary article { min-height:78px; padding:10px; gap:8px; }.expiring-inventory-summary span { width:34px; height:34px; border-radius:9px; font-size:18px; }.expiring-inventory-summary strong { font-size:22px; }.expiring-inventory-summary small { font-size:10px; line-height:1.2; }.expiring-inventory-filters { flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; }.expiring-inventory-filters button { flex:0 0 auto; min-height:37px; padding:0 11px; font-size:12px; }.expiring-inventory-list { max-height:none; overflow:visible; }.expiring-inventory-row { grid-template-columns:40px minmax(0,1fr); gap:9px 11px; padding:12px; }.expiring-inventory-icon { width:40px; height:40px; font-size:21px; }.expiring-inventory-product { align-self:center; }.expiring-inventory-row > div:not(.expiring-inventory-product) { grid-column:1 / -1; grid-template-columns:1fr auto; padding-top:7px; border-top:1px solid #edf1f5; }.expiring-inventory-row > div:not(.expiring-inventory-product) small { font-size:11px; }.expiring-inventory-status { justify-self:start; grid-column:1 / -1; font-size:11px; }.expiring-inventory-body .dialog-actions { padding-top:4px; }.expiring-inventory-body .dialog-actions button { width:100%; min-height:48px; } }

/* Administración opera como un comercio propio, sin mezclarse con las cuentas
   comerciales ni reutilizar su formato de PDF. */
.super-mode .super-dashboard.super-office-active .super-main-content { padding:18px; }
.super-mode .super-office-panel-body { width:100%; max-width:none; gap:13px; }
.super-office-commerce-head { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 18px; border:1px solid #dce6ee; border-radius:15px; background:#fff; box-shadow:0 8px 22px rgba(26,55,82,.055); }
.super-office-commerce-head > div { display:flex; align-items:center; gap:12px; }.super-office-commerce-head > div:last-child { gap:8px; }.super-office-commerce-logo { display:grid; width:48px; height:48px; place-items:center; border-radius:13px; color:#fff; background:linear-gradient(135deg,#067f74,#08a292); font-size:16px; font-weight:950; }.super-office-commerce-head p { margin:0 0 2px; color:#078174; font-size:10px; font-weight:900; letter-spacing:.08em; }.super-office-commerce-head h2 { margin:0; color:#102444; font-size:24px; letter-spacing:-.035em; }.super-office-commerce-head h2 + span { color:#687a92; font-size:11px; font-weight:650; }
.super-office-commerce-nav { display:flex; gap:7px; padding:6px; overflow-x:auto; border:1px solid #dfe7ef; border-radius:13px; background:#fff; }.super-office-commerce-nav button { display:inline-flex; min-height:40px; flex:1 0 auto; align-items:center; justify-content:center; gap:7px; padding:0 14px; border:0; border-radius:9px; color:#5c6e87; background:transparent; font-size:12px; font-weight:850; }.super-office-commerce-nav button span { font-size:18px; }.super-office-commerce-nav button.active { color:#fff; background:linear-gradient(120deg,#087e74,#08a091); box-shadow:0 7px 14px rgba(6,133,120,.18); }
.super-office-commerce-workspace { display:grid; grid-template-columns:minmax(0,1fr) 390px; align-items:start; gap:16px; height:auto; min-height:0; overflow:visible; }
.super-office-commerce-catalog,.super-office-commerce-document { min-width:0; min-height:0; border:1px solid #dde6ed; border-radius:16px; background:#fff; box-shadow:0 9px 22px rgba(29,56,83,.055); }
.super-office-commerce-catalog { display:grid; grid-template-rows:auto auto auto; gap:12px; padding:16px; overflow:visible; }.super-office-commerce-catalog > .search-box { margin:0; }.super-office-commerce-catalog .inventory-meta { margin:0; }.super-office-commerce-catalog .product-grid { min-height:0; align-items:stretch; overflow:visible; padding-right:0; }.super-office-workspace-product { min-height:0; height:auto; cursor:pointer; }.super-office-workspace-product .product-body { min-height:210px; }.super-office-workspace-product .product-name,.super-office-workspace-product .product-barcode { overflow-wrap:anywhere; }.super-office-workspace-product .product-image { background:linear-gradient(135deg,color-mix(in srgb,var(--product-color) 84%,#fff),color-mix(in srgb,var(--product-color) 52%,#fff)); }.super-office-workspace-product .product-image::after { content:attr(data-initials); color:#fff; font-size:24px; font-weight:900; }
.super-office-commerce-document { display:flex; flex-direction:column; align-self:start; padding:17px; overflow:visible; }.super-office-commerce-document .invoice-head { margin-bottom:11px; }.super-office-workspace-type { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:11px; padding:5px; border-radius:10px; background:#eef3f7; }.super-office-workspace-type button { min-height:37px; border:0; border-radius:8px; color:#617087; background:transparent; font-weight:850; }.super-office-workspace-type button.active { color:#fff; background:#087f75; box-shadow:0 5px 12px rgba(7,127,117,.18); }.super-office-commerce-document .customer-field { margin-bottom:10px; }.super-office-workspace-dates { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-bottom:10px; }.super-office-workspace-dates label { display:grid; gap:5px; color:#607188; font-size:10px; font-weight:850; text-transform:uppercase; }.super-office-workspace-dates input { min-width:0; min-height:39px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.super-office-commerce-document .cart-list { min-height:110px; flex:0 0 auto; overflow:visible; padding-right:0; }.super-office-workspace-cart-item { grid-template-columns:minmax(115px,1fr) 58px 76px 55px auto 30px; gap:6px; align-items:end; padding:9px; }.super-office-workspace-cart-item label { display:grid; min-width:0; gap:4px; color:#6d7b90; font-size:8px; font-weight:850; text-transform:uppercase; }.super-office-workspace-cart-item input { min-width:0; min-height:34px; padding:5px 7px; border:1px solid #d9e2eb; border-radius:7px; font-size:11px; }.super-office-workspace-line-tax { min-height:34px; display:flex !important; align-items:center; justify-content:center; gap:3px !important; border:1px solid #d9e2eb; border-radius:7px; background:#fff; }.super-office-workspace-line-tax input { min-height:0; padding:0; }.super-office-workspace-cart-item > strong { align-self:center; color:#18314f; font-size:10px; }.super-office-workspace-cart-item > button { width:30px; height:34px; color:#b42338; border-color:#f0cbd1; background:#fff5f6; }.super-office-commerce-document .totals { margin-top:9px; }.super-office-commerce-document .form-feedback { min-height:18px; margin:5px 0 0; }.super-office-commerce-document .checkout-actions { margin-top:8px; }.super-office-commerce-document .checkout-actions button { flex:1; min-height:46px; }
.super-office-panel > .super-office-panel-body > :is(.super-office-records,.super-office-documents,.super-office-search) { width:100%; }.super-office-panel .super-office-records:not(.hidden),.super-office-panel .super-office-documents:not(.hidden) { min-height:420px; padding:16px; border:1px solid #dde6ed; border-radius:15px; background:#fff; box-shadow:0 8px 22px rgba(29,56,83,.05); }
.super-office-product-directory { display:grid; gap:18px; color:#102344; }
.super-office-product-directory-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }.super-office-product-directory-heading h3 { margin:0 0 4px; color:#07183e; font-size:24px; letter-spacing:-.035em; }.super-office-product-directory-heading p { margin:0; color:#596f91; font-size:13px; }.super-office-product-directory-heading button { min-height:46px; padding:0 20px; border:0; border-radius:9px; color:#fff; background:linear-gradient(120deg,#087d6d,#079b82); box-shadow:0 8px 18px rgba(7,126,108,.18); font-weight:850; }
.super-office-product-filters { display:grid; grid-template-columns:minmax(260px,1.8fr) repeat(3,minmax(145px,.55fr)); gap:12px; align-items:end; }.super-office-product-filters label { display:grid; gap:6px; color:#405577; font-size:11px; font-weight:850; }.super-office-product-filters input,.super-office-product-filters select { min-width:0; min-height:46px; border:1px solid #d6e1ec; border-radius:9px; color:#14284e; background:#fff; font-size:13px; }.super-office-product-search { position:relative; }.super-office-product-search > span { position:absolute; z-index:1; left:16px; bottom:10px; color:#17345e; font-size:24px; }.super-office-product-search input { padding-left:48px; }
.super-office-product-table { overflow-x:auto; border:1px solid #dbe5ee; border-radius:10px; }.super-office-product-table-head,.super-office-product-row { display:grid; min-width:900px; grid-template-columns:42px minmax(190px,1.5fr) minmax(180px,1.25fr) 115px 86px 112px 112px 142px; align-items:center; gap:10px; }.super-office-product-table-head { min-height:42px; padding:0 12px; color:#405577; background:#f0f4f7; font-size:10px; font-weight:900; text-transform:uppercase; }.super-office-product-row { min-height:62px; padding:7px 12px; border-top:1px solid #e2e9ef; background:#fff; }.super-office-product-index { color:#355173; font-size:12px; }.super-office-product-identity { display:grid; min-width:0; grid-template-columns:42px minmax(0,1fr); align-items:center; gap:10px; }.super-office-product-identity strong { overflow-wrap:anywhere; color:#081a3d; font-size:12px; line-height:1.25; }.super-office-product-thumb { display:grid; width:40px; height:40px; place-items:center; border-radius:9px; color:#008976; background:#e0f3ed; background-position:center; background-size:cover; font-size:21px; font-weight:900; }.super-office-product-thumb.has-image { color:transparent; }.super-office-product-description { display:-webkit-box; margin:0; overflow:hidden; color:#435a7b; font-size:12px; line-height:1.35; -webkit-box-orient:vertical; -webkit-line-clamp:2; }.super-office-product-price { color:#00836f; font-size:13px; }.super-office-product-stock { text-align:center; font-size:12px; }.super-office-product-type,.super-office-product-status { display:inline-flex; width:max-content; max-width:100%; min-height:29px; align-items:center; justify-content:center; gap:6px; padding:0 11px; border-radius:999px; color:#1c65ad; background:#e6f2fc; font-size:11px; font-weight:800; }.super-office-product-type:not(.is-service) { color:#6650a9; background:#f0ebff; }.super-office-product-status { color:#08785f; background:#ddf8eb; }.super-office-product-status i { width:8px; height:8px; border-radius:50%; background:#08a477; }.super-office-product-status:not(.is-imported) { color:#5a6580; background:#edf1f5; }.super-office-product-status:not(.is-imported) i { background:#7c879a; }.super-office-product-actions { display:grid; grid-template-columns:1fr 42px; gap:7px; }.super-office-product-actions button { min-height:38px; border:1px solid #d5e0ea; border-radius:8px; color:#102344; background:#fff; font-size:12px; font-weight:850; }.super-office-product-actions button:first-child { display:inline-flex; align-items:center; justify-content:center; gap:7px; }.super-office-product-directory-footer { display:flex; align-items:center; justify-content:space-between; color:#526987; font-size:12px; }.super-office-product-directory-footer > div { display:flex; align-items:center; gap:7px; }.super-office-product-directory-footer button,.super-office-product-directory-footer b { display:grid; width:38px; height:38px; place-items:center; border:1px solid #d7e1eb; border-radius:8px; color:#59708e; background:#fff; }.super-office-product-directory-footer b { color:#fff; border-color:#078977; background:#078977; }
@media (max-width:1100px) { .super-office-commerce-workspace { grid-template-columns:minmax(0,1fr) 350px; }.super-office-workspace-cart-item { grid-template-columns:1fr 1fr 30px; }.super-office-workspace-cart-item label:first-child { grid-column:1 / -1; }.super-office-workspace-line-tax { grid-column:1; }.super-office-workspace-cart-item > strong { grid-column:2; }.super-office-workspace-cart-item > button { grid-column:3; grid-row:2; } }
@media (max-width:720px) { .super-mode .super-dashboard.super-office-active .super-main-content { padding:14px 12px 88px; }.super-office-commerce-head { align-items:flex-start; padding:13px; }.super-office-commerce-head > div:last-child { display:none; }.super-office-commerce-logo { width:43px; height:43px; }.super-office-commerce-head h2 { font-size:20px; }.super-office-commerce-head h2 + span { display:block; max-width:245px; line-height:1.3; }.super-office-commerce-nav { position:sticky; top:0; z-index:5; }.super-office-commerce-nav button { min-width:91px; padding:0 9px; font-size:10px; }.super-office-commerce-nav button span { font-size:16px; }.super-office-commerce-workspace { display:flex; height:auto; min-height:0; flex-direction:column; overflow:visible; }.super-office-commerce-catalog { min-height:500px; padding:13px; }.super-office-commerce-catalog .product-grid { max-height:none; overflow:visible; }.super-office-commerce-document { min-height:610px; padding:14px; overflow:visible; }.super-office-commerce-document .cart-list { min-height:150px; max-height:none; overflow:visible; }.super-office-workspace-cart-item { grid-template-columns:1fr 1fr 32px; }.super-office-workspace-cart-item label:first-child { grid-column:1 / -1; }.super-office-workspace-cart-item > button { grid-column:3; grid-row:2; }.super-office-panel .super-office-records:not(.hidden),.super-office-panel .super-office-documents:not(.hidden) { min-height:0; padding:12px; }.super-office-product-directory { gap:14px; }.super-office-product-directory-heading { align-items:flex-start; flex-direction:column; }.super-office-product-directory-heading h3 { font-size:22px; }.super-office-product-directory-heading p { line-height:1.4; }.super-office-product-directory-heading button { width:100%; }.super-office-product-filters { grid-template-columns:1fr; }.super-office-product-table { overflow:visible; border:0; }.super-office-product-table-head { display:none; }.super-office-product-row { min-width:0; grid-template-columns:42px minmax(0,1fr); gap:10px; margin-bottom:11px; padding:13px; border:1px solid #dce6ee; border-radius:12px; box-shadow:0 6px 15px rgba(29,56,83,.055); }.super-office-product-index { grid-column:1; grid-row:1; align-self:center; text-align:center; }.super-office-product-identity { grid-column:2; grid-row:1; }.super-office-product-description { grid-column:1 / -1; display:block; overflow:visible; -webkit-line-clamp:unset; }.super-office-product-price,.super-office-product-stock,.super-office-product-type,.super-office-product-status { grid-column:auto; }.super-office-product-stock { align-self:center; text-align:left; }.super-office-product-actions { grid-column:1 / -1; }.super-office-product-directory-footer { align-items:flex-start; flex-direction:column; gap:12px; }.super-office-product-directory-footer > div { align-self:flex-end; } }

/* Escritorios de poca altura: las dos cuentas conservan toda su información
   visible, sin que las filas del directorio se recorten. */
@media (min-width:721px) and (max-height:760px) {
  .super-mode .super-users-panel { gap:10px; padding:18px 28px; }
  .super-admin-hero { align-items:center; gap:18px; }
  .super-admin-hero .eyebrow { margin-bottom:4px; font-size:10px; }
  .super-admin-hero h2 { font-size:32px; }
  .super-admin-hero p:not(.eyebrow) { margin-top:5px; font-size:12px; line-height:1.3; }
  .super-admin-new-button { min-height:46px; padding-inline:18px; font-size:13px; }
  .super-admin-new-button span { font-size:19px; }
  .super-admin-stats { gap:10px; }
  .super-admin-stat { min-height:70px; padding:10px 12px; gap:9px; }
  .super-admin-stat > span { width:38px; height:38px; border-radius:10px; font-size:20px; }
  .super-admin-stat strong { font-size:27px; }
  .super-admin-stat b { font-size:11px; }
  .super-admin-stat small { display:none; }
  .super-admin-directory { padding:13px 14px; }
  .super-admin-directory-head { gap:12px; }
  .super-admin-directory-title { gap:9px; }
  .super-admin-directory-title>span { width:42px; height:42px; border-radius:11px; font-size:21px; }
  .super-admin-directory-title p { margin-bottom:1px; font-size:9px; }
  .super-admin-directory-title h3 { font-size:18px; }
  .super-admin-search { min-width:250px; min-height:42px; padding-inline:12px; font-size:12px; }
  .super-admin-search span { font-size:21px; }
  .super-admin-search input,.super-admin-status select { font-size:12px; }
  .super-admin-status { min-width:135px; padding:4px 10px 0; }
  .super-admin-list-label { min-height:15px; margin:5px 0; font-size:10px; }
  .super-admin-card-grid { gap:9px; }
  .super-admin-card { gap:13px; padding:9px 14px; }
  .super-admin-avatar { width:52px; height:52px; font-size:21px; }
  .super-admin-card-identity { gap:11px; }
  .super-admin-card-identity h4 { margin-bottom:3px; font-size:16px; }
  .super-admin-badges { gap:5px; margin-bottom:4px; }
  .super-admin-badges span,.super-admin-badges small { padding:4px 7px; font-size:9px; }
  .super-admin-card-identity p { gap:5px; margin-top:3px; font-size:10px; }
  .super-admin-card-identity p b { font-size:12px; }
  .super-admin-card-meta { gap:6px; padding:2px 12px; }
  .super-admin-card-meta p { grid-template-columns:18px 1fr; column-gap:5px; font-size:9px; }
  .super-admin-card-meta p>b { font-size:14px; }
  .super-admin-card-meta strong { font-size:10px; }
  .super-admin-card-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .super-admin-card-actions button { min-height:32px; padding:0 6px; font-size:10px; }
  .super-admin-own-account { padding:8px; font-size:10px; }
}

/* Si el alto útil no alcanza para presentar las dos tarjetas con seguridad,
   la página se desplaza completa. Nunca se recorta la información de una
   cuenta dentro de una tarjeta ni se superponen sus acciones. */
@media (min-width:721px) and (max-height:760px) {
  .super-mode .super-dashboard,
  .super-mode .super-main-content {
    height:auto;
    min-height:calc(100dvh / var(--app-scale));
    max-height:none;
    overflow:visible;
  }

  .super-mode .super-main-content { align-content:start; }

  .super-mode .super-users-panel,
  .super-mode .super-users-panel #superAdminUserList,
  .super-admin-directory {
    height:auto;
    min-height:0;
    max-height:none;
    overflow:visible;
  }

  .super-admin-card-grid {
    flex:none;
    grid-template-rows:none;
  }

  .super-admin-card {
    min-height:104px;
    height:auto;
  }
}

/* Directorio de administradores: estructura sin alturas rígidas. El flujo
   vertical pertenece a la página, nunca a una tarjeta recortada. */
@media (min-width:721px) {
  .super-mode .super-dashboard,
  .super-mode .super-main-content {
    height:auto !important;
    min-height:calc(100dvh / var(--app-scale));
    max-height:none !important;
    overflow:visible !important;
  }

  .super-mode .super-users-panel {
    display:block;
    height:auto !important;
    min-height:calc(100dvh / var(--app-scale));
    max-height:none !important;
    padding:36px 38px 42px;
    overflow:visible !important;
  }

  .super-mode .super-users-panel #superAdminUserList {
    display:block;
    height:auto !important;
    min-height:0;
    max-height:none !important;
    padding:0;
    overflow:visible !important;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  .super-admin-hero { margin-bottom:28px; }
  .super-admin-hero h2 { font-size:42px; }
  .super-admin-hero p:not(.eyebrow) { max-width:880px; }
  .super-admin-stats { margin-bottom:24px; }
  .super-admin-directory { height:auto !important; min-height:0; padding:26px; }
  .super-admin-directory-head { min-height:74px; }
  .super-admin-card-grid {
    display:grid;
    height:auto !important;
    min-height:0;
    grid-template-columns:1fr;
    grid-template-rows:none;
    gap:16px;
  }

  .super-admin-card {
    min-height:0;
    height:auto !important;
    grid-template-columns:minmax(370px,1.45fr) minmax(215px,.72fr) minmax(210px,.6fr);
    padding:18px 20px;
  }

  .super-admin-card-actions { align-self:stretch; align-content:center; }
}

@media (max-width:1040px) and (min-width:721px) {
  .super-mode .super-users-panel { padding:30px 24px 36px; }
  .super-admin-hero h2 { font-size:36px; }
  .super-admin-directory-head { align-items:flex-start; flex-direction:column; }
  .super-admin-filters { width:100%; }
  .super-admin-search { flex:1; }
  .super-admin-card { grid-template-columns:minmax(300px,1fr) minmax(190px,.7fr); }
  .super-admin-card-actions { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:720px) {
  .super-mode .super-users-panel,
  .super-mode .super-users-panel #superAdminUserList,
  .super-admin-directory { height:auto; min-height:0; max-height:none; overflow:visible; }
  .super-admin-card-grid { height:auto; grid-template-rows:none; }
}

/* Usuarios super: el módulo ocupa el área administrativa completa para que
   las cuentas y sus acciones no queden comprimidas en una tarjeta pequeña. */
@media (min-width: 721px) {
  .super-mode .super-users-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: stretch;
    min-height: calc(100dvh - 63px);
    padding: clamp(28px, 3vw, 48px);
    border-color: #dce7ef;
    background:
      radial-gradient(circle at 100% 0, rgba(8, 166, 175, .10), transparent 34%),
      linear-gradient(135deg, #fff 0%, #f8fcfd 100%);
  }

  .super-mode .super-users-panel > h2 {
    margin: 6px 0 10px;
    color: #10203a;
    font-size: clamp(30px, 3vw, 42px);
    letter-spacing: -.045em;
  }

  .super-mode .super-users-panel > p:not(.eyebrow) {
    max-width: 780px;
    margin: 0 0 28px;
    color: #52657d;
    font-size: 16px;
  }

  .super-mode .super-users-panel #superAdminUserList {
    min-height: 0;
    padding: 26px;
    border: 1px solid #dfeaf0;
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 18px 38px rgba(23, 65, 87, .07);
  }

  .super-mode .super-users-panel .super-user-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    align-content: start;
    gap: 20px;
  }

  .super-mode .super-users-panel .user-row {
    min-height: 218px;
    padding: 24px;
    border: 1px solid #dce8ee;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f4fbfc);
    box-shadow: 0 10px 25px rgba(36, 79, 96, .06);
  }

  .super-mode .super-users-panel .super-user-card-head strong { font-size: 28px; }
  .super-mode .super-users-panel .super-user-card-head span { font-size: 15px; }
  .super-mode .super-users-panel .user-row-actions { margin-top: auto; gap: 10px; }
  .super-mode .super-users-panel .user-row-actions button { min-height: 42px; padding: 0 15px; }
}

@media (max-width: 720px) {
  .super-mode .super-users-panel { padding: 20px 14px; }
  .super-mode .super-users-panel > h2 { font-size: 27px; }
  .super-mode .super-users-panel > p:not(.eyebrow) { margin-bottom: 20px; font-size: 13px; }
  .super-mode .super-users-panel #superAdminUserList { padding: 14px; border: 1px solid #e1e9ef; border-radius: 14px; background: #fff; }
}

@media (max-width: 720px) {
  #productDialog.operation-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  #productDialog #productForm { gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 16px 0; overflow: hidden; }
  #productDialog .product-dialog-head { display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; align-items: start; gap: 10px; }
  #productDialog .product-mobile-back { display: grid !important; font-size: 38px; line-height: 1; }
  #productDialog .product-dialog-head h2 { font-size: 34px; }
  .product-dialog-subtitle { max-width: 430px; font-size: 14px; line-height: 1.35; }
  .product-form-layout { display: flex; flex-direction: column; gap: 11px; padding: 0 2px 12px; overflow-y: auto; overscroll-behavior: contain; }
  .product-main-fields { flex: 0 0 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; background: transparent; overflow: visible; }
  .product-main-fields > .product-field-card { grid-column: 1 / -1; min-height: 96px; border: 1px solid #dfebf8; border-radius: 15px; background: rgba(255,255,255,.88); }
  .product-main-fields > .product-total-card,.product-main-fields > .product-margin-card { grid-column: auto; grid-template-columns: 58px minmax(0, 1fr); padding-inline: 12px; }
  .product-main-fields > .new-category-row { grid-column: 1 / -1; }
  .product-field-card { grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 13px; }
  .product-field-icon { width: 64px; height: 64px; border-radius: 15px; }
  .product-barcode-card > .product-barcode-static-icon { display: none; }
  .product-barcode-card > .product-barcode-scan-button { display: grid; }
  .product-barcode-scan-button .catalog-scan-icon { width: 32px; height: 32px; stroke-width: 2.25; }
  .product-barcode-scan-hint { display: inline-flex; align-items: center; align-self: start; gap: 7px; padding: 3px 0 0; border: 0; color: #0875de; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
  .product-barcode-scan-hint .catalog-scan-icon { width: 17px; height: 17px; stroke-width: 2.25; }
  .product-expiry-card { min-height: 126px !important; }
  #productDialog input,#productDialog select { min-height: 52px; font-size: 16px; }
  #productDialog :is(.category-picker, .product-supplier-picker) { grid-template-columns: minmax(0, 1fr) 66px; }
  #productDialog :is(.add-category-button, .add-product-supplier-button) { width: 66px; height: 52px; }
  .product-total-display { font-size: 22px; white-space: nowrap; }
  .product-media-panel { order: 2; padding: 12px; }
  .product-live-preview,.product-upload-actions,#imageHint { display: none; }
  .product-upload-dropzone { min-height: 108px; grid-template-columns: 58px auto; grid-template-rows: auto auto; column-gap: 12px; text-align: left; }
  .product-upload-icon { grid-row: 1 / 3; }
  .product-color-section { order: 3; min-height: 90px; padding: 12px; }
  .product-public-catalog-field { order: 4; }
  #productDialog .product-dialog-actions { position: sticky; z-index: 5; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); box-shadow: 0 -10px 25px rgba(28, 66, 105, .08); }
  #productDialog .product-dialog-actions button { width: 100%; min-width: 0; min-height: 56px; font-size: 16px; }
  #productDialog #deleteProductBtn { grid-column: 1 / -1; }
  #productDialog #saveProductBtn { min-width: 0; }
}

/* En móviles, el encabezado forma parte del desplazamiento del módulo. Así
   deja libre la pantalla al avanzar por el formulario y Safari conserva un
   único gesto vertical desde el título hasta las acciones. */
@media (max-width: 720px) {
  #productDialog[open].operation-dialog {
    display: block;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #productDialog #productForm {
    display: flex;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    flex-direction: column;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 0;
    overflow: visible;
  }

  #productDialog .product-dialog-head {
    position: static;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  #productDialog .product-dialog-head > .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  #productDialog .product-dialog-head h2 {
    margin: 1px 0 2px;
    font-size: clamp(25px, 8vw, 30px);
    line-height: 1.05;
  }

  #productDialog .product-dialog-head .eyebrow { margin-bottom: 2px; font-size: 10px; }
  #productDialog .product-dialog-subtitle { font-size: 12px; line-height: 1.3; }
  #productDialog .product-form-layout { flex: 0 0 auto; overflow: visible; }
}

@media (max-width: 430px) {
  .product-main-fields > .product-total-card,.product-main-fields > .product-margin-card { grid-column: 1 / -1; }
  .product-color-options { gap: 7px; }
  .product-color-swatch,#productDialog #productColor { width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
}

/* Espacio de trabajo de agenda: se abre como módulo completo y no como una
   tarjeta superpuesta. El contenido conserva todos sus controles originales. */
.appointments-dialog.operation-dialog {
  inset: 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.appointments-dialog.operation-dialog::backdrop { background: transparent; }
.appointments-dialog.operation-dialog .appointments-dialog-body {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  max-height: none;
  padding: clamp(13px, 1.4vw, 20px);
  overflow: hidden;
}
.appointments-dialog.operation-dialog .dialog-head { grid-column: 1; grid-row: 1; align-self: start; }
.appointments-dialog.operation-dialog .appointments-hero { grid-column: 2; grid-row: 1; min-width: 0; }
.appointments-dialog.operation-dialog .appointment-staff-manager { grid-column: 2; grid-row: 2; min-width: 0; }
.appointments-dialog.operation-dialog .appointment-deposit-manager { grid-column: 2; grid-row: 3; min-width: 0; }
.appointments-dialog.operation-dialog .appointments-search-results { grid-column: 2; min-width: 0; }
.appointments-dialog.operation-dialog .appointments-layout,
.appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.appointments-dialog.operation-dialog .appointments-side-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}
.appointments-dialog.operation-dialog .appointment-card { flex: 0 0 auto; }
.appointments-dialog.operation-dialog .appointments-calendar-panel,
.appointments-dialog.operation-dialog .appointments-filter-panel {
  padding: 12px;
  border: 1px solid #dceaf2;
  border-radius: 13px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 19px rgba(29, 80, 122, .05);
}
.appointments-calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.appointments-calendar-heading h3 { margin: 0; color: #172c54; font-size: 13px; }
.appointments-calendar-heading .ghost-button { min-height: 28px; padding: 4px 9px; font-size: 10px; }
.appointments-calendar-nav { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; text-align: center; gap: 4px; color: #1b3159; font-size: 11px; text-transform: capitalize; }
.appointments-calendar-nav .icon-button { width: 29px; height: 29px; min-height: 29px; padding: 0; font-size: 22px; line-height: 1; }
.appointments-calendar-weekdays,
.appointments-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.appointments-calendar-weekdays { margin: 9px 0 3px; color: #7890a9; font-size: 9px; font-weight: 850; }
.appointments-calendar-day,
.appointments-calendar-empty { min-height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 800; }
.appointments-calendar-day { position: relative; border: 0; color: #233a63; background: transparent; cursor: pointer; }
.appointments-calendar-day:hover { background: #e8f9fb; }
.appointments-calendar-day.has-appointments::after { content: ""; position: absolute; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: #0b9ead; }
.appointments-calendar-day.is-today { color: #078fa2; box-shadow: inset 0 0 0 1px #9cdae3; }
.appointments-calendar-day.is-selected { color: #fff; background: linear-gradient(135deg, #078a9d, #159dcc); box-shadow: 0 5px 10px rgba(8,138,157,.18); }
.appointments-calendar-day.is-selected::after { background: #fff; }
.appointments-filter-panel { display: grid; gap: 9px; }
.appointments-filter-panel label { display: grid; gap: 5px; color: #4f6686; font-size: 10px; font-weight: 850; }
.appointments-filter-panel select,
.appointments-staff-filter-trigger { width: 100%; min-height: 37px; border: 1px solid #d9e6ef; border-radius: 8px; color: #1c345e; background: #fff; font: inherit; font-size: 11px; }
.appointments-staff-filter-trigger { padding: 8px 10px; color: #147f72; border-color: #bfe4df; background: #effbf8; font-weight: 850; text-align: left; cursor: pointer; }
.appointments-dialog.operation-dialog .appointments-agenda { min-height: 0; overflow: auto; }
.appointments-dialog.operation-dialog .appointments-list { padding-bottom: 6px; }
.appointments-dialog.operation-dialog .appointments-dialog-body > .dialog-actions { display: none; }

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointments-dialog-body {
    display: flex;
    height: auto;
    min-height: 100dvh;
    padding: 14px 13px 34px;
    overflow: visible;
  }
  .appointments-dialog.operation-dialog .appointments-hero,
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed,
  .appointments-dialog.operation-dialog .appointments-side-panel { display: contents; }
  .appointments-dialog.operation-dialog .dialog-head { order: 0; }
  .appointments-dialog.operation-dialog .appointment-card { order: 1; }
  .appointments-dialog.operation-dialog .appointments-summary { order: 2; }
  .appointments-dialog.operation-dialog .appointments-search-panel { order: 3; }
  .appointments-dialog.operation-dialog .appointment-staff-manager { order: 4; }
  .appointments-dialog.operation-dialog .appointment-deposit-manager { order: 5; }
  .appointments-dialog.operation-dialog .appointments-search-results { order: 6; }
  .appointments-dialog.operation-dialog .appointments-agenda { order: 7; min-height: auto; overflow: visible; }
  .appointments-dialog.operation-dialog .appointments-calendar-panel,
  .appointments-dialog.operation-dialog .appointments-filter-panel { display: none; }
}

/* Ajustes de composición de agenda solicitados: la barra de retorno se sitúa
   sobre la búsqueda y el panel izquierdo comienza junto al contenido superior. */
.appointments-dialog.operation-dialog .appointment-back-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-self: end;
  gap: 6px;
  margin: 0 0 7px auto;
  padding: 7px 11px;
  border: 1px solid #f0b5b7;
  border-radius: 9px;
  color: #b42328;
  background: #fff6f6;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.appointments-dialog.operation-dialog .appointment-back-button:hover { border-color: #dc6d73; color: #8f1820; background: #ffeded; }
.appointments-dialog.operation-dialog .appointment-back-button span { font-size: 16px; line-height: .6; }
.appointments-dialog.operation-dialog .appointments-search-panel { display: grid; }

@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .dialog-head { min-width: 0; }
  .appointments-dialog.operation-dialog .dialog-head h2 { white-space: nowrap; font-size: clamp(22px, 2vw, 30px); }
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed { display: contents; }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    grid-column: 1;
    grid-row: 2 / 5;
    display: flex;
    align-self: stretch;
    min-height: 0;
  }
  .appointments-dialog.operation-dialog .appointments-agenda {
    grid-column: 2;
    grid-row: 4;
    min-height: 0;
  }
}

/* Mantiene el panel lateral como una columna continua: así el calendario y el
   filtro permanecen visibles inmediatamente debajo de Nueva cita. */
@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    display: flex;
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    min-height: 0;
    height: max-content;
    overflow: visible;
    transform: translateY(-94px);
    margin-bottom: -94px;
  }
  .appointments-dialog.operation-dialog .appointments-agenda {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }
}

#appointmentsBtn {
  position: relative;
  gap: 7px;
}

.appointment-nav-bell {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.appointment-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #c4313b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(116, 30, 35, .25);
}

@media (max-width: 720px) {
  .topbar-direct-action#appointmentsBtn:not(.hidden) {
    display: flex !important;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .appointment-notification-badge {
    top: -7px;
    right: -7px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: calc(100vh / var(--app-scale));
  color: var(--text);
  background: var(--app-background);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* En escritorio la interfaz usa la densidad equivalente al navegador al 88%,
   de modo que el catálogo y la factura aprovechen mejor una pantalla común. */
@media (min-width: 1100px) {
  :root {
    --app-scale: .88;
  }

  body {
    zoom: .88;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: calc(100vh / var(--app-scale));
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 82px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.2fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.brand p,
.invoice-head h2,
.dialog-head h2 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.business-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  text-align: center;
}

.business-logo {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.business-identity p {
  margin: 0;
  color: var(--text);
  font-size: clamp(15px, 1.15vw, 19px);
  font-weight: 800;
}

.brand p,
.inventory-meta span,
.receipt-muted {
  color: var(--muted);
}

.top-actions,
.checkout-actions,
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: var(--control-height);
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 12px;
  font-weight: 800;
  font-size: 14px;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: #000;
  background: #e8f4ef;
  border-color: #c7e3d8;
}

.ghost-button {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

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

.hidden {
  display: none !important;
}

.top-actions-menu {
  position: relative;
}

.top-actions-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.top-actions-menu summary::-webkit-details-marker {
  display: none;
}

.top-actions-menu summary::after {
  content: "▾";
  font-size: 12px;
}

.top-actions-menu[open] summary::after {
  content: "▴";
}

.top-actions-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 210px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(17, 33, 59, 0.14);
}

.top-actions-menu-panel button {
  width: 100%;
  justify-content: flex-start;
}

.mobile-menu-heading,
.mobile-menu-shortcut {
  display: none;
}

.auth-screen {
  min-height: calc(100vh / var(--app-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 12% 12%, rgba(52, 211, 153, 0.16), transparent 29%),
    radial-gradient(circle at 88% 84%, rgba(31, 138, 112, 0.13), transparent 34%),
    linear-gradient(135deg, #edf5f1 0%, #f8faf9 48%, #e6f0eb 100%);
}

.auth-layout {
  width: min(1180px, 100%);
  min-height: min(720px, calc((100vh - 64px) / var(--app-scale)));
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(390px, 0.78fr);
  overflow: hidden;
  border: 1px solid rgba(24, 79, 61, 0.13);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(19, 55, 42, 0.17);
}

.auth-showcase {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 34px;
  overflow: hidden;
  padding: clamp(42px, 5vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 16%, rgba(129, 230, 185, 0.24), transparent 28%),
    linear-gradient(145deg, #0d6b57 0%, #145744 58%, #103f34 100%);
}

.auth-showcase::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -115px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.035),
    0 0 0 86px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  display: grid;
  justify-items: start;
  gap: 12px;
  text-align: left;
}

.auth-brand .brand-mark {
  width: clamp(140px, 14vw, 190px);
  height: clamp(140px, 14vw, 190px);
  margin-bottom: 8px;
  border: 6px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  box-shadow: 0 24px 55px rgba(3, 31, 24, 0.28);
}

.auth-brand h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(46px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -2px;
}

.auth-brand p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
}

.auth-brand .auth-kicker {
  color: #a9f0d2;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.auth-highlights {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-highlights article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.auth-highlights span {
  color: #a9f0d2;
  font-size: 11px;
  font-weight: 900;
}

.auth-highlights strong {
  font-size: 14px;
}

.auth-highlights small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.4;
}

.auth-showcase-note {
  position: relative;
  z-index: 1;
  margin: -18px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 700;
}

.auth-access {
  display: grid;
  place-items: center;
  padding: clamp(34px, 5vw, 70px);
  background:
    radial-gradient(circle at top right, rgba(31, 138, 112, 0.09), transparent 34%),
    #fff;
}

.auth-card {
  width: min(410px, 100%);
  display: grid;
  gap: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card-head p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-card .eyebrow {
  color: var(--accent-strong);
  letter-spacing: 1px;
}

.auth-card .auth-form {
  gap: 17px;
}

.auth-card input {
  min-height: 52px;
  border-radius: 12px;
  background: #fbfdfc;
}

.auth-submit {
  min-height: 52px;
  margin-top: 3px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(31, 138, 112, 0.19);
}

.login-lockout {
  margin: -4px 0 0;
  padding: 12px 14px;
  color: #7f1d1d;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.auth-form.is-locked input,
.auth-form.is-locked .password-toggle,
.auth-form.is-locked .auth-submit {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-support {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d7e9e0;
  border-radius: 12px;
  background: #f2f9f5;
}

.auth-support span {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.auth-support p {
  margin: 0;
  color: #315746;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.theme-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.theme-preview-swatch {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 33, 28, 0.14);
  border-radius: 7px;
  background: var(--theme-preview-color, var(--bg));
}

.auth-card-head {
  display: grid;
  gap: 4px;
}

.auth-card-head h2 {
  margin: 0;
  font-size: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* La pantalla de acceso aprovecha monitores de escritorio sin afectar la
   composición de tabletas ni teléfonos. */
@media (min-width: 1280px) {
  .auth-screen {
    padding: clamp(40px, 4.5vw, 88px);
  }

  .auth-layout {
    width: min(1380px, 100%);
    min-height: min(820px, calc(100vh - 80px));
    grid-template-columns: minmax(0, 1.16fr) minmax(460px, 0.84fr);
    border-radius: 34px;
  }

  .auth-showcase {
    padding: clamp(56px, 5vw, 88px);
  }

  .auth-brand .brand-mark {
    width: clamp(170px, 12vw, 220px);
    height: clamp(170px, 12vw, 220px);
  }

  .auth-brand h1 {
    font-size: clamp(58px, 4.6vw, 82px);
  }

  .auth-brand p {
    max-width: 620px;
    font-size: clamp(17px, 1.25vw, 20px);
  }

  .auth-highlights article {
    padding: 18px;
  }

  .auth-access {
    padding: clamp(50px, 5vw, 88px);
  }

  .auth-card {
    width: min(480px, 100%);
    gap: 28px;
  }

  .auth-card-head h2 {
    font-size: 34px;
  }

  .auth-card-head p:last-child {
    font-size: 16px;
  }

  .auth-card input,
  .auth-submit {
    min-height: 58px;
    font-size: 17px;
  }
}

.auth-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.auth-tab.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.user-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.user-list h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.user-row div {
  display: grid;
  gap: 3px;
}

.user-row span,
.user-row small {
  color: var(--muted);
  font-size: 12px;
}

.user-row .status-active,
.user-row .status-suspended {
  font-weight: 800;
}

.user-row .status-active {
  color: var(--accent-strong);
}

.user-row .status-suspended {
  color: var(--danger);
}

.status-active,
.status-suspended,
.status-pending {
  font-weight: 800;
}

.status-active {
  color: var(--accent-strong);
}

.status-suspended {
  color: var(--danger);
}

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

.user-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-row-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.user-row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  background: #f7faf6;
  border-color: var(--line);
}

.pos-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  height: calc((100vh - 128px) / var(--app-scale));
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.super-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  padding: 18px;
}

.super-sidebar { align-self: stretch; min-height: calc(100vh - 150px); padding:18px 12px; border:1px solid var(--line); border-radius:12px; background:var(--panel); box-shadow:var(--shadow); }
.super-sidebar-brand { display:grid; gap:3px; padding:4px 10px 20px; border-bottom:1px solid var(--line); }
.super-sidebar-brand strong { font-size:18px; }.super-sidebar-brand span { color:var(--muted); font-size:13px; }
.super-nav { display:grid; gap:8px; padding-top:16px; }.super-nav-button { display:flex; gap:10px; align-items:center; width:100%; min-height:44px; padding:0 12px; border:0; border-radius:9px; color:var(--text); background:transparent; font-weight:800; text-align:left; }.super-nav-button:hover,.super-nav-button.active { color:#fff; background:var(--accent-strong); }.super-nav-button span { width:20px; text-align:center; }
.super-main-content { min-width:0; display:grid; align-content:start; gap:18px; }.super-commerce-panel { display:grid; gap:12px; }.super-start-panel,.super-office-panel { padding:28px; border:1px solid var(--line); border-radius:12px; background:var(--panel); box-shadow:var(--shadow); }.super-start-panel h2 { margin:4px 0 10px; }.super-start-panel p:last-child { max-width:620px; color:var(--muted); line-height:1.5; }.super-office-panel-body { min-width:0; }.super-office-panel .dialog-actions { margin-top:18px; }

.super-hero,
.super-users {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.super-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.super-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.super-users .super-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.super-users .user-row {
  min-height: 232px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--theme-surface-soft);
}

.super-users .user-row-actions {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  justify-content:stretch;
}

.super-users .user-row-actions small { grid-column: 1 / -1; }

.super-users .user-row-actions button { min-width:0; }

/* El directorio de comercios debe aprovechar el espacio sin verse como un
   panel de tarjetas gigantes. Se compacta solo esta vista: Inicio y
   Administración conservan sus medidas independientes. */
.super-commerce-panel .super-hero {
  gap: 12px;
  padding: 16px 18px;
}

.super-commerce-panel .super-hero h2 { font-size: 21px; }
.super-commerce-panel .super-hero p { font-size: 14px; }
.super-commerce-panel .super-hero-actions { gap: 8px; }
.super-commerce-panel .super-hero-actions button { min-height: 36px; padding: 0 12px; font-size: 13px; }
.super-commerce-panel .super-users .user-list-heading { margin-bottom: 12px; }
.super-commerce-panel .user-list-heading h3 { font-size: 18px; }
.super-commerce-panel .super-user-filters { gap: 6px; }
.super-commerce-panel .super-user-filters button { min-height: 32px; padding: 0 10px; font-size: 13px; }

.super-commerce-panel .super-users .super-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 10px;
}

.super-commerce-panel .super-users .user-row {
  min-height: 0;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
}

.super-commerce-panel .super-user-card-head { gap: 5px !important; }
.super-commerce-panel .super-user-card-head strong { font-size: 20px; line-height: 1.1; }
.super-commerce-panel .super-user-card-head span { font-size: 13px; line-height: 1.2; }
.super-commerce-panel .super-role-badge { padding: 3px 7px; font-size: 10px; }
.super-commerce-panel .validity-count { padding: 4px 8px; font-size: 12px; }
.super-commerce-panel .super-users .user-row-actions { gap: 7px; }
.super-commerce-panel .super-users .user-row-actions small { font-size: 13px; line-height: 1.25; }
.super-commerce-panel .super-users .user-row-actions button { min-height: 34px; padding: 0 10px; font-size: 13px; }

.super-dashboard :is(h2, h3, strong, span, small, p) { font-weight: 800; }
.user-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.user-list-heading h3 { margin: 2px 0 0; font-size: 20px; }
.user-list-heading .eyebrow { margin: 0; }
.super-user-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.super-user-filters button { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; color: #000; background: rgba(255,255,255,.72); font-weight: 900; }
.super-user-filters button.active { color: #fff; border-color: var(--accent-strong); background: var(--accent-strong); }
.super-role-badge { width: fit-content; padding: 4px 8px; border-radius: 999px; color: #000; background: rgba(255,255,255,.7); font-size: 11px; text-transform: uppercase; }
.super-user-card-head { align-content: start; }
.super-user-card-head { gap: 7px !important; }
.super-user-card-head strong { font-size: 24px; line-height: 1.05; }
.super-user-card-head span { font-size: 15px; line-height: 1.25; }
.validity-count { width:fit-content; padding:5px 9px; border-radius:999px; font-weight:900 !important; }
.validity-count-active { color:#096447 !important; background:#dff7ec; }
.validity-count-warning { color:#8a4b00 !important; background:#fff0c8; }
.validity-count-urgent { color:#9a3412 !important; background:#ffeadc; }
.validity-count-expired { color:#a21c2c !important; background:#ffe4e6; }
.validity-count-neutral { color:#475569 !important; background:#e9eef5; }
#saveAdminUserBtn.is-saving { cursor:wait; opacity:.82; }
.super-office-panel { overflow:hidden; border-color:color-mix(in srgb, var(--accent) 36%, var(--line)); background:linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel) 45%); }
.super-office-heading { margin:-28px -28px 18px; padding:24px 28px; border-bottom:1px solid color-mix(in srgb, var(--accent) 35%, transparent); background:linear-gradient(115deg, var(--accent-strong), var(--accent)); color:#fff; }
.super-office-heading .eyebrow { color:#d7fff3; }.super-office-heading h2 { color:#fff; }.super-office-heading .icon-button { color:var(--accent-strong); border-color:#e6fff7; background:#fff; }
.super-office-intro { margin:0 0 16px; padding:13px 15px; border-left:4px solid var(--accent); border-radius:0 10px 10px 0; color:var(--text); background:color-mix(in srgb, var(--accent) 9%, var(--panel)); line-height:1.45; }
.super-office-summary { grid-template-columns:repeat(auto-fit, minmax(155px, 1fr)); }
.super-home-summary { margin-top:22px; margin-bottom:0; }
.super-office-summary article { min-height:96px; border-color:color-mix(in srgb, var(--accent) 25%, var(--line)); background:linear-gradient(160deg, #fff, color-mix(in srgb, var(--accent) 8%, #fff)); box-shadow:0 7px 18px rgba(18,107,86,.08); }
.super-office-summary article strong { color:var(--accent-strong); }
.super-office-search { margin:18px 0 0; padding:12px; border:1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius:10px; background:rgba(255,255,255,.72); }
.super-office-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 18px; padding-bottom:18px; border-bottom:1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); }
.super-office-actions button { flex:1 1 130px; }.super-office-actions .secondary-button { color:var(--accent-strong); border-color:color-mix(in srgb, var(--accent) 35%, var(--line)); background:color-mix(in srgb, var(--accent) 10%, #fff); }
.super-office-records,.super-office-documents { padding:4px; border-radius:10px; background:color-mix(in srgb, var(--accent) 5%, #fff); }.super-office-records .sale-row,.super-office-documents .sale-row { border-color:color-mix(in srgb, var(--accent) 18%, var(--line)); }
.super-office-client-commerce { color:var(--accent-strong) !important; font-weight:800; }
.admin-commerce-management { margin-top:16px; padding:14px; border:1px solid var(--line); border-radius:10px; background:#fffaf6; }.admin-commerce-management p { margin:0 0 10px; color:var(--muted); font-weight:800; }.admin-commerce-management > div { display:flex; flex-wrap:wrap; gap:8px; }
.super-office-client-fields { display:grid; grid-column:1 / -1; gap:12px; margin:0; padding:14px; border:1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius:10px; background:color-mix(in srgb, var(--accent) 5%, #fff); }.super-office-client-fields legend { padding:0 6px; color:var(--accent-strong); font-size:13px; font-weight:900; }.super-office-client-fields p { margin:0; color:var(--muted); font-size:13px; line-height:1.4; }.super-office-client-fields > label,.super-office-new-client-fields label { display:grid; gap:6px; font-weight:800; }.super-office-new-client-fields { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.super-office-document-dialog { width:min(1220px, calc(100vw - 24px)); max-width:none; max-height:min(94vh, 940px); padding:0; overflow:hidden; }
.super-office-document-builder-form { display:grid; grid-template-rows:auto minmax(0, 1fr) auto; gap:16px; height:min(92vh, 900px); padding:20px; overflow:hidden; background:#f5f8fc; }
.super-office-document-builder-head { margin:0; padding:2px 2px 15px; border-bottom:1px solid #dce5ef; }
.super-office-document-builder-head h2 { margin:3px 0 4px; color:#14233f; font-size:28px; }
.super-office-document-builder-head > div > span { color:#687991; font-size:13px; font-weight:700; }
.super-office-document-builder { min-height:0; display:grid; grid-template-columns:minmax(300px, .82fr) minmax(520px, 1.45fr); gap:16px; }
.super-office-document-catalog,.super-office-document-sheet { min-width:0; min-height:0; border:1px solid #dce5ef; border-radius:16px; background:#fff; box-shadow:0 8px 24px rgba(27,52,82,.06); }
.super-office-document-catalog { display:grid; grid-template-rows:auto auto minmax(0,1fr); gap:13px; padding:16px; overflow:hidden; }
.super-office-document-catalog header > div { display:flex; align-items:center; gap:11px; }.super-office-document-catalog h3,.super-office-document-lines-head h3 { margin:0; color:#14233f; font-size:18px; }.super-office-document-catalog p,.super-office-document-lines-head p { margin:3px 0 0; color:#728097; font-size:11px; line-height:1.35; }
.super-office-builder-icon { display:grid; width:42px; height:42px; flex:0 0 auto; place-items:center; border-radius:12px; color:#087d72; background:#ddf7ef; font-size:22px; }
.super-office-catalog-search { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; min-height:44px; padding:0 12px; border:1px solid #d7e1ed; border-radius:11px; background:#f8fafc; }.super-office-catalog-search > span { color:#718197; font-size:20px; }.super-office-catalog-search input { min-width:0; border:0; outline:0; background:transparent; box-shadow:none; }
.super-office-document-product-grid { min-height:0; display:grid; align-content:start; gap:9px; overflow:auto; padding-right:3px; }
.super-office-catalog-product { display:grid; grid-template-columns:42px minmax(0,1fr) auto 25px; align-items:center; gap:10px; width:100%; min-height:70px; padding:10px; border:1px solid #e0e7ef; border-radius:12px; color:#14233f; background:#fff; text-align:left; }.super-office-catalog-product:hover { border-color:#87d8c9; background:#f3fcf9; transform:translateY(-1px); }.super-office-catalog-product-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:11px; color:#078477; background:#e1f7f0; font-size:21px; }.super-office-catalog-product > span:nth-child(2) { min-width:0; display:grid; gap:3px; }.super-office-catalog-product strong,.super-office-catalog-product small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.super-office-catalog-product strong { font-size:13px; }.super-office-catalog-product small { color:#7b8798; font-size:10px; }.super-office-catalog-product b { color:#087d72; font-size:12px; white-space:nowrap; }.super-office-catalog-product i { display:grid; width:25px; height:25px; place-items:center; border-radius:999px; color:#fff; background:#079484; font-size:18px; font-style:normal; }
.super-office-document-sheet { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto auto; gap:13px; padding:16px; overflow:hidden; }
.super-office-document-meta { display:grid; grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(125px,.8fr)); gap:10px; }.super-office-document-meta label { display:grid; gap:6px; color:#4b5c73; font-size:11px; font-weight:850; text-transform:uppercase; }.super-office-document-meta :is(input,select) { min-width:0; min-height:42px; border:1px solid #d6e0eb; border-radius:9px; background:#fff; }
.super-office-document-lines-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:2px; }.super-office-document-lines-head button { min-height:37px; padding:0 11px; white-space:nowrap; }
.super-office-lines { min-height:0; overflow:auto; padding-right:3px; }
.super-office-lines:empty::before { content:"Selecciona productos del catálogo o agrega una partida manual."; display:grid; min-height:150px; place-items:center; padding:24px; border:1px dashed #cdd9e5; border-radius:12px; color:#7a8798; background:#f8fafc; font-size:12px; font-weight:750; text-align:center; }
.super-office-line { display:grid; grid-template-columns:minmax(145px,1.05fr) minmax(160px,1.25fr) 76px 92px 64px 34px; gap:8px; align-items:end; margin:0 0 9px; padding:11px; border:1px solid #e1e8f0; border-radius:12px; background:#fbfcfe; }
.super-office-line label { min-width:0; display:grid; gap:5px; color:#66758a; font-size:9px; font-weight:850; text-transform:uppercase; }.super-office-line :is(input,select) { min-width:0; min-height:38px; border:1px solid #d7e1eb; border-radius:8px; background:#fff; font-size:12px; }.super-office-line-tax-field { display:flex !important; min-height:38px; align-items:center; justify-content:center; gap:5px !important; border:1px solid #d7e1eb; border-radius:8px; background:#fff; }.super-office-line-tax-field input { min-height:0; }.super-office-line .super-office-remove-line { width:34px; height:38px; color:#b42338; border-color:#f0cbd1; background:#fff5f6; }
.super-office-document-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }.super-office-document-totals > div { display:grid; gap:3px; padding:10px 12px; border-radius:10px; color:#627188; background:#f2f6fa; }.super-office-document-totals span { font-size:10px; font-weight:800; text-transform:uppercase; }.super-office-document-totals strong { color:#172743; font-size:16px; }.super-office-document-totals .is-total { color:#fff; background:linear-gradient(135deg,#078e82,#06a593); }.super-office-document-totals .is-total strong { color:#fff; }
.super-office-document-builder-actions { display:flex; justify-content:flex-end; gap:9px; margin:0; padding-top:14px; border-top:1px solid #dce5ef; }.super-office-document-builder-actions button { min-width:145px; }
@media (max-width:960px) { .super-office-document-builder { grid-template-columns:1fr; overflow:auto; }.super-office-document-catalog { min-height:330px; }.super-office-document-sheet { min-height:530px; }.super-office-line { grid-template-columns:1fr 1fr 80px 95px; }.super-office-line-tax-field { grid-column:3; }.super-office-line .super-office-remove-line { grid-column:4; justify-self:end; } }
@media (max-width:720px) { .super-office-panel { padding:18px; }.super-office-heading { margin:-18px -18px 16px; padding:20px 18px; }.super-office-summary { grid-template-columns:repeat(2, minmax(0, 1fr)); }.super-office-document-dialog { width:100dvw; height:100dvh; max-height:none; margin:0; border-radius:0; }.super-office-document-builder-form { height:100dvh; padding:14px; }.super-office-document-builder-head h2 { font-size:23px; }.super-office-document-builder { gap:12px; }.super-office-document-catalog { min-height:300px; padding:13px; }.super-office-document-sheet { min-height:650px; padding:13px; overflow:visible; }.super-office-document-meta { grid-template-columns:1fr 1fr; }.super-office-document-meta label:first-child { grid-column:1 / -1; }.super-office-document-lines-head { align-items:flex-start; }.super-office-document-lines-head p { display:none; }.super-office-line { grid-template-columns:1fr 1fr; }.super-office-line-product-field,.super-office-line-description-field { grid-column:1 / -1; }.super-office-line-tax-field { grid-column:1; }.super-office-line .super-office-remove-line { grid-column:2; justify-self:end; }.super-office-document-totals { grid-template-columns:1fr 1fr; }.super-office-document-totals .is-total { grid-column:1 / -1; }.super-office-document-builder-actions { position:sticky; bottom:-14px; z-index:4; margin:0 -14px -14px; padding:11px 14px calc(11px + env(safe-area-inset-bottom)); background:#fff; box-shadow:0 -8px 20px rgba(31,50,76,.09); }.super-office-document-builder-actions button { min-width:0; flex:1; } }
@media (max-width:720px) { .super-office-new-client-fields { grid-template-columns:1fr; } }
.super-users .user-row-actions small { font-size: 15px; }
.super-users .user-row-actions button { min-height: 40px; font-size: 15px; }

/* Panel Super: directorio de comercios con la jerarquía visual del nuevo
   dashboard. Los colores continúan alimentándose de las variables del tema. */
.app-shell.super-mode {
  background: #f6f8fc;
}

.super-mode .topbar {
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 28px;
  background: rgba(255, 255, 255, .92);
  border-color: #e6ebf2;
  box-shadow: 0 2px 12px rgba(34, 58, 92, .04);
}

.super-mode .topbar .brand { display: none; }
.super-mode .business-identity { display: none; }
.super-mode .business-identity p { color: #17243a; font-size: 15px; }
.super-mode .topbar .top-actions .ghost-button { min-height: 36px; border-color: #e2e8f0; background: #fff; }

.super-mode .super-dashboard {
  min-height: calc(100vh - 64px);
  grid-template-columns: 198px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #f6f8fc;
}

.super-mode .super-sidebar {
  min-height: 100%;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
  color: #effbff;
  background: linear-gradient(160deg, #07384e, #06445c 55%, #032f44);
  box-shadow: none;
}

.super-mode .super-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
  border: 0;
}

.super-mode .super-sidebar-brand img {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 11px;
  background: #e5fbfb;
}

.super-mode .super-sidebar-brand div { display: grid; gap: 2px; }
.super-mode .super-sidebar-brand strong { color: #fff; font-size: 15px; }
.super-mode .super-sidebar-brand span { color: #b9d8e6; font-size: 10px; font-weight: 700; }
.super-mode .super-nav { gap: 6px; padding: 0; }
.super-mode .super-nav-button {
  min-height: 47px;
  gap: 11px;
  padding: 0 14px;
  border-radius: 9px;
  color: #e9f7fb;
  font-size: 14px;
  font-weight: 750;
}

.super-mode .super-nav-button span { color: #bdeefa; font-size: 19px; }
.super-mode .super-nav-button:hover { color: #fff; background: rgba(8,169,176,.26); }
.super-mode .super-nav-button.active { color: #fff; background: linear-gradient(115deg, #087f89, #08a6af); box-shadow: 0 7px 16px rgba(8, 150, 161, .22); }
.super-mode .super-nav-button.active span { color: #fff; }

.super-sidebar-help {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px 11px;
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.09);
}

.super-sidebar-help > span { display: grid; width: 30px; height: 30px; place-items: center; border: 3px solid #09a7af; border-radius: 999px; color: #09a7af; font-weight: 900; }
.super-sidebar-help div { display: grid; gap: 2px; }
.super-sidebar-help strong { font-size: 11px; }.super-sidebar-help small { color: #c7e0eb; font-size: 10px; font-weight: 700; }

.super-mode .super-main-content { gap: 22px; padding: 29px 34px 34px; }
.super-mode .super-commerce-panel { gap: 18px; }
.super-commerce-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.super-commerce-welcome h2 { margin: 0 0 3px; color: #111c32; font-size: clamp(24px, 2.2vw, 31px); line-height: 1.1; letter-spacing: -.04em; }
.super-commerce-welcome p { margin: 0; color: #607087; font-size: 14px; font-weight: 600; }
.super-commerce-welcome .super-hero-actions { display: flex; gap: 9px; }
.super-commerce-welcome .ghost-button { min-height: 40px; border-color: #d8e1ea; color: #375066; background: #fff; font-size: 13px; }
.super-commerce-welcome .primary-button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 8px; background: linear-gradient(115deg, #078b97, #08a9b0); box-shadow: 0 8px 18px rgba(8, 150, 161, .2); }

.super-commerce-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.super-stat-card { position: relative; min-height: 102px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; column-gap: 13px; align-items: center; padding: 17px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .75); border-radius: 12px; color: #142139; text-align: left; box-shadow: 0 8px 20px rgba(35, 57, 88, .07); transition: transform .16s ease, box-shadow .16s ease; }
.super-stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(35, 57, 88, .13); }
.super-stat-card strong { align-self: end; font-size: 29px; line-height: 1; }.super-stat-card > span:not(.super-stat-icon) { grid-column: 2; align-self: start; color: #405167; font-size: 11px; font-weight: 750; }.super-stat-card b { grid-column: 3; grid-row: 1 / -1; color: #6c7c91; font-size: 28px; font-weight: 400; }
.super-stat-icon { grid-row: 1 / -1; display: grid; width: 45px; height: 45px; place-items: center; border-radius: 12px; color: #fff; font-size: 25px; font-weight: 900; }
.super-stat-cyan { background: linear-gradient(135deg, #dffbfd, #eaf8ff); }.super-stat-cyan .super-stat-icon { background: #0797a3; }
.super-stat-green { background: linear-gradient(135deg, #e8fff1, #f1fff8); }.super-stat-green .super-stat-icon { background: #17a95c; }
.super-stat-orange { background: linear-gradient(135deg, #fff2e8, #fff8f1); }.super-stat-orange .super-stat-icon { background: #ff741f; }
.super-stat-purple { background: linear-gradient(135deg, #eee9ff, #f5f1ff); }.super-stat-purple .super-stat-icon { background: #6950dd; }

.super-commerce-directory { padding: 21px 18px 16px; border: 1px solid #e7ebf1; border-radius: 16px; background: #fff; box-shadow: 0 11px 26px rgba(39, 57, 83, .08); }
.super-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 3px 16px; }
.super-directory-title { display: flex; align-items: center; gap: 12px; }.super-directory-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #078b97, #08a9b0); font-size: 22px; box-shadow: 0 7px 14px rgba(8, 150, 161, .18); }.super-directory-title h3 { margin: 0 0 2px; color: #15223a; font-size: 21px; letter-spacing: -.03em; }.super-directory-title p { margin: 0; color: #64748b; font-size: 12px; font-weight: 600; }
.super-directory-filters { display: grid; grid-template-columns: minmax(210px, 2.2fr) repeat(3, minmax(130px, .75fr)); gap: 10px; margin-bottom: 18px; }.super-directory-filters label { min-width: 0; }.super-directory-filters select,.super-directory-search { width: 100%; min-height: 39px; border: 1px solid #e0e7ef; border-radius: 9px; color: #314156; background: #fff; font-size: 12px; font-weight: 700; }.super-directory-filters select { padding: 0 30px 0 11px; }.super-directory-search { display: flex; align-items: center; gap: 8px; padding: 0 11px; }.super-directory-search > span { color: #5d7189; font-size: 21px; line-height: 1; }.super-directory-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: #26364b; background: transparent; font-size: 12px; font-weight: 600; }
.super-commerce-table-wrap { overflow-x: auto; }.super-commerce-table { width: 100%; min-width: 800px; border-collapse: separate; border-spacing: 0; color: #27364a; }.super-commerce-table th { padding: 13px 11px; color: #52647a; background: #f0f5fa; font-size: 11px; font-weight: 850; text-align: left; }.super-commerce-table th:first-child { border-radius: 9px 0 0 9px; }.super-commerce-table th:last-child { border-radius: 0 9px 9px 0; text-align: center; }.super-commerce-table td { padding: 13px 11px; border-bottom: 1px solid #edf0f4; font-size: 12px; font-weight: 650; vertical-align: middle; }.super-commerce-table tbody tr:last-child td { border-bottom: 0; }.commerce-identity { display: flex; align-items: center; gap: 10px; min-width: 190px; }.commerce-identity > div { display: grid; gap: 3px; }.commerce-identity strong { color: #1d2b40; font-size: 12px; }.commerce-identity small,.commerce-expiry small { color: #718096; font-size: 11px; font-weight: 600; }.commerce-type-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 9px; color: #713eb5; background: #f1eaff; font-size: 19px; font-weight: 900; }.commerce-type-icon.commerce-logo { border: 1px solid #e2eaf0; background: #fff; }.commerce-type-icon.commerce-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }.commerce-type-cafeteria,.commerce-type-comida { color: #d87217; background: #fff0d9; }.commerce-type-salon { color: #9b56bd; background: #f4e8fb; }.commerce-type-farmacia { color: #108b69; background: #e0f8ef; }.commerce-owner { color: #33465c; font-size: 11px; font-weight: 800; }.commerce-plan { display: inline-flex; padding: 5px 15px; border-radius: 999px; color: #fff; background: linear-gradient(115deg, #078b97, #08b1b5); font-size: 10px; font-weight: 900; letter-spacing: .04em; }.commerce-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 850; }.commerce-status i { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }.commerce-status-active { color: #0d8b52; background: #e0f9ec; }.commerce-status-upcoming { color: #a4600c; background: #fff3d7; }.commerce-status-expired { color: #c2343a; background: #ffebed; }.commerce-expiry { display: grid; gap: 3px; min-width: 110px; }.commerce-expiry strong { color: #33465c; font-size: 11px; }.commerce-actions { display: flex; justify-content: center; gap: 7px; }.commerce-action { width: 37px; height: 37px; display: grid; place-items: center; border: 0; border-radius: 9px; font-size: 18px; font-weight: 900; transition: transform .14s ease, filter .14s ease; }.commerce-action:hover { transform: translateY(-1px); filter: brightness(.96); }.commerce-action-enter { color: #087b87; background: #dcf8f9; }.commerce-action-edit { color: #167d8b; background: #e3f7fb; }.super-commerce-empty { padding: 30px !important; color: #697a8f; text-align: center; }
.super-directory-note { display: flex; align-items: flex-start; gap: 13px; margin-top: 17px; padding: 15px 17px; border-radius: 10px; color: #245365; background: linear-gradient(90deg, #dff9fc, #ecfbff); }.super-directory-note > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 999px; color: #fff; background: #0a9cab; font-weight: 900; }.super-directory-note strong { display: block; margin-bottom: 2px; color: #1c5265; font-size: 13px; }.super-directory-note p { max-width: 650px; margin: 0; color: #557182; font-size: 11px; font-weight: 650; line-height: 1.4; }

@media (max-width: 1040px) {
  .super-mode .super-main-content { padding: 24px; }
  .super-commerce-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .super-directory-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .super-directory-search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .super-mode .topbar { min-height: 58px; padding: 7px 12px; }.super-mode .business-identity p { font-size: 13px; }.super-mode .topbar .top-actions .ghost-button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .super-mode .super-dashboard { grid-template-columns: 1fr; }.super-mode .super-sidebar { min-height: auto; padding: 9px 10px; border-right: 0; border-bottom: 1px solid #e7ebf1; }.super-mode .super-sidebar-brand,.super-mode .super-sidebar-help { display: none; }.super-mode .super-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }.super-mode .super-nav-button { min-height: 48px; justify-content: center; gap: 2px; padding: 5px 3px; font-size: 11px; text-align: center; flex-direction: column; }.super-mode .super-nav-button span { width: auto; font-size: 16px; }
  .super-mode .super-main-content { gap: 16px; padding: 18px 12px 24px; }.super-commerce-welcome { align-items: flex-start; flex-direction: column; gap: 12px; }.super-commerce-welcome h2 { font-size: 26px; }.super-commerce-welcome .super-hero-actions { width: 100%; }.super-commerce-welcome .super-hero-actions button { flex: 1; min-width: 0; }.super-commerce-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.super-stat-card { min-height: 86px; grid-template-columns: auto 1fr; padding: 12px; column-gap: 9px; }.super-stat-card strong { font-size: 23px; }.super-stat-card b { display: none; }.super-stat-icon { width: 35px; height: 35px; border-radius: 10px; font-size: 19px; }.super-stat-card > span:not(.super-stat-icon) { font-size: 10px; }
  .super-commerce-directory { padding: 15px 12px 12px; border-radius: 13px; }.super-directory-title h3 { font-size: 18px; }.super-directory-title p { font-size: 11px; }.super-directory-icon { width: 37px; height: 37px; }.super-directory-filters { grid-template-columns: 1fr; margin-bottom: 12px; }.super-directory-search { grid-column: auto; }.super-commerce-table { min-width: 0; }.super-commerce-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }.super-commerce-table,.super-commerce-table tbody,.super-commerce-table tr,.super-commerce-table td { display: block; width: 100%; }.super-commerce-table tbody { display: grid; gap: 10px; }.super-commerce-table tr { padding: 11px; border: 1px solid #e9edf2; border-radius: 11px; }.super-commerce-table td { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 10px; padding: 7px 2px; border: 0; align-items: center; }.super-commerce-table td::before { content: attr(data-label); color: #687a91; font-size: 10px; font-weight: 850; }.super-commerce-table td:first-child { display: block; padding-bottom: 10px; border-bottom: 1px solid #edf0f4; }.super-commerce-table td:first-child::before { display: none; }.commerce-actions { justify-content: flex-start; }.super-commerce-empty { display: block !important; }.super-directory-note { padding: 13px; }.super-directory-note p { font-size: 10px; }
}

@media (max-width: 720px) { .user-list-heading { align-items: stretch; flex-direction: column; } .super-user-filters button { flex: 1; } }

/* Panel Super móvil: navegación persistente y tarjetas de comercio legibles,
   sin modificar las mismas acciones disponibles en computadora. */
.super-commerce-mobile-cards { display: none; }

/* Administración / Negocios Pro: espacio documental propio, distinto al
   directorio de comercios y diseñado para escritorio y móvil. */
.super-mode .super-dashboard.super-office-active .super-sidebar { color: #effbff; background: linear-gradient(160deg, #07384e, #06445c 55%, #032f44); }
.super-mode .super-dashboard.super-office-active .super-sidebar-brand { border-bottom-color: rgba(255,255,255,.12); }
.super-mode .super-dashboard.super-office-active .super-sidebar-brand strong { color: #fff; }
.super-mode .super-dashboard.super-office-active .super-sidebar-brand span { color: #b9d8e6; }
.super-mode .super-dashboard.super-office-active .super-nav-button { color: #e9f7fb; }
.super-mode .super-dashboard.super-office-active .super-nav-button span { color: #bdeefa; }
.super-mode .super-dashboard.super-office-active .super-nav-button:hover { color: #fff; background: rgba(8,169,176,.26); }
.super-mode .super-dashboard.super-office-active .super-nav-button.active { background: linear-gradient(115deg, #00869a, #03adc0); }
.super-mode .super-dashboard.super-office-active .super-sidebar-help { color: #fff; background: rgba(255,255,255,.09); }
.super-mode .super-dashboard.super-office-active .super-sidebar-help small { color: #c7e0eb; }

.super-mode .super-office-panel { padding: 0; overflow: visible; border: 1px solid #d5e9eb; border-radius: 16px; background: linear-gradient(145deg, #effeff, #f9fcff 45%, #eef9ff); box-shadow: 0 14px 32px rgba(31, 69, 95, .10); }
.super-office-panel-body { display: grid; gap: 16px; padding: 24px; }
.super-office-hero { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 15px; }
.super-office-hero-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 14px; color: #078b9a; background: linear-gradient(135deg, #c8fbff, #dff8ff); font-size: 31px; font-weight: 900; }
.super-office-hero p { margin: 0 0 3px; color: #4d6580; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.super-office-hero h2 { margin: 0 0 3px; color: #121c3c; font-size: 28px; letter-spacing: -.04em; }
.super-office-hero > div:nth-child(2) > span { display: block; max-width: 680px; color: #66758f; font-size: 13px; font-weight: 600; line-height: 1.4; }
.super-office-hero-status { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: #098654; background: #ddfbed; font-size: 11px; font-weight: 850; white-space: nowrap; }.super-office-hero-status > span { font-size: 10px; }
.super-office-intro { display: flex; align-items: center; gap: 12px; margin: 0; padding: 13px 16px; border: 1px solid #c8eef3; border-left: 0; border-radius: 9px; color: #36516b; background: linear-gradient(90deg, #e1faff, #f3fcff); font-size: 13px; font-weight: 650; line-height: 1.4; }
.super-office-intro > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 999px; color: #fff; background: #0694a5; font-weight: 900; }.super-office-intro button { margin-left: auto; padding: 0; border: 0; color: #688099; background: transparent; font-size: 23px; line-height: 1; }
.super-office-search { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 14px; min-height: 46px; border: 1px solid #dce6ef; border-radius: 9px; background: #fff; }.super-office-search > span { color: #5c6f8a; font-size: 23px; line-height: 1; }.super-office-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: #273d58; background: transparent; font-weight: 650; }.super-office-search input::placeholder { color: #8a99aa; }
.super-office-actions { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) repeat(4, minmax(95px, .72fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.super-office-action-card { position: relative; min-height: 112px; display: grid; align-content: center; justify-items: start; gap: 5px; padding: 15px; overflow: hidden; border: 1px solid #e8edf4; border-radius: 11px; color: #1b2b46; background: #fff; text-align: left; box-shadow: 0 6px 15px rgba(43, 69, 96, .06); transition: transform .15s ease, box-shadow .15s ease; }.super-office-action-card:hover { transform: translateY(-2px); box-shadow: 0 11px 20px rgba(43, 69, 96, .12); }
.super-office-action-card > span { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 999px; color: #058b9c; background: #dafbfe; font-size: 23px; font-weight: 900; }.super-office-action-card strong { font-size: 13px; }.super-office-action-card small { max-width: 92px; color: #78889e; font-size: 10px; font-weight: 650; line-height: 1.3; }.super-office-action-card b { position: absolute; top: 19px; right: 15px; color: #6b7e95; font-size: 24px; font-weight: 400; }
.super-office-action-create { align-content: center; justify-items: center; padding: 12px 9px; text-align: center; }.super-office-action-create > span { width: auto; height: auto; color: inherit; background: transparent; font-size: 34px; font-weight: 400; }.super-office-action-create strong { max-width: 86px; font-size: 12px; line-height: 1.2; }.super-office-action-client { color: #129753; background: linear-gradient(135deg, #deffec, #c8ffe0); }.super-office-action-product { color: #1674d9; background: linear-gradient(135deg, #e5f4ff, #cfe9ff); }.super-office-action-quote { color: #e27108; background: linear-gradient(135deg, #fff4dd, #ffe8c1); }.super-office-action-invoice { color: #06849b; background: linear-gradient(135deg, #dcfaff, #c4f3f8); }
.super-office-documents-workspace { padding: 18px; border: 1px solid #e1eaf1; border-radius: 13px; background: #fff; box-shadow: 0 8px 18px rgba(35, 57, 83, .06); }.super-office-documents-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }.super-office-documents-heading > div { display: flex; align-items: center; gap: 12px; }.super-office-documents-heading > div > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #078b9a; background: #d9f8fb; font-size: 23px; font-weight: 900; }.super-office-documents-heading h3 { margin: 0 0 2px; color: #14233e; font-size: 19px; }.super-office-documents-heading p { margin: 0; color: #718097; font-size: 11px; font-weight: 600; }.super-office-documents-heading button { min-height: 36px; padding: 0 12px; border: 1px solid #1596a3; border-radius: 8px; color: #087f8c; background: #fff; font-size: 11px; font-weight: 850; }
.super-office-document-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(130px, 1fr)); gap: 9px; margin-bottom: 12px; }.super-office-document-filters select,.super-office-document-search { min-width: 0; min-height: 37px; border: 1px solid #dfe6ef; border-radius: 8px; color: #52647d; background: #fff; font-size: 11px; font-weight: 700; }.super-office-document-filters select { padding: 0 28px 0 10px; }.super-office-document-search { display: flex; align-items: center; gap: 7px; padding: 0 10px; }.super-office-document-search > span { color: #627590; font-size: 19px; }.super-office-document-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: #2c405b; background: transparent; font-size: 11px; font-weight: 650; }
.super-office-documents-table { overflow: hidden; border: 1px solid #e8edf2; border-radius: 9px; }.super-office-document-table-head,.super-office-document-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) .75fr 1fr .8fr .8fr 88px; gap: 10px; align-items: center; }.super-office-document-table-head { padding: 11px 12px; color: #5d708a; background: #f2f6fa; font-size: 10px; font-weight: 850; }.super-office-document-row { min-height: 64px; padding: 9px 12px; border-top: 1px solid #edf1f4; color: #52647d; font-size: 11px; font-weight: 650; }.super-office-document-id { display: flex; align-items: center; min-width: 0; gap: 9px; }.super-office-document-icon { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 6px; color: #fff; background: #147be3; font-size: 14px; font-weight: 900; }.super-office-document-icon.super-office-document-quotation { background: #b638d9; }.super-office-document-id > div { display: grid; min-width: 0; gap: 2px; }.super-office-document-id strong { overflow: hidden; color: #1a2b46; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.super-office-document-id small { display: none; color: #718198; font-size: 10px; }.super-office-document-status { display: inline-flex; width: max-content; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; }.super-office-document-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }.super-office-document-status-pending { color: #d7870a; background: #fff5dc; }.super-office-document-status-paid { color: #0d9653; background: #e0faed; }.super-office-document-status-converted { color: #137dd9; background: #e5f3ff; }.super-office-document-status-cancelled { color: #c9404b; background: #ffeaec; }.super-office-document-total { color: #30435c; font-size: 11px; }.super-office-document-view { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; gap: 5px; border: 1px solid #0f98a6; border-radius: 7px; color: #087f8c; background: #fff; font-size: 11px; font-weight: 850; }.super-office-document-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.super-office-document-client:not(.super-office-document-client-desktop) { display: none; }
.super-office-document-table-head.is-quotation,.super-office-document-row.is-quotation { grid-template-columns: minmax(150px, 1.4fr) .75fr 1fr .8fr 88px; }
.super-mode .super-office-panel .super-office-records,
.super-mode .super-office-panel .super-office-documents { height: auto; max-height: none; overflow: visible; padding-right: 0; }
.super-office-panel .dialog-actions { display: none; }

/* Administración mantiene las mismas acciones, pero adopta la jerarquía
   visual moderna de Inicio: superficies limpias, tarjetas reconocibles y
   tipografía más clara para el trabajo diario. */
.super-mode .super-dashboard.super-office-active .super-main-content {
  background:
    radial-gradient(circle at 86% 2%, rgba(153, 235, 246, .24), transparent 28rem),
    #f6f8fc;
}
.super-mode .super-office-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.super-office-panel-body {
  max-width: 1320px;
  gap: 20px;
  padding: 0;
}
.super-office-intro {
  min-height: 52px;
  padding: 14px 17px;
  border: 1px solid #c9edf2;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(34, 86, 113, .05);
}
.super-office-search {
  min-height: 50px;
  padding: 0 16px;
  border-color: #d8e4ee;
  border-radius: 12px;
  box-shadow: 0 7px 16px rgba(35, 61, 87, .045);
}
.super-office-search:focus-within {
  border-color: #0c9baa;
  box-shadow: 0 0 0 4px rgba(10, 164, 179, .12);
}
.super-office-actions {
  grid-template-columns: repeat(4, minmax(140px, 1.1fr)) repeat(4, minmax(104px, .76fr));
  gap: 12px;
}
.super-office-action-card {
  min-height: 124px;
  padding: 17px;
  border-color: #e2eaf1;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(41, 67, 98, .065);
}
.super-office-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 25px rgba(35, 70, 98, .13);
}
.super-office-action-card > span {
  width: 41px;
  height: 41px;
  font-size: 25px;
}
.super-office-action-card strong {
  color: #14233e;
  font-size: 14px;
  letter-spacing: -.015em;
}
.super-office-action-card small {
  max-width: 112px;
  color: #718199;
  font-size: 11px;
  line-height: 1.38;
}
.super-office-action-create { padding: 14px 10px; }
.super-office-action-create > span { font-size: 36px; }
.super-office-action-create strong { color: inherit; font-size: 12px; }
.super-office-documents-workspace {
  padding: 21px;
  border-color: #dfe9f1;
  border-radius: 17px;
  box-shadow: 0 13px 28px rgba(35, 62, 91, .075);
}
.super-office-documents-heading h3 { font-size: 21px; letter-spacing: -.025em; }
.super-office-documents-heading p { font-size: 12px; }
.super-office-document-filters select,
.super-office-document-search {
  min-height: 41px;
  border-color: #dce5ee;
  border-radius: 10px;
  font-size: 12px;
}
.super-office-documents-table { border-color: #e2eaf1; border-radius: 12px; }
.super-office-document-table-head { padding: 12px 14px; background: #f2f7fb; }
.super-office-document-row { min-height: 68px; padding: 10px 14px; }
.super-office-document-row:hover { background: #f9fdff; }

/* Directorio de clientes: conserva los datos privados existentes, pero los
   presenta con la misma jerarquía visual y acciones claras de Comercios. */
.super-office-client-directory { padding: 21px; border: 1px solid #dfe9f1; border-radius: 17px; background: #fff; box-shadow: 0 13px 28px rgba(35, 62, 91, .075); }
.super-office-client-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; padding-bottom: 15px; border-bottom: 1px solid #e7edf3; }
.super-office-client-directory-heading > div { display: flex; align-items: center; gap: 12px; }.super-office-client-directory-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #078b9a; background: linear-gradient(135deg, #c8fbff, #e0f9ff); font-size: 25px; font-weight: 900; }.super-office-client-directory-heading p { margin: 0 0 2px; color: #078894; font-size: 10px; font-weight: 900; letter-spacing: .08em; }.super-office-client-directory-heading h3 { margin: 0; color: #14233e; font-size: 21px; letter-spacing: -.025em; }.super-office-client-directory-heading small { color: #718199; font-size: 11px; font-weight: 650; }.super-office-client-directory-hint { padding: 8px 10px; border-radius: 999px; color: #5b6e85; background: #f1f8fa; font-size: 11px; font-weight: 650; }.super-office-client-directory-hint b { color: #087f8c; }
.super-office-client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 12px; }.super-office-client-card { display: grid; gap: 13px; min-width: 0; padding: 15px; border: 1px solid #e2eaf1; border-radius: 15px; background: linear-gradient(150deg, #fff, #f9fdff); box-shadow: 0 7px 16px rgba(42, 67, 93, .05); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }.super-office-client-card:hover { transform: translateY(-2px); border-color: #bae7eb; box-shadow: 0 13px 23px rgba(35, 75, 99, .1); }.super-office-client-card-head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }.super-office-client-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: #087f8c; background: linear-gradient(135deg, #d6f7fa, #e9fcfd); font-size: 14px; font-weight: 900; }.super-office-client-card-head > div { display: grid; min-width: 0; gap: 3px; }.super-office-client-card-head strong { overflow: hidden; color: #182a45; font-size: 14px; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }.super-office-client-card-head small { color: #748399; font-size: 10px; font-weight: 700; }.super-office-client-status { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 5px 8px; border-radius: 999px; color: #098654; background: #e0faed; font-size: 10px; font-weight: 850; white-space: nowrap; }.super-office-client-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }.super-office-client-status.is-legacy { color: #68798f; background: #edf2f6; }
.super-office-client-meta { display: grid; gap: 7px; min-height: 42px; padding: 11px; border-radius: 10px; background: #f5f9fc; }.super-office-client-meta > span { display: flex; min-width: 0; align-items: center; gap: 7px; color: #596c84; font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }.super-office-client-meta b,.super-office-client-linked b { color: #078b9a; font-size: 14px; }.super-office-client-no-contact { align-self: center; color: #8492a3 !important; font-style: italic; }.super-office-client-linked { display: flex; align-items: flex-start; gap: 7px; min-width: 0; color: #26717b; font-size: 11px; font-weight: 750; line-height: 1.35; }.super-office-client-linked span { overflow-wrap: anywhere; }.super-office-client-card footer { display: flex; justify-content: flex-end; padding-top: 1px; }.super-office-client-card .commerce-action { min-height: 35px; min-width: 116px; }

/* Detalle de facturas y cotizaciones: misma lectura visual de las tarjetas
   modernas de Administración, sin cambiar el flujo de abonos o conversión. */
.super-office-detail-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: min(88dvh, 760px);
  border: 1px solid #dbe7ef;
  border-radius: 20px;
  background: #f7fbfd;
  box-shadow: 0 26px 64px rgba(24, 49, 78, .25);
}
.super-office-detail-dialog .print-dialog-body {
  display: grid;
  gap: 18px;
  height: auto;
  max-height: min(88dvh, 760px);
  padding: 25px;
  overflow: auto;
  background: radial-gradient(circle at 100% 0, rgba(177, 242, 247, .48), transparent 20rem), #f8fcfe;
}
.super-office-detail-head {
  align-items: center;
  margin: 0;
  padding-bottom: 17px;
  border-bottom: 1px solid #dce8ef;
}
.super-office-detail-head > div:first-child { display: flex; align-items: center; gap: 13px; }
.super-office-detail-head .eyebrow { margin: 0 0 3px; color: #078894; font-size: 10px; letter-spacing: .08em; }
.super-office-detail-head h2 { margin: 0; color: #14233e; font-size: 25px; letter-spacing: -.03em; }
.super-office-detail-head-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #078b9a; background: linear-gradient(135deg, #c8fbff, #e1f9ff); font-size: 24px; font-weight: 900; }
.super-office-detail-head .icon-button { width: 39px; min-width: 39px; height: 39px; min-height: 39px; border-color: #d7e3ec; border-radius: 11px; color: #24344b; background: #fff; font-size: 25px; }
.super-office-detail-dialog #superOfficeDetailBody { display: grid; gap: 14px; min-width: 0; }
.super-office-detail-status { display: flex; align-items: center; gap: 8px; }
.super-office-detail-type { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 999px; color: #24707a; background: #def8fa; font-size: 11px; font-weight: 850; }
.super-office-detail-items { overflow: hidden; border: 1px solid #dfe9ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 18px rgba(38, 66, 92, .055); }
.super-office-detail-items header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #e5edf2; background: #f4fafc; }
.super-office-detail-items header > div { display: flex; align-items: center; gap: 9px; }.super-office-detail-items header > div > span { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: #078b9a; background: #d8f7fa; font-weight: 900; }.super-office-detail-items h3 { margin: 0; color: #1b2c46; font-size: 14px; }.super-office-detail-items header > strong { color: #708197; font-size: 11px; }
.super-office-detail-lines { display: grid; }.super-office-detail-lines > article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border-top: 1px solid #edf1f4; }.super-office-detail-lines > article:first-child { border-top: 0; }.super-office-detail-lines > article > div { display: grid; min-width: 0; gap: 4px; }.super-office-detail-lines > article > div strong { overflow: hidden; color: #152640; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }.super-office-detail-lines > article > div span { color: #728299; font-size: 12px; font-weight: 650; }.super-office-detail-lines > article > strong { flex: 0 0 auto; color: #0d7180; font-size: 14px; }
.super-office-detail-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.super-office-detail-totals > div { display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #e1eaf0; border-radius: 13px; background: #fff; }.super-office-detail-totals span { color: #718198; font-size: 11px; font-weight: 750; }.super-office-detail-totals strong { color: #172944; font-size: 17px; letter-spacing: -.02em; }.super-office-detail-totals .is-pending { border-color: #f2d89c; background: #fffaf0; }.super-office-detail-totals .is-pending strong { color: #b26307; }
.super-office-payment-form { margin: 0; padding: 17px; border: 1px solid #dce8ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 18px rgba(38, 66, 92, .045); }.super-office-payment-form label { color: #34506e; font-size: 11px; font-weight: 850; }.super-office-payment-form input,.super-office-payment-form select { min-height: 44px; border-color: #d8e3eb; border-radius: 10px; }.super-office-payment-form .primary-button { min-height: 44px; border-radius: 10px; }
.super-office-detail-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 0; padding-top: 3px; }.super-office-detail-dialog .dialog-actions button { min-height: 40px; border-radius: 10px; font-weight: 850; }

@media (max-width: 640px) {
  .super-office-detail-dialog { width: calc(100dvw - 16px); max-height: calc(100dvh - 16px); margin: 8px auto; border-radius: 16px; }
  .super-office-detail-dialog .print-dialog-body { gap: 14px; max-height: calc(100dvh - 16px); padding: 17px 14px calc(18px + env(safe-area-inset-bottom)); }
  .super-office-detail-head { padding-bottom: 13px; }.super-office-detail-head-icon { width: 39px; height: 39px; border-radius: 11px; font-size: 21px; }.super-office-detail-head h2 { font-size: 20px; }
  .super-office-detail-items header,.super-office-detail-lines > article { padding: 12px; }.super-office-detail-lines > article { gap: 10px; }.super-office-detail-lines > article > div strong { font-size: 13px; }.super-office-detail-lines > article > strong { font-size: 13px; }
  .super-office-detail-totals { grid-template-columns: 1fr; gap: 7px; }.super-office-detail-totals > div { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; }.super-office-detail-totals strong { font-size: 16px; }
  .super-office-payment-form { grid-template-columns: 1fr; padding: 14px; }.super-office-payment-form .primary-button { width: 100%; }
  .super-office-detail-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }.super-office-detail-dialog .dialog-actions #superOfficeConvertBtn { grid-column: 1 / -1; }.super-office-detail-dialog .dialog-actions button { width: 100%; }
}

@media (max-width: 1100px) {
  .super-office-actions { grid-template-columns: repeat(4, minmax(112px, 1fr)) repeat(4, minmax(88px, .7fr)); }
  .super-office-action-card { min-height: 104px; padding: 12px; }
  .super-office-document-table-head,.super-office-document-row { grid-template-columns: minmax(140px, 1.5fr) .7fr .9fr .75fr .8fr 78px; gap: 7px; }
}

@media (max-width: 720px) {
  .super-mode .super-dashboard.super-office-active .super-sidebar { color: #687b93; background: rgba(255,255,255,.97); }
  .super-mode .super-dashboard.super-office-active .super-nav-button { color: #687b93; }
  .super-mode .super-dashboard.super-office-active .super-nav-button span { color: currentColor; }
  .super-mode .super-dashboard.super-office-active .super-nav-button.active { color: #078d98; background: transparent; box-shadow: none; }
  .super-mode .super-dashboard.super-office-active .super-nav-button.active span { color: #078d98; }
  .super-mode .super-office-panel { border: 0; border-radius: 0; background: #f5fbfd; box-shadow: none; }
  .super-office-panel-body { gap: 13px; padding: 16px 12px 20px; }
  .super-office-hero { grid-template-columns: 51px minmax(0, 1fr); gap: 11px; }
  .super-office-hero-icon { width: 51px; height: 51px; border-radius: 13px; font-size: 27px; }
  .super-office-hero h2 { font-size: 25px; }.super-office-hero p { font-size: 9px; }.super-office-hero > div:nth-child(2) > span { font-size: 12px; line-height: 1.3; }
  .super-office-hero-status { display: none; }
  .super-office-intro { align-items: flex-start; gap: 10px; padding: 12px; border-left: 1px solid #c8eef3; font-size: 12px; }.super-office-intro > span { width: 24px; height: 24px; }.super-office-intro button { font-size: 21px; }
  .super-office-search { min-height: 45px; }.super-office-search > span { font-size: 21px; }.super-office-search input { font-size: 12px; }
  .super-office-actions { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 9px; }
  .super-office-action-card { min-height: 130px; padding: 12px; border-radius: 11px; }.super-office-action-browse { grid-column: span 3; }.super-office-action-create { min-height: 103px; grid-column: span 3; }.super-office-action-card > span { width: 35px; height: 35px; font-size: 21px; }.super-office-action-card strong { font-size: 12px; }.super-office-action-card small { font-size: 10px; }.super-office-action-card b { top: 14px; right: 11px; font-size: 21px; }.super-office-action-create > span { width: auto; height: auto; font-size: 29px; }.super-office-action-create strong { font-size: 11px; }
  .super-office-documents-workspace { padding: 12px; border-radius: 13px; }.super-office-documents-heading { margin-bottom: 11px; }.super-office-documents-heading > div { gap: 9px; }.super-office-documents-heading > div > span { width: 37px; height: 37px; border-radius: 9px; font-size: 20px; }.super-office-documents-heading h3 { font-size: 17px; }.super-office-documents-heading p { font-size: 10px; }.super-office-documents-heading button { min-height: 31px; padding: 0; border: 0; color: #087f8c; background: transparent; font-size: 11px; white-space: nowrap; }
  .super-office-document-filters { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }.super-office-document-search { display: none; }.super-office-document-filters select { min-height: 40px; font-size: 11px; }
  .super-office-documents-table { overflow: visible; border: 0; border-radius: 0; }.super-office-document-table-head { display: none; }.super-office-document-row { min-height: 0; grid-template-columns: minmax(0, 1fr) auto 72px; gap: 8px; padding: 11px 2px; border-top: 1px solid #e6edf2; }.super-office-document-row:first-of-type { border-top: 0; }.super-office-document-id { grid-column: 1; grid-row: 1 / span 2; gap: 8px; }.super-office-document-icon { width: 32px; height: 32px; border-radius: 7px; font-size: 18px; }.super-office-document-id strong { font-size: 11px; }.super-office-document-id small { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.super-office-document-client-desktop,.super-office-document-type,.super-office-document-date { display: none; }.super-office-document-status { grid-column: 2; grid-row: 1; align-self: end; padding: 4px 7px; font-size: 9px; }.super-office-document-total { grid-column: 2; grid-row: 2; align-self: start; font-size: 11px; }.super-office-document-view { grid-column: 3; grid-row: 1 / span 2; min-height: 35px; align-self: center; font-size: 11px; }
  .super-office-client-directory { padding: 14px 12px; border-radius: 14px; }.super-office-client-directory-heading { align-items: flex-start; margin-bottom: 13px; padding-bottom: 12px; }.super-office-client-directory-icon { width: 37px; height: 37px; border-radius: 10px; font-size: 21px; }.super-office-client-directory-heading h3 { font-size: 18px; }.super-office-client-directory-hint { display: none; }.super-office-client-grid { grid-template-columns: 1fr; gap: 10px; }.super-office-client-card { gap: 11px; padding: 13px; border-radius: 13px; }.super-office-client-card-head { grid-template-columns: 39px minmax(0, 1fr); }.super-office-client-avatar { width: 39px; height: 39px; }.super-office-client-status { grid-column: 2; grid-row: 2; justify-self: start; margin-top: -4px; }.super-office-client-meta { min-height: 0; padding: 10px; }.super-office-client-card footer { justify-content: stretch; }.super-office-client-card .commerce-action { width: 100%; }
}

@media (max-width: 720px) {
  .app-shell.super-mode {
    min-height: 100dvh;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    background: #f5f8fc;
  }

  .super-mode .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 14px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
  }

  .super-mode .topbar .brand {
    display: flex;
    gap: 8px;
    min-width: 0;
  }

  .super-mode .topbar .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .super-mode .topbar .brand h1 {
    margin: 0;
    color: #15233b;
    font-size: 18px;
  }

  .super-mode .topbar .brand div:last-child::after {
    content: "Administración";
    display: block;
    margin-top: 1px;
    color: #718096;
    font-size: 10px;
    font-weight: 700;
  }

  .super-mode .business-identity { display: none; }
  .super-mode .top-actions { gap: 7px; }
  .super-mode .top-actions #logoutBtn {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    overflow: hidden;
    border-radius: 999px;
    color: transparent;
    background: linear-gradient(135deg, #078b97, #08a9b0);
  }
  .super-mode .top-actions #logoutBtn::before {
    content: "JP";
    color: #fff;
    font-size: 12px;
    font-weight: 850;
  }

  .super-mode .super-dashboard { display: block; min-height: auto; padding: 0; }
  .super-mode .super-sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: block;
    min-height: 0;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid #e5eaf1;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -8px 22px rgba(37, 54, 82, .10);
  }
  .super-mode .super-sidebar-brand,
  .super-mode .super-sidebar-help { display: none; }
  .super-mode .super-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .super-mode .super-nav-button {
    min-height: 55px;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 9px;
    color: #687b93;
    background: transparent;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
  }
  .super-mode .super-nav-button span { width: auto; height: auto; color: currentColor; font-size: 20px; line-height: 1; }
  .super-mode .super-nav-button.active,
  .super-mode .super-nav-button:hover {
    color: #078d98;
    background: transparent;
    box-shadow: none;
  }
  .super-mode .super-nav-button.active span { color: #078d98; }

  .super-mode .super-main-content { display: block; padding: 20px 14px; }
  .super-mode .super-commerce-panel { gap: 16px; }
  .super-commerce-welcome { display: grid; gap: 12px; }
  .super-commerce-welcome h2 { font-size: 27px; }
  .super-commerce-welcome p { max-width: 270px; font-size: 13px; line-height: 1.4; }
  .super-commerce-welcome .super-hero-actions { width: 100%; }
  .super-commerce-welcome .super-hero-actions #superThemeBtn { display: none; }
  .super-commerce-welcome .super-hero-actions .primary-button { width: 100%; min-height: 48px; font-size: 14px; }
  .super-mobile-commerce .super-commerce-welcome > div:first-child { display: none; }
  .super-mobile-commerce .super-commerce-welcome { margin-bottom: 14px; }

  .super-commerce-stats { gap: 11px; }
  .super-stat-card { min-height: 119px; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; padding: 14px; border-radius: 13px; }
  .super-stat-icon { grid-column: 1; grid-row: 1; width: 42px; height: 42px; border-radius: 999px; font-size: 22px; }
  .super-stat-card strong { grid-column: 2; grid-row: 1; align-self: center; font-size: 29px; }
  .super-stat-card > span:not(.super-stat-icon) { grid-column: 1 / -1; grid-row: 3; align-self: end; font-size: 11px; line-height: 1.25; }
  .super-stat-card b { display: none; }

  .super-commerce-directory { padding: 15px; border-radius: 15px; }
  .super-directory-heading { margin: 0 0 13px; }
  .super-directory-icon { width: 38px; height: 38px; font-size: 20px; }
  .super-directory-title h3 { font-size: 19px; }
  .super-directory-title p { font-size: 11px; line-height: 1.35; }
  .super-directory-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
  .super-directory-search { grid-column: 1 / -1; min-height: 46px; }
  .super-directory-filters select { min-height: 42px; font-size: 11px; }
  .super-commerce-table-wrap { display: none; }
  .super-commerce-mobile-cards { display: grid; gap: 12px; }
  .super-commerce-mobile-card {
    display: grid;
    gap: 13px;
    padding: 14px;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 17px rgba(38, 55, 82, .05);
  }
  .super-commerce-mobile-card-head { display: flex; align-items: flex-start; gap: 11px; }
  .super-commerce-mobile-card-head .commerce-type-icon { width: 53px; height: 53px; border-radius: 999px; font-size: 28px; }
  .super-commerce-mobile-card-head > div { display: grid; min-width: 0; gap: 3px; }
  .super-commerce-mobile-card-head strong { overflow: hidden; color: #17243a; font-size: 14px; font-weight: 850; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .super-commerce-mobile-card-head small { color: #708096; font-size: 11px; font-weight: 700; }
  .super-commerce-mobile-card-head .commerce-status { width: max-content; margin-top: 2px; padding: 4px 9px; font-size: 10px; }
  .super-commerce-mobile-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; color: #52647a; font-size: 11px; font-weight: 750; }
  .super-commerce-mobile-meta span { display: flex; min-width: 0; align-items: center; gap: 6px; }
  .super-commerce-mobile-meta b { color: #607995; font-size: 14px; }
  .super-commerce-mobile-meta .super-commerce-mobile-days { grid-column: 1 / -1; color: #108657; font-weight: 850; }
  .super-commerce-mobile-days b { color: #108657; }
  .super-commerce-mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .super-commerce-mobile-actions .commerce-action { width: 100%; height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid currentColor; border-radius: 9px; font-size: 13px; font-weight: 850; }
  .super-commerce-mobile-actions .commerce-action-enter { color: #fff; border-color: #078b97; background: linear-gradient(115deg, #078b97, #08a9b0); }
  .super-commerce-mobile-actions .commerce-action-edit { color: #078b97; background: #fff; }
  .super-commerce-mobile-empty { margin: 0; padding: 22px 12px; border: 1px dashed #dce4ed; border-radius: 11px; color: #6c7d91; font-size: 12px; font-weight: 700; text-align: center; }
  .super-directory-note { margin-top: 13px; }
}

.super-hero h2,
.super-hero p {
  margin: 0;
}

.super-hero h2 {
  font-size: 24px;
}

.super-hero p {
  color: var(--muted);
}

.super-users {
  padding: 18px;
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.account-strip.business-account-summary {
  justify-content: flex-end;
}

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

.inventory-panel,
.invoice-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.inventory-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
}

.invoice-panel {
  position: sticky;
  top: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  padding: 14px;
  border-radius: 8px;
}

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

.catalog-search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.catalog-search-control input {
  min-width: 0;
}

.catalog-scan-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-transform: none;
}

.catalog-scan-icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.catalog-scan-button:hover {
  background: var(--accent-strong);
}

.catalog-invoice-scan-button {
  background: #0f6654;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.15);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 90px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 72px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.password-toggle:hover,
.password-toggle.is-visible {
  color: var(--accent-strong);
  background: #e8f4ef;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.filter-pill {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
  font-weight: 800;
}

.filter-pill.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}

.product-card {
  min-height: 256px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--theme-surface-soft);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(23, 33, 28, 0.14);
}

.product-card.is-out {
  opacity: 0.55;
}

.product-image {
  position: relative;
  min-height: 118px;
  background: var(--product-color);
  background-size: cover;
  background-position: center;
}

.product-image::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 34px;
  font-weight: 800;
}

.product-image.has-photo::after {
  display: none;
}

.product-body {
  flex: 1;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.product-name {
  min-height: 42px;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.product-category,
.product-barcode,
.stock-warning,
.empty-state {
  color: var(--muted);
  font-size: 12px;
}

.product-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-actions button {
  min-height: 36px;
  padding: 0 10px;
}

.product-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.price {
  color: var(--accent-strong);
  font-size: 19px;
  font-weight: 800;
}

.stock-warning.low {
  color: var(--warning);
}

.stock-warning.service {
  color: var(--accent-strong);
  font-weight: 800;
}

.stock-warning.out {
  color: var(--danger);
}

.invoice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-field {
  margin: 10px 0 12px;
}

.customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
}

.customer-picker input {
  min-width: 0;
  width: 100%;
}

.customer-suggestions {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #161b1a;
  box-shadow: var(--shadow);
  z-index: 4;
}

.customer-suggestions button {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  text-align: left;
}

.customer-suggestions button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.customer-suggestions span {
  color: #d7ded9;
  font-size: 12px;
}

.add-customer-button {
  min-width: 44px;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.add-customer-button.is-editing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  min-width: 78px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: #e8f4ef;
  border-color: #b8ddcf;
  font-size: 13px;
  white-space: nowrap;
}

.add-customer-button.is-editing::before {
  content: "✎";
  font-size: 16px;
  line-height: 1;
}

.add-customer-button.is-editing:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.mixed-payment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #c7e3d8;
  border-radius: 8px;
  background: #f2faf6;
}

.mixed-payment label {
  min-width: 0;
}

.mixed-payment input,
.mixed-payment select {
  min-height: 38px;
}

.mixed-payment input.is-calculated {
  background: #edf6f1;
  color: var(--accent-strong);
  font-weight: 800;
}

#mixedCreditDaysField {
  grid-column: 1 / -1;
}

.cart-list {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
  padding-right: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.cart-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.cart-detail {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.qty-control {
  display: grid;
  grid-template-columns: 32px 44px 32px;
  gap: 4px;
  align-items: center;
}

.qty-control button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 800;
}

.qty-control input {
  min-height: 32px;
  padding: 0;
  text-align: center;
}

.cart-line-total {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.totals {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.totals > div,
.tax-row {
  display: grid;
  grid-template-columns: 1fr 94px 110px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: none;
}

.totals > div {
  grid-template-columns: 1fr 110px;
}

.tax-row input {
  min-height: 34px;
  padding: 0 8px;
}

.totals strong {
  justify-self: end;
  color: var(--text);
}

.grand-total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.grand-total strong {
  color: #000;
  font-size: 22px;
}

.invoice-panel .checkout-actions button {
  min-height: 38px;
}

.print-button {
  flex: 1;
}

.product-dialog {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  max-height: min(88vh, 920px);
  overflow: hidden;
}

.product-dialog::backdrop {
  background: rgba(8, 15, 12, 0.45);
}

.barcode-scanner-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.barcode-scanner-dialog::backdrop {
  background: rgba(8, 15, 12, 0.58);
}

.barcode-scanner-body {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--panel);
}

.barcode-usb-reader { display: none; }
.barcode-scanner-dialog.is-usb-reader .barcode-usb-reader { display: grid; gap: 7px; padding: 13px; border: 1px solid #c8e4eb; border-radius: 12px; background: #f2fbfd; }
.barcode-scanner-dialog.is-usb-reader .barcode-usb-reader label { color: #16466c; font-size: 12px; font-weight: 850; text-transform: none; }
.barcode-scanner-dialog.is-usb-reader .barcode-usb-reader input { min-height: 48px; border-color: #9dcfd9; color: #17335c; background: #fff; font-size: 15px; font-weight: 750; }
.barcode-scanner-dialog.is-usb-reader .barcode-usb-reader small { color: #54708a; font-size: 12px; line-height: 1.35; }
.barcode-scanner-dialog.is-usb-reader .barcode-camera-frame,
.barcode-scanner-dialog.is-usb-reader .barcode-photo-button { display: none; }

.barcode-scanner-help,
.barcode-scanner-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.barcode-scanner-status {
  min-height: 20px;
  color: var(--accent-strong);
  font-weight: 800;
}

.barcode-camera-frame {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c1512;
}

.barcode-camera-frame video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.barcode-scan-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78%, 340px);
  height: 34%;
  transform: translate(-50%, -50%);
  border: 2px solid #80e7c7;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.barcode-scan-guide::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 10%;
  height: 3px;
  border-radius: 999px;
  background: #ffd84a;
  box-shadow: 0 0 10px #ffd84a, 0 0 22px rgba(255, 216, 74, 0.72);
  animation: barcode-scan-line 1.55s ease-in-out infinite;
}

.barcode-scan-guide.is-detected {
  border-color: #8bf0a7;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24), 0 0 22px rgba(139, 240, 167, 0.8);
}

.barcode-scan-guide.is-detected::after {
  background: #8bf0a7;
  box-shadow: 0 0 12px #8bf0a7, 0 0 26px rgba(139, 240, 167, 0.86);
  animation-play-state: paused;
  top: 50%;
}

@keyframes barcode-scan-line {
  0%, 100% { top: 10%; opacity: 0.55; }
  50% { top: 85%; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .barcode-scan-guide::after { animation: none; top: 50%; }
}

.barcode-scanner-actions {
  justify-content: space-between;
}

.barcode-photo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
}

.system-message-dialog {
  width: min(460px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.system-message-dialog::backdrop {
  background: rgba(8, 15, 12, 0.48);
}

.system-message-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  background: #fff;
}

.system-message-body .dialog-actions {
  grid-column: 1 / -1;
  margin-top: 6px;
}

.system-message-body h2,
.system-message-body p {
  margin: 0;
}

.system-message-body h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.system-message-body #systemMessageText {
  color: var(--muted);
  line-height: 1.45;
}

.system-message-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.update-available-dialog { border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 57, 86, .26); }
.update-available-dialog::backdrop { background: rgba(11, 34, 57, .48); }
.update-available-dialog .system-message-body { background: linear-gradient(145deg, #fff, #f2fbff); }
.update-available-dialog .update-available-icon { color: #fff; background: linear-gradient(135deg, #078c9e, #16aec0); box-shadow: 0 7px 15px rgba(7, 140, 158, .24); }
.update-available-dialog .dialog-actions { justify-content: flex-end; }

.onboarding-dialog::backdrop {
  background: rgba(8, 15, 12, 0.72);
}

.product-dialog form {
  padding: var(--dialog-padding);
  max-height: min(84vh, 860px);
  overflow: auto;
}

/* Alta de comercios: es un flujo administrativo completo, no un formulario
   pequeño. Se abre como superficie de trabajo y conserva siempre una salida
   visible, tanto en escritorio como en dispositivos táctiles. */
#adminDialog.commerce-admin-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  /* El escritorio usa body { zoom: .88 }; compensamos esa escala solo en
     esta vista para que realmente alcance los bordes físicos del navegador. */
  width: calc(100vw / var(--app-scale));
  width: calc(100dvw / var(--app-scale));
  height: calc(100vh / var(--app-scale));
  height: calc(100dvh / var(--app-scale));
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

#adminDialog.commerce-admin-dialog form {
  display: flex;
  min-height: 0;
  height: 100%;
  max-height: none;
  flex-direction: column;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
}

#adminDialog.commerce-admin-dialog .dialog-head {
  position: sticky;
  z-index: 3;
  top: -28px;
  margin: -28px -28px 20px;
  padding: 28px 28px 16px;
  border-bottom: 1px solid #e1ebea;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(10px);
}

#adminDialog.commerce-admin-dialog .dialog-head h2 {
  font-size: clamp(28px, 2.6vw, 40px);
}

#adminDialog.commerce-admin-dialog .dialog-head .icon-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border: 1px solid #d7e4df;
  border-radius: 12px;
  color: #123d38;
  background: #fff;
  font-size: 28px;
  font-weight: 800;
}

#adminDialog.commerce-admin-dialog .form-grid {
  width: min(1440px, 100%);
  margin: 0 auto;
  gap: 18px 22px;
}

#adminDialog.commerce-admin-dialog .user-list,
#adminDialog.commerce-admin-dialog .form-feedback,
#adminDialog.commerce-admin-dialog .admin-commerce-management {
  width: min(1440px, 100%);
  margin-inline: auto;
}

#adminDialog.commerce-admin-dialog .dialog-actions {
  position: sticky;
  z-index: 3;
  bottom: -28px;
  width: calc(100% + 56px);
  margin: 20px -28px -28px;
  padding: 16px 28px 28px;
  border-top: 1px solid #e1ebea;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(10px);
}

#adminDialog.commerce-admin-dialog .dialog-actions button {
  min-width: 132px;
  min-height: 48px;
}

/* Alta de comercio: composición administrativa por pasos. Conserva los
   controles originales, pero les da la lectura clara de la referencia. */
#adminDialog.commerce-admin-dialog { color: #101a42; background: #fff; }
#adminDialog.commerce-admin-dialog .commerce-admin-subtitle { margin: 5px 0 0; color: #60729d; font-size: 16px; font-weight: 500; }
#adminDialog.commerce-admin-dialog .commerce-admin-layout { display: grid; grid-template-columns: 274px minmax(0, 1fr); gap: 18px; width: min(1720px, 100%); margin: 0 auto; }
#adminDialog.commerce-admin-dialog .commerce-role-picker { display: grid; align-content: start; gap: 14px; }
#adminDialog.commerce-admin-dialog .commerce-role-option { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 13px; min-height: 96px; padding: 14px; border: 1px solid #d8e4f2; border-radius: 11px; color: #193160; background: linear-gradient(145deg, #f8fbff, #eef5fb); text-align: left; box-shadow: 0 4px 11px rgba(30, 63, 110, .05); }
#adminDialog.commerce-admin-dialog .commerce-role-option > span { grid-row: 1 / 3; display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid #d1dfef; border-radius: 12px; color: #102a5c; background: #fff; font-size: 29px; font-weight: 800; }
#adminDialog.commerce-admin-dialog .commerce-role-option b { align-self: end; font-size: 15px; }
#adminDialog.commerce-admin-dialog .commerce-role-option small { align-self: start; margin-top: 5px; color: #59719a; font-size: 12px; font-weight: 500; line-height: 1.4; }
#adminDialog.commerce-admin-dialog .commerce-role-option.active { border-color: transparent; color: #fff; background: linear-gradient(135deg, #087d70, #009980); box-shadow: 0 12px 23px rgba(0, 120, 105, .23); }
#adminDialog.commerce-admin-dialog .commerce-role-option.active > span { border-color: rgba(255,255,255,.55); color: #097568; background: #e2fff4; }
#adminDialog.commerce-admin-dialog .commerce-role-option.active small { color: rgba(255,255,255,.91); }
#adminDialog.commerce-admin-dialog .commerce-admin-content { display: grid; align-content: start; gap: 13px; min-width: 0; }
#adminDialog.commerce-admin-dialog .commerce-form-section { min-width: 0; padding: 16px; border: 1px solid #d8e5f3; border-radius: 12px; background: linear-gradient(145deg, #fff, #fbfdff); box-shadow: 0 4px 15px rgba(26, 60, 108, .035); }
#adminDialog.commerce-admin-dialog .commerce-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#adminDialog.commerce-admin-dialog .commerce-section-heading > span { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #087b6d; background: linear-gradient(135deg, #e5fff5, #cef8e9); font-size: 25px; font-weight: 800; }
#adminDialog.commerce-admin-dialog .commerce-section-heading h3 { margin: 0; color: #101b4a; font-size: 18px; letter-spacing: -.02em; }
#adminDialog.commerce-admin-dialog .commerce-section-heading p { margin: 3px 0 0; color: #6679a3; font-size: 13px; }
#adminDialog.commerce-admin-dialog .commerce-access-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#adminDialog.commerce-admin-dialog .commerce-section-fields { display: grid; gap: 14px; }
#adminDialog.commerce-admin-dialog .commerce-admin-content label { display: grid; min-width: 0; gap: 7px; color: #101a42; font-size: 13px; font-weight: 800; }
#adminDialog.commerce-admin-dialog .commerce-admin-content input,#adminDialog.commerce-admin-dialog .commerce-admin-content select { min-width: 0; min-height: 45px; border: 1px solid #d4e0ef; border-radius: 10px; color: #172a58; background: #fff; box-shadow: none; font-size: 14px; font-weight: 600; }
#adminDialog.commerce-admin-dialog .commerce-admin-content input:focus,#adminDialog.commerce-admin-dialog .commerce-admin-content select:focus { border-color: #0a9881; box-shadow: 0 0 0 3px rgba(10,152,129,.12); }
#adminDialog.commerce-admin-dialog .commerce-admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
#adminDialog.commerce-admin-dialog .commerce-config-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#adminDialog.commerce-admin-dialog .catalog-access-field { display: grid; gap: 6px; margin-top: 13px; }
#adminDialog.commerce-admin-dialog .catalog-access-field small { padding-left: 29px; color: #60739a; font-size: 12px; font-weight: 500; line-height: 1.35; }
#adminDialog.commerce-admin-dialog .catalog-access-field .switch-field { color: #122250; font-size: 14px; }
#adminDialog.commerce-admin-dialog .catalog-access-field .switch-field input { min-height: 20px; }
#adminDialog.commerce-admin-dialog .commerce-client-section { grid-column: auto; gap: 13px; padding: 16px; border-color: #92d9cf; border-radius: 12px; background: linear-gradient(115deg, #f6fffd, #fff); }
#adminDialog.commerce-admin-dialog .commerce-client-section legend { color: #101b4a; font-size: 18px; }
#adminDialog.commerce-admin-dialog .commerce-client-section legend span { display: inline-grid; width: 38px; height: 38px; place-items: center; margin-right: 7px; border-radius: 11px; color: #087b6d; background: #dffaf0; font-size: 21px; }
#adminDialog.commerce-admin-dialog .commerce-client-section > p { color: #61749d; font-size: 13px; }
#adminDialog.commerce-admin-dialog .commerce-client-section > label { max-width: 48%; }
#adminDialog.commerce-admin-dialog .super-office-new-client-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1040px) { #adminDialog.commerce-admin-dialog .commerce-admin-layout { grid-template-columns: 1fr; } #adminDialog.commerce-admin-dialog .commerce-role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { #adminDialog.commerce-admin-dialog .commerce-admin-subtitle { font-size: 13px; line-height: 1.35; } #adminDialog.commerce-admin-dialog .commerce-admin-layout { gap: 12px; } #adminDialog.commerce-admin-dialog .commerce-role-picker,#adminDialog.commerce-admin-dialog .commerce-admin-columns,#adminDialog.commerce-admin-dialog .commerce-access-fields,#adminDialog.commerce-admin-dialog .commerce-config-fields,#adminDialog.commerce-admin-dialog .super-office-new-client-fields { grid-template-columns: 1fr; } #adminDialog.commerce-admin-dialog .commerce-role-option { min-height: 82px; } #adminDialog.commerce-admin-dialog .commerce-role-option > span { width: 48px; height: 48px; font-size: 24px; } #adminDialog.commerce-admin-dialog .commerce-form-section,#adminDialog.commerce-admin-dialog .commerce-client-section { padding: 13px; } #adminDialog.commerce-admin-dialog .commerce-section-heading > span { width: 40px; height: 40px; font-size: 21px; } #adminDialog.commerce-admin-dialog .commerce-section-heading h3,#adminDialog.commerce-admin-dialog .commerce-client-section legend { font-size: 16px; } #adminDialog.commerce-admin-dialog .commerce-client-section > label { max-width: none; } }

/* En teléfono el formulario se lee como una secuencia de pasos, con los dos
   accesos visibles primero y las acciones siempre al alcance del pulgar. */
@media (max-width: 720px) {
  #adminDialog.commerce-admin-dialog .commerce-role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #adminDialog.commerce-admin-dialog .commerce-role-option { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 5px; min-height: 162px; padding: 12px; }
  #adminDialog.commerce-admin-dialog .commerce-role-option > span { grid-row: auto; width: 44px; height: 44px; margin-bottom: 3px; }
  #adminDialog.commerce-admin-dialog .commerce-role-option b { align-self: auto; font-size: 14px; line-height: 1.16; }
  #adminDialog.commerce-admin-dialog .commerce-role-option small { align-self: auto; margin: 0; font-size: 11px; line-height: 1.35; }
  #adminDialog.commerce-admin-dialog .commerce-form-section,#adminDialog.commerce-admin-dialog .commerce-client-section { border-width: 0 0 1px; border-radius: 0; box-shadow: none; background: #fff; }
  #adminDialog.commerce-admin-dialog .commerce-section-heading { margin-bottom: 13px; }
  #adminDialog.commerce-admin-dialog .commerce-section-heading::before { content: counter(commerce-step); display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #087b6d; background: #dcf8ee; font-size: 18px; font-weight: 900; }
  #adminDialog.commerce-admin-dialog .commerce-admin-content { counter-reset: commerce-step; gap: 0; }
  #adminDialog.commerce-admin-dialog .commerce-form-section { counter-increment: commerce-step; padding: 18px 0; }
  #adminDialog.commerce-admin-dialog .commerce-client-section { counter-increment: commerce-step; padding: 18px 0; }
  #adminDialog.commerce-admin-dialog .commerce-section-heading > span { width: 42px; height: 42px; }
  #adminDialog.commerce-admin-dialog .commerce-section-heading h3 { font-size: 17px; }
  #adminDialog.commerce-admin-dialog .commerce-section-heading p { font-size: 12px; line-height: 1.35; }
  #adminDialog.commerce-admin-dialog .commerce-client-section legend { display: flex; align-items: center; gap: 9px; padding: 0; font-size: 17px; }
  #adminDialog.commerce-admin-dialog .commerce-client-section legend::before { content: counter(commerce-step); display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #087b6d; background: #dcf8ee; font-size: 18px; font-weight: 900; }
  #adminDialog.commerce-admin-dialog .commerce-client-section legend span { width: 42px; height: 42px; margin: 0; }
  #adminDialog.commerce-admin-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
  #adminDialog.commerce-admin-dialog .dialog-actions button { width: 100%; min-height: 50px; padding: 0 8px; font-size: 12px; }
}

@media (max-width: 720px) {
  #adminDialog.commerce-admin-dialog {
    width: 100dvw;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #adminDialog.commerce-admin-dialog form {
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  #adminDialog.commerce-admin-dialog .dialog-head {
    top: -18px;
    margin: -18px -16px 16px;
    padding: calc(18px + env(safe-area-inset-top)) 16px 14px;
  }

  #adminDialog.commerce-admin-dialog .dialog-head h2 { font-size: 27px; }

  #adminDialog.commerce-admin-dialog .dialog-actions {
    bottom: calc(-18px - env(safe-area-inset-bottom));
    width: calc(100% + 32px);
    margin: 16px -16px calc(-18px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  #adminDialog.commerce-admin-dialog .dialog-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--dialog-gap);
}

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

.supplier-payment-accounts { display:grid; gap:11px; padding:14px; border:1px solid #d8e8f4; border-radius:14px; background:linear-gradient(145deg,#fbfeff,#f3f9ff); }
.supplier-payment-accounts-head h3 { margin:2px 0 3px; color:#102b52; font-size:16px; }.supplier-payment-accounts-head p { margin:0; color:#627996; font-size:12px; }
.supplier-payment-account-entry { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:9px; }.supplier-payment-account-entry label { display:grid; gap:5px; color:#385572; font-size:12px; font-weight:750; }.supplier-payment-account-entry input { min-width:0; }.supplier-payment-account-entry button { min-height:42px; white-space:nowrap; }
.supplier-payment-account-list { display:grid; gap:7px; }.supplier-payment-account { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 10px; border:1px solid #dce9f2; border-radius:10px; background:#fff; }.supplier-payment-account div { display:grid; gap:2px; min-width:0; }.supplier-payment-account strong { color:#15345b; font-size:13px; }.supplier-payment-account span { overflow:hidden; color:#607995; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }.supplier-payment-account button { width:34px; min-width:34px; height:34px; padding:0; color:#b42338; font-size:21px; }.supplier-payment-account-empty { margin:0; padding:10px; border:1px dashed #c9dbe9; border-radius:10px; color:#7087a0; font-size:12px; text-align:center; }
@media (max-width:720px) { .supplier-payment-account-entry { grid-template-columns:1fr; }.supplier-payment-account-entry button { width:100%; }.supplier-payment-accounts { padding:12px; } }

/* Proveedores se comporta como los demás módulos de trabajo: toda la pantalla
   y un único panel central desplazable, tanto en escritorio como en teléfono. */
#suppliersDialog.suppliers-dialog { border-color:#d9e9f4; background:linear-gradient(145deg,#fbfdff,#f4faff 55%,#fff); box-shadow:0 24px 65px rgba(28,77,125,.2); }
#suppliersDialog .client-directory-body { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:16px; width:100%; height:100%; min-height:0; padding:22px 26px 15px; overflow:hidden; }
#suppliersDialog .client-directory-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin:0; }
#suppliersDialog .client-directory-head h2 { margin:2px 0; color:#10245a; font-size:clamp(30px,2.8vw,42px); letter-spacing:-.045em; }
#suppliersDialog .client-directory-head .eyebrow { color:#0da88c; }
#suppliersDialog .client-directory-workspace { min-height:0; overflow:auto; padding:0 1px 2px; }
#suppliersDialog .client-directory-actions-footer { display:flex; justify-content:flex-end; margin:0; }
#suppliersDialog .client-directory-actions-footer button { min-height:42px; }
#supplierDialog[open] { position:fixed; inset:0; box-sizing:border-box; width:calc(100dvw / var(--app-scale)); min-width:calc(100dvw / var(--app-scale)); max-width:none; height:calc(100dvh / var(--app-scale)); min-height:calc(100dvh / var(--app-scale)); max-height:none; margin:0; border-radius:0; }
#supplierDialog #supplierForm { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:16px; width:100%; height:100%; min-height:0; padding:22px 26px 15px; overflow:hidden; }
#supplierDialog .form-grid { min-height:0; align-content:start; overflow:auto; overscroll-behavior:contain; padding:1px 2px 12px; }
#supplierDialog .dialog-actions { margin:0; }
@media (max-width:720px) {
  #suppliersDialog[open].suppliers-dialog { position:fixed; inset:0; width:100dvw !important; min-width:100dvw; max-width:100dvw; height:100dvh !important; max-height:100dvh; margin:0; padding:0; border:0; border-radius:0; }
  #suppliersDialog .client-directory-body { gap:13px; padding:calc(18px + env(safe-area-inset-top)) 15px calc(12px + env(safe-area-inset-bottom)); }
  #suppliersDialog .client-directory-head { align-items:center; gap:10px; }.supplier-directory-dialog .client-directory-head > div:first-child { min-width:0; flex:1; }.supplier-directory-dialog .client-directory-head h2 { font-size:28px; }.supplier-directory-dialog .client-directory-subtitle { font-size:12px; }.supplier-directory-dialog .client-directory-new { min-height:45px; padding:0 11px; font-size:12px; }.supplier-directory-dialog .client-directory-close { width:43px; min-width:43px; height:43px; font-size:27px; }
  #suppliersDialog .client-directory-workspace { padding-bottom:12px; }
  #supplierDialog[open] { width:100dvw; min-width:100dvw; height:100dvh; min-height:100dvh; margin:0; padding:0; border:0; border-radius:0; }
  #supplierDialog #supplierForm { gap:13px; padding:calc(16px + env(safe-area-inset-top)) 15px calc(12px + env(safe-area-inset-bottom)); }
  #supplierDialog .dialog-head h2 { font-size:27px; }
  #supplierDialog .form-grid { grid-template-columns:1fr; gap:10px; }
  #supplierDialog .dialog-actions { display:grid; grid-template-columns:1fr 1.3fr; gap:9px; }.supplier-payment-accounts { grid-column:1 / -1; }
}

#productTotalCost[readonly] {
  background: #f2faf6;
  color: var(--accent-strong);
  font-weight: 800;
}

.category-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.add-category-button {
  width: 44px;
  font-size: 22px;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.stock-filter { white-space: nowrap; }

.new-category-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c7e3d8;
  border-radius: 8px;
  background: #f2faf6;
}

.file-field {
  grid-column: 1 / -1;
}

.file-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

.dialog-actions {
  margin-top: 14px;
}

.dialog-actions .danger-button {
  margin-right: auto;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.receipt {
  display: none;
}

.print-dialog {
  width: min(1120px, calc(100vw - 24px));
  height: min(94vh, 980px);
  max-height: min(94vh, 980px);
}

.sales-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-height: min(88vh, 920px);
}

.print-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  padding: 18px;
  overflow: hidden;
}

.receipt-preview {
  display: block;
  width: min(820px, 100%);
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
  margin: 0 auto;
  padding: 28px 32px;
  color: #000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
  font-family: Arial, sans-serif;
}

.invoice-document {
  width: min(760px, 100%);
  margin: 0 auto;
  color: #17231e;
  background: #fff;
  font-family: Arial, sans-serif;
}

.invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 20px;
  border-bottom: 4px solid #1f8a70;
}

.invoice-business {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.invoice-business .receipt-logo {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
}

.invoice-kicker,
.invoice-identity span,
.invoice-info-grid span {
  margin: 0 0 5px;
  color: #527267;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.invoice-header h1 {
  margin: 0;
  color: #10251c;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.1;
  text-align: left;
}

.invoice-contact {
  margin: 7px 0 0;
  color: #496056;
  font-size: 11px;
  line-height: 1.45;
}

.invoice-identity {
  min-width: 142px;
  padding: 12px 14px;
  border: 1px solid #cce3d9;
  border-radius: 8px;
  background: #f1f8f5;
  text-align: right;
}

.invoice-identity span,
.invoice-identity strong,
.invoice-identity small {
  display: block;
}

.invoice-identity strong {
  color: #0b4b3b;
  font-size: 18px;
}

.invoice-identity small {
  margin-top: 5px;
  color: #4c6359;
  font-size: 10px;
  line-height: 1.35;
}

.invoice-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.invoice-info-grid > div {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid #d9e6df;
  border-radius: 7px;
  background: #fbfdfc;
}

.invoice-info-grid span,
.invoice-info-grid strong {
  display: block;
}

.invoice-info-grid strong {
  overflow-wrap: anywhere;
  color: #18261f;
  font-size: 13px;
  line-height: 1.4;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.invoice-items-table th {
  padding: 11px 10px;
  color: #fff;
  background: #16775f;
  font-size: 10px;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}

.invoice-items-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #dfe9e4;
  vertical-align: top;
}

.invoice-items-table tbody tr:nth-child(even) {
  background: #f7faf8;
}

.invoice-items-table td:first-child {
  width: 52%;
}

.invoice-items-table td small {
  display: block;
  margin-top: 3px;
  color: #62766c;
  font-size: 10px;
}

.numeric {
  text-align: right !important;
  white-space: nowrap;
}

.invoice-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 40%);
  align-items: end;
  gap: 24px;
  margin-top: 22px;
}

.invoice-thanks {
  margin: 0 0 18px;
  color: #385348;
  font-size: 13px;
  line-height: 1.55;
}

.invoice-thanks small {
  color: #71847a;
  font-size: 10px;
}

.invoice-totals {
  border: 1px solid #d4e5dc;
  border-radius: 8px;
  overflow: hidden;
}

.invoice-total-row,
.invoice-grand-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  font-size: 12px;
}

.invoice-total-row + .invoice-total-row {
  border-top: 1px solid #e3ece7;
}

.invoice-pending {
  color: #9b4a14;
}

.invoice-grand-total {
  padding: 13px;
  color: #fff;
  background: #16775f;
  font-size: 16px;
  font-weight: 800;
}

.invoice-footer {
  margin-top: 28px;
  padding-top: 11px;
  border-top: 1px solid #dfe9e4;
  color: #72867b;
  font-size: 10px;
  text-align: center;
}

.pos-document {
  display: none;
}

.print-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 4px;
}

.report-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.report-filter label {
  min-width: 0;
}

.report-filter button {
  min-height: 42px;
}

.appointments-dialog {
  width: min(1040px, calc(100vw - 28px));
}

.appointments-dialog {
  --appointments-bg-1: #f3f7fd;
  --appointments-bg-2: #dcecff;
  --appointments-ink: #11213b;
  --appointments-muted: #5d6b81;
  --appointments-line: #d9e2f0;
  --appointments-primary: #0b67d2;
  --appointments-primary-2: #2789f7;
  --appointments-success: #168f5c;
  --appointments-warning: #c67700;
  --appointments-danger: #b4232a;
}

.operation-dialog {
  width: calc(100vw - 24px);
  height: calc((100vh - 24px) / var(--app-scale));
  max-width: none;
  max-height: none;
}

.operation-dialog form,
.operation-dialog .print-dialog-body {
  height: 100%;
}

.operation-dialog form,
.operation-dialog .print-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.operation-dialog .form-grid,
.operation-dialog .purchase-form,
.operation-dialog .appointments-layout,
.operation-dialog .appointments-hero,
.operation-dialog #payablesListSection,
.operation-dialog .sales-list,
.operation-dialog .appointments-list,
.operation-dialog .sales-summary,
.operation-dialog .report-filter {
  min-height: 0;
}

.operation-dialog .form-grid,
.operation-dialog .purchase-form,
.operation-dialog .print-dialog-body {
  align-content: start;
}

.operation-dialog .form-grid,
.operation-dialog .purchase-form,
.operation-dialog #payablesListSection,
.operation-dialog .appointments-dialog-body {
  overflow: auto;
}

.operation-dialog .dialog-head {
  margin-bottom: 12px;
}

.operation-dialog .dialog-head h2 {
  font-size: 26px;
}

.operation-dialog .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
}

.operation-dialog label span,
.operation-dialog .appointments-search-panel p,
.operation-dialog .appointments-agenda-head p,
.operation-dialog .appointment-editor-helper,
.operation-dialog .appointment-meta,
.operation-dialog .appointment-notes,
.operation-dialog .appointment-whatsapp-note,
.operation-dialog .appointment-audit,
.operation-dialog .sales-summary span,
.operation-dialog .sale-row span {
  font-size: 12px;
}

.operation-dialog input,
.operation-dialog select,
.operation-dialog textarea,
.operation-dialog button {
  font-size: 14px;
}

.operation-dialog .primary-button,
.operation-dialog .secondary-button,
.operation-dialog .ghost-button,
.operation-dialog .danger-button,
.operation-dialog .icon-button {
  min-height: 36px;
}

.operation-dialog .print-dialog-body {
  padding: 16px 18px;
}

.operation-dialog .dialog-actions {
  margin-top: 12px;
}

.operation-dialog .sales-summary,
.operation-dialog .appointments-summary {
  gap: 8px;
  margin-bottom: 12px;
}

.operation-dialog .sales-summary article,
.operation-dialog .appointments-summary article {
  padding: 10px 12px;
}

.operation-dialog .sales-summary strong,
.operation-dialog .appointments-summary strong {
  font-size: 18px;
}

.operation-dialog .sales-list,
.operation-dialog .appointments-list {
  max-height: none;
  height: 100%;
}

.operation-dialog .sale-row,
.operation-dialog .appointment-item,
.operation-dialog .appointments-search-result {
  padding: 10px 12px;
}

.operation-dialog .purchase-form {
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
}

.operation-dialog .purchase-line-form {
  gap: 8px;
}

.operation-dialog .appointments-dialog-body {
  gap: 12px;
}

.operation-dialog .appointments-hero,
.operation-dialog .appointments-layout {
  gap: 12px;
}

.operation-dialog .appointment-editor-trigger {
  padding: 12px 14px;
  font-size: 18px;
}

.operation-dialog .appointment-editor-body {
  padding: 0 14px 14px;
}

.appointments-dialog-body {
  display: grid;
  gap: 14px;
  color: var(--appointments-ink);
  background: radial-gradient(circle at 10% 0%, #ffffff 0%, var(--appointments-bg-1) 45%, var(--appointments-bg-2) 100%);
}

.appointments-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, auto);
  gap: 12px;
  align-items: center;
}

.appointments-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.appointments-summary article,
.appointments-search-panel,
.appointments-agenda,
.appointment-card {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(17, 33, 59, 0.08);
}

.appointments-summary article {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
}

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

.appointments-summary strong {
  color: var(--appointments-ink);
  font-size: 16px;
  line-height: 1;
}

.appointments-search-panel {
  padding: 8px 10px;
  border: 1px solid var(--appointments-line);
  background: linear-gradient(135deg, #ffffff, #f7faff);
}

.appointments-search-panel p,
.appointments-agenda-head p,
.appointment-editor-helper,
.appointment-meta,
.appointment-notes,
.appointment-whatsapp-note,
.appointment-audit,
.appointments-search-empty,
.appointments-search-result span {
  color: var(--appointments-muted);
}

.appointments-search-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 0;
}

.appointments-search-inline-label {
  color: var(--appointments-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.appointments-search-results {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.appointments-search-empty {
  padding: 10px 12px;
  border: 1px dashed var(--appointments-line);
  border-radius: 12px;
  background: #fff;
  font-size: 11px;
}

.appointments-search-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--appointments-line);
  border-radius: 12px;
  background: #fff;
}

.appointments-search-result strong,
.appointment-title {
  display: block;
  color: #0f3f86;
}

.appointments-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 14px;
  align-items: start;
}

.appointments-layout.is-collapsed {
  grid-template-columns: 154px minmax(0, 1fr);
}

.appointment-editor {
  overflow: hidden;
  border-radius: 12px;
}

.appointment-editor[open] {
  background: transparent;
}

.appointment-editor-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--appointments-primary), var(--appointments-primary-2));
  box-shadow: 0 8px 18px rgba(11, 103, 210, 0.2);
}

.appointment-editor-trigger::-webkit-details-marker {
  display: none;
}

.appointment-editor-trigger svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.appointment-editor[open] .appointment-editor-trigger svg {
  transform: rotate(45deg);
}

.appointment-editor[open] .appointment-editor-trigger {
  background: #e8f2ff;
  color: #0f4da6;
  box-shadow: none;
}

.appointment-editor-body {
  padding: 0 16px 16px;
}

.appointment-editor-helper {
  margin: 0 0 10px;
  line-height: 1.45;
  font-size: 13px;
}

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

.appointment-form-full,
.appointment-form-actions {
  grid-column: 1 / -1;
}

.appointment-date-field,
.appointment-time-field {
  min-width: 0;
}

.appointment-service-field {
  position: relative;
}

.appointment-selected-services {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 42px;
  padding: 7px;
  border: 1px solid #d5e2ea;
  border-radius: 10px;
  background: #f7fbfc;
}

.appointment-service-empty {
  align-self: center;
  padding: 0 4px;
  color: #7890a1;
  font-size: 12px;
}

.appointment-service-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 7px 6px 10px;
  border: 1px solid #8fd8cf;
  border-radius: 999px;
  background: #e8faf6;
  color: #087768;
  font-size: 12px;
  font-weight: 800;
}

.appointment-service-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-service-chip button {
  display: grid;
  width: 24px;
  min-height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #c9f0e8;
  color: #075e55;
  font-size: 18px;
  line-height: 1;
}

.appointment-service-help {
  color: #617b8f;
  font-size: 11px;
  font-weight: 600;
}

.appointment-service-suggestions {
  position: absolute;
  z-index: 8;
  top: calc(100% - 4px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 190px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #cbd8e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(19, 43, 77, 0.18);
}

.appointment-service-suggestions button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #20314d;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.appointment-service-suggestions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.appointment-service-suggestions button strong {
  color: #0a8b7b;
  font-size: 11px;
  text-transform: uppercase;
}

.appointment-service-suggestions button:hover,
.appointment-service-suggestions button:focus-visible {
  background: #e8f5f1;
  color: #087761;
  outline: 0;
}

.appointment-form-actions {
  margin-top: 4px;
}

.appointment-form button {
  min-height: 42px;
}

.appointment-time-picker {
  display: grid;
  grid-template-columns: minmax(58px, 0.9fr) minmax(64px, 1fr) minmax(72px, 1fr);
  gap: 8px;
}

.appointment-time-picker select {
  min-width: 0;
  width: 100%;
  padding-right: 26px;
}

.appointment-time-picker select#appointmentHour {
  min-width: 58px;
}

.appointment-time-picker select#appointmentMinute {
  min-width: 64px;
}

.appointment-time-picker select#appointmentPeriod {
  min-width: 72px;
}

.appointments-agenda {
  padding: 12px;
}

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

.mobile-appointment-date-picker {
  display: none;
}

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointments-agenda-filter > .appointment-agenda-native-date,
  .appointments-agenda-filter > #appointmentAgendaBtn {
    display: none;
  }

  .appointments-agenda-filter > .mobile-appointment-date-picker {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .mobile-appointment-date-picker summary {
    display: grid;
    gap: 3px;
    min-height: 46px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
  }

  .mobile-appointment-date-picker .appointments-calendar {
    margin-top: 8px;
    padding: 8px;
  }

  .mobile-agenda-calendar-month {
    align-items: center;
    justify-content: center;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-filter .mobile-agenda-calendar-month {
    display: flex;
    gap: 4px;
    font-size: 13px;
  }

  .mobile-agenda-calendar-month select {
    min-width: 0;
    font-size: 16px;
  }
}

.appointments-agenda-filter {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.appointments-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.appointment-card-list {
  display: contents;
}

.appointment-day-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid #cde5ea;
  border-left: 4px solid #09939e;
  border-radius: 9px;
  color: #17355d;
  background: linear-gradient(100deg, #edfafa, #f8fcff);
}

.appointment-day-heading:first-child {
  margin-top: 0;
}

.appointment-day-heading strong {
  font-size: 13px;
  text-transform: capitalize;
}

.appointment-day-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #18786f;
  background: #dff8f1;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.appointments-timeline {
  display: none;
}

.appointments-agenda-head h3 {
  font-size: 22px;
  color: var(--appointments-ink);
}

.appointments-agenda-head p {
  font-size: 12px;
}

.operation-dialog .appointments-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-self: center;
}

.operation-dialog .appointments-summary article {
  min-height: 52px;
  padding: 7px 9px;
  border-radius: 10px;
}

.operation-dialog .appointments-summary strong {
  font-size: 14px;
}

.operation-dialog .appointments-summary span {
  font-size: 9px;
}

.operation-dialog .appointments-search-panel,
.operation-dialog .appointments-agenda,
.operation-dialog .appointment-card {
  padding: 10px;
}

.operation-dialog .appointment-card {
  padding: 0;
}

.operation-dialog .appointments-search-panel {
  max-width: none;
}

.operation-dialog .appointments-search-form {
  grid-template-columns: auto minmax(240px, 320px) 96px;
  gap: 8px;
}

.operation-dialog .appointments-search-results {
  max-height: 86px;
  overflow: auto;
}

.operation-dialog .appointments-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  align-items: center;
}

.operation-dialog .appointments-layout {
  grid-template-columns: 410px minmax(0, 1fr);
  min-height: 0;
}

.operation-dialog .appointments-layout.is-collapsed {
  grid-template-columns: 150px minmax(0, 1fr);
}

.operation-dialog .appointments-agenda {
  min-height: 0;
}

.operation-dialog .appointments-dialog-body {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
}

/* El administrador de personal y los depósitos son paneles que se despliegan
   antes de la agenda. La rejilla anterior les asignaba una fila limitada y la
   agenda podía dibujarse encima de su contenido al abrirlos en escritorio.
   En Citas usamos una columna flexible: los paneles abiertos conservan su
   espacio visible y la agenda ocupa únicamente el alto restante. */
.appointments-dialog.operation-dialog .appointments-dialog-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.appointments-dialog.operation-dialog .appointment-staff-manager,
.appointments-dialog.operation-dialog .appointment-deposit-manager,
.appointments-dialog.operation-dialog .appointments-search-results {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

.appointments-dialog.operation-dialog .appointment-staff-manager[open],
.appointments-dialog.operation-dialog .appointment-deposit-manager[open] {
  /* El bloque abierto es su propio área vertical de trabajo. Así se puede
     recorrer completo sin que los últimos servicios o los botones queden
     detrás de la agenda. */
  max-height: min(68vh, 660px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.appointments-dialog.operation-dialog .appointments-layout {
  flex: 1 1 auto;
  min-height: 0;
}

.operation-dialog .appointments-search-panel {
  padding: 7px 9px;
}

.operation-dialog .appointments-search-form {
  margin-top: 0;
  align-items: center;
}

.operation-dialog .appointments-search-inline-label {
  font-size: 9px;
}

.operation-dialog .appointments-search-form input,
.operation-dialog .appointments-search-form button {
  min-height: 31px;
  font-size: 13px;
}

.operation-dialog .appointments-search-form button {
  padding-inline: 10px;
}

.operation-dialog .appointments-agenda {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.operation-dialog .appointments-list {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.operation-dialog .appointment-card {
  height: 100%;
}

.operation-dialog .appointment-editor {
  height: 100%;
}

.operation-dialog .appointment-editor[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.operation-dialog .appointment-editor-body {
  overflow: auto;
}

.operation-dialog .appointment-form {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.operation-dialog .appointment-date-field,
.operation-dialog .appointment-time-field {
  min-width: 0;
}

.operation-dialog .appointment-date-field {
  grid-column: span 1;
}

.operation-dialog .appointment-time-field {
  grid-column: 1 / -1;
}

.operation-dialog .appointment-time-picker {
  grid-template-columns: minmax(84px, 1fr) minmax(92px, 1fr) minmax(98px, 1fr);
  gap: 8px;
}

.operation-dialog .appointment-time-picker select {
  min-height: 31px;
  padding-left: 8px;
  padding-right: 26px;
  font-size: 12px;
}

@media (min-height: 820px) {
  .operation-dialog {
    height: calc((100vh - 8px) / var(--app-scale));
  }

  .operation-dialog .print-dialog-body {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .operation-dialog .appointments-list {
    min-height: 320px;
  }
}

.appointment-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--appointments-line);
  border-left: 4px solid #c6d2cc;
  border-radius: 14px;
  background: #fff;
}

.appointment-item.status-pending {
  border-left-color: #94a3b8;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.appointment-item.status-active {
  border-left-color: #2789f7;
  border-color: #bad9ff;
  background: linear-gradient(135deg, #f7fbff 0%, #eaf4ff 100%);
}

.appointment-item.status-warning {
  border-left-color: #e49a13;
  border-color: #f4d7a0;
  background: linear-gradient(135deg, #fffdf7 0%, #fff4df 100%);
}

.appointment-item.status-suspended {
  border-left-color: #d73d4a;
  border-color: #f2bdc2;
  background: linear-gradient(135deg, #fffafa 0%, #fdebed 100%);
}

.appointment-item.appointment-visual-unsent {
  border-left-color: #d99000;
  border-color: #f1d38a;
  background: linear-gradient(135deg, #fffdf7 0%, #fff5da 100%);
}

.appointment-item.appointment-visual-awaiting {
  border-left-color: #1672d2;
  border-color: #b9d9fb;
  background: linear-gradient(135deg, #f7fbff 0%, #e8f3ff 100%);
}

.appointment-item.appointment-visual-confirmed {
  border-left-color: #168f5c;
  border-color: #bde5d0;
  background: linear-gradient(135deg, #f7fdf9 0%, #e8f8ef 100%);
}

.appointment-item.appointment-visual-action-needed {
  border-left-color: #c4313b;
  border-color: #f0bdc2;
  background: linear-gradient(135deg, #fffafa 0%, #fdebed 100%);
}

.appointment-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.appointment-main {
  display: grid;
  gap: 6px;
}

.appointment-meta {
  font-size: 13px;
  color: var(--appointments-muted);
}

.appointment-notes {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  color: #334155;
}

.appointment-badges,
.appointment-whatsapp {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.appointment-badges .appointment-visual-unsent,
.appointment-badges .appointment-visual-awaiting,
.appointment-badges .appointment-visual-confirmed,
.appointment-badges .appointment-visual-action-needed {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.appointment-badges .appointment-visual-unsent {
  color: #815500;
  background: #fff0c7;
}

.appointment-badges .appointment-visual-awaiting {
  color: #0755a9;
  background: #dceeff;
}

.appointment-badges .appointment-visual-confirmed {
  color: #087143;
  background: #d9f5e5;
}

.appointment-badges .appointment-visual-action-needed {
  color: #a61f2a;
  background: #fde0e2;
}

.appointment-whatsapp-note,
.appointment-audit {
  font-size: 12px;
}

.appointment-whatsapp-badge.unsent {
  background: #fde8ed;
  color: #b4233b;
}

.appointment-whatsapp-badge.sent {
  background: #d8f8e5;
  color: #08763a;
}

.appointment-whatsapp-badge.error {
  background: #fde8ea;
  color: #b4232a;
}

.appointment-reschedule {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #f0cf8b;
  border-radius: 10px;
  color: #805000;
  background: #fff8e8;
  font-size: 12px;
  line-height: 1.35;
}

.appointment-reschedule span {
  color: #6d5b35;
}

.appointment-reschedule-accept-button {
  white-space: normal;
}

.appointment-confirm-button {
  white-space: nowrap;
}

.appointment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.appointment-actions button,
.appointment-actions a {
  min-height: 34px;
  border-radius: 12px;
  font-weight: 700;
}

.appointments-dialog .secondary-button,
.appointments-dialog .ghost-button {
  border: 1px solid var(--appointments-line);
}

.appointments-dialog .primary-button {
  background: linear-gradient(135deg, var(--appointments-primary), var(--appointments-primary-2));
}

.appointments-dialog .primary-button:hover {
  background: linear-gradient(135deg, #0a5cb9, #1f7ae0);
}

.appointments-dialog .secondary-button {
  color: var(--appointments-ink);
  background: #eef4fb;
}

.appointments-dialog .ghost-button {
  color: var(--appointments-ink);
  background: #eef4fb;
}

.appointments-dialog a.secondary-button[data-whatsapp-appointment] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #128c4f, #25b967);
}

.appointments-dialog .appointment-confirm-button,
.appointments-dialog a.secondary-button[data-whatsapp-appointment] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.appointments-dialog .appointment-whatsapp-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

/* Controles de vista y salida compartidos por la agenda móvil y escritorio. */
.appointments-dialog.operation-dialog .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.appointments-dialog.operation-dialog .dialog-head .appointment-back-button {
  flex: 0 0 auto;
  margin: 0;
}

/* La salida de Citas forma parte de la cabecera: así conserva su lugar propio
   arriba a la derecha y nunca invade la fila de búsqueda. */
.appointments-dialog.operation-dialog .appointment-back-button {
  position: static;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  box-shadow: 0 5px 12px rgba(165, 35, 43, .1);
}
.appointments-dialog.operation-dialog .dialog-head { min-height: 48px; padding-right: 0; }

.appointments-dialog.operation-dialog .appointments-agenda-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.appointments-view-switcher {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(360px, 100%);
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid #dce7f2;
  border-radius: 10px;
  background: #f0f5fb;
}

.appointments-view-switcher button {
  min-height: 37px;
  border: 0;
  color: #385170;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.appointments-view-switcher button.active {
  color: #fff;
  background: linear-gradient(135deg, #078c9e, #08a9b0);
  box-shadow: 0 4px 12px rgba(7, 140, 158, .2);
}

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .dialog-head {
    align-items: center;
  }

  .appointments-dialog.operation-dialog .dialog-head h2 {
    white-space: normal;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .appointments-view-switcher {
    width: 100%;
    margin-top: 1px;
  }

  .appointments-view-switcher button {
    min-height: 44px;
    font-size: 13px;
  }
}

.appointments-dialog .status-pending {
  color: #566476;
}

.appointments-dialog .status-active {
  color: #0f4da6;
}

.appointments-dialog .status-warning {
  color: #9a5d00;
}

.appointments-dialog .status-suspended {
  color: #b4232a;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-menu {
  position: relative;
  margin: 0;
}

.status-menu > summary {
  list-style: none;
}

.status-menu > summary::-webkit-details-marker {
  display: none;
}

.status-trigger {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #b8c7da;
  border-radius: 11px;
  background: #fff;
  color: #174f91;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 63, 134, 0.08);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.status-trigger:hover {
  background: #eef5ff;
  border-color: #6fa9e9;
  transform: translateY(-1px);
}

.status-menu[open] .status-trigger {
  background: #e5f0ff;
  border-color: #2789f7;
}

.status-trigger svg {
  width: 19px;
  height: 19px;
}

.status-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 60;
  width: 205px;
  padding: 7px;
  border: 1px solid #cbd8e8;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 45, 80, 0.18);
}

.status-menu-title {
  padding: 5px 8px 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #24364d;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.status-option:hover {
  background: #f0f5fb;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a3b8;
}

.status-option-confirmada .status-dot {
  background: #2789f7;
}

.status-option-atendida .status-dot {
  background: #1d9c62;
}

.status-option-no_asistio .status-dot {
  background: #e49a13;
}

.status-option-cancelada .status-dot {
  background: #d73d4a;
}

.operation-dialog .appointment-item {
  gap: 8px;
  padding: 9px 10px;
  border-radius: 11px;
}

.operation-dialog .appointment-top {
  gap: 8px;
  align-items: flex-start;
}

.operation-dialog .appointment-main {
  gap: 4px;
}

.operation-dialog .appointment-title {
  font-size: 13px;
  line-height: 1.25;
}

.operation-dialog .appointment-meta,
.operation-dialog .appointment-notes,
.operation-dialog .appointment-whatsapp-note,
.operation-dialog .appointment-audit {
  font-size: 10.5px;
  line-height: 1.35;
}

.operation-dialog .appointment-notes {
  padding: 8px 10px;
}

.operation-dialog .appointment-actions {
  gap: 6px;
}

.operation-dialog .appointment-actions button,
.operation-dialog .appointment-actions a {
  min-height: 28px;
  padding-inline: 8px;
  font-size: 11px;
}

.operation-dialog .status-trigger {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.operation-dialog .status-trigger svg {
  width: 17px;
  height: 17px;
}

.operation-dialog .status-menu-panel {
  width: 190px;
}

.operation-dialog .status-option {
  padding: 7px 9px;
  font-size: 11.5px;
}

@media (max-width: 1180px) {
  .appointments-list,
  .operation-dialog .appointments-list {
    grid-template-columns: 1fr;
  }
}

.purchase-form {
  display: grid;
  grid-template-columns: minmax(200px, 1.35fr) minmax(170px, 1fr) minmax(170px, 0.95fr) minmax(170px, 0.95fr);
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

#purchaseCreditDaysField {
  min-width: 0;
}

.purchase-line-form,
.purchase-lines,
.purchase-form .dialog-actions {
  grid-column: 1 / -1;
}

.purchase-line-form {
  display: grid;
  grid-template-columns: minmax(240px, 2.3fr) minmax(130px, 1fr) minmax(110px, 0.9fr) 82px minmax(115px, 0.95fr) minmax(115px, 0.95fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.purchase-product-field {
  min-width: 0;
}

.purchase-qty-field {
  max-width: 84px;
}

#purchaseProductQty {
  padding-left: 10px;
  padding-right: 8px;
}

.purchase-lines {
  display: grid;
  gap: 6px;
}

.purchase-line-header,
.purchase-line-row,
.purchase-line-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 110px 110px auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.purchase-line-header {
  color: var(--muted);
  font-size: 12px;
  background: #f2faf6;
}

.purchase-line-total {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: end;
  color: var(--accent-strong);
  font-weight: 900;
}

.sales-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sales-summary article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.sales-summary span,
.sale-row span {
  color: var(--muted);
  font-size: 12px;
}

.sales-summary strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.payment-breakdown {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-breakdown div {
  display: grid;
  gap: 4px;
}

.sales-list {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.sale-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sale-row > div:first-child {
  display: grid;
  gap: 4px;
}

.sale-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sale-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.sale-actions button {
  min-height: 34px;
}

.sale-row.is-voided {
  border-color: #efcaca;
  background: #fff7f7;
}

.sale-row.is-voided > strong {
  color: #8f2525;
  text-decoration: line-through;
}

.sale-row .sale-void-history {
  display: block;
  max-width: 760px;
  color: #7b2d2d;
  line-height: 1.45;
}

.sale-void-history b {
  display: inline-flex;
  margin-right: 5px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #fff;
  background: #b52c2c;
  font-size: 10px;
  letter-spacing: .05em;
}

.invoice-void-dialog {
  width: min(560px, calc(100vw - 24px));
}

.invoice-void-warning {
  display: grid;
  gap: 5px;
  border: 1px solid #efcaca;
  border-radius: 12px;
  padding: 13px 15px;
  color: #792424;
  background: #fff4f4;
}

.invoice-void-warning span,
.invoice-void-reason small {
  color: var(--muted);
  font-size: 12px;
}

.invoice-void-reason {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.invoice-void-reason textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.invoice-void-banner {
  margin: 12px 0;
  border: 2px solid #b52c2c;
  border-radius: 10px;
  padding: 9px 12px;
  color: #7b2020;
  background: #fff2f2;
  text-align: center;
}

.invoice-void-banner strong,
.invoice-void-banner span {
  display: block;
}

.invoice-void-banner span {
  margin-top: 3px;
  font-size: 11px;
}

.receipt-brand {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 8px;
  text-align: center;
}

.receipt-brand p {
  margin: 0;
  font-size: 11px;
}

.receipt-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.receipt h1 {
  margin: 0 0 4px;
  font-size: 22px;
  text-align: center;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed #aaa;
  font-size: 12px;
}

.receipt-total {
  font-size: 16px;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .auth-screen {
    padding: 24px;
  }

  .auth-layout {
    width: min(760px, 100%);
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    gap: 24px;
    padding: 38px 42px 32px;
  }

  .auth-brand .brand-mark {
    width: 124px;
    height: 124px;
    border-width: 4px;
    border-radius: 22px;
  }

  .auth-brand h1 {
    font-size: 48px;
  }

  .auth-brand p {
    max-width: 620px;
  }

  .auth-showcase-note {
    display: none;
  }

  .auth-access {
    padding: 42px;
  }

  .appointments-hero,
  .appointments-layout {
    grid-template-columns: 1fr;
  }

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

  .appointments-agenda-head,
  .appointment-top,
  .appointments-search-result {
    display: grid;
  }

  .appointments-agenda-filter,
  .appointments-search-form {
    grid-template-columns: 1fr;
  }

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

  .top-actions {
    justify-self: stretch;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button,
  .top-actions summary {
    flex: 1;
  }

  .top-actions-menu {
    flex: 1;
  }

  .top-actions-menu-panel {
    left: 0;
    right: auto;
    min-width: min(280px, 100%);
  }

  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .invoice-panel {
    position: static;
    height: auto;
    min-height: 560px;
    overflow: visible;
  }

  .inventory-panel {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  /* En teléfono se conservan dos acciones claras en la cabecera. El resto
     permanece agrupado en Operaciones para liberar espacio sin perder acceso. */
  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .topbar-direct-action {
    display: none !important;
  }

  .top-actions-menu,
  .top-actions #logoutBtn {
    width: 100%;
    min-width: 0;
  }

  .top-actions-menu-panel {
    left: 0;
    right: auto;
    width: min(340px, calc(100dvw - 24px));
    max-height: calc(100dvh - 150px);
    overflow: auto;
    padding: 10px;
    gap: 8px;
  }

  .top-actions-menu-panel .mobile-menu-heading {
    display: block;
    margin: 6px 4px 0;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .top-actions-menu-panel .mobile-menu-shortcut {
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .auth-screen {
    align-items: flex-start;
    padding: 12px;
  }

  .auth-layout {
    border-radius: 20px;
  }

  .auth-showcase {
    gap: 14px;
    padding: 26px 22px 24px;
  }

  .auth-brand .brand-mark {
    width: 92px;
    height: 92px;
    margin-bottom: 2px;
    border-width: 3px;
    border-radius: 18px;
  }

  .auth-brand h1 {
    font-size: 38px;
    letter-spacing: -1px;
  }

  .auth-brand p {
    font-size: 14px;
    line-height: 1.5;
  }

  .auth-highlights,
  .auth-showcase-note {
    display: none;
  }

  .auth-access {
    padding: 30px 22px 34px;
  }

  .auth-card {
    gap: 18px;
  }

  .auth-card-head h2 {
    font-size: 26px;
  }

  .auth-card input,
  .auth-submit {
    min-height: 50px;
  }

  .topbar,
  .pos-layout {
    padding: 12px;
  }

  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .catalog-scan-button {
    width: 46px;
    padding: 0;
  }

  .catalog-scan-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .barcode-scanner-body {
    gap: 12px;
    padding: 16px;
  }

  .barcode-camera-frame,
  .barcode-camera-frame video {
    min-height: 240px;
  }

  .inventory-meta {
    display: grid;
  }

  .checkout-actions {
    display: grid;
  }

  .sales-summary,
  .payment-breakdown,
  .report-filter,
  .appointments-summary,
  .appointment-form,
  .purchase-form,
  .purchase-line-form,
  .purchase-line-header,
  .purchase-line-row,
  .mixed-payment,
  .sale-row {
    grid-template-columns: 1fr;
  }

  .super-hero {
    display: grid;
  }

  .super-dashboard { grid-template-columns: 1fr; padding: 10px; }
  .super-sidebar { min-height: 0; padding: 10px; }
  .super-sidebar-brand { display: none; }
  .super-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 0; gap: 6px; }
  .super-nav-button { justify-content: center; padding: 8px 4px; font-size: 12px; text-align: center; flex-direction: column; gap: 2px; }
  .super-nav-button span { height: 16px; }

  .account-strip {
    display: grid;
    padding: 10px 12px;
  }

  .appointment-time-picker,
  .appointments-agenda-filter,
  .appointments-search-form {
    grid-template-columns: 1fr;
  }

  /* Safari móvil reduce el área útil con sus barras. La vista previa debe
     mantenerse dentro del viewport dinámico y conservar las acciones visibles. */
  .print-dialog {
    width: calc(100vw - 12px);
    width: calc(100dvw - 12px);
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  .print-dialog .print-dialog-body {
    gap: 10px;
    padding: 12px;
  }

  .print-dialog .dialog-head {
    margin-bottom: 0;
  }

  .print-dialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -8px 16px rgba(20, 30, 25, 0.06);
  }

  .print-dialog .dialog-actions button {
    width: 100%;
    min-height: 44px;
  }

  .print-dialog .receipt-preview {
    padding: 18px;
    border-radius: 7px;
  }
}

@media (max-width: 620px) {
  .invoice-header,
  .invoice-bottom {
    grid-template-columns: 1fr;
  }

  .invoice-header {
    display: grid;
  }

  .invoice-identity {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .invoice-info-grid {
    grid-template-columns: 1fr;
  }

  .invoice-bottom {
    display: grid;
    gap: 4px;
  }

  .invoice-thanks {
    margin: 6px 0 16px;
  }

  .invoice-items-table {
    font-size: 11px;
  }

  .invoice-items-table th,
  .invoice-items-table td {
    padding: 9px 6px;
  }

  .invoice-items-table th:nth-child(3),
  .invoice-items-table td:nth-child(3) {
    display: none;
  }

  .invoice-items-table td:first-child {
    width: auto;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #printReceipt,
  #printReceipt * {
    visibility: visible;
  }

  #printReceipt {
    display: block;
    position: absolute;
    inset: 0;
    width: 196mm;
    min-height: auto;
    padding: 0;
    color: #000;
    background: #fff;
    font-family: Arial, sans-serif;
  }

  body.print-pos #printReceipt {
    width: 80mm;
    min-height: auto;
    padding: 6mm;
  }

  body.print-invoice #printReceipt {
    width: 196mm;
  }

  body.print-invoice #printReceipt .invoice-document {
    display: block;
    width: 100%;
  }

  body.print-invoice #printReceipt .pos-document,
  body.print-pos #printReceipt .invoice-document {
    display: none;
  }

  body.print-pos #printReceipt .pos-document {
    display: block;
  }

  body.print-invoice #printReceipt .invoice-header {
    padding-bottom: 5mm;
  }

  body.print-invoice #printReceipt .invoice-info-grid {
    margin: 5mm 0;
  }

  body.print-invoice #printReceipt .invoice-items-table {
    font-size: 10.5pt;
  }

  body.print-invoice #printReceipt .invoice-items-table th {
    padding: 3mm;
  }

  body.print-invoice #printReceipt .invoice-items-table td {
    padding: 3.2mm 3mm;
  }

  body.print-invoice #printReceipt .invoice-bottom {
    margin-top: 6mm;
  }

  body.print-invoice #printReceipt .invoice-footer {
    margin-top: 7mm;
  }

  #printReceipt h1 {
    margin: 0 0 4px;
    font-size: 22px;
    text-align: center;
  }

  #printReceipt .receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed #aaa;
    font-size: 12px;
  }

  body.print-pos #printReceipt .receipt-row {
    gap: 6px;
    font-size: 11px;
  }

  body.print-pos #printReceipt .receipt-date {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
  }

  body.print-pos #printReceipt .receipt-date strong {
    justify-self: start;
  }

  #printReceipt .receipt-total {
    font-size: 16px;
    font-weight: 800;
  }
}
.inventory-panel,
.invoice-panel {
  min-width: 0;
}

/* Punto de venta de dos paneles: en una pantalla amplia el catálogo y la
   factura se desplazan de forma independiente. La factura conserva un único
   recorrido natural: cliente, pago, artículos, totales y acciones. */
@media (min-width: 900px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 29vw, 440px);
    align-items: stretch;
    flex: 0 0 calc((100dvh - 128px) / var(--app-scale));
    height: calc((100dvh - 128px) / var(--app-scale));
    max-height: calc((100dvh - 128px) / var(--app-scale));
  }

  .inventory-panel,
  .invoice-panel {
    height: 100%;
    max-height: 100%;
    overscroll-behavior: contain;
  }

  .inventory-panel {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  .invoice-panel {
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 0;
  }
}

/* En laptops compactas se reduce únicamente el espacio decorativo. El panel
   completo de la factura conserva su desplazamiento natural. */
@media (min-width: 900px) and (max-height: 760px) {
  .invoice-panel {
    padding: 10px;
  }

  .invoice-panel .invoice-head {
    min-height: 36px;
  }

  .invoice-panel .icon-button {
    width: 36px;
    min-height: 36px;
    font-size: 21px;
  }

  .invoice-panel .customer-field {
    gap: 4px;
    margin: 6px 0 8px;
    font-size: 11px;
  }

  .invoice-panel input,
  .invoice-panel select {
    min-height: 36px;
  }

  .invoice-panel .customer-picker {
    gap: 6px;
  }

  .invoice-panel .cart-list {
    gap: 6px;
    padding-right: 3px;
  }

  .invoice-panel .cart-list .empty-state {
    padding: 14px 10px;
  }

  .invoice-panel .totals {
    gap: 5px;
    padding: 6px 0;
  }

  .invoice-panel .tax-row input {
    min-height: 30px;
  }

  .invoice-panel .grand-total {
    padding-top: 5px;
  }

  .invoice-panel .grand-total strong {
    font-size: 18px;
  }

  .invoice-panel .checkout-actions {
    gap: 6px;
  }

  .invoice-panel .checkout-actions button {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }
}

@media (max-width: 1440px), (max-height: 900px) {
  :root {
    --control-height: 38px;
    --dialog-padding: 16px;
    --dialog-gap: 14px;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 14px;
    gap: 12px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 12px;
  }

  .business-logo {
    width: 62px;
    height: 62px;
  }

  .business-identity p {
    font-size: 13px;
  }

  .product-dialog {
    width: min(780px, calc(100vw - 24px));
    max-height: 86vh;
  }

  .sales-dialog {
    width: min(920px, calc(100vw - 24px));
    max-height: 86vh;
  }

  .appointments-dialog {
    width: min(940px, calc(100vw - 24px));
  }

  .print-dialog {
    width: min(980px, calc(100vw - 20px));
    height: min(94vh, 940px);
    max-height: min(94vh, 940px);
  }

  .print-dialog-body {
    padding: 16px;
  }

  .dialog-head h2 {
    font-size: 24px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .sales-list,
  .appointments-list {
    max-height: 42vh;
  }

  .top-actions-menu-panel {
    min-width: 190px;
  }

  .operation-dialog {
    width: calc(100vw - 18px);
    height: calc((100vh - 18px) / var(--app-scale));
  }
}

@media (max-width: 1280px), (max-height: 820px) {
  .product-dialog {
    width: min(720px, calc(100vw - 20px));
  }

  .sales-dialog {
    width: min(860px, calc(100vw - 20px));
  }

  .appointments-dialog {
    width: min(880px, calc(100vw - 20px));
  }

  .print-dialog {
    width: min(920px, calc(100vw - 16px));
    height: min(95vh, 900px);
    max-height: min(95vh, 900px);
  }

  .receipt-preview {
    width: min(740px, 100%);
    padding: 22px 24px;
  }

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

  .appointments-hero,
  .appointments-layout {
    gap: 12px;
  }

  .operation-dialog {
    width: calc(100vw - 14px);
    height: calc((100vh - 14px) / var(--app-scale));
  }

  .operation-dialog .print-dialog-body,
  .operation-dialog form {
    padding: 14px;
  }

  .operation-dialog .dialog-head h2 {
    font-size: 23px;
  }
}

/* El directorio es un diálogo con lista larga. En Safari móvil necesita un
   alto explícito del viewport dinámico; de otro modo su área central queda
   transparente o fuera de la pantalla detrás del POS. */
@media (min-width: 721px) {
  /* Configuración, Caja, Ventas y Clientes son espacios de trabajo. En
     escritorio ocupan el área disponible como los módulos de Operaciones,
     con el contenido central desplazable y las acciones siempre visibles. */
  .workspace-dialog {
    width: calc(100vw - 32px);
    height: calc((100vh - 32px) / var(--app-scale));
    max-width: none;
    max-height: none;
  }

  .workspace-dialog .print-dialog-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: none;
    overflow: hidden;
  }

  #settingsDialog form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    max-height: none;
    overflow: hidden;
  }

  .workspace-dialog .sales-list,
  .workspace-dialog .sales-summary,
  #settingsDialog .form-grid {
    min-height: 0;
  }

  .workspace-dialog .sales-list {
    flex: 1 1 auto;
  }

  .workspace-dialog .dialog-head,
  .workspace-dialog .report-filter,
  .workspace-dialog .sales-summary,
  .workspace-dialog .dialog-actions {
    flex: 0 0 auto;
  }

  .workspace-dialog .sales-list,
  #settingsDialog .form-grid {
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #settingsDialog .form-grid {
    align-content: start;
    padding-right: 6px;
  }
}

.clients-dialog .print-dialog-body {
  background: #fff;
}

.form-grid-full { grid-column: 1 / -1; }
.appointments-settings {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #b9ded3;
  border-radius: 16px;
  background: linear-gradient(135deg, #f2fbf7, #fff);
}
.appointments-settings-head { display:flex; gap:16px; justify-content:space-between; align-items:flex-start; }
.public-page-switches { display:grid; gap:8px; justify-items:start; }
.catalog-access-field { align-content:start; }
.catalog-access-field small { color:var(--muted, #64748b); font-weight:500; line-height:1.35; }
.public-catalog-access-note { max-width:390px; color:#8a4b00; font-weight:600; line-height:1.35; }
.switch-field input:disabled { cursor:not-allowed; opacity:.55; }
.appointments-settings h3 { margin: 3px 0 5px; font-size: 1.1rem; }
.appointments-settings p { margin:0; color:#527068; max-width:620px; }
.switch-field { display:flex; align-items:center; gap:8px; white-space:nowrap; font-weight:700; }
.switch-field input { inline-size:20px; block-size:20px; accent-color:var(--primary, #1f8a70); }
.appointments-settings-fields { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.appointments-settings-fields label { display:grid; gap:6px; }
.appointments-settings-fields small { color:#5c6d69; font-weight:500; }
.appointment-public-link-field { display:grid; gap:6px; }
.appointment-public-link-actions { display:flex; gap:8px; align-items:stretch; min-width:0; }
.appointment-public-link-actions input { flex:1 1 auto; min-width:0; background:#fff; color:#24685a; font-weight:700; }
.appointment-public-link-actions button { flex:0 0 auto; white-space:nowrap; }
.public-contact-links { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.public-contact-links label { display:grid; gap:6px; }
.product-public-catalog-field { grid-column:1 / -1; align-items:flex-start; white-space:normal; padding:10px 12px; border:1px solid #cfe3da; border-radius:12px; background:#f5fbf8; }
.product-public-catalog-field small { display:block; color:#527068; font-weight:500; line-height:1.35; }
.service-duration-picker { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.appointment-staff-manager { margin: 14px 0; padding: 14px; border:1px solid #d4e4df; border-radius:14px; background:#f8fcfa; }
.appointment-staff-manager summary { cursor:pointer; font-weight:800; color:#176a59; }
.appointment-staff-manager > p { color:#526d66; margin:10px 0; }
.appointment-staff-workspace { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(260px,.92fr); gap:14px; align-items:stretch; }
.appointment-staff-editor-pane,
.appointment-staff-list-pane { display:flex; flex-direction:column; min-width:0; min-height:0; padding:13px; border:1px solid #d5e7e0; border-radius:12px; background:#fff; }
.appointment-staff-pane-head { flex:0 0 auto; padding-bottom:10px; margin-bottom:12px; border-bottom:1px solid #e5efeb; }
.appointment-staff-pane-head .eyebrow { margin:0 0 3px; color:#27836c; font-size:10px; }
.appointment-staff-pane-head h3 { margin:0; color:#173c35; font-size:16px; }
.appointment-staff-form { display:grid; gap:12px; min-width:0; }
.appointment-staff-form > label { display:grid; gap:6px; }
.appointment-staff-form fieldset { display:grid; min-inline-size:0; gap:4px; margin:0; border:1px solid #d4e4df; border-radius:10px; }
.appointment-staff-services { display:grid; gap:9px; padding:6px 2px 2px; }
.appointment-staff-service-options { display:grid; grid-template-columns:repeat(auto-fit, minmax(155px, 1fr)); gap:8px; }
.appointment-staff-service-options:not(.is-expanded) .appointment-staff-service-extra { display:none; }
.appointment-staff-services label { display:flex; align-items:flex-start; min-width:0; gap:6px; padding:7px 9px; background:#fff; border:1px solid #d9e8e2; border-radius:9px; }
.appointment-staff-services label span { min-width:0; overflow-wrap:anywhere; line-height:1.25; }
.appointment-staff-services-toggle { justify-self:start; min-height:34px; padding:6px 10px; color:#176a59; font-size:12px; font-weight:800; }
.appointment-staff-list { display:grid; gap:8px; min-width:0; }
.appointment-staff-item { text-align:left; display:grid; gap:3px; padding:10px; border:1px solid #d3e4df; border-radius:10px; background:#fff; cursor:pointer; }
.appointment-staff-item span { color:#557168; font-size:.9rem; }
.appointment-schedule { border-top:1px solid #d5e7e0; padding-top:12px; }
.appointment-schedule h4 { margin:0 0 4px; }.appointment-schedule p { margin:0 0 10px; color:#5a716a; }
.appointment-weekly-schedule { display:grid; gap:9px; }
.appointment-schedule-row { display:grid; grid-template-columns:minmax(128px,1fr) minmax(116px,.8fr) minmax(116px,.8fr); align-items:end; gap:10px; padding:9px 10px; border:1px solid #d5e7e0; border-radius:11px; background:#fbfefd; }
.appointment-day-toggle { display:flex; align-items:center; gap:8px; min-height:38px; font-weight:800; }
.appointment-day-toggle input { inline-size:20px; block-size:20px; accent-color:var(--primary, #1f8a70); }
.appointment-time-control { display:grid; gap:4px; color:#41655b; font-size:.78rem; font-weight:800; }
.appointment-time-control input[type="time"] { min-height:40px; padding:6px 8px; color:#143d33; background:#fff; font-size:.95rem; font-weight:750; }
.appointment-deposit { display:grid; gap:12px; padding:12px 0; border-top:1px solid #d5e7e0; }
.appointment-deposit-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.appointment-deposit-fields label { display:grid; gap:6px; }

@media (max-width: 980px) {
  .appointment-staff-workspace { grid-template-columns:1fr; }
}

@media (max-width: 560px) {
  .appointments-settings-head { flex-direction:column; }
  .appointments-settings-fields { grid-template-columns:1fr; }
  .public-contact-links { grid-template-columns:1fr; }
  .appointment-public-link-actions { flex-wrap:wrap; }
  .appointment-public-link-actions input { flex-basis:100%; }
  .appointment-public-link-actions button { flex:1 1 0; }
  .switch-field { white-space:normal; }
  .appointment-schedule-row { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; padding:12px; }
  .appointment-day-toggle { grid-column:1 / -1; }
  .appointment-time-control { font-size:.82rem; }
  .appointment-time-control input[type="time"] { min-height:46px; font-size:1rem; }
  .appointment-deposit-fields { grid-template-columns:1fr; }
}

.analytics-dialog .print-dialog-body { background: radial-gradient(circle at 100% 0, #e6f7f0 0, transparent 30%), #f5f8f7; }
@media (min-width: 721px) {
  .analytics-dialog .analytics-content { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding-right: 6px; }
}
.analytics-filter { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin: 0 0 16px; }
.analytics-filter label { display:grid; gap:6px; min-width:170px; font-weight:700; }
.analytics-filter select, .analytics-filter input { min-height:44px; }
.analytics-content { min-height:0; }
.analytics-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.analytics-kpi, .analytics-panel, .analytics-executive { background:rgba(255,255,255,.94); border:1px solid rgba(195,215,207,.9); border-radius:18px; padding:17px; box-shadow:0 12px 28px rgba(20,55,45,.08); }
.analytics-kpi span, .analytics-kpi small, .analytics-list-row small { display:block; color:#64748b; }
.analytics-kpi { position:relative; overflow:hidden; }
.analytics-kpi::after { content:""; position:absolute; right:-24px; bottom:-30px; width:76px; height:76px; border-radius:50%; background:rgba(31,138,112,.07); }
.analytics-kpi strong { display:block; position:relative; z-index:1; margin:7px 0; font-size:23px; letter-spacing:-.04em; color:#126a58; }
.analytics-kpi small { font-size:12px; line-height:1.35; }
.analytics-executive { margin:16px 0; border-left:4px solid #1f8a70; background:linear-gradient(100deg,#ffffff 0%,#effaf5 100%); }
.analytics-executive p { margin:6px 0 0; line-height:1.5; }
.analytics-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.analytics-panel h3 { margin:0; font-size:18px; letter-spacing:-.025em; color:#173c35; }
.analytics-chart-panel { position:relative; min-height:320px; overflow:hidden; }
.analytics-chart-panel::before { content:""; position:absolute; top:0; left:0; width:100%; height:4px; background:linear-gradient(90deg,#1f8a70,#59c6a5); }
.analytics-chart-feature { grid-column:span 2; background:linear-gradient(135deg,#fff 0%,#f1fbf6 100%); }
.analytics-chart-heading { display:flex; align-items:start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.analytics-chart-heading span { display:block; margin-bottom:4px; color:#27836c; font-size:10px; font-weight:900; letter-spacing:.11em; }
.analytics-chart-heading i { flex:0 0 auto; padding:6px 9px; border-radius:999px; color:#397565; background:#eaf6f0; font-size:11px; font-style:normal; font-weight:800; }
.analytics-chart-panel canvas { width:100% !important; height:252px !important; }
.analytics-bar-row { display:grid; grid-template-columns:minmax(88px,1fr) minmax(75px,2fr) auto; align-items:center; gap:8px; margin:10px 0; font-size:13px; }
.analytics-bar-row > div { height:9px; overflow:hidden; background:#e7f0ec; border-radius:99px; }
.analytics-bar-row i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#1f8a70,#4db89d); }
.analytics-spark { height:185px; display:flex; align-items:end; gap:7px; overflow-x:auto; padding:8px 2px 22px; }
.analytics-spark > div { min-width:32px; height:100%; display:flex; flex-direction:column; justify-content:end; align-items:center; gap:5px; }
.analytics-spark i { width:20px; min-height:4px; border-radius:7px 7px 2px 2px; background:linear-gradient(#269c80,#0d6c59); }
.analytics-spark span { width:52px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#64748b; font-size:10px; transform:rotate(-42deg); transform-origin:top center; }
.analytics-list-row { display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:9px 0; border-bottom:1px solid #e8efec; }
.analytics-list-row small { grid-column:1 / -1; font-size:12px; }
.analytics-empty, .analytics-notice { color:#64748b; line-height:1.5; }
.analytics-notice { margin:14px 0 0; padding:12px 14px; border-radius:10px; background:#fff8df; color:#765b13; font-size:13px; }
.analytics-movement-ranking { margin: 0 0 16px; padding: 20px; background: linear-gradient(135deg, rgba(255,255,255,.98), #f0faf6); }
.analytics-movement-ranking .analytics-chart-heading { align-items: center; }
.analytics-movement-ranking .analytics-chart-heading h3 { font-size: 21px; }
.analytics-movement-ranking .analytics-chart-heading p { max-width: 700px; margin: 5px 0 0; color: #64748b; font-size: 13px; }
.analytics-movement-table { overflow: hidden; border: 1px solid #dce9e4; border-radius: 14px; background: #fff; }
.analytics-movement-head,
.analytics-movement-row { display: grid; grid-template-columns: 76px minmax(190px, 1.5fr) minmax(130px, .8fr) minmax(160px, .9fr) minmax(120px, .7fr); gap: 14px; align-items: center; }
.analytics-movement-head { padding: 11px 15px; color: #eefcf8; background: linear-gradient(100deg, #0b6c5b, #168b74); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.analytics-movement-row { min-height: 68px; padding: 10px 15px; border-top: 1px solid #e7efec; }
.analytics-movement-row:first-of-type { border-top: 0; }
.analytics-movement-row:nth-child(odd) { background: #fbfefd; }
.analytics-movement-row > div { display: grid; gap: 3px; }
.analytics-movement-row small { color: #6b7b77; font-size: 11px; }
.analytics-movement-row strong { color: #173c35; font-size: 14px; }
.analytics-movement-row em { color: #71807c; font-size: 10px; font-style: normal; font-weight: 600; }
.analytics-movement-name strong { font-size: 15px; }
.analytics-weekly-average { padding: 8px 10px; border-radius: 9px; background: #e8f7f1; }
.analytics-weekly-average strong { color: #08715d; }
.analytics-rank { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #315d53; background: #e7f1ee; font-size: 14px; font-weight: 900; }
.analytics-rank-1 { color: #704c00; background: linear-gradient(135deg, #ffeaa1, #f4bd35); box-shadow: 0 5px 12px rgba(193,135,0,.2); }
.analytics-rank-2 { color: #53616b; background: linear-gradient(135deg, #f0f4f6, #c9d2d8); }
.analytics-rank-3 { color: #774629; background: linear-gradient(135deg, #efd0ba, #c98961); }
.analytics-ranking-note { margin: 10px 2px 0; color: #687873; font-size: 11px; line-height: 1.45; }

@media (max-width: 900px) {
  .analytics-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .analytics-movement-head { display: none; }
  .analytics-movement-row { grid-template-columns: 42px minmax(0, 1.5fr) minmax(120px, .8fr); gap: 9px; }
  .analytics-movement-row > div:nth-of-type(2),
  .analytics-movement-row > div:nth-of-type(4) { display: none; }
}

@media (max-width: 520px) {
  .analytics-dialog { width:calc(100dvw - 12px); height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); margin:6px auto; }
  .analytics-dialog .print-dialog-body { display:block; overflow-y:auto; padding:14px 12px calc(14px + env(safe-area-inset-bottom)); }
  .analytics-filter { display:grid; grid-template-columns:1fr; }
  .analytics-filter label, .analytics-filter button { width:100%; }
  .analytics-kpis { gap:8px; }
  .analytics-kpi { padding:11px; }
  .analytics-kpi strong { font-size:18px; }
  .analytics-grid { grid-template-columns:1fr; gap:10px; }
  .analytics-panel { padding:14px; border-radius:16px; }
  .analytics-chart-feature { grid-column:auto; }
  .analytics-chart-panel { min-height:278px; }
  .analytics-chart-panel canvas { height:218px !important; }
  .analytics-chart-heading h3 { font-size:17px; }
  .analytics-movement-ranking { padding: 14px; }
  .analytics-movement-ranking .analytics-chart-heading { align-items: flex-start; }
  .analytics-movement-ranking .analytics-chart-heading i { white-space: nowrap; }
  .analytics-movement-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 10px; }
  .analytics-movement-row > div:nth-of-type(2),
  .analytics-movement-row > div:nth-of-type(4) { display: grid; }
  .analytics-movement-row > div:nth-of-type(2) { grid-column: 2; }
  .analytics-movement-row > div:nth-of-type(3) { grid-column: 2; }
  .analytics-movement-row > div:nth-of-type(4) { display: none; }
  .analytics-weekly-average { margin-top: 3px; }
  .analytics-rank { width: 30px; height: 30px; }
}

#clientDeleteConfirmationDialog {
  width: min(500px, calc(100vw - 28px));
}

#clientDeleteConfirmationDialog .print-dialog-body {
  display: block;
  height: auto;
  padding: 22px;
  overflow: visible;
  background: #fff;
}

#anonymousSaleConfirmationDialog {
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  background: #fff;
}

#anonymousSaleConfirmationDialog .print-dialog-body {
  display: block;
  height: auto;
  max-height: calc(100dvh - 28px);
  padding: 22px;
  overflow: auto;
  background: #fff;
}

#anonymousSaleConfirmationDialog .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.receivable-payment-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  background: #fff;
}

.receivable-payment-dialog form,
.payment-receipt-body {
  display: block;
  max-height: calc(100dvh - 28px);
  padding: 22px;
  overflow: auto;
  background: #fff;
}

.receivable-payment-summary,
.payment-receipt-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.receivable-payment-summary > div,
.payment-receipt-card > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbf9;
}

.receivable-payment-summary span,
.payment-receipt-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receivable-payment-summary strong,
.payment-receipt-card strong {
  color: #000;
  font-size: 16px;
}

.receivable-payment-dialog label {
  display: grid;
  gap: 7px;
  color: #000;
  font-weight: 800;
}

.form-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  color: #b42318;
  font-weight: 700;
}

.payment-receipt-card .payment-receipt-total {
  background: #e8f4ef;
  border-color: #b8daca;
}

.payment-receipt-card .payment-receipt-balance {
  background: #fff7e8;
  border-color: #f2d195;
}

.payment-receipt-card .payment-receipt-balance strong {
  color: #965100;
}

.payment-receipt-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.receivable-payment-dialog form .dialog-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.collection-row {
  border-color: #b8daca;
  background: #f1faf5;
}

.collection-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: #146b48;
  background: #dff3e8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#clientDeleteConfirmationDialog .dialog-head {
  margin-bottom: 10px;
}

#clientDeleteConfirmationDialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

#clientDeleteConfirmationDialog .dialog-actions {
  margin: 18px 0 0;
}

@media (max-width: 720px) {
  /* Base para confirmaciones y formularios: ningún cuadro queda cortado por
     las barras dinámicas de Safari ni usa un fondo transparente. */
  .product-dialog:not(.print-dialog):not(.clients-dialog) {
    width: calc(100vw - 16px);
    width: calc(100dvw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 8px auto;
    background: #fff;
  }

  .product-dialog:not(.print-dialog):not(.clients-dialog) form {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
    overscroll-behavior: contain;
  }

  .product-dialog button,
  .system-message-dialog button {
    min-height: 44px;
  }

  .product-dialog .icon-button {
    min-width: 44px;
  }

  .system-message-dialog {
    width: calc(100vw - 24px);
    width: calc(100dvw - 24px);
    max-height: calc(100dvh - 24px);
    margin: 12px auto;
  }

  .system-message-body {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 18px;
  }

  .system-message-icon {
    width: 40px;
    height: 40px;
  }

  .clients-dialog {
    width: calc(100vw - 12px);
    width: calc(100dvw - 12px);
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  .clients-dialog .print-dialog-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    height: 100%;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .clients-dialog .print-dialog-body > :nth-child(2) {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .clients-dialog .sales-list {
    max-height: none;
    overflow: visible;
  }

  .clients-dialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  .clients-dialog .dialog-actions button {
    width: 100%;
    min-height: 44px;
  }

  #clientDeleteConfirmationDialog {
    width: calc(100vw - 28px);
    width: calc(100dvw - 28px);
    max-width: 460px;
  }

  #clientDeleteConfirmationDialog .print-dialog-body {
    display: block;
    height: auto;
    max-height: calc(100dvh - 28px);
    padding: 20px;
    overflow: auto;
  }

  #anonymousSaleConfirmationDialog {
    width: calc(100vw - 24px);
    width: calc(100dvw - 24px);
    margin: 12px auto;
  }

  #anonymousSaleConfirmationDialog .print-dialog-body {
    padding: 20px;
  }

  .receivable-payment-dialog {
    width: calc(100vw - 24px);
    width: calc(100dvw - 24px);
    max-height: calc(100dvh - 24px);
    margin: 12px auto;
  }

  .receivable-payment-dialog form,
  .payment-receipt-body {
    max-height: calc(100dvh - 24px);
    padding: 20px;
  }

  .receivable-payment-summary,
  .payment-receipt-card,
  .payment-receipt-actions,
  .receivable-payment-dialog form .dialog-actions {
    grid-template-columns: 1fr;
  }

  .payment-receipt-actions button {
    width: 100%;
    min-height: 46px;
  }

  .receivable-payment-dialog form .dialog-actions button {
    width: 100%;
    min-height: 46px;
  }

  #anonymousSaleConfirmationDialog .dialog-actions button {
    width: 100%;
    min-height: 46px;
  }

  #clientDeleteConfirmationDialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #clientDeleteConfirmationDialog .dialog-actions button {
    width: 100%;
    min-height: 46px;
  }

  /* Listas y reportes usan toda el área disponible, con encabezado y
     acciones fijas. Las citas y proveedores mantienen su rejilla propia. */
  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) {
    width: calc(100vw - 12px);
    width: calc(100dvw - 12px);
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .print-dialog-body {
    display: block;
    gap: 10px;
    height: 100%;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .dialog-head,
  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .report-filter,
  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-summary,
  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-list {
    margin-bottom: 12px;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-summary article {
    gap: 3px;
    padding: 9px 10px;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-summary strong {
    font-size: 16px;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .payment-breakdown {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .sales-list {
    max-height: none;
    overflow: visible;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  .sales-dialog:not(.clients-dialog):not(.print-dialog):not(.appointments-dialog):not(#payablesDialog) .dialog-actions button {
    width: 100%;
    min-height: 44px;
  }

  .operation-dialog,
  .appointments-dialog {
    width: calc(100vw - 12px);
    width: calc(100dvw - 12px);
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  .operation-dialog .print-dialog-body,
  .operation-dialog form {
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
  }

  /* La agenda móvil es una secuencia vertical: resumen, búsqueda, editor
     desplegable y día seleccionado. Ningún mínimo de escritorio puede forzar
     desplazamiento horizontal en Safari, Android o iPhone. */
  .appointments-dialog.operation-dialog .appointments-dialog-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    overflow: hidden;
  }

  /* En teléfono la razón de abrir este módulo es ver la agenda, no los
     contadores. La agenda pasa al primer bloque útil y las herramientas de
     búsqueda/registro continúan disponibles más abajo. */
  .appointments-dialog.operation-dialog .dialog-head {
    gap: 10px;
    margin-bottom: 0;
  }

  .appointments-dialog.operation-dialog .dialog-head h2 {
    font-size: 22px;
    line-height: 1.1;
  }

  .appointments-dialog.operation-dialog .dialog-head .eyebrow {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .appointments-dialog.operation-dialog .dialog-head .icon-button {
    width: 40px;
    min-height: 40px;
    font-size: 22px;
  }

  .appointments-dialog.operation-dialog .appointments-hero,
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .appointments-dialog.operation-dialog .appointments-hero {
    display: contents;
  }

  .appointments-dialog.operation-dialog .appointments-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
    order: 3;
  }

  .appointments-dialog.operation-dialog .appointments-summary article {
    min-height: 42px;
    padding: 5px 6px;
    gap: 2px;
    border-radius: 9px;
    box-shadow: none;
  }

  .appointments-dialog.operation-dialog .appointments-summary span {
    font-size: 8px;
    line-height: 1.05;
    letter-spacing: 0;
  }

  .appointments-dialog.operation-dialog .appointments-summary strong {
    font-size: 16px;
    line-height: 1;
  }

  .appointments-dialog.operation-dialog .appointments-summary article:last-child {
    border-color: rgba(22, 143, 92, 0.28);
    background: #f1fbf6;
  }

  .appointments-dialog.operation-dialog .appointments-search-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .appointments-dialog.operation-dialog .appointments-search-inline-label {
    grid-column: 1 / -1;
  }

  .appointments-dialog.operation-dialog .appointments-search-inline-label {
    font-size: 10px;
  }

  .appointments-dialog.operation-dialog .appointments-search-form input,
  .appointments-dialog.operation-dialog .appointments-search-form button {
    min-height: 40px;
    font-size: 14px;
  }

  .appointments-dialog.operation-dialog .appointments-search-form button {
    min-width: 86px;
    padding-inline: 10px;
  }

  .appointments-dialog.operation-dialog .appointments-search-panel {
    order: 4;
  }

  .appointments-dialog.operation-dialog .appointments-search-results {
    flex: 0 0 auto;
    max-height: 150px;
    order: 5;
  }

  .appointments-dialog.operation-dialog .appointments-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
    order: 1;
  }

  .appointments-dialog.operation-dialog .appointment-card,
  .appointments-dialog.operation-dialog .appointment-editor,
  .appointments-dialog.operation-dialog .appointments-agenda {
    height: auto;
    min-height: 0;
  }

  .appointments-dialog.operation-dialog .appointments-agenda {
    order: 1;
    width: 100%;
  }

  .appointments-dialog.operation-dialog .appointment-card {
    order: 0;
    flex: 0 0 auto;
    width: 100%;
  }

  .appointments-dialog.operation-dialog .appointment-editor-body {
    overflow: visible;
  }

  .appointments-dialog.operation-dialog .appointment-form,
  .appointments-dialog.operation-dialog .appointment-time-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .appointments-dialog.operation-dialog .appointment-time-picker select,
  .appointments-dialog.operation-dialog .appointment-time-picker select#appointmentHour,
  .appointments-dialog.operation-dialog .appointment-time-picker select#appointmentMinute,
  .appointments-dialog.operation-dialog .appointment-time-picker select#appointmentPeriod {
    min-width: 0;
    min-height: 44px;
    font-size: 15px;
  }

  .appointments-dialog.operation-dialog .appointment-service-suggestions {
    z-index: 12;
    max-height: min(220px, 32dvh);
  }

  .appointments-dialog.operation-dialog .appointment-service-suggestions button {
    min-height: 44px;
    font-size: 15px;
  }

  .appointments-dialog.operation-dialog .appointment-selected-services {
    min-height: 48px;
    padding: 8px;
  }

  .appointments-dialog.operation-dialog .appointment-service-chip {
    max-width: 100%;
    min-height: 38px;
    padding-left: 12px;
    font-size: 14px;
  }

  .appointments-dialog.operation-dialog .appointment-service-chip button {
    width: 28px;
    min-height: 28px;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-head {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-head h3 {
    font-size: 18px;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-head p {
    display: none;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .appointments-dialog.operation-dialog .appointments-agenda-filter button,
  .appointments-dialog.operation-dialog .appointments-agenda-filter input {
    min-height: 40px;
  }

  .appointments-dialog.operation-dialog .appointments-list {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .appointments-dialog.operation-dialog .appointment-card-list {
    display: none;
  }

  .appointments-dialog.operation-dialog .appointments-timeline {
    display: grid;
    gap: 5px;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 7px 9px;
    border: 1px solid var(--appointments-line);
    border-left: 4px solid #9aaac1;
    border-radius: 10px;
    color: var(--appointments-ink);
    background: #fff;
    text-align: left;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.is-available {
    border-left-color: #d6e0ec;
    color: #6d7b8e;
    background: #fbfcfe;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.is-occupied {
    border-left-color: #d99000;
    color: #73521a;
    background: #fff9e9;
    cursor: default;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.is-occupied .appointment-slot-status {
    color: #986200;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.status-active {
    border-left-color: var(--appointments-primary);
    background: #f4f9ff;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.status-warning {
    border-left-color: var(--appointments-warning);
    background: #fffaf0;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.status-suspended {
    border-left-color: var(--appointments-danger);
    background: #fff7f7;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.appointment-visual-unsent {
    border-left-color: #d99000;
    background: #fff9e9;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.appointment-visual-awaiting {
    border-left-color: #1672d2;
    background: #f1f8ff;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.appointment-visual-confirmed {
    border-left-color: #168f5c;
    background: #f0fbf5;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.appointment-visual-action-needed {
    border-left-color: #c4313b;
    background: #fff4f4;
  }

  .appointments-dialog.operation-dialog .appointment-time-slot.is-selected {
    border-color: var(--appointments-primary);
    box-shadow: 0 0 0 2px rgba(11, 103, 210, 0.12);
  }

  .appointments-dialog.operation-dialog .appointment-slot-time {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .appointments-dialog.operation-dialog .appointment-slot-client {
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .appointments-dialog.operation-dialog .appointment-slot-status {
    color: var(--appointments-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: right;
  }

  .appointments-dialog.operation-dialog .appointment-visual-unsent .appointment-slot-status {
    color: #986200;
  }

  .appointments-dialog.operation-dialog .appointment-visual-awaiting .appointment-slot-status {
    color: #0755a9;
  }

  .appointments-dialog.operation-dialog .appointment-visual-confirmed .appointment-slot-status {
    color: #087143;
  }

  .appointments-dialog.operation-dialog .appointment-visual-action-needed .appointment-slot-status {
    color: #a61f2a;
  }

  .appointments-dialog.operation-dialog .appointment-slot-add {
    color: var(--appointments-primary);
    font-size: 22px;
    font-weight: 500;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-detail {
    display: grid;
    gap: 10px;
    margin: -1px 6px 4px 12px;
    padding: 11px;
    border: 1px solid #c9d9ed;
    border-radius: 0 0 11px 11px;
    color: var(--appointments-ink);
    background: #f7fbff;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-detail > div:first-child {
    display: grid;
    gap: 3px;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-detail strong {
    font-size: 15px;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-detail span,
  .appointments-dialog.operation-dialog .appointment-timeline-detail p {
    margin: 0;
    color: var(--appointments-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .appointments-dialog.operation-dialog .appointment-timeline-actions button,
  .appointments-dialog.operation-dialog .appointment-timeline-actions a {
    display: grid;
    width: 100%;
    min-height: 40px;
    padding-inline: 7px;
    place-items: center;
    font-size: 11px;
    text-align: center;
  }

  .appointments-dialog.operation-dialog .appointment-item {
    padding: 12px;
  }

  .appointments-dialog.operation-dialog .appointment-title {
    font-size: 15px;
  }

  .appointments-dialog.operation-dialog .appointment-meta,
  .appointments-dialog.operation-dialog .appointment-notes,
  .appointments-dialog.operation-dialog .appointment-whatsapp-note,
  .appointments-dialog.operation-dialog .appointment-audit {
    font-size: 12px;
  }

  .appointments-dialog.operation-dialog .appointment-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointments-dialog.operation-dialog .appointment-actions button,
  .appointments-dialog.operation-dialog .appointment-actions a {
    width: 100%;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .appointments-dialog.operation-dialog .status-menu {
    width: 100%;
  }

  .appointments-dialog.operation-dialog .status-trigger {
    width: 100%;
    height: 44px;
  }

  .appointments-dialog.operation-dialog .status-menu-panel {
    width: min(250px, calc(100dvw - 44px));
  }

  .appointments-dialog.operation-dialog .appointments-dialog-body > .dialog-actions {
    flex: 0 0 auto;
    margin: 0;
    order: 6;
  }
}

/* Entrada de inventario: la rejilla de escritorio tenía cuatro columnas y,
   en el iPhone 12 mini, comprimía “No. factura” y “Fecha” hasta montarlas.
   En móvil el formulario se comporta como una secuencia vertical táctil. */
@media (max-width: 680px) {
  #payablesDialog.operation-dialog {
    width: calc(100dvw - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 10px auto;
  }

  #payablesDialog.operation-dialog .print-dialog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
  }

  #payablesDialog.operation-dialog .purchase-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #payablesDialog.operation-dialog .purchase-form > label,
  #payablesDialog.operation-dialog .purchase-line-form,
  #payablesDialog.operation-dialog .purchase-lines,
  #payablesDialog.operation-dialog .purchase-form .dialog-actions {
    grid-column: 1;
    min-width: 0;
  }

  #payablesDialog.operation-dialog .purchase-line-form {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 12px;
  }

  #payablesDialog.operation-dialog .purchase-qty-field {
    max-width: none;
  }

  #payablesDialog.operation-dialog .purchase-form .dialog-actions {
    padding-top: 10px;
    background: #fbfdfb;
  }
}

/* La definición final de acceso va al final para prevalecer sobre las reglas
   responsivas históricas del resto de módulos. */
.auth-screen { min-height: 100vh; padding: clamp(24px, 3.1vw, 40px); background: linear-gradient(135deg, #e9f8fa 0%, #f8fbfc 50%, #eaf3f9 100%); }
.auth-layout { width: min(1200px, 100%); min-height: min(774px, calc(100vh - 80px)); grid-template-columns: minmax(0, 1.58fr) minmax(405px, 1fr); border: 0; border-radius: 25px; background: #fff; box-shadow: 0 24px 65px rgba(8, 52, 70, .17); }
.auth-showcase { min-height: 0; padding: clamp(46px, 4.7vw, 70px) clamp(38px, 4.1vw, 58px) 43px; background: linear-gradient(90deg, rgba(0, 46, 64, .97) 0%, rgba(1, 61, 79, .88) 42%, rgba(0, 39, 55, .40) 100%), url("img/jpsistema-login-hero.png") center / cover no-repeat; }
.auth-showcase::after { display: none; }.auth-brand { gap: 13px; }.auth-brand .brand-mark { width: clamp(142px, 13vw, 190px); height: clamp(142px, 13vw, 190px); margin-bottom: 13px; padding: 8px; border: 0; border-radius: 25px; background: #fff; box-shadow: 0 17px 35px rgba(0, 14, 25, .27); }.auth-brand h1 { font-size: clamp(46px, 4.6vw, 65px); letter-spacing: -2.6px; }.auth-brand h1 span { color: #10d7f2; }.auth-brand .auth-kicker { padding: 8px 15px; border-radius: 999px; color: #d9fbff; background: rgba(19, 159, 181, .38); box-shadow: inset 0 0 0 1px rgba(126, 240, 255, .18); font-size: 11px; letter-spacing: 1.35px; }.auth-brand p { max-width: 472px; color: rgba(241, 251, 255, .89); font-size: 17px; line-height: 1.48; }
.auth-highlights { gap: 14px; }.auth-highlights article { min-height: 178px; align-content: start; gap: 9px; padding: 20px 17px; border-color: rgba(161, 238, 255, .2); border-radius: 17px; background: rgba(3, 42, 59, .45); box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }.auth-highlights span { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 2px; border-radius: 12px; color: #16b75c; background: #c9ffde; font-size: 28px; line-height: 1; }.auth-highlights article:nth-child(2) span { color: #1687dc; background: #d7ecff; }.auth-highlights article:nth-child(3) span { color: #ff7b22; background: #ffe0c9; }.auth-highlights strong { font-size: 15px; }.auth-highlights small { color: rgba(238, 249, 252, .79); font-size: 12px; line-height: 1.42; }.auth-showcase-note { display: flex; align-items: center; gap: 13px; margin: -14px 0 0; color: rgba(228, 247, 252, .74); font-size: 12px; }.auth-showcase-note i { width: 36px; height: 4px; flex: 0 0 auto; border-radius: 999px; background: #12d4ed; }
.auth-access { position: relative; overflow: hidden; padding: clamp(45px, 5.4vw, 76px) clamp(34px, 4.3vw, 62px) 36px; background: linear-gradient(145deg, #fff 0%, #fff 72%, #edfaff 100%); }.auth-access::after { content: ""; position: absolute; right: -70px; bottom: -105px; width: 380px; height: 220px; border-radius: 52% 0 0; background: radial-gradient(ellipse at 45% 0%, rgba(71, 211, 231, .25), transparent 63%); pointer-events: none; }.auth-card { position: relative; z-index: 1; width: min(365px, 100%); gap: 20px; }.auth-card-head { gap: 5px; }.auth-card .eyebrow { color: #048ea2; font-size: 11px; letter-spacing: .8px; }.auth-card-head h2 { color: #10203c; font-size: 37px; letter-spacing: -.055em; }.auth-card-head p:last-child { max-width: 325px; color: #75859e; font-size: 15px; line-height: 1.42; }.auth-card .auth-form { gap: 16px; }.auth-card .auth-form label { display: grid; gap: 7px; }.auth-card .auth-form label > span { color: #17243d; font-size: 11px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }.auth-input-wrap,.auth-card .password-field { position: relative; display: block; }.auth-card input { width: 100%; min-height: 51px; padding: 0 48px; border: 1px solid #d8e0eb; border-radius: 11px; color: #20314c; background: #fafcff; box-shadow: none; font-size: 14px; }.auth-card input:focus { border-color: #0aa5b7; box-shadow: 0 0 0 3px rgba(0, 165, 183, .12); }.auth-card input::placeholder { color: #8c9ab0; }.auth-input-icon { position: absolute; z-index: 1; top: 50%; left: 16px; transform: translateY(-50%); color: #5d7090; font-size: 23px; font-style: normal; line-height: 1; pointer-events: none; }.auth-card .password-field input { padding-right: 48px; }.auth-card .password-toggle { z-index: 2; right: 8px; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 0; color: #5d7090; background: transparent; box-shadow: none; font-size: 0; }.auth-card .password-toggle::after { content: "◉"; font-size: 17px; line-height: 1; }.auth-card .password-toggle:hover,.auth-card .password-toggle.is-visible { color: #078fa0; background: #e5fbfd; }.auth-submit { min-height: 54px; margin-top: 3px; border-radius: 10px; background: linear-gradient(100deg, #008a9e, #06a7b9); box-shadow: 0 10px 20px rgba(0, 141, 158, .22); font-size: 16px; }.auth-submit::before { content: "➜"; display: inline-block; margin-right: 11px; color: #bdf5f8; font-size: 25px; line-height: 0; vertical-align: -2px; }.auth-support { gap: 13px; padding: 13px 15px; border: 0; border-radius: 11px; background: linear-gradient(100deg, #e1fbf3, #effcf8); }.auth-support span { width: 32px; height: 32px; flex-basis: 32px; background: #10bd72; font-size: 17px; }.auth-support p { color: #188055; font-size: 12px; line-height: 1.35; }.auth-note { padding-top: 15px; border-top: 1px solid #e2e7ee; color: #8090a6; font-size: 11px; text-align: center; }.auth-footer-brand { display: flex; align-items: center; justify-content: center; gap: 7px; color: #102e52; font-size: 17px; font-weight: 800; text-align: left; }.auth-footer-brand img { width: 31px; height: 31px; object-fit: contain; }.auth-footer-brand strong { color: #028ca1; }.auth-footer-brand small { display: block; margin-top: 1px; color: #718098; font-size: 7px; font-weight: 700; }

@media (max-width: 1080px) and (min-width: 721px) { .auth-layout { width: min(720px, 100%); grid-template-columns: 1fr; }.auth-showcase { min-height: 510px; }.auth-access { padding: 48px 36px; } }
@media (max-width: 720px) { .auth-screen { display: block; min-height: 100svh; padding: 0; background: #06384d; }.auth-layout { width: 100%; min-height: 100svh; display: block; overflow: visible; border-radius: 0; background: transparent; box-shadow: none; }.auth-showcase { min-height: 675px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 54px 30px 48px; background: linear-gradient(90deg, rgba(0, 42, 59, .95), rgba(0, 52, 70, .52)), url("img/jpsistema-login-hero.png") 61% center / auto 100% no-repeat; }.auth-brand { gap: 10px; }.auth-brand .brand-mark { width: 148px; height: 148px; margin-bottom: 7px; padding: 7px; border-radius: 22px; }.auth-brand .auth-kicker { padding: 7px 12px; font-size: 9px; letter-spacing: 1px; }.auth-brand h1 { font-size: 43px; letter-spacing: -1.8px; }.auth-brand p { max-width: 290px; font-size: 16px; line-height: 1.45; }.auth-highlights { display: grid; gap: 9px; }.auth-highlights article { min-height: 152px; gap: 7px; padding: 13px 11px; border-radius: 14px; }.auth-highlights span { width: 39px; height: 39px; border-radius: 10px; font-size: 24px; }.auth-highlights strong { font-size: 12px; }.auth-highlights small { font-size: 10px; line-height: 1.3; }.auth-showcase-note { display: flex; margin: -3px 0 0; font-size: 10px; }.auth-showcase-note i { width: 31px; }.auth-access { min-height: 0; margin: -35px 13px 0; padding: 30px 22px 31px; border-radius: 23px 23px 0 0; background: linear-gradient(150deg, #fff, #f5fcff); }.auth-access::after { width: 280px; height: 150px; right: -80px; bottom: -70px; }.auth-card { gap: 17px; width: 100%; }.auth-card-head h2 { font-size: 32px; }.auth-card-head p:last-child { font-size: 14px; }.auth-card .auth-form { gap: 14px; }.auth-card input { min-height: 50px; }.auth-submit { min-height: 54px; }.auth-note { padding-top: 13px; }.auth-footer-brand { padding-top: 1px; } }

/* Laptops compactas: se usa el alto real del viewport, no una altura fija.
   Así la pantalla de acceso cabe completa desde equipos de 12 pulgadas. */
@media (min-width: 721px) and (max-height: 820px) {
  .auth-screen { align-items: flex-start; padding: 7px clamp(14px, 3.5vw, 52px); }
  .auth-layout { height: calc(100vh - 14px); min-height: 0; max-height: calc(100vh - 14px); }
  .auth-showcase { gap: 15px; padding: clamp(22px, 3.1vh, 34px) clamp(28px, 4vw, 54px) 18px; }
  .auth-brand { gap: 7px; }.auth-brand .brand-mark { width: clamp(96px, 10vw, 130px); height: clamp(96px, 10vw, 130px); margin-bottom: 5px; padding: 5px; border-radius: 18px; }.auth-brand .auth-kicker { padding: 6px 11px; font-size: 9px; }.auth-brand h1 { font-size: clamp(37px, 4vw, 54px); line-height: 1; }.auth-brand p { max-width: 440px; font-size: clamp(13px, 1.45vw, 16px); line-height: 1.38; }
  .auth-highlights { gap: 10px; }.auth-highlights article { min-height: 126px; gap: 5px; padding: 12px 13px; border-radius: 14px; }.auth-highlights span { width: 36px; height: 36px; border-radius: 10px; font-size: 22px; }.auth-highlights strong { font-size: 13px; }.auth-highlights small { font-size: 10px; line-height: 1.25; }.auth-showcase-note { margin: 0; font-size: 10px; }
  .auth-access { padding: clamp(24px, 4vh, 40px) clamp(28px, 4vw, 54px) 17px; }.auth-card { gap: 12px; }.auth-card-head { gap: 2px; }.auth-card .eyebrow { font-size: 9px; }.auth-card-head h2 { font-size: clamp(28px, 3.1vw, 35px); }.auth-card-head p:last-child { font-size: 13px; line-height: 1.3; }.auth-card .auth-form { gap: 9px; }.auth-card .auth-form label { gap: 4px; }.auth-card .auth-form label > span { font-size: 9px; }.auth-card input { min-height: 44px; font-size: 13px; }.auth-submit { min-height: 46px; font-size: 14px; }.auth-submit::before { font-size: 20px; }.auth-support { padding: 9px 11px; }.auth-support span { width: 27px; height: 27px; flex-basis: 27px; font-size: 14px; }.auth-support p { font-size: 10px; }.auth-note { padding-top: 9px; font-size: 9px; }.auth-footer-brand { font-size: 14px; }.auth-footer-brand img { width: 25px; height: 25px; }.auth-footer-brand small { font-size: 6px; }
}

/* El texto mantiene explícita la acción y queda centrado verticalmente. */
.auth-card .password-field input { padding-right: 70px; }
.auth-card .password-toggle {
  top: 50%;
  right: 8px;
  width: 54px;
  min-width: 54px;
  height: 36px;
  transform: translateY(-50%);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.auth-card .password-toggle::after { content: none; }

/* Salir pertenece a la navegación del superusuario y no a la cabecera. */
.super-mode .super-nav { display: flex; flex: 1; flex-direction: column; }
.super-mode .super-nav-logout { margin-top: auto; color: #d5f3fa; }
.super-mode .super-nav-logout span { color: #bdeefa; }
.super-mode .super-nav-logout:hover { color: #fff; background: rgba(8,169,176,.26); }

/* En escritorio la cabecera del superusuario no contiene acciones ni datos:
   se elimina para entregar ese alto completo al panel administrativo. */
@media (min-width: 721px) {
  .super-mode .topbar { display: none; }
  .super-mode .super-dashboard {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .super-mode .super-sidebar {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .super-mode .super-main-content {
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 720px) {
  .super-mode .super-nav { display: grid; flex: 0 0 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .super-mode .super-nav-logout { margin-top: 0; color: #687b93; }
  .super-mode .super-nav-logout span { color: currentColor; }
}

/* Comercio: aprovecha el alto recuperado al ocultar la antigua franja de
   cuenta; el catálogo y la factura llenan la ventana hasta su borde inferior. */
@media (min-width: 900px) {
  .app-shell:not(.super-mode) .pos-layout {
    flex: 0 0 calc((100dvh - 78px) / var(--app-scale));
    height: calc((100dvh - 78px) / var(--app-scale));
    max-height: calc((100dvh - 78px) / var(--app-scale));
  }
}

.app-shell:not(.super-mode) .commerce-logout-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #40536e;
  border-color: #dce7f0;
  background: #fff;
}
.app-shell:not(.super-mode) .commerce-logout-button:hover { color: #0b7f95; border-color: #a9dbe4; background: #effbfc; }

@media (max-width: 720px) {
  .app-shell:not(.super-mode) .commerce-logout-button { display: none; }
}

/* Punto de venta: misma familia visual contemporánea de Administración,
   conservando los controles y la lógica original del comercio. */
.app-shell:not(.super-mode) {
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 255, 255, .42), transparent 28%),
    linear-gradient(135deg, var(--app-background) 0%, var(--theme-surface-soft) 54%, var(--app-background) 100%);
}

.app-shell:not(.super-mode) .topbar {
  grid-template-columns: minmax(190px, .72fr) minmax(245px, 1.05fr) auto;
  min-height: 78px;
  padding: 10px 18px;
  border-bottom-color: #e3ecf4;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 16px rgba(42, 87, 117, .06);
}

.app-shell:not(.super-mode) .brand { gap: 10px; }
.app-shell:not(.super-mode) .brand-mark {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #e6fbff, #f5f8ff);
  box-shadow: 0 7px 16px rgba(34, 118, 153, .11);
}
.app-shell:not(.super-mode) .brand h1 { color: #122447; font-size: 20px; letter-spacing: -.02em; }
.app-shell:not(.super-mode) .business-identity {
  justify-content: flex-start;
  gap: 11px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid #dce8f2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(42, 87, 117, .05);
  text-align: left;
}
.app-shell:not(.super-mode) .business-logo {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #10213e;
}
.app-shell:not(.super-mode) .business-identity p {
  display: grid;
  overflow: hidden;
  color: #172449;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
}
.app-shell:not(.super-mode) .business-identity p strong,
.app-shell:not(.super-mode) .business-identity p small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell:not(.super-mode) .business-identity p small { color: #72839b; font-size: 11px; font-weight: 700; }
.app-shell:not(.super-mode) .top-actions { flex-wrap: nowrap; gap: 8px; }
.mobile-business-avatar { display: none; }
.app-shell:not(.super-mode) #settingsBtn { display: none; }
.app-shell:not(.super-mode) #mobileSettingsBtn { display: flex; }
.app-shell:not(.super-mode) .top-actions > button,
.app-shell:not(.super-mode) .top-actions-menu > summary {
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid #e0eaf3;
  border-radius: 9px;
  color: #172449;
  background: #f7fbff;
  box-shadow: 0 3px 9px rgba(43, 80, 116, .04);
  font-size: 12px;
}
.app-shell:not(.super-mode) #cashRegisterBtn {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(115deg, #078c9e, #07a6b3);
  box-shadow: 0 8px 17px rgba(7, 148, 165, .22);
}
.app-shell:not(.super-mode) .topbar-nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-shell:not(.super-mode) #cashRegisterBtn::before,
.app-shell:not(.super-mode) #salesReportBtn::before,
.app-shell:not(.super-mode) #clientsBtn::before,
.app-shell:not(.super-mode) #appointmentsBtn::before { content: none; }
.app-shell:not(.super-mode) #settingsBtn::before { content: "⚙"; margin-right: 7px; font-size: 17px; }
.app-shell:not(.super-mode) .top-actions-menu summary::before { content: "⚙"; font-size: 17px; }
.app-shell:not(.super-mode) .top-actions-menu-panel {
  min-width: 228px;
  padding: 9px;
  border-color: #dce8f2;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(19, 55, 84, .17);
}
.app-shell:not(.super-mode) .top-actions-menu-panel button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 39px;
  padding-left: 11px;
  border: 0;
  color: #17335c;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -.01em;
}
.app-shell:not(.super-mode) .top-actions-menu-panel button:hover { color: #087e9b; background: #edfafe; }
.app-shell:not(.super-mode) .operation-menu-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: #087d9c;
  font-family: Inter, system-ui, sans-serif;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}
.app-shell:not(.super-mode) svg.operation-menu-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-shell:not(.super-mode) #newProductBtn .operation-menu-icon { color: #0491a5; }
.app-shell:not(.super-mode) #accountsReceivableBtn .operation-menu-icon { color: #087dad; }
.app-shell:not(.super-mode) #accountsPayableBtn .operation-menu-icon { color: #236dae; }
.app-shell:not(.super-mode) #inventoryEntryBtn .operation-menu-icon { color: #2474b9; }
.app-shell:not(.super-mode) #analyticsBtn .operation-menu-icon { color: #127ca7; }
.app-shell:not(.super-mode) .account-strip { display: none; }

.app-shell:not(.super-mode) .pos-layout {
  gap: 15px;
  padding: 15px;
}
.app-shell:not(.super-mode) .inventory-panel,
.app-shell:not(.super-mode) .invoice-panel {
  border: 1px solid #e0ebf4;
  border-radius: 16px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 12px 30px rgba(35, 85, 120, .08);
}
.app-shell:not(.super-mode) .inventory-panel { padding: 16px; }
.app-shell:not(.super-mode) .catalog-search-control { gap: 10px; }
.app-shell:not(.super-mode) .search-box > span:first-child { display: none; }
.app-shell:not(.super-mode) .catalog-search-control input {
  min-height: 45px;
  border-color: #d7e4ef;
  border-radius: 10px;
  background: #fbfdff;
}
.app-shell:not(.super-mode) .catalog-search-control input::placeholder { color: #7185a1; }
.app-shell:not(.super-mode) .catalog-scan-button {
  min-height: 45px;
  border-color: #9bd4df;
  border-radius: 9px;
  color: #16325a;
  background: #fff;
}
.app-shell:not(.super-mode) .catalog-invoice-scan-button {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(115deg, #078c9e, #07a6b3);
}
.app-shell:not(.super-mode) .filters { gap: 9px; margin: 15px 0 12px; }
.app-shell:not(.super-mode) .filter-pill {
  min-height: 37px;
  padding: 0 17px;
  border: 0;
  color: #33476d;
  background: #edf5ff;
  box-shadow: none;
}
.app-shell:not(.super-mode) .filter-pill.active {
  color: #fff;
  background: linear-gradient(115deg, #078c9e, #07a6b3);
  box-shadow: 0 6px 14px rgba(7, 148, 165, .18);
}
.app-shell:not(.super-mode) .inventory-meta { margin: 8px 0 13px; color: #172449; font-size: 12px; }
.app-shell:not(.super-mode) .inventory-meta span { color: #516a87; }
.catalog-view-controls { display: none; }
.app-shell:not(.super-mode) .product-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.app-shell:not(.super-mode) .product-card {
  min-height: 0;
  border: 1px solid #e4edf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(31, 75, 111, .06);
}
.app-shell:not(.super-mode) .product-image { min-height: 104px; margin: 9px 9px 0; border-radius: 8px; }
.app-shell:not(.super-mode) .product-body { gap: 8px; padding: 9px; }
.app-shell:not(.super-mode) .product-name { min-height: 0; color: #172449; font-size: 13px; line-height: 1.18; }
.app-shell:not(.super-mode) .product-category,
.app-shell:not(.super-mode) .product-barcode { color: #71829a; font-size: 11px; line-height: 1.25; }
.app-shell:not(.super-mode) .price { color: #07879b; font-size: 17px; }
.app-shell:not(.super-mode) .stock-warning.service { padding: 3px 7px; border-radius: 5px; color: #087d99; background: #e2f7ff; font-size: 10px; }
.app-shell:not(.super-mode) .product-actions { grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; }
.app-shell:not(.super-mode) .product-actions button { min-height: 38px; border-radius: 7px; }
.app-shell:not(.super-mode) .add-product-btn { color: #fff; border-color: transparent; background: linear-gradient(115deg, #078c9e, #07a6b3); }
.app-shell:not(.super-mode) .add-product-btn::before { content: "⌑"; margin-right: 7px; font-size: 17px; }
.app-shell:not(.super-mode) .edit-product-btn { padding: 0; border-color: #dbe7f2; color: #142850; font-size: 24px; line-height: 1; }

.app-shell:not(.super-mode) .invoice-panel { padding: 15px; }
.app-shell:not(.super-mode) .invoice-head { padding-bottom: 10px; border-bottom: 1px solid #e7eff6; }
.app-shell:not(.super-mode) .invoice-head h2 { color: #13264b; font-size: 22px; }
.app-shell:not(.super-mode) .invoice-head h2.is-pending { max-width: 250px; color: #5d7190; font-size: 14px; line-height: 1.25; letter-spacing: 0; }
.app-shell:not(.super-mode) .invoice-head .eyebrow { color: #077f96; font-size: 10px; }
.invoice-head-actions { display: flex; align-items: center; gap: 7px; }
.mobile-invoice-toggle { display: none; }
.app-shell:not(.super-mode) .customer-field { color: #1f3559; font-size: 11px; }
.app-shell:not(.super-mode) .customer-field input,
.app-shell:not(.super-mode) .customer-field select { min-height: 40px; border-color: #d9e6f0; border-radius: 8px; background: #fff; }
.app-shell:not(.super-mode) .cart-list .empty-state { padding: 26px 11px; border-color: #cce9f2; border-radius: 10px; color: #657b98; background: #f4fbff; }
.app-shell:not(.super-mode) .grand-total { margin-top: 3px; padding: 12px 10px; border: 0; border-radius: 8px; color: #087b91; background: linear-gradient(100deg, #dcf7ff, #eaf8ff); }
.app-shell:not(.super-mode) .grand-total strong { color: #13264b; font-size: 25px; }
.app-shell:not(.super-mode) .checkout-actions { gap: 9px; }
.app-shell:not(.super-mode) .checkout-actions button { min-height: 45px; border-radius: 8px; }
.app-shell:not(.super-mode) #holdSaleBtn { color: #15294e; border-color: #d7e4ef; background: #f9fcff; }
.app-shell:not(.super-mode) #holdSaleBtn::before { content: "Ⅱ"; margin-right: 7px; font-weight: 900; }
.app-shell:not(.super-mode) .print-button { background: linear-gradient(115deg, #078c9e, #07a6b3); box-shadow: 0 8px 17px rgba(7, 148, 165, .16); }
.app-shell:not(.super-mode) .print-button::before { content: "▤"; margin-right: 7px; font-size: 17px; }

@media (max-width: 1200px) and (min-width: 721px) {
  .app-shell:not(.super-mode) .topbar { grid-template-columns: 164px minmax(210px, 1fr) auto; padding-inline: 12px; gap: 9px; }
  .app-shell:not(.super-mode) .brand h1 { font-size: 17px; }
  .app-shell:not(.super-mode) .brand-mark { width: 46px; height: 46px; }
  .app-shell:not(.super-mode) .top-actions { gap: 5px; }
  .app-shell:not(.super-mode) .top-actions > button,
  .app-shell:not(.super-mode) .top-actions-menu > summary { padding-inline: 8px; font-size: 11px; }
  .app-shell:not(.super-mode) .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .app-shell:not(.super-mode) .product-image { min-height: 88px; }
}

@media (min-width: 721px) {
  /* En computadora la pistola USB escribe directamente en el buscador o en
     el lector continuo de facturación; no hace falta mostrar la cámara. */
  .app-shell:not(.super-mode) #barcodeScannerBtn { display: none; }
  .app-shell:not(.super-mode) .catalog-search-control { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 720px) {
  .app-shell:not(.super-mode) { min-height: 100dvh; padding-bottom: 0; }
  .app-shell:not(.super-mode) .topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 10px;
    min-height: 0;
    padding: 10px 13px;
  }
  .app-shell:not(.super-mode) .brand { gap: 8px; }
  .app-shell:not(.super-mode) .brand-mark { width: 42px; height: 42px; border-radius: 10px; }
  .app-shell:not(.super-mode) .brand h1 { font-size: 20px; }
  .app-shell:not(.super-mode) .business-identity {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 55px;
    padding: 8px 10px;
  }
  .app-shell:not(.super-mode) .business-logo { width: 39px; height: 39px; }
  .app-shell:not(.super-mode) .business-identity p { font-size: 13px; }
  .app-shell:not(.super-mode) .top-actions { grid-column: 2; grid-row: 1; display: flex; gap: 8px; justify-content: flex-end; }
  .app-shell:not(.super-mode) .mobile-business-avatar:not(.hidden) { display: block; width: 38px; height: 38px; border-radius: 999px; object-fit: cover; border: 2px solid #fff; box-shadow: 0 3px 9px rgba(32, 73, 109, .15); }
  .app-shell:not(.super-mode) .topbar-direct-action { display: none !important; }
  /* Citas es un acceso prioritario: queda siempre a la vista en teléfono y
     conserva el contador rojo cuando existen pendientes. */
  .app-shell:not(.super-mode) #appointmentsBtn.topbar-direct-action:not(.hidden),
  .app-shell:not(.super-mode) #cashRegisterBtn.topbar-direct-action:not(.hidden) { display: inline-flex !important; }
  .app-shell:not(.super-mode) #cashRegisterBtn,
  .app-shell:not(.super-mode) #appointmentsBtn,
  .app-shell:not(.super-mode) .top-actions-menu > summary {
    width: 45px;
    min-width: 45px;
    min-height: 43px;
    padding: 0;
    font-size: 0;
  }
  .app-shell:not(.super-mode) #cashRegisterBtn::before,
  .app-shell:not(.super-mode) .top-actions-menu summary::before { margin: 0; font-size: 22px; }
  .app-shell:not(.super-mode) #cashRegisterBtn .topbar-nav-icon,
  .app-shell:not(.super-mode) #appointmentsBtn .topbar-nav-icon { width: 22px; height: 22px; flex-basis: 22px; }
  .app-shell:not(.super-mode) #appointmentsBtn > span:not(.appointment-notification-badge) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .app-shell:not(.super-mode) #appointmentsBtn .appointment-notification-badge { top: -7px; right: -7px; }
  .app-shell:not(.super-mode) .top-actions-menu summary::before { content: "☰"; }
  .app-shell:not(.super-mode) .top-actions-menu summary::after { display: none; }
  .app-shell:not(.super-mode) .top-actions-menu-panel { position: fixed; top: 65px; right: 13px; left: auto; width: min(282px, calc(100dvw - 26px)); max-height: calc(100dvh - 84px); padding: 10px; }
  .app-shell:not(.super-mode) .top-actions-menu-panel button { min-height: 46px; padding-left: 13px; font-size: 14px; font-weight: 800; }
  .app-shell:not(.super-mode) .top-actions-menu-panel .operation-menu-icon { width: 26px; height: 26px; flex-basis: 26px; font-size: 22px; }
  .app-shell:not(.super-mode) .top-actions-menu-panel .mobile-menu-heading { display: none; }
  .app-shell:not(.super-mode) .pos-layout { display: block; height: auto; padding: 10px 12px 0; overflow: visible; }
  .app-shell:not(.super-mode) .inventory-panel { overflow: visible; padding: 12px; border-radius: 14px; }
  .app-shell:not(.super-mode) .toolbar .search-box { position: relative; }
  .app-shell:not(.super-mode) .catalog-search-control { position: relative; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .app-shell:not(.super-mode) .toolbar .search-box::before { content: "⌕"; position: absolute; z-index: 1; top: 13px; left: 14px; color: #1b3b68; font-size: 25px; font-weight: 700; line-height: 1; pointer-events: none; }
  .app-shell:not(.super-mode) .catalog-search-control input { min-height: 47px; }
  .app-shell:not(.super-mode) .catalog-search-control input { padding-left: 47px; }
  .app-shell:not(.super-mode) .catalog-scan-button { width: auto; min-height: 45px; padding: 0 14px; font-size: 13px; }
  .app-shell:not(.super-mode) .catalog-invoice-scan-button { font-size: 10.5px; letter-spacing: -.02em; }
  .app-shell:not(.super-mode) .catalog-scan-button > span:last-child { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .app-shell:not(.super-mode) .catalog-search-control .catalog-scan-button { display: inline-flex; width: calc(50% - 4px); }
  .app-shell:not(.super-mode) .catalog-search-control { display: flex; flex-wrap: wrap; }
  .app-shell:not(.super-mode) .catalog-search-control input { flex: 1 0 100%; }
  .app-shell:not(.super-mode) .filters { gap: 8px; margin: 13px 0; }
  .app-shell:not(.super-mode) .filter-pill { min-height: 39px; padding: 0 16px; font-size: 12px; }
  .app-shell:not(.super-mode) .inventory-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .app-shell:not(.super-mode) .inventory-meta span { display: none; }
  .app-shell:not(.super-mode) .catalog-view-controls { display: flex; gap: 7px; }
  .app-shell:not(.super-mode) .catalog-view-button { display: grid; width: 39px; height: 39px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #1b3b68; background: #edf5ff; }
  .app-shell:not(.super-mode) .catalog-view-button.active { color: #fff; background: linear-gradient(115deg, #078c9e, #07a6b3); box-shadow: 0 6px 14px rgba(7, 148, 165, .18); }
  .app-shell:not(.super-mode) .catalog-view-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .app-shell:not(.super-mode) .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .app-shell:not(.super-mode) .product-grid.is-list-view { grid-template-columns: 1fr; }
  .app-shell:not(.super-mode) .product-grid.is-list-view .product-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); }
  .app-shell:not(.super-mode) .product-grid.is-list-view .product-image { min-height: 0; height: auto; margin: 8px; }
  .app-shell:not(.super-mode) .product-grid.is-list-view .product-body { padding-left: 3px; }
  .app-shell:not(.super-mode) .product-image { min-height: 110px; margin: 8px 8px 0; }
  .app-shell:not(.super-mode) .product-body { gap: 7px; padding: 9px; }
  .app-shell:not(.super-mode) .product-name { font-size: 13px; }
  .app-shell:not(.super-mode) .price { font-size: 16px; }
  .app-shell:not(.super-mode) .product-actions { grid-template-columns: minmax(0, 1fr) 40px; }

  /* La factura forma parte del flujo vertical del catálogo. Antes se fijaba
     sobre la pantalla y, al abrirse, dejaba una capa translúcida sobre los
     productos. Así siempre queda después del último producto. */
  .app-shell:not(.super-mode) .invoice-panel {
    position: static;
    z-index: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-top: 12px;
    padding: 12px;
    overflow: visible;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(35, 85, 120, .08);
  }
  .app-shell:not(.super-mode) .invoice-panel .invoice-head { min-height: 39px; padding-bottom: 6px; border: 0; }
  .app-shell:not(.super-mode) .invoice-panel .invoice-head h2 { font-size: 19px; }
  .app-shell:not(.super-mode) .invoice-panel .invoice-head .eyebrow { font-size: 9px; }
  .mobile-invoice-toggle { display: none; }
  .app-shell:not(.super-mode) .invoice-panel #clearCartBtn { display: inline-flex; }
  .app-shell:not(.super-mode) .invoice-panel .totals { gap: 6px; padding: 8px 0; border: 0; }
  .app-shell:not(.super-mode) .invoice-panel .grand-total { margin: 3px 0 0; padding: 10px; border-radius: 8px; background: linear-gradient(100deg, #dcf7ff, #eaf8ff); }
  .app-shell:not(.super-mode) .invoice-panel .grand-total span { font-size: 15px; font-weight: 850; }
  .app-shell:not(.super-mode) .invoice-panel .grand-total strong { font-size: 23px; }
  .app-shell:not(.super-mode) .invoice-panel .checkout-actions { display: grid; grid-template-columns: .88fr 1.12fr; gap: 8px; }
  .app-shell:not(.super-mode) .invoice-panel .checkout-actions button { min-height: 44px; padding-inline: 8px; font-size: 12px; }
  .app-shell:not(.super-mode) .invoice-panel.is-mobile-expanded .customer-field { margin: 7px 0; }
  .app-shell:not(.super-mode) .invoice-panel.is-mobile-expanded .cart-list { margin: 5px 0; }
}

/* Se deja al final para que el acceso de salida prevalezca sobre la apariencia
   común de los demás accesos de la barra superior. */
.app-shell:not(.super-mode) .commerce-logout-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #40536e;
  border-color: #dce7f0;
  background: #fff;
}
.app-shell:not(.super-mode) .commerce-logout-button:hover { color: #0b7f95; border-color: #a9dbe4; background: #effbfc; }
@media (max-width: 720px) { .app-shell:not(.super-mode) .commerce-logout-button { display: none; } }

/* Menú móvil del comercio: todos los accesos comparten la misma alineación y
   la salida permanece disponible dentro del panel. */
@media (max-width: 720px) {
  .app-shell:not(.super-mode) .top-actions-menu-panel button,
  .app-shell:not(.super-mode) .top-actions-menu-panel .mobile-menu-shortcut {
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
  }
  .app-shell:not(.super-mode) .top-actions-menu-panel .mobile-menu-logout {
    display: flex;
    margin-top: 4px;
    color: #a32626;
    border-color: #f0caca;
    background: #fff7f7;
  }
  .app-shell.cashier-mode:not(.super-mode) .commerce-logout-button {
    display: inline-flex;
    width: 45px;
    min-width: 45px;
    min-height: 43px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }
  .app-shell.cashier-mode:not(.super-mode) .commerce-logout-button .topbar-nav-icon {
    width: 22px;
    height: 22px;
  }
}

/* Agenda de citas: misma familia visual clara de los módulos modernos, sin
   alterar los formularios, filtros, estados ni acciones existentes. */
.appointments-dialog.operation-dialog {
  color: #14274b;
  border: 1px solid #dceaf4;
  background: linear-gradient(135deg, #f9fdff 0%, #eef8ff 100%);
  box-shadow: 0 24px 68px rgba(23, 68, 107, .2);
}
.appointments-dialog.operation-dialog .appointments-dialog-body {
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at 8% 3%, rgba(55, 206, 221, .12), transparent 24%),
    linear-gradient(135deg, #f8fcff, #eef7ff);
}
.appointments-dialog.operation-dialog .dialog-head {
  padding: 2px 4px 4px;
}
.appointments-dialog.operation-dialog .dialog-head .eyebrow {
  color: #07899b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
}
.appointments-dialog.operation-dialog .dialog-head h2 {
  color: #122755;
  font-size: clamp(24px, 2vw, 31px);
  letter-spacing: -.035em;
}
.appointments-dialog.operation-dialog .dialog-head .icon-button {
  border-color: #d7e6f2;
  color: #264369;
  background: #fff;
}
.appointments-dialog.operation-dialog .appointments-hero {
  grid-template-columns: minmax(0, 1fr) minmax(285px, 350px);
  gap: 12px;
}
.appointments-dialog.operation-dialog .appointments-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.appointments-dialog.operation-dialog .appointments-summary article {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e4edf5;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 7px 18px rgba(29, 80, 122, .06);
}
.appointments-dialog.operation-dialog .appointments-summary article > div { display: grid; gap: 2px; }
.appointments-dialog.operation-dialog .appointments-summary span:not(.appointment-summary-icon) { color: #70829e; font-size: 10px; font-weight: 750; }
.appointments-dialog.operation-dialog .appointments-summary strong { color: #122755; font-size: 23px; line-height: 1; }
.appointment-summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #078da1;
  background: #ddf7fb;
  font-size: 21px;
  font-weight: 900;
}
.appointment-summary-icon svg {
  width: 19px;
  height: 19px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.appointment-summary-pending .appointment-summary-icon { color: #e79413; background: #fff1d8; }
.appointment-summary-confirmed .appointment-summary-icon { color: #0da163; background: #dcfae9; }
.appointment-summary-today .appointment-summary-icon { color: #2788c7; background: #e2f1ff; }
.appointments-dialog.operation-dialog .appointments-search-panel {
  padding: 0;
  border: 0;
  background: transparent;
}
.appointments-dialog.operation-dialog .appointments-search-form {
  position: relative;
  grid-template-columns: minmax(0,1fr) 84px;
  gap: 7px;
  align-items: end;
}
.appointments-dialog.operation-dialog .appointments-search-inline-label { display: none; }
.appointments-dialog.operation-dialog .appointments-search-form input,
.appointments-dialog.operation-dialog .appointments-search-form button {
  min-height: 47px;
  border-radius: 10px;
  font-size: 12px;
}
.appointments-dialog.operation-dialog .appointments-search-form input {
  padding-left: 38px;
  border-color: #d8e5f0;
  background: #fff;
}
.appointments-dialog.operation-dialog .appointments-search-form::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  margin: 13px 0 0 13px;
  color: #1a3968;
  font-size: 22px;
  font-weight: 800;
  pointer-events: none;
}
.appointments-dialog.operation-dialog .appointments-search-form button { color: #17355d; border-color: #dce8f1; background: #f8fbff; font-weight: 850; }
.appointments-dialog.operation-dialog .appointment-staff-manager,
.appointments-dialog.operation-dialog .appointment-deposit-manager {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cce8e5;
  border-radius: 10px;
  background: rgba(241, 253, 251, .87);
}
.appointments-dialog.operation-dialog .appointment-deposit-manager { border-color: #d9e7f7; background: rgba(245, 249, 255, .9); }
.appointments-dialog.operation-dialog .appointment-staff-manager > summary,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary {
  min-height: 35px;
  padding: 9px 13px;
  color: #177866;
  font-size: 12px;
  font-weight: 850;
}
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary { color: #234d82; }
.appointments-dialog.operation-dialog .appointment-staff-manager > summary::before,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary::before { content: "▸"; margin-right: 7px; }
.appointments-dialog.operation-dialog .appointments-layout,
.appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
  grid-template-columns: minmax(185px, 225px) minmax(0, 1fr);
  gap: 12px;
}
.appointments-dialog.operation-dialog .appointment-card,
.appointments-dialog.operation-dialog .appointments-agenda {
  border: 1px solid #e0eaf3;
  border-radius: 13px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 8px 19px rgba(29, 80, 122, .05);
}
.appointments-dialog.operation-dialog .appointment-card { padding: 10px; }
.appointments-dialog.operation-dialog .appointment-editor { height: auto; }
.appointments-dialog.operation-dialog .appointment-editor-trigger {
  min-height: 45px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(112deg, #068a9d, #119dcc);
  box-shadow: 0 8px 16px rgba(7, 139, 157, .2);
  font-size: 13px;
  font-weight: 850;
}
.appointments-dialog.operation-dialog .appointment-editor-trigger::before { content: "+"; margin-right: 7px; font-size: 23px; font-weight: 400; vertical-align: -2px; }
.appointments-dialog.operation-dialog .appointment-editor-trigger svg { display: none; }
.appointments-dialog.operation-dialog .appointment-editor-body { margin-top: 10px; }
.appointments-dialog.operation-dialog .appointments-agenda { padding: 14px; }
.appointments-dialog.operation-dialog .appointments-agenda-head { align-items: center; margin-bottom: 11px; }
.appointments-dialog.operation-dialog .appointments-agenda-head h3 { color: #122755; font-size: 19px; letter-spacing: -.02em; }
.appointments-dialog.operation-dialog .appointments-agenda-head p { color: #7b8fa8; font-size: 11px; }
.appointments-dialog.operation-dialog .appointments-agenda-filter label { display: grid; gap: 4px; color: #627793; font-size: 9px; font-weight: 800; }
.appointments-dialog.operation-dialog .appointments-agenda-filter input,
.appointments-dialog.operation-dialog .appointments-agenda-filter button { min-height: 37px; border-radius: 8px; font-size: 11px; }
.appointments-dialog.operation-dialog .appointments-list { grid-template-columns: 1fr; gap: 9px; max-height: none; overflow: visible; padding: 0; }
.appointments-dialog.operation-dialog .appointment-item {
  display: grid;
  grid-template-columns: 138px 43px minmax(155px, 1fr) auto;
  grid-template-areas: "time avatar main badge" "time avatar actions actions";
  align-items: center;
  gap: 7px 12px;
  padding: 11px 13px;
  border: 1px solid #cde9db;
  border-left: 4px solid #16ad72;
  border-radius: 10px;
  background: linear-gradient(110deg, #fff 0%, #f0fbf5 100%);
  box-shadow: none;
}
.appointments-dialog.operation-dialog .appointment-time-block { grid-area: time; display: grid; gap: 2px; align-content: center; color: #193c69; }
.appointments-dialog.operation-dialog .appointment-time-block strong { font-size: 14px; }.appointments-dialog.operation-dialog .appointment-time-block span { color: #607a9c; font-size: 12px; font-weight: 750; }.appointments-dialog.operation-dialog .appointment-time-block small { color: #7489a4; font-size: 10px; }
.appointments-dialog.operation-dialog .appointment-client-avatar { grid-area: avatar; display: grid; width: 43px; height: 43px; place-items: center; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #5577a4, #8ea5c5); font-size: 16px; font-weight: 850; }
.appointments-dialog.operation-dialog .appointment-main { grid-area: main; min-width: 0; gap: 3px; }
.appointments-dialog.operation-dialog .appointment-title { color: #162c54; font-size: 14px; }.appointments-dialog.operation-dialog .appointment-meta { color: #536f92; font-size: 11px; font-weight: 700; }.appointments-dialog.operation-dialog .appointment-contact { color: #4a7595; font-size: 10px; line-height: 1.25; }.appointments-dialog.operation-dialog .appointment-contact-whatsapp { color: #168653; }
.appointments-dialog.operation-dialog .appointment-badges { grid-area: badge; align-self: start; justify-self: end; }.appointments-dialog.operation-dialog .appointment-badges .appointment-visual-confirmed { color: #118550; background: #dff8e9; }.appointments-dialog.operation-dialog .appointment-badges span { white-space: nowrap; }
.appointments-dialog.operation-dialog .appointment-actions { grid-area: actions; justify-content: flex-end; gap: 6px; }.appointments-dialog.operation-dialog .appointment-actions button,.appointments-dialog.operation-dialog .appointment-actions a { min-height: 32px; padding: 0 10px; border-radius: 7px; font-size: 10px; }.appointments-dialog.operation-dialog .appointment-actions .danger-button { color: #fff; border-color: transparent; background: linear-gradient(135deg,#e63837,#d51e2e); }.appointments-dialog.operation-dialog .appointment-actions .status-trigger { width: 34px; height: 32px; }.appointments-dialog.operation-dialog .appointment-notes { margin-top: 3px; padding: 5px 7px; font-size: 10px; }

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .appointments-dialog.operation-dialog .appointments-dialog-body { display: flex; min-height: 100%; height: auto; padding: 14px 13px 94px; overflow: visible; }
  .appointments-dialog.operation-dialog .dialog-head { order: 0; }.appointments-dialog.operation-dialog .appointments-hero,.appointments-dialog.operation-dialog .appointments-layout { display: contents; }
  .appointments-dialog.operation-dialog .appointment-card { order: 1; padding: 0; border: 0; background: transparent; box-shadow: none; }.appointments-dialog.operation-dialog .appointment-editor-trigger { min-height: 52px; font-size: 15px; }
  .appointments-dialog.operation-dialog .appointments-summary { order: 2; gap: 7px; }.appointments-dialog.operation-dialog .appointments-summary article { min-height: 88px; display: grid; justify-items: start; gap: 4px; padding: 9px; }.appointments-dialog.operation-dialog .appointment-summary-icon { width: 31px; height: 31px; font-size: 18px; }.appointments-dialog.operation-dialog .appointment-summary-icon svg { width: 17px; height: 17px; }.appointments-dialog.operation-dialog .appointments-summary strong { font-size: 22px; }.appointments-dialog.operation-dialog .appointments-summary span:not(.appointment-summary-icon) { font-size: 9px; line-height: 1.05; }
  .appointments-dialog.operation-dialog .appointments-search-panel { order: 3; }.appointments-dialog.operation-dialog .appointments-search-form { grid-template-columns: 1fr; }.appointments-dialog.operation-dialog .appointments-search-form button { display: none; }.appointments-dialog.operation-dialog .appointments-search-form input { min-height: 48px; font-size: 13px; }
  .appointments-dialog.operation-dialog .appointment-staff-manager { order: 4; }.appointments-dialog.operation-dialog .appointment-deposit-manager { order: 5; }.appointments-dialog.operation-dialog .appointments-search-results { order: 6; }.appointments-dialog.operation-dialog .appointments-agenda { order: 7; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .appointments-dialog.operation-dialog .appointments-agenda-head { display: grid; gap: 9px; margin: 7px 0 9px; }.appointments-dialog.operation-dialog .appointments-agenda-head h3 { font-size: 24px; }.appointments-dialog.operation-dialog .appointments-agenda-filter { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }.appointments-dialog.operation-dialog .appointments-agenda-filter label { font-size: 0; }.appointments-dialog.operation-dialog .appointments-agenda-filter input,.appointments-dialog.operation-dialog .appointments-agenda-filter button { min-height: 46px; font-size: 13px; }
  .appointments-dialog.operation-dialog .appointments-list { display: grid; gap: 10px; }.appointments-dialog.operation-dialog .appointment-card-list { display: grid; gap: 10px; }.appointments-dialog.operation-dialog .appointments-timeline { display: none; }
  .appointments-dialog.operation-dialog .appointment-item { grid-template-columns: 83px 42px minmax(0,1fr); grid-template-areas: "time avatar main" "time badge badge" "actions actions actions"; gap: 6px 9px; padding: 11px 10px; }.appointments-dialog.operation-dialog .appointment-time-block strong { font-size: 14px; }.appointments-dialog.operation-dialog .appointment-client-avatar { width: 42px; height: 42px; }.appointments-dialog.operation-dialog .appointment-title { font-size: 15px; }.appointments-dialog.operation-dialog .appointment-badges { justify-self: start; align-self: center; }.appointments-dialog.operation-dialog .appointment-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 40px 1.25fr 1fr; }.appointments-dialog.operation-dialog .appointment-actions button,.appointments-dialog.operation-dialog .appointment-actions a { width: 100%; min-height: 40px; padding-inline: 5px; font-size: 10px; }.appointments-dialog.operation-dialog .appointment-actions .status-menu { width: 40px; }.appointments-dialog.operation-dialog .appointment-actions .status-trigger { width: 40px; height: 40px; }.appointments-dialog.operation-dialog .appointment-actions .appointment-reschedule-accept-button,.appointments-dialog.operation-dialog .appointment-actions .appointment-confirm-button { grid-column: span 2; }
  .appointments-dialog.operation-dialog .appointments-dialog-body > .dialog-actions { display: none; }
}

/* Se conserva la columna lateral completa y elevada: evita que el calendario
   quede oculto dentro de un contenedor de desplazamiento. */
@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    display: flex;
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    min-height: 0;
    height: max-content;
    overflow: visible;
    transform: translateY(-94px);
    margin-bottom: -94px;
  }
  .appointments-dialog.operation-dialog .appointments-agenda {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }
}

/* Posición final: estos estilos prevalecen sobre las variantes anteriores de
   agenda y dejan el panel izquierdo compacto desde la parte superior. */
.appointments-dialog.operation-dialog .appointment-back-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-self: end;
  gap: 6px;
  margin: 0 0 7px auto;
  padding: 7px 11px;
  border: 1px solid #f0b5b7;
  border-radius: 9px;
  color: #b42328;
  background: #fff6f6;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.appointments-dialog.operation-dialog .appointment-back-button:hover { border-color: #dc6d73; color: #8f1820; background: #ffeded; }
.appointments-dialog.operation-dialog .appointment-back-button span { font-size: 16px; line-height: .6; }
.appointments-dialog.operation-dialog .appointments-search-panel { display: grid; }

@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .dialog-head { min-width: 0; }
  .appointments-dialog.operation-dialog .dialog-head h2 { white-space: nowrap; font-size: clamp(22px, 2vw, 30px); }
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed { display: contents; }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    grid-column: 1;
    grid-row: 2 / 5;
    display: flex;
    align-self: stretch;
    min-height: 0;
  }
  .appointments-dialog.operation-dialog .appointments-agenda {
    grid-column: 2;
    grid-row: 4;
    min-height: 0;
  }
}

/* La agenda se presenta como un módulo de pantalla completa. Este bloque se
   mantiene al final para prevalecer sobre las variantes visuales anteriores. */
.appointments-dialog.operation-dialog {
  inset: 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.appointments-dialog.operation-dialog::backdrop { background: transparent; }
.appointments-dialog.operation-dialog .appointments-dialog-body {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  max-height: none;
  padding: clamp(13px, 1.4vw, 20px);
  overflow: hidden;
}
.appointments-dialog.operation-dialog .dialog-head { grid-column: 1; grid-row: 1; align-self: start; }
.appointments-dialog.operation-dialog .appointments-hero { grid-column: 2; grid-row: 1; min-width: 0; }
.appointments-dialog.operation-dialog .appointment-staff-manager { grid-column: 2; grid-row: 2; min-width: 0; }
.appointments-dialog.operation-dialog .appointment-deposit-manager { grid-column: 2; grid-row: 3; min-width: 0; }
.appointments-dialog.operation-dialog .appointments-search-results { grid-column: 2; min-width: 0; }
.appointments-dialog.operation-dialog .appointments-layout,
.appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.appointments-dialog.operation-dialog .appointments-side-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}
.appointments-dialog.operation-dialog .appointment-card { flex: 0 0 auto; }
.appointments-dialog.operation-dialog .appointments-calendar-panel,
.appointments-dialog.operation-dialog .appointments-filter-panel {
  padding: 12px;
  border: 1px solid #dceaf2;
  border-radius: 13px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 19px rgba(29, 80, 122, .05);
}
.appointments-calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.appointments-calendar-heading h3 { margin: 0; color: #172c54; font-size: 13px; }
.appointments-calendar-heading .ghost-button { min-height: 28px; padding: 4px 9px; font-size: 10px; }
.appointments-calendar-nav { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; text-align: center; gap: 4px; color: #1b3159; font-size: 11px; text-transform: capitalize; }
.appointments-calendar-nav .icon-button { width: 29px; height: 29px; min-height: 29px; padding: 0; font-size: 22px; line-height: 1; }
.appointments-calendar-weekdays,
.appointments-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.appointments-calendar-weekdays { margin: 9px 0 3px; color: #7890a9; font-size: 9px; font-weight: 850; }
.appointments-calendar-day,
.appointments-calendar-empty { min-height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 800; }
.appointments-calendar-day { position: relative; border: 0; color: #233a63; background: transparent; cursor: pointer; }
.appointments-calendar-day:hover { background: #e8f9fb; }
.appointments-calendar-day.has-appointments::after { content: ""; position: absolute; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: #0b9ead; }
.appointments-calendar-day.is-today { color: #078fa2; box-shadow: inset 0 0 0 1px #9cdae3; }
.appointments-calendar-day.is-selected { color: #fff; background: linear-gradient(135deg, #078a9d, #159dcc); box-shadow: 0 5px 10px rgba(8,138,157,.18); }
.appointments-calendar-day.is-selected::after { background: #fff; }
.appointments-filter-panel { display: grid; gap: 9px; }
.appointments-filter-panel label { display: grid; gap: 5px; color: #4f6686; font-size: 10px; font-weight: 850; }
.appointments-filter-panel select,
.appointments-staff-filter-trigger { width: 100%; min-height: 37px; border: 1px solid #d9e6ef; border-radius: 8px; color: #1c345e; background: #fff; font: inherit; font-size: 11px; }
.appointments-staff-filter-trigger { padding: 8px 10px; color: #147f72; border-color: #bfe4df; background: #effbf8; font-weight: 850; text-align: left; cursor: pointer; }
.appointments-dialog.operation-dialog .appointments-agenda { min-height: 0; overflow: auto; }
.appointments-dialog.operation-dialog .appointments-list { padding-bottom: 6px; }
.appointments-dialog.operation-dialog .appointments-dialog-body > .dialog-actions { display: none; }

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointments-dialog-body { display: flex; height: auto; min-height: 100dvh; padding: 14px 13px 34px; overflow: visible; }
  .appointments-dialog.operation-dialog .appointments-hero,
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed,
  .appointments-dialog.operation-dialog .appointments-side-panel { display: contents; }
  .appointments-dialog.operation-dialog .dialog-head { order: 0; }
  .appointments-dialog.operation-dialog .appointment-card { order: 1; }
  .appointments-dialog.operation-dialog .appointments-summary { order: 2; }
  .appointments-dialog.operation-dialog .appointments-search-panel { order: 3; }
  .appointments-dialog.operation-dialog .appointment-staff-manager { order: 4; }
  .appointments-dialog.operation-dialog .appointment-deposit-manager { order: 5; }
  .appointments-dialog.operation-dialog .appointments-search-results { order: 6; }
  .appointments-dialog.operation-dialog .appointments-agenda { order: 7; min-height: auto; overflow: visible; }
  .appointments-dialog.operation-dialog .appointments-calendar-panel,
  .appointments-dialog.operation-dialog .appointments-filter-panel { display: none; }
}

/* Column layout final for desktop appointments. */
@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    display: flex;
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    min-height: 0;
    height: max-content;
    overflow: visible;
    transform: translateY(-94px);
    margin-bottom: -94px;
  }
  .appointments-dialog.operation-dialog .appointments-agenda {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }
}

@media (min-width: 721px) {
  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed { overflow: visible; }
  .appointments-dialog.operation-dialog .appointments-side-panel {
    max-height: calc(100dvh - 126px);
    overflow-y: auto;
  }
}

/* Los paneles desplegables pertenecen al mismo espacio de trabajo visual de
   la agenda: conservan sus acciones, pero ahora se leen como paneles modernos. */
.appointments-dialog.operation-dialog .appointment-staff-manager[open],
.appointments-dialog.operation-dialog .appointment-deposit-manager[open] {
  padding: 10px;
  border-color: #b9e2dd;
  background: linear-gradient(135deg, rgba(237,253,250,.98), rgba(248,253,255,.98));
  box-shadow: 0 12px 28px rgba(24, 97, 120, .09);
}
.appointments-dialog.operation-dialog .appointment-deposit-manager[open] { border-color: #c8dff5; background: linear-gradient(135deg, #f1f9ff, #fbfdff); }
.appointments-dialog.operation-dialog .appointment-staff-manager > summary,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 9px;
  color: #126d67;
  background: #e9fbf8;
  font-size: 12px;
  list-style: none;
}
.appointments-dialog.operation-dialog .appointment-staff-manager > summary::-webkit-details-marker,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary::-webkit-details-marker { display: none; }
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary { color: #22538b; background: #edf6ff; }
.appointments-dialog.operation-dialog .appointment-staff-manager > summary::before,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary::before {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  margin: 0;
  border-radius: 7px;
  color: #078d99;
  background: #d4f6f4;
  content: "♟";
  font-size: 14px;
}
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary::before { color: #397cbd; background: #dceeff; content: "▣"; }
.appointments-dialog.operation-dialog .appointment-staff-manager > summary::after,
.appointments-dialog.operation-dialog .appointment-deposit-manager > summary::after { margin-left: auto; content: "⌄"; font-size: 16px; line-height: 1; transition: transform .18s ease; }
.appointments-dialog.operation-dialog .appointment-staff-manager[open] > summary::after,
.appointments-dialog.operation-dialog .appointment-deposit-manager[open] > summary::after { transform: rotate(180deg); }
.appointments-dialog.operation-dialog .appointment-staff-manager > p {
  margin: 9px 2px 10px;
  color: #54758a;
  font-size: 11px;
  line-height: 1.45;
}
.appointments-dialog.operation-dialog .appointment-staff-workspace { gap: 8px; }
.appointments-dialog.operation-dialog .appointment-staff-editor-pane,
.appointments-dialog.operation-dialog .appointment-staff-list-pane {
  padding: 10px;
  border-color: #d8ebeb;
  border-radius: 12px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 5px 15px rgba(25, 101, 120, .04);
}
.appointments-dialog.operation-dialog .appointment-staff-pane-head { border-color: #e3f0ef; }
.appointments-dialog.operation-dialog .appointment-staff-pane-head .eyebrow { color: #07919c; }
.appointments-dialog.operation-dialog .appointment-staff-pane-head h3 { color: #18365d; }
.appointments-dialog.operation-dialog .appointment-staff-form { gap: 8px; }
.appointments-dialog.operation-dialog .appointment-staff-form label > span,
.appointments-dialog.operation-dialog .appointment-staff-form legend { color: #52728a; font-size: 9px; font-weight: 850; }
.appointments-dialog.operation-dialog .appointment-staff-form input:not([type="checkbox"]),
.appointments-dialog.operation-dialog .appointment-staff-form select { min-height: 31px; border-color: #d7e6ee; border-radius: 8px; background: #fbfdff; font-size: 10px; }
.appointments-dialog.operation-dialog .appointment-staff-form fieldset { border-color: #dbeaf0; background: #f9fcff; }
.appointments-dialog.operation-dialog .appointment-staff-services { gap: 7px; padding-top: 4px; }
.appointments-dialog.operation-dialog .appointment-staff-services label { padding: 5px 7px; border-color: #dbe9ec; background: #fff; font-size: 9px; }
.appointments-dialog.operation-dialog .appointment-staff-services input[type="checkbox"] { inline-size: 16px; block-size: 16px; }
.appointments-dialog.operation-dialog .appointment-staff-form .dialog-actions { gap: 6px; }
.appointments-dialog.operation-dialog .appointment-staff-form .dialog-actions button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.appointments-dialog.operation-dialog .appointment-staff-services label:has(input:checked) { border-color: #9edfd7; background: #ecfbf7; color: #087669; }
.appointments-dialog.operation-dialog .appointment-staff-item {
  border-color: #dceaf0;
  background: linear-gradient(100deg, #fff, #f7fcff);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.appointments-dialog.operation-dialog .appointment-staff-item:hover { border-color: #a8dedb; box-shadow: 0 7px 15px rgba(15, 131, 145, .1); transform: translateY(-1px); }
.appointments-dialog.operation-dialog .appointment-staff-item strong { color: #1a365f; font-size: 12px; }
.appointments-dialog.operation-dialog .appointment-staff-item span { color: #55768d; font-size: 10px; }
.appointments-dialog.operation-dialog .appointment-deposit-list { display: grid; gap: 9px; margin-top: 10px; }
.appointments-dialog.operation-dialog .appointment-deposit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #d7e7f4;
  border-radius: 11px;
  background: rgba(255,255,255,.94);
}
.appointments-dialog.operation-dialog .appointment-deposit-item > div:first-child { display: grid; gap: 3px; min-width: 0; }
.appointments-dialog.operation-dialog .appointment-deposit-item strong { color: #19365e; font-size: 12px; }
.appointments-dialog.operation-dialog .appointment-deposit-item span { color: #64809a; font-size: 10px; }
.appointments-dialog.operation-dialog .appointment-deposit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.appointments-dialog.operation-dialog .appointment-deposit-actions button,
.appointments-dialog.operation-dialog .appointment-deposit-actions a { min-height: 32px; padding: 6px 9px; border-radius: 7px; font-size: 10px; font-weight: 800; }

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointment-staff-manager[open],
  .appointments-dialog.operation-dialog .appointment-deposit-manager[open] { padding: 8px; }
  .appointments-dialog.operation-dialog .appointment-staff-manager > summary,
  .appointments-dialog.operation-dialog .appointment-deposit-manager > summary { min-height: 48px; font-size: 12px; }
  .appointments-dialog.operation-dialog .appointment-staff-workspace { grid-template-columns: 1fr; gap: 8px; }
  .appointments-dialog.operation-dialog .appointment-staff-editor-pane,
  .appointments-dialog.operation-dialog .appointment-staff-list-pane { padding: 9px; }
  .appointments-dialog.operation-dialog .appointment-deposit-item { align-items: stretch; flex-direction: column; }
  .appointments-dialog.operation-dialog .appointment-deposit-actions { justify-content: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appointments-dialog.operation-dialog .appointment-deposit-actions button,
  .appointments-dialog.operation-dialog .appointment-deposit-actions a { width: 100%; text-align: center; }
}

/* En iPhone el diálogo nativo ocupa toda la pantalla. Este desplazamiento vive
   en el propio diálogo para que los gestos verticales nunca queden atrapados
   por un panel interno y toda la agenda siga siendo accesible. */
@media (max-width: 720px) {
  .appointments-dialog.operation-dialog {
    display: block;
    padding: 0;
    background: #f3f7fd;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .appointments-dialog.operation-dialog::backdrop {
    background: #f3f7fd;
  }

  .appointments-dialog.operation-dialog .appointments-dialog-body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .appointments-dialog.operation-dialog .appointments-layout,
  .appointments-dialog.operation-dialog .appointments-layout.is-collapsed,
  .appointments-dialog.operation-dialog .appointments-agenda,
  .appointments-dialog.operation-dialog .appointments-list {
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* Safari puede conservar la portada de acceso en el flujo visual mientras un
   dialogo nativo esta abierto. La portada no debe competir con el espacio de
   trabajo autenticado de Citas. */
body:has(#appointmentsDialog[open]) #authScreen {
  display: none !important;
}

body:has(#appointmentsDialog[open]) #appointmentsDialog {
  background: #f3f7fd;
  isolation: isolate;
}

body.appointments-open #authScreen {
  display: none !important;
}

/* Registro de cliente: mejora visual sin cambiar los campos ni su persistencia. */
#customerDialog.customer-dialog {
  width: min(820px, calc(100vw - 46px));
  border: 1px solid #d8e7f6;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f6fbff);
  box-shadow: 0 24px 65px rgba(28, 77, 125, .24);
}
#customerDialog #customerForm { display: grid; gap: 19px; max-height: none; padding: 25px 28px 20px; }
#customerDialog .customer-dialog-head { display: grid; grid-template-columns: 78px minmax(0, 1fr) 48px; align-items: center; gap: 14px; padding: 0; }
.customer-dialog-avatar { display: grid; width: 78px; height: 78px; place-items: center; border-radius: 50%; color: #079a77; background: radial-gradient(circle at 61% 33%, #10b985 0 10%, transparent 11%), linear-gradient(135deg, #e4fbf2, #ccefe4); box-shadow: inset 0 0 0 1px rgba(21, 181, 133, .08); font-size: 37px; line-height: 1; }
#customerDialog .customer-dialog-head .eyebrow { margin: 0 0 2px; color: #078777; font-size: 11px; letter-spacing: .12em; }
#customerDialog .customer-dialog-head h2 { margin: 0; color: #101e59; font-size: clamp(25px, 2.25vw, 33px); line-height: 1.05; }
.customer-dialog-subtitle { margin: 5px 0 0; color: #667ba6; font-size: 15px; }
#customerDialog .customer-dialog-head .icon-button { width: 48px; height: 48px; border: 1px solid #d9e7f7; border-radius: 12px; color: #10235d; background: #fff; font-size: 29px; line-height: 1; }
.customer-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.customer-field-card { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 102px; padding: 15px; border: 1px solid #dfebf8; border-radius: 15px; background: rgba(255,255,255,.86); }
#invoiceDgiiBtn[hidden], #clientDocumentField[hidden], #clientDgiiStatus:empty, #applyClientDgiiBtn[hidden] { display: none; }
.invoice-customer-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.invoice-customer-label button { padding: 4px 8px; font-size: .85rem; }
.client-dgii-result { grid-column: 2; display: grid; justify-items: start; gap: 8px; overflow-wrap: anywhere; }
#clientDgiiStatus { font-weight: 500; font-size: .85em; }
.customer-field-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 15px; font-size: 31px; font-weight: 800; line-height: 1; }
.customer-icon-blue { color: #1477e9; background: linear-gradient(135deg, #e8f3ff, #ddecff); }.customer-icon-green { color: #05986e; background: linear-gradient(135deg, #e7fcf1, #d4f7e6); }.customer-icon-purple { color: #a633df; background: linear-gradient(135deg, #f6e9ff, #ebd8ff); }.customer-icon-orange { color: #fa7000; background: linear-gradient(135deg, #fff2df, #ffe7c5); }
.customer-field-card label { display: grid; gap: 7px; min-width: 0; color: #243e78; font-size: 13px; font-weight: 800; }.customer-field-card label span b { color: #e23a48; }.customer-field-card input { width: 100%; min-width: 0; height: 47px; padding: 0 13px; border: 1px solid #d5e1f1; border-radius: 10px; color: #14235d; background: #fbfdff; font-size: 14px; }.customer-field-card input:focus { border-color: #079a87; outline: 3px solid rgba(7,154,135,.12); }
#customerDialog .customer-dialog-actions { align-items: center; justify-content: flex-end; margin: 0 -28px -20px; padding: 17px 28px; border-top: 1px solid #e4edf8; background: rgba(255,255,255,.8); }.customer-dialog-actions .ghost-button, .customer-dialog-actions .primary-button { min-width: 185px; min-height: 52px; border-radius: 12px; font-size: 14px; font-weight: 800; }.customer-dialog-actions .primary-button { background: linear-gradient(135deg, #08aa95, #0c68bd); box-shadow: 0 9px 18px rgba(6,124,157,.22); }

/* Directorio de clientes: una misma jerarquía para tabla de escritorio y
   tarjetas móviles, sin cambiar los datos ni las acciones existentes. */
#clientsDialog.clients-dialog {
  border-color: #d9e9f4;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% -18%, rgba(162, 227, 235, .28) 0 15%, transparent 15.2%),
    linear-gradient(135deg, #fbfdff, #f4faff 55%, #fff);
  box-shadow: 0 24px 65px rgba(28, 77, 125, .2);
}

#clientsDialog .client-directory-body {
  gap: 18px;
  padding: 26px 30px 18px;
}

#clientsDialog .client-directory-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
}

#clientsDialog .client-directory-head h2 {
  margin: 2px 0 2px;
  color: #10245a;
  font-size: clamp(30px, 2.8vw, 42px);
  letter-spacing: -.045em;
}

#clientsDialog .client-directory-head .eyebrow { color: #0da88c; }
.client-directory-subtitle { margin: 0; color: #59729b; font-size: 15px; }
.client-directory-head-actions { display: flex; align-items: center; gap: 12px; }
.client-directory-new { min-height: 52px; padding: 0 21px; border-radius: 13px; background: linear-gradient(125deg, #12a89a, #0968aa); box-shadow: 0 10px 18px rgba(0, 121, 157, .2); font-size: 15px; }
.client-directory-new span { margin-right: 9px; font-size: 31px; font-weight: 300; line-height: 0; vertical-align: -3px; }
.client-directory-close { width: 48px; min-width: 48px; height: 48px; border-color: #d9e6f7; border-radius: 13px; color: #142861; background: #fff; font-size: 32px; box-shadow: 0 4px 10px rgba(40, 89, 135, .08); }

#clientsDialog .client-directory-workspace { min-height: 0; overflow: auto; padding: 0 1px 2px; }
.client-directory-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.client-directory-summary article { display: flex; align-items: center; gap: 17px; min-height: 94px; padding: 16px 20px; border: 1px solid #d9e9f4; border-radius: 15px; background: rgba(255,255,255,.78); }
.client-directory-summary article > div { display: grid; gap: 5px; }.client-directory-summary article span:not(.client-directory-summary-icon) { color: #405d91; font-size: 14px; }.client-directory-summary article strong { color: #087b68; font-size: 30px; line-height: 1; }
.client-directory-summary-icon { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; border-radius: 16px; color: #02a77e; background: #e3fbf3; }.client-directory-summary-icon svg { width: 27px; height: 27px; fill: none !important; stroke: currentColor !important; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.client-directory-summary-phone { border-color: #dceafe !important; background: linear-gradient(120deg, #fff, #f1f8ff) !important; }.client-directory-summary-phone strong { color: #125cb6 !important; }.client-directory-summary-phone .client-directory-summary-icon { color: #087ce4; background: #e2f2ff; }.client-directory-summary-no-phone { border-color: #ffead4 !important; background: linear-gradient(120deg, #fff, #fff8f1) !important; }.client-directory-summary-no-phone strong { color: #bc6405 !important; }.client-directory-summary-no-phone .client-directory-summary-icon { color: #ef8506; background: #fff1dd; }

.client-directory-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; align-items: center; margin-bottom: 13px; }
.client-directory-search { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 17px; border: 1px solid #d7e4f6; border-radius: 13px; background: #fff; box-shadow: 0 4px 11px rgba(32, 83, 138, .035); }.client-directory-search > span { color: #0c2969; font-size: 28px; font-weight: 700; line-height: 1; }.client-directory-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #1d3566; background: transparent; font-size: 15px; }.client-directory-search input::placeholder { color: #7085ac; }
.client-directory-sort { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border: 1px solid #d7e4f6; border-radius: 13px; color: #142861; background: #fff; }.client-directory-sort > span { color: #0b2c70; font-size: 21px; font-weight: 900; }.client-directory-sort select { width: 100%; border: 0; outline: 0; color: #142861; background: transparent; font: inherit; font-weight: 750; }
.client-directory-filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }.client-directory-filters button { min-height: 45px; padding: 0 23px; border: 1px solid #e0ebfa; border-radius: 999px; color: #23457d; background: #f2f7ff; font-weight: 750; }.client-directory-filters button.active { border-color: #b7ebdc; color: #073e39; background: linear-gradient(120deg, #d9f8ef, #e9fbf5); box-shadow: inset 0 0 0 1px rgba(36, 176, 139, .05); }

.client-directory-list { min-height: 0; }.client-directory-table { overflow: hidden; border: 1px solid #dce8f8; border-radius: 15px; background: rgba(255,255,255,.87); }.client-directory-table-head,.client-directory-row { display: grid; grid-template-columns: minmax(205px, 1.35fr) minmax(170px, .72fr) minmax(155px, .78fr) minmax(135px, .78fr) minmax(170px, .72fr); align-items: center; gap: 16px; }.client-directory-table-head { min-height: 46px; padding: 0 25px; color: #38568a; background: linear-gradient(90deg, #f1f7ff, #fbfdff); font-size: 12px; font-weight: 850; }.client-directory-row { min-height: 66px; padding: 8px 25px; border-top: 1px solid #e6eef9; }.client-directory-person { display: flex; min-width: 0; align-items: center; gap: 13px; }.client-directory-person > div { display: grid; min-width: 0; gap: 3px; }.client-directory-person strong { overflow: hidden; color: #10245a; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }.client-directory-avatar { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #0879db; background: #dfeeff; font-size: 20px; font-weight: 850; }.client-directory-avatar-1 { color: #d62b99; background: #ffe3f5; }.client-directory-avatar-2 { color: #0aa75e; background: #def9e7; }.client-directory-avatar-3 { color: #9734e2; background: #f0e0ff; }.client-directory-avatar-4 { color: #ec8506; background: #fff0d7; }.client-directory-avatar-5 { color: #0c9984; background: #ddf7f0; }
.client-directory-phone { display: flex; align-items: center; gap: 6px; min-width: 0; color: #526a9d; }.client-directory-phone svg,.client-directory-mobile-phone svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #00a576; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }.client-directory-phone span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.client-directory-status > span { display: inline-flex; align-items: center; gap: 7px; width: max-content; max-width: 100%; padding: 7px 10px; border-radius: 10px; font-size: 12px; font-weight: 780; white-space: nowrap; }.client-directory-status svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }.client-directory-status .has-phone { color: #008b58; background: #e0f9ed; }.client-directory-status .without-phone { color: #c86c00; background: #fff0d8; }.client-directory-date { color: #506a9b; font-size: 13px; }.client-directory-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }.client-directory-actions button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 11px; font-weight: 800; }.client-directory-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }.client-directory-edit { color: #0756b9; background: #e9f3ff; }.client-directory-delete { color: #e32d2f; background: #ffe8eb; }
.client-directory-mobile-phone { display: none; }.client-directory-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 9px 0; color: #6177a1; font-size: 13px; }.client-directory-pagination > div { display: flex; gap: 7px; }.client-directory-pagination button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #dbe8fa; border-radius: 10px; color: #17336a; background: #fff; font-weight: 800; }.client-directory-pagination button.active { border-color: #078d80; color: #fff; background: linear-gradient(135deg, #078d80, #08705f); }.client-directory-pagination button:disabled { opacity: .45; cursor: not-allowed; }
#clientsDialog .client-directory-actions-footer { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }.client-directory-actions-footer button { min-height: 36px; }.client-directory-actions-footer .hidden { display: none; }

@media (min-width: 721px) and (max-width: 1440px) {
  #clientsDialog .client-directory-body { gap: 12px; padding: 19px 22px 13px; }
  #clientsDialog .client-directory-head h2 { font-size: 34px; }
  .client-directory-subtitle { font-size: 13px; }
  .client-directory-new { min-height: 45px; padding: 0 17px; border-radius: 11px; font-size: 13px; }
  .client-directory-new span { margin-right: 7px; font-size: 26px; }
  .client-directory-close { width: 43px; min-width: 43px; height: 43px; font-size: 28px; }
  .client-directory-summary { gap: 10px; margin-bottom: 12px; }
  .client-directory-summary article { min-height: 76px; gap: 12px; padding: 11px 15px; border-radius: 12px; }
  .client-directory-summary-icon { width: 43px; height: 43px; border-radius: 13px; }
  .client-directory-summary-icon svg { width: 23px; height: 23px; }
  .client-directory-summary article span:not(.client-directory-summary-icon) { font-size: 12px; }
  .client-directory-summary article strong { font-size: 25px; }
  .client-directory-toolbar { grid-template-columns: minmax(0, 1fr) 205px; gap: 10px; margin-bottom: 10px; }
  .client-directory-search,.client-directory-sort { min-height: 45px; border-radius: 11px; }
  .client-directory-search { padding: 0 14px; }.client-directory-search > span { font-size: 24px; }.client-directory-search input { font-size: 13px; }.client-directory-sort { padding: 0 12px; font-size: 13px; }
  .client-directory-filters { gap: 7px; margin-bottom: 11px; }.client-directory-filters button { min-height: 38px; padding: 0 17px; font-size: 12px; }
  .client-directory-table-head { min-height: 38px; padding: 0 18px; font-size: 11px; }.client-directory-table-head,.client-directory-row { grid-template-columns: minmax(185px, 1.35fr) minmax(155px, .72fr) minmax(140px, .78fr) minmax(120px, .78fr) minmax(150px, .72fr); gap: 12px; }
  .client-directory-row { min-height: 55px; padding: 6px 18px; }.client-directory-person { gap: 10px; }.client-directory-person strong { font-size: 13px; }.client-directory-avatar { width: 36px; height: 36px; font-size: 17px; }.client-directory-phone,.client-directory-date { font-size: 12px; }.client-directory-status > span { padding: 6px 8px; font-size: 11px; }.client-directory-actions { gap: 6px; }.client-directory-actions button { min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 12px; }.client-directory-actions svg { width: 15px; height: 15px; }
  .client-directory-pagination { padding-top: 10px; font-size: 12px; }.client-directory-pagination button { width: 33px; height: 33px; border-radius: 9px; }
}

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointment-back-button { min-height: 38px; padding: 0 12px; font-size: 11px; }
  .appointments-dialog.operation-dialog .dialog-head { min-height: 46px; padding-right: 0; }
  .appointments-dialog.operation-dialog .appointments-search-panel { margin-top: 10px; }
  #clientsDialog.clients-dialog { position: fixed; inset: 0; box-sizing: border-box; width: 100dvw !important; min-width: 100dvw; max-width: 100dvw; height: 100dvh !important; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; background: linear-gradient(145deg, #fff, #f6fbff); transform: none; }
  #clientsDialog .client-directory-body { display: flex; flex-direction: column; gap: 16px; width: 100%; min-width: 0; height: 100%; padding: calc(20px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom)); overflow: hidden; }
  #clientsDialog .client-directory-head { gap: 12px; align-items: center; }.client-directory-head .eyebrow { margin-bottom: 3px; }.client-directory-subtitle { font-size: 12px; }.client-directory-head-actions { gap: 9px; }.client-directory-new { min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 14px; }.client-directory-new span { font-size: 28px; }.client-directory-close { order: -1; width: 45px; min-width: 45px; height: 45px; font-size: 0; }.client-directory-close::before { content: "‹"; font-size: 43px; font-weight: 400; line-height: .7; }
  #clientsDialog .client-directory-head > div:first-child { min-width: 0; flex: 1; }.client-directory-head h2 { font-size: 31px; }.client-directory-workspace { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 0 1px 80px; }.client-directory-summary { gap: 9px; margin-bottom: 17px; }.client-directory-summary article { min-height: 104px; align-items: flex-start; gap: 8px; padding: 12px 10px; border-radius: 15px; }.client-directory-summary-icon { width: 39px; height: 39px; border-radius: 13px; }.client-directory-summary-icon svg { width: 21px; height: 21px; }.client-directory-summary article > div { gap: 5px; }.client-directory-summary article span:not(.client-directory-summary-icon) { font-size: 11px; line-height: 1.15; }.client-directory-summary article strong { font-size: 28px; }
  .client-directory-toolbar { grid-template-columns: minmax(0, 1fr) 58px; gap: 10px; margin-bottom: 13px; }.client-directory-search { min-height: 53px; padding: 0 15px; }.client-directory-search > span { font-size: 27px; }.client-directory-search input { font-size: 14px; }.client-directory-sort { justify-content: center; min-height: 53px; padding: 0; }.client-directory-sort > span { font-size: 25px; }.client-directory-sort select { position: absolute; width: 58px; height: 53px; opacity: 0; }
  .client-directory-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }.client-directory-filters button { min-height: 45px; padding: 0 6px; font-size: 12px; white-space: nowrap; }.client-directory-table { overflow: visible; border: 0; background: transparent; }.client-directory-table-head { display: none; }.client-directory-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "person actions" "status actions"; gap: 8px 10px; min-height: 126px; margin-bottom: 10px; padding: 14px 14px 13px; border: 1px solid #dae7f8; border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: 0 6px 17px rgba(26, 82, 136, .06); }.client-directory-person { grid-area: person; gap: 13px; }.client-directory-person strong { font-size: 17px; }.client-directory-avatar { width: 58px; height: 58px; font-size: 27px; }.client-directory-mobile-phone { display: flex; align-items: center; gap: 5px; color: #5c73a1; font-size: 13px; }.client-directory-phone,.client-directory-date { display: none; }.client-directory-status { grid-area: status; padding-left: 71px; }.client-directory-status > span { font-size: 11px; }.client-directory-actions { grid-area: actions; display: grid; align-self: stretch; gap: 7px; }.client-directory-actions button { min-width: 112px; min-height: 43px; padding: 0 10px; border-radius: 11px; font-size: 12px; }.client-directory-actions svg { width: 18px; height: 18px; }.client-directory-pagination { position: sticky; bottom: -1px; z-index: 2; margin: 3px -18px -80px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #dfeafa; background: rgba(255,255,255,.96); box-shadow: 0 -7px 18px rgba(37, 74, 112, .06); font-size: 12px; }.client-directory-pagination button { width: 36px; height: 36px; }.client-directory-actions-footer { display: none !important; }

  #customerDialog.customer-dialog { position: fixed; inset: 0; box-sizing: border-box; width: 100dvw; min-width: 100dvw; max-width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; }
  #customerDialog #customerForm { grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; width: 100%; height: 100%; padding: calc(18px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom)); overflow: hidden; }
  #customerDialog .customer-dialog-head { grid-template-columns: 58px minmax(0, 1fr) 48px; gap: 10px; }.customer-dialog-avatar { width: 58px; height: 58px; font-size: 28px; border-radius: 18px; }#customerDialog .customer-dialog-head h2 { font-size: 23px; }.customer-dialog-subtitle { margin-top: 4px; font-size: 12px; line-height: 1.25; }
  .customer-form-grid { grid-template-columns: 1fr; align-content: start; gap: 10px; overflow: auto; overscroll-behavior: contain; padding: 1px 2px 8px; }.customer-field-card { grid-template-columns: 56px minmax(0, 1fr); gap: 11px; min-height: 86px; padding: 12px; border-radius: 14px; }.customer-field-icon { width: 54px; height: 54px; border-radius: 13px; font-size: 26px; }.customer-field-card label { gap: 5px; font-size: 12px; }.customer-field-card input { height: 42px; font-size: 14px; }
  #customerDialog .customer-form-grid { grid-auto-rows: max-content; }
  #clientDocumentField .client-dgii-result { grid-column: 1 / -1; }
  #searchClientDgiiBtn, #applyClientDgiiBtn { width: 100%; min-height: 44px; white-space: normal; }
  #customerDialog .customer-dialog-actions { display: grid; grid-template-columns: 1fr 1.45fr; gap: 10px; margin: 0 -16px calc(-12px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }.customer-dialog-actions .ghost-button, .customer-dialog-actions .primary-button { min-width: 0; min-height: 50px; padding: 0 10px; font-size: 13px; }
}

@media (max-width: 720px) {
  /* Un dialogo de Citas solo puede verse después de abrirlo desde su botón.
     Esto neutraliza estados visuales restaurados por Android/Safari cuando se
     vuelve al index o al inicio de sesión. */
  body:not(.appointments-open) #appointmentsDialog {
    display: none !important;
  }

  body.appointments-open {
    overflow: hidden;
  }

  /* Safari puede abrir el diálogo como un elemento normal cuando restaura una
     pestaña. Al fijarlo al viewport, la agenda no deja rastros sobre el index. */
  #appointmentsDialog[open].operation-dialog {
    position: fixed;
    inset: 0;
    width: 100dvw;
    min-width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    background: #f3f7fd;
    z-index: 2147483647;
  }
}

/* Salida persistente de Citas: el encabezado puede ocupar la columna lateral
   en escritorio, por eso el control se ancla al módulo completo y se reserva
   una franja superior para no cruzarse con métricas ni búsqueda. */
#appointmentsDialog.appointments-dialog .appointment-back-button {
  position: fixed !important;
  top: 16px;
  right: 22px;
  z-index: 2147483647;
  display: inline-flex !important;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  box-shadow: 0 7px 16px rgba(165, 35, 43, .14);
}
#appointmentsDialog.appointments-dialog .appointments-dialog-body {
  padding-top: 70px !important;
}
/* En escritorio el body se muestra a 88 %. Compensamos esa densidad para que
   Citas alcance el borde físico de la ventana, sin dejar franjas vacías. */
@media (min-width: 721px) {
  #appointmentsDialog[open].appointments-dialog.operation-dialog {
    position: fixed;
    inset: 0;
    width: calc(100dvw / var(--app-scale));
    min-width: calc(100dvw / var(--app-scale));
    height: calc(100dvh / var(--app-scale));
    min-height: calc(100dvh / var(--app-scale));
    max-width: none;
    max-height: none;
    margin: 0;
  }

  #appointmentsDialog[open].appointments-dialog.operation-dialog .appointments-dialog-body {
    height: calc(100dvh / var(--app-scale));
  }
}

/* Los módulos operativos se trabajan como superficies completas en escritorio.
   El body usa una densidad visual propia, por lo que las medidas compensan esa
   escala y evitan franjas vacías al lado derecho o inferior. */
@media (min-width: 721px) {
  #settingsDialog[open],
  #clientsDialog[open],
  #customerDialog[open],
  #productDialog[open],
  #supplierDialog[open],
  #salesDialog[open],
  #salesReportDialog[open],
  #quotationsDialog[open],
  #analyticsDialog[open],
  #expensesDialog[open],
  #payablesDialog[open],
  #receivablesDialog[open] {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: calc(100dvw / var(--app-scale));
    min-width: calc(100dvw / var(--app-scale));
    height: calc(100dvh / var(--app-scale));
    min-height: calc(100dvh / var(--app-scale));
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
}

/* Operaciones usa un acento independiente del verde profundo del POS para que
   el acceso y cada opción se distingan con claridad en web y en teléfono. */
.app-shell:not(.super-mode) #operationsMenu > summary {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #2dd4bf;
  border-radius: 12px;
  color: #fff;
  background: rgba(0, 78, 71, .78);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  font-size: 15px;
  font-weight: 650;
}
.app-shell:not(.super-mode) #operationsMenu > summary::before { content: none; }
.app-shell:not(.super-mode) #operationsMenu > summary::after {
  content: "⌄";
  margin-left: 7px;
  font-size: 22px;
  line-height: .7;
}
.app-shell:not(.super-mode) #operationsMenu[open] > summary,
.app-shell:not(.super-mode) #operationsMenu > summary:hover {
  border-color: #5eead4;
  background: rgba(0, 95, 83, .92);
  box-shadow: 0 7px 17px rgba(0, 0, 0, .14);
}
.app-shell:not(.super-mode) #operationsMenu[open] > summary::after { content: "⌄"; }
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel {
  top: calc(100% + 13px);
  right: auto;
  left: 0;
  width: 280px;
  min-width: 280px;
  gap: 5px;
  padding: 14px;
  border: 1px solid #d1fae5;
  border-radius: 12px;
  background: #ecfdf5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .15), 0 4px 12px rgba(0, 0, 0, .08);
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel::before {
  position: absolute;
  top: -10px;
  left: 196px;
  width: 20px;
  height: 20px;
  border-top: 1px solid #d1fae5;
  border-left: 1px solid #d1fae5;
  background: #ecfdf5;
  content: "";
  transform: rotate(45deg);
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button {
  position: relative;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: #064e3b;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:hover,
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:focus-visible {
  color: #064e3b;
  background: #d1fae5;
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:active {
  color: #fff;
  background: #10b981;
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel .operation-menu-icon,
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:hover .operation-menu-icon,
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:focus-visible .operation-menu-icon {
  color: #059669;
}
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel button:active .operation-menu-icon { color: #fff; }

@media (max-width: 720px) {
  .app-shell:not(.super-mode) #operationsMenu > summary {
    width: 45px;
    min-width: 45px;
    min-height: 43px;
    padding: 0;
  }
  .app-shell:not(.super-mode) #operationsMenu > summary::before {
    display: block;
    margin: 0;
    content: "☰";
    font-size: 22px;
  }
  .app-shell:not(.super-mode) #operationsMenu > summary::after { display: none; }
  .app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel {
    top: 65px;
    right: 13px;
    left: auto;
    width: min(280px, calc(100dvw - 26px));
    min-width: 0;
    max-height: calc(100dvh - 84px);
  }
  .app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel::before {
    top: -10px;
    right: 12px;
    left: auto;
  }
}
@media (max-width: 720px) {
  #appointmentsDialog.appointments-dialog .appointment-back-button { top: 12px; right: 13px; min-height: 38px; }
  #appointmentsDialog.appointments-dialog .appointments-dialog-body { padding-top: 62px !important; }
}

/* Panel de Ventas y facturas: conserva el reporte actual, con la jerarquía
   visual de indicadores, filtro por fechas y estado vacío del nuevo diseño. */
#salesReportDialog.sales-dialog {
  border-color: #dceafa;
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 0, rgba(108, 190, 249, .12), transparent 22%),
    linear-gradient(135deg, #fbfdff, #f5faff 57%, #fff);
  box-shadow: 0 24px 65px rgba(30, 83, 134, .19);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#salesReportDialog .sales-report-body { gap: 16px; height: auto; min-height: 100%; padding: 24px 28px 16px; overflow: visible; background: transparent; }
#salesReportDialog .sales-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0; }
#salesReportDialog .sales-report-head h2 { margin: 3px 0 3px; color: #10235a; font-size: clamp(29px, 2.8vw, 40px); letter-spacing: -.045em; }
#salesReportDialog .sales-report-head .eyebrow { color: #0b957d; }
.sales-report-subtitle { margin: 0; color: #5872a0; font-size: 15px; }
#salesReportDialog .sales-report-head .icon-button { width: 48px; min-width: 48px; height: 48px; border-color: #dce9fa; border-radius: 13px; color: #142960; background: #fff; font-size: 29px; box-shadow: 0 4px 11px rgba(42, 84, 132, .06); }

#salesReportDialog .sales-report-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 210px; gap: 12px; align-items: center; margin: 0; padding: 12px; border: 1px solid #dceafb; border-radius: 16px; background: rgba(247, 251, 255, .84); }
#salesReportDialog .sales-report-date-field { display: flex; min-width: 0; min-height: 63px; align-items: center; gap: 13px; padding: 9px 15px; border: 1px solid #dbe7f7; border-radius: 13px; background: #fff; }
.sales-report-date-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #078c73; background: #ddf8ef; }.sales-report-date-icon svg,.sales-report-filter-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }.sales-report-date-copy { display: grid; min-width: 0; gap: 2px; }.sales-report-date-copy small { color: #6378a2; font-size: 13px; }.sales-report-date-copy input { width: 100%; min-height: 26px; padding: 0; border: 0; outline: 0; color: #11275d; background: transparent; font-size: 16px; font-weight: 800; }
#salesReportDialog .sales-report-filter-button { display: inline-flex; min-height: 63px; align-items: center; justify-content: center; gap: 10px; border-radius: 13px; background: linear-gradient(125deg, #0ca28d, #0878a1); font-size: 15px; box-shadow: 0 9px 17px rgba(7, 131, 145, .17); }

#salesReportDialog .sales-report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
#salesReportDialog .sales-report-card { display: flex; min-width: 0; min-height: 88px; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid #dceafb; border-radius: 15px; background: rgba(255,255,255,.82); }
#salesReportDialog .sales-report-card > div { display: grid; min-width: 0; gap: 6px; }#salesReportDialog .sales-report-card > div > span { color: #536fa0; font-size: 13px; }#salesReportDialog .sales-report-card strong { overflow: hidden; color: #11255b; font-size: 21px; line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.sales-report-card-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: #087dea; background: #e1f0ff; }.sales-report-card-icon svg { width: 27px; height: 27px; fill: none !important; stroke: currentColor !important; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#salesReportDialog .sales-report-range { color: #0d9876; background: linear-gradient(125deg, #f5fffc, #ecfbf6); border-color: #d7f2e7; }#salesReportDialog .sales-report-range .sales-report-card-icon,#salesReportDialog .sales-report-card-total .sales-report-card-icon,#salesReportDialog .sales-report-card-cash .sales-report-card-icon { color: #04956a; background: #dff8ed; }#salesReportDialog .sales-report-card-total { background: linear-gradient(125deg, #f4fffb, #effcf8); border-color: #d7f2e8; }#salesReportDialog .sales-report-card-income { background: linear-gradient(125deg, #fbfdff, #f0f8ff); }#salesReportDialog .sales-report-card-collections { background: linear-gradient(125deg, #fffaf4, #fff6ea); border-color: #ffead1; }#salesReportDialog .sales-report-card-collections .sales-report-card-icon { color: #db7908; background: #fff0d8; }#salesReportDialog .sales-report-card-paid { background: linear-gradient(125deg, #fff7fa, #fff0f5); border-color: #ffdae5; }#salesReportDialog .sales-report-card-paid .sales-report-card-icon { color: #dc2c66; background: #ffe0eb; }#salesReportDialog .sales-report-card-transfer { background: linear-gradient(125deg, #fcf9ff, #f6efff); border-color: #e9dcff; }#salesReportDialog .sales-report-card-transfer .sales-report-card-icon { color: #9a2ce7; background: #eedfff; }#salesReportDialog .sales-report-card-mix { background: linear-gradient(125deg, #fff9fb, #fff0f5); border-color: #ffdce6; }#salesReportDialog .sales-report-card-mix .sales-report-card-icon { color: #e32457; background: #ffe0e9; }

#salesReportDialog .sales-report-list { flex: 0 0 auto; display: grid; align-content: start; gap: 8px; min-height: 0; max-height: none; padding: 0; overflow: visible; }#salesReportDialog .sales-report-list .sale-row { border-color: #dfebf8; border-radius: 13px; background: rgba(255,255,255,.88); }#salesReportDialog .sales-report-list .collection-row.is-settled-payment { border-color: #b9ead9; background: rgba(239,255,249,.92); }#salesReportDialog .sales-report-empty { display: grid; min-height: 190px; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 1px dashed #cce1fc; border-radius: 15px; color: #12265b; background: rgba(255,255,255,.58); text-align: center; }.sales-report-empty > span { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 50%; color: #829ac4; background: #e9f3ff; }.sales-report-empty svg { width: 37px; height: 37px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.sales-report-empty strong { font-size: 17px; }.sales-report-empty p { margin: 0; color: #6c82ab; font-size: 13px; }
#salesReportDialog .sales-report-actions { display: flex; justify-content: flex-end; margin: 0; }#salesReportDialog .sales-report-actions button { min-height: 38px; }

@media (min-width: 721px) and (max-width: 1440px) {
  #salesReportDialog .sales-report-body { gap: 11px; padding: 18px 22px 13px; }#salesReportDialog .sales-report-head h2 { font-size: 33px; }.sales-report-subtitle { font-size: 13px; }#salesReportDialog .sales-report-filter { gap: 9px; padding: 9px; }#salesReportDialog .sales-report-date-field,#salesReportDialog .sales-report-filter-button { min-height: 51px; }.sales-report-date-icon { width: 36px; height: 36px; border-radius: 11px; }.sales-report-date-icon svg { width: 20px; height: 20px; }.sales-report-date-copy small { font-size: 11px; }.sales-report-date-copy input { font-size: 14px; }#salesReportDialog .sales-report-summary { gap: 9px; }#salesReportDialog .sales-report-card { min-height: 70px; gap: 10px; padding: 10px 12px; border-radius: 12px; }.sales-report-card-icon { width: 39px; height: 39px; border-radius: 12px; }.sales-report-card-icon svg { width: 22px; height: 22px; }#salesReportDialog .sales-report-card > div > span { font-size: 11px; }#salesReportDialog .sales-report-card strong { font-size: 17px; }.sales-report-empty { min-height: 130px !important; }
}

@media (max-width: 720px) {
  #salesReportDialog.sales-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: linear-gradient(145deg, #fff, #f5faff); overflow-y: auto; overscroll-behavior: contain; }#salesReportDialog .sales-report-body { display: flex; flex-direction: column; gap: 18px; height: auto !important; min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom)); overflow: visible !important; overscroll-behavior: auto; }#salesReportDialog .sales-report-head { gap: 12px; }.sales-report-subtitle { max-width: 620px; font-size: 14px; line-height: 1.4; }#salesReportDialog .sales-report-head h2 { font-size: 34px; }#salesReportDialog .sales-report-head .icon-button { width: 46px; min-width: 46px; height: 46px; font-size: 31px; }
  #salesReportDialog .sales-report-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 14px; border-radius: 17px; }#salesReportDialog .sales-report-date-field { min-height: 106px; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 13px; }.sales-report-date-icon { width: 46px; height: 46px; }.sales-report-date-copy { padding-top: 8px; }.sales-report-date-copy small { font-size: 14px; }.sales-report-date-copy input { font-size: 15px; }#salesReportDialog .sales-report-filter-button { grid-column: 1 / -1; min-height: 58px; font-size: 17px; }
  /* En teléfonos, la fecha ocupa una segunda fila completa. Safari asigna a
     type="date" un ancho interno mayor que la columna y, si comparte fila con
     el icono, el año termina fuera de la tarjeta. */
  #salesReportDialog .sales-report-date-field {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: 40px auto;
    align-items: center;
    column-gap: 9px;
    row-gap: 8px;
    overflow: hidden;
  }
  #salesReportDialog .sales-report-date-icon {
    width: 40px;
    height: 40px;
    grid-column: 1;
    grid-row: 1;
  }
  #salesReportDialog .sales-report-date-copy { display: contents; }
  #salesReportDialog .sales-report-date-copy small {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    font-size: 13px;
  }
  #salesReportDialog .sales-report-date-copy input {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    box-sizing: border-box;
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.2;
    letter-spacing: -.025em;
    white-space: nowrap;
  }
  #salesReportDialog .sales-report-date-copy input::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
  }
  #salesReportDialog .sales-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.sales-report-range { display: none !important; }#salesReportDialog .sales-report-card { min-height: 122px; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 17px; }.sales-report-card-icon { width: 57px; height: 57px; border-radius: 17px; }.sales-report-card-icon svg { width: 31px; height: 31px; }#salesReportDialog .sales-report-card > div { padding-top: 7px; gap: 7px; }#salesReportDialog .sales-report-card > div > span { font-size: 13px; line-height: 1.2; }#salesReportDialog .sales-report-card strong { font-size: 24px; white-space: normal; }#salesReportDialog .sales-report-card-mix { grid-column: 1 / -1; }
  #salesReportDialog .sales-report-list { flex: 0 0 auto; overflow: visible; }#salesReportDialog .sales-report-empty { min-height: 260px; padding: 28px 20px; border-radius: 17px; }.sales-report-empty > span { width: 78px; height: 78px; }.sales-report-empty strong { max-width: 280px; font-size: 20px; }.sales-report-empty p { font-size: 15px; }#salesReportDialog .sales-report-actions { display: none; }
}

/* Caja comparte el sistema visual de Ventas sin cambiar su lógica de caja diaria. */
#salesDialog { width: min(1180px, calc(100vw - 44px)); border: 1px solid #d8e7f7; border-radius: 23px; background: linear-gradient(135deg, #fbfdff, #f5faff 57%, #fff); box-shadow: 0 24px 65px rgba(30, 83, 134, .19); }
#salesDialog .cash-summary-body { display: flex; flex-direction: column; gap: 16px; padding: 24px 28px 16px; background: transparent; }
#salesDialog .cash-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0; }
#salesDialog .cash-summary-head h2 { margin: 3px 0; color: #10235a; font-size: clamp(29px, 2.8vw, 40px); letter-spacing: -.045em; }
#salesDialog .cash-summary-head .eyebrow { color: #0b957d; }
.cash-summary-subtitle { margin: 0; color: #5872a0; font-size: 15px; }
#salesDialog #salesSummary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.cash-user-scope { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: #48658e; font-size: 13px; font-weight: 700; }
.cash-user-scope select { width: min(100%, 300px); min-height: 44px; padding: 0 38px 0 13px; border: 1px solid #cfe0f3; border-radius: 12px; color: #10235a; background: #fff; font: inherit; }
#salesDialog .cash-summary-card { display: flex; min-width: 0; min-height: 88px; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid #dceafb; border-radius: 15px; background: rgba(255,255,255,.82); }
#salesDialog .cash-summary-card > div { display: grid; min-width: 0; gap: 6px; }
#salesDialog .cash-summary-card > div > span { color: #536fa0; font-size: 13px; }
#salesDialog .cash-summary-card strong { overflow: hidden; color: #11255b; font-size: 21px; line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
#salesDialog .cash-summary-card-balance { grid-column: 1 / -1; min-height: 132px; padding: 22px 26px; border-color: #bfeadb; background: linear-gradient(125deg, #f1fff9, #e8f9f3 58%, #f6fffc); }
#salesDialog .cash-summary-card-balance .cash-summary-card-icon { width: 68px; height: 68px; border-radius: 21px; color: #078b6b; background: #d4f5e9; }
#salesDialog .cash-summary-card-balance .cash-summary-card-icon svg { width: 38px; height: 38px; }
#salesDialog .cash-summary-card-balance > div > span { color: #256a5b; font-size: 15px; font-weight: 700; }
#salesDialog .cash-summary-card-balance strong { color: #087a60; font-size: clamp(34px, 4vw, 48px); }
#salesDialog .cash-summary-card-balance small { color: #57746d; font-size: 13px; }
.cash-summary-card-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: #087dea; background: #e1f0ff; }
.cash-summary-card-icon svg { width: 27px; height: 27px; fill: none !important; stroke: currentColor !important; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#salesDialog .cash-summary-card-date,#salesDialog .cash-summary-card-total { background: linear-gradient(125deg, #f4fffb, #effcf8); border-color: #d7f2e8; }
#salesDialog .cash-summary-card-date .cash-summary-card-icon,#salesDialog .cash-summary-card-total .cash-summary-card-icon,#salesDialog .cash-summary-card-cash .cash-summary-card-icon { color: #04956a; background: #dff8ed; }
#salesDialog .cash-summary-card-income { background: linear-gradient(125deg, #fbfdff, #f0f8ff); }
#salesDialog .cash-summary-card-collections { background: linear-gradient(125deg, #fffaf4, #fff6ea); border-color: #ffead1; }
#salesDialog .cash-summary-card-collections .cash-summary-card-icon { color: #db7908; background: #fff0d8; }
#salesDialog .cash-summary-card-paid { background: linear-gradient(125deg, #fff7fa, #fff0f5); border-color: #ffdae5; }
#salesDialog .cash-summary-card-paid .cash-summary-card-icon { color: #dc2c66; background: #ffe0eb; }
#salesDialog .cash-summary-card-transfer { background: linear-gradient(125deg, #fcf9ff, #f6efff); border-color: #e9dcff; }
#salesDialog .cash-summary-card-transfer .cash-summary-card-icon { color: #9a2ce7; background: #eedfff; }
#salesDialog .cash-summary-card-mix { background: linear-gradient(125deg, #fff9fb, #fff0f5); border-color: #ffdce6; }
#salesDialog .cash-summary-card-mix .cash-summary-card-icon { color: #e32457; background: #ffe0e9; }
#salesDialog #salesList { display: grid; align-content: start; gap: 8px; min-height: 0; max-height: min(38vh, 390px); padding: 0; overflow: auto; }
#salesDialog #salesList .sale-row { border-color: #dfebf8; border-radius: 13px; background: rgba(255,255,255,.88); }
#salesDialog .cash-summary-empty { display: grid; min-height: 190px; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 1px dashed #cce1fc; border-radius: 15px; color: #12265b; background: rgba(255,255,255,.58); text-align: center; }
#salesDialog .cash-summary-empty > span { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 50%; color: #829ac4; background: #e9f3ff; }
#salesDialog .cash-summary-empty svg { width: 37px; height: 37px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#salesDialog .cash-summary-empty strong { font-size: 17px; }
#salesDialog .cash-summary-empty p { margin: 0; color: #6c82ab; font-size: 13px; }
#salesDialog .dialog-actions { display: flex; justify-content: flex-end; margin: 0; }

@media (min-width: 721px) and (max-width: 1440px) {
  #salesDialog .cash-summary-body { gap: 11px; padding: 18px 22px 13px; } #salesDialog .cash-summary-head h2 { font-size: 33px; } .cash-summary-subtitle { font-size: 13px; } #salesDialog #salesSummary { gap: 9px; } #salesDialog .cash-summary-card { min-height: 70px; gap: 10px; padding: 10px 12px; border-radius: 12px; } .cash-summary-card-icon { width: 39px; height: 39px; border-radius: 12px; } .cash-summary-card-icon svg { width: 22px; height: 22px; } #salesDialog .cash-summary-card > div > span { font-size: 11px; } #salesDialog .cash-summary-card strong { font-size: 17px; } #salesDialog .cash-summary-empty { min-height: 130px; }
}

@media (max-width: 720px) {
  #salesDialog.sales-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: linear-gradient(145deg, #fff, #f5faff); overflow-y: auto; overscroll-behavior: contain; }
  #salesDialog .cash-summary-body { display: flex; flex-direction: column; gap: 18px; height: auto; min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom)); overflow: visible; }
  #salesDialog .cash-user-scope { align-items: stretch; flex-direction: column; } #salesDialog .cash-user-scope select { width: 100%; }
  #salesDialog .cash-summary-head { gap: 12px; } .cash-summary-subtitle { max-width: 620px; font-size: 14px; line-height: 1.4; } #salesDialog .cash-summary-head h2 { font-size: 34px; } #salesDialog .cash-summary-head .icon-button { width: 46px; min-width: 46px; height: 46px; font-size: 31px; }
  #salesDialog #salesSummary { grid-template-columns: 1fr; gap: 12px; } #salesDialog .cash-summary-card-date { display: none; } #salesDialog .cash-summary-card { min-height: 122px; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 17px; } .cash-summary-card-icon { width: 57px; height: 57px; border-radius: 17px; } .cash-summary-card-icon svg { width: 31px; height: 31px; } #salesDialog .cash-summary-card > div { padding-top: 7px; gap: 7px; } #salesDialog .cash-summary-card > div > span { font-size: 13px; line-height: 1.2; } #salesDialog .cash-summary-card strong { font-size: 24px; white-space: normal; } #salesDialog .cash-summary-card-balance { min-height: 150px; padding: 20px; } #salesDialog .cash-summary-card-balance strong { font-size: 38px; } #salesDialog .cash-summary-card-mix { grid-column: 1 / -1; }
  #salesDialog #salesList { flex: 0 0 auto; max-height: none; overflow: visible; } #salesDialog .cash-summary-empty { min-height: 260px; padding: 28px 20px; border-radius: 17px; } #salesDialog .cash-summary-empty > span { width: 78px; height: 78px; } #salesDialog .cash-summary-empty strong { max-width: 280px; font-size: 20px; } #salesDialog .cash-summary-empty p { font-size: 15px; } #salesDialog .dialog-actions { display: none; }
}

/* Configuración: una sola vista con secciones claras. Se conservan los mismos
   campos, identificadores y acciones existentes para no alterar la lógica. */
#settingsDialog.settings-dialog { width: calc(100dvw - 8px); max-width: none; height: calc(100dvh - 8px); max-height: none; margin: 4px; border: 1px solid #dbe9f6; border-radius: 18px; background: linear-gradient(145deg, #fbfdff, #f4faff); box-shadow: 0 20px 52px rgba(22, 69, 111, .22); }
#settingsDialog.settings-dialog #settingsForm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; height: 100%; max-height: none; padding: 28px; overflow: hidden; }
#settingsDialog .settings-dialog-head { align-items: start; margin: 0; padding: 0 0 13px; border-bottom: 1px solid #dfeaf6; }
#settingsDialog .settings-dialog-head h2 { color: #101e59; font-size: 29px; letter-spacing: -.03em; }
#settingsDialog .settings-dialog-head .eyebrow { margin-bottom: 3px; color: #078d7c; font-size: 11px; letter-spacing: .11em; }
#settingsDialog .settings-dialog-head p:last-child { max-width: 680px; margin: 4px 0 0; color: #667da8; font-size: 13px; line-height: 1.35; }
#settingsDialog .settings-dialog-head .icon-button { width: 48px; height: 48px; border-color: #d9e7f7; border-radius: 13px; color: #10255e; background: #fff; box-shadow: 0 4px 10px rgba(42, 84, 132, .06); }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 0; overflow: hidden; border: 1px solid #dce9f6; border-radius: 16px; background: rgba(255,255,255,.72); }
.settings-navigation { display: grid; align-content: start; gap: 4px; padding: 16px 11px; border-right: 1px solid #e1ecf7; background: linear-gradient(180deg, #fbfdff, #f2f8ff); }.settings-navigation p { margin: 0 8px 8px; color: #4a6387; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }.settings-navigation a { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 0 9px; border-left: 3px solid transparent; border-radius: 8px; color: #1c3769; font-size: 11px; font-weight: 780; text-decoration: none; }.settings-navigation a span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 7px; color: #197ce0; background: #e9f3ff; font-size: 15px; }.settings-navigation a:hover,.settings-navigation a.active { border-left-color: #06a589; color: #093d42; background: linear-gradient(90deg, #d9f9ef, #edfcf8); }.settings-navigation a.active span { color: #07866f; background: #cefae9; }
.settings-scroll { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 17px; scroll-behavior: smooth; }.settings-section { position: relative; display: grid; gap: 15px; margin: 0 0 15px; padding: 17px; border: 1px solid #dce9f7; border-radius: 15px; background: linear-gradient(145deg, #fff, #fbfdff); box-shadow: 0 6px 18px rgba(38, 80, 124, .04); }.settings-section:last-child { margin-bottom: 0; }.settings-section-heading { display: flex; align-items: center; gap: 11px; }.settings-section-heading h3,.settings-mini-heading h4 { margin: 0; color: #11275c; font-size: 15px; }.settings-section-heading p,.settings-mini-heading p { margin: 3px 0 0; color: #647da8; font-size: 11px; line-height: 1.35; }.settings-section-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #078d73; background: linear-gradient(135deg, #dffbf0, #c9f4e3); font-size: 24px; font-weight: 850; }.settings-section-icon.icon-public { color: #1279df; background: linear-gradient(135deg, #e7f3ff, #d9ebff); }.settings-section-icon.icon-appearance { color: #853bd5; background: linear-gradient(135deg, #f4e8ff, #e9dcff); }
.settings-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }.settings-field-grid > label { display: grid; gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid #e0ebf7; border-radius: 12px; background: #fbfdff; }.settings-field-grid > label > span { color: #284477; font-size: 11px; font-weight: 850; }.settings-field-grid input,.settings-field-grid select { min-width: 0; height: 41px; border-color: #d4e2f2; border-radius: 9px; color: #14285a; background: #fff; font-size: 13px; font-weight: 650; }.settings-field-grid small { color: #7184a5; font-size: 10px; line-height: 1.3; }.settings-field-grid .file-field input { padding: 7px; }.settings-field-grid .file-field { align-content: start; }
#settingsDialog .appointments-settings { gap: 15px; padding: 17px; border-color: #d9eaf7; background: linear-gradient(145deg, #f9fdff, #f2fbff); }.settings-anchor { position: relative; top: -3px; }.appointments-settings-head { gap: 18px; }.appointments-settings-head > .settings-section-heading { flex: 1; }.public-page-switches { gap: 7px; padding: 10px 12px; border: 1px solid #d7e9f7; border-radius: 12px; background: rgba(255,255,255,.82); }.switch-field { color: #1d416f; font-size: 11px; }.appointment-public-link-field { padding: 12px; border: 1px solid #dce8f6; border-radius: 12px; background: #fff; }.appointment-public-link-field > span { color: #274777; font-size: 11px; font-weight: 850; }.appointment-public-link-field small { color: #7183a2; font-size: 10px; }
#settingsDialog .public-contact-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 14px; border: 1px solid #e1eafd; border-radius: 13px; background: rgba(255,255,255,.78); }.settings-mini-heading { display: flex; grid-column: 1 / -1; align-items: center; gap: 9px; }.settings-mini-heading > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #7e3ed4; background: #f2e9ff; font-size: 20px; }.settings-mini-heading h4 { font-size: 13px; }.public-contact-links label { display: grid; gap: 6px; min-width: 0; }.public-contact-links label span { color: #2b4778; font-size: 11px; font-weight: 850; }.public-contact-links input { min-width: 0; height: 40px; border-color: #d5e3f3; border-radius: 9px; color: #193165; background: #fff; font-size: 12px; }.public-contact-links small { color: #7183a2; font-size: 10px; line-height: 1.25; }
.public-contact-profile-pair { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr); gap:8px; }
.public-contact-profile-field { display:grid; gap:6px; min-width:0; }
.public-contact-profile-field > span:first-child { color:#2b4778; font-size:11px; font-weight:850; }
.public-contact-links .public-contact-profile-pair input { width:100%; }
#settingsDialog .appointments-settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 14px; border: 1px solid #e0eaf7; border-radius: 13px; background: #fff; }.appointments-settings-fields > label { padding: 9px 10px; border: 1px solid #e4ecf7; border-radius: 10px; background: #fbfdff; }.appointments-settings-fields > label > span { color: #2c497a; font-size: 10px; font-weight: 850; }.appointments-settings-fields select { min-height: 38px; border-color: #d5e2f2; border-radius: 8px; background: #fff; font-size: 12px; }.appointment-schedule,.appointment-deposit,.appointments-settings-fields > .appointment-public-links { grid-column: 1 / -1; }.appointment-schedule { padding: 13px; border: 1px solid #dfeaf7; border-radius: 12px; background: #f9fcff; }.appointment-schedule h4 { margin: 0; color: #193266; font-size: 13px; }.appointment-schedule > p { margin: 3px 0 10px; color: #7082a2; font-size: 11px; }.appointment-weekly-schedule { gap: 6px; }.appointment-schedule-row { grid-template-columns: minmax(112px, 1fr) minmax(104px, .8fr) minmax(104px, .8fr); padding: 8px 9px; border-color: #dbe7f3; background: #fff; }.appointment-deposit { padding: 12px; border: 1px solid #fde4bf; border-radius: 12px; background: #fffaf1; }.appointment-deposit-fields { gap: 10px; }
.settings-appearance { background: linear-gradient(145deg, #fff, #fbf8ff); }.settings-appearance-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.settings-appearance .theme-preview { grid-column: auto; min-height: 60px; padding: 11px; border: 1px solid #e2d9f9; border-radius: 11px; background: #fff; }.settings-appearance .theme-preview-swatch { width: 36px; height: 36px; border-radius: 10px; }
#settingsDialog .settings-dialog-actions { margin: 0; padding: 0; }.settings-dialog-actions .ghost-button,.settings-dialog-actions .primary-button { min-width: 172px; min-height: 48px; border-radius: 11px; }.settings-dialog-actions .primary-button { background: linear-gradient(125deg, #08aa95, #096bb6); box-shadow: 0 8px 17px rgba(7, 124, 157, .18); }

@media (max-width: 720px) {
  #settingsDialog.settings-dialog { position: fixed; inset: 0; width: 100dvw; max-width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  #settingsDialog.settings-dialog #settingsForm { gap: 13px; padding: calc(15px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom)); }
  #settingsDialog .settings-dialog-head { align-items: start; padding-bottom: 10px; }.settings-dialog-head h2 { font-size: 23px !important; }.settings-dialog-head p:last-child { max-width: 260px; font-size: 11px !important; }.settings-dialog-head .icon-button { width: 43px !important; height: 43px !important; font-size: 27px; }
  .settings-layout { display: block; overflow: hidden; border: 0; border-radius: 0; background: transparent; }.settings-navigation { display: none; }.settings-scroll { height: 100%; padding: 0 1px 16px; }.settings-section { gap: 12px; margin-bottom: 12px; padding: 13px; border-radius: 14px; }.settings-section-heading { gap: 9px; }.settings-section-icon { width: 39px; height: 39px; border-radius: 12px; font-size: 21px; }.settings-section-heading h3 { font-size: 14px; }.settings-section-heading p { font-size: 10px; }
  .settings-field-grid { grid-template-columns: 1fr; gap: 9px; }.settings-field-grid > label { padding: 9px 10px; }.settings-field-grid input,.settings-field-grid select { height: 40px; font-size: 12px; }
  #settingsDialog .appointments-settings { gap: 12px; padding: 13px; }.appointments-settings-head { display: grid; gap: 10px; }.public-page-switches { padding: 9px 10px; }.switch-field { font-size: 10px; white-space: normal; }.appointment-public-link-actions { display: grid; grid-template-columns: 1fr 1fr; }.appointment-public-link-actions input { grid-column: 1 / -1; min-height: 39px; }.appointment-public-link-actions button { min-height: 39px; padding: 0 8px; font-size: 11px; }
  #settingsDialog .public-contact-links,#settingsDialog .appointments-settings-fields { grid-template-columns: 1fr; gap: 9px; padding: 11px; }.settings-mini-heading { grid-column: auto; }.appointment-schedule,.appointment-deposit,.appointments-settings-fields > .appointment-public-links { grid-column: auto; }.appointment-schedule { padding: 11px; }.appointment-schedule-row { grid-template-columns: 1fr 1fr; gap: 7px; }.appointment-day-toggle { grid-column: 1 / -1; }.appointment-time-control { font-size: 9px; }.appointment-time-control input { min-height: 34px; font-size: 11px; }.appointment-deposit { padding: 11px; }
  .public-contact-profile-pair { grid-template-columns:1fr; }
  .settings-appearance-grid { grid-template-columns: 1fr; }.settings-appearance .theme-preview { grid-column: auto; }.settings-dialog-actions .ghost-button,.settings-dialog-actions .primary-button { min-width: 0; min-height: 48px; padding: 0 9px; font-size: 12px; }.settings-dialog-actions { display: grid !important; grid-template-columns: 1fr 1.45fr; gap: 9px; }
}

/* Safari en iPhone amplía automáticamente los controles con texto menor de
   16px. En pantallas táctiles se mantiene ese mínimo para abrir solo el
   teclado, también en entradas de inventario y formularios de proveedores. */
@media (max-width: 720px) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Entrada de inventario en escritorio: jerarquía visual propia para registrar
   facturas de proveedores sin tocar los controles, cálculos ni persistencia. */
@media (min-width: 681px) {
  #payablesDialog.operation-dialog { width: calc(100dvw - 18px); height: calc(100dvh - 18px); max-height: calc(100dvh - 18px); margin: 9px auto; border: 1px solid #d9e8f6; border-radius: 20px; background: linear-gradient(145deg, #fbfdff, #f4faff); box-shadow: 0 24px 65px rgba(26, 70, 111, .22); }
  #payablesDialog.operation-dialog .print-dialog-body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; padding: 22px 24px 15px; background: transparent; }
  #payablesDialog.operation-dialog .dialog-head { align-items: center; margin: 0; padding: 0 0 14px; border-bottom: 1px solid #dce8f5; }
  #payablesDialog.operation-dialog .dialog-head .eyebrow { margin-bottom: 4px; color: #078d7c; font-size: 10px; letter-spacing: .12em; }
  #payablesDialog.operation-dialog .dialog-head h2 { color: #11245a; font-size: 29px; letter-spacing: -.035em; }
  #payablesDialog.operation-dialog .dialog-head .icon-button { width: 47px; height: 47px; border-color: #d5e5f6; border-radius: 13px; color: #10255e; background: #fff; font-size: 28px; box-shadow: 0 4px 11px rgba(42, 84, 132, .07); }
  #payablesDialog.operation-dialog .purchase-form { grid-template-columns: minmax(270px, 1.45fr) minmax(205px, .95fr) minmax(190px, .86fr) minmax(190px, .86fr); align-content: start; gap: 14px 12px; margin: 0; padding: 16px; border-color: #d9e7f4; border-radius: 15px; background: rgba(255,255,255,.9); box-shadow: 0 7px 18px rgba(34, 76, 118, .045); }
  #payablesDialog.operation-dialog .purchase-form > label { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; }
  #payablesDialog.operation-dialog .purchase-form > label > span,#payablesDialog.operation-dialog .purchase-line-form label > span { color: #294675; font-size: 10px; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
  #payablesDialog.operation-dialog .purchase-form input,#payablesDialog.operation-dialog .purchase-form select { min-height: 42px; border-color: #d4e2f1; border-radius: 9px; color: #172b5e; background: #fff; font-weight: 650; }
  #payablesDialog.operation-dialog .purchase-form input:focus,#payablesDialog.operation-dialog .purchase-form select:focus { border-color: #0a9b89; box-shadow: 0 0 0 3px rgba(10,155,137,.12); outline: 0; }
  #payablesDialog.operation-dialog .purchase-form .customer-picker { gap: 7px; }.purchase-form .customer-picker .add-customer-button { width: 42px; min-width: 42px; height: 42px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #0da592, #0874a8); font-size: 24px; box-shadow: 0 6px 13px rgba(5,132,149,.15); }
  #payablesDialog.operation-dialog .purchase-line-form { position: relative; grid-template-columns: minmax(245px, 2.1fr) minmax(125px, .85fr) minmax(115px, .8fr) 82px minmax(125px, .9fr) minmax(125px, .9fr) auto; gap: 10px; padding: 42px 12px 12px; border: 1px solid #dce8f5; border-radius: 13px; background: linear-gradient(145deg, #f9fcff, #fff); }
  #payablesDialog.operation-dialog .purchase-line-form::before { content: "Productos de la factura"; position: absolute; top: 13px; left: 13px; color: #12285d; font-size: 14px; font-weight: 850; }
  #payablesDialog.operation-dialog .purchase-line-form::after { content: "Agrega los productos incluidos en esta factura."; position: absolute; top: 16px; left: 176px; color: #6c82a7; font-size: 11px; }
  #payablesDialog.operation-dialog .purchase-line-form label { display: grid; gap: 6px; min-width: 0; }.purchase-line-form .purchase-qty-field { max-width: none; }.purchase-line-form .secondary-button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #0da592, #0874a8); font-size: 12px; font-weight: 800; box-shadow: 0 6px 13px rgba(5,132,149,.15); white-space: nowrap; }
  #payablesDialog.operation-dialog .purchase-lines { min-height: 120px; padding: 10px; border: 1px dashed #d8e6f4; border-radius: 12px; background: #fcfeff; }.purchase-line-header,.purchase-line-row,.purchase-line-total { border-color: #dce8f4; border-radius: 10px; }.purchase-line-header { color: #46638e; background: #eef6ff; font-weight: 800; }.purchase-line-total { color: #087d70; background: #f0fcf8; }
  #payablesDialog.operation-dialog .purchase-form > .dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 0; padding-top: 1px; }.purchase-form > .dialog-actions .ghost-button,.purchase-form > .dialog-actions .primary-button { min-width: 135px; min-height: 43px; border-radius: 10px; font-size: 12px; font-weight: 800; }.purchase-form > .dialog-actions .primary-button { background: linear-gradient(125deg, #08aa95, #096bb6); box-shadow: 0 8px 16px rgba(7,124,157,.16); }
  #payablesDialog.operation-dialog > .print-dialog-body > .dialog-actions { justify-content: flex-end; margin: 0; }.payables-list-section { min-height: 0; }
}

/* Cuentas por cobrar: panel de escritorio y tarjetas de lectura rápida en
   móvil. Los estilos son propios para no alterar Ventas ni Caja. */
#receivablesDialog.receivables-dialog {
  width: calc(100vw - 56px);
  height: calc((100vh - 42px) / var(--app-scale));
  max-width: none;
  max-height: none;
  border-radius: 18px;
  background: #fff;
}

#receivablesDialog .receivables-dialog-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 28px 20px;
  overflow: hidden;
  background: #fff;
}

.receivables-head { flex: 0 0 auto; margin-bottom: 16px; }
.receivables-head h2 { margin-bottom: 3px; font-size: 28px; }
.receivables-subtitle { margin: 0; color: #617188; font-size: 14px; }

#receivablesSummary {
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

#receivablesSummary .receivable-kpi {
  display: flex;
  grid-template: none;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 18px;
  border-radius: 12px;
}

.receivable-kpi > div { display: grid; gap: 5px; min-width: 0; }
.receivable-kpi-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 14px;
}
.receivable-kpi-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#receivablesSummary .receivable-kpi span:not(.receivable-kpi-icon) { color: #172337; font-size: 13px; font-weight: 700; }
#receivablesSummary .receivable-kpi strong { color: #087762; font-size: 23px; line-height: 1; }
#receivablesSummary .receivable-kpi small { color: #68758a; font-size: 12px; }
.receivable-kpi-invoices { border-color: #cde9e1 !important; background: linear-gradient(135deg, #f4fcf9, #edf8f5) !important; }
.receivable-kpi-invoices .receivable-kpi-icon { color: #098f77; background: #dcf5ed; }
.receivable-kpi-total { border-color: #cadef4 !important; background: linear-gradient(135deg, #f4f9ff, #edf5fd) !important; }
.receivable-kpi-total .receivable-kpi-icon { color: #0876c9; background: #deefff; }
.receivable-kpi-paid { border-color: #f4dfb9 !important; background: linear-gradient(135deg, #fffaf0, #fff5e3) !important; }
.receivable-kpi-paid .receivable-kpi-icon { color: #af6b00; background: #ffedc5; }
.receivable-kpi-overdue { border-color: #f0cdd0 !important; background: linear-gradient(135deg, #fff7f7, #ffedef) !important; }
.receivable-kpi-overdue .receivable-kpi-icon { color: #bf1720; background: #ffdfe2; }
#receivablesSummary .receivable-kpi-overdue strong { color: #b3131c; }

#receivablesList {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
}

.receivables-filters {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(280px, 2.1fr) minmax(135px, .8fr) minmax(135px, .8fr) minmax(180px, 1.25fr) auto;
  gap: 12px;
  align-items: end;
}
.receivables-filters label { display: grid; gap: 6px; color: #18253a; font-size: 12px; font-weight: 700; }
.receivables-filters input,
.receivables-filters select { min-width: 0; height: 46px; border: 1px solid #cedbea; border-radius: 9px; color: #142039; background: #fff; font: inherit; font-size: 13px; }
.receivables-search { position: relative; display: block !important; }
.receivables-search > span { position: absolute; z-index: 1; left: 15px; top: 12px; color: #0b1d3b; }
.receivables-search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.receivables-search input { width: 100%; padding-left: 48px; }
.receivables-clear { display: flex; gap: 7px; align-items: center; justify-content: center; height: 46px; white-space: nowrap; }
.receivables-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.receivables-mobile-tabs { display: none; }

.receivables-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid #d6e2ee; border-radius: 10px; }
.receivables-table { width: 100%; border-collapse: collapse; color: #172337; font-size: 12px; white-space: nowrap; }
.receivables-table th { position: sticky; z-index: 1; top: 0; padding: 12px 10px; color: #fff; background: linear-gradient(135deg, #006d62, #006157); text-align: left; }
.receivables-table td { padding: 9px 10px; border-bottom: 1px solid #dce5ed; background: #fff; }
.receivables-table tbody tr:nth-child(even) td { background: #fbfdff; }
.receivables-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: #008f7e; }
.receivables-table .is-pending { color: #087d67; }
.receivables-table .is-overdue { color: #cf171f; }
.receivable-status { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 4px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.receivable-status.is-pending { color: #0968ad; background: #e3f1ff; }
.receivable-status.is-overdue { color: #bf1821; background: #ffe1e4; }
.receivable-table-actions { display: flex; gap: 7px; }
.receivable-table-actions .primary-button { min-width: 88px; min-height: 34px; padding: 6px 14px; }
.receivable-table-actions .ghost-button { min-width: 38px; min-height: 34px; padding: 4px 10px; font-size: 18px; }
.receivables-mobile-list { display: none; }
.receivables-footer { display: flex; flex: 0 0 auto; align-items: center; min-height: 28px; color: #56677f; font-size: 13px; }
#receivablesDialog > .print-dialog-body > .dialog-actions { flex: 0 0 auto; margin-top: 0; }

.receivable-detail-dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); border-radius: 20px; background: #fff; }
.receivable-detail-body { max-height: calc(100dvh - 28px); padding: 26px; overflow: auto; background: #fff; }
.receivable-detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.receivable-detail-head h2 { margin: 2px 0 0; color: #071a42; font-size: 30px; }
.receivable-detail-head .icon-button { width: 42px; height: 42px; }
.receivable-detail-balance { display: block; margin: 18px 0; color: #087c68; font-size: 30px; }
.receivable-detail-balance.is-overdue { color: #c71622; }
.receivable-overdue-notice { display: flex; gap: 14px; align-items: center; padding: 18px; border: 1px solid #f5cfd2; border-radius: 14px; color: #c51721; background: linear-gradient(135deg, #fff8f8, #ffeded); }
.receivable-overdue-notice.is-current { color: #087664; border-color: #cce8e1; background: #f0faf7; }
.receivable-overdue-notice > svg { flex: 0 0 30px; width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.receivable-overdue-notice div { display: grid; gap: 6px; }
.receivable-overdue-notice span { font-size: 13px; }
.receivable-detail-section { margin-top: 22px; }
.receivable-detail-section h3 { margin: 0 0 10px; color: #0d1832; font-size: 14px; text-transform: uppercase; }
.receivable-detail-card { display: grid; gap: 12px; padding: 18px; border: 1px solid #dce5ed; border-radius: 14px; background: #fff; }
.receivable-detail-card p { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; margin: 0; color: #18243d; }
.receivable-detail-card svg,
.receivable-detail-notes > svg,
.receivable-detail-actions svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.receivable-detail-values p { grid-template-columns: 26px minmax(0, 1fr) auto; }
.receivable-detail-values .is-overdue { color: #c51620; }
.receivable-detail-values .is-paid { color: #087b67; }
.receivable-detail-notes { display: flex; flex-direction: row; align-items: center; color: #6a778b; }
.receivable-detail-actions { display: grid; gap: 12px; margin-top: 24px; }
.receivable-detail-actions > button { width: 100%; min-height: 52px; }
.receivable-detail-actions > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.receivable-detail-actions button { display: flex; gap: 9px; align-items: center; justify-content: center; }

@media (max-width: 720px) {
  #receivablesDialog.receivables-dialog {
    width: 100dvw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  #receivablesDialog .receivables-dialog-body { display: block; height: 100%; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .receivables-head { align-items: start; margin-bottom: 14px; }
  .receivables-head h2 { font-size: 25px; }
  .receivables-subtitle { max-width: 310px; font-size: 13px; line-height: 1.4; }
  #receivablesSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  #receivablesSummary .receivable-kpi { align-items: flex-start; gap: 10px; min-height: 124px; padding: 13px 11px; }
  .receivable-kpi-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 12px; }
  .receivable-kpi-icon svg { width: 24px; height: 24px; }
  #receivablesSummary .receivable-kpi span:not(.receivable-kpi-icon) { font-size: 12px; }
  #receivablesSummary .receivable-kpi strong { font-size: 20px; line-height: 1.12; }
  #receivablesSummary .receivable-kpi small { font-size: 11px; line-height: 1.25; }
  #receivablesList { display: block; max-height: none; overflow: visible; }
  .receivables-filters { grid-template-columns: minmax(0, 1fr) 50px; margin-bottom: 12px; }
  .receivables-filters > label:not(.receivables-search) { display: none; }
  .receivables-search input { height: 50px; font-size: 16px; }
  .receivables-clear { width: 50px; height: 50px; min-width: 50px; padding: 0; }
  .receivables-clear span { display: none; }
  .receivables-mobile-tabs { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
  .receivables-mobile-tabs::-webkit-scrollbar { display: none; }
  .receivables-mobile-tabs button { flex: 0 0 auto; min-height: 44px; padding: 8px 15px; border: 1px solid #d8e3ed; border-radius: 11px; color: #17243a; background: #fff; font-weight: 700; }
  .receivables-mobile-tabs button.is-active { color: #fff; border-color: #008f7c; background: linear-gradient(135deg, #08a894, #007f70); }
  .receivables-mobile-tabs button.is-danger:not(.is-active) { color: #b7161f; background: #fff5f5; }
  .receivables-table-wrap { display: none; }
  .receivables-mobile-list { display: grid; gap: 10px; }
  .receivable-mobile-card { position: relative; overflow: hidden; padding: 13px 11px 11px 16px; border: 1px solid #d8e3ed; border-radius: 14px; background: #fff; box-shadow: 0 4px 13px rgba(24, 54, 84, .06); }
  .receivable-mobile-card::before { position: absolute; inset: 0 auto 0 0; width: 5px; content: ""; background: #51cdbc; }
  .receivable-mobile-card.is-overdue::before { background: #ff5b62; }
  .receivable-mobile-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .receivable-mobile-main > div { display: grid; gap: 5px; }
  .receivable-mobile-main > div:last-child { grid-template-columns: auto auto; align-items: center; justify-items: end; }
  .receivable-mobile-main strong { color: #101f40; font-size: 17px; }
  .receivable-mobile-main span { display: flex; gap: 6px; align-items: center; color: #576982; font-size: 13px; }
  .receivable-mobile-main svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .receivable-mobile-main .ghost-button { width: 40px; min-width: 40px; min-height: 34px; padding: 2px 8px; font-size: 20px; }
  .receivable-card-balance { grid-column: 1 / -1; color: #07826b !important; font-size: 17px !important; }
  .receivable-mobile-card.is-overdue .receivable-card-balance { color: #c81722 !important; }
  .receivable-card-days { grid-column: 1 / -1; }
  .receivable-card-days.is-overdue { color: #d11922; }
  .receivable-collect-button { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; min-height: 43px; margin-top: 10px; }
  .receivable-collect-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .receivables-footer { margin: 14px 0 4px; }
  #receivablesDialog > .print-dialog-body > .dialog-actions { display: none; }
  .receivable-detail-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .receivable-detail-body { max-height: 100dvh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .receivable-detail-head h2 { font-size: 27px; }
  .receivable-detail-balance { font-size: 28px; }
  .receivable-detail-actions > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receivable-detail-actions > div button { min-height: 92px; flex-direction: column; }
}

/* Cuentas por pagar comparte la jerarquía visual de cobros, pero conserva
   sin cambios el formulario de entrada de inventario cuando se abre. */
#payablesDialog.payables-dialog:not(.is-entry-mode) {
  width: calc(100vw - 56px);
  height: calc((100vh - 42px) / var(--app-scale));
  max-width: none;
  max-height: none;
  border-radius: 18px;
  background: #fff;
}
#payablesDialog.payables-dialog:not(.is-entry-mode) .payables-dialog-body { display: flex; flex-direction: column; height: 100%; padding: 22px 28px 18px; overflow: hidden; background: #fff; }
#payablesDialog:not(.is-entry-mode) .purchase-dialog-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; flex: 0 0 auto; align-items: center; margin-bottom: 16px; }
#payablesDialog:not(.is-entry-mode) .purchase-dialog-head h2 { margin-bottom: 3px; font-size: 28px; }
#payablesDialog:not(.is-entry-mode) .purchase-dialog-mark { width: 56px; height: 56px; color: #1269e8; background: #e8f1ff; }
.payables-new-invoice-head { display: flex; gap: 7px; align-items: center; min-height: 45px; padding-inline: 22px; }
#payablesDialog.is-entry-mode .payables-new-invoice-head { display: none; }
#payablesListSection { flex: 1 1 auto; min-height: 0; }
#payablesDialog:not(.is-entry-mode) #payablesListSection { display: flex; flex-direction: column; gap: 12px; }
#payablesSummary { flex: 0 0 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 2px; }
#payablesSummary .payable-kpi { display: flex; grid-template: none; align-items: center; gap: 16px; min-height: 112px; padding: 18px; border-radius: 12px; }
.payable-kpi > div { display: grid; gap: 5px; min-width: 0; }
.payable-kpi-icon { display: grid; flex: 0 0 54px; width: 54px; height: 54px; place-items: center; border-radius: 14px; }
.payable-kpi-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#payablesSummary .payable-kpi span:not(.payable-kpi-icon) { color: #172337; font-size: 13px; font-weight: 700; }
#payablesSummary .payable-kpi strong { color: #087762; font-size: 23px; line-height: 1; }
#payablesSummary .payable-kpi small { color: #68758a; font-size: 12px; }
.payable-kpi-invoices { border-color: #cadef4 !important; background: linear-gradient(135deg, #f4f9ff, #edf5fd) !important; }
.payable-kpi-invoices .payable-kpi-icon { color: #1269e8; background: #dfecff; }
.payable-kpi-total { border-color: #cde9e1 !important; background: linear-gradient(135deg, #f4fcf9, #eaf8f4) !important; }
.payable-kpi-total .payable-kpi-icon { color: #078a74; background: #d5f5eb; }
.payable-kpi-paid { border-color: #f4dfb9 !important; background: linear-gradient(135deg, #fffaf0, #fff4df) !important; }
.payable-kpi-paid .payable-kpi-icon { color: #ad6500; background: #ffebc4; }
.payable-kpi-overdue { border-color: #f0cdd0 !important; background: linear-gradient(135deg, #fff7f7, #ffedef) !important; }
.payable-kpi-overdue .payable-kpi-icon { color: #c01620; background: #ffdfe2; }
#payablesSummary .payable-kpi-overdue strong { color: #bd151e; }
#payablesList { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; max-height: none; padding: 0; overflow: hidden; }
.payables-filters { display: grid; flex: 0 0 auto; grid-template-columns: minmax(280px, 2.1fr) minmax(135px, .8fr) minmax(135px, .8fr) minmax(180px, 1.25fr) auto; gap: 12px; align-items: end; }
.payables-filters label { display: grid; gap: 6px; color: #18253a; font-size: 12px; font-weight: 700; }
.payables-filters input,
.payables-filters select { min-width: 0; height: 46px; border: 1px solid #cedbea; border-radius: 9px; color: #142039; background: #fff; font: inherit; font-size: 13px; }
.payables-search { position: relative; display: block !important; }
.payables-search > span { position: absolute; z-index: 1; left: 15px; top: 12px; color: #0b1d3b; }
.payables-search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.payables-search input { width: 100%; padding-left: 48px; }
.payables-clear { display: flex; gap: 7px; align-items: center; justify-content: center; height: 46px; white-space: nowrap; }
.payables-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.payables-mobile-tabs { display: none; }
.payables-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid #d6e2ee; border-radius: 10px; }
.payables-table { width: 100%; border-collapse: collapse; color: #172337; font-size: 12px; white-space: nowrap; }
.payables-table th { position: sticky; z-index: 1; top: 0; padding: 12px 10px; color: #fff; background: linear-gradient(135deg, #006d62, #006157); text-align: left; }
.payables-table td { padding: 9px 10px; border-bottom: 1px solid #dce5ed; background: #fff; }
.payables-table tbody tr:nth-child(even) td { background: #fbfdff; }
.payables-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: #008f7e; }
.payables-table .is-pending { color: #087d67; }
.payables-table .is-overdue { color: #cf171f; }
.payables-table .is-paid { color: #07836d; }
.payable-status { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 4px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.payable-status.is-pending { color: #0968ad; background: #e3f1ff; }
.payable-status.is-overdue { color: #bf1821; background: #ffe1e4; }
.payable-status.is-paid { color: #08705d; background: #dff6ed; }
.payable-status.is-deleted { color: #a71924; background: #ffe3e5; }
.payable-table-actions { display: flex; gap: 7px; }
.payable-table-actions .primary-button,
.payable-table-actions > .ghost-button:first-child { min-width: 85px; min-height: 34px; padding: 6px 14px; }
.payable-table-actions > .ghost-button:last-child { min-width: 38px; min-height: 34px; padding: 4px 10px; font-size: 18px; }
.payables-mobile-list { display: none; }
.payables-footer { display: flex; flex: 0 0 auto; align-items: center; min-height: 28px; color: #56677f; font-size: 13px; }
.payables-list-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; padding-top: 2px; border-top: 1px solid #e0e8ef; }
.payables-list-actions button { min-width: 180px; }
#payablesDialog:not(.is-entry-mode) > .print-dialog-body > .dialog-actions { display: none; }

.payable-detail-dialog { width: min(540px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); border-radius: 20px; background: #fff; }
.payable-detail-body { max-height: calc(100dvh - 28px); padding: 24px; overflow: auto; background: #fff; }
.payable-detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 18px; }
.payable-detail-head h2 { margin: 0; color: #0a1938; font-size: 21px; }
.payable-detail-head p { margin: 3px 0 0; color: #697991; font-size: 13px; }
.payable-detail-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 15px; align-items: start; padding: 18px; border: 1px solid #dbe5ed; border-radius: 15px; }
.payable-detail-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 14px; color: #0b73dd; background: #e6f0ff; }
.payable-detail-icon svg { width: 33px; height: 33px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.payable-detail-hero > div { display: grid; gap: 5px; }
.payable-detail-hero h3 { margin: 0; color: #0b1939; font-size: 21px; }
.payable-detail-hero > div > strong { color: #07806a; font-size: 25px; }
.payable-detail-hero.is-overdue > div > strong,
.payable-detail-hero.is-overdue .payable-detail-days { color: #c71721; }
.payable-detail-hero > div > span { color: #677790; font-size: 13px; }
.payable-detail-days { display: flex; gap: 7px; align-items: center; }
.payable-detail-days svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.payable-detail-panel { margin-top: 12px; padding: 16px 18px; border: 1px solid #dbe5ed; border-radius: 14px; }
.payable-detail-panel h3 { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; color: #0e1d3b; font-size: 15px; }
.payable-detail-panel h3 svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; color: #087967; background: #ddf6ee; fill: none; stroke: currentColor; stroke-width: 1.8; }
.payable-detail-panel dl { display: grid; gap: 9px; margin: 0; }
.payable-detail-panel dl > div { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 1.2fr); gap: 10px; }
.payable-detail-panel dt { color: #687790; }
.payable-detail-panel dd { margin: 0; color: #101d38; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.payable-detail-panel dd.is-overdue { color: #cb1721; }
.payable-detail-panel dd.is-paid { color: #087b67; }
.payable-detail-lines { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.payable-detail-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #edf1f5; }
.payable-detail-lines li:first-child { border-top: 0; }
.payable-detail-lines span { display: flex; gap: 12px; align-items: center; }
.payable-detail-lines b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #f0f4f8; }
.payable-detail-empty { margin: 0; color: #6b7990; }
.payable-detail-actions { display: grid; gap: 10px; margin-top: 16px; }
.payable-detail-actions button { display: flex; gap: 9px; align-items: center; justify-content: center; min-height: 48px; }
.payable-detail-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.payable-detail-payment-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payable-payment-history { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.payable-payment-history li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid #dce7ee; border-radius: 11px; background: #f8fbfc; }
.payable-payment-history li > div { display: grid; gap: 3px; min-width: 0; }
.payable-payment-history li span { color: #617189; font-size: 12px; }
.payable-payment-history li > strong { flex: 0 0 auto; color: #087c68; }
.payable-mobile-payment-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payable-mobile-manage-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.payable-mobile-manage-actions button { min-height: 42px; }
.payable-deleted-notice { display: grid; gap: 5px; margin: 0 0 14px; padding: 13px 15px; border: 1px solid #efadb3; border-radius: 12px; color: #961722; background: #fff1f2; }
.payable-deleted-notice span, .payable-deleted-notice p { margin: 0; font-size: 13px; }
.payable-audit-entry { display: grid; gap: 4px; margin-top: 9px; padding: 11px 12px; border: 1px solid #dce7ee; border-radius: 11px; background: #f8fbfc; }
.payable-audit-entry:first-of-type { margin-top: 0; }
.payable-audit-entry > span, .payable-audit-entry p { margin: 0; color: #617189; font-size: 12px; }
.payable-audit-entry.is-deleted { border-color: #efc4c8; background: #fff5f5; }
.payable-audit-entry ul { display: grid; gap: 5px; margin: 5px 0 0; padding: 0; list-style: none; }
.payable-audit-entry li { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); gap: 8px; font-size: 12px; }
.payable-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.payable-edit-fields .form-span-2 { grid-column: 1 / -1; }
.payable-edit-dialog textarea, .payable-delete-dialog textarea { resize: vertical; }
.payable-delete-dialog .dialog-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payable-detail-hero.is-deleted { border-color: #efc4c8; background: linear-gradient(135deg, #fff8f8, #ffeded); }

@media (max-width: 720px) {
  #payablesDialog.payables-dialog:not(.is-entry-mode) { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  #payablesDialog.payables-dialog:not(.is-entry-mode) .payables-dialog-body { display: block; height: 100%; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
  #payablesDialog:not(.is-entry-mode) .purchase-dialog-head { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
  #payablesDialog:not(.is-entry-mode) .purchase-dialog-mark { width: 54px; height: 54px; }
  #payablesDialog:not(.is-entry-mode) .purchase-dialog-head h2 { font-size: 23px; }
  #payablesDialog:not(.is-entry-mode) .purchase-dialog-subtitle { font-size: 13px; line-height: 1.4; }
  #payablesDialog:not(.is-entry-mode) .payables-new-invoice-head { display: none; }
  #payablesDialog:not(.is-entry-mode) #payablesListSection { display: block; }
  #payablesSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  #payablesSummary .payable-kpi { align-items: flex-start; gap: 10px; min-height: 124px; padding: 13px 11px; }
  .payable-kpi-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 12px; }
  .payable-kpi-icon svg { width: 24px; height: 24px; }
  #payablesSummary .payable-kpi span:not(.payable-kpi-icon) { font-size: 12px; }
  #payablesSummary .payable-kpi strong { font-size: 20px; line-height: 1.12; }
  #payablesSummary .payable-kpi small { font-size: 11px; line-height: 1.25; }
  #payablesList { display: block; max-height: none; overflow: visible; }
  .payables-filters { grid-template-columns: minmax(0, 1fr) 50px; margin-bottom: 12px; }
  .payables-filters > label:not(.payables-search) { display: none; }
  .payables-search input { height: 50px; font-size: 16px; }
  .payables-clear { width: 50px; height: 50px; min-width: 50px; padding: 0; }
  .payables-clear span { display: none; }
  .payables-mobile-tabs { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
  .payables-mobile-tabs::-webkit-scrollbar { display: none; }
  .payables-mobile-tabs button { flex: 0 0 auto; min-height: 44px; padding: 8px 15px; border: 1px solid #d8e3ed; border-radius: 11px; color: #17243a; background: #fff; font-weight: 700; }
  .payables-mobile-tabs button.is-active { color: #fff; border-color: #008f7c; background: linear-gradient(135deg, #08a894, #007f70); }
  .payables-mobile-tabs button.is-danger:not(.is-active) { color: #b7161f; background: #fff5f5; }
  .payables-table-wrap { display: none; }
  .payables-mobile-list { display: grid; gap: 10px; }
  .payable-mobile-card { position: relative; overflow: hidden; padding: 13px 11px 11px 16px; border: 1px solid #d8e3ed; border-radius: 14px; background: #fff; box-shadow: 0 4px 13px rgba(24, 54, 84, .06); }
  .payable-mobile-card::before { position: absolute; inset: 0 auto 0 0; width: 5px; content: ""; background: #7ab9ff; }
  .payable-mobile-card.is-overdue::before { background: #ff555d; }
  .payable-mobile-card.is-paid::before { background: #54d2a9; }
  .payable-mobile-card.is-deleted::before { background: #d92d3a; }
  .payable-mobile-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .payable-mobile-main > div { display: grid; gap: 5px; }
  .payable-mobile-main > div:last-child { grid-template-columns: auto auto; align-items: center; justify-items: end; }
  .payable-mobile-main strong { color: #101f40; font-size: 17px; }
  .payable-mobile-main span { display: flex; gap: 6px; align-items: center; color: #576982; font-size: 13px; }
  .payable-mobile-main svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .payable-mobile-main .ghost-button { width: 40px; min-width: 40px; min-height: 34px; padding: 2px 8px; font-size: 20px; }
  .payable-card-balance { grid-column: 1 / -1; color: #07826b !important; font-size: 17px !important; }
  .payable-mobile-card.is-overdue .payable-card-balance { color: #c81722 !important; }
  .payable-card-days { grid-column: 1 / -1; }
  .payable-card-days.is-overdue { color: #d11922; }
  .payable-pay-button { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; min-height: 43px; margin-top: 10px; }
  .payable-mobile-payment-actions .payable-pay-button { margin-top: 10px; }
  .payable-pay-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .payables-footer { margin: 14px 0 4px; }
  .payables-list-actions { display: none; }
  .payable-detail-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .payable-detail-body { max-height: 100dvh; padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); }
  .payable-detail-hero { grid-template-columns: auto minmax(0, 1fr); }
  .payable-detail-hero > .payable-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .payable-detail-hero > div { grid-column: 2; }
  .payable-detail-panel dl > div { grid-template-columns: minmax(110px, 1fr) minmax(0, 1.25fr); }
  .payable-edit-fields { grid-template-columns: 1fr; }
  .payable-edit-fields .form-span-2 { grid-column: auto; }
  .payable-audit-entry li { grid-template-columns: 1fr; gap: 2px; }
}

/* Panel ejecutivo de Estadísticas. La jerarquía replica el tablero de
   referencia y conserva todos los análisis existentes. */
.analytics-dialog {
  width: calc(100vw - 34px);
  height: calc((100vh - 34px) / var(--app-scale));
  max-width: none;
  max-height: none;
  border-radius: 17px;
  background: #f7fafb;
}
.analytics-dialog .print-dialog-body { display: flex; flex-direction: column; height: 100%; padding: 18px 20px 14px; overflow: hidden; background: #f7fafb; }
.analytics-head { display: grid; grid-template-columns: auto minmax(230px, 1fr) auto auto; gap: 12px; align-items: center; flex: 0 0 auto; margin-bottom: 14px; }
.analytics-head-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 13px; color: #176ee4; background: #e8f1ff; }
.analytics-head-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.analytics-head h2 { margin: 0; color: #0a1c3f; font-size: 25px; }
.analytics-head .eyebrow { display: none; }
.analytics-head > div:first-of-type > p:last-child { max-width: 510px; margin: 4px 0 0; color: #64758d; font-size: 12px; line-height: 1.35; }
.analytics-head .icon-button { align-self: start; }
.analytics-filter { display: grid; grid-template-columns: auto minmax(126px, auto) auto auto; gap: 10px; align-items: center; min-height: 52px; margin: 0; padding: 7px 8px; border: 1px solid #d9e4ec; border-radius: 12px; background: #fff; }
.analytics-period-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; color: #087a68; background: #e5f6f1; font-size: 18px; }
.analytics-filter label { display: grid; gap: 1px; min-width: 120px; }
.analytics-filter label > span { color: #6b7a90; font-size: 10px; font-weight: 600; }
.analytics-filter select,
.analytics-filter input { min-height: 28px; padding: 2px 24px 2px 0; border: 0; color: #13213e; background: transparent; font-size: 12px; font-weight: 800; }
.analytics-range-label { padding-left: 10px; border-left: 1px solid #dce5ec; color: #66768d; font-size: 10px; white-space: nowrap; }
.analytics-filter .primary-button { min-height: 40px; padding: 8px 18px; white-space: nowrap; }
.analytics-custom-date { position: absolute; top: 76px; z-index: 4; padding: 9px; border: 1px solid #d8e3ec; border-radius: 9px; background: #fff; box-shadow: 0 10px 25px rgba(15,45,64,.15); }
.analytics-custom-date:nth-of-type(2) { right: 260px; }
.analytics-custom-date:nth-of-type(3) { right: 120px; }
.analytics-mobile-tabs { display: none; }
.analytics-dialog .analytics-content { flex: 1 1 auto; min-height: 0; padding: 0 5px 6px 0; overflow: auto; overscroll-behavior: contain; }
.analytics-dialog .dialog-actions { display: none; }
.analytics-content > section { scroll-margin-top: 12px; }

.analytics-kpis { display: grid; gap: 12px; }
.analytics-kpis-primary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-kpis-secondary { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 12px; }
.analytics-kpi { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 14px; border: 1px solid #d8e5e1; border-radius: 12px; background: #fff; box-shadow: none; }
.analytics-kpi::after { display: none; }
.analytics-kpi > div { display: grid; gap: 3px; min-width: 0; }
.analytics-kpi > div > span { color: #142039; font-size: 11px; font-weight: 600; }
.analytics-kpi strong { margin: 1px 0; color: #075f55; font-size: 19px; line-height: 1.1; white-space: nowrap; }
.analytics-kpi small { color: #69778c; font-size: 10px; line-height: 1.25; }
.analytics-kpi small.is-positive { color: #07966e; }
.analytics-kpi small.is-negative { color: #da2831; }
.analytics-kpi-visual { display: grid !important; flex: 0 0 45px; width: 45px; height: 45px; place-items: center; border-radius: 12px; }
.analytics-kpi-visual svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.analytics-kpi-primary { min-height: 92px; }
.analytics-kpi-primary strong { font-size: 22px; }
.analytics-kpi-compact { min-height: 88px; padding: 12px; }
.analytics-kpi-compact .analytics-kpi-visual { flex-basis: 41px; width: 41px; height: 41px; }
.analytics-kpi-green { border-color: #cce8e0; background: linear-gradient(135deg, #f5fcfa, #edf9f5); }
.analytics-kpi-green .analytics-kpi-visual { color: #078c75; background: #daf5ed; }
.analytics-kpi-blue { border-color: #cfe0f6; background: linear-gradient(135deg, #f6faff, #edf5ff); }
.analytics-kpi-blue .analytics-kpi-visual { color: #176fe1; background: #dfedff; }
.analytics-kpi-red { border-color: #f0d0d4; background: linear-gradient(135deg, #fff8f8, #ffeff1); }
.analytics-kpi-red .analytics-kpi-visual { color: #d72631; background: #ffe0e3; }
.analytics-kpi-red strong { color: #c61722; }
.analytics-kpi-amber { border-color: #f0dfbd; background: linear-gradient(135deg, #fffaf1, #fff5df); }
.analytics-kpi-amber .analytics-kpi-visual { color: #cc7a00; background: #ffedc7; }
.analytics-kpi-violet { border-color: #ded4f5; background: linear-gradient(135deg, #faf8ff, #f1edff); }
.analytics-kpi-violet .analytics-kpi-visual { color: #6d42dc; background: #e9e0ff; }
.analytics-kpi-cyan { border-color: #cce8ef; background: linear-gradient(135deg, #f6fcfe, #eaf8fb); }
.analytics-kpi-cyan .analytics-kpi-visual { color: #0a88b0; background: #def3f9; }
.analytics-kpi-slate { border-color: #dce4eb; background: linear-gradient(135deg, #fafcfd, #f2f6f8); }
.analytics-kpi-slate .analytics-kpi-visual { color: #516b7d; background: #e8eef2; }

.analytics-overview-grid { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.45fr); gap: 12px; margin-top: 12px; }
.analytics-panel,
.analytics-executive { padding: 15px; border: 1px solid #dce5ea; border-radius: 12px; background: #fff; box-shadow: none; }
.analytics-executive { margin: 0; border-left: 1px solid #dce5ea; }
.analytics-executive h3 { display: flex; gap: 9px; align-items: center; margin: 0 0 14px; color: #10203e; font-size: 15px; }
.analytics-executive h3 span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #078470; background: #dff6ee; }
.analytics-executive p { margin: 0; padding: 8px 0 8px 16px; border-left: 4px solid #0c9a80; color: #5f7089; font-size: 12px; line-height: 1.7; }
.analytics-sales-feature { min-height: 222px; }
.analytics-chart-panel { min-height: 245px; }
.analytics-chart-panel::before { display: none; }
.analytics-chart-panel canvas { height: 190px !important; }
.analytics-sales-feature canvas { height: 165px !important; }
.analytics-chart-heading { margin-bottom: 8px; }
.analytics-chart-heading h3 { color: #11213d; font-size: 15px; }
.analytics-chart-heading i { color: #3c546b; border: 1px solid #dce5eb; background: #fff; }
.analytics-three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.analytics-rankings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.analytics-rankings-grid .analytics-movement-ranking { grid-column: span 2; margin: 0; }
.analytics-movement-ranking { padding: 15px; }
.analytics-movement-ranking .analytics-chart-heading h3 { font-size: 15px; }
.analytics-movement-ranking .analytics-chart-heading p { font-size: 11px; }
.analytics-movement-head,
.analytics-movement-row { grid-template-columns: 48px minmax(130px, 1.35fr) minmax(95px, .7fr) minmax(115px, .8fr) minmax(100px, .7fr); gap: 8px; }
.analytics-movement-head { padding: 8px 10px; font-size: 9px; }
.analytics-movement-row { min-height: 53px; padding: 7px 10px; }
.analytics-movement-row strong { font-size: 12px; }
.analytics-movement-name strong { font-size: 12px; }
.analytics-movement-row small { font-size: 9px; }
.analytics-rank { width: 25px; height: 25px; font-size: 11px; }
.analytics-weekly-average { padding: 5px 7px; }
.analytics-list-row { font-size: 12px; }
.analytics-list-row b { display: inline-grid; width: 20px; height: 20px; place-items: center; margin-right: 5px; border-radius: 50%; color: #126a58; background: #e9f6f1; font-size: 10px; }

@media (max-width: 1100px) {
  .analytics-head { grid-template-columns: auto minmax(200px, 1fr) auto; }
  .analytics-filter { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .analytics-head > .icon-button { grid-column: 3; grid-row: 1; }
  .analytics-kpis-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-rankings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .analytics-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .analytics-dialog .print-dialog-body { display: block; height: 100%; padding: 13px 12px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; background: #f7fafb; }
  .analytics-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; margin-bottom: 10px; padding: 12px; border: 1px solid #dbe5eb; border-radius: 12px; background: #fff; }
  .analytics-head-icon { width: 42px; height: 42px; border-radius: 10px; }
  .analytics-head-icon svg { width: 24px; height: 24px; }
  .analytics-head h2 { font-size: 20px; }
  .analytics-head > div:first-of-type > p:last-child { font-size: 10px; }
  .analytics-head > .icon-button { width: 40px; min-width: 40px; min-height: 40px; }
  .analytics-filter { grid-column: 1 / -1; grid-row: 2; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 7px; }
  .analytics-period-icon { width: 34px; height: 34px; }
  .analytics-filter label { min-width: 0; }
  .analytics-filter select { width: 100%; font-size: 12px; }
  .analytics-range-label { grid-column: 2; grid-row: 2; padding: 0; border: 0; font-size: 9px; }
  .analytics-filter .primary-button { grid-column: 3; grid-row: 1 / span 2; min-height: 50px; padding: 7px 12px; }
  .analytics-filter .primary-button span { display: none; }
  .analytics-custom-date { position: static; grid-column: 1 / -1; }
  .analytics-mobile-tabs { position: sticky; z-index: 3; top: -13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 10px; padding: 5px; border: 1px solid #dce5eb; border-radius: 10px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
  .analytics-mobile-tabs button { min-height: 36px; padding: 6px 4px; border: 0; border-radius: 8px; color: #53657c; background: transparent; font-size: 10px; font-weight: 700; }
  .analytics-mobile-tabs button.is-active { color: #fff; background: linear-gradient(135deg, #0aa58f, #007c6c); }
  .analytics-dialog .analytics-content { overflow: visible; padding: 0; }
  .analytics-content > section { scroll-margin-top: 56px; }
  .analytics-kpis-primary,
  .analytics-kpis-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .analytics-kpis-secondary { margin-top: 8px; }
  .analytics-kpi { align-items: flex-start; gap: 8px; min-height: 92px; padding: 10px 8px; }
  .analytics-kpi-visual { flex-basis: 36px; width: 36px; height: 36px; border-radius: 9px; }
  .analytics-kpi-visual svg { width: 20px; height: 20px; }
  .analytics-kpi > div > span { font-size: 9px; }
  .analytics-kpi strong,
  .analytics-kpi-primary strong { font-size: 16px; white-space: normal; }
  .analytics-kpi small { font-size: 9px; }
  .analytics-overview-grid,
  .analytics-three-grid,
  .analytics-rankings-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 9px; }
  .analytics-rankings-grid .analytics-movement-ranking { grid-column: auto; }
  .analytics-panel,
  .analytics-executive { padding: 12px; border-radius: 11px; }
  .analytics-sales-feature,
  .analytics-chart-panel { min-height: 250px; }
  .analytics-chart-panel canvas,
  .analytics-sales-feature canvas { height: 205px !important; }
  .analytics-movement-head { display: none; }
  .analytics-movement-row { grid-template-columns: 31px minmax(0, 1fr); gap: 7px; padding: 10px 7px; }
  .analytics-movement-row > div:nth-of-type(1),
  .analytics-movement-row > div:nth-of-type(2),
  .analytics-movement-row > div:nth-of-type(3) { display: grid; grid-column: 2; }
  .analytics-movement-row > div:nth-of-type(4) { display: none; }
  .analytics-weekly-average { margin-top: 2px; }
}

/* Historial operativo de gastos. */
.expense-editor-dialog { width: min(820px, calc(100vw - 28px)); }
.expense-editor-dialog #expenseForm { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.expense-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.expense-form-grid > label { min-width: 0; }
.expense-form-grid > label > small { color: #718097; font-size: 10px; line-height: 1.35; }
.expense-category-picker { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }.expense-category-picker input { min-width: 0; }.expense-category-picker button { width: 48px; min-width: 48px; min-height: 46px; padding: 0; border-radius: 11px; font-size: 24px; line-height: 1; }.expense-category-editor { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #d5e5eb; border-radius: 11px; background: #f5fbfa; }.expense-category-editor > div { display: flex; gap: 7px; }.expense-category-editor button { min-height: 38px; padding: 0 12px; font-size: 12px; }.expense-category-editor small { min-height: 0; color: #a13445 !important; font-size: 11px; font-weight: 700; }
.expense-recurring-toggle { display: flex !important; grid-column: 1 / -1; min-height: 72px; align-items: center; grid-template-columns: none !important; gap: 12px !important; padding: 13px 15px; border: 1px solid #cfe4de; border-radius: 13px; background: linear-gradient(135deg, #f7fffc, #edf9f5); cursor: pointer; }
.expense-recurring-toggle > input { width: 22px !important; min-width: 22px; height: 22px; min-height: 22px !important; margin: 0; accent-color: #07947f; }
.expense-recurring-toggle > span { display: grid; gap: 3px; }
.expense-recurring-toggle strong { color: #123b38; font-size: 13px; }
.expense-recurring-toggle small { color: #617a79; font-size: 11px; font-weight: 500; line-height: 1.35; }
.expense-recurrence-fields { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid #cfe0ef; border-radius: 13px; background: #f7fbff; }
.expense-recurrence-fields label { display: grid; gap: 6px; }
.expense-recurrence-fields label > span { color: #304c68; font-size: 11px; font-weight: 750; }
.expense-recurrence-fields label > small { color: #718097; font-size: 10px; }
.expense-recurrence-badge { display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 4px; margin: 5px 0 0; padding: 4px 7px; border-radius: 999px; color: #087866; background: #ddf6ef; font-size: 9px; font-weight: 800; }
.expense-recurrence-badge.is-paused { color: #7b6470; background: #f0e8ec; }
.expenses-dialog { background: #f7fafb; }
.expenses-dialog .expenses-dialog-body { grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 13px; padding: 18px 20px 14px; background: #f7fafb; }
.expenses-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 13px; align-items: center; margin: 0 !important; }
.expenses-head-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; color: #078b76; background: #def5ee; }
.expenses-head-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.expenses-head h2 { margin: 0; color: #0b1e3e; }
.expenses-subtitle { margin: 3px 0 0; color: #65758c; font-size: 12px; }
.expenses-new-button { min-width: 158px; }
.expenses-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.expenses-summary-card { display: grid; min-height: 91px; align-content: center; gap: 3px; padding: 13px 16px; border: 1px solid #d7e5e2; border-radius: 13px; background: linear-gradient(135deg, #f7fcfb, #eaf8f4); }
.expenses-summary-card span { color: #52647b; font-size: 11px; font-weight: 650; }
.expenses-summary-card strong { overflow: hidden; color: #077564; font-size: 22px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.expenses-summary-card small { color: #738096; font-size: 10px; }
.expenses-summary-count { border-color: #d3e2f3; background: linear-gradient(135deg, #f8fbff, #eaf3ff); }
.expenses-summary-count strong { color: #176bc7; }
.expenses-summary-category { border-color: #f1dfbf; background: linear-gradient(135deg, #fffaf2, #fff3dc); }
.expenses-summary-category strong { color: #ad6700; }
.expenses-filters { display: grid; grid-template-columns: minmax(250px, 1.5fr) minmax(130px, .65fr) minmax(130px, .65fr) minmax(150px, .75fr) auto auto; gap: 9px; align-items: end; padding: 11px; border: 1px solid #dce6eb; border-radius: 12px; background: #fff; }
.expenses-filters label { display: grid; gap: 4px; min-width: 0; }
.expenses-filters label span { color: #40536b; font-size: 10px; font-weight: 750; }
.expenses-filters input,
.expenses-filters select { width: 100%; min-height: 38px; }
.expenses-filters button { min-height: 38px; }
.expenses-list-area { min-height: 0; overflow: hidden; border: 1px solid #dbe5ea; border-radius: 12px; background: #fff; }
.expenses-table-wrap { height: 100%; overflow: auto; }
.expenses-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.expenses-table th { position: sticky; z-index: 1; top: 0; padding: 11px 12px; color: #fff; background: linear-gradient(135deg, #075f55, #007f70); font-size: 11px; text-align: left; }
.expenses-table th:nth-child(1) { width: 105px; }
.expenses-table th:nth-child(2) { width: 145px; }
.expenses-table th:nth-child(4) { width: 145px; }
.expenses-table th:nth-child(5) { width: 125px; }
.expenses-table th:nth-child(6) { width: 165px; }
.expenses-table td { padding: 10px 12px; border-bottom: 1px solid #e3eaee; color: #273952; font-size: 12px; vertical-align: middle; }
.expenses-table tbody tr:hover { background: #f5fbf9; }
.expenses-table td:nth-child(5) strong { color: #087866; font-size: 13px; white-space: nowrap; }
.expense-description-cell { line-height: 1.4; overflow-wrap: anywhere; }
.expense-category-badge { display: inline-flex; max-width: 100%; padding: 5px 9px; border-radius: 999px; color: #087866; background: #e2f6f0; font-size: 10px; font-weight: 750; }
.expense-row-actions { display: flex; gap: 6px; }
.expense-row-actions button { min-height: 31px !important; padding: 6px 9px; font-size: 10px !important; }
.expenses-empty { display: grid; min-height: 150px; place-items: center; align-content: center; gap: 6px; color: #74849a; text-align: center; }
.expenses-empty strong { color: #2d405a; }
.expenses-mobile-list { display: none; }
.expenses-footer { justify-content: space-between; margin: 0 !important; }
.expenses-footer > span { color: #61738b; font-size: 11px; }

@media (max-width: 900px) {
  .expenses-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expenses-search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .expense-editor-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .expense-editor-dialog #expenseForm { min-height: 100%; padding: calc(17px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .expense-form-grid,.expense-recurrence-fields { grid-template-columns: 1fr; }
  .expense-category-picker { grid-template-columns: minmax(0, 1fr) 52px; }.expense-category-picker input,.expense-category-picker button { min-height: 52px !important; }.expense-category-picker button { width: 52px; min-width: 52px; font-size: 28px; }.expense-category-editor { padding: 11px; }.expense-category-editor > div { display: grid; grid-template-columns: 1fr 1fr; }.expense-category-editor button { min-height: 43px; font-size: 13px; }
  .expense-recurring-toggle { min-height: 76px; }
  .expenses-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .expenses-dialog .expenses-dialog-body { display: flex; min-height: 100dvh; height: auto; flex-direction: column; gap: 10px; padding: 12px 11px calc(18px + env(safe-area-inset-bottom)); overflow: visible; }
  .expenses-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; }
  .expenses-head-icon { width: 44px; height: 44px; border-radius: 12px; }
  .expenses-head-icon svg { width: 24px; height: 24px; }
  .expenses-head h2 { font-size: 22px !important; }
  .expenses-subtitle { font-size: 10px; line-height: 1.3; }
  .expenses-new-button { grid-column: 1 / -1; grid-row: 2; min-height: 42px !important; }
  .expenses-head .icon-button { grid-column: 3; grid-row: 1; }
  .expenses-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .expenses-summary-card { min-height: 86px; padding: 10px; }
  .expenses-summary-card strong { font-size: 17px; white-space: normal; }
  .expenses-summary-card span { font-size: 10px; }
  .expenses-summary-card small { font-size: 9px; }
  .expenses-summary-category { grid-column: 1 / -1; min-height: 72px; }
  .expenses-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 9px; }
  .expenses-search { grid-column: 1 / -1; }
  .expenses-filters label:nth-child(4) { grid-column: 1 / -1; }
  .expenses-filters input,
  .expenses-filters select,
  .expenses-filters button { min-height: 42px; font-size: 16px !important; }
  .expenses-list-area { min-height: 0; overflow: visible; border: 0; background: transparent; }
  .expenses-table-wrap { display: none; }
  .expenses-mobile-list { display: grid; gap: 9px; }
  .expense-mobile-card { display: grid; gap: 8px; padding: 12px; border: 1px solid #dce6eb; border-left: 4px solid #0aa084; border-radius: 12px; background: #fff; }
  .expense-mobile-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
  .expense-mobile-card-head > div { display: grid; gap: 2px; }
  .expense-mobile-card-head span { color: #697a91; font-size: 10px; }
  .expense-mobile-card-head strong { color: #0e203e; font-size: 14px; }
  .expense-mobile-card-head b { color: #087866; font-size: 16px; white-space: nowrap; }
  .expense-mobile-card p { margin: 0; color: #33465f; font-size: 12px; line-height: 1.45; }
  .expense-mobile-card small { color: #6b7c92; font-size: 10px; }
  .expense-mobile-card .expense-row-actions button { flex: 1; min-height: 37px !important; }
}

/* Diseño de factura de proveedor: versión visual para escritorio y móvil.
   Las clases solo organizan controles existentes; no cambian su comportamiento. */
#payablesDialog .purchase-dialog-head { display: grid; grid-template-columns: 67px minmax(0, 1fr) auto; align-items: center; gap: 15px; }
.purchase-dialog-mark { display: grid; width: 67px; height: 67px; place-items: center; border-radius: 19px; color: #2769ed; background: linear-gradient(135deg, #edf2ff, #e1e9ff); box-shadow: inset 0 0 0 1px rgba(49,105,235,.08); font-size: 34px; font-weight: 900; }
#payablesDialog .purchase-dialog-head > div { min-width: 0; }.purchase-dialog-subtitle { margin: 5px 0 0; color: #6d81b3; font-size: 14px; line-height: 1.35; }
#payablesDialog .purchase-line-heading { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0 3px; }
.purchase-line-heading > div:first-child { display: flex; align-items: center; gap: 12px; }.purchase-line-heading > div:first-child > span { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: #182b74; background: linear-gradient(135deg, #e9efff, #dde8ff); font-size: 26px; font-weight: 900; }.purchase-line-heading h3 { margin: 0; color: #11245a; font-size: 17px; }.purchase-line-heading p { margin: 4px 0 0; color: #7184b0; font-size: 12px; }.purchase-line-heading .secondary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(125deg, #0ba596, #087ab4); box-shadow: 0 8px 17px rgba(7,124,157,.18); font-size: 13px; font-weight: 800; white-space: nowrap; }.purchase-line-heading .secondary-button span { font-size: 24px; font-weight: 400; }
#payablesDialog .purchase-top-field { position: relative; display: grid; grid-template-columns: 63px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; min-height: 98px; padding: 14px; border: 1px solid #dfebf8; border-radius: 14px; background: linear-gradient(145deg, #fff, #fbfdff); }
#payablesDialog .purchase-top-field::before { content: "⌂"; grid-column: 1; grid-row: 1 / span 2; display: grid; width: 57px; height: 57px; place-items: center; border-radius: 15px; color: #176df1; background: linear-gradient(135deg, #edf5ff, #e1edff); font-size: 28px; font-weight: 850; }
#payablesDialog .purchase-top-field.purchase-invoice-field::before { content: "▤"; }.purchase-top-field.purchase-date-field::before { content: "▣"; color: #0a9b89; background: linear-gradient(135deg, #e4fbf3, #d7f8e9); }.purchase-top-field.purchase-payment-field::before { content: "▰"; color: #1d71d8; background: linear-gradient(135deg, #e8f2ff, #dceaff); }.purchase-top-field > span { grid-column: 2; grid-row: 1; }.purchase-top-field > input,.purchase-top-field > select,.purchase-top-field > .customer-picker { grid-column: 2; grid-row: 2; }.purchase-top-field > small { grid-column: 2; }.purchase-top-field .customer-picker { min-width: 0; }.purchase-top-field .customer-picker input { min-width: 0; }.purchase-top-field .add-customer-button { align-self: stretch; }
#payablesDialog .purchase-line-form::before,#payablesDialog .purchase-line-form::after { content: none; }
#payablesDialog .purchase-line-form { padding-top: 13px; }
.purchase-product-field { position: relative; }
#payablesDialog .purchase-product-suggestions { display: grid; max-height: 230px; gap: 5px; overflow-y: auto; padding: 6px; border: 1px solid rgba(37,190,211,.48); border-radius: 11px; background: #052f3d; box-shadow: 0 14px 30px rgba(0,14,24,.38); }
#payablesDialog .purchase-product-suggestions button { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; min-height: 52px; padding: 8px 10px; border: 1px solid rgba(55,183,199,.18); border-radius: 8px; color: #f5fbff; background: #073b49; text-align: left; cursor: pointer; }
#payablesDialog .purchase-product-suggestions button:hover,#payablesDialog .purchase-product-suggestions button:focus { color: #fff; background: #075761; outline: 2px solid rgba(43,220,199,.28); }
#payablesDialog .purchase-product-suggestions strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }#payablesDialog .purchase-product-suggestions span { overflow: hidden; color: #b9ced8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }#payablesDialog .purchase-product-suggestions b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #52e4cf; font-size: 12px; }#payablesDialog .purchase-product-suggestions p { margin: 0; padding: 12px; color: #bed1da; font-size: 12px; text-align: center; }
.purchase-percent-input,.purchase-suggested-control { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; }
.purchase-percent-input b { display: grid; min-width: 38px; place-items: center; border: 1px solid #d4e2f1; border-left: 0; border-radius: 0 9px 9px 0; color: #46648d; background: #f2f7fd; font-size: 12px; }.purchase-percent-input input { border-radius: 9px 0 0 9px !important; }
.purchase-suggested-control button { min-width: 54px; border: 0; border-radius: 0 9px 9px 0; color: #fff; background: linear-gradient(135deg,#0a9f8e,#0878ad); font-size: 11px; font-weight: 850; cursor: pointer; }.purchase-suggested-control input { border-radius: 9px 0 0 9px !important; color: #087769 !important; background: #effaf7 !important; }
#payablesDialog .purchase-lines .empty-state { display: grid; min-height: 144px; place-items: center; align-content: center; gap: 7px; border: 1px dashed #cbdcf5; border-radius: 13px; color: #7184ae; background: linear-gradient(145deg, #fcfdff, #f4f8ff); font-size: 13px; font-weight: 650; text-align: center; }.purchase-lines .empty-state::before { content: "▣"; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: #7e92c0; background: #eaf1ff; font-size: 28px; }

@media (min-width: 681px) {
  #payablesDialog.operation-dialog .purchase-line-form { grid-template-columns: repeat(12,minmax(0,1fr)); }
  #payablesDialog .purchase-product-field { grid-column: span 4; }
  #payablesDialog .purchase-line-form > label:not(.purchase-product-field) { grid-column: span 2; }
}

@media (max-width: 680px) {
  #payablesDialog.operation-dialog { width: 100dvw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: linear-gradient(145deg, #fff, #f4faff); }
  #payablesDialog.operation-dialog .print-dialog-body { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 15px calc(13px + env(safe-area-inset-bottom)); background: transparent; }
  #payablesDialog .purchase-dialog-head { grid-template-columns: 59px minmax(0, 1fr) 43px; gap: 10px; padding: 0 0 11px; border-bottom: 1px solid #deebf7; }.purchase-dialog-mark { width: 59px; height: 59px; border-radius: 17px; font-size: 30px; }#payablesDialog .purchase-dialog-head h2 { font-size: 23px; line-height: 1.08; }.purchase-dialog-subtitle { margin-top: 4px; font-size: 12px; }.purchase-dialog-head .icon-button { width: 43px !important; min-width: 43px; height: 43px; border-color: #d7e5f6; border-radius: 12px; color: #132860; background: #fff; font-size: 27px; }
  #payablesDialog.operation-dialog .purchase-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 0; padding: 0; border: 0; background: transparent; overflow: auto; }.purchase-top-field.purchase-supplier-field,.purchase-top-field.purchase-invoice-field,.purchase-line-heading,.purchase-line-form,.purchase-lines,#payablesDialog .purchase-form .dialog-actions { grid-column: 1 / -1; }
  #payablesDialog .purchase-top-field { grid-template-columns: 50px minmax(0, 1fr); min-height: 79px; column-gap: 10px; padding: 10px; border-color: #deebf8; border-radius: 13px; background: rgba(255,255,255,.88); }.purchase-top-field::before,#payablesDialog .purchase-top-field::before { width: 48px; height: 48px; border-radius: 13px; font-size: 24px; }.purchase-top-field > span { font-size: 11px !important; }.purchase-top-field > input,.purchase-top-field > select,.purchase-top-field > .customer-picker { min-height: 39px !important; height: 39px; font-size: 13px !important; }.purchase-top-field .add-customer-button { width: 39px; min-width: 39px; height: 39px; min-height: 39px !important; }
  #payablesDialog .purchase-line-heading { align-items: flex-start; gap: 10px; padding: 10px 0 1px; }.purchase-line-heading > div:first-child { gap: 9px; }.purchase-line-heading > div:first-child > span { width: 40px; height: 40px; border-radius: 12px; font-size: 22px; }.purchase-line-heading h3 { font-size: 13px; }.purchase-line-heading p { max-width: 205px; margin-top: 2px; font-size: 10px; line-height: 1.3; }.purchase-line-heading .secondary-button { min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 11px; }.purchase-line-heading .secondary-button span { font-size: 19px; }
  #payablesDialog .purchase-line-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 10px; padding: 11px; border: 1px solid #dbe8f7; border-radius: 14px; background: rgba(255,255,255,.88); }.purchase-line-form .purchase-product-field { grid-column: 1 / -1; }.purchase-line-form label { gap: 5px; }.purchase-line-form label > span { font-size: 10px !important; }.purchase-line-form input { min-height: 39px; height: 39px; font-size: 13px !important; }.purchase-line-form .purchase-qty-field { max-width: none; }.purchase-line-form .purchase-product-field .add-customer-button { width: 39px; min-width: 39px; height: 39px; min-height: 39px !important; }
  #payablesDialog .purchase-product-suggestions { max-height: 205px; }.purchase-product-suggestions button { min-height: 58px; }.purchase-suggested-control button { min-width: 58px; }.purchase-line-form .purchase-price-field { grid-column: 1 / -1; }#payablesDialog .purchase-product-field .add-customer-button.is-editing { width: auto; min-width: 72px; padding-inline: 8px; }
  #payablesDialog .purchase-lines { min-height: 120px; padding: 0; border: 0; background: transparent; }.purchase-lines .empty-state { min-height: 120px !important; padding: 16px; font-size: 11px !important; }.purchase-lines .empty-state::before { width: 44px; height: 44px; font-size: 23px; }
  #payablesDialog .purchase-form > .dialog-actions { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1.45fr; gap: 9px; margin: 0 -1px; padding: 11px 1px 2px; background: linear-gradient(180deg, rgba(248,252,255,.35), #f8fcff 28%); }.purchase-form > .dialog-actions .ghost-button,.purchase-form > .dialog-actions .primary-button { min-width: 0; min-height: 48px; padding: 0 9px; border-radius: 11px; font-size: 12px; }.purchase-form > .dialog-actions .primary-button { background: linear-gradient(125deg, #08a995, #087bb3); }
}

/* Corrección de jerarquía: prevalece sobre el diseño inicial de la entrada. */
#payablesDialog.operation-dialog .purchase-line-form::before,
#payablesDialog.operation-dialog .purchase-line-form::after { content: none !important; }
#payablesDialog.operation-dialog .purchase-line-heading { position: relative; z-index: 1; margin: 0; }
#payablesDialog.operation-dialog #addSupplierBtn { overflow: hidden; font-size: 0; }
#payablesDialog.operation-dialog #addSupplierBtn::before { content: "✎"; font-size: 20px; font-weight: 800; line-height: 1; }
#payablesDialog.operation-dialog .purchase-supplier-field::before { content: "♙"; }
#payablesDialog.operation-dialog .purchase-invoice-field::before { content: "▤"; }
#payablesDialog.operation-dialog .purchase-date-field::before { content: "▣"; }
#payablesDialog.operation-dialog .purchase-payment-field::before { content: "▰"; }

/* Punto de venta: apariencia fija Verde Esmeralda Premium. No depende de
   preferencias individuales; mantiene el catálogo legible y la factura como
   superficie blanca de trabajo. */
.app-shell:not(.super-mode) {
  background:
    radial-gradient(circle at 12% 10%, rgba(17, 176, 159, .35), transparent 31%),
    radial-gradient(circle at 72% 5%, rgba(49, 227, 184, .17), transparent 27%),
    linear-gradient(135deg, #003c3a 0%, #005a55 49%, #003835 100%);
}

.app-shell:not(.super-mode) .topbar {
  border-color: rgba(115, 255, 226, .18);
  border-radius: 0 0 21px 21px;
  color: #f3fffd;
  background: linear-gradient(105deg, rgba(0, 48, 46, .98), rgba(0, 91, 83, .96));
  box-shadow: 0 12px 28px rgba(0, 29, 28, .2);
}

.app-shell:not(.super-mode) .brand h1,
.app-shell:not(.super-mode) .business-identity p,
.app-shell:not(.super-mode) .business-identity p small { color: #f4fffd; }
.app-shell:not(.super-mode) .brand-mark { background: #fff; }
.app-shell:not(.super-mode) .business-identity { border: 0; background: transparent; box-shadow: none; }
.app-shell:not(.super-mode) .business-logo { border: 2px solid rgba(255,255,255,.9); background: #fff; }

.app-shell:not(.super-mode) .top-actions > button,
.app-shell:not(.super-mode) .top-actions-menu > summary {
  color: #f4fffd;
  border-color: transparent;
  background: rgba(0, 73, 68, .78);
  box-shadow: none;
}
.app-shell:not(.super-mode) .top-actions > button:hover,
.app-shell:not(.super-mode) .top-actions-menu > summary:hover { background: rgba(29, 159, 145, .82); }
.app-shell:not(.super-mode) #cashRegisterBtn {
  color: #fff;
  background: linear-gradient(135deg, #08a993, #00c2b5);
  box-shadow: 0 8px 18px rgba(0, 23, 22, .2);
}
.app-shell:not(.super-mode) .top-actions-menu-panel { border-color: rgba(83, 239, 213, .25); background: #004a46; }
.app-shell:not(.super-mode) .top-actions-menu-panel button { color: #effffc; background: transparent; }
.app-shell:not(.super-mode) .top-actions-menu-panel button:hover { color: #fff; background: rgba(79, 230, 203, .18); }

.app-shell:not(.super-mode) .pos-layout { gap: 24px; padding: 30px 27px; }
.app-shell:not(.super-mode) .inventory-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.app-shell:not(.super-mode) .invoice-panel { border: 0; border-radius: 17px; background: #fff; box-shadow: 0 16px 36px rgba(0, 24, 23, .24); }

.app-shell:not(.super-mode) .catalog-search-control input {
  color: #f4fffd;
  border-color: rgba(138, 255, 232, .38);
  background: rgba(0, 77, 72, .65);
}
.app-shell:not(.super-mode) .catalog-search-control input::placeholder { color: #e0fbf6; }
.app-shell:not(.super-mode) .catalog-scan-button { color: #fff; border-color: transparent; background: linear-gradient(135deg, #00ae99, #00c3b4); }
.app-shell:not(.super-mode) .catalog-invoice-scan-button { background: linear-gradient(135deg, #00ae99, #00c3b4); }
.app-shell:not(.super-mode) .filter-pill { color: #173d3b; background: #e9f4f6; }
.app-shell:not(.super-mode) .filter-pill.active { color: #fff; background: linear-gradient(135deg, #00ad98, #00c6b5); }
.app-shell:not(.super-mode) .inventory-meta,
.app-shell:not(.super-mode) .inventory-meta span { color: #effffc; }
.app-shell:not(.super-mode) .catalog-view-controls { display: flex; margin-left: auto; }

.app-shell:not(.super-mode) .product-card {
  border: 1px solid rgba(193, 255, 244, .34);
  border-radius: 14px;
  color: #f5fffd;
  background: linear-gradient(155deg, rgba(2, 59, 56, .92), rgba(1, 39, 38, .9));
  box-shadow: 0 11px 21px rgba(0, 24, 23, .24);
}
.app-shell:not(.super-mode) .product-image { border-radius: 10px; }
.app-shell:not(.super-mode) .product-name { color: #fff; }
.app-shell:not(.super-mode) .product-category,
.app-shell:not(.super-mode) .product-barcode { color: #d3eee9; }
.app-shell:not(.super-mode) .price { color: #39ead3; }
.app-shell:not(.super-mode) .stock-warning.service { color: #dffffa; background: rgba(42, 190, 169, .28); }
.app-shell:not(.super-mode) .product-card .stock-warning:not(.service):not(.out) {
  color: #fde68a;
  font-weight: 700;
}

.invoice-payment-dialog {
  width: min(560px, calc(100vw - 28px));
}

.invoice-payment-dialog form {
  display: grid;
  gap: 18px;
}

.invoice-payment-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.invoice-payment-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(16, 185, 129, .24);
  border-radius: 16px;
  background: rgba(16, 185, 129, .08);
}

.invoice-payment-total span,
.cash-change-summary span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-payment-total strong {
  color: var(--primary);
  font-size: 25px;
}

.cash-payment-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.cash-change-summary {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 185, 129, .24);
  border-radius: 14px;
  background: rgba(16, 185, 129, .08);
}

.cash-change-summary strong {
  color: var(--primary);
  font-size: 23px;
}

.cash-change-summary small {
  color: var(--muted);
  line-height: 1.35;
}

.cash-change-summary.is-insufficient {
  border-color: rgba(220, 38, 38, .3);
  background: rgba(220, 38, 38, .07);
}

.cash-change-summary.is-insufficient strong,
.cash-change-summary.is-insufficient small {
  color: #b91c1c;
}

@media (max-width: 640px) {
  .invoice-payment-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .cash-payment-fields {
    grid-template-columns: 1fr;
  }

  .invoice-payment-dialog .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .invoice-payment-dialog .dialog-actions .primary-button {
    order: -1;
  }
}
.app-shell:not(.super-mode) .add-product-btn,
.app-shell:not(.super-mode) .print-button { background: linear-gradient(135deg, #009b86, #007869); }
.app-shell:not(.super-mode) .edit-product-btn { color: #fff; border-color: rgba(211,255,248,.34); background: rgba(255,255,255,.06); }

.app-shell:not(.super-mode) .invoice-head { border-bottom-color: #e5f0ef; }
.app-shell:not(.super-mode) .invoice-head h2 { color: #063c3a; }
.app-shell:not(.super-mode) .invoice-head .eyebrow { color: #008f80; }
.app-shell:not(.super-mode) .cart-list .empty-state { color: #007f75; border-color: #c6f2e9; background: linear-gradient(135deg, #e9fbf8, #d5f6f1); }
.app-shell:not(.super-mode) .grand-total { color: #006b63; background: linear-gradient(100deg, #d7f8f3, #e5fbf8); }
.app-shell:not(.super-mode) .grand-total strong { color: #00645d; }
.app-shell:not(.super-mode) #holdSaleBtn { color: #00736a; border-color: #9bded4; background: #fff; }

@media (max-width: 720px) {
  .app-shell:not(.super-mode) .topbar { border-radius: 0 0 16px 16px; }
  .app-shell:not(.super-mode) .pos-layout { gap: 15px; padding: 16px 13px 24px; }
  .app-shell:not(.super-mode) .inventory-panel { overflow: visible; }
  .app-shell:not(.super-mode) .invoice-panel { border-radius: 15px; }
  .app-shell:not(.super-mode) .catalog-view-controls { display: none; }
}

/* En escritorio la factura aprovecha por completo el alto libre entre el
   encabezado y el borde inferior, mientras conserva su propio desplazamiento. */
@media (min-width: 900px) {
  .app-shell:not(.super-mode) .invoice-panel {
    height: calc(100% + 60px);
    max-height: calc(100% + 60px);
    margin-block: -30px;
  }
}

@media (min-width: 681px) {
  #payablesDialog.operation-dialog .purchase-form {
    grid-template-rows: 98px 60px auto minmax(144px, 1fr) auto;
  }
  #payablesDialog.operation-dialog .purchase-line-heading { min-height: 60px; padding: 12px 0 5px; }
  #payablesDialog.operation-dialog .purchase-line-form { align-items: end; padding: 13px; }
  #payablesDialog.operation-dialog .purchase-lines { margin-top: 2px; }
}

/* En escritorio, el alta conserva la misma energía visual del móvil con una
   composición más amplia y superficies administrativas diferenciadas. */
@media (min-width: 721px) {
  #adminDialog.commerce-admin-dialog { background: #e6f5f3; }
  #adminDialog.commerce-admin-dialog form { background: radial-gradient(circle at 100% 0, #caefe9 0, transparent 29%), radial-gradient(circle at 0 100%, #e1efff 0, transparent 26%), linear-gradient(135deg, #f8fffe, #edf6fb); }
  #adminDialog.commerce-admin-dialog .dialog-head { border-bottom-color: #9bd8d0; background: linear-gradient(100deg, #f8fffe, #ddf5ee); box-shadow: 0 8px 22px rgba(0, 103, 94, .1); }
  #adminDialog.commerce-admin-dialog .dialog-head .eyebrow { color: #007e70; }
  #adminDialog.commerce-admin-dialog .dialog-head h2 { color: #09275c; }
  #adminDialog.commerce-admin-dialog .commerce-admin-subtitle { color: #3e6387; }
  #adminDialog.commerce-admin-dialog .commerce-role-picker { padding: 9px; border: 1px solid #c2e5df; border-radius: 17px; background: linear-gradient(180deg, rgba(222,250,244,.93), rgba(233,244,255,.9)); box-shadow: 0 12px 25px rgba(12, 91, 106, .1); }
  #adminDialog.commerce-admin-dialog .commerce-role-option { border-color: #bddfdc; background: rgba(255,255,255,.78); box-shadow: 0 7px 15px rgba(29, 85, 108, .07); }
  #adminDialog.commerce-admin-dialog .commerce-role-option:not(.active) > span { color: #1e5280; background: #eff5ff; border-color: #d2dfef; }
  #adminDialog.commerce-admin-dialog .commerce-role-option.active { background: linear-gradient(135deg, #008b7c, #006b75); box-shadow: 0 13px 24px rgba(0, 111, 102, .27); }
  #adminDialog.commerce-admin-dialog .commerce-form-section { border-color: #b9dedb; background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(232,251,247,.95)); box-shadow: 0 9px 21px rgba(19, 88, 105, .075); }
  #adminDialog.commerce-admin-dialog .commerce-admin-columns .commerce-form-section:nth-child(2) { border-color: #c9d9f0; background: linear-gradient(145deg, #f9fcff, #e9f3ff); }
  #adminDialog.commerce-admin-dialog .commerce-section-heading > span { color: #087c77; background: linear-gradient(135deg, #d8fff4, #c3f2e7); box-shadow: 0 5px 12px rgba(0, 131, 116, .1); }
  #adminDialog.commerce-admin-dialog .commerce-admin-columns .commerce-form-section:nth-child(2) .commerce-section-heading > span { color: #176bb1; background: linear-gradient(135deg, #e1efff, #cfe5ff); }
  #adminDialog.commerce-admin-dialog .commerce-admin-content input,#adminDialog.commerce-admin-dialog .commerce-admin-content select { border-color: #b8dcd8; background: rgba(255,255,255,.94); box-shadow: 0 3px 8px rgba(14, 91, 108, .045); }
  #adminDialog.commerce-admin-dialog .commerce-client-section { border-color: #72cfc3; background: linear-gradient(100deg, #effff9, #e5f5ff); box-shadow: 0 10px 22px rgba(14, 122, 120, .1); }
  #adminDialog.commerce-admin-dialog .catalog-access-field { padding: 10px; border-radius: 11px; background: linear-gradient(90deg, #e8fff8, #e9f6ff); }
  #adminDialog.commerce-admin-dialog .dialog-actions { border-top-color: #9bd9d1; background: linear-gradient(90deg, #f3fffc, #daf5ee); box-shadow: 0 -10px 24px rgba(11, 94, 101, .12); }
  #adminDialog.commerce-admin-dialog .dialog-actions .primary-button { background: linear-gradient(135deg, #009d87, #00736c); box-shadow: 0 9px 18px rgba(0, 123, 109, .25); }
}

/* Prevalece sobre las reglas generales del diálogo: color y energía en el
   formulario móvil de alta de comercios. */
@media (max-width: 720px) {
  #adminDialog.commerce-admin-dialog { background: #eaf8f6; }
  #adminDialog.commerce-admin-dialog form { background: radial-gradient(circle at 100% 0, #d9f8f3 0, transparent 30%), linear-gradient(180deg, #f7fffd 0%, #edf8fb 100%); }
  #adminDialog.commerce-admin-dialog .dialog-head { border-bottom-color: #a8ddd5; background: linear-gradient(135deg, #f9fffe, #e1f8f3); box-shadow: 0 7px 20px rgba(4, 104, 94, .09); }
  #adminDialog.commerce-admin-dialog .dialog-head .eyebrow { color: #007d70; }
  #adminDialog.commerce-admin-dialog .dialog-head h2 { color: #09285b; }
  #adminDialog.commerce-admin-dialog .commerce-admin-subtitle { color: #386586; }
  #adminDialog.commerce-admin-dialog .commerce-role-option { border-color: #c5e4e1; background: linear-gradient(145deg, #f4fffd, #e5f8f8); box-shadow: 0 8px 18px rgba(12, 92, 107, .09); }
  #adminDialog.commerce-admin-dialog .commerce-role-option:not(.active) > span { color: #225684; background: #eef4ff; border-color: #d2e1f2; }
  #adminDialog.commerce-admin-dialog .commerce-role-option.active { background: linear-gradient(145deg, #008b7b, #006b76); box-shadow: 0 12px 24px rgba(0, 112, 103, .28); }
  #adminDialog.commerce-admin-dialog .commerce-form-section,#adminDialog.commerce-admin-dialog .commerce-client-section { margin: 0 -4px; padding: 18px 12px; border: 1px solid #cfe9e6; border-radius: 16px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(236,251,249,.97)); box-shadow: 0 8px 18px rgba(23, 93, 109, .06); }
  #adminDialog.commerce-admin-dialog .commerce-form-section:nth-child(odd) { background: linear-gradient(145deg, #f5fffe, #e7f9f5); }
  #adminDialog.commerce-admin-dialog .commerce-section-heading::before,#adminDialog.commerce-admin-dialog .commerce-client-section legend::before { color: #fff; background: linear-gradient(135deg, #11ad9d, #087e89); box-shadow: 0 5px 11px rgba(3, 124, 115, .2); }
  #adminDialog.commerce-admin-dialog .commerce-section-heading > span,#adminDialog.commerce-admin-dialog .commerce-client-section legend span { color: #087c77; background: linear-gradient(135deg, #d8fff4, #c6f1eb); }
  #adminDialog.commerce-admin-dialog .commerce-admin-content input,#adminDialog.commerce-admin-dialog .commerce-admin-content select { border-color: #bddedb; background: rgba(255,255,255,.92); box-shadow: 0 3px 8px rgba(13, 98, 111, .035); }
  #adminDialog.commerce-admin-dialog .catalog-access-field { padding: 11px; border-radius: 12px; background: linear-gradient(135deg, #e8fff8, #e7f7ff); }
  #adminDialog.commerce-admin-dialog .commerce-client-section { border-color: #76cfc4; background: linear-gradient(145deg, #effffb, #e3f6ff); }
  #adminDialog.commerce-admin-dialog .dialog-actions { border-top-color: #9fdcd5; background: linear-gradient(90deg, #f5fffc, #ddf8f3); box-shadow: 0 -9px 22px rgba(11, 92, 100, .12); }
  #adminDialog.commerce-admin-dialog .dialog-actions .primary-button { background: linear-gradient(135deg, #009b86, #00756d); box-shadow: 0 8px 16px rgba(0, 125, 111, .24); }
}

/* Cotizaciones del comercio reutilizan el lenguaje visual de ventas, pero se
   mantienen en un espacio propio y cómodo en móvil. */
#quotationsDialog .quotations-dialog-body { display: flex; min-height: min(720px, 86vh); flex-direction: column; }
#quotationsDialog .quotations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#quotationsDialog .quotations-filter { grid-template-columns: minmax(220px, 1fr) auto; }
#quotationsDialog .quotations-list { flex: 1 1 auto; max-height: none; }
#quotationsDialog .quotation-row { grid-template-columns: minmax(0, 1fr) auto minmax(250px, auto); }
.quotation-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.quotation-row-actions button { min-height: 36px; }

@media (max-width: 720px) {
  #quotationsDialog .quotations-dialog-body { min-height: 100dvh; }
  #quotationsDialog .quotations-summary,#quotationsDialog .quotations-filter,#quotationsDialog .quotation-row { grid-template-columns: 1fr; }
  #quotationsDialog .quotation-row { align-items: stretch; }
  #quotationsDialog .quotation-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  #quotationsDialog .quotation-row-actions button:only-child { grid-column: 1 / -1; }
  .super-office-document-row.is-quotation { grid-template-columns: minmax(0, 1fr) auto 72px; }
}

/* Listado de cotizaciones: la información queda escaneable como tabla en
   escritorio y como tarjetas completas en teléfono. */
#quotationsDialog.quotations-dialog { width: min(1080px, calc(100vw - 34px)); }
#quotationsDialog .quotations-dialog-body { gap: 18px; padding: 28px 30px 18px; background: linear-gradient(135deg, #fff 0%, #fbfdff 55%, #f4fbff 100%); }
#quotationsDialog .quotations-dialog-head { margin: 0; }
#quotationsDialog .quotations-dialog-head h2 { margin: 3px 0 4px; color: #071542; font-size: clamp(31px, 3vw, 41px); letter-spacing: -.045em; }
#quotationsDialog .quotations-dialog-head p:not(.eyebrow) { margin: 0; color: #46618f; font-size: 16px; }
#quotationsDialog .quotations-dialog-head .eyebrow { color: #00816f; font-weight: 800; }
#quotationsDialog .quotations-dialog-head .icon-button { width: 50px; height: 50px; border-color: #d7e1f0; color: #071542; background: #fff; font-size: 30px; }
#quotationsDialog .quotations-summary { display: grid; gap: 18px; }
#quotationsDialog .quotations-summary-card { position: relative; display: flex; min-height: 122px; align-items: center; gap: 18px; overflow: hidden; padding: 20px; border: 1px solid #d8e8ed; border-radius: 13px; background: linear-gradient(125deg, #f7fffd, #eefbf8); }
#quotationsDialog .quotations-summary-card > div { display: grid; gap: 3px; }
#quotationsDialog .quotations-summary-card > div > span { color: #10285d; font-size: 15px; font-weight: 700; }
#quotationsDialog .quotations-summary-card strong { color: #06235b; font-size: 34px; line-height: 1.05; }
#quotationsDialog .quotations-summary-card small { color: #59709a; font-size: 14px; }
#quotationsDialog .quotations-summary-card > b { position: absolute; right: 18px; color: #d8f6f1; font-size: 64px; transform: rotate(180deg); }
#quotationsDialog .quotations-summary-amount { border-color: #d8e8f8; background: linear-gradient(125deg, #f7fcff, #eef8ff); }
#quotationsDialog .quotations-summary-amount strong { color: #007c6b; }
#quotationsDialog .quotations-summary-amount > b { color: #dff1ff; }
.quotations-summary-icon { display: grid; width: 68px; height: 68px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #008977; background: #daf7ef; font-size: 34px; font-weight: 800; }
.quotations-summary-amount .quotations-summary-icon { color: #0874c8; background: #dceeff; }
#quotationsDialog .quotations-filter { display: grid; grid-template-columns: minmax(0, 1fr) 217px; gap: 14px; margin: 8px 0 -2px; }
#quotationsDialog .quotations-search { position: relative; }
#quotationsDialog .quotations-search::before { position: absolute; z-index: 1; top: 50%; left: 18px; color: #0a3569; content: "⌕"; font-size: 30px; line-height: 1; transform: translateY(-36%); }
#quotationsDialog .quotations-search span { display: none; }
#quotationsDialog .quotations-search input { height: 54px; padding-left: 58px; border-color: #c9d9ea; border-radius: 11px; color: #244b7d; font-size: 16px; background: #fff; }
#quotationsDialog #newQuotationBtn { min-height: 54px; border-radius: 10px; font-size: 16px; box-shadow: 0 9px 18px rgba(0, 123, 103, .2); }
#quotationsDialog .quotations-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quotations-status-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.quotations-status-filters button { display: inline-flex; min-height: 39px; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid #e0e8f2; border-radius: 11px; color: #23416d; background: #f5f8fc; font-weight: 700; }
.quotations-status-filters button.active { border-color: #008675; color: #00766a; background: #f0fffa; box-shadow: 0 2px 8px rgba(0, 128, 111, .1); }
.quotations-status-filters i { width: 10px; height: 10px; border-radius: 50%; background: #0aaa68; }
.quotations-status-filters [data-quotation-filter="converted"] i { background: #2487ec; }
.quotations-status-filters [data-quotation-filter="cancelled"] i { background: #f14351; }
.quotations-sort { display: grid; min-width: 165px; gap: 3px; padding: 7px 11px; border: 1px solid #d5e0ee; border-radius: 10px; background: #fff; }
.quotations-sort span { color: #5c739a; font-size: 11px; }
.quotations-sort select { min-width: 0; border: 0; color: #15315d; font-weight: 800; background: transparent; }
#quotationsDialog .quotations-table-head { display: grid; grid-template-columns: 1.55fr 1.08fr .82fr .74fr 1.75fr; align-items: center; min-height: 48px; padding: 0 19px; border: 1px solid #dbe5f1; border-bottom: 0; border-radius: 11px 11px 0 0; color: #264976; background: #f1f6fb; font-size: 12px; font-weight: 800; text-transform: uppercase; }
#quotationsDialog .quotations-list { position: relative; display: grid; gap: 0; overflow: visible; border: 1px solid #dbe5f1; border-radius: 0 0 11px 11px; background: #fff; }
#quotationsDialog .quotation-row { display: grid; grid-template-columns: 1.55fr 1.08fr .82fr .74fr 1.75fr; align-items: center; gap: 10px; min-height: 106px; margin: 0; padding: 15px 19px; border: 0; border-bottom: 1px solid #e3eaf2; border-radius: 0; background: #fff; box-shadow: none; }
#quotationsDialog .quotation-row:last-child { border-bottom: 0; }
.quotation-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.quotation-document-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #008574; background: #ddf8f0; font-size: 27px; font-weight: 800; }
.quotation-main > div { display: grid; min-width: 0; gap: 3px; }
.quotation-main strong { color: #07173f; font-size: 16px; }
.quotation-main span,.quotation-main small { overflow: hidden; color: #46618c; text-overflow: ellipsis; white-space: nowrap; }
.quotation-main small { font-size: 12px; }
.quotation-date { display: flex; align-items: center; gap: 9px; color: #345482; font-size: 13px; line-height: 1.35; }
.quotation-date > span { color: #0b4a7f; font-size: 19px; }
.quotation-amount { color: #007f6d; font-size: 17px; white-space: nowrap; }
.quotation-status { display: inline-flex; width: max-content; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 10px; color: #087c67; background: #def8ef; font-size: 13px; font-weight: 800; }
.quotation-status::before { width: 9px; height: 9px; border-radius: 50%; background: currentColor; content: ""; }
.quotation-status-converted { color: #1978cb; background: #e5f2ff; }
.quotation-status-cancelled { color: #c52a3d; background: #ffe8ea; }
#quotationsDialog .quotation-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
#quotationsDialog .quotation-row-actions button { min-height: 43px; white-space: nowrap; }
#quotationsDialog .quotation-convert-button { grid-column: 1 / -1; }
#quotationsDialog .quotations-footer { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; color: #48638d; font-size: 14px; }
.quotations-pagination { display: flex; gap: 7px; }
.quotations-pagination button { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid #d7e1ed; border-radius: 10px; color: #153764; background: #fff; font-size: 25px; font-weight: 800; }
.quotations-pagination button.active { color: #fff; border-color: #008777; background: #008777; }
#quotationsDialog .dialog-actions { margin-top: -2px; padding-top: 15px; border-top: 1px solid #e2eaf3; }

@media (max-width: 720px) {
  #quotationsDialog.quotations-dialog { width: 100%; max-width: none; margin: 0; border-radius: 0; }
  #quotationsDialog .quotations-dialog-body { gap: 13px; padding: calc(20px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
  #quotationsDialog .quotations-dialog-head { align-items: flex-start; }
  #quotationsDialog .quotations-dialog-head h2 { font-size: 30px; }
  #quotationsDialog .quotations-dialog-head p:not(.eyebrow) { max-width: 260px; font-size: 15px; line-height: 1.35; }
  #quotationsDialog .quotations-dialog-head .icon-button { width: 44px; height: 44px; font-size: 27px; }
  #quotationsDialog .quotations-summary { gap: 11px; }
  #quotationsDialog.quotations-dialog .quotations-summary { grid-template-columns: 1fr !important; }
  #quotationsDialog .quotations-summary-card { min-height: 94px; gap: 13px; padding: 14px; border-radius: 10px; }
  #quotationsDialog .quotations-summary-card strong { font-size: 26px; }
  #quotationsDialog .quotations-summary-card > div > span { font-size: 13px; }
  #quotationsDialog .quotations-summary-card small { font-size: 12px; }
  .quotations-summary-icon { width: 56px; height: 56px; border-radius: 11px; font-size: 28px; }
  #quotationsDialog .quotations-summary-card > b { right: 12px; font-size: 45px; }
  #quotationsDialog .quotations-filter { grid-template-columns: 1fr; gap: 9px; margin: 0; }
  #quotationsDialog .quotations-search input,#quotationsDialog #newQuotationBtn { height: 46px; min-height: 46px; font-size: 14px; }
  #quotationsDialog .quotations-toolbar { display: grid; gap: 10px; }
  .quotations-status-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .quotations-status-filters button { min-height: 38px; flex: 0 0 auto; padding: 0 13px; font-size: 12px; }
  .quotations-status-filters [data-quotation-filter="cancelled"] { display: none; }
  .quotations-sort { display: none; }
  #quotationsDialog .quotations-table-head { display: none; }
  #quotationsDialog .quotations-list { gap: 10px; border: 0; background: transparent; }
  #quotationsDialog .quotation-row { grid-template-columns: minmax(0, 1fr) auto; gap: 13px 8px; min-height: 0; padding: 15px 13px; border: 1px solid #dbe5f1; border-radius: 11px; background: #fff; box-shadow: 0 5px 14px rgba(24, 57, 98, .045); }
  .quotation-main { align-items: flex-start; }
  .quotation-document-icon { width: 43px; height: 43px; font-size: 25px; }
  .quotation-main strong { font-size: 16px; }
  .quotation-date { grid-column: 1 / -1; font-size: 12px; }
  .quotation-amount { grid-column: 1 / -1; font-size: 15px; }
  .quotation-status { align-self: start; padding: 8px 10px; font-size: 12px; }
  #quotationsDialog .quotation-row-actions { grid-column: 1 / -1; }
  #quotationsDialog .quotation-row-actions button { min-height: 42px; font-size: 13px; }
  #quotationsDialog .quotations-footer { padding: 1px 0; font-size: 12px; }
  .quotations-pagination button { width: 39px; height: 39px; }
  #quotationsDialog .dialog-actions { position: static; margin: 0; padding: 13px 0 calc(7px + env(safe-area-inset-bottom)); background: transparent; }
  #quotationsDialog .dialog-actions .ghost-button { width: 100%; min-height: 49px; }
}

/* Directorio de administradores: en el escritorio con escala visual, 100dvh
   debe compensarse para que el panel y la barra lateral alcancen el borde
   inferior real. Con dos cuentas, las tarjetas usan el espacio completo sin
   crear una segunda barra de desplazamiento. */
@media (min-width: 721px) {
  .app-shell.super-mode,
  .super-mode .super-dashboard,
  .super-mode .super-sidebar,
  .super-mode .super-main-content {
    height: calc(100dvh / var(--app-scale));
    min-height: calc(100dvh / var(--app-scale));
    max-height: calc(100dvh / var(--app-scale));
  }

  .super-mode .super-dashboard { overflow: hidden; }
  .super-mode .super-sidebar { align-self: stretch; }

  .super-mode .super-users-panel {
    box-sizing: border-box;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .super-mode .super-users-panel #superAdminUserList {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .super-mode .super-users-panel .super-user-grid {
    display: grid;
    min-height: 0;
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
  }

  .super-mode .super-users-panel .user-row {
    min-height: 0;
    height: 100%;
  }
}

/* Directorio de administradores: reglas finales para prevalecer sobre el
   listado administrativo genérico. */
.super-admin-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; }.super-admin-hero .eyebrow { margin:0 0 8px; color:#008576; font-size:12px; font-weight:900; text-transform:uppercase; }.super-admin-hero h2 { margin:0; color:#09234a; font-size:clamp(30px,3vw,44px); line-height:1.06; letter-spacing:-.045em; }.super-admin-hero p:not(.eyebrow) { max-width:880px; margin:10px 0 0; color:#61718f; font-size:16px; font-weight:650; line-height:1.45; }.super-admin-new-button { min-height:60px; flex:0 0 auto; padding-inline:24px; border:0; border-radius:12px; color:#fff; background:linear-gradient(130deg,#008f7c,#007b71); box-shadow:0 13px 25px rgba(0,126,111,.22); font-size:15px; }.super-admin-new-button span { margin-right:8px; font-size:24px; vertical-align:-2px; }
.super-admin-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }.super-admin-stat { display:flex; align-items:center; gap:14px; min-height:108px; padding:16px; border:1px solid #dce8ed; border-radius:12px; background:linear-gradient(135deg,#f8fffe,#effafa); }.super-admin-stat > span { display:grid; width:54px; height:54px; flex:0 0 auto; place-items:center; border-radius:13px; color:#007f70; background:#d7f8ed; font-size:28px; font-weight:900; }.super-admin-stat div { display:grid; grid-template-columns:auto 1fr; column-gap:8px; align-items:baseline; }.super-admin-stat strong { color:#082851; font-size:35px; line-height:1; }.super-admin-stat b { color:#102b51; font-size:14px; }.super-admin-stat small { grid-column:1/-1; margin-top:7px; color:#5d7190; font-size:11px; font-weight:650; }.super-admin-stat-green { background:linear-gradient(135deg,#f4fff9,#e9fbf1); }.super-admin-stat-green > span { color:#078b55; background:#d8f9e4; }.super-admin-stat-orange { background:linear-gradient(135deg,#fffaf1,#fff5e5); }.super-admin-stat-orange > span { color:#ee8b00; background:#fff0ce; }.super-admin-stat-blue { background:linear-gradient(135deg,#f4faff,#e9f5ff); }.super-admin-stat-blue > span { color:#0978e6; background:#dceeff; }
.super-admin-directory { display:flex; flex-direction:column; min-height:0; height:100%; padding:22px; border:1px solid #dce7ee; border-radius:16px; background:rgba(255,255,255,.91); box-shadow:0 12px 28px rgba(34,67,93,.06); }.super-admin-directory-head { display:flex; align-items:center; justify-content:space-between; gap:20px; }.super-admin-directory-title { display:flex; align-items:center; gap:14px; }.super-admin-directory-title>span { display:grid; width:58px; height:58px; place-items:center; border-radius:15px; color:#008577; background:linear-gradient(135deg,#ddfbf4,#cdf3e8); font-size:30px; }.super-admin-directory-title p { margin:0 0 3px; color:#087b72; font-size:11px; font-weight:900; }.super-admin-directory-title h3 { margin:0; color:#0a2954; font-size:23px; letter-spacing:-.03em; }
.super-admin-filters { display:flex; align-items:stretch; gap:12px; }.super-admin-search { display:flex; align-items:center; min-width:320px; min-height:51px; gap:11px; padding:0 15px; border:1px solid #d5e1ed; border-radius:11px; color:#0b315e; background:#fff; }.super-admin-search span { font-size:27px; line-height:1; }.super-admin-search input { min-width:0; flex:1; border:0; outline:0; color:#1e3559; background:transparent; font-size:14px; }.super-admin-status { position:relative; display:grid; gap:0; min-width:155px; padding:7px 12px 0; border:1px solid #d5e1ed; border-radius:11px; background:#fff; }.super-admin-status span { position:absolute; top:-9px; left:12px; padding:0 4px; color:#657590; background:#fff; font-size:11px; font-weight:800; }.super-admin-status select { min-height:38px; border:0; outline:0; color:#173458; background:transparent; font-size:14px; font-weight:750; }.super-admin-list-label { display:flex; justify-content:flex-end; min-height:22px; margin:10px 0 7px; color:#5a6e8e; font-size:12px; }.super-admin-list-label strong { font-weight:750; }
.super-admin-card-grid { display:grid; min-height:0; flex:1; grid-template-rows:repeat(2,minmax(0,1fr)); gap:14px; }.super-admin-card { display:grid; grid-template-columns:minmax(360px,1.55fr) minmax(190px,.7fr) minmax(190px,.62fr); align-items:center; gap:20px; padding:16px 20px; border:1px solid #dce6ef; border-radius:15px; background:linear-gradient(105deg,#fff,#fbfdff); box-shadow:0 5px 13px rgba(26,58,88,.035); }.super-admin-card-identity { display:flex; align-items:center; min-width:0; gap:16px; }.super-admin-avatar { display:grid; width:72px; height:72px; flex:0 0 auto; place-items:center; border-radius:50%; color:#008371; background:linear-gradient(135deg,#d5f8ed,#ebfbf8); font-size:29px; font-weight:900; }.super-admin-card-identity h4 { margin:0 0 5px; color:#08264d; font-size:20px; }.super-admin-badges { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:8px; }.super-admin-badges span { padding:6px 10px; border-radius:7px; color:#fff; background:linear-gradient(120deg,#009983,#008270); font-size:11px; font-weight:900; }.super-admin-badges small { padding:6px 9px; border-radius:7px; color:#395174; background:#eaf0f8; font-size:11px; font-weight:750; }.super-admin-card-identity p { display:flex; align-items:center; gap:8px; margin:5px 0 0; overflow-wrap:anywhere; color:#365171; font-size:13px; font-weight:650; }.super-admin-card-identity p b { color:#14365f; font-size:15px; }.super-admin-card-identity p.is-active { color:#008464; font-weight:850; }.super-admin-card-identity p.is-suspended { color:#c84b4b; font-weight:850; }.super-admin-card-identity p i { color:#6a7b92; font-style:normal; }.super-admin-card-meta { display:grid; gap:13px; padding:4px 19px; border-inline:1px solid #e2eaf2; }.super-admin-card-meta p { display:grid; grid-template-columns:25px 1fr; column-gap:8px; margin:0; color:#55708e; font-size:11px; }.super-admin-card-meta p>b { grid-row:1/3; color:#0d345f; font-size:19px; }.super-admin-card-meta span { color:#637a98; }.super-admin-card-meta strong { color:#183558; font-size:13px; }.super-admin-card-actions { display:grid; gap:8px; }.super-admin-card-actions button { min-height:41px; border-radius:9px; font-size:13px; }.super-admin-card-actions .secondary-button { border-color:#bfe8df; color:#007569; background:linear-gradient(90deg,#effcf7,#ecfaf7); }.super-admin-card-actions .ghost-button { border-color:#d3dfed; color:#123b68; background:#fff; }.super-admin-own-account { padding:11px; border-radius:9px; color:#52708d; background:#f1f6fb; font-size:12px; font-weight:750; text-align:center; }
@media (min-width:721px) { .super-mode .super-users-panel { grid-template-rows:auto auto minmax(0,1fr); gap:18px; padding:clamp(24px,2.4vw,38px); } .super-mode .super-users-panel #superAdminUserList { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; } }
@media (max-width:1040px) and (min-width:721px) { .super-admin-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-directory-head { align-items:flex-start; flex-direction:column; }.super-admin-filters { width:100%; }.super-admin-search { flex:1; }.super-admin-card { grid-template-columns:minmax(280px,1fr) minmax(180px,.7fr); }.super-admin-card-actions { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-card-meta { border-right:0; } }
@media (max-width:720px) { .super-mode .super-users-panel { padding:18px 14px 94px; background:linear-gradient(180deg,#f9fffd,#f4f9ff); }.super-admin-hero { display:block; }.super-admin-hero h2 { font-size:31px; }.super-admin-hero p:not(.eyebrow) { margin-top:7px; font-size:14px; }.super-admin-new-button { position:fixed; z-index:3; right:18px; bottom:16px; left:18px; min-height:57px; justify-content:center; box-shadow:0 10px 26px rgba(0,108,98,.29); }.super-admin-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:16px; }.super-admin-stat { min-height:98px; gap:10px; padding:12px; border-radius:12px; }.super-admin-stat>span { width:46px; height:46px; border-radius:12px; font-size:24px; }.super-admin-stat div { display:block; }.super-admin-stat strong { display:block; font-size:29px; }.super-admin-stat b { display:block; margin-top:3px; font-size:12px; }.super-admin-stat small { display:block; margin-top:4px; font-size:10px; line-height:1.25; }.super-admin-directory { height:auto; margin-top:16px; padding:13px; border-radius:14px; }.super-admin-directory-head { display:block; }.super-admin-directory-title { gap:10px; }.super-admin-directory-title>span { width:46px; height:46px; border-radius:12px; font-size:25px; }.super-admin-directory-title h3 { font-size:19px; }.super-admin-filters { display:grid; gap:10px; margin-top:15px; }.super-admin-search { min-width:0; min-height:48px; }.super-admin-status { min-height:53px; }.super-admin-list-label { justify-content:flex-end; margin:13px 2px 8px; }.super-admin-card-grid { display:grid; gap:12px; }.super-admin-card { display:block; padding:16px; border-radius:14px; }.super-admin-card + .super-admin-card { margin-top:0; }.super-admin-card-identity { align-items:flex-start; gap:13px; }.super-admin-avatar { width:64px; height:64px; font-size:25px; }.super-admin-card-identity h4 { font-size:18px; }.super-admin-card-identity p { font-size:13px; }.super-admin-card-meta { grid-template-columns:1fr; gap:8px; margin:15px 0 12px; padding:12px; border:0; border-radius:10px; background:#f3f8fc; }.super-admin-card-meta p { grid-template-columns:23px 1fr; }.super-admin-card-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }.super-admin-card-actions button:first-child { grid-column:1/-1; }.super-admin-card-actions button { min-height:43px; padding-inline:7px; font-size:12px; }.super-admin-own-account { grid-column:1/-1; } }
/* Productos próximos a vencer: superficie de control completa, basada en la
   referencia del comercio. El listado conserva su lectura de tabla en PC y
   cambia a fichas claras en pantalla táctil. */
#expiringInventoryDialog.expiring-inventory-dialog { border:1px solid #dce9ec; background:linear-gradient(145deg,#fff,#fbfefe); }
#expiringInventoryDialog .expiring-inventory-body { gap:22px; background:transparent; }
#expiringInventoryDialog .dialog-head { align-items:flex-start; }
#expiringInventoryDialog .dialog-head h2 { margin:4px 0 5px; color:#07162b; font-size:clamp(30px,2.8vw,42px); letter-spacing:-.04em; }
#expiringInventoryDialog .dialog-head .eyebrow { margin:0; color:#007e6e; font-size:12px; font-weight:900; text-transform:uppercase; }
#expiringInventoryDialog .expiring-inventory-subtitle { max-width:none; margin:0; color:#516d94; font-size:16px; }
#expiringInventoryDialog .dialog-head .icon-button { width:53px; min-width:53px; height:53px; border-radius:12px; color:#06162b; background:#fff; font-size:31px; }
.expiring-inventory-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.expiry-summary-card { display:grid; grid-template-columns:68px minmax(0,1fr) auto; align-items:center; min-height:124px; gap:17px; padding:18px 20px; border:1px solid #d9e7ec; border-radius:16px; color:#09213d; background:linear-gradient(135deg,#f8fffd,#edf9f7); text-align:left; cursor:pointer; }
.expiry-summary-card:hover { transform:translateY(-1px); box-shadow:0 10px 22px rgba(12,78,85,.09); }.expiry-summary-card>span { display:grid; width:68px; height:68px; place-items:center; border-radius:15px; color:#008b70; background:#d9f8ed; font-size:34px; font-weight:900; }.expiry-summary-card div { display:grid; gap:3px; }.expiry-summary-card strong { color:#082347; font-size:34px; line-height:1; }.expiry-summary-card b { font-size:16px; }.expiry-summary-card small { color:#58708e; font-size:13px; }.expiry-summary-card i { color:#00836d; font-size:35px; font-style:normal; }.expiry-summary-card.is-expired { border-color:#f5d5d5; background:linear-gradient(135deg,#fffafa,#fff3f2); }.expiry-summary-card.is-expired>span { color:#c31d1d; background:#ffe0df; }.expiry-summary-card.is-expired i { color:#c31d1d; }.expiry-summary-card.is-30 { border-color:#d4e4f7; background:linear-gradient(135deg,#f9fcff,#eff7ff); }.expiry-summary-card.is-30>span { color:#0969c2; background:#dcecff; }.expiry-summary-card.is-30 i { color:#0969c2; }
.expiring-inventory-toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; }.expiring-inventory-filters { flex-wrap:nowrap; gap:10px; }.expiring-inventory-filters button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:56px; padding:0 20px; border-color:#bfd0e0; border-radius:13px; color:#294a71; background:#f9fbfe; font-size:15px; font-weight:850; white-space:nowrap; }.expiring-inventory-filters button.active { border-color:#008f7b; color:#fff; background:linear-gradient(125deg,#009b83,#008376); box-shadow:0 8px 16px rgba(0,137,119,.18); }.expiring-inventory-search { display:flex; align-items:center; width:min(500px,40%); min-height:56px; gap:12px; padding:0 15px; border:1px solid #b9cbdf; border-radius:13px; color:#274a72; background:#fff; }.expiring-inventory-search>span { font-size:29px; line-height:1; }.expiring-inventory-search input { width:100%; min-width:0; border:0; outline:0; color:#183457; background:transparent; font:inherit; }.expiring-inventory-search button { border:0; color:#88a0bb; background:transparent; font-size:29px; line-height:1; }
.expiring-inventory-table-shell { min-height:0; border:1px solid #e0e9f0; border-radius:16px; overflow:hidden; background:#fff; box-shadow:0 6px 14px rgba(30,68,92,.035); }.expiring-inventory-table-head,.expiring-inventory-row { display:grid; grid-template-columns:38px minmax(190px,1.35fr) minmax(130px,.95fr) minmax(110px,.75fr) minmax(115px,.85fr) minmax(100px,.7fr) minmax(92px,.7fr) minmax(145px,.95fr) 54px; align-items:center; column-gap:15px; }.expiring-inventory-table-head { min-height:58px; padding:0 22px; color:#5d7292; background:linear-gradient(180deg,#f7fbfe,#f0f6fb); font-size:12px; font-weight:900; text-transform:uppercase; }.expiring-inventory-list { display:grid; max-height:none; overflow:auto; padding:0; }.expiring-inventory-row { min-height:112px; padding:0 22px; border:0; border-top:1px solid #e8eef3; border-radius:0; background:#fff; }.expiry-row-select { width:23px; height:23px; border:1px solid #bdcede; border-radius:5px; }.expiring-inventory-product { display:flex; align-items:center; gap:14px; }.expiry-product-photo { display:grid; width:76px; height:76px; flex:0 0 auto; place-items:center; overflow:hidden; border-radius:13px; color:#087e70; background:#def7f0; background-position:center; background-size:cover; font-size:20px; font-weight:900; }.expiring-inventory-product div { display:grid; min-width:0; gap:5px; }.expiring-inventory-product strong { overflow:hidden; color:#0a2348; font-size:17px; text-overflow:ellipsis; white-space:nowrap; }.expiring-inventory-product small,.expiry-code small { color:#5d7493; font-size:13px; }.expiry-code { display:grid; gap:6px; }.expiry-code strong { color:#102b52; font-size:15px; }.expiry-category { justify-self:start; padding:8px 11px; border-radius:999px; color:#1457a2; background:#e8f2ff; font-size:13px; font-weight:850; }.expiry-date,.expiry-quantity { color:#0b2a51; font-size:15px; white-space:nowrap; }.expiry-days { color:#008257; font-size:17px; white-space:nowrap; }.expiry-days.urgent,.expiry-days.expired { color:#c63a22; }.expiring-inventory-status { justify-self:start; padding:10px 14px; font-size:13px; }.expiry-action { width:48px; min-width:48px; height:48px; padding:0; border-color:#d5e0ec; font-size:17px; letter-spacing:2px; }.expiring-inventory-table-footer { display:flex; align-items:center; justify-content:space-between; min-height:100px; padding:0 22px; border-top:1px solid #e5edf3; color:#587191; font-size:15px; }.expiring-inventory-table-footer>div { display:flex; gap:8px; }.expiring-inventory-table-footer button,.expiring-inventory-table-footer strong { display:grid; width:49px; height:49px; place-items:center; border-radius:10px; }.expiring-inventory-table-footer strong { color:#fff; background:#008879; }.expiring-inventory-tip { display:flex; align-items:center; gap:13px; padding:17px 22px; border-radius:15px; color:#087364; background:linear-gradient(90deg,#effcf7,#f7fffd); }.expiring-inventory-tip span { font-size:28px; }.expiring-inventory-tip p { margin:0; font-size:15px; }.expiring-inventory-tip strong { color:#007b67; }.expiring-inventory-body>.dialog-actions { margin:0; }.expiring-inventory-body>.dialog-actions button { min-width:154px; min-height:58px; border-radius:12px; font-size:16px; }
@media (min-width:721px) { #expiringInventoryDialog.expiring-inventory-dialog { width:calc(100dvw / var(--app-scale) - 32px); height:calc(100dvh / var(--app-scale) - 32px); max-width:none; max-height:none; margin:16px auto; border-radius:20px; } #expiringInventoryDialog .expiring-inventory-body { display:grid; grid-template-rows:auto auto auto minmax(0,1fr) auto auto; height:100%; padding:28px 32px 22px; overflow:hidden; } #expiringInventoryDialog .expiring-inventory-table-shell { display:grid; grid-template-rows:auto minmax(0,1fr) auto; } }
@media (max-width:1100px) and (min-width:721px) { .expiring-inventory-summary { gap:12px; }.expiry-summary-card { grid-template-columns:52px minmax(0,1fr); padding:14px; }.expiry-summary-card>span { width:52px; height:52px; font-size:28px; }.expiry-summary-card small,.expiry-summary-card i { display:none; }.expiring-inventory-table-head,.expiring-inventory-row { grid-template-columns:32px minmax(175px,1.3fr) minmax(120px,.85fr) minmax(105px,.7fr) minmax(100px,.7fr) minmax(88px,.65fr) 50px; }.expiring-inventory-table-head span:nth-child(4),.expiring-inventory-row>.expiry-category,.expiring-inventory-table-head span:nth-child(6),.expiring-inventory-row>.expiry-days { display:none; } }
@media (max-width:720px) { #expiringInventoryDialog.expiring-inventory-dialog { width:100dvw; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; } #expiringInventoryDialog .expiring-inventory-body { display:flex; min-height:100dvh; padding:calc(18px + env(safe-area-inset-top)) 14px calc(15px + env(safe-area-inset-bottom)); overflow:auto; } #expiringInventoryDialog .dialog-head h2 { font-size:28px; }.expiring-inventory-summary { grid-template-columns:1fr; gap:10px; }.expiry-summary-card { min-height:87px; grid-template-columns:48px minmax(0,1fr) auto; gap:11px; padding:12px; }.expiry-summary-card>span { width:48px; height:48px; font-size:25px; }.expiry-summary-card strong { font-size:24px; }.expiry-summary-card b { font-size:14px; }.expiry-summary-card small { display:none; }.expiry-summary-card i { font-size:27px; }.expiring-inventory-toolbar { display:grid; gap:10px; }.expiring-inventory-filters { overflow-x:auto; padding-bottom:3px; }.expiring-inventory-filters button { min-height:46px; padding:0 14px; font-size:13px; }.expiring-inventory-search { width:auto; min-height:49px; }.expiring-inventory-table-head { display:none; }.expiring-inventory-table-shell { overflow:visible; }.expiring-inventory-list { overflow:visible; }.expiring-inventory-row { grid-template-columns:34px minmax(0,1fr) auto; gap:10px; min-height:0; padding:13px; }.expiry-row-select { width:20px; height:20px; }.expiring-inventory-product { gap:10px; }.expiry-product-photo { width:58px; height:58px; border-radius:10px; }.expiring-inventory-product strong { font-size:15px; white-space:normal; }.expiring-inventory-product small { font-size:12px; }.expiry-code,.expiry-date,.expiry-days,.expiry-quantity,.expiring-inventory-status { grid-column:2 / -1; }.expiry-code { grid-row:2; }.expiry-date { grid-row:3; }.expiry-days { grid-row:3; justify-self:end; }.expiry-quantity { grid-row:4; }.expiring-inventory-status { grid-row:4; justify-self:end; }.expiry-action { grid-column:3; grid-row:1; width:38px; min-width:38px; height:38px; }.expiring-inventory-table-footer { min-height:70px; padding:10px 13px; font-size:12px; }.expiring-inventory-table-footer button,.expiring-inventory-table-footer strong { width:38px; height:38px; }.expiring-inventory-tip { align-items:flex-start; padding:14px; }.expiring-inventory-tip p { font-size:13px; line-height:1.4; }.expiring-inventory-body>.dialog-actions { display:grid; grid-template-columns:1fr 1fr; }.expiring-inventory-body>.dialog-actions button { width:100%; min-width:0; min-height:51px; font-size:14px; } }
#expiringInventoryDialog .expiring-inventory-table-shell { min-height:224px; }
#expiringInventoryDialog .expiring-inventory-list { min-height:112px; grid-auto-rows:minmax(112px,auto); }
@media (min-width:721px) { #expiringInventoryDialog .expiring-inventory-body { grid-template-rows:auto auto auto minmax(224px,1fr) auto auto; overflow:auto; } }

/* En pantallas de trabajo el producto es la prioridad: cabecera y métricas
   compactas para entregar la mayor altura posible a la tabla. */
@media (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-body { gap:12px; grid-template-rows:auto auto auto minmax(210px,1fr) auto auto; padding:16px 24px 14px; }
  #expiringInventoryDialog .dialog-head h2 { margin:2px 0 3px; font-size:clamp(27px,2.25vw,34px); }
  #expiringInventoryDialog .dialog-head .eyebrow { font-size:10px; }
  #expiringInventoryDialog .expiring-inventory-subtitle { font-size:13px; }
  #expiringInventoryDialog .dialog-head .icon-button { width:43px; min-width:43px; height:43px; font-size:27px; }
  #expiringInventoryDialog .expiring-inventory-summary { gap:14px; }
  #expiringInventoryDialog .expiry-summary-card { grid-template-columns:48px minmax(0,1fr) auto; min-height:76px; gap:11px; padding:10px 14px; border-radius:13px; }
  #expiringInventoryDialog .expiry-summary-card>span { width:48px; height:48px; border-radius:12px; font-size:25px; }
  #expiringInventoryDialog .expiry-summary-card strong { font-size:25px; }
  #expiringInventoryDialog .expiry-summary-card b { font-size:13px; }
  #expiringInventoryDialog .expiry-summary-card small { font-size:10px; }
  #expiringInventoryDialog .expiry-summary-card i { font-size:26px; }
  #expiringInventoryDialog .expiring-inventory-toolbar { gap:12px; }
  #expiringInventoryDialog .expiring-inventory-filters { gap:7px; }
  #expiringInventoryDialog .expiring-inventory-filters button { min-height:43px; padding:0 15px; border-radius:10px; font-size:13px; }
  #expiringInventoryDialog .expiring-inventory-search { min-height:43px; padding:0 12px; border-radius:10px; font-size:13px; }
  #expiringInventoryDialog .expiring-inventory-search>span { font-size:24px; }
  #expiringInventoryDialog .expiring-inventory-table-shell { min-height:210px; }
  #expiringInventoryDialog .expiring-inventory-table-head { min-height:45px; font-size:10px; }
  #expiringInventoryDialog .expiring-inventory-row { min-height:112px; }
  #expiringInventoryDialog .expiring-inventory-table-footer { min-height:54px; }
  #expiringInventoryDialog .expiring-inventory-table-footer button,#expiringInventoryDialog .expiring-inventory-table-footer strong { width:40px; height:40px; }
  #expiringInventoryDialog .expiring-inventory-tip { padding:12px 16px; }
  #expiringInventoryDialog .expiring-inventory-tip p { font-size:13px; }
  #expiringInventoryDialog .expiring-inventory-body>.dialog-actions button { min-height:46px; }
}

/* Esta consulta aprovecha todo el viewport en escritorio; se compactan sus
   controles internos para reservar la mayor altura posible al inventario. */
@media (min-width:721px) {
  #expiringInventoryDialog.expiring-inventory-dialog {
    width:calc(100dvw / var(--app-scale) - 32px);
    height:calc(100dvh / var(--app-scale) - 32px);
    margin:16px auto;
  }
}

/* El listado es el único bloque elástico del diálogo. Esta regla se deja al
   final para prevalecer sobre las versiones visuales anteriores del módulo. */
@media (min-width:721px) {
  #expiringInventoryDialog .expiring-inventory-body {
    display:grid;
    height:100%;
    min-height:0;
    grid-template-rows:auto auto minmax(0,1fr);
    overflow:hidden;
  }
  #expiringInventoryDialog .expiring-inventory-table-shell {
    display:grid;
    height:100%;
    min-height:0;
    grid-template-rows:43px minmax(0,1fr) 55px;
  }
  #expiringInventoryDialog .expiring-inventory-list {
    min-height:0;
    height:100%;
    align-content:stretch;
    grid-auto-rows:minmax(44px,1fr);
  }
  #expiringInventoryDialog .expiring-inventory-row { min-height:44px; }
}

/* El pie del formulario de proveedor se reserva al borde inferior; la zona
   intermedia es la única que desplaza contenido. */
@media (min-width:721px) {
  #supplierDialog[open] { display:block; padding:0; }
  #supplierDialog #supplierForm {
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    width:100%;
    height:100%;
    min-height:0;
    box-sizing:border-box;
    overflow:hidden;
  }
  #supplierDialog .form-grid { min-height:0; overflow:auto; align-content:start; }
  #supplierDialog .dialog-actions { align-self:end; margin:0; }
}

/* El desplegable de Operaciones se desplaza por dentro cuando supera la
   altura disponible, sin extender la página del punto de venta. */
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel {
  box-sizing: border-box;
  max-height: calc((100dvh - 84px) / var(--app-scale));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel::before {
  display: none;
}

/* Las operaciones se agrupan por el trabajo que resuelven. Cada grupo mantiene
   sus botones originales para que los permisos y eventos existentes continúen
   funcionando igual en escritorio y móvil. */
.app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel {
  display: grid;
  gap: 12px;
}
.app-shell:not(.super-mode) #operationsMenu .operations-menu-group {
  display: grid;
  gap: 4px;
}
.app-shell:not(.super-mode) #operationsMenu .operations-menu-group + .operations-menu-group {
  padding-top: 11px;
  border-top: 1px solid rgba(5, 150, 105, .2);
}
.app-shell:not(.super-mode) #operationsMenu .operations-menu-group > p {
  margin: 0 7px 3px;
  color: #73f1d7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.app-shell:not(.super-mode) #operationsMenu .operations-menu-administration .mobile-menu-logout {
  color: #b42318;
}
.app-shell:not(.super-mode) #operationsMenu .operations-menu-administration .mobile-menu-logout .operation-menu-icon {
  color: #c24132;
}
@media (max-width: 720px) {
  .app-shell:not(.super-mode) #operationsMenu .top-actions-menu-panel {
    gap: 10px;
  }
  .app-shell:not(.super-mode) #operationsMenu .operations-menu-group + .operations-menu-group {
    padding-top: 9px;
  }
  .app-shell:not(.super-mode) #operationsMenu .operations-menu-group > p {
    display: block;
    margin: 0 8px 3px;
    color: #73f1d7;
    font-size: 10px;
  }
}

/* Safari en pantallas compactas puede inflar el texto de los formularios y
   calcular tarde las filas de una rejilla. En Nueva cita usamos un flujo
   vertical real para que Teléfono, Servicios y el resto nunca se monten. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 720px) {
  .appointments-dialog.operation-dialog .appointment-form {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    overflow: visible;
  }

  .appointments-dialog.operation-dialog .appointment-form > label,
  .appointments-dialog.operation-dialog .appointment-form > .appointment-form-actions {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
  }

  .appointments-dialog.operation-dialog .appointment-form > label {
    display: grid;
    align-content: start;
    gap: 7px;
  }

  .appointments-dialog.operation-dialog .appointment-service-field {
    isolation: isolate;
    z-index: 1;
  }

  .appointments-dialog.operation-dialog .appointment-service-field:focus-within {
    z-index: 20;
  }

  .appointments-dialog.operation-dialog .appointment-service-suggestions {
    top: calc(100% + 3px);
  }
}
