﻿:root{
  --font-main: "ITC Avant Garde Gothic", "Avant Garde", "Century Gothic", "URW Gothic L", "Futura", "Trebuchet MS", sans-serif;
  --bg0:#070A12; --bg1:#0B1024;
  --card: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);
  --text:#EAF0FF; --muted:#A9B3D0;

  --accent:#7C3AED; --accent2:#22D3EE;
  --ok:#2EE59D; --bad:#FF4D6D; --warn:#FFB020;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
body{margin:0; font-family: var(--font-main); color:var(--text)}
html.modal-open,
body.modal-open{
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}
body.modal-open{
  position: fixed;
  inset: 0;
  width: 100%;
}

/* Native controls baseline: global scrollbar skin */
html{
  scrollbar-gutter: stable;
}
html,
body,
.app,
.app *{
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.72) rgba(15,23,42,.55);
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.app::-webkit-scrollbar,
.app *::-webkit-scrollbar{
  width:10px;
  height:10px;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.app::-webkit-scrollbar-track,
.app *::-webkit-scrollbar-track{
  background: rgba(15,23,42,.55);
  border-radius:999px;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.app::-webkit-scrollbar-thumb,
.app *::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(56,189,248,.80), rgba(14,165,233,.68));
  border-radius:999px;
  border:2px solid rgba(15,23,42,.68);
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.app::-webkit-scrollbar-thumb:hover,
.app *::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(125,211,252,.92), rgba(56,189,248,.84));
}
.bg{
  min-height:100vh;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(124,58,237,.25), transparent 55%),
    radial-gradient(900px 500px at 80% 30%, rgba(34,211,238,.20), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.center{min-height:100vh; display:grid; place-items:center; padding:24px}
.card{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:18px;
  backdrop-filter: blur(10px);
}
.auth{width:min(420px, 92vw)}
.title{font-size:22px; font-weight:800}
.sub{color:var(--muted); font-size:13px; margin-top:6px; margin-bottom:14px}

.loginPage{
  min-height:100vh;
  margin:0;
  font-family: var(--font-main);
  color:#EAF0FF;
  background:
    radial-gradient(820px 520px at 18% 15%, rgba(56,189,248,.18), transparent 58%),
    radial-gradient(900px 560px at 85% 85%, rgba(14,165,233,.22), transparent 58%),
    linear-gradient(150deg, #0B1222, #0F172A 48%, #111827);
  display:grid;
  place-items:center;
  padding:18px;
}
.loginWrap{
  width:min(540px, 96vw);
}
.loginCard{
  background: linear-gradient(180deg, rgba(15,23,42,.78), rgba(2,6,23,.78));
  border:1px solid rgba(148,163,184,.24);
  border-radius:30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 55px rgba(2,6,23,.48);
  padding:30px 30px 26px 30px;
}
.loginLogoWrap{
  width:98px;
  height:98px;
  border-radius:999px;
  margin:0 auto 12px auto;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.18);
}
.loginLogo{
  width:70px;
  height:70px;
  object-fit:contain;
}
.loginTitle{
  text-align:center;
  font-size:26px;
  font-weight:800;
  letter-spacing:.05em;
  margin-bottom:14px;
}
.loginAvatarPreviewWrap{
  width:144px;
  height:144px;
  border-radius:999px;
  margin:0 auto 10px auto;
  display:grid;
  place-items:center;
  border:2px dashed rgba(148,163,184,.35);
  background: rgba(15,23,42,.72);
  overflow:hidden;
}
.loginAvatarPreviewImg{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.loginAvatarPreviewFallback{
  color:#94A3B8;
  font-size:13px;
  font-weight:700;
  letter-spacing:.03em;
}
.loginPickTitle{
  color:#CBD5E1;
  font-size:13px;
  margin-bottom:6px;
  font-weight:700;
}
.loginPickInput{
  width:100%;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(148,163,184,.30);
  border-radius:10px;
  color:#E2E8F0;
  padding:12px 14px;
  outline:none;
  margin-bottom:12px;
}
.loginPickInput:focus{
  border-color: rgba(56,189,248,.55);
  box-shadow: 0 0 0 4px rgba(56,189,248,.16);
}
.loginPickSuggest{
  margin-top:-8px;
  margin-bottom:12px;
  max-height:220px;
  overflow:auto;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(2,6,23,.92);
  box-shadow: 0 12px 26px rgba(2,6,23,.45);
}
.loginPickItem{
  width:100%;
  border:0;
  border-bottom:1px solid rgba(148,163,184,.18);
  background: transparent;
  color:#E2E8F0;
  text-align:left;
  padding:10px 12px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.loginPickItem:last-child{
  border-bottom:0;
}
.loginPickItem:hover{
  background: rgba(56,189,248,.16);
}
.loginPickUser{
  font-size:13px;
  font-weight:800;
}
.loginPickName{
  font-size:12px;
  color:#94A3B8;
}
.loginField{
  display:flex;
  align-items:center;
  gap:12px;
  border-bottom:1px solid rgba(226,232,240,.38);
  margin-bottom:14px;
}
.loginFieldIcon{
  color:#7DD3FC;
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
}
.loginFieldIcon svg{
  width:18px;
  height:18px;
  stroke: currentColor;
  fill: none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.loginInput{
  width:100%;
  background:transparent;
  border:none;
  outline:none;
  color:#F8FAFC;
  font-size:16px;
  padding:11px 2px;
}
.loginMeta{
  margin-top:6px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:12px;
  color:#CBD5E1;
}
.loginRemember{
  display:flex;
  align-items:center;
  gap:6px;
}
.loginForgot{
  color:#C4B5FD;
  text-decoration:none;
}
.loginBtn{
  margin-top:16px;
  width:100%;
  border:none;
  border-radius:14px;
  padding:14px 16px;
  cursor:pointer;
  font-weight:800;
  color:#E2E8F0;
  letter-spacing:.11em;
  background: linear-gradient(90deg, #0369A1, #2563EB);
}
.loginMsg{
  margin-top:10px;
  min-height:20px;
  text-align:center;
  color:#CBD5E1;
  font-size:13px;
}
.loginMsg.bad{color:#FCA5A5}

@media (max-width: 640px){
  .loginWrap{
    width:min(96vw, 420px);
  }
  .loginCard{
    border-radius:22px;
    padding:20px 16px 18px 16px;
  }
  .loginTitle{
    font-size:22px;
  }
  .loginAvatarPreviewWrap{
    width:110px;
    height:110px;
  }
  .loginPickSuggest{
    max-height:180px;
  }
}

.lbl{
  display:block;
  color:#E2E8F0;
  font-size:13px;
  font-weight:800;
  letter-spacing:.01em;
  margin:10px 0 6px;
}
.in, .ta{
  width:100%;
  background: rgba(2,6,23,.72);
  border:1px solid rgba(148,163,184,.42);
  border-radius:12px;
  padding:12px 12px;
  color:#F8FAFC;
  font-size:14px;
  font-weight:600;
  outline:none;
}
@supports (-webkit-touch-callout: none){
  .in, .ta{
    font-size:16px;
  }
}
.ta{min-height:80px; resize:vertical}
.in:focus,.ta:focus{
  border-color: rgba(56,189,248,.85);
  box-shadow: 0 0 0 4px rgba(56,189,248,.18);
}
.in::placeholder,.ta::placeholder{
  color:#93A7BF;
  opacity:1;
}
.entPriceLabelRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.entPriceChip{
  border:1px solid rgba(56,189,248,.45);
  background: rgba(56,189,248,.12);
  color:#BAE6FD;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  padding:4px 10px;
  cursor:pointer;
  line-height:1.2;
}
.entPriceChip:hover{
  background: rgba(56,189,248,.2);
  border-color: rgba(56,189,248,.7);
}

.btn{
  margin-top:12px;
  width:100%;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  color: #0B1024;
  font-weight:800;
  cursor:pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.btn.soft{
  width:auto; margin:0;
  padding:10px 12px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  border:1px solid rgba(255,255,255,.10);
}
.btn.ok{ background: linear-gradient(135deg, var(--ok), var(--accent2)); }
.msg{margin-top:10px; font-size:13px; color:var(--muted)}
.msg.bad{color:var(--bad)}
.msg.ok{color:var(--ok)}

.shell{display:grid; grid-template-columns: 240px 1fr; min-height:100vh}
.sidebar{
  padding:16px;
  border-right:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.brand{display:flex; gap:10px; align-items:center; margin-bottom:14px}
.brandDot{width:12px; height:12px; border-radius:50%; background: linear-gradient(135deg, var(--accent), var(--accent2))}
.brandTitle{font-weight:900}
.brandSub{color:var(--muted); font-size:12px}

.nav{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  cursor:pointer;
  text-align:left;
  margin-top:10px;
}
.nav.active{border-color: rgba(34,211,238,.55); box-shadow:0 0 0 4px rgba(34,211,238,.10)}
.nav.danger{border-color: rgba(255,77,109,.35)}

.spacer{height:18px}

.main{padding:16px}
.topbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px}
.h1{font-size:22px; font-weight:900}
.panel{display:block}
.hidden{display:none}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:14px}
@media (max-width: 980px){
  .shell{grid-template-columns: 1fr}
  .sidebar{position:sticky; top:0; z-index:10}
  .grid2{grid-template-columns:1fr}
}

.cardTitle{
  font-weight:900;
  font-size:18px;
  color:#F8FAFC;
  letter-spacing:.01em;
  margin-bottom:10px;
}
.userSection{
  margin-top:12px;
  padding:10px 12px 12px 12px;
  border:1px solid rgba(125,211,252,.28);
  border-radius:16px;
  background:
    linear-gradient(135deg, rgba(14,116,144,.14), rgba(30,64,175,.10)),
    rgba(2,6,23,.35);
  box-shadow: 0 14px 28px rgba(2,6,23,.28);
}
.userSection:first-child{margin-top:0}
.userSectionToggle{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:none;
  background:transparent;
  color:inherit;
  cursor:pointer;
  padding:2px 0;
  text-align:left;
}
.userSectionToggle .cardTitle{margin:0}
.userSectionIcon{
  width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid rgba(125,211,252,.35);
  background: rgba(56,189,248,.16);
  color:#E0F2FE;
  display:grid;
  place-items:center;
  font-size:14px;
  font-weight:900;
  line-height:1;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.userSectionBody{
  margin-top:10px;
  max-height:2400px;
  overflow:hidden;
  opacity:1;
  transform:translateY(0);
  transition:max-height .28s ease, opacity .22s ease, transform .22s ease;
}
.userSection.is-collapsed .userSectionBody{
  margin-top:0;
  max-height:0;
  opacity:.35;
  transform:translateY(-4px);
}
.userSection.is-collapsed .userSectionIcon{
  transform:rotate(-90deg);
  background: rgba(148,163,184,.16);
  border-color: rgba(148,163,184,.35);
}
.userSection.is-collapsed{
  box-shadow: 0 8px 18px rgba(2,6,23,.2);
}
.row{
  display:flex;
  gap:10px;
  min-width:0;
}
.row > *{
  min-width:0;
}
.row .in{flex:1}

.list{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.item{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.itemTop{display:flex; justify-content:space-between; gap:10px}
.badge{font-size:11px; padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); color:var(--muted)}
.badge.ok{color:var(--ok); border-color: rgba(46,229,157,.35)}
.badge.warn{color:var(--warn); border-color: rgba(255,176,32,.35)}

.cart{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.cartRow{display:flex; justify-content:space-between; gap:10px; align-items:center}
.xbtn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}

.tableWrap{
  overflow:auto;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  margin-top:10px;
  width:100%;
  max-width:100%;
  min-width:0;
}
.manageTableCompact{
  min-height: 180px;
  max-height: min(320px, calc(100dvh - 340px));
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.manageTableCompact::-webkit-scrollbar{
  width:0;
  height:0;
}
.limitsTableCompact{
  max-height: min(260px, calc(100dvh - 420px));
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.38) rgba(255,255,255,.06);
}
.limitsTableCompact::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}
.limitsTableCompact::-webkit-scrollbar-track{
  background: rgba(255,255,255,.05);
  border-radius: 999px;
}
.limitsTableCompact::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(148,163,184,.42), rgba(100,116,139,.38));
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.05);
}
.limitsTableCompact::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(148,163,184,.52), rgba(100,116,139,.46));
}
.tbl{width:100%; border-collapse:collapse; min-width:640px}
.tbl th,.tbl td{padding:10px; border-bottom:1px solid rgba(255,255,255,.08); font-size:13px}
.tbl th{color:var(--muted); text-align:left; background: rgba(255,255,255,.03)}
.tblFilterRow th{
  background: rgba(2,6,23,.75) !important;
  padding:6px;
}
.tblFilter{
  padding:9px 10px;
  min-width:120px;
  font-size:13px;
  font-weight:700;
  color:#F8FAFC;
  background: rgba(15,23,42,.92);
  border:1px solid rgba(148,163,184,.5);
  border-radius:10px;
}
.tblFilter:focus{
  outline:none;
  border-color:#7DD3FC;
  box-shadow: 0 0 0 3px rgba(56,189,248,.2);
}
.note{
  color:#D1DDEE;
  line-height:1.5;
  font-weight:600;
}

/* =========================
   NUEVA PRINCIPAL
========================= */
.app{
  margin:0;
  font-family: var(--font-main);
  color:#E5E7EB;
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(56, 189, 248, .18), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(244, 114, 182, .16), transparent 55%),
    linear-gradient(180deg, #0B1222, #0F172A);
  min-height:100vh;
  overflow-x:hidden;
}
.appShell{
  display:grid;
  grid-template-columns: 64px 1fr;
  min-height:100vh;
  min-width:0;
}
.rail{
  background:#0F172A;
  color:#E5E7EB;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:14px 10px;
  gap:14px;
  border-right:1px solid rgba(255,255,255,.08);
  position:relative;
  z-index:5;
}
.railLogo{
  width:34px;
  height:34px;
  object-fit:contain;
  display:block;
  filter: drop-shadow(0 4px 10px rgba(2,6,23,.35));
}
.railHint{
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing:3px;
  font-size:13px;
  font-weight:800;
  color:#CBD5E1;
}
.rail::after{
  content:"\203A";
  position:absolute;
  right:-11px;
  top:50%;
  transform: translateY(-50%);
  width:22px;
  height:22px;
  border-radius:999px;
  background:#22D3EE;
  color:#0B1222;
  font-size:18px;
  font-weight:900;
  display:grid;
  place-items:center;
  box-shadow: 0 8px 16px rgba(2,6,23,.38);
}

.menu{
  position:fixed;
  left:64px;
  top:0;
  bottom:0;
  width:260px;
  background:#0B1222;
  color:#F8FAFC;
  padding:16px;
  border-right:1px solid rgba(255,255,255,.08);
  transform: translateX(-12px);
  opacity:0;
  pointer-events:none;
  transition: all .25s ease;
  z-index:4;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.menu{
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.menu::-webkit-scrollbar{
  width: 0;
  height: 0;
}
.rail:hover + .menu,
.menu:hover{
  transform: translateX(0);
  opacity:1;
  pointer-events:auto;
}
.menuHeader{margin-bottom:14px}
.menuAvatarWrap{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.menuInitialBadge,
.menuAvatarImg{
  width:54px;
  height:54px;
  border-radius:999px;
}
.menuInitialBadge{
  display:grid;
  place-items:center;
  border:2px solid rgba(148,163,184,.45);
  background: linear-gradient(135deg, rgba(51,65,85,.8), rgba(15,23,42,.95));
  color:#E2E8F0;
  font-weight:800;
  font-size:20px;
}
.menuAvatarImg{
  display:block;
  object-fit:cover;
  border:2px solid rgba(56,189,248,.45);
  box-shadow: 0 6px 18px rgba(2,6,23,.32);
  cursor:pointer;
  transition: transform .18s ease, box-shadow .2s ease;
  transform-origin: center center;
  position:relative;
  z-index:2;
}
.menuAvatarImg:hover{
  transform: scale(2);
  box-shadow: 0 14px 26px rgba(2,6,23,.45);
}
.brandTitle{font-weight:900; font-size:18px}
.brandWelcome{
  color:#E2E8F0;
  font-size:12px;
  font-weight:700;
  margin-top:4px;
}
.brandSub{color:#CBD5E1; font-size:12px; margin-top:4px}
.menuGroup{margin-top:14px}
.menuTitle{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
  font-weight:800;
  color:#E2E8F0;
  margin-bottom:9px;
}
.menuGroupToggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background: linear-gradient(135deg, rgba(56,189,248,.26), rgba(14,116,144,.22));
  border:1px solid rgba(56,189,248,.45);
  border-radius:10px;
  padding:10px 12px;
  cursor:pointer;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.18);
}
.menuGroupToggle .menuTitle{
  margin:0;
  color:#BAE6FD;
}
.menuGroupCaret{
  color:#BAE6FD;
  font-size:12px;
  transition: transform .18s ease;
}
.menuGroupToggle:hover{
  background: linear-gradient(135deg, rgba(34,211,238,.34), rgba(14,165,233,.26));
  border-color: rgba(34,211,238,.6);
}
.menuGroupBody{
  margin-top:8px;
}
.menuAccordion.is-collapsed .menuGroupBody{
  display:none;
}
.menuAccordion:not(.is-collapsed) .menuGroupCaret{
  transform: rotate(180deg);
}

.menuBtn{
  width:100%;
  text-align:left;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color:#E5E7EB;
  padding:13px 14px;
  border-radius:10px;
  cursor:pointer;
  margin-bottom:8px;
  font-size:16px;
  font-weight:800;
  line-height:1.25;
  transition: all .15s ease;
}

.menuBtn:hover{
  background: linear-gradient(135deg, rgba(249,115,22,.20), rgba(34,211,238,.20));
  border-color: rgba(34,211,238,.55);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(15,23,42,.22);
}
.menuBtn.danger{
  border-color: rgba(248,113,113,.35);
  color:#FCA5A5;
}
.menuSpacer{height:10px}

.avatarField{
  display:flex;
  align-items:flex-end;
}
.avatarFile{
  padding:6px;
  border-radius:12px;
}
.avatarFile::file-selector-button{
  border:1px solid rgba(56,189,248,.45);
  background: linear-gradient(135deg, rgba(56,189,248,.20), rgba(34,211,238,.20));
  color:#E2E8F0;
  border-radius:10px;
  padding:8px 12px;
  margin-right:10px;
  cursor:pointer;
  font-weight:700;
}
.avatarPreviewImg,
.avatarPreviewFallback{
  width:64px;
  height:64px;
  border-radius:999px;
}
.avatarPreviewImg{
  display:block;
  object-fit:cover;
  border:2px solid rgba(56,189,248,.45);
}
.avatarPreviewFallback{
  display:grid;
  place-items:center;
  background: rgba(15,23,42,.72);
  border:2px dashed rgba(148,163,184,.42);
  color:#CBD5E1;
  font-size:11px;
  text-align:center;
  padding:6px;
}
.logoPreviewField{
  display:flex;
  align-items:flex-end;
}
.logoPreviewImg,
.logoPreviewFallback{
  width:160px;
  height:72px;
  border-radius:16px;
}
.logoPreviewImg{
  display:block;
  object-fit:contain;
  background:#fff;
  border:2px solid rgba(56,189,248,.35);
  padding:6px;
}
.logoPreviewFallback{
  display:grid;
  place-items:center;
  background: rgba(15,23,42,.72);
  border:2px dashed rgba(148,163,184,.42);
  color:#CBD5E1;
  font-size:11px;
  text-align:center;
  padding:6px;
}
.avatarCell{
  text-align:center;
  vertical-align:middle;
}
.avatarThumb{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:cover;
  border:1px solid rgba(56,189,248,.4);
  display:inline-block;
}
.avatarThumbEmpty{
  width:22px;
  height:22px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(148,163,184,.10);
  color:#CBD5E1;
  font-size:12px;
  line-height:1;
}

.stage{
  grid-column:2 / -1;
  padding:22px 24px 30px 24px;
  margin-left:0;
  min-width:0;
  max-width:100%;
}
.stageTop{
  background: rgba(15,23,42,.65);
  border:1px solid rgba(148,163,184,.2);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 12px 30px rgba(2,6,23,.45);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.stageHeadText{min-width:0}
.stageTitle{font-size:24px; font-weight:900; color:#F8FAFC; letter-spacing:.01em}
.stageSub{color:#E2E8F0; font-size:14px; font-weight:600; margin-top:4px}
.supervisorBadge{
  margin-top:8px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(45,212,191,.45);
  background: rgba(13,148,136,.16);
  color:#99F6E4;
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  font-weight:700;
}
.stageHeadLogoWrap{
  flex:0 0 auto;
  display:flex;
  align-items:center;
}
.stageHeadLogo{
  max-height:56px;
  width:auto;
  object-fit:contain;
  opacity:.96;
  filter: drop-shadow(0 6px 16px rgba(2,6,23,.35));
}
.stageBody{
  margin-top:16px;
  min-width:0;
  max-width:100%;
}
.emptyCard{
  background: rgba(15,23,42,.6);
  border:1px dashed rgba(148,163,184,.3);
  border-radius:18px;
  padding:22px;
  max-width:720px;
}
.emptyTitle{font-weight:800; font-size:18px}
.emptyText{color:#CBD5E1; margin-top:6px; line-height:1.5}

.view{
  display:block;
  min-width:0;
  max-width:100%;
}
.view.hidden{display:none}
.card.light{
  background: rgba(15,23,42,.7);
  border:1px solid rgba(148,163,184,.2);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 12px 30px rgba(2,6,23,.45);
  min-width:0;
  max-width:100%;
}
.divider{height:1px; background:rgba(148,163,184,.25); margin:16px 0}
.grid3{display:grid; grid-template-columns: repeat(3, 1fr); gap:10px}
.grid4{display:grid; grid-template-columns: repeat(4, 1fr); gap:10px}
.grid2 > *,
.grid3 > *,
.grid4 > *{
  min-width:0;
}
.addRow{
  display:flex;
  align-items:flex-end;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
}
.addRow > *{
  min-width:0;
}
.searchWrap{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.searchWrap .in{
  flex:1;
  min-width:0;
}
.searchWrap .btn{
  flex:0 0 auto;
  margin-top:0;
}
.warehouseCheckList{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
  padding:10px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:12px;
  background: rgba(2,6,23,.24);
  min-height:48px;
}
.warehouseCheckItem{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(96,165,250,.22);
  background: rgba(30,41,59,.55);
  color:#E5E7EB;
  font-size:12px;
}
.warehouseCheckItem input{
  margin:0;
}
.warehouseCheckEmpty{
  color:#94A3B8;
  font-size:12px;
}
.ajProductGrid{
  grid-template-columns: minmax(260px, 2fr) 1fr 1fr 1fr;
}
.app #view-ajustes .in.in-compact{
  max-width:170px;
  padding:9px 10px;
  font-size:13px;
}
.ajFlowCard{
  margin: 6px 0 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.35);
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(2,6,23,.72));
}
.ajFlowCard.is-entrada{
  border-color: rgba(34,197,94,.45);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.12);
}
.ajFlowCard.is-salida{
  border-color: rgba(248,113,113,.45);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.12);
}
.ajFlowTitle{
  font-weight: 800;
  color:#F8FAFC;
}
.ajFlowDesc{
  margin-top: 4px;
  color:#CBD5E1;
  font-size: 12px;
}
.ajEntradaOnly.hidden{
  display:none;
}
.ajImpactBox{
  margin-top: 6px;
  font-size: 12px;
  color:#BFDBFE;
}
.ajImpactBox.is-entrada{
  color:#86EFAC;
}
.ajImpactBox.is-salida{
  color:#FCA5A5;
}
.ajQty.entrada{
  color:#86EFAC;
  font-weight:800;
}
.ajQty.salida{
  color:#FCA5A5;
  font-weight:800;
}
.ajMiniHelp{
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148,163,184,.45);
  background: rgba(15,23,42,.48);
}
.ajMiniHelpTitle{
  font-size: 12px;
  font-weight: 800;
  color:#E2E8F0;
  margin-bottom: 6px;
}
.ajMiniHelpStep{
  font-size: 12px;
  color:#CBD5E1;
  line-height: 1.45;
}
.ajMiniHelpStep + .ajMiniHelpStep{
  margin-top: 3px;
}
.ajResume{
  margin-bottom: 10px;
  color:#CBD5E1;
  font-size: 12px;
}
.grid2{display:grid; grid-template-columns: repeat(2, 1fr); gap:10px}
.cuadreStickyHead{
  position:sticky;
  top:10px;
  z-index:20;
  display:grid;
  gap:14px;
  margin-bottom:14px;
  padding:14px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(15,23,42,.97), rgba(2,6,23,.95));
  border:1px solid rgba(96,165,250,.18);
  box-shadow:0 14px 28px rgba(2,6,23,.32);
  backdrop-filter:blur(10px);
}
.cuadreShell{
  display:grid;
  grid-template-columns:minmax(0, 1.55fr) minmax(320px, .9fr);
  gap:18px;
  align-items:start;
}
.cuadreMain{
  min-width:0;
  display:grid;
  gap:14px;
}
.cuadreActions{
  justify-content:flex-end;
}
.cuadreResumeGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
}
.cuadreResumeCard{
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(96,165,250,.24);
  background:linear-gradient(180deg, rgba(15,23,42,.92), rgba(2,6,23,.76));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.cuadreResumeCard.accent{
  border-color:rgba(45,212,191,.34);
  background:linear-gradient(180deg, rgba(8,47,73,.92), rgba(6,24,39,.88));
}
.cuadreResumeLabel{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#94A3B8;
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-bottom:6px;
}
.cuadreResumeCard strong{
  display:block;
  font-size:28px;
  line-height:1;
  color:#F8FAFC;
}
.cuadreBlock{
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(148,163,184,.16);
  background:linear-gradient(180deg, rgba(8,15,33,.82), rgba(2,6,23,.68));
}
.cuadreBlockHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.cuadreMiniGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
.cuadreDenomInput{
  min-width:180px;
}
.cuadreDenomTableWrap{
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(96,165,250,.14);
}
.cuadreDenomTable{
  table-layout:fixed;
}
.cuadreDenomTable th,
.cuadreDenomTable td{
  vertical-align:middle;
}
.cuadreDenomTable th:nth-child(1),
.cuadreDenomTable td:nth-child(1){
  width:130px;
}
.cuadreDenomTable th:nth-child(2),
.cuadreDenomTable td:nth-child(2){
  width:150px;
}
.cuadreDenomTable th:nth-child(3),
.cuadreDenomTable td:nth-child(3){
  width:120px;
}
.cuadreDenomTable th:nth-child(4),
.cuadreDenomTable td:nth-child(4){
  width:110px;
}
.cuadreDenomCol-label,
.cuadreDenomCol-action{
  text-align:center;
}
.cuadreDenomCol-qty{
  text-align:center;
}
.cuadreDenomCol-total{
  text-align:right;
}
.app .cuadreDenomTableWrap .in.cuadreQtyInput{
  width:96px;
  max-width:96px;
  min-width:96px;
  text-align:center;
  padding-left:8px;
  padding-right:8px;
}
.cuadreDenomBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:86px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(37,99,235,.18);
  border:1px solid rgba(96,165,250,.28);
  font-weight:800;
  color:#DBEAFE;
}
.cuadreLineTotal{
  font-weight:800;
  color:#7DD3FC;
}
.cuadrePreviewWrap{
  position:sticky;
  top:16px;
}
.cuadrePreviewCard{
  border-radius:22px;
  padding:16px;
  border:1px solid rgba(45,212,191,.22);
  background:
    radial-gradient(circle at top, rgba(45,212,191,.12), transparent 34%),
    linear-gradient(180deg, rgba(8,15,33,.95), rgba(2,6,23,.92));
  box-shadow:0 18px 40px rgba(2,6,23,.38);
}
.cuadrePreviewHead{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:14px;
}
.cuadrePreviewEyebrow{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#5EEAD4;
  font-weight:900;
}
.cuadreTicket{
  border-radius:20px;
  padding:18px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(241,245,249,.98));
  color:#0F172A;
  box-shadow:0 14px 28px rgba(15,23,42,.3);
}
.cuadreTicketBrand{
  text-align:center;
  font-size:18px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  padding-bottom:12px;
  border-bottom:1px dashed rgba(15,23,42,.22);
}
.cuadreTicketMeta,
.cuadreTicketSection{
  padding-top:12px;
}
.cuadreTicketMeta{
  display:grid;
  gap:8px;
}
.cuadreTicketMeta div,
.cuadreTicketLine{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.cuadreTicketMeta span,
.cuadreTicketLine span{
  color:#475569;
  font-size:12px;
}
.cuadreTicketMeta strong,
.cuadreTicketLine strong{
  color:#020617;
  font-size:12px;
  font-weight:900;
}
.cuadreTicketTitle{
  margin-bottom:8px;
  padding-bottom:6px;
  border-bottom:1px dashed rgba(15,23,42,.18);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.1em;
  font-weight:900;
}
.cuadreTicketLines{
  display:grid;
  gap:6px;
}
.cuadreTicketLine.total{
  margin-top:8px;
}
.cuadreTicketLine.strong span,
.cuadreTicketLine.strong strong{
  font-size:14px;
  color:#020617;
}
.cuadreTicketEmpty{
  color:#94A3B8;
  font-style:italic;
}
.cuadreTicketFooter{
  margin-top:14px;
  padding-top:12px;
  border-top:1px dashed rgba(15,23,42,.22);
  text-align:center;
  font-size:11px;
  color:#64748B;
}
.importGrid{align-items:stretch}
.adminImportCard{
  background: linear-gradient(180deg, rgba(15,23,42,.78), rgba(2,6,23,.74));
  border:1px solid rgba(56,189,248,.28);
  border-radius:14px;
  padding:12px;
}
.importTitle{
  font-weight:800;
  color:#E2E8F0;
  font-size:14px;
}
.importRow{
  display:flex;
  align-items:center;
  gap:8px;
}
.importInputFile{
  position:absolute;
  opacity:0;
  pointer-events:none;
  width:1px;
  height:1px;
}
.importPickBtn{
  white-space:nowrap;
  min-width:130px;
}
.importFileName{
  flex:1;
  min-height:38px;
  border-radius:10px;
  border:1px dashed rgba(148,163,184,.45);
  background: rgba(2,6,23,.5);
  color:#CBD5E1;
  display:flex;
  align-items:center;
  padding:0 10px;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

@media (max-width: 980px){
  .grid3{grid-template-columns:1fr}
  .grid4{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .cuadreStickyHead{position:static; top:auto; padding:0; background:transparent; border:none; box-shadow:none; backdrop-filter:none}
  .cuadreShell{grid-template-columns:1fr}
  .cuadreResumeGrid{grid-template-columns:1fr 1fr}
  .cuadreMiniGrid{grid-template-columns:1fr}
  .cuadrePreviewWrap{position:static}
  .cuadreDenomTable{
    min-width:500px;
  }
  .ajProductGrid{
    grid-template-columns:1fr;
  }
  .importRow{
    flex-direction:column;
    align-items:stretch;
  }
  .importPickBtn{
    min-width:0;
  }
}

/* Inputs/labels for new light theme */
.app .lbl{
  color:#E2E8F0;
  font-weight:800;
  font-size:13px;
  letter-spacing:.01em;
}
.app .in, .app select.in{
  background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(2,6,23,.76));
  color:#F8FAFC;
  border:1px solid rgba(148,163,184,.5);
  font-weight:700;
}
@supports (-webkit-touch-callout: none){
  .app .in, .app select.in{
    font-size:16px;
  }
}
.app .in:hover, .app select.in:hover{
  border-color: rgba(125,211,252,.7);
  background: linear-gradient(180deg, rgba(30,41,59,.94), rgba(15,23,42,.8));
}
.app .in:focus, .app select.in:focus{
  border-color:#7DD3FC;
  box-shadow: 0 0 0 4px rgba(56,189,248,.24);
}
.app .in::placeholder,
.app textarea.in::placeholder{
  color:#9FB3CC;
  opacity:1;
}
.app .in:disabled,
.app select.in:disabled{
  color:#E2E8F0;
  border-color: rgba(148,163,184,.38);
  background: linear-gradient(180deg, rgba(30,41,59,.75), rgba(15,23,42,.68));
  opacity:1;
}
.app.apple-webkit select.in.combo-apple-fix,
.app.windows-webkit select.in.combo-win-fix{
  -webkit-appearance:none;
  appearance:none;
  border-radius:12px;
  padding-right:40px;
  min-height:44px;
  line-height:1.25;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23E5E7EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:16px 16px;
}
.app.apple-webkit select.in.combo-apple-fix::-ms-expand,
.app.windows-webkit select.in.combo-win-fix::-ms-expand{
  display:none;
}
.app.apple-webkit select.in.combo-apple-fix option,
.app.windows-webkit select.in.combo-win-fix option{
  color:#E5E7EB;
  background:#0B1222;
}
@supports (-webkit-touch-callout: none){
  .app.apple-webkit select.in.combo-apple-fix{
    font-size:16px;
  }
}
.app input[type="date"].in,
.app input[type="time"].in{
  color-scheme: dark;
  background: linear-gradient(180deg, rgba(2,6,23,.85), rgba(2,6,23,.55));
  padding-right:40px;
  min-height:44px;
  height:44px;
  line-height:1.2;
}
.app input[type="date"].in::-webkit-calendar-picker-indicator,
.app input[type="time"].in::-webkit-calendar-picker-indicator{
  filter: invert(1) brightness(2.8) saturate(0);
  opacity:1;
  width:22px;
  height:22px;
  margin-right:2px;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  cursor:pointer;
}
.app input[type="date"].in:focus::-webkit-calendar-picker-indicator,
.app input[type="time"].in:focus::-webkit-calendar-picker-indicator{
  opacity:1;
}
.app input[type="number"].in::-webkit-inner-spin-button,
.app input[type="number"].in::-webkit-outer-spin-button{
  filter: invert(1) brightness(3) saturate(0);
  opacity: 1;
  height: 22px;
  width: 18px;
  margin-right: 4px;
  border-radius: 999px;
  background-color: rgba(255,255,255,.22);
}
.app input[type="number"].in{
  accent-color: #38BDF8;
}
.app .tbl th{
  color:#E2E8F0;
  background: rgba(2,6,23,.6);
}
.app .tbl td{
  color:#E5E7EB;
}
.tbl.grid{
  border-collapse:separate;
  border-spacing:0;
  width:100%;
}
.tbl.grid thead th{
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color:#F8FAFC;
  font-weight:700;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.tbl.grid thead th:first-child{border-top-left-radius:12px}
.tbl.grid thead th:last-child{border-top-right-radius:12px}
.tbl.grid tbody tr{
  background: rgba(2,6,23,.55);
}
.tbl.grid tbody tr:nth-child(even){
  background: rgba(2,6,23,.75);
}
.tbl.grid tbody td{
  border-bottom:1px solid rgba(148,163,184,.18);
}
.gridInput{
  width:100%;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.5);
  background: rgba(15,23,42,.9);
  color:#F8FAFC;
  font-size:13px;
  font-weight:700;
}
.gridInput:focus{
  outline:none;
  border-color:#7DD3FC;
  box-shadow: 0 0 0 3px rgba(56,189,248,.2);
}
.gridInput:disabled{
  color:#D1DDEE;
  border-color: rgba(148,163,184,.38);
  background: rgba(30,41,59,.75);
  opacity:1;
  cursor:not-allowed;
}
.gridActions{
  display:flex;
  gap:6px;
}
.iconBtn{
  width:30px;
  height:30px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(2,6,23,.6);
  color:#E5E7EB;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:14px;
}
.iconBtn svg{
  width:16px;
  height:16px;
  stroke: currentColor;
  stroke-width:2.2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.iconBtn.edit{
  border-color: rgba(34,197,94,.45);
  color:#22C55E;
}
.iconBtn.del{
  border-color: rgba(239,68,68,.45);
  color:#EF4444;
}
.iconBtn.disabled{
  opacity:.5;
  cursor:not-allowed;
  pointer-events:none;
}
.badgeTag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid rgba(148,163,184,.35);
  color:#E2E8F0;
  background: rgba(148,163,184,.12);
}
.badgeTag.warn{
  border-color: rgba(245,158,11,.45);
  color:#FCD34D;
  background: rgba(245,158,11,.12);
}
.badgeTag.partial{
  border-color: rgba(56,189,248,.45);
  color:#7DD3FC;
  background: rgba(56,189,248,.12);
}
.badgeTag.ok{
  border-color: rgba(34,197,94,.45);
  color:#86EFAC;
  background: rgba(34,197,94,.12);
}
.badgeTag.justified{
  border-color: rgba(34,197,94,.65);
  color:#DCFCE7;
  background: rgba(22,163,74,.22);
}
.badgeTag.canceled{
  border-color: rgba(248,113,113,.45);
  color:#FECACA;
  background: rgba(127,29,29,.2);
}
.app .btn{
  width:auto;
  margin-top:0;
  height:36px;
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 12px;
  background: linear-gradient(135deg, #7DD3FC, #93C5FD);
  color:#0B1222;
  border:1px solid rgba(147,197,253,.55);
  font-size:13px;
  line-height:1;
  white-space:nowrap;
  box-shadow: 0 8px 18px rgba(2,6,23,.28);
  transition: background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.app .btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2,6,23,.36);
}
.app .btn.btn-sm{
  height:32px;
  min-height:32px;
  padding:6px 10px;
  font-size:12px;
  border-radius:10px;
}
.app .btn.btn-lg{
  height:42px;
  min-height:42px;
  padding:10px 14px;
  font-size:14px;
  border-radius:12px;
}
.app .btn.soft{
  height:36px;
  min-height:36px;
  padding:8px 12px;
  background: linear-gradient(135deg, #274C77, #3A628F);
  color:#F8FAFC;
  border:1px solid rgba(147,197,253,.42);
}
.app .btn.soft:hover{
  background: linear-gradient(135deg, #315C8E, #4673A7);
  border-color: rgba(186,230,253,.58);
}
.app .btn.ok{
  background: linear-gradient(135deg, #5EEAD4, #60A5FA);
  border:1px solid rgba(125,211,252,.62);
}
.app .btn .btnIcon{
  width:20px;
  height:20px;
  object-fit:contain;
  margin-right:0;
  flex:0 0 auto;
}
.app .addRow .btn{
  flex:0 0 auto;
  min-width:120px;
}
.app .gridActions .btn{
  height:36px;
  min-height:36px;
  padding:8px 12px;
}
.actionRow{
  display:flex;
  justify-content:flex-end;
  align-items:flex-end;
  flex-wrap:wrap;
  gap:8px;
  width:auto;
  max-width:100%;
  margin-left:auto;
}
.actionRow .btn{
  width:auto !important;
  flex:0 0 auto;
  min-width:0;
  height:42px !important;
  min-height:42px !important;
  align-self:flex-end;
}
.app button.btn[id$="Clear"]{
  background: linear-gradient(135deg, rgba(127,29,29,.9), rgba(220,38,38,.78)) !important;
  border:1px solid rgba(248,113,113,.55) !important;
  color:#FEE2E2 !important;
}
.app button.btn[id$="Clear"]:hover{
  background: linear-gradient(135deg, rgba(153,27,27,.96), rgba(239,68,68,.82)) !important;
  border-color: rgba(252,165,165,.65) !important;
}
.app #repEntExport,
.app #repSalExport,
.app #repPedExport,
.app #repKarExport{
  background: linear-gradient(135deg, #A7F3D0, #86EFAC) !important;
  border:1px solid rgba(134,239,172,.65) !important;
  color:#052E16 !important;
}
.app #repExistExport{
  background: linear-gradient(135deg, #A7F3D0, #86EFAC) !important;
  border:1px solid rgba(134,239,172,.65) !important;
  color:#052E16 !important;
}
.app #repDiaHistory,
.app #repDiaClose{
  width: 132px;
  min-width: 132px;
  justify-content: center;
}
.app .repDiaActions{
  justify-content:flex-start;
  align-items:stretch;
  gap:8px;
}
.app .repDiaActions .btn{
  flex:0 1 auto;
  width:auto !important;
  min-width:110px;
  max-width:100%;
  padding:9px 12px;
  justify-content:center;
  text-align:center;
  white-space:normal;
  line-height:1.1;
}
.app #repDiaApplyCount{
  min-width:140px;
}
.app #repDiaSearch{
  min-width:96px;
}
.app #repDiaPdf{
  min-width:84px;
}
.app #repDiaHistory{
  white-space: normal;
  line-height: 1.05;
  text-align: center;
}

/* Ejemplo pedido: botones compactos a la derecha con azul visible */
.orderActions{
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.app .orderActions .btn{
  width:auto !important;
  flex:0 1 auto !important;
  max-width:100%;
  min-height:36px;
  padding:8px 12px;
  font-size:13px;
}
.app #pedAdd,
.app #pedSave{
  background: linear-gradient(135deg, #38BDF8, #60A5FA) !important;
  border:1px solid rgba(96,165,250,.6) !important;
  color:#061226 !important;
}
.app #pedPrintPos,
.app button[data-reppos]{
  background: linear-gradient(135deg, #4338CA, #6366F1) !important;
  border:1px solid rgba(165,180,252,.5) !important;
  color:#EEF2FF !important;
}
.app #repDiaPdf,
.app button[data-reppdf]{
  background: linear-gradient(135deg, #C2410C, #F97316) !important;
  border:1px solid rgba(253,186,116,.55) !important;
  color:#FFF7ED !important;
}
.app #pedClear{
  background: linear-gradient(135deg, rgba(127,29,29,.9), rgba(220,38,38,.78)) !important;
  border:1px solid rgba(248,113,113,.55) !important;
  color:#FEE2E2 !important;
}

/* Tamano automatico segun pantalla:
   - Movil: compactos
   - Desktop grande: amplios */
@media (max-width: 768px){
  .app .btn:not(.btn-lg){
    min-height:36px;
    padding:8px 12px;
    font-size:13px;
  }
  .actionRow{
    justify-content:stretch;
    width:100%;
  }
  .actionRow .btn{
    width:100% !important;
  }
}
@media (min-width: 1200px){
  .app .btn:not(.btn-sm){
    min-height:38px;
    padding:8px 13px;
    font-size:13px;
  }
}
.app .xbtn{
  background: rgba(148,163,184,.15);
  border:1px solid rgba(148,163,184,.35);
  color:#E5E7EB;
}
.searchPanel{
  background: rgba(2,6,23,.85);
  border:1px solid rgba(148,163,184,.25);
}
.suggestItem{
  color:#E5E7EB;
}
.suggestItem:hover{
  background: rgba(56,189,248,.15);
}

/* iPhone-like toast */
.toast{
  margin-top:10px;
  display:none;
  padding:10px 14px;
  border-radius:14px;
  background: rgba(15,23,42,.85);
  border:1px solid rgba(148,163,184,.35);
  color:#E2E8F0;
  font-size:13px;
  box-shadow: 0 12px 24px rgba(2,6,23,.5);
  transform: translateY(8px);
  opacity: 0;
  transition: all .25s ease;
}
.toast.show{
  display:block;
  transform: translateY(0);
  opacity: 1;
}
.toast.bad{
  border-color: rgba(239,68,68,.5);
  color:#FCA5A5;
}
.toast.ok{
  border-color: rgba(34,197,94,.5);
  color:#86EFAC;
}

.toastStack{
  position:fixed;
  right:20px;
  top:20px;
  display:flex;
  flex-direction:column;
  gap:8px;
  z-index:2147483646 !important;
}
.toastFloat{
  min-width:320px;
  max-width:420px;
  background: rgba(15,23,42,.96);
  border:2px solid rgba(148,163,184,.55);
  color:#E2E8F0;
  border-radius:16px;
  padding:14px 16px;
  box-shadow: 0 16px 40px rgba(2,6,23,.6);
  display:flex;
  gap:10px;
  align-items:flex-start;
  transform: translateY(8px);
  opacity:0;
  transition: all .25s ease;
}
.toastFloat.show{
  transform: translateY(0);
  opacity:1;
}
.toastIcon{
  width:26px;
  height:26px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:14px;
  flex:0 0 auto;
  background: rgba(56,189,248,.2);
  color:#7DD3FC;
}
.toastFloat.bad{
  border-color: rgba(239,68,68,.45);
}
.toastFloat.bad .toastIcon{
  background: rgba(239,68,68,.2);
  color:#FCA5A5;
}
.toastFloat.ok{
  border-color: rgba(34,197,94,.45);
}
.toastFloat.ok .toastIcon{
  background: rgba(34,197,94,.2);
  color:#86EFAC;
}
.toastText{font-size:14px; line-height:1.5; font-weight:700}

/* big alert bar */
.alertBar{
  position:fixed;
  left:50%;
  top:18px;
  transform: translateX(-50%) translateY(-10px);
  min-width:320px;
  max-width:720px;
  width: min(720px, 92vw);
  padding:14px 18px;
  border-radius:16px;
  font-size:15px;
  font-weight:800;
  letter-spacing:.01em;
  box-shadow: 0 20px 50px rgba(2,6,23,.55);
  z-index:2147483647 !important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  opacity:0;
  transition: all .25s ease;
}
.alertBar.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}
.alertBar.hidden{display:none}
.alertBar.ok{
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(34,197,94,.75));
  color:#052e1a;
  border:1px solid rgba(22,163,74,.65);
}
.alertBar.bad{
  background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(244,63,94,.75));
  color:#2a0b12;
  border:1px solid rgba(244,63,94,.65);
}
.alertBar.warn{
  background: linear-gradient(135deg, rgba(245,158,11,.95), rgba(251,191,36,.75));
  color:#2a1a04;
  border:1px solid rgba(245,158,11,.65);
}
.alertBar .alertText{flex:1}
.alertBar .alertClose{
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.4);
  color:#0b1222;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-weight:900;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}
.field-error{
  border-color: rgba(239,68,68,.8) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.18) !important;
  animation: shake .25s ease;
}
.field-error-persist{
  border-color: rgba(239,68,68,.92) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.22) !important;
  background: rgba(127,29,29,.10) !important;
}
.repDiaValidationNote{
  color:#fecaca;
  border:1px solid rgba(239,68,68,.42);
  background: rgba(127,29,29,.18);
  border-radius:12px;
  padding:10px 12px;
  margin-top:8px;
  line-height:1.4;
}
.repEntDashboardCell{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.suggest{
  position:relative;
}
.suggestList{
  position:absolute;
  left:0;
  right:0;
  margin-top:6px;
  background: rgba(2,6,23,.92);
  border:1px solid rgba(148,163,184,.25);
  border-radius:10px;
  box-shadow: 0 10px 24px rgba(2,6,23,.45);
  max-height:220px;
  overflow:auto;
  z-index:10;
}
.suggestItem{
  padding:8px 10px;
  cursor:pointer;
  font-size:13px;
  color:#E5E7EB;
}
.suggestItem:hover{
  background: rgba(56,189,248,.15);
}

/* modal */
.modal{
  position:fixed;
  inset:0;
  background: rgba(2,6,23,.7);
  display:grid;
  place-items:center;
  z-index:12000;
  padding:
    calc(16px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.modal.hidden{display:none}
.modalCard{
  width:min(900px, 96vw);
  max-height: calc(100dvh - 32px);
  background: rgba(15,23,42,.95);
  border:1px solid rgba(148,163,184,.35);
  border-radius:18px;
  padding:16px;
  box-shadow: 0 20px 50px rgba(2,6,23,.6);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.modalHeader{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.modalTitle{font-weight:900; font-size:20px; color:#F8FAFC}
.modalSub{color:#D0DDF0; font-size:13px; font-weight:600; margin-top:4px}
.modal .confirmBtn{
  min-width:128px;
  height:40px;
  border-radius:10px;
  font-weight:700;
}
.modal .confirmBtn.cancel{
  border:1px solid rgba(239,68,68,.55);
  color:#FECACA;
  background: linear-gradient(135deg, rgba(220,38,38,.22), rgba(185,28,28,.18));
}
.modal .confirmBtn.accept{
  border:1px solid rgba(34,197,94,.55);
  color:#DCFCE7;
  background: linear-gradient(135deg, rgba(22,163,74,.28), rgba(21,128,61,.22));
}
.modal .confirmBtn:hover{
  transform: translateY(-1px);
}

#pedDispatchModal .modalCard{
  max-height: 90vh;
  display:flex;
  flex-direction:column;
}
#pedDispatchModal .tableWrap{
  flex:1 1 auto;
  min-height:0;
  max-height: calc(90vh - 190px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#pedDispatchModal .tableWrap::-webkit-scrollbar{
  width: 0;
  height: 0;
}
#pedDispatchModal .tableWrap .tbl thead th{
  position: sticky;
  top: 0;
  z-index: 4;
}
#pedDispatchModal .tbl td:nth-child(6),
#pedDispatchModal .tbl td:nth-child(7){
  white-space: nowrap;
}

#repDiaHistoryModal .modalCard{
  width:min(1100px, 98vw);
  max-height: calc(100dvh - 32px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
#repDiaHistoryModal .tableWrap{
  overflow:auto !important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action: pan-y pan-x;
}
#repDiaHistoryModal .tableWrap .tbl thead th{
  position: sticky;
  top: 0;
  z-index: 3;
}
#repDiaHistoryModal #repCloseSearchBtn,
#repDiaHistoryModal #repCloseAllBtn,
#repDiaHistoryModal #repCloseExport{
  height:auto !important;
  min-height:48px !important;
  padding:10px 12px !important;
  white-space:normal !important;
  line-height:1.15;
  text-align:center;
}
#repDiaHistoryModal #repCloseExport{
  min-width:132px;
}

.itemSearchCard{
  width:min(640px, 96vw);
  border-radius:20px;
  padding:18px;
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.12), transparent 44%),
    radial-gradient(circle at top left, rgba(34,197,94,.10), transparent 38%),
    rgba(15,23,42,.96);
}
.itemSearchHeader{
  margin-bottom:10px;
}
.itemSearchBar{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
}
.itemSearchInput{
  min-height:44px;
  border-radius:12px;
  border:1px solid rgba(56,189,248,.45);
  background: rgba(2,6,23,.72);
}
.itemSearchInput:focus{
  border-color: rgba(56,189,248,.85);
  box-shadow: 0 0 0 4px rgba(56,189,248,.16);
}
.itemSearchRun{
  min-width:120px;
  min-height:44px;
  border-radius:12px;
}
.itemSearchHint{
  margin-top:8px;
  font-size:12px;
  color:#94A3B8;
}
.itemSearchList{
  margin-top:10px;
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  background: rgba(2,6,23,.72);
  max-height:320px;
  overflow:auto;
}
.itemSearchList.hidden{
  display:none;
}
.itemSearchRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid rgba(148,163,184,.12);
  cursor:pointer;
}
.itemSearchRow:last-child{
  border-bottom:none;
}
.itemSearchRow:hover{
  background: rgba(56,189,248,.12);
}
.itemSearchName{
  font-size:14px;
  font-weight:700;
  color:#E2E8F0;
}
.itemSearchMeta{
  margin-top:3px;
  font-size:12px;
  color:#93C5FD;
}
.itemSearchPick{
  flex:0 0 auto;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  color:#0F172A;
  background:#7DD3FC;
  border-radius:999px;
  padding:3px 8px;
}
.itemSearchEmpty{
  padding:16px 12px;
  text-align:center;
  color:#94A3B8;
  font-size:13px;
}
.itemSearchActions{
  margin-top:12px;
  justify-content:flex-end;
  gap:8px;
}
@media (max-width: 640px){
  .itemSearchBar{
    grid-template-columns:1fr;
  }
  .itemSearchRun{
    width:100%;
  }
}
.supervisorAuthFields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:8px;
}

.searchPanel{
  margin-top:8px;
  background: rgba(2,6,23,.85);
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  padding:10px;
}
.searchPanel.hidden{display:none}
#entSearchList{
  position:static;
  margin-top:8px;
  max-height:220px;
  overflow:auto;
}

/* =========================
   PEDIDOS
========================= */
.orderWrap{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.orderHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.orderSub{
  color:#E2E8F0;
  font-size:14px;
  font-weight:600;
  margin-top:6px;
}
.orderMeta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.pill{
  border:1px solid rgba(56,189,248,.35);
  color:#E0F2FE;
  background: rgba(56,189,248,.12);
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.pill.ghost{
  border-color: rgba(148,163,184,.35);
  color:#E2E8F0;
  background: rgba(148,163,184,.10);
}
.orderGrid{
  display:grid;
  grid-template-columns: 1.1fr 1fr;
  gap:14px;
}
.orderPanel{
  background: rgba(2,6,23,.45);
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  padding:14px;
  min-width:0;
  max-width:100%;
}
#view-pedidos .orderWorkspace{
  display:grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.15fr);
  gap:14px;
  align-items:start;
}
#view-pedidos .orderComposer{
  min-width:0;
}
#view-pedidos .orderSide{
  min-width:0;
  display:grid;
  grid-template-rows:auto minmax(0, 1fr);
  gap:14px;
  position:sticky;
  top:84px;
  max-height: calc(100dvh - 112px);
  overflow:hidden;
}
#view-pedidos .orderCart{
  background: rgba(2,6,23,.45);
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  padding:14px;
  height:100%;
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap:10px;
  min-height:0;
}
#view-pedidos .orderCart .panelTitle{
  margin-bottom:0;
}
#view-pedidos .orderCart .cartList{
  overflow:auto;
  padding-right:4px;
  min-height:180px;
  max-height: calc(100dvh - 420px);
  scrollbar-width:none;
  -ms-overflow-style:none;
}
#view-pedidos .orderCart .cartList::-webkit-scrollbar{
  width:0;
  height:0;
}
#view-pedidos .orderCart .orderActions{
  margin-top:0 !important;
  padding-top:8px;
  border-top:1px solid rgba(148,163,184,.22);
  background: linear-gradient(180deg, rgba(2,6,23,.18), rgba(2,6,23,0));
  position:sticky;
  bottom:0;
  z-index:2;
}
#view-pedidos .orderSubmitProgress{
  margin-top:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(56,189,248,.32);
  background:
    linear-gradient(135deg, rgba(14,165,233,.16), rgba(37,99,235,.12)),
    rgba(15,23,42,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#view-pedidos .orderSubmitProgressHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
#view-pedidos .orderSubmitProgressTitle{
  font-weight:800;
  color:#F8FAFC;
}
#view-pedidos .orderSubmitProgressPct{
  font-size:12px;
  font-weight:800;
  color:#7DD3FC;
}
#view-pedidos .orderSubmitProgressBar{
  width:100%;
  height:10px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(15,23,42,.7);
  border:1px solid rgba(125,211,252,.18);
  position:relative;
}
#view-pedidos .orderSubmitProgressFill{
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, #22d3ee 0%, #38bdf8 45%, #60a5fa 100%);
  box-shadow:0 0 14px rgba(56,189,248,.35);
  transition:width .28s ease;
}
#view-pedidos .orderSubmitProgressNote{
  margin-top:8px;
  font-size:12px;
  color:#CBD5E1;
}
#view-pedidos .orderCart.isSaving{
  border-color:rgba(56,189,248,.4);
  box-shadow:0 22px 44px rgba(2,6,23,.34);
}
#view-pedidos .orderCart.isSaving .cartList,
#view-pedidos .orderCart.isSaving textarea,
#view-pedidos .orderCart.isSaving input,
#view-pedidos .orderCart.isSaving button{
  pointer-events:none;
}
#view-pedidos .orderCart.isSaving #pedSave{
  pointer-events:none;
}
#view-pedidos .orderCart.isSaving #pedSave[disabled]{
  opacity:1;
}
#view-pedidos .orderCart.isSaving #pedSave::after{
  content:"";
  display:inline-block;
  width:14px;
  height:14px;
  margin-left:8px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.28);
  border-top-color:#fff;
  animation:pedSaveSpin .8s linear infinite;
  vertical-align:-2px;
}
@keyframes pedSaveSpin{
  to{ transform:rotate(360deg); }
}
.app #pedUser{
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(2,6,23,.72));
  border:1px solid rgba(56,189,248,.42);
  color:#E5E7EB;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: ellipsis;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(15,23,42,.55);
}
.app #pedUser::-webkit-scrollbar{
  height: 8px;
  width: 8px;
}
.app #pedUser::-webkit-scrollbar-track{
  background: rgba(15,23,42,.55);
  border-radius: 999px;
}
.app #pedUser::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg, rgba(56,189,248,.78), rgba(14,165,233,.68));
  border-radius: 999px;
}
.app #pedUser::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(90deg, rgba(125,211,252,.9), rgba(56,189,248,.85));
}
.app #pedUser option{
  color:#E5E7EB;
  background:#0B1222;
}
.repCollapseSection{
  border:1px solid rgba(125,211,252,.28);
  border-radius:16px;
  background:
    linear-gradient(135deg, rgba(14,116,144,.14), rgba(30,64,175,.10)),
    rgba(2,6,23,.35);
  box-shadow: 0 14px 28px rgba(2,6,23,.28);
  padding:10px 12px 12px 12px;
}
.repCollapseToggle{
  width:100%;
  border:none;
  background:transparent;
  color:inherit;
  cursor:pointer;
  padding:2px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;
}
.repCollapseMeta{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.repCollapseIcon{
  width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid rgba(125,211,252,.35);
  background: rgba(56,189,248,.16);
  color:#E0F2FE;
  display:grid;
  place-items:center;
  font-weight:900;
  line-height:1;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.repCollapseBody{
  display:grid;
  grid-template-rows:1fr;
  opacity:1;
  transition: grid-template-rows .28s ease, opacity .22s ease;
}
.repCollapseBodyInner{
  min-height:0;
  overflow:hidden;
}
.repCollapseSection.is-collapsed .repCollapseBody{
  grid-template-rows:0fr;
  opacity:.4;
}
.repCollapseSection.is-collapsed .repCollapseIcon{
  transform: rotate(-90deg);
  background: rgba(148,163,184,.16);
  border-color: rgba(148,163,184,.35);
}
.repCollapseSection.is-collapsed{
  box-shadow: 0 8px 18px rgba(2,6,23,.2);
}
.panelTitle{
  font-weight:800;
  font-size:16px;
  margin-bottom:8px;
  color:#F8FAFC;
}
.hintHover{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.hintChip{
  font-size:12px;
  font-weight:700;
  color:#E0F2FE;
  border:1px solid rgba(56,189,248,.4);
  background: rgba(56,189,248,.16);
  border-radius:999px;
  padding:6px 10px;
  cursor:default;
  user-select:none;
}
.hintPanel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:min(520px, 82vw);
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.3);
  background: rgba(2,6,23,.96);
  color:#E2E8F0;
  font-size:12px;
  line-height:1.45;
  display:flex;
  flex-direction:column;
  gap:6px;
  opacity:0;
  pointer-events:none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
  z-index:20;
  box-shadow: 0 16px 34px rgba(2,6,23,.55);
}
.hintHover:hover .hintPanel{
  opacity:1;
  pointer-events:auto;
  transform: translateY(0);
}
.permBoard{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap:10px;
}
.permItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid rgba(148,163,184,.3);
  background: rgba(2,6,23,.55);
  border-radius:12px;
  padding:10px 12px;
}
.permLabel{
  color:#E2E8F0;
  font-size:12px;
  font-weight:600;
}
.permSwitch{
  position:relative;
  width:44px;
  height:24px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.45);
  background: rgba(148,163,184,.22);
  cursor:pointer;
  appearance:none;
  outline:none;
  transition: background .18s ease, border-color .18s ease;
}
.permSwitch::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#E2E8F0;
  transition: transform .18s ease;
}
.permSwitch:checked{
  background: rgba(34,197,94,.32);
  border-color: rgba(34,197,94,.6);
}
.warehouseCheck{
  width:18px;
  height:18px;
  accent-color:#64748B;
  flex:0 0 auto;
}
.permSwitch:checked::after{
  transform: translateX(20px);
}
@media (max-width: 980px){
  .permBoard{grid-template-columns:1fr}
  .repCollapseMeta{
    width:100%;
    justify-content:flex-end;
  }
}
.homeDashGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap:10px;
}
.homeDashCard{
  border:1px solid rgba(148,163,184,.32);
  background: linear-gradient(145deg, rgba(15,23,42,.85), rgba(2,6,23,.82));
  border-radius:14px;
  padding:12px;
  color:#E5E7EB;
  text-align:left;
  cursor:pointer;
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.homeDashCard:hover{
  transform: translateY(-2px);
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 10px 18px rgba(2,6,23,.35);
}
.homeDashCard.active{
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 2px rgba(34,197,94,.2), 0 10px 18px rgba(2,6,23,.35);
}
.homeDashCard .k{
  font-size:12px;
  color:#CBD5E1;
  font-weight:700;
}
.homeDashCard .v{
  margin-top:6px;
  font-size:26px;
  font-weight:900;
  line-height:1.1;
}
.homeDashCard .v.sm{
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.homeDashCard .s{
  margin-top:5px;
  font-size:12px;
  color:#94A3B8;
}
.homeDashCard.bad .v{ color:#FCA5A5; }
.homeDashCard.warn .v{ color:#FDE68A; }
.homeDashCard.info .v{ color:#7DD3FC; }
.homeDashCard.money .v{ color:#86EFAC; }
.homeDashCard.up .v{ color:#86EFAC; }
.homeDashCard.down .v{ color:#FDE68A; }
.homeDashCard.stock .v{ color:#FDBA74; }
@media (max-width: 1200px){
  .homeDashGrid{grid-template-columns: repeat(3, minmax(170px, 1fr));}
}
@media (max-width: 980px){
  .homeDashGrid{grid-template-columns: repeat(2, minmax(150px, 1fr));}
}
@media (max-width: 620px){
  .homeDashGrid{grid-template-columns: 1fr;}
}
.searchBlock{
  background: rgba(15,23,42,.5);
  border-radius:14px;
  padding:10px;
  border:1px solid rgba(148,163,184,.18);
}
.cartList{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cartItem{
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap:16px;
  align-items:stretch;
  background: linear-gradient(135deg, rgba(2,6,23,.75), rgba(15,23,42,.55));
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  padding:14px;
  position:relative;
  overflow:visible;
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
}
.cartItem::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(220px 120px at 85% 15%, rgba(56,189,248,.15), transparent 60%);
  pointer-events:none;
}
.cartItem:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(2,6,23,.45);
  border-color: rgba(56,189,248,.4);
}
.cartLeft, .cartRight{position:relative; z-index:1}
.cartName{
  font-weight:800;
  font-size:15px;
  letter-spacing:.01em;
}
.cartMeta{
  color:#94A3B8;
  font-size:12px;
  margin-top:4px;
}
.cartMeta strong{
  color:#E2E8F0;
  font-weight:800;
}
.cartRight{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.qtyRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.qtyRow .iconBtnSm{
  flex:0 0 auto;
}
.qtyWrap{
  display:flex;
  align-items:center;
  gap:8px;
  background: rgba(2,6,23,.6);
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  padding:6px;
}
.qtyInput{
  width:110px;
  text-align:center;
  border-radius:10px;
  font-size:14px;
  font-weight:800;
  color:#F8FAFC;
  border:1px solid rgba(148,163,184,.5);
  background: rgba(15,23,42,.9);
}
.qtyInput:focus{
  outline:none;
  border-color:#7DD3FC;
  box-shadow: 0 0 0 3px rgba(56,189,248,.2);
}
.stockPill{
  font-size:12px;
  color:#E2E8F0;
  background: rgba(148,163,184,.12);
  border:1px solid rgba(148,163,184,.3);
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.iconBtnSm{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.6);
  color:#E2E8F0;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.iconBtnSm svg{
  width:16px;
  height:16px;
  stroke: currentColor;
  stroke-width:2.2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.iconBtnSm:hover{
  transform: translateY(-1px);
  border-color: rgba(56,189,248,.55);
  box-shadow: 0 6px 14px rgba(2,6,23,.35);
}
.iconBtnSm.ghost{
  border-color: rgba(239,68,68,.45);
  color:#FCA5A5;
  background: rgba(127,29,29,.35);
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.25);
}
.lineNote{
  width:100%;
  background: rgba(2,6,23,.5);
  border:1px solid rgba(148,163,184,.3);
  border-radius:10px;
  color:#E5E7EB;
  padding:8px 10px;
  font-size:12px;
  margin-top:8px;
}
.orderCart .panelTitle{
  margin-bottom:10px;
}

.dispatchActions{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:6px;
  width:100%;
  max-width:130px;
  margin:0 auto;
}
.dispatchBtn{
  border:1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.72);
  color:#E2E8F0;
  border-radius:10px;
  padding:8px 10px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  min-height:34px;
  white-space:nowrap;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.dispatchBtn svg{
  width:14px;
  height:14px;
  stroke: currentColor;
  stroke-width:2.1;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.dispatchBtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(2,6,23,.35);
}
.dispatchBtn-ok{
  border-color: rgba(34,197,94,.45);
  color:#86EFAC;
  background: rgba(34,197,94,.14);
}
.dispatchBtn-neutral{
  border-color: rgba(56,189,248,.45);
  color:#7DD3FC;
  background: rgba(56,189,248,.12);
}
.dispatchBtn-pdf{
  border-color: rgba(251,191,36,.45);
  color:#FDE68A;
  background: rgba(251,191,36,.12);
}
.dispatchBtn-pos{
  border-color: rgba(20,184,166,.45);
  color:#5EEAD4;
  background: rgba(20,184,166,.12);
}
.dispatchBtn-danger{
  border-color: rgba(239,68,68,.45);
  color:#FCA5A5;
  background: rgba(239,68,68,.12);
}
.dispatchBtn.disabled{
  opacity:.5;
  cursor:not-allowed;
  pointer-events:none;
}
.dispatchLineActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap: nowrap;
}
.dispatchActionIcon{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.72);
  color:#E2E8F0;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.dispatchActionIcon svg{
  width:16px;
  height:16px;
  stroke: currentColor;
  stroke-width:2.2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.dispatchActionIcon:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(2,6,23,.35);
}
.dispatchActionIcon-ok{
  border-color: rgba(34,197,94,.45);
  color:#86EFAC;
  background: rgba(34,197,94,.14);
}
.dispatchActionIcon-danger{
  border-color: rgba(239,68,68,.45);
  color:#FCA5A5;
  background: rgba(239,68,68,.12);
}
.dispatchActionIcon-cancel{
  border-color: rgba(245,158,11,.55);
  color:#FDE68A;
  background: rgba(245,158,11,.14);
}
.dispatchLineCanceled td{
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity:.78;
}
.kType{
  font-weight:800;
  letter-spacing:.01em;
}
.kType.in{
  color:#86EFAC;
}
.kType.out{
  color:#FCA5A5;
}
.karResume{
  font-weight:700;
}
.karResume.in{
  color:#86EFAC;
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.12);
}
.karResume.out{
  color:#FCA5A5;
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
}
.karResume.adjust{
  color:#FDE68A;
  border-color: rgba(245,158,11,.45);
  background: rgba(245,158,11,.14);
}
.karResume.transfer{
  color:#FCA5A5;
  border-color: rgba(248,113,113,.45);
  background: rgba(248,113,113,.14);
}
.karResume.stock{
  color:#7DD3FC;
  border-color: rgba(56,189,248,.45);
  background: rgba(56,189,248,.14);
}

.statusLight{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(148,163,184,.12);
  color:#E2E8F0;
}
.statusLight .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
}
.statusLight.red{
  color:#FCA5A5;
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
}
.statusLight.amber{
  color:#FDE68A;
  border-color: rgba(245,158,11,.45);
  background: rgba(245,158,11,.14);
}
.statusLight.green{
  color:#86EFAC;
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.12);
}
.statusLight.blue{
  color:#93C5FD;
  border-color: rgba(59,130,246,.45);
  background: rgba(59,130,246,.14);
}
.statusLight.neutral{
  color:#CBD5E1;
  border-color: rgba(148,163,184,.35);
  background: rgba(148,163,184,.10);
}
.statusGroup{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.repTableScroll{
  max-height: 420px;
  overflow:auto;
  max-width:100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(15,23,42,.55);
  -ms-overflow-style: auto;
}
.repTableScroll::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
.repTableScroll::-webkit-scrollbar-track{
  background: rgba(15,23,42,.55);
  border-radius: 999px;
}
.repTableScroll::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(56,189,248,.75), rgba(14,165,233,.65));
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,.6);
}
.repTableScroll::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(125,211,252,.9), rgba(56,189,248,.85));
}
.repTableScroll .tbl thead th{
  position: sticky;
  top: 0;
  z-index: 4;
}
.repTableScroll .tbl thead tr.tblFilterRow th{
  top: 42px;
  z-index: 5;
}

/* reveal animations */
.reveal{
  opacity:1;
  transform: translateY(0);
}
.animate .reveal{
  animation: revealUp .35s ease both;
}
.delay-1{animation-delay:.06s}
.delay-2{animation-delay:.12s}
.delay-3{animation-delay:.18s}

@keyframes revealUp{
  from{opacity:0; transform: translateY(12px);}
  to{opacity:1; transform: translateY(0);}
}

@media (max-width: 980px){
  .orderGrid{grid-template-columns:1fr}
  .cartItem{grid-template-columns:1fr}
  .cartRight{align-items:flex-start}
  .qtyInput{width:100%}
  .stageTop{flex-direction:column; align-items:flex-start}
  .stageHeadLogo{max-height:44px}
  #view-pedidos .orderWorkspace{
    grid-template-columns:1fr;
  }
  #view-pedidos .orderSide{
    position:static;
    max-height:none;
  }
  #view-pedidos .orderCart{
    position:static;
    max-height:none;
    display:block;
  }
  #view-pedidos .orderCart .cartList{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }
}

@media (max-width: 980px) and (pointer: fine){
  #view-pedidos .orderWorkspace{
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.1fr);
  }
  #view-pedidos .orderSide{
    position:sticky;
    top:84px;
    max-height: calc(100dvh - 112px);
  }
  #view-pedidos .orderCart{
    position:static;
    max-height:none;
    display:grid;
  }
  #view-pedidos .orderCart .cartList{
    max-height: calc(100dvh - 420px);
    overflow:auto;
    padding-right:4px;
  }
}

@media (max-height: 820px){
  #view-pedidos .orderSide{
    position:static;
    top:auto;
    max-height:none;
    overflow:visible;
  }
  #view-pedidos .orderCart{
    display:flex;
    flex-direction:column;
    min-height:0;
  }
  #view-pedidos .orderCart .cartList{
    max-height: min(42dvh, 320px);
    overflow:auto;
    padding-right:4px;
  }
  #view-pedidos .orderCart .orderActions{
    position:static;
    bottom:auto;
    margin-top:8px !important;
    background:transparent;
  }
}

@media (max-width: 1280px), (max-height: 760px){
  .stage{
    padding:16px;
  }
  .card.light{
    padding:14px;
  }
  .row,
  .actionRow,
  .orderActions{
    flex-wrap:wrap;
  }
  .app .orderActions .btn{
    flex:1 1 180px !important;
  }
  .app .actionRow .btn{
    flex:1 1 180px;
  }
  .grid3,
  .grid4{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (max-width: 980px){
  .appShell{grid-template-columns: 64px 1fr}
  .menu{width:230px}
  .stage{padding:16px}
}

@media (max-width: 980px){
  .app.mobile-nav .appShell{
    grid-template-columns:1fr;
  }
  .app.mobile-nav .rail{
    position:fixed;
    left:10px;
    top:calc(10px + env(safe-area-inset-top));
    width:46px;
    height:46px;
    border-radius:12px;
    padding:6px;
    gap:0;
    justify-content:center;
    background: rgba(15,23,42,.92);
    border:1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 20px rgba(2,6,23,.45);
    z-index:11010;
  }
  .app.mobile-nav .railLogo,
  .app.mobile-nav .railHint{
    display:none;
  }
  .app.mobile-nav .menu{
    left:0;
    top:0;
    bottom:0;
    height:100dvh;
    padding-top:calc(64px + env(safe-area-inset-top));
    padding-bottom:calc(16px + env(safe-area-inset-bottom));
    z-index:11000;
  }
  .app.mobile-nav .menu{
    width:min(78vw, 300px);
    transform: translateX(-108%);
    opacity:0;
    pointer-events:none;
  }
  .app.mobile-nav.menu-open .menu{
    transform: translateX(0);
    opacity:1;
    pointer-events:auto;
  }
  .app.mobile-nav .rail::after{
    content:"\2261";
    font-size:16px;
  }
  .app.mobile-nav.menu-open .rail::after{
    content:"\00D7";
    font-size:18px;
  }
  .app.mobile-nav .stage{
    grid-column:auto;
    padding:72px 12px 20px;
  }
  .app.mobile-nav .card.light{
    padding:14px;
  }
}

@media (max-width: 640px){
  .app.mobile-nav .stageTop{
    padding:14px;
  }
  .app.mobile-nav .stageTitle{
    font-size:20px;
  }
  .app.mobile-nav .row{
    flex-wrap:wrap;
    min-width:0;
  }
  .app.mobile-nav .addRow{
    flex-direction:column;
    align-items:stretch;
  }
  .app.mobile-nav .tableWrap{
    border-radius:10px;
    max-width:100%;
  }
  .app.mobile-nav .tbl{
    min-width:560px;
  }
  .app.mobile-nav .menuBtn{
    font-size:15px;
    padding:12px;
  }
}

.appFooter{
  margin-top:18px;
  text-align:center;
  color:#94A3B8;
  font-size:10px;
  letter-spacing:.01em;
}

/* =========================
   FLATPICKR THEME (APP)
========================= */

.flatpickr-calendar{
  background: linear-gradient(180deg, #0B1222, #0F172A) !important;
  border:1px solid rgba(56,189,248,.35) !important;
  box-shadow: 0 18px 38px rgba(2,6,23,.55) !important;
  border-radius:14px !important;
  color:#E5E7EB !important;
  z-index:13050 !important;
}
.flatpickr-calendar.open,
.flatpickr-calendar.static.open{
  z-index:13050 !important;
}
.flatpickr-calendar:before,
.flatpickr-calendar:after{
  border-bottom-color:#0F172A !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year{
  color:#E5E7EB !important;
  fill:#E5E7EB !important;
}
.flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year{
  background: transparent !important;
  border:0 !important;
}
.flatpickr-weekdays{
  background: rgba(56,189,248,.10) !important;
}
span.flatpickr-weekday{
  color:#93C5FD !important;
  font-weight:700 !important;
}
.flatpickr-day{
  color:#E5E7EB !important;
  border-color: transparent !important;
}
.flatpickr-day:hover,
.flatpickr-day:focus{
  background: rgba(56,189,248,.18) !important;
  border-color: rgba(56,189,248,.45) !important;
}
.flatpickr-day.today{
  border-color: rgba(34,211,238,.75) !important;
  color:#67E8F9 !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange{
  background: linear-gradient(135deg, #0EA5E9, #22D3EE) !important;
  color:#0B1222 !important;
  border-color: transparent !important;
}
.flatpickr-day.inRange{
  background: rgba(34,211,238,.14) !important;
  border-color: rgba(34,211,238,.28) !important;
  box-shadow:none !important;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay{
  color:#64748B !important;
}
.flatpickr-day.flatpickr-disabled{
  color:#475569 !important;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg{
  fill:#22D3EE !important;
}

.pinModern{
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .32em;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(180deg, rgba(2,6,23,.88), rgba(2,6,23,.58));
  border: 1px solid rgba(56,189,248,.42);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.35);
}
.pinModern::placeholder{
  letter-spacing: .08em;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
}









/* Pedidos x Despachar: vista mas alta */
#view-pedidos-despachar .card{
  min-height: calc(100dvh - 190px);
  display:flex;
  flex-direction:column;
}
#view-pedidos-despachar .repTableScroll{
  flex: 1 1 auto;
  min-height: 62vh;
  max-height: calc(100dvh - 280px);
}
@media (max-width: 980px){
  #view-pedidos-despachar .card{
    min-height: calc(100dvh - 150px);
  }
  #view-pedidos-despachar .repTableScroll{
    min-height: 58vh;
    max-height: calc(100dvh - 220px);
  }
}



/* Add Views layout recovery */
.addViewCard .addAutoToolbar{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
  align-items:end;
  margin-bottom:10px;
}
.addViewCard .addAutoToolbar > button,
.addViewCard .addAutoToolbar > .btn{
  justify-self:start;
}
.addViewCard .addAutoToolbar > .addRow,
.addViewCard .addAutoToolbar > .row,
.addViewCard .addAutoToolbar > .grid3,
.addViewCard .addAutoToolbar > .grid4{
  grid-column:1/-1;
}
#view-productos .addAutoToolbar > div[id$="FileName"],
#view-categorias .addAutoToolbar > div[id$="FileName"],
#view-subcategorias .addAutoToolbar > div[id$="FileName"],
#view-proveedores .addAutoToolbar > div[id$="FileName"],
#view-limites .addAutoToolbar > div[id$="FileName"]{
  min-height:34px;
  display:flex;
  align-items:center;
  color:#A9B3D0;
  font-size:12px;
}
/* Edit fields are grouped inside collapsible Edit sections; do not force-hide them. */

/* En usuarios y bodegas solo ocultar IDs/metadata, no todo el formulario de edicion */
#view-usuarios #usrEditId,
#view-usuarios #usrEditAvatarData,
#view-bodegas #bodEditId,
#view-bodegas #bodLogoAppData,
#view-bodegas #bodLogoPrintData{
  display:none !important;
}


/* Home cards guard: never inherit regular action button look */
.homeDashCard,
.homeDashCard.btn,
button.homeDashCard{
  display:block !important;
  width:100% !important;
  min-height:92px;
  height:auto !important;
  padding:12px !important;
  white-space:normal !important;
  line-height:1.2 !important;
}
.homeDashCard .k,
.homeDashCard .v,
.homeDashCard .s{
  display:block;
}

/* Add views readability */
.addAutoToolbar .in,
.addAutoToolbar select.in,
.addAutoToolbar input.in{
  width:100%;
}
.addAutoToolbar input[type="file"]{
  color:#CBD5E1;
  font-size:12px;
}


/* Productos: checklist y scroll visual */
#view-productos .warehouseCheckList{
  max-height: 116px;
  overflow:auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(15,23,42,.55);
}
#view-productos .warehouseCheckList::-webkit-scrollbar{ width:10px; height:10px; }
#view-productos .warehouseCheckList::-webkit-scrollbar-track{ background: rgba(15,23,42,.55); border-radius:999px; }
#view-productos .warehouseCheckList::-webkit-scrollbar-thumb{ background: linear-gradient(180deg, rgba(56,189,248,.75), rgba(14,165,233,.65)); border-radius:999px; border:2px solid rgba(15,23,42,.6); }
#view-productos .warehouseCheckList::-webkit-scrollbar-thumb:hover{ background: linear-gradient(180deg, rgba(125,211,252,.9), rgba(56,189,248,.85)); }
#view-productos .importGrid .note{ margin-top:6px; font-size:12px; color:#94A3B8; min-height:18px; }
#view-productos .prdWarehouseMount{
  display:block;
  width:100%;
  margin-top:8px;
}
#view-productos .prdWarehouseField{
  grid-column:1 / -1;
}
#view-productos .prdWhPicker{
  border:1px solid rgba(96,165,250,.24);
  border-radius:14px;
  background: linear-gradient(180deg, rgba(2,6,23,.42), rgba(2,6,23,.2));
  padding:10px;
  overflow:hidden;
}
#view-productos .prdWhEditor{
  border:1px solid rgba(96,165,250,.24);
  border-radius:14px;
  background: linear-gradient(180deg, rgba(2,6,23,.42), rgba(2,6,23,.2));
  padding:10px;
}
#view-productos .prdWhEditorHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
#view-productos .prdWhEditorTitle{
  font-size:13px;
  font-weight:800;
  color:#E2E8F0;
}
#view-productos .prdWhEditorMeta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
#view-productos .prdWhEditorTools{
  display:grid;
  grid-template-columns:minmax(200px,1.6fr) repeat(3, minmax(140px,auto)) minmax(180px,auto);
  gap:8px;
  align-items:center;
}
#view-productos .prdWhPicker .prdWhEditorTools{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
#view-productos .prdWhPicker .prdWhEditorTools [data-prd-wh-search]{
  flex:1 1 260px;
  min-width:220px;
}
#view-productos .prdWhPicker .prdWhEditorTools .btn{
  flex:1 1 150px;
  min-width:150px;
  margin-top:0;
}
#view-productos .prdWhPicker .prdWhEditorTools [data-prd-wh-counter]{
  flex:1 1 100%;
  text-align:left;
}
#view-productos .prdWhEditorTools .note{
  text-align:right;
  margin:0;
  color:#A5B4FC;
  font-weight:700;
}
#view-productos .prdWhEditorList{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  max-height:360px;
  overflow-x:hidden;
}
#view-productos .prdWhEditorList .warehouseCheckItem{
  border-radius:12px;
  padding:10px 12px;
  justify-content:space-between;
  min-height:42px;
  font-size:13px;
  font-weight:700;
  border:1px solid rgba(96,165,250,.24);
  background: rgba(15,23,42,.45);
}
#view-productos .prdWhSwitchRow{
  display:flex;
  align-items:center;
  gap:12px;
}
#view-productos .prdWhName{
  min-width:0;
  flex:1 1 auto;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#view-productos .prdWhSwitch{
  position:relative;
  width:46px;
  height:26px;
  flex:0 0 46px;
}
#view-productos .prdWhSwitchInput{
  position:absolute;
  opacity:0;
  inset:0;
  margin:0;
  cursor:pointer;
}
#view-productos .prdWhSwitchSlider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background: rgba(71,85,105,.78);
  border:1px solid rgba(148,163,184,.45);
  transition: background .16s ease, border-color .16s ease;
}
#view-productos .prdWhSwitchSlider::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#E2E8F0;
  box-shadow:0 2px 5px rgba(2,6,23,.48);
  transition: transform .16s ease;
}
#view-productos .prdWhSwitchInput:checked + .prdWhSwitchSlider{
  background: linear-gradient(135deg, #0EA5E9, #22D3EE);
  border-color: rgba(56,189,248,.92);
}
#view-productos .prdWhSwitchInput:checked + .prdWhSwitchSlider::after{
  transform: translateX(20px);
}
#view-productos .prdWhSwitchInput:focus-visible + .prdWhSwitchSlider{
  outline:2px solid rgba(56,189,248,.88);
  outline-offset:2px;
}
@media (max-width: 1200px){
  #view-productos .prdWhEditorTools{
    grid-template-columns:1fr 1fr;
  }
  #view-productos .prdWhEditorTools .note{
    text-align:left;
  }
}
@media (max-width: 760px){
  #view-productos .prdWhEditorTools{
    grid-template-columns:1fr;
  }
  #view-productos .prdWhEditorList{
    grid-template-columns:1fr;
    max-height:260px;
  }
}


/* Admin native-control recovery */
.app select.in,
.app select,
.app option{
  color:#E5E7EB;
  background-color:#0B1222;
}
.app select.in option,
.app select option{
  color:#E5E7EB;
  background-color:#0B1222;
}
.app input[type="file"]{
  color:#CBD5E1;
  background: transparent;
}
.app input[type="file"]::file-selector-button{
  border:1px solid rgba(147,197,253,.45);
  background: linear-gradient(135deg, #274C77, #3A628F);
  color:#F8FAFC;
  border-radius:10px;
  padding:6px 10px;
  margin-right:8px;
  cursor:pointer;
}
.app input[type="file"]::-webkit-file-upload-button{
  border:1px solid rgba(147,197,253,.45);
  background: linear-gradient(135deg, #274C77, #3A628F);
  color:#F8FAFC;
  border-radius:10px;
  padding:6px 10px;
  margin-right:8px;
  cursor:pointer;
}

.adminSectionBody{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}
.adminSectionBody > .tableWrap,
.adminSectionBody > table,
.adminSectionBody > .repTableScroll{
  grid-column:1 / -1;
}

/* Styled scrollbars for admin panels */
#view-categorias .repTableScroll,
#view-subcategorias .repTableScroll,
#view-motivos-movimiento .repTableScroll,
#view-proveedores .repTableScroll,
#view-productos .repTableScroll,
#view-limites .repTableScroll,
#view-reglas-subcategorias .repTableScroll,
#view-usuarios .repTableScroll,
#view-bodegas .repTableScroll{
  max-height: 420px;
  overflow:auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(15,23,42,.55);
}
#view-categorias .repTableScroll::-webkit-scrollbar,
#view-subcategorias .repTableScroll::-webkit-scrollbar,
#view-motivos-movimiento .repTableScroll::-webkit-scrollbar,
#view-proveedores .repTableScroll::-webkit-scrollbar,
#view-productos .repTableScroll::-webkit-scrollbar,
#view-limites .repTableScroll::-webkit-scrollbar,
#view-reglas-subcategorias .repTableScroll::-webkit-scrollbar,
#view-usuarios .repTableScroll::-webkit-scrollbar,
#view-bodegas .repTableScroll::-webkit-scrollbar{ width:10px; height:10px; }
#view-categorias .repTableScroll::-webkit-scrollbar-track,
#view-subcategorias .repTableScroll::-webkit-scrollbar-track,
#view-motivos-movimiento .repTableScroll::-webkit-scrollbar-track,
#view-proveedores .repTableScroll::-webkit-scrollbar-track,
#view-productos .repTableScroll::-webkit-scrollbar-track,
#view-limites .repTableScroll::-webkit-scrollbar-track,
#view-reglas-subcategorias .repTableScroll::-webkit-scrollbar-track,
#view-usuarios .repTableScroll::-webkit-scrollbar-track,
#view-bodegas .repTableScroll::-webkit-scrollbar-track{ background: rgba(15,23,42,.55); border-radius:999px; }
#view-categorias .repTableScroll::-webkit-scrollbar-thumb,
#view-subcategorias .repTableScroll::-webkit-scrollbar-thumb,
#view-motivos-movimiento .repTableScroll::-webkit-scrollbar-thumb,
#view-proveedores .repTableScroll::-webkit-scrollbar-thumb,
#view-productos .repTableScroll::-webkit-scrollbar-thumb,
#view-limites .repTableScroll::-webkit-scrollbar-thumb,
#view-reglas-subcategorias .repTableScroll::-webkit-scrollbar-thumb,
#view-usuarios .repTableScroll::-webkit-scrollbar-thumb,
#view-bodegas .repTableScroll::-webkit-scrollbar-thumb{ background: linear-gradient(180deg, rgba(56,189,248,.75), rgba(14,165,233,.65)); border-radius:999px; border:2px solid rgba(15,23,42,.6); }
#view-categorias .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-subcategorias .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-motivos-movimiento .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-proveedores .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-productos .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-limites .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-reglas-subcategorias .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-usuarios .repTableScroll::-webkit-scrollbar-thumb:hover,
#view-bodegas .repTableScroll::-webkit-scrollbar-thumb:hover{ background: linear-gradient(180deg, rgba(125,211,252,.9), rgba(56,189,248,.85)); }

/* Admin UI hardening (2026-03-08) */
.app select,
.app select.in,
.app select option,
.app select.in option{
  color:#E5E7EB !important;
  background:#0B1222 !important;
}

#view-usuarios .userSection .adminSectionBody,
#view-bodegas [data-bod-collapse] .adminSectionBody{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}

#view-usuarios .userSection .adminSectionBody > .tableWrap,
#view-usuarios .userSection .adminSectionBody > table,
#view-bodegas [data-bod-collapse] .adminSectionBody > .tableWrap,
#view-bodegas [data-bod-collapse] .adminSectionBody > table{
  grid-column:1 / -1;
}

#view-usuarios .avatarPreviewImg,
#view-usuarios .avatarPreviewFallback,
#view-bodegas .logoPreviewImg,
#view-bodegas .logoPreviewFallback{
  justify-self:start;
}

#view-usuarios .userSectionBody,
#view-bodegas .repCollapseBodyInner{
  scrollbar-width:thin;
  scrollbar-color: rgba(56,189,248,.65) rgba(15,23,42,.55);
}
#view-usuarios .userSectionBody::-webkit-scrollbar,
#view-bodegas .repCollapseBodyInner::-webkit-scrollbar{ width:10px; height:10px; }
#view-usuarios .userSectionBody::-webkit-scrollbar-track,
#view-bodegas .repCollapseBodyInner::-webkit-scrollbar-track{ background: rgba(15,23,42,.55); border-radius:999px; }
#view-usuarios .userSectionBody::-webkit-scrollbar-thumb,
#view-bodegas .repCollapseBodyInner::-webkit-scrollbar-thumb{ background: linear-gradient(180deg, rgba(56,189,248,.75), rgba(14,165,233,.65)); border-radius:999px; border:2px solid rgba(15,23,42,.6); }
#view-usuarios .userSectionBody::-webkit-scrollbar-thumb:hover,
#view-bodegas .repCollapseBodyInner::-webkit-scrollbar-thumb:hover{ background: linear-gradient(180deg, rgba(125,211,252,.9), rgba(56,189,248,.85)); }

/* Collapse icon fix: use real icon text from HTML span */
.userSectionIcon,
.repCollapseIcon{
  font-size:14px;
  line-height:1;
}
.userSectionIcon::before,
.repCollapseIcon::before{
  content:none !important;
}
#confirmModal{
  z-index: 2147483645 !important;
}
#supervisorModal,#closeDayPinModal{
  z-index: 2147483644 !important;
}


/* UI Form System */
.uiFormLayout{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:12px;
  padding:12px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:14px;
  background: linear-gradient(180deg, rgba(15,23,42,.56), rgba(2,6,23,.45));
}
.uiFormLayout .lbl{
  margin:0 0 6px;
}
.uiFormLayout .grid2,
.uiFormLayout .grid3,
.uiFormLayout .grid4{
  gap:12px;
}
.uiFormLayout .in,
.uiFormLayout select.in,
.uiField .in,
.uiField select.in{
  min-height:44px;
  height:44px;
}
.uiFormLayout .ta,
.uiField .ta,
.uiFormLayout textarea,
.uiField textarea{
  min-height:44px;
}
.uiField{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.uiField .lbl{
  margin:0;
}
#view-r-existencias .repExistPanel{
  margin-top:10px;
  padding:12px;
  border:1px solid rgba(56,189,248,.24);
  border-radius:16px;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(56,189,248,.09), transparent 70%),
    linear-gradient(180deg, rgba(15,23,42,.55), rgba(2,6,23,.42));
}
#view-r-existencias .repExistPanelHead{
  margin-bottom:10px;
}
#view-r-existencias .repExistPanelTitle{
  font-size:14px;
  font-weight:800;
  color:#E2E8F0;
}
#view-r-existencias .repExistPanelSub{
  margin-top:3px;
  font-size:12px;
  color:#AFC2DA;
}
#view-r-existencias .repHeadFilters{
  display:grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap:10px;
}
#view-r-existencias .repFilterCard{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.26);
  background: linear-gradient(180deg, rgba(15,23,42,.50), rgba(2,6,23,.36));
}
#view-r-existencias .repFilterLabel{
  font-size:11px;
  font-weight:700;
  letter-spacing:.3px;
  text-transform:uppercase;
  color:#9FB3CF;
}
#view-r-existencias .repHeadInput{
  min-height:36px;
  height:36px;
  width:100%;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.72);
  color:#E2E8F0;
  padding:0 10px;
  font-size:13px;
}
#view-r-existencias .repHeadInput::placeholder{
  color:#9FB3CF;
}
#view-r-existencias .repHeadInput:focus{
  outline:none;
  border-color: rgba(56,189,248,.58);
  box-shadow: 0 0 0 2px rgba(56,189,248,.18);
}
#view-r-existencias .multiSelect{
  position:relative;
}
#view-r-existencias .multiSelectSummary{
  list-style:none;
  min-height:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.72);
  color:#E2E8F0;
  padding:0 10px;
  font-size:13px;
  cursor:pointer;
}
#view-r-existencias .multiSelectSummary::-webkit-details-marker{
  display:none;
}
#view-r-existencias .multiSelectSummary::after{
  content:'\25BE';
  color:#AFC2DA;
  font-size:12px;
}
#view-r-existencias .multiSelect[open] .multiSelectSummary{
  border-color: rgba(56,189,248,.58);
  box-shadow: 0 0 0 2px rgba(56,189,248,.18);
}
#view-r-existencias .multiSelectMenu{
  position:absolute;
  z-index:35;
  left:0;
  right:0;
  top:calc(100% + 6px);
  border-radius:12px;
  border:1px solid rgba(148,163,184,.35);
  background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(2,6,23,.95));
  box-shadow: 0 14px 32px rgba(2,6,23,.48);
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:220px;
  overflow:auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.72) rgba(15,23,42,.55);
}
#view-r-existencias .multiSelectMenu::-webkit-scrollbar{
  width:10px;
}
#view-r-existencias .multiSelectMenu::-webkit-scrollbar-track{
  background: rgba(15,23,42,.55);
  border-radius:999px;
}
#view-r-existencias .multiSelectMenu::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(56,189,248,.80), rgba(14,165,233,.68));
  border-radius:999px;
  border:2px solid rgba(15,23,42,.68);
}
#view-r-existencias .multiSelectMenu::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(125,211,252,.92), rgba(56,189,248,.84));
}
#view-r-existencias .multiSelectMenu label{
  display:flex;
  align-items:center;
  gap:8px;
  color:#D2DFEF;
  font-size:12px;
  padding:4px 2px;
}
#view-r-existencias .multiSelectMenu input[type="checkbox"]{
  accent-color:#38BDF8;
}
#view-r-existencias .multiSelectActions{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  padding-top:4px;
  border-top:1px solid rgba(148,163,184,.22);
}
#view-r-existencias .repExistLegendCards{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap:10px;
}
#view-r-existencias .repLegendCard{
  border-radius:12px;
  border:1px solid rgba(148,163,184,.28);
  padding:10px;
  background: rgba(15,23,42,.45);
}
#view-r-existencias .repLegendCard.estado{
  border-color: rgba(34,197,94,.34);
  background: linear-gradient(180deg, rgba(16,185,129,.13), rgba(15,23,42,.45));
}
#view-r-existencias .repLegendCard.nivel{
  border-color: rgba(245,158,11,.34);
  background: linear-gradient(180deg, rgba(245,158,11,.12), rgba(15,23,42,.45));
}
#view-r-existencias .repLegendCard.regla{
  border-color: rgba(59,130,246,.34);
  background: linear-gradient(180deg, rgba(59,130,246,.12), rgba(15,23,42,.45));
}
#view-r-existencias .repLegendTitle{
  font-size:12px;
  font-weight:800;
  color:#E2E8F0;
  margin-bottom:4px;
}
#view-r-existencias .repLegendText{
  font-size:12px;
  color:#B9C8DF;
  line-height:1.35;
}
@media (max-width: 1180px){
  #view-r-existencias .repHeadFilters{
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
  #view-r-existencias .repExistLegendCards{
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px){
  #view-r-existencias .repHeadFilters{
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}
@media (max-width: 560px){
  #view-r-existencias .repHeadFilters{
    grid-template-columns: 1fr;
  }
}
#view-r-existencias #repExistResume,
#view-r-transferencias #repKarResume,
#view-r-pedidos #repPedResume,
#view-r-auditoria-sensibles #repAudMeta,
#view-r-auditoria-sensibles #repAlertResume{
  margin-top:10px;
}
@media (max-width: 980px){
  .uiFormLayout{
    padding:10px;
  }
}

.addSectionHint{
  margin-bottom:8px;
  color:#B9C8DF;
  font-size:12px;
}


/* Import UX cards */
.adminImportBoard{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(260px, 1fr);
  gap:12px;
  align-items:stretch;
}
.adminImportCard{
  border:1px solid rgba(125,211,252,.26);
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, rgba(15,23,42,.62), rgba(2,6,23,.5));
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.2);
}
.adminImportCardTitle{
  font-size:14px;
  font-weight:800;
  color:#E2E8F0;
}
.adminImportCardSub{
  margin-top:4px;
  font-size:12px;
  color:#AFC2DA;
  line-height:1.35;
}
.adminImportDropZone{
  margin-top:10px;
  border:1px dashed rgba(125,211,252,.38);
  border-radius:12px;
  padding:10px;
  background: rgba(15,23,42,.46);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.adminImportDropZone [id$="FileName"]{
  min-height:22px;
  color:#B9C8DF;
  font-size:12px;
}
.adminImportConfigGrid{
  margin-top:10px;
  display:grid;
  gap:10px;
}
.adminImportActionRow{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.adminImportActionRow .btn,
.adminImportActionRow button{
  flex:1 1 150px;
}
.adminImportCardActions{
  grid-column:1;
}
.adminImportCardExample{
  grid-column:2;
}
.adminImportExampleList{
  margin:10px 0 0;
  padding-left:18px;
  color:#C8D6EA;
  font-size:12px;
  line-height:1.45;
}
.adminImportExampleList li{ margin:2px 0; }

@media (max-width: 1080px){
  .adminImportBoard{
    grid-template-columns:1fr;
  }
  .adminImportCardActions,
  .adminImportCardExample{
    grid-column:auto;
  }
}


/* Productos - flujo crear/buscar/editar */
#view-productos .prdFlowHint{
  margin:8px 0 14px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid rgba(96,165,250,.32);
  background: linear-gradient(180deg, rgba(15,23,42,.5), rgba(2,6,23,.3));
}
#view-productos .prdCaptureSection .adminSectionBody{
  align-items:end;
}
#view-productos .prdCaptureSection #prdVisibleWarehouses{
  min-height:210px;
}
#view-productos .prdCaptureSection #prdSave{
  justify-self:start;
  margin-top:0;
  background: linear-gradient(135deg, #34D399, #60A5FA);
  color:#041321;
  min-height:40px;
  min-width:190px;
}

#view-productos .prdListSection .adminSectionBody{
  grid-template-columns:minmax(320px,2fr) minmax(180px,1fr);
  align-items:end;
}
#view-productos .prdListSection .searchWrap{
  grid-column:1 / 2;
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:10px;
  align-items:center;
}
#view-productos .prdListSection .searchWrap .in{
  margin:0;
}
#view-productos .prdListSection #prdSearchBtn,
#view-productos .prdListSection #prdRefresh{
  width:100%;
  margin-top:0;
}
#view-productos .prdListSection #prdRefresh{
  grid-column:2 / 3;
}
#view-productos .prdListSection .tableWrap{
  grid-column:1 / -1;
  margin-top:4px;
}

@media (max-width: 980px){
  #view-productos .prdCaptureSection #prdSave{ width:100%; min-width:0; }
  #view-productos .prdListSection .adminSectionBody{
    grid-template-columns:1fr;
  }
  #view-productos .prdListSection .searchWrap{
    grid-column:1 / -1;
    grid-template-columns:1fr;
  }
  #view-productos .prdListSection #prdRefresh{
    grid-column:1 / -1;
  }
  #view-productos .prdWhPicker .prdWhEditorTools [data-prd-wh-search]{
    min-width:0;
    width:100%;
  }
  #view-productos .prdWhPicker .prdWhEditorTools .btn{
    min-width:0;
    width:100%;
  }
}


/* Admin list compact scrolling */
#view-categorias .repCollapseSection .tableWrap,
#view-subcategorias .repCollapseSection .tableWrap,
#view-motivos-movimiento .repCollapseSection .tableWrap,
#view-proveedores .repCollapseSection .tableWrap,
#view-productos .repCollapseSection .tableWrap,
#view-limites .repCollapseSection .tableWrap,
#view-reglas-subcategorias .repCollapseSection .tableWrap,
#view-bodegas [data-bod-collapse] .tableWrap,
#view-usuarios .userSection .tableWrap{
  max-height: min(360px, calc(100dvh - 290px));
  overflow:auto;
}
@media (max-width: 980px){
  #view-categorias .repCollapseSection .tableWrap,
  #view-subcategorias .repCollapseSection .tableWrap,
  #view-motivos-movimiento .repCollapseSection .tableWrap,
  #view-proveedores .repCollapseSection .tableWrap,
  #view-productos .repCollapseSection .tableWrap,
  #view-limites .repCollapseSection .tableWrap,
  #view-reglas-subcategorias .repCollapseSection .tableWrap,
  #view-bodegas [data-bod-collapse] .tableWrap,
  #view-usuarios .userSection .tableWrap{
    max-height: min(300px, calc(100dvh - 250px));
  }
}



/* Add Views: spacing + readability across sections */
.addViewCard .repCollapseSection,
#view-bodegas [data-bod-collapse],
#view-usuarios .userSection{
  margin-top:14px;
}
.addViewCard .repCollapseSection:first-child,
#view-bodegas [data-bod-collapse]:first-child,
#view-usuarios .userSection:first-child{
  margin-top:0;
}
.addViewCard .repCollapseBodyInner,
#view-bodegas [data-bod-collapse] .repCollapseBodyInner,
#view-usuarios .userSectionBody{
  padding-top:6px;
}
.addViewCard .adminSectionBody,
#view-bodegas [data-bod-collapse] .adminSectionBody,
#view-usuarios .userSection .adminSectionBody{
  gap:14px;
}
.addViewCard .addSectionHint,
#view-bodegas .addSectionHint,
#view-usuarios .addSectionHint{
  grid-column:1 / -1;
  margin:0;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(125,211,252,.24);
  background: rgba(15,23,42,.36);
  color:#C3D5EA;
}
.addViewCard .adminSectionBody > .uiField,
.addViewCard .adminSectionBody > .searchWrap,
#view-bodegas [data-bod-collapse] .adminSectionBody > .uiField,
#view-usuarios .userSection .adminSectionBody > .uiField{
  padding:9px 10px;
  border:1px solid rgba(148,163,184,.16);
  border-radius:12px;
  background: linear-gradient(180deg, rgba(15,23,42,.34), rgba(2,6,23,.22));
}
.addViewCard .adminSectionBody > .addRow,
#view-bodegas [data-bod-collapse] .adminSectionBody > .addRow,
#view-usuarios .userSection .adminSectionBody > .addRow{
  grid-column:1 / -1;
  padding-top:10px;
  border-top:1px dashed rgba(148,163,184,.28);
}
.app .lbl[title],
.app button[title],
.app input[title],
.app select[title],
.app textarea[title]{
  cursor:help;
}

/* Productos - Editar producto UX layout */
#view-productos #prdEditVisibleWarehouses{
  grid-column:1 / -1;
  width:100%;
}
#view-productos #prdEditVisibleWarehouses .prdWhEditor{
  width:100%;
  overflow:visible;
}
#view-productos #prdEditVisibleWarehouses .prdWhEditorTools{
  grid-template-columns:minmax(260px,2fr) repeat(3, minmax(150px,1fr)) minmax(180px,1.2fr);
}
#view-productos #prdEditVisibleWarehouses .prdWhEditorTools .in{
  min-width:0;
}
#view-productos #prdEditVisibleWarehouses .prdWhEditorList{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  max-height:340px;
  min-height:140px;
}
@media (max-width: 620px){
  #view-productos .prdWhEditorList,
  #view-productos #prdEditVisibleWarehouses .prdWhEditorList{
    grid-template-columns:1fr;
  }
}
#view-productos #prdEditSave{
  grid-column:1 / -1;
  justify-self:start;
  min-width:220px;
  margin-top:6px;
}
@media (max-width: 1100px){
  #view-productos #prdEditVisibleWarehouses .prdWhEditorTools{
    grid-template-columns:1fr 1fr;
  }
}
@media (max-width: 760px){
  #view-productos #prdEditVisibleWarehouses .prdWhEditorTools,
  #view-productos #prdEditVisibleWarehouses .prdWhEditorList{
    grid-template-columns:1fr;
  }
  #view-productos #prdEditSave{
    width:100%;
    min-width:0;
  }
}

/* Global UX polish (full pass) */
.app .tableWrap .tbl thead th{
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(4px);
  background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.86));
}
.app .tbl.grid tbody tr{
  transition: background .16s ease;
}
.app .tbl.grid tbody tr:hover{
  background: rgba(56,189,248,.08);
}
.addViewCard .repCollapseToggle,
#view-bodegas [data-bod-collapse] .repCollapseToggle,
#view-usuarios .userSectionToggle{
  padding:6px 0;
}
.addViewCard .panelTitle,
#view-bodegas .panelTitle,
#view-usuarios .cardTitle{
  letter-spacing:.01em;
}
.addViewCard .adminSectionBody > .tableWrap,
#view-bodegas [data-bod-collapse] .adminSectionBody > .tableWrap,
#view-usuarios .userSection .adminSectionBody > .tableWrap{
  margin-top:4px;
}
.addViewCard .adminSectionBody .note,
#view-bodegas [data-bod-collapse] .adminSectionBody .note,
#view-usuarios .userSection .adminSectionBody .note{
  color:#BFD2E8;
}
.addViewCard .searchWrap,
#view-bodegas [data-bod-collapse] .searchWrap,
#view-usuarios .userSection .searchWrap{
  width:100%;
}
.addViewCard .btn,
#view-bodegas [data-bod-collapse] .btn,
#view-usuarios .userSection .btn{
  min-height:42px;
}
.addViewCard .btn.soft,
#view-bodegas [data-bod-collapse] .btn.soft,
#view-usuarios .userSection .btn.soft{
  border-color: rgba(148,163,184,.24);
  background: linear-gradient(180deg, rgba(30,41,59,.76), rgba(15,23,42,.7));
}
.addViewCard .btn.soft:hover,
#view-bodegas [data-bod-collapse] .btn.soft:hover,
#view-usuarios .userSection .btn.soft:hover{
  border-color: rgba(125,211,252,.38);
  background: linear-gradient(180deg, rgba(30,64,175,.34), rgba(15,23,42,.74));
}
@media (max-width: 980px){
  .addViewCard .adminSectionBody,
  #view-bodegas [data-bod-collapse] .adminSectionBody,
  #view-usuarios .userSection .adminSectionBody{
    gap:12px;
  }
  .addViewCard .adminSectionBody > .uiField,
  .addViewCard .adminSectionBody > .searchWrap,
  #view-bodegas [data-bod-collapse] .adminSectionBody > .uiField,
  #view-usuarios .userSection .adminSectionBody > .uiField{
    padding:8px 9px;
  }
}










/* Reporte tendencia de producto */
.repTrendCharts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:10px;
}
.repTrendChartCard{
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  background:rgba(2,6,23,.36);
  padding:10px;
}
.repTrendChartTitle{
  font-weight:700;
  color:#E2E8F0;
  margin-bottom:8px;
}
.repTrendChartBars{
  min-height:182px;
  display:flex;
  align-items:flex-end;
  gap:8px;
  overflow-x:auto;
  padding:8px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.2);
  background:rgba(15,23,42,.55);
}
.repTrendBar{
  min-width:72px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.repTrendBarFill{
  width:28px;
  min-height:8px;
  border-radius:8px 8px 2px 2px;
}
.repTrendChartBars.price .repTrendBarFill{
  background:linear-gradient(180deg,#F59E0B 0%,#FCD34D 100%);
}
.repTrendChartBars.demand .repTrendBarFill{
  background:linear-gradient(180deg,#38BDF8 0%,#0EA5E9 100%);
}
.repTrendBarDate{
  font-size:11px;
  color:#AFC2DA;
  text-align:center;
  line-height:1.2;
}
.repTrendBarValue{
  font-size:11px;
  color:#E5E7EB;
  font-weight:600;
}
@media (max-width: 1100px){
  .repTrendCharts{
    grid-template-columns:1fr;
  }
}


#view-bodegas #bodManageList tr.is-editing{
  background: linear-gradient(180deg, rgba(37,99,235,.24), rgba(14,165,233,.12));
}
#view-bodegas #bodManageList tr.is-editing td{
  box-shadow: inset 0 1px 0 rgba(125,211,252,.18), inset 0 -1px 0 rgba(125,211,252,.18);
}
#view-bodegas .warehouseEditSummary{
  grid-column:1 / -1;
  padding:12px 14px;
  border-radius:14px;
  border:1px dashed rgba(148,163,184,.24);
  background: linear-gradient(180deg, rgba(15,23,42,.22), rgba(2,6,23,.14));
  color:#bfd2e8;
}
#view-bodegas .warehouseEditSummary.is-active{
  border-style:solid;
  border-color: rgba(56,189,248,.28);
  background: linear-gradient(180deg, rgba(8,47,73,.3), rgba(15,23,42,.22));
}
#view-bodegas .warehouseEditSummaryTitle{
  font-size:14px;
  font-weight:800;
  color:#f8fafc;
}
#view-bodegas .warehouseEditSummaryMeta{
  margin-top:4px;
  font-size:12px;
  line-height:1.45;
  color:#c3d5ea;
}
#view-bodegas [data-bod-collapse] .adminSectionBody .uiField{
  min-width:0;
}
#view-bodegas #bodEditSave{
  min-width:220px;
  justify-self:start;
}
@media (max-width: 760px){
  #view-bodegas #bodEditSave{
    width:100%;
    min-width:0;
  }
}

@media (max-width: 1400px), (max-height: 860px){
  #view-cuadre-caja .card.light{
    padding:12px;
  }
  #view-cuadre-caja .cuadreStickyHead{
    gap:12px;
    padding:12px;
    margin-bottom:12px;
  }
  #view-cuadre-caja .cuadreShell{
    grid-template-columns:minmax(0, 1.2fr) minmax(280px, .88fr);
    gap:14px;
  }
  #view-cuadre-caja .cuadreResumeCard{
    padding:12px 14px;
  }
  #view-cuadre-caja .cuadreResumeCard strong{
    font-size:24px;
  }
  #view-cuadre-caja .cuadreBlock,
  #view-cuadre-caja .cuadrePreviewCard{
    padding:12px;
    border-radius:16px;
  }
  #view-cuadre-caja .cuadreActions{
    justify-content:flex-start;
    gap:8px;
  }
  #view-cuadre-caja .cuadreActions .btn{
    flex:1 1 170px;
    min-height:40px;
  }
  #view-cuadre-caja .cuadreTicket{
    padding:16px 14px;
    border-radius:18px;
  }
  #view-cuadre-caja .cuadreTicketBrand{
    font-size:16px;
  }
}

@media (max-width: 1180px){
  #view-cuadre-caja .cuadreStickyHead{
    position:static;
    top:auto;
  }
  #view-cuadre-caja .cuadreShell{
    grid-template-columns:1fr;
  }
  #view-cuadre-caja .cuadrePreviewWrap{
    position:static;
  }
  #view-cuadre-caja .cuadrePreviewCard{
    max-width:820px;
    margin:0 auto;
  }
  #view-cuadre-caja .cuadreResumeGrid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
  #view-cuadre-caja .cuadreBlockHead{
    align-items:stretch;
  }
  #view-cuadre-caja .cuadreBlockHead > .addRow,
  #view-cuadre-caja .cuadreBlockHead > .btn{
    width:100%;
  }
  #view-cuadre-caja .cuadreBlockHead .addRow{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(190px, auto);
    gap:8px;
  }
  #view-cuadre-caja .cuadreDenomInput{
    min-width:0;
    width:100%;
  }
  #view-cuadre-caja .cuadreDenomTable{
    min-width:460px;
  }
}

@media (max-height: 760px) and (min-width: 981px){
  #view-cuadre-caja .card.light{
    padding:10px;
  }
  #view-cuadre-caja .cuadreStickyHead{
    position:sticky;
    top:8px;
    gap:8px;
    padding:10px;
    margin-bottom:10px;
    border-radius:14px;
  }
  #view-cuadre-caja .cuadreShell{
    grid-template-columns:minmax(0, 1.25fr) minmax(260px, .85fr);
    gap:10px;
  }
  #view-cuadre-caja .cuadreMain{
    gap:10px;
  }
  #view-cuadre-caja .cuadreResumeGrid{
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:8px;
  }
  #view-cuadre-caja .cuadreResumeCard{
    padding:9px 10px;
    border-radius:12px;
  }
  #view-cuadre-caja .cuadreResumeCard strong{
    font-size:18px;
  }
  #view-cuadre-caja .cuadreResumeLabel{
    font-size:10px;
    margin-bottom:3px;
  }
  #view-cuadre-caja .cuadreBlock,
  #view-cuadre-caja .cuadrePreviewCard{
    padding:10px;
    border-radius:12px;
  }
  #view-cuadre-caja .cuadreBlockHead{
    gap:8px;
    margin-bottom:8px;
  }
  #view-cuadre-caja .cuadreMiniGrid{
    gap:8px;
  }
  #view-cuadre-caja .cuadreActions{
    gap:6px;
  }
  #view-cuadre-caja .cuadreActions .btn{
    min-height:36px;
    flex:1 1 140px;
  }
  #view-cuadre-caja .cuadrePreviewWrap{
    position:sticky;
    top:8px;
  }
  #view-cuadre-caja .cuadrePreviewCard{
    max-height:calc(100vh - 18px);
    overflow:auto;
  }
  #view-cuadre-caja .cuadreTicket{
    padding:12px 10px;
    border-radius:14px;
  }
  #view-cuadre-caja .cuadreTicketBrand{
    font-size:13px;
    padding-bottom:8px;
  }
  #view-cuadre-caja .cuadreTicketMeta,
  #view-cuadre-caja .cuadreTicketSection{
    padding-top:8px;
  }
  #view-cuadre-caja .cuadreTicketMeta span,
  #view-cuadre-caja .cuadreTicketLine span,
  #view-cuadre-caja .cuadreTicketMeta strong,
  #view-cuadre-caja .cuadreTicketLine strong{
    font-size:10px;
  }
  #view-cuadre-caja .cuadreTicketLine.strong span,
  #view-cuadre-caja .cuadreTicketLine.strong strong{
    font-size:11px;
  }
}

@media (max-width: 760px){
  #view-cuadre-caja .card.light{
    padding:10px;
  }
  #view-cuadre-caja .cuadreStickyHead{
    padding:10px;
    gap:10px;
    border-radius:14px;
  }
  #view-cuadre-caja .cuadreResumeGrid,
  #view-cuadre-caja .cuadreMiniGrid,
  #view-cuadre-caja .grid2,
  #view-cuadre-caja .grid4{
    grid-template-columns:1fr;
  }
  #view-cuadre-caja .cuadreActions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  #view-cuadre-caja .cuadreActions .btn,
  #view-cuadre-caja .cuadreBlockHead > .btn,
  #view-cuadre-caja .cuadreBlockHead .addRow .btn{
    width:100%;
    min-width:0;
  }
  #view-cuadre-caja .cuadreBlockHead .addRow{
    grid-template-columns:1fr;
  }
  #view-cuadre-caja .cuadreResumeCard{
    padding:10px 12px;
    border-radius:14px;
  }
  #view-cuadre-caja .cuadreResumeCard strong{
    font-size:20px;
  }
  #view-cuadre-caja .cuadreResumeLabel{
    font-size:11px;
    margin-bottom:4px;
  }
  #view-cuadre-caja .cuadreBlock,
  #view-cuadre-caja .cuadrePreviewCard{
    padding:10px;
    border-radius:14px;
  }
  #view-cuadre-caja .cuadreTicket{
    padding:14px 12px;
    border-radius:16px;
  }
  #view-cuadre-caja .cuadreTicketBrand{
    font-size:14px;
    letter-spacing:.05em;
  }
  #view-cuadre-caja .cuadreTicketMeta span,
  #view-cuadre-caja .cuadreTicketLine span,
  #view-cuadre-caja .cuadreTicketMeta strong,
  #view-cuadre-caja .cuadreTicketLine strong{
    font-size:11px;
  }
  #view-cuadre-caja .cuadreTicketLine.strong span,
  #view-cuadre-caja .cuadreTicketLine.strong strong{
    font-size:12px;
  }
  #view-cuadre-caja .cuadreDenomTable{
    min-width:420px;
  }
  #view-cuadre-caja .cuadreDenomTable th:nth-child(1),
  #view-cuadre-caja .cuadreDenomTable td:nth-child(1){
    width:104px;
  }
  #view-cuadre-caja .cuadreDenomTable th:nth-child(2),
  #view-cuadre-caja .cuadreDenomTable td:nth-child(2){
    width:114px;
  }
  #view-cuadre-caja .cuadreDenomTable th:nth-child(3),
  #view-cuadre-caja .cuadreDenomTable td:nth-child(3){
    width:96px;
  }
  #view-cuadre-caja .cuadreDenomTable th:nth-child(4),
  #view-cuadre-caja .cuadreDenomTable td:nth-child(4){
    width:86px;
  }
  #view-cuadre-caja .cuadreDenomBadge{
    min-width:68px;
    padding:7px 9px;
    font-size:12px;
  }
  #view-cuadre-caja .app .cuadreDenomTableWrap .in.cuadreQtyInput,
  .app #view-cuadre-caja .cuadreDenomTableWrap .in.cuadreQtyInput{
    width:82px;
    max-width:82px;
    min-width:82px;
  }
}

@media (max-width: 520px){
  #view-cuadre-caja .cuadreActions{
    grid-template-columns:1fr;
  }
  #view-cuadre-caja .cuadrePreviewEyebrow{
    font-size:10px;
  }
  #view-cuadre-caja .cuadreTicketMeta div,
  #view-cuadre-caja .cuadreTicketLine{
    gap:6px;
  }
}

#view-cuadre-caja #cuadrePdfFormat{
  min-width:160px;
}

@media (max-width: 1400px), (max-height: 860px){
  #view-cuadre-caja #cuadrePdfFormat{
    flex:1 1 180px;
  }
}

@media (max-width: 760px){
  #view-cuadre-caja #cuadrePdfFormat{
    width:100%;
    min-width:0;
  }
}

.globalSaveProgress{
  position:fixed;
  left:50%;
  top:14px;
  transform:translateX(-50%) translateY(-10px);
  width:min(520px, calc(100vw - 24px));
  z-index:2147483647 !important;
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}
.globalSaveProgress.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.globalSaveProgress.hidden{display:none}
.globalSaveProgressInner{
  border-radius:16px;
  padding:10px 12px;
  background:linear-gradient(180deg, rgba(8,15,33,.97), rgba(15,23,42,.96));
  border:1px solid rgba(96,165,250,.34);
  box-shadow:0 16px 40px rgba(2,6,23,.52);
  backdrop-filter:blur(10px);
}
.globalSaveProgressLabel{
  font-size:13px;
  font-weight:900;
  color:#E2E8F0;
  margin-bottom:8px;
  letter-spacing:.01em;
}
.globalSaveProgressTrack{
  height:8px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(30,41,59,.92);
  border:1px solid rgba(125,211,252,.16);
}
.globalSaveProgressBar{
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #38BDF8 0%, #60A5FA 45%, #34D399 100%);
  box-shadow:0 0 14px rgba(56,189,248,.45);
  transition:width .22s ease;
}
@media (max-width: 760px){
  .globalSaveProgress{
    top:10px;
    width:min(460px, calc(100vw - 18px));
  }
  .globalSaveProgressInner{
    border-radius:14px;
    padding:9px 10px;
  }
  .globalSaveProgressLabel{
    font-size:12px;
    margin-bottom:6px;
  }
  .globalSaveProgressTrack{
    height:7px;
  }
}

.app .btn.is-busy,
.app button.is-busy{
  opacity:.72;
  cursor:progress;
  filter:saturate(.88);
}
.app .btn.is-busy:disabled,
.app button.is-busy:disabled{
  opacity:.72;
}


