:root{
  --bg:#eef3f8;
  --panel:#fffefa;
  --line:#dedbd1;
  --text:#132033;
  --muted:#667085;
  --blue:#004b80;
  --green:#007865;
  --green2:#005f4f;
  --red:#b91c1c;
  --yellow:#f5c56b;
  --mono:"Courier New",monospace;
  --radius:12px;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,Arial,sans-serif;
  font-size:13px;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:230px;
  background:#0f2437;
  color:#fff;
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
}
.brand{display:flex;gap:10px;align-items:center;margin-bottom:24px}
.brand-icon{
  width:36px;height:36px;border-radius:10px;background:var(--green);
  display:grid;place-items:center;font-weight:900
}
.brand strong{display:block}
.brand small{display:block;color:#b6c7d8;margin-top:3px}
.nav{
  display:block;width:100%;border:0;border-radius:9px;padding:11px 12px;
  background:transparent;color:#cfe0ef;text-align:left;margin-bottom:6px;font-weight:800
}
.nav.active,.nav:hover{background:#183a59;color:#fff}
.main{flex:1;padding:18px;min-width:0}
.topbar{
  display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px
}
h1,h2,h3,p{margin:0}
h1{font-size:22px}
h2{font-size:17px}
h3{font-size:14px}
p{color:var(--muted);margin-top:5px}
.primary,.secondary,.danger,.ghost,.upload{
  border:0;border-radius:8px;font-weight:900;padding:9px 12px;display:inline-flex;align-items:center;gap:6px
}
.primary{background:var(--green);color:#fff}
.secondary{background:#eaf2fb;color:#1e5a8a;border:1px solid #bfd3e5}
.danger{background:#fee2e2;color:var(--red)}
.ghost{background:#f1f5f9;color:#334155;border:1px solid #cbd5e1}
.small{padding:7px 10px;font-size:12px}
.tiny{padding:4px 8px;font-size:11px;border-radius:6px}
.upload{background:#fff;border:1px solid var(--line);color:#132033}
.upload input{display:none}
.view{display:none}
.view.active{display:block}
.layout{display:grid;grid-template-columns:330px minmax(0,1fr);gap:14px}
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.04)
}
.detail{
  max-height:calc(100vh - 96px);
  overflow:auto;
  scrollbar-gutter:stable;
}
.panel-head,.section-head,.editor-head,.line-head{
  display:flex;justify-content:space-between;align-items:center;gap:12px
}
.exp-list{margin-top:12px;display:flex;flex-direction:column;gap:8px}
.exp-card{
  border:1px solid var(--line);border-radius:10px;padding:10px;background:#fff;cursor:pointer
}
.exp-card.active{border-color:var(--green);box-shadow:0 0 0 2px rgba(0,120,101,.12)}
.exp-card strong{display:block}
.exp-card small{display:block;color:var(--muted);margin-top:4px}
.empty-state{
  min-height:360px;display:grid;place-content:center;text-align:center;color:var(--muted)
}
.hidden{display:none!important}
.editor-head{margin-bottom:12px;border-bottom:1px solid var(--line);padding-bottom:12px}
.editor-actions{display:flex;gap:8px;align-items:center}
.block,.subblock{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  margin-bottom:12px;
  overflow:hidden;
}
.block{padding:12px}
.operation{background:#eef6ff;border-color:#bdd7f2}
.block-title,.subblock-title{
  color:var(--blue);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:10px;
}
.grid{display:grid;gap:10px}
.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}
label{display:flex;flex-direction:column;gap:5px}
label.full{margin-top:10px}
label span{
  font-size:10px;color:#667085;font-weight:900;text-transform:uppercase;letter-spacing:.05em
}
input,select,textarea{
  border:1px solid #d7d2c6;background:#fffefa;border-radius:8px;padding:8px 9px;min-width:0
}
input.money{text-align:right;font-family:var(--mono)}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.tab{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:8px 14px;
  color:#132033;
  font-weight:900;
}
.tab.active{background:var(--green);color:#fff;border-color:var(--green)}
.tab-content{display:none}
.tab-content.active{display:block}
.factura-card{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  margin-bottom:12px;
  overflow:hidden;
}
.factura-head{
  display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line);
  background:#fffefa
}
.factura-title{display:flex;align-items:center;gap:8px}
.badge{
  width:22px;height:22px;border-radius:999px;background:#1b5d7a;color:#fff;
  display:grid;place-items:center;font-size:11px;font-weight:900
}
.facturaSub{display:block;color:var(--muted);margin-left:30px;margin-top:2px}
.factura-actions{display:flex;gap:7px}
.factura-body{padding:12px 14px}
.subblock{padding:12px;margin-bottom:12px}
.pagos-block{padding:0}
.pagos-title{
  display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:9px 14px;background:#fbfaf6;border-bottom:1px solid var(--line);
  font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.06em
}
.coin{
  display:inline-flex;width:22px;height:22px;border-radius:999px;background:var(--yellow);
  align-items:center;justify-content:center;color:#3b2a00;margin-right:8px;font-weight:900
}
.pagos-summary{
  display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--line)
}
.pagos-summary>div{padding:10px 14px;border-right:1px solid var(--line);min-height:56px}
.pagos-summary>div:last-child{border-right:0}
.pagos-summary span{
  display:block;font-size:9px;font-weight:900;color:#667085;text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px
}
.pagos-summary b{font-family:var(--mono);font-size:14px;color:var(--green2)}
.progress{height:7px;border-radius:999px;background:#e5e7eb;overflow:hidden;margin:6px 0}
.progress i{display:block;height:100%;background:#2f6b4f;border-radius:999px}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
.pagos-table{min-width:1080px}
th{
  background:#f5f2ea;color:#667085;font-size:10px;text-transform:uppercase;
  letter-spacing:.05em;padding:8px;text-align:left;border-bottom:1px solid var(--line)
}
td{padding:7px 8px;border-top:1px solid #eeeae0;vertical-align:middle}
td input,td select{width:100%;height:31px;font-size:11px;padding:5px 7px}
.num{text-align:center;color:var(--muted)}
.right{text-align:right}
.mono{font-family:var(--mono)}
.strong{font-weight:900}
.status{
  display:inline-flex;border-radius:999px;padding:3px 8px;font-size:10px;font-weight:900;white-space:nowrap
}
.status.ok{background:#e7f6f2;color:var(--green)}
.status.pend{background:#fff7d6;color:#8a6500}
.del{
  border:0;background:#fee2e2;color:var(--red);border-radius:6px;padding:4px 8px;font-weight:900
}
.empty-row{text-align:center;color:var(--muted);padding:14px}
.docs-list{display:flex;flex-direction:column;gap:7px;margin-top:8px}
.doc-item{
  display:flex;justify-content:space-between;align-items:center;border:1px dashed #cbd5e1;border-radius:8px;padding:8px 10px;background:#f8fafc
}
.muted{color:var(--muted)}
.mve-summary{
  border:1px solid var(--line);border-radius:10px;background:#fff;padding:12px;
  white-space:pre-wrap;font-family:var(--mono);font-size:12px;line-height:1.45
}
.catalog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px}
.catalog-list{
  border:1px solid var(--line);border-radius:10px;background:#fff;max-height:420px;overflow:auto;padding:10px
}
.catalog-item{padding:6px 0;border-bottom:1px solid #f1f5f9}
.catalog-item:last-child{border-bottom:0}
@media(max-width:1100px){
  .layout{grid-template-columns:1fr}
  .sidebar{display:none}
  .cols3,.cols4,.pagos-summary,.catalog-grid{grid-template-columns:1fr}
  .detail{max-height:none}
}



/* =========================================================
   D02 - Lectura automática de factura con IA
   ========================================================= */
.doc-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.ia-upload{
  background:#e7f6f2!important;
  color:#007865!important;
  border-color:#9fd8cc!important;
}
.ia-status{
  margin:8px 0;
  border-radius:8px;
  padding:8px 10px;
  background:#eaf2fb;
  color:#1e5a8a;
  font-weight:800;
  font-size:12px;
}
.ia-status.ok{
  background:#e7f6f2;
  color:#007865;
}
.ia-status.error{
  background:#fee2e2;
  color:#b91c1c;
}



/* =========================================================
   D07 - Facturas compactas / una abierta a la vez
   ========================================================= */

.facturas-summary-strip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:10px 0 12px;
}
.facturas-summary-strip>div{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:10px 12px;
}
.facturas-summary-strip span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:4px;
}
.facturas-summary-strip b{
  font-family:var(--mono);
  color:var(--green2);
  font-size:14px;
}
.factura-card{
  transition:box-shadow .15s ease, border-color .15s ease;
}
.factura-card.expanded{
  border-color:#9fd8cc;
  box-shadow:0 0 0 2px rgba(0,120,101,.10);
}
.factura-head{
  gap:12px;
}
.factura-title strong{
  font-size:14px;
}
.facturaSub{
  margin-left:30px;
  display:flex!important;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.mini-chip{
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1px solid #e6e1d7;
  background:#fbfaf6;
  color:#667085;
  border-radius:999px;
  padding:3px 8px;
  font-size:10px;
  font-weight:800;
}
.mini-chip b{
  color:#132033;
  font-family:var(--mono);
}
.btnToggleFactura{
  min-width:92px;
  justify-content:center;
}
.factura-card:not(.expanded) .factura-head{
  border-bottom:0;
}
.factura-card:not(.expanded) .factura-body{
  display:none!important;
}
.subblock-collapsible.collapsed > *:not(.line-head){
  display:none!important;
}
.compact-toggle{
  margin-left:auto;
}
.subblock-collapsible.collapsed{
  padding-bottom:10px;
}
@media(max-width:900px){
  .facturas-summary-strip{
    grid-template-columns:1fr 1fr;
  }
}



/* =========================================================
   D08 - Facturas como botones + popup de edición
   ========================================================= */

/* El área de facturas ahora es mosaico */
#facturasContainer{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
  gap:10px;
  align-items:start;
}

/* El resumen general ocupa todo el ancho */
#facturasContainer .facturas-summary-strip{
  grid-column:1 / -1;
}

/* Tarjeta cerrada = botón pequeño */
#facturasContainer .factura-card{
  margin:0!important;
  min-height:92px;
  border-radius:12px;
  cursor:pointer;
  overflow:hidden;
  background:#fffefa;
}

#facturasContainer .factura-card:not(.expanded):hover{
  border-color:#9fd8cc;
  box-shadow:0 0 0 2px rgba(0,120,101,.08);
}

#facturasContainer .factura-card:not(.expanded) .factura-head{
  padding:10px 12px;
  height:100%;
  align-items:flex-start;
}

#facturasContainer .factura-card:not(.expanded) .factura-title{
  align-items:flex-start;
}

#facturasContainer .factura-card:not(.expanded) .factura-title strong{
  font-size:12px;
  line-height:1.2;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

#facturasContainer .factura-card:not(.expanded) .facturaSub{
  margin-left:0;
  margin-top:8px;
  gap:4px;
}

#facturasContainer .factura-card:not(.expanded) .mini-chip{
  font-size:9px;
  padding:2px 6px;
}

#facturasContainer .factura-card:not(.expanded) .factura-actions{
  flex-direction:column;
  align-items:flex-end;
}

#facturasContainer .factura-card:not(.expanded) .btnToggleFactura{
  min-width:60px;
  padding:5px 8px;
  font-size:10px;
}

#facturasContainer .factura-card:not(.expanded) .btnEliminarFactura{
  padding:5px 8px;
  font-size:10px;
}

/* Popup/modal cuando está abierto */
#facturasContainer .factura-card.expanded{
  position:fixed!important;
  top:4vh;
  left:4vw;
  width:92vw;
  height:92vh;
  z-index:1002;
  margin:0!important;
  display:flex;
  flex-direction:column;
  border-radius:16px;
  background:#fffefa;
  overflow:hidden;
  box-shadow:0 30px 90px rgba(15,23,42,.35);
  border:1px solid #9fd8cc;
}

/* Fondo oscuro usando pseudo-elemento */
#facturasContainer .factura-card.expanded::before{
  content:"";
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.48);
  z-index:-1;
}

/* Header del popup */
#facturasContainer .factura-card.expanded .factura-head{
  position:sticky;
  top:0;
  z-index:2;
  background:#fffefa;
  border-bottom:1px solid var(--line);
  padding:12px 16px;
}

#facturasContainer .factura-card.expanded .factura-title strong{
  font-size:15px;
}

#facturasContainer .factura-card.expanded .facturaSub{
  margin-left:30px;
}

/* Cuerpo del popup */
#facturasContainer .factura-card.expanded .factura-body{
  display:block!important;
  overflow:auto;
  padding:14px 16px 22px;
  height:100%;
}

/* Evitar scroll de fondo */
body.mve-modal-open{
  overflow:hidden;
}

/* En popup, hacerlo más cómodo visualmente */
#facturasContainer .factura-card.expanded .subblock{
  margin-bottom:10px;
}

#facturasContainer .factura-card.expanded .pagos-block{
  margin-bottom:10px;
}

/* Para evitar que el summary quede demasiado alto */
.facturas-summary-strip{
  margin-bottom:8px;
}

@media(max-width:900px){
  #facturasContainer{
    grid-template-columns:1fr;
  }
  #facturasContainer .factura-card.expanded{
    top:2vh;
    left:2vw;
    width:96vw;
    height:96vh;
  }
}



/* =========================================================
   D09 - No abrir popup por default
   ========================================================= */
#facturasContainer .factura-card:not(.expanded){
  max-height:116px;
}



/* =========================================================
   D10 - Look & Feel profesional
   ========================================================= */

:root{
  --bg:#f4f7fb!important;
  --panel:#ffffff!important;
  --line:#d9e1ea!important;
  --line-soft:#edf1f5!important;
  --text:#172033!important;
  --muted:#6b7280!important;
  --blue:#12355b!important;
  --blue2:#0b2545!important;
  --blue-soft:#edf5ff!important;
  --green:#006f5f!important;
  --green2:#00584d!important;
  --red:#b42318!important;
  --red-soft:#fee4e2!important;
  --yellow:#f4b740!important;
  --shadow:0 10px 30px rgba(16,24,40,.07)!important;
  --shadow-soft:0 4px 14px rgba(16,24,40,.06)!important;
  --radius:14px!important;
  --mono:"SFMono-Regular","Cascadia Code","Consolas","Courier New",monospace!important;
}

body{
  background:linear-gradient(180deg,#f7faff 0%,#eef4fb 100%)!important;
  color:var(--text)!important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif!important;
  font-size:13px!important;
  letter-spacing:.005em!important;
}

.sidebar{
  background:linear-gradient(180deg,#0b2545 0%,#102f52 100%)!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
  box-shadow:8px 0 24px rgba(15,35,55,.10)!important;
}

.brand{
  padding:6px 4px 18px!important;
  border-bottom:1px solid rgba(255,255,255,.10)!important;
  margin-bottom:18px!important;
}

.brand-icon{
  background:linear-gradient(135deg,#00a389,#006f5f)!important;
  box-shadow:0 8px 20px rgba(0,111,95,.28)!important;
}

.brand strong{
  font-size:14px!important;
  letter-spacing:.02em!important;
}

.brand small{
  color:#a8bfd6!important;
}

.nav{
  color:#cbd8e6!important;
  border:1px solid transparent!important;
  border-radius:10px!important;
  margin-bottom:7px!important;
  transition:all .15s ease!important;
}

.nav.active,
.nav:hover{
  background:rgba(255,255,255,.10)!important;
  color:#ffffff!important;
  border-color:rgba(255,255,255,.12)!important;
}

.main{
  padding:22px!important;
}

.topbar{
  background:#ffffff!important;
  border:1px solid var(--line)!important;
  border-radius:18px!important;
  padding:18px 20px!important;
  box-shadow:var(--shadow-soft)!important;
  margin-bottom:16px!important;
}

h1{
  font-size:23px!important;
  font-weight:850!important;
  color:#0f172a!important;
  letter-spacing:-.02em!important;
}

h2{
  font-size:17px!important;
  font-weight:850!important;
  letter-spacing:-.01em!important;
}

h3{
  font-size:14px!important;
  font-weight:850!important;
}

p{
  color:#667085!important;
  line-height:1.45!important;
}

.primary,
.secondary,
.danger,
.ghost,
.upload{
  border-radius:10px!important;
  font-weight:800!important;
  letter-spacing:.01em!important;
  transition:all .14s ease!important;
}

.primary{
  background:linear-gradient(135deg,#00836f,#006f5f)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(0,111,95,.18)!important;
}

.primary:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 10px 22px rgba(0,111,95,.24)!important;
}

.secondary{
  background:#f4f8fd!important;
  color:#12355b!important;
  border:1px solid #cfe0f1!important;
}

.ghost{
  background:#f8fafc!important;
  color:#334155!important;
  border:1px solid #d8e0e8!important;
}

.danger{
  background:#fff1f0!important;
  color:#b42318!important;
  border:1px solid #ffd2cc!important;
}

.upload{
  background:#ffffff!important;
  border:1px solid #ccd6e0!important;
  color:#12355b!important;
}

.panel{
  background:#ffffff!important;
  border:1px solid var(--line)!important;
  border-radius:18px!important;
  box-shadow:var(--shadow-soft)!important;
}

.detail{
  background:#ffffff!important;
}

.exp-card{
  border:1px solid #dce3eb!important;
  border-radius:14px!important;
  background:#ffffff!important;
  box-shadow:0 2px 8px rgba(16,24,40,.03)!important;
  transition:all .15s ease!important;
}

.exp-card:hover{
  transform:translateY(-1px)!important;
  border-color:#aac5df!important;
  box-shadow:0 8px 18px rgba(16,24,40,.07)!important;
}

.exp-card.active{
  border-color:#006f5f!important;
  box-shadow:0 0 0 3px rgba(0,111,95,.11)!important;
}

.editor-head{
  background:#fbfcfe!important;
  border:1px solid #edf1f5!important;
  border-radius:14px!important;
  padding:14px 16px!important;
  margin-bottom:14px!important;
}

.block,
.subblock{
  background:#ffffff!important;
  border:1px solid #dfe6ee!important;
  border-radius:14px!important;
  box-shadow:0 2px 7px rgba(16,24,40,.035)!important;
}

.operation{
  background:linear-gradient(180deg,#f3f8ff,#ffffff)!important;
  border-color:#c9dcef!important;
}

.block-title,
.subblock-title{
  color:#12355b!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.10em!important;
}

input,
select,
textarea{
  border:1px solid #cfd8e3!important;
  background:#ffffff!important;
  border-radius:10px!important;
  padding:9px 10px!important;
  color:#172033!important;
  box-shadow:inset 0 1px 1px rgba(16,24,40,.025)!important;
}

input:focus,
select:focus,
textarea:focus{
  outline:none!important;
  border-color:#2478b7!important;
  box-shadow:0 0 0 3px rgba(36,120,183,.12)!important;
}

label span{
  color:#667085!important;
  font-size:9px!important;
  letter-spacing:.075em!important;
}

.tabs{
  margin:16px 0!important;
}

.tab{
  background:#ffffff!important;
  border:1px solid #d7e0ea!important;
  color:#344054!important;
  border-radius:999px!important;
  font-weight:850!important;
  box-shadow:0 1px 2px rgba(16,24,40,.04)!important;
}

.tab.active{
  background:#12355b!important;
  border-color:#12355b!important;
  color:#ffffff!important;
  box-shadow:0 8px 18px rgba(18,53,91,.18)!important;
}

.section-head{
  background:#ffffff!important;
  border:1px solid #edf1f5!important;
  border-radius:14px!important;
  padding:12px 14px!important;
  margin-bottom:10px!important;
}

/* Facturas mosaico profesional */
.facturas-summary-strip{
  gap:10px!important;
}

.facturas-summary-strip>div{
  border:1px solid #dfe6ee!important;
  background:linear-gradient(180deg,#ffffff,#fbfcfe)!important;
  border-radius:14px!important;
  box-shadow:0 2px 8px rgba(16,24,40,.04)!important;
}

.facturas-summary-strip span{
  color:#667085!important;
}

.facturas-summary-strip b{
  color:#12355b!important;
}

#facturasContainer .factura-card:not(.expanded){
  border:1px solid #dfe6ee!important;
  background:#ffffff!important;
  box-shadow:0 3px 12px rgba(16,24,40,.045)!important;
  border-radius:16px!important;
}

#facturasContainer .factura-card:not(.expanded):hover{
  border-color:#8db7d9!important;
  box-shadow:0 14px 32px rgba(16,24,40,.10)!important;
  transform:translateY(-2px)!important;
}

.factura-card.expanded{
  border-color:#c8d8e8!important;
}

#facturasContainer .factura-card.expanded{
  box-shadow:0 32px 90px rgba(15,23,42,.35)!important;
  border:1px solid #c8d8e8!important;
}

#facturasContainer .factura-card.expanded::before{
  background:rgba(15,23,42,.58)!important;
  backdrop-filter:blur(2px)!important;
}

.factura-head{
  background:#ffffff!important;
}

#facturasContainer .factura-card.expanded .factura-head{
  background:#ffffff!important;
  border-bottom:1px solid #e5ebf1!important;
}

.badge{
  background:linear-gradient(135deg,#12355b,#1f5f8d)!important;
  box-shadow:0 6px 14px rgba(18,53,91,.18)!important;
}

.factura-title strong{
  color:#111827!important;
  font-weight:850!important;
}

.mini-chip{
  background:#f6f8fb!important;
  border:1px solid #e1e7ef!important;
  color:#667085!important;
  font-weight:750!important;
}

.mini-chip b{
  color:#12355b!important;
  font-weight:850!important;
}

.btnToggleFactura{
  background:#eef5fb!important;
  border-color:#cbddec!important;
  color:#12355b!important;
}

.btnEliminarFactura{
  background:#fff1f0!important;
  border:1px solid #ffd1cc!important;
  color:#b42318!important;
}

/* Pagos */
.pagos-block{
  border:1px solid #dfe6ee!important;
}

.pagos-title{
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
  color:#12355b!important;
  border-bottom:1px solid #e3e9f0!important;
}

.coin{
  background:linear-gradient(135deg,#f6c85f,#e7a829)!important;
  color:#422800!important;
  box-shadow:0 4px 10px rgba(231,168,41,.24)!important;
}

.pagos-summary{
  background:#ffffff!important;
  border-bottom:1px solid #e3e9f0!important;
}

.pagos-summary>div{
  border-right:1px solid #e3e9f0!important;
}

.pagos-summary span{
  color:#667085!important;
}

.pagos-summary b{
  color:#006f5f!important;
}

.progress{
  background:#e8edf3!important;
}

.progress i{
  background:linear-gradient(90deg,#006f5f,#00a389)!important;
}

table{
  background:#ffffff!important;
}

th{
  background:#f7f9fc!important;
  color:#667085!important;
  border-bottom:1px solid #e3e9f0!important;
  font-weight:900!important;
}

td{
  border-top:1px solid #edf1f5!important;
}

.status.ok{
  background:#e7f6f2!important;
  color:#006f5f!important;
}

.status.pend{
  background:#fff7e6!important;
  color:#a15c00!important;
}

.del{
  background:#fff1f0!important;
  color:#b42318!important;
  border:1px solid #ffd1cc!important;
}

/* IA */
.ia-upload{
  background:#eaf8f4!important;
  color:#006f5f!important;
  border-color:#b8ded4!important;
}

.ia-status{
  border:1px solid #cfe0f1!important;
  background:#f2f8ff!important;
  color:#12355b!important;
  border-radius:10px!important;
}

.ia-status.ok{
  background:#e7f6f2!important;
  color:#006f5f!important;
  border-color:#b8ded4!important;
}

.ia-status.error{
  background:#fff1f0!important;
  color:#b42318!important;
  border-color:#ffd1cc!important;
}

/* Scrollbar más fino */
.detail::-webkit-scrollbar,
.factura-body::-webkit-scrollbar,
.catalog-list::-webkit-scrollbar{
  width:10px!important;
  height:10px!important;
}

.detail::-webkit-scrollbar-thumb,
.factura-body::-webkit-scrollbar-thumb,
.catalog-list::-webkit-scrollbar-thumb{
  background:#c7d1dc!important;
  border-radius:999px!important;
  border:2px solid #f4f7fb!important;
}

.detail::-webkit-scrollbar-track,
.factura-body::-webkit-scrollbar-track,
.catalog-list::-webkit-scrollbar-track{
  background:#f4f7fb!important;
}

/* Pulido final */
.empty-row,
.empty-state{
  color:#667085!important;
}

.doc-item{
  background:#f8fafc!important;
  border:1px dashed #cfd8e3!important;
  border-radius:12px!important;
}

.catalog-list{
  border-color:#dfe6ee!important;
  border-radius:14px!important;
  background:#ffffff!important;
}

.catalog-item{
  border-bottom:1px solid #edf1f5!important;
}



/* =========================================================
   D11 - Documentos/IA con refresco visual inmediato
   ========================================================= */

.ia-status{
  animation:iaPulse .35s ease;
}

@keyframes iaPulse{
  from{transform:translateY(-3px);opacity:.55}
  to{transform:translateY(0);opacity:1}
}

.docs-list{
  margin-top:10px!important;
}

.doc-item{
  background:#ffffff!important;
  border:1px solid #dfe6ee!important;
  box-shadow:0 2px 8px rgba(16,24,40,.035)!important;
}

.doc-item strong{
  color:#12355b!important;
}

.subblock-collapsible:not(.collapsed){
  border-color:#bfd7ee!important;
  box-shadow:0 0 0 3px rgba(36,120,183,.08)!important;
}



/* =========================================================
   D12 - Documentos generales estilo digitalización
   ========================================================= */

#tab-documentos .docs-list{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(360px,1fr))!important;
  gap:12px!important;
  margin-top:14px!important;
}

.doc-card-vucem{
  display:grid;
  grid-template-columns:54px 1fr auto;
  gap:14px;
  align-items:center;
  background:#ffffff;
  border:1px solid #d8e4ef;
  border-left:5px solid #245c48;
  border-radius:18px;
  padding:16px 18px;
  box-shadow:0 6px 18px rgba(16,24,40,.06);
  min-height:112px;
  transition:all .15s ease;
}

.doc-card-vucem:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(16,24,40,.10);
  border-color:#b9ccdc;
  border-left-color:#006f5f;
}

.doc-card-vucem .doc-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  background:#edf8f4;
  color:#245c48;
  display:grid;
  place-items:center;
  font-size:23px;
  font-weight:900;
  border:1px solid #d4efe7;
}

.doc-card-vucem .doc-title{
  font-size:16px;
  font-weight:900;
  color:#111827;
  letter-spacing:.01em;
  margin-bottom:4px;
}

.doc-card-vucem .doc-sub{
  color:#667085;
  font-size:12px;
  margin-bottom:10px;
}

.doc-card-vucem .doc-tags{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.doc-card-vucem .tag-mve,
.doc-card-vucem .tag-ready{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 11px;
  font-size:11px;
  font-weight:850;
  border:1px solid transparent;
}

.doc-card-vucem .tag-mve{
  background:#fff7e6;
  color:#8a5700;
  border-color:#ffe1a3;
}

.doc-card-vucem .tag-ready{
  background:#e7f6f2;
  color:#006f5f;
  border-color:#b8ded4;
  text-transform:uppercase;
  letter-spacing:.02em;
}

.doc-actions-card{
  display:flex;
  gap:8px;
  align-items:center;
}

.doc-actions-card button{
  width:38px;
  height:38px;
  border-radius:999px;
  border:0;
  display:grid;
  place-items:center;
  font-weight:900;
  cursor:pointer;
}

.doc-eye{
  background:#f2f6fa;
  color:#12355b;
}

.doc-delete{
  background:#fff1f0;
  color:#b42318;
}

.doc-more{
  background:#e7f6f2;
  color:#006f5f;
}

.doc-extra{
  grid-column:1 / -1;
  border-top:1px solid #edf1f5;
  padding-top:12px;
  margin-top:2px;
  color:#475467;
  font-size:12px;
  line-height:1.55;
  background:#fbfcfe;
  border-radius:12px;
  padding:12px;
}

@media(max-width:760px){
  #tab-documentos .docs-list{
    grid-template-columns:1fr!important;
  }
  .doc-card-vucem{
    grid-template-columns:44px 1fr;
  }
  .doc-actions-card{
    grid-column:1 / -1;
    justify-content:flex-end;
  }
}



/* =========================================================
   D13 - Pago con IA por factura
   ========================================================= */

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

.pago-ia-upload{
  background:#edf5ff!important;
  color:#12355b!important;
  border-color:#c9dcef!important;
}

.pago-ia-status{
  margin:8px 12px 0;
  border-radius:10px;
  padding:8px 10px;
  background:#f2f8ff;
  color:#12355b;
  border:1px solid #cfe0f1;
  font-weight:800;
  font-size:12px;
}

.pago-ia-status.ok{
  background:#e7f6f2;
  color:#006f5f;
  border-color:#b8ded4;
}

.pago-ia-status.error{
  background:#fff1f0;
  color:#b42318;
  border-color:#ffd1cc;
}

.pago-ia-status.hidden{
  display:none!important;
}



/* =========================================================
   D14 - Pagos limpios y columna Forma pago amplia
   ========================================================= */

/* Evita que Transferencia se vea cortado */
.pagos-table th:nth-child(6),
.pagos-table td:nth-child(6){
  min-width:190px!important;
  width:190px!important;
}

.pagos-table th:nth-child(7),
.pagos-table td:nth-child(7){
  min-width:120px!important;
  width:120px!important;
}

.pagos-table select{
  min-width:100%!important;
  text-overflow:clip!important;
  padding-right:32px!important;
}

/* La tabla de pagos necesita un poco más de ancho por las columnas */
.pagos-table{
  min-width:1220px!important;
}

/* La fila vacía debe verse limpia */
.pagosRows .empty-row{
  padding:18px!important;
  color:#667085!important;
  background:#fbfcfe!important;
}

/* Botones de pagos mejor alineados */
.pagos-actions .upload,
.pagos-actions .primary{
  white-space:nowrap!important;
}



/* =========================================================
   D15 - Pago global distribuible entre facturas
   ========================================================= */

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

.pago-global-upload{
  background:#edf5ff!important;
  color:#12355b!important;
  border-color:#c9dcef!important;
}

.pago-global-modal.hidden{
  display:none!important;
}

.pago-global-modal{
  position:fixed;
  inset:0;
  z-index:1500;
}

.pago-global-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(2px);
}

.pago-global-dialog{
  position:relative;
  z-index:1;
  width:min(1180px,94vw);
  max-height:92vh;
  margin:4vh auto;
  background:#ffffff;
  border-radius:18px;
  border:1px solid #d8e4ef;
  box-shadow:0 32px 90px rgba(15,23,42,.36);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.pago-global-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:16px 18px;
  border-bottom:1px solid #e5ebf1;
  background:#ffffff;
}

.pago-global-info{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border-bottom:1px solid #e5ebf1;
  background:#fbfcfe;
}

.pago-global-info>div{
  padding:12px 16px;
  border-right:1px solid #e5ebf1;
}

.pago-global-info>div:last-child{
  border-right:0;
}

.pago-global-info span{
  display:block;
  color:#667085;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:4px;
}

.pago-global-info b{
  color:#006f5f;
  font-family:var(--mono);
  font-size:14px;
}

.pago-global-table-wrap{
  overflow:auto;
  padding:0;
}

.pago-global-table{
  min-width:980px;
}

.pago-global-table input[type="checkbox"]{
  width:18px;
  height:18px;
}

.pago-global-table .pg-monto{
  width:160px!important;
}

.pago-global-foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-top:1px solid #e5ebf1;
  background:#ffffff;
}

.pago-global-total{
  font-weight:900;
  color:#12355b;
  font-family:var(--mono);
}

@media(max-width:900px){
  .pago-global-info{
    grid-template-columns:1fr 1fr;
  }
  .pago-global-dialog{
    margin:2vh auto;
    width:96vw;
    max-height:96vh;
  }
}



/* =========================================================
   D16 - Pago global: faltante por aplicar
   ========================================================= */

.pago-global-totales{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.pago-global-faltante{
  font-weight:900;
  font-family:var(--mono);
  font-size:13px;
}

.pago-global-faltante.warn{
  color:#a15c00;
}

.pago-global-faltante.error{
  color:#b42318;
}

.pago-global-faltante.ok{
  color:#006f5f;
}

.pago-global-foot{
  align-items:flex-start!important;
}


/* D17 - Pedimento IA y conciliación */
.pedimento-upload{background:#f2f8ff!important;color:#12355b!important;border-color:#c9dcef!important}
.pedimento-modal.hidden{display:none!important}
.pedimento-modal{position:fixed;inset:0;z-index:1600}
.pedimento-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.60);backdrop-filter:blur(2px)}
.pedimento-dialog{position:relative;z-index:1;width:min(1320px,96vw);max-height:94vh;margin:3vh auto;background:#fff;border-radius:18px;border:1px solid #d8e4ef;box-shadow:0 32px 90px rgba(15,23,42,.36);overflow:hidden;display:flex;flex-direction:column}
.pedimento-head,.pedimento-foot{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:16px 18px;border-bottom:1px solid #e5ebf1;background:#fff}
.pedimento-foot{border-top:1px solid #e5ebf1;border-bottom:0;justify-content:flex-end}
.pedimento-info{display:grid;grid-template-columns:repeat(6,1fr);border-bottom:1px solid #e5ebf1;background:#fbfcfe}
.pedimento-info>div{padding:12px 14px;border-right:1px solid #e5ebf1}
.pedimento-info span{display:block;color:#667085;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px}
.pedimento-info b{color:#006f5f;font-family:var(--mono);font-size:13px}
.pedimento-table-wrap{overflow:auto;max-height:42vh}.pedimento-table{min-width:1180px}.ped-match-select{width:100%}.ped-match-reasons{margin-top:5px;color:#667085;font-size:11px}
.ped-score{display:inline-flex;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:900}.ped-score.high{background:#e7f6f2;color:#006f5f}.ped-score.mid{background:#fff7e6;color:#a15c00}.ped-score.low{background:#fff1f0;color:#b42318}
.pedimento-extra{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px 18px;overflow:auto;border-top:1px solid #e5ebf1;background:#fbfcfe}
.pedimento-extra h3{margin-bottom:8px;color:#12355b}.ped-mini-row{background:#fff;border:1px solid #dfe6ee;border-radius:10px;padding:8px 10px;margin-bottom:6px;font-size:12px}
@media(max-width:1000px){.pedimento-info{grid-template-columns:1fr 1fr}.pedimento-extra{grid-template-columns:1fr}}


/* D18 - Drag & drop y catálogo documentos MVE */
.docs-upload-zone{border:1px solid #d8e4ef;border-radius:16px;background:#fff;margin:12px 0;padding:14px;box-shadow:0 4px 14px rgba(16,24,40,.04)}
.docs-catalog-row{display:grid;grid-template-columns:minmax(280px,420px) 1fr;gap:12px;align-items:end;margin-bottom:12px}
.docs-drop-help{color:#667085;font-size:12px;line-height:1.4;padding-bottom:7px}
.docs-drop-zone{display:flex;align-items:center;gap:14px;border:2px dashed #c8d8e8;border-radius:16px;background:#f8fbff;padding:22px;transition:all .15s ease;color:#12355b}
.docs-drop-zone p{margin:3px 0 0!important}
.docs-drop-zone.drag-over{border-color:#006f5f;background:#eaf8f4;box-shadow:0 0 0 4px rgba(0,111,95,.08)}
.drop-icon{width:46px;height:46px;border-radius:14px;background:#edf5ff;border:1px solid #c9dcef;display:grid;place-items:center;font-size:24px;font-weight:900}
.tag-class{display:inline-flex;align-items:center;border-radius:999px;padding:4px 11px;font-size:11px;font-weight:850;background:#edf5ff;color:#12355b;border:1px solid #c9dcef}
.pedimento-upload{background:#f2f8ff!important;color:#12355b!important;border-color:#c9dcef!important}
.catalog-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important}
@media(max-width:850px){.docs-catalog-row{grid-template-columns:1fr}.docs-drop-zone{align-items:flex-start}}


/* D19 - Clasificación al arrastrar documentos */
.clasificar-docs-modal.hidden{display:none!important}
.clasificar-docs-modal{position:fixed;inset:0;z-index:1700}
.clasificar-docs-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.60);backdrop-filter:blur(2px)}
.clasificar-docs-dialog{position:relative;z-index:1;width:min(980px,94vw);max-height:92vh;margin:4vh auto;background:#fff;border:1px solid #d8e4ef;border-radius:18px;box-shadow:0 32px 90px rgba(15,23,42,.36);display:flex;flex-direction:column;overflow:hidden}
.clasificar-docs-head,.clasificar-docs-foot{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:16px 18px;background:#fff;border-bottom:1px solid #e5ebf1}
.clasificar-docs-foot{border-top:1px solid #e5ebf1;border-bottom:0;align-items:center}
.clasificar-docs-rows{overflow:auto;padding:14px 18px;background:#fbfcfe}
.clasificar-doc-row{display:grid;grid-template-columns:46px minmax(220px,1fr) minmax(260px,330px) minmax(220px,1fr);gap:12px;align-items:center;background:#fff;border:1px solid #dfe6ee;border-radius:14px;padding:12px;margin-bottom:10px;box-shadow:0 2px 8px rgba(16,24,40,.035)}
.clasificar-doc-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#edf8f4;color:#006f5f;border:1px solid #d4efe7;font-weight:900}
.clasificar-doc-file strong{display:block;color:#111827;font-size:13px;word-break:break-word}
.clasificar-doc-file small{color:#667085}
.clasificar-doc-desc{display:flex;flex-direction:column;gap:3px;color:#667085;font-size:12px}
.clasificar-doc-desc b{color:#12355b}
.hidden{display:none!important}
.doc-general-actions .hidden{display:none!important}
@media(max-width:900px){.clasificar-doc-row{grid-template-columns:42px 1fr}.clasificar-doc-row label,.clasificar-doc-desc{grid-column:1/-1}}


/* D20 - Pedimento: checklist MVE por identificadores */
.pedimento-checklist-box{border-top:1px solid #e5ebf1;background:#fff;padding:14px 18px;overflow:auto;max-height:25vh}
.pedimento-checklist-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-end;margin-bottom:10px}
.pedimento-checklist-head h3{color:#12355b;margin:0}
.pedimento-checklist-head p{margin:0!important;font-size:12px;color:#667085!important}
.pedimento-checklist-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
.checklist-doc{display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:flex-start;border:1px solid #dfe6ee;border-radius:14px;background:#fbfcfe;padding:11px 12px}
.checklist-doc.req{border-left:5px solid #006f5f}
.checklist-doc.opt{border-left:5px solid #98a2b3}
.check-icon{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;font-weight:900;background:#e7f6f2;color:#006f5f}
.checklist-doc.opt .check-icon{background:#f2f4f7;color:#667085}
.checklist-doc strong{display:block;color:#111827;font-weight:900;margin-bottom:3px}
.checklist-doc p{margin:0 0 5px!important;color:#344054!important;font-size:12px!important}
.checklist-doc small{color:#667085}


/* D21 - Checklist MVE con estatus de documentos subidos */
.checklist-doc.done{border-left:5px solid #12b76a!important;background:#f6fffb!important}
.checklist-doc.done .check-icon{background:#dcfae6!important;color:#067647!important}
.checkline{display:flex;justify-content:space-between;gap:8px;align-items:center}
.check-status{display:inline-flex;border-radius:999px;padding:3px 8px;font-size:10px;font-weight:900;white-space:nowrap}
.check-status.done{background:#dcfae6;color:#067647}
.check-status.pending{background:#fff1f0;color:#b42318}
.check-status.optional{background:#f2f4f7;color:#667085}


/* D22 - Checklist MVE dentro de factura */
.factura-checklist-subblock{background:linear-gradient(180deg,#ffffff,#fbfcfe)!important;border-color:#cfe0f1!important}
.factura-checklist-summary{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:10px}
.factura-checklist-summary strong{display:block;color:#12355b;font-size:13px;font-weight:900}
.factura-checklist-summary span{display:block;color:#667085;font-size:11px;margin-top:2px}
.factura-check-progress{width:220px;height:9px;background:#e8edf3;border-radius:999px;overflow:hidden}
.factura-check-progress i{display:block;height:100%;background:linear-gradient(90deg,#006f5f,#12b76a);border-radius:999px}
.factura-checklist-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px}
.factura-check-item{display:grid;grid-template-columns:28px 1fr;gap:8px;border:1px solid #dfe6ee;border-radius:12px;background:#fff;padding:9px 10px}
.factura-check-item.done{border-left:4px solid #12b76a;background:#f6fffb}
.factura-check-item.pending{border-left:4px solid #f04438;background:#fffafa}
.factura-check-item.optional{border-left:4px solid #98a2b3;background:#fbfcfe}
.fc-icon{width:24px;height:24px;border-radius:999px;display:grid;place-items:center;font-size:12px;font-weight:900;background:#e7f6f2;color:#006f5f}
.factura-check-item.pending .fc-icon{background:#fee4e2;color:#b42318}
.factura-check-item.optional .fc-icon{background:#f2f4f7;color:#667085}
.fc-line{display:flex;justify-content:space-between;gap:8px;align-items:center}
.fc-line strong{font-size:12px;color:#111827}
.fc-line span{font-size:10px;font-weight:900;border-radius:999px;padding:2px 7px;background:#edf5ff;color:#12355b;white-space:nowrap}
.factura-check-item.done .fc-line span{background:#dcfae6;color:#067647}
.factura-check-item.pending .fc-line span{background:#fee4e2;color:#b42318}
.factura-check-item.optional .fc-line span{background:#f2f4f7;color:#667085}
.factura-check-item p{margin:3px 0 0!important;font-size:11px!important;color:#667085!important;line-height:1.25!important}
@media(max-width:760px){.factura-checklist-summary{display:block}.factura-check-progress{width:100%;margin-top:8px}}


/* D23 - IA factura flete/seguro incrementables */
.incrementables-modal.hidden{display:none!important}
.incrementables-modal{position:fixed;inset:0;z-index:1800}
.incrementables-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.60);backdrop-filter:blur(2px)}
.incrementables-dialog{position:relative;z-index:1;width:min(1180px,94vw);max-height:92vh;margin:4vh auto;background:#fff;border:1px solid #d8e4ef;border-radius:18px;box-shadow:0 32px 90px rgba(15,23,42,.36);display:flex;flex-direction:column;overflow:hidden}
.incrementables-head,.incrementables-foot{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:16px 18px;background:#fff;border-bottom:1px solid #e5ebf1}
.incrementables-foot{border-top:1px solid #e5ebf1;border-bottom:0;align-items:center}
.incrementables-info{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid #e5ebf1;background:#fbfcfe}
.incrementables-info>div{padding:12px 14px;border-right:1px solid #e5ebf1}
.incrementables-info span{display:block;color:#667085;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px}
.incrementables-info b{color:#006f5f;font-family:var(--mono);font-size:13px}
.incrementables-apply{padding:14px 18px;background:#fff;border-bottom:1px solid #e5ebf1}
.incrementables-table-wrap{overflow:auto}
.incrementables-table{min-width:980px}
.incrementables-table input[type="checkbox"]{width:18px;height:18px}
.incrementables-table .inc-monto{width:140px!important}
.incrementables-table .inc-moneda{width:90px!important}
.inc-score{display:inline-flex;border-radius:999px;padding:4px 9px;background:#edf5ff;color:#12355b;font-weight:900}


/* D24 - Comparación incrementables factura vs pedimento */
.incrementables-comparacion{margin:12px 18px 0;border-radius:14px;padding:12px;border:1px solid #dfe6ee;background:#fbfcfe}
.incrementables-comparacion.hidden{display:none!important}
.incrementables-comparacion strong{display:block;font-weight:900;margin-bottom:4px}
.incrementables-comparacion p{margin:0 0 8px!important;font-size:12px!important;color:#667085!important}
.incrementables-comparacion table{width:100%;font-size:12px;border:1px solid #e5ebf1;border-radius:10px;overflow:hidden}
.incrementables-comparacion th,.incrementables-comparacion td{padding:7px 9px}
.incrementables-comparacion.ok{background:#f6fffb;border-color:#b8ded4;color:#006f5f}
.incrementables-comparacion.warn{background:#fff8e8;border-color:#f6c85f;color:#8a5700}
.incrementables-comparacion.info{background:#f2f8ff;border-color:#c9dcef;color:#12355b}
.diff-warn{color:#b42318!important;font-weight:900}


/* D25 - Prorrateo incrementables pedimento a factura */
.pedimento-prorrateo-box{border-top:1px solid #e5ebf1;background:#fbfcfe;padding:14px 18px;overflow:auto;max-height:30vh}
.pedimento-prorrateo-box.hidden{display:none!important}
.pedimento-prorrateo-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}
.pedimento-prorrateo-head h3{margin:0;color:#12355b}
.pedimento-prorrateo-head p{margin:3px 0 0!important;font-size:12px!important;color:#667085!important}
.prorrateo-total{background:#fff;border:1px solid #dfe6ee;border-radius:12px;padding:9px 11px;margin-bottom:8px;color:#12355b}
.prorrateo-table{width:100%;font-size:12px;border:1px solid #e5ebf1;border-radius:12px;overflow:hidden;background:#fff}
.prorrateo-table th,.prorrateo-table td{padding:8px 10px}
.pedimento-inc-previos{margin-top:10px;border-radius:12px;padding:10px;border:1px solid #dfe6ee;background:#fff}
.pedimento-inc-previos strong{display:block;margin-bottom:8px}
.pedimento-inc-previos.warn{background:#fff8e8;border-color:#f6c85f;color:#8a5700}
.pedimento-inc-previos.ok{background:#f6fffb;border-color:#b8ded4;color:#006f5f}
.pedimento-inc-previos table{width:100%;font-size:12px}


/* D26 - Incrementables visibles al aplicar */
.subblock:not(.collapsed) .conceptos-table-wrap,
.subblock:not(.collapsed) .conceptosRows{
  display:block;
}
.factura-card.expanded .subblock.factura-checklist-subblock + .subblock{
  scroll-margin-top:90px;
}


/* D27 - Vista de búsqueda/listado de expedientes */
.vista-expedientes{
  padding:24px;
  max-width:1320px;
  margin:0 auto;
}

.vista-exp-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}

.vista-exp-head h1{
  margin:0;
  color:#111827;
  font-size:28px;
  letter-spacing:-.02em;
}

.vista-exp-head p{
  margin:6px 0 0!important;
  color:#667085!important;
}

.exp-search-card{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:end;
  background:#ffffff;
  border:1px solid #d8e4ef;
  border-radius:16px;
  padding:16px;
  box-shadow:0 8px 24px rgba(16,24,40,.06);
  margin-bottom:16px;
}

.expedientes-home-list{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.exp-home-card{
  display:grid;
  grid-template-columns:1fr auto;
  gap:18px;
  align-items:center;
  background:#ffffff;
  border:1px solid #d8e4ef;
  border-radius:18px;
  padding:16px 18px;
  box-shadow:0 8px 24px rgba(16,24,40,.05);
}

.exp-home-card:hover{
  border-color:#b9ccdc;
  box-shadow:0 14px 34px rgba(16,24,40,.09);
}

.exp-home-title{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.exp-home-title strong{
  font-size:17px;
  color:#12355b;
  font-weight:900;
}

.status-pill{
  border-radius:999px;
  padding:4px 10px;
  background:#fff7e6;
  color:#8a5700;
  font-size:11px;
  font-weight:900;
}

.exp-home-sub{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  color:#344054;
  font-size:13px;
  margin-bottom:10px;
}

.exp-home-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.exp-home-metrics span{
  border:1px solid #dfe6ee;
  background:#fbfcfe;
  border-radius:999px;
  padding:4px 9px;
  font-size:11px;
  color:#475467;
  font-weight:800;
}

.exp-home-actions{
  display:flex;
  gap:8px;
}

.empty-expedientes{
  text-align:center;
  padding:40px 24px;
  background:#ffffff;
  border:1px dashed #c8d8e8;
  border-radius:18px;
  color:#667085;
}

.empty-expedientes h3{
  color:#12355b;
  margin-bottom:6px;
}

.hidden-editor-mve{
  display:none!important;
}

@media(max-width:760px){
  .vista-exp-head,
  .exp-home-card,
  .exp-search-card{
    grid-template-columns:1fr;
    display:grid;
  }

  .exp-home-actions{
    justify-content:flex-start;
  }
}


/* D34 - Corrección real del listado y panel izquierdo */
.app-shell{
  display:flex!important;
  min-height:100vh!important;
  width:100%!important;
}

.sidebar{
  width:230px!important;
  min-width:230px!important;
  max-width:230px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  position:sticky!important;
  top:0!important;
  height:100vh!important;
  overflow:hidden!important;
  z-index:5!important;
}

.sidebar .brand{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
}

.sidebar .nav{
  display:block!important;
  width:100%!important;
  text-align:left!important;
  white-space:nowrap!important;
}

.main{
  flex:1!important;
  min-width:0!important;
  width:auto!important;
  overflow:auto!important;
  padding:0!important;
  background:#f4f8fc!important;
}

.d34-hidden-editor{
  display:none!important;
}

body.d34-listing #vistaExpedientes{
  display:block!important;
}

body.d34-editing #vistaExpedientes{
  display:none!important;
}

/* Listado */
.vista-expedientes{
  max-width:1120px!important;
  margin:0 auto!important;
  padding:36px 28px!important;
}

.vista-exp-head{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  gap:18px!important;
  align-items:center!important;
  margin-bottom:18px!important;
}

.vista-exp-head h1{
  font-size:30px!important;
  line-height:1.1!important;
  margin:0!important;
}

.vista-exp-head p{
  color:#667085!important;
  margin-top:6px!important;
}

.exp-search-card{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  gap:12px!important;
  align-items:end!important;
  background:#fff!important;
  padding:18px!important;
  border-radius:18px!important;
  margin-bottom:18px!important;
}

.exp-search-card label{
  display:grid!important;
  grid-template-columns:130px 1fr!important;
  align-items:center!important;
  gap:12px!important;
  min-width:0!important;
}

.exp-search-card input{
  width:100%!important;
  min-width:0!important;
  height:44px!important;
}

.expedientes-home-list{
  display:grid!important;
  gap:14px!important;
}

.exp-home-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:20px!important;
  align-items:center!important;
  padding:22px 24px!important;
  border-radius:20px!important;
  min-height:112px!important;
  overflow:hidden!important;
}

.exp-home-main{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
}

.exp-home-title{
  margin:0!important;
  display:flex!important;
  gap:10px!important;
  align-items:center!important;
}

.exp-home-title strong{
  font-size:19px!important;
}

.exp-home-sub{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px 18px!important;
  margin:0!important;
  line-height:1.45!important;
  min-width:0!important;
}

.exp-home-sub span{
  white-space:normal!important;
}

.exp-home-metrics{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
}

.exp-home-actions{
  display:flex!important;
  gap:10px!important;
  align-items:center!important;
  justify-content:flex-end!important;
}

.exp-home-actions button{
  min-width:88px!important;
  height:42px!important;
}

/* Edición */
body.d34-editing .topbar{
  padding:18px!important;
  margin-bottom:0!important;
}

body.d34-editing .view.active{
  display:block!important;
}

body.d34-editing .layout{
  max-width:none!important;
  padding:18px!important;
}

#btnCerrarEdicionD34{
  margin-right:8px!important;
}

@media(max-width:900px){
  .sidebar{
    width:92px!important;
    min-width:92px!important;
  }
  .sidebar .brand strong,
  .sidebar .brand small,
  .sidebar .nav{
    font-size:12px!important;
  }
  .vista-expedientes{
    padding:24px 16px!important;
  }
  .vista-exp-head,
  .exp-search-card,
  .exp-search-card label,
  .exp-home-card{
    grid-template-columns:1fr!important;
  }
  .exp-home-actions{
    justify-content:flex-start!important;
  }
}


/* D35 - Nota deduplicación incrementables */
.ped-mini-row small{
  color:#667085;
  font-size:11px;
}


/* D36 - Acciones comparación incrementables */
.pedimento-prorrateo-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}
.danger-light{
  color:#b42318!important;
  background:#fff1f0!important;
  border:1px solid #fecdca!important;
}


/* D37 - Eliminación completa */
.danger-light,
button.danger-light{
  color:#b42318!important;
  background:#fff1f0!important;
  border:1px solid #fecdca!important;
}


/* D38 - Incrementables visibles y estado/comentarios de pagos */
.d38-inc-visible{
  margin:10px 0;
  padding:12px 14px;
  border:1px solid #b8ded4;
  background:#f6fffb;
  border-radius:14px;
}
.d38-inc-visible>strong{
  display:block;
  color:#006f5f;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:8px;
}
.d38-inc-visible>div{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.d38-inc-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid #d7efe7;
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}
.d38-inc-chip b{color:#12355b}
.d38-inc-chip span{font-family:var(--mono);font-weight:900;color:#006f5f}
.d38-inc-chip small{color:#667085}

.d38-comparacion-detalle{
  margin-top:10px;
  padding:10px;
  border-top:1px solid rgba(0,0,0,.08);
  display:grid;
  gap:5px;
}
.d38-comparacion-detalle b{
  color:#12355b;
}
.d38-comparacion-detalle span{
  display:block;
  font-size:12px;
  color:#344054;
}

.d38-estado-pago{
  min-width:120px!important;
  height:34px!important;
  padding:4px 8px!important;
  border-radius:10px!important;
}
.d38-comentario-pago{
  min-width:260px!important;
  height:34px!important;
  padding:4px 10px!important;
  border-radius:10px!important;
}


/* D39 - Render directo pagos/incrementables */
.d39-pagos-wrap,
.d39-inc-wrap{
  width:100%;
  overflow-x:auto;
}

.d39-pagos-table,
.d39-inc-table{
  width:100%;
  min-width:1120px;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}

.d39-pagos-table th,
.d39-pagos-table td,
.d39-inc-table th,
.d39-inc-table td{
  padding:8px 10px;
  border-bottom:1px solid #eef2f6;
  vertical-align:middle;
}

.d39-pagos-table input,
.d39-pagos-table select,
.d39-inc-table input,
.d39-inc-table select{
  height:34px!important;
  border-radius:10px!important;
  padding:5px 9px!important;
  font-size:12px!important;
  min-width:100px;
}

.d39-pago-comentario{
  min-width:260px!important;
}

.d39-pago-estado{
  min-width:120px!important;
  font-weight:800;
}

.d39-inc-resumen{
  margin:10px 0 12px;
  padding:12px;
  border:1px solid #b8ded4;
  background:#f6fffb;
  border-radius:14px;
}

.d39-inc-resumen>strong{
  display:block;
  font-size:12px;
  color:#006f5f;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:8px;
}

.d39-inc-resumen>div{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.d39-inc-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid #d7efe7;
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}

.d39-inc-pill b{
  color:#12355b;
}

.d39-inc-pill small{
  color:#667085;
}


/* D40 - Render real de pagos e incrementables */
.pago-estado-combo{
  min-width:120px!important;
  height:34px!important;
  border-radius:10px!important;
  padding:5px 9px!important;
  font-weight:800!important;
}

.pago-comentarios{
  min-width:260px!important;
  height:34px!important;
  border-radius:10px!important;
  padding:5px 9px!important;
}

.incrementables-resumen-visible{
  margin:10px 0 12px;
  padding:12px;
  border:1px solid #b8ded4;
  background:#f6fffb;
  border-radius:14px;
}

.incrementables-resumen-visible>strong{
  display:block;
  color:#006f5f;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:8px;
}

.incrementables-resumen-visible>div{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.incrementables-resumen-visible span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid #d7efe7;
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
}

.incrementables-resumen-visible b{
  color:#12355b;
}

.incrementables-resumen-visible small{
  color:#667085;
}


/* D41 - Empresa/importador, CSF, VUCEM y FIEL */
.empresa-panel{
  max-width:1280px;
  margin:0 auto;
}

.empresa-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}

.empresa-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.empresa-card{
  background:#fff;
  border:1px solid #d8e4ef;
  border-radius:18px;
  padding:16px;
  box-shadow:0 8px 24px rgba(16,24,40,.05);
}

.empresa-card h3{
  margin:0;
  color:#12355b;
}

.empresa-card textarea{
  width:100%;
  border:1px solid #cfd8e3;
  border-radius:12px;
  padding:10px;
  font-family:var(--font);
  resize:vertical;
}

.csf-upload-box{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:12px;
  align-items:center;
  background:#f6fffb;
  border:1px solid #b8ded4;
  border-radius:14px;
  padding:12px;
  margin:10px 0 14px;
}

.csf-upload-box p{
  margin:4px 0 0!important;
  color:#667085!important;
  font-size:12px!important;
}

.file-pill input[type="file"]{
  display:none;
}

.secure-card{
  border-left:5px solid #006f5f;
}

.secure-badge{
  display:inline-flex;
  border-radius:999px;
  background:#dcfae6;
  color:#067647;
  padding:4px 9px;
  font-size:11px;
  font-weight:900;
}

.secure-mask{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:#f2f4f7;
  color:#344054;
  font-size:12px;
  font-weight:800;
}

.empresa-status{
  margin:10px 0;
  padding:10px 12px;
  border-radius:12px;
  background:#edf5ff;
  border:1px solid #c9dcef;
  color:#12355b;
  font-weight:800;
}

.empresa-status.hidden{
  display:none!important;
}

.empresa-status.ok{
  background:#f6fffb;
  border-color:#b8ded4;
  color:#006f5f;
}

.empresa-status.error{
  background:#fff1f0;
  border-color:#fecdca;
  color:#b42318;
}

.security-list{
  display:grid;
  gap:8px;
}

.security-list div{
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
}

.security-list .ok{
  background:#f6fffb;
  border:1px solid #b8ded4;
  color:#006f5f;
}

.security-list .warn{
  background:#fff8e8;
  border:1px solid #f6c85f;
  color:#8a5700;
}

@media(min-width:980px){
  .empresa-grid{
    grid-template-columns:1.4fr 1fr;
  }
  .empresa-grid .empresa-card:first-child{
    grid-row:span 3;
  }
}

@media(max-width:760px){
  .empresa-head,
  .csf-upload-box{
    grid-template-columns:1fr;
    display:grid;
  }
}


/* D42 - Módulos internos desde menú izquierdo */
body.d34-editing #view-empresa.active,
body.d34-editing #view-catalogos.active{
  display:block!important;
}

body.d34-editing #vistaExpedientes.hidden{
  display:none!important;
}

#view-empresa.active .empresa-panel{
  display:block!important;
}


/* D43 - Vigencia FIEL */
.fiel-vigencia-box{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.fiel-vigencia-box div{
  background:#fbfcfe;
  border:1px solid #dfe6ee;
  border-radius:12px;
  padding:9px 10px;
}

.fiel-vigencia-box span{
  display:block;
  color:#667085;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:4px;
}

.fiel-vigencia-box b{
  color:#12355b;
  font-size:13px;
}

.fiel-vigencia-box b.vigente{
  color:#067647;
}

.fiel-vigencia-box b.vencida{
  color:#b42318;
}

@media(max-width:760px){
  .fiel-vigencia-box{
    grid-template-columns:1fr;
  }
}


/* D44 - Guardar FIEL separado */
.fiel-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0;
  flex-wrap:wrap;
}

.fiel-save-status{
  font-size:12px;
  color:#667085;
  font-weight:800;
}

.fiel-save-status.pending{
  color:#8a5700;
}

.fiel-save-status.saving{
  color:#12355b;
}

.fiel-save-status.ok{
  color:#067647;
}

.fiel-save-status.warn{
  color:#8a5700;
}

.fiel-save-status.error{
  color:#b42318;
}


/* D45 - Guardar clave WEB separado */
.webkey-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0;
  flex-wrap:wrap;
}

.webkey-save-status{
  font-size:12px;
  color:#667085;
  font-weight:800;
}

.webkey-save-status.pending{
  color:#8a5700;
}

.webkey-save-status.saving{
  color:#12355b;
}

.webkey-save-status.ok{
  color:#067647;
}

.webkey-save-status.error{
  color:#b42318;
}


/* D46 - Pedimento a nivel factura */
.grid.cols5.factura-grid-d46{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
}

.factura-grid-d46 [data-field="pedimento"]{
  font-family:var(--mono);
}

.factura-pedimento-chip{
  background:#eef6ff!important;
  border-color:#c9dcef!important;
  color:#12355b!important;
}

@media(max-width:1200px){
  .grid.cols5.factura-grid-d46{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .grid.cols5.factura-grid-d46{
    grid-template-columns:1fr;
  }
}


/* D48 - eDocuments VUCEM */
.edoc-panel{ margin-top:12px; }
.edoc-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.edoc-resumen{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin:12px 0;
}

.edoc-resumen div{
  border:1px solid #d8e4ef;
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
}

.edoc-resumen span{
  display:block;
  color:#667085;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.edoc-resumen b{ color:#006f5f; font-size:20px; }

.edoc-alert{
  margin:10px 0;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid #d8e4ef;
  background:#f8fafc;
}

.edoc-alert.ok{ border-color:#b8ded4; background:#f6fffb; color:#006f5f; }
.edoc-alert.warn{ border-color:#f6c85f; background:#fff8e8; color:#8a5700; }

.edoc-table{
  width:100%;
  min-width:1080px;
  border-collapse:separate;
  border-spacing:0;
}

.edoc-table th,
.edoc-table td{
  padding:9px 10px;
  border-bottom:1px solid #eef2f6;
  vertical-align:middle;
}

.badge.optional{ background:#f2f4f7; color:#475467; }

@media(max-width:900px){
  .edoc-resumen{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}


/* D49 - Catálogo VUCEM en cola eDocuments */
.edoc-vucem-select{
  width:100%;
  min-width:260px;
  height:36px;
  border-radius:10px;
  border:1px solid #cfd8e3;
  background:#fff;
  color:#1d2939;
  padding:5px 8px;
  font-size:12px;
  font-weight:700;
}

.edoc-vucem-help{
  display:block;
  color:#667085;
  margin-top:4px;
  max-width:360px;
  white-space:normal;
}


/* D50 - Catálogo VUCEM en tarjetas de documentos */
.d50-vucem-doc-box{
  margin-top:12px;
  padding:12px;
  border:1px solid #d8e4ef;
  background:#f8fafc;
  border-radius:14px;
  display:grid;
  grid-template-columns:minmax(260px,1fr) auto;
  gap:10px;
  align-items:end;
  max-width:620px;
}

.d50-vucem-doc-box label{
  display:block;
}

.d50-vucem-doc-box label span{
  display:block;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#667085;
  font-weight:900;
  margin-bottom:4px;
}

.d50-doc-vucem-select{
  width:100%;
  height:36px;
  border-radius:10px;
  border:1px solid #cfd8e3;
  background:#fff;
  color:#1d2939;
  padding:5px 8px;
  font-size:12px;
  font-weight:700;
}

.d50-vucem-doc-meta{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}

.d50-code{
  font-family:var(--mono);
  font-weight:900;
  color:#12355b;
  background:#eef6ff;
  border:1px solid #c9dcef;
  border-radius:999px;
  padding:6px 10px;
}

.d50-vucem-doc-box small{
  grid-column:1/-1;
  color:#667085;
  font-size:12px;
}

@media(max-width:760px){
  .d50-vucem-doc-box{
    grid-template-columns:1fr;
  }
  .d50-vucem-doc-meta{
    justify-content:flex-start;
  }
}


/* D51 - eDocs desde documentos generales */
.doc-card-vucem .d50-vucem-doc-box{
  margin-top:10px;
  max-width:100%;
}

.edoc-alert.warn{
  border-color:#f6c85f;
  background:#fff8e8;
  color:#8a5700;
}


/* D52 - Estilo Costeo + requisitos PDF VUCEM */
.edoc-req-tecnicos{
  margin:14px 0;
  padding:16px 18px;
  border:1px solid #d8e4ef;
  background:#fff;
  border-radius:16px;
}

.edoc-req-tecnicos h4{
  margin:0 0 10px;
  color:#12355b;
  font-size:18px;
}

.edoc-req-tecnicos ul{
  margin:0;
  padding-left:22px;
  color:#1d2939;
}

.edoc-req-tecnicos li{
  margin:8px 0;
  line-height:1.35;
}

.edoc-actions-cell{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  min-width:190px;
}

.edoc-actions-cell .tiny{
  height:30px!important;
  padding:4px 9px!important;
  border-radius:9px!important;
  font-size:11px!important;
}

.edoc-error{
  color:#b42318;
  font-weight:800;
}

.edoc-table td{
  vertical-align:top!important;
}

.edoc-table th:last-child,
.edoc-table td:last-child{
  position:sticky;
  right:0;
  background:#fff;
  z-index:2;
  box-shadow:-8px 0 12px rgba(16,24,40,.04);
}


/* D53 - Adjuntar PDF desde eDocuments */
.d53-edoc-file{
  display:none!important;
}

.d53-file-missing{
  display:inline-block;
  margin-top:4px;
  color:#8a5700;
  font-weight:800;
}

.edoc-actions-cell .primary.tiny{
  white-space:nowrap;
}


/* D54 - Storage real */
.storage-badge,
[data-storage-saved="1"]{
  background:#f6fffb;
  border:1px solid #b8ded4;
  color:#006f5f;
  border-radius:999px;
  padding:3px 8px;
  font-size:11px;
  font-weight:900;
}

/* D55 - storage test */
#btnTestStorageD55{
  border-color:#b8ded4!important;
  color:#006f5f!important;
}


/* D57 - Documentos compactos */
.d57-original-action-hidden{
  display:none!important;
}

.d57-options-holder{
  position:relative;
  display:inline-block;
  margin-left:8px;
  z-index:20;
}

.d57-options-trigger{
  height:36px;
  border:1px solid #cfe0ed;
  background:#fff;
  color:#12355b;
  border-radius:999px;
  padding:0 14px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.02em;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow:0 4px 12px rgba(16,24,40,.05);
}

.d57-options-trigger span{
  font-size:13px;
  color:#006f5f;
}

.d57-options-menu{
  display:none;
  position:absolute;
  right:0;
  top:42px;
  min-width:220px;
  background:#fff;
  border:1px solid #d8e4ef;
  border-radius:16px;
  box-shadow:0 18px 38px rgba(16,24,40,.16);
  padding:10px;
  z-index:300;
}

.d57-options-holder.open .d57-options-menu{
  display:block;
}

.d57-options-title{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#667085;
  font-weight:900;
  padding:6px 8px 8px;
  border-bottom:1px solid #eef2f6;
  margin-bottom:6px;
}

.d57-options-menu .d57-menu-action{
  width:100%;
  min-height:34px;
  border:0!important;
  background:#fff!important;
  color:#12355b!important;
  border-radius:10px!important;
  padding:8px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  font-size:12px!important;
  font-weight:800!important;
  text-align:left!important;
  box-shadow:none!important;
  margin:2px 0!important;
}

.d57-options-menu .d57-menu-action:hover{
  background:#f3f7fb!important;
}

.d57-vucem-details{
  margin-top:10px;
  border:1px solid #d8e4ef;
  border-radius:14px;
  background:#f8fafc;
  overflow:hidden;
}

.d57-vucem-details summary{
  cursor:pointer;
  padding:10px 12px;
  font-size:12px;
  font-weight:900;
  color:#12355b;
  list-style:none;
}

.d57-vucem-details summary::-webkit-details-marker{
  display:none;
}

.d57-vucem-details summary:after{
  content:'⌄';
  float:right;
  color:#006f5f;
}

.d57-vucem-details[open] summary:after{
  content:'⌃';
}

.d57-vucem-details .d50-vucem-doc-box{
  margin:0!important;
  border:0!important;
  border-top:1px solid #d8e4ef!important;
  border-radius:0!important;
  max-width:100%!important;
  background:#fff!important;
}

.doc-card-vucem.d57-compact-ready,
.doc-card.d57-compact-ready,
.mve-doc-card.d57-compact-ready,
.document-card.d57-compact-ready{
  overflow:visible!important;
}


/* D58 - Tarjetas documentos estilo CosteoBase */
.d58-docs-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(420px,1fr));
  gap:18px;
  margin-top:18px;
}

.d58-doc-card{
  border:1px solid #d7e5df;
  border-left:6px solid #16715f;
  background:#fff;
  border-radius:24px;
  overflow:hidden;
  box-shadow:0 18px 40px rgba(16,24,40,.06);
}

.d58-doc-summary{
  min-height:130px;
  padding:22px 24px;
  display:grid;
  grid-template-columns:76px 1fr auto;
  gap:20px;
  align-items:center;
  cursor:pointer;
  list-style:none;
}

.d58-doc-summary::-webkit-details-marker{
  display:none;
}

.d58-doc-icon{
  width:64px;
  height:64px;
  border-radius:20px;
  background:#eef8f4;
  color:#1c6b5c;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #d8efe7;
}

.d58-doc-title{
  font-size:22px;
  line-height:1.1;
  font-weight:950;
  color:#101828;
  margin-bottom:8px;
  max-width:520px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.d58-doc-sub{
  font-size:15px;
  color:#667085;
  line-height:1.4;
  margin-bottom:12px;
}

.d58-pills{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.d58-pills .pill{
  border-radius:999px;
  padding:7px 14px;
  font-size:12px;
  font-weight:950;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.d58-pills .pill.mve{
  border:1px solid #f4c785;
  background:#fff8ea;
  color:#8a5700;
}

.d58-pills .pill.ok{
  border:1px solid #b8ded4;
  background:#ecfbf6;
  color:#006f5f;
}

.d58-pills .pill.warn{
  border:1px solid #f6c85f;
  background:#fff8e8;
  color:#8a5700;
}

.d58-pills .pill.bad{
  border:1px solid #f5b5b0;
  background:#fff1f0;
  color:#b42318;
}

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

.d58-actions button{
  width:54px;
  height:54px;
  border-radius:50%;
  border:0;
  background:#f5f7f8;
  color:#12355b;
  font-size:19px;
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.d58-actions button:hover{
  background:#eaf1f5;
}

.d58-actions .danger{
  background:#fff1f0;
  color:#b42318;
}

.d58-actions .expand{
  background:#f7f7f2;
  color:#006f5f;
}

.d58-doc-card[open] .d58-actions .expand{
  transform:rotate(180deg);
}

.d58-doc-details{
  border-top:1px solid #eef2f6;
  padding:20px 24px 24px;
  background:#fff;
}

.d58-grid{
  display:grid;
  grid-template-columns:1.4fr .8fr .35fr .7fr;
  gap:12px;
  align-items:end;
}

.d58-grid label span{
  display:block;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#667085;
  font-weight:950;
  margin-bottom:5px;
}

.d58-grid select,
.d58-grid input{
  width:100%;
  height:40px;
  border:1px solid #d0d9e4;
  border-radius:10px;
  padding:0 12px;
  background:#fff;
  font-size:13px;
  color:#101828;
  font-weight:750;
}

.d58-grid .small input{
  text-align:center;
  font-family:var(--mono);
}

.d58-digibar{
  margin-top:16px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.d58-digibar .hash{
  color:#667085;
  font-family:var(--mono);
  font-size:12px;
  margin-right:8px;
}

.d58-digibar button{
  height:36px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid #d8e4ef;
  background:#fff;
  color:#12355b;
  font-weight:900;
  font-size:12px;
  cursor:pointer;
}

.d58-note{
  margin-top:14px;
  border:1px solid #e6edf4;
  background:#fbfcfd;
  border-radius:14px;
  padding:12px 16px;
  color:#667085;
  font-size:14px;
}

@media(max-width:900px){
  .d58-docs-grid{
    grid-template-columns:1fr;
  }
  .d58-doc-summary{
    grid-template-columns:58px 1fr;
  }
  .d58-actions{
    grid-column:1/-1;
    justify-content:flex-end;
  }
  .d58-grid{
    grid-template-columns:1fr;
  }
}


/* D59 - Tarjetas de documentos más compactas */
.d58-docs-grid{
  grid-template-columns:repeat(auto-fit,minmax(360px,1fr))!important;
  gap:12px!important;
  margin-top:12px!important;
}

.d58-doc-card{
  border-radius:18px!important;
  border-left-width:4px!important;
  box-shadow:0 10px 24px rgba(16,24,40,.045)!important;
}

.d58-doc-summary{
  min-height:92px!important;
  padding:14px 16px!important;
  grid-template-columns:52px 1fr auto!important;
  gap:12px!important;
}

.d58-doc-icon{
  width:46px!important;
  height:46px!important;
  border-radius:14px!important;
}

.d58-doc-icon svg{
  width:20px!important;
  height:20px!important;
}

.d58-doc-title{
  font-size:17px!important;
  margin-bottom:5px!important;
  max-width:360px!important;
}

.d58-doc-sub{
  font-size:12px!important;
  line-height:1.25!important;
  margin-bottom:7px!important;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.d58-pills{
  gap:6px!important;
}

.d58-pills .pill{
  padding:4px 9px!important;
  font-size:10px!important;
  letter-spacing:.04em!important;
}

.d58-actions{
  gap:7px!important;
}

.d58-actions button{
  width:38px!important;
  height:38px!important;
  font-size:14px!important;
}

.d58-doc-details{
  padding:14px 16px 16px!important;
}

.d58-grid{
  grid-template-columns:1.2fr .7fr 90px .7fr!important;
  gap:8px!important;
}

.d58-grid label span{
  font-size:9px!important;
  margin-bottom:4px!important;
}

.d58-grid select,
.d58-grid input{
  height:34px!important;
  border-radius:8px!important;
  padding:0 9px!important;
  font-size:12px!important;
}

.d58-digibar{
  margin-top:10px!important;
  gap:7px!important;
}

.d58-digibar button{
  height:30px!important;
  padding:0 11px!important;
  font-size:11px!important;
}

.d58-digibar .hash{
  font-size:11px!important;
}

.d58-note{
  margin-top:10px!important;
  padding:9px 12px!important;
  border-radius:10px!important;
  font-size:12px!important;
}

@media(max-width:900px){
  .d58-doc-summary{
    grid-template-columns:46px 1fr!important;
  }
  .d58-actions{
    grid-column:2/3!important;
    justify-content:flex-start!important;
  }
  .d58-grid{
    grid-template-columns:1fr!important;
  }
}


/* D60 - PDF VUCEM status */
.d60-pdf-vucem{
  border:1px solid #b8ded4;
  color:#006f5f;
  background:#ecfbf6;
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  font-weight:900;
}


/* D61 - eDocuments storage real */
#btnSyncStorageEdocsD61{
  border-color:#b8ded4!important;
  color:#006f5f!important;
}

.d61-size{
  color:#006f5f;
  font-weight:900;
  margin-left:4px;
}

/* D62 */
#btnRepairStorageD62{
  border-color:#f6c85f!important;
  color:#8a5700!important;
  background:#fff8e8!important;
}

/* D63 */
.d63-storage-note{
  color:#006f5f;
  font-size:11px;
  font-weight:900;
}

/* D64 */
.d64-scope-note{
  color:#006f5f;
  font-size:11px;
  font-weight:900;
}

/* D65 */
#btnExactStorageD65{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}


/* D66 - eDocuments tabla limpia */
.edoc-table.d66-edoc-table{
  min-width:1320px!important;
  table-layout:auto!important;
}

.edoc-table.d66-edoc-table th:nth-child(1),
.edoc-table.d66-edoc-table td:nth-child(1){
  width:42px!important;
  min-width:42px!important;
}

.edoc-table.d66-edoc-table th:nth-child(2),
.edoc-table.d66-edoc-table td:nth-child(2){
  width:190px!important;
  min-width:190px!important;
}

.edoc-table.d66-edoc-table th:nth-child(3),
.edoc-table.d66-edoc-table td:nth-child(3){
  width:120px!important;
  min-width:120px!important;
}

.edoc-table.d66-edoc-table th:nth-child(4),
.edoc-table.d66-edoc-table td:nth-child(4){
  width:170px!important;
  min-width:170px!important;
}

.edoc-table.d66-edoc-table th:nth-child(5),
.edoc-table.d66-edoc-table td:nth-child(5){
  width:360px!important;
  min-width:360px!important;
}

.edoc-table.d66-edoc-table th:nth-child(6),
.edoc-table.d66-edoc-table td:nth-child(6){
  width:230px!important;
  min-width:230px!important;
}

.edoc-table.d66-edoc-table th:nth-child(7),
.edoc-table.d66-edoc-table td:nth-child(7){
  width:96px!important;
  min-width:96px!important;
  text-align:center!important;
}

.edoc-table.d66-edoc-table th:nth-child(8),
.edoc-table.d66-edoc-table td:nth-child(8){
  width:115px!important;
  min-width:115px!important;
}

.edoc-table.d66-edoc-table th:nth-child(9),
.edoc-table.d66-edoc-table td:nth-child(9){
  width:120px!important;
  min-width:120px!important;
}

.edoc-table.d66-edoc-table th:nth-child(10),
.edoc-table.d66-edoc-table td:nth-child(10){
  width:170px!important;
  min-width:170px!important;
}

.d66-archivo-cell{
  white-space:normal!important;
  vertical-align:top!important;
}

.d66-file-wrap{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:5px!important;
  line-height:1.25!important;
  max-width:220px!important;
  overflow:visible!important;
}

.d66-file-wrap .badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:auto!important;
  height:auto!important;
  border-radius:999px!important;
  padding:4px 8px!important;
  font-size:10px!important;
  line-height:1.1!important;
  box-shadow:none!important;
  margin:0!important;
}

.d66-file-wrap small{
  display:block!important;
  white-space:normal!important;
  word-break:break-word!important;
  color:#475467!important;
  font-size:11px!important;
  line-height:1.25!important;
  margin:0!important;
}

.d66-file-wrap .mono{
  font-family:var(--mono)!important;
}

.d66-action-cell,
.edoc-table td.edoc-actions-cell{
  position:sticky!important;
  right:0!important;
  background:#fff!important;
  z-index:3!important;
  box-shadow:-8px 0 12px rgba(16,24,40,.04)!important;
  vertical-align:top!important;
}

.d66-action-cell .edoc-actions-cell,
.edoc-actions-cell{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:8px!important;
  min-width:145px!important;
}

.edoc-actions-cell .tiny,
.d66-action-cell .tiny{
  width:100%!important;
  min-width:128px!important;
  height:34px!important;
  padding:6px 10px!important;
  border-radius:10px!important;
  font-size:11px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
}

.edoc-table.d66-edoc-table td{
  padding-top:14px!important;
  padding-bottom:14px!important;
}

.edoc-table.d66-edoc-table .edoc-vucem-select{
  max-width:350px!important;
}

@media(max-width:900px){
  .edoc-table.d66-edoc-table{
    min-width:1180px!important;
  }
}


/* D67 - tabla eDocuments sin sobreposición */
.edoc-table.d67-edoc-table,
.edoc-table.d66-edoc-table{
  min-width:1280px!important;
  table-layout:fixed!important;
}

.edoc-table.d67-edoc-table th,
.edoc-table.d67-edoc-table td{
  position:static!important;
}

.edoc-table.d67-edoc-table th:nth-child(1),
.edoc-table.d67-edoc-table td:nth-child(1){width:44px!important;}

.edoc-table.d67-edoc-table th:nth-child(2),
.edoc-table.d67-edoc-table td:nth-child(2){width:190px!important;}

.edoc-table.d67-edoc-table th:nth-child(3),
.edoc-table.d67-edoc-table td:nth-child(3){width:130px!important;}

.edoc-table.d67-edoc-table th:nth-child(4),
.edoc-table.d67-edoc-table td:nth-child(4){width:180px!important;}

.edoc-table.d67-edoc-table th:nth-child(5),
.edoc-table.d67-edoc-table td:nth-child(5){width:360px!important;}

.edoc-table.d67-edoc-table th:nth-child(6),
.edoc-table.d67-edoc-table td:nth-child(6){width:230px!important;}

.edoc-table.d67-edoc-table th:nth-child(7),
.edoc-table.d67-edoc-table td:nth-child(7){width:90px!important;text-align:center!important;}

.edoc-table.d67-edoc-table th:nth-child(8),
.edoc-table.d67-edoc-table td:nth-child(8){width:110px!important;}

.edoc-table.d67-edoc-table th:nth-child(9),
.edoc-table.d67-edoc-table td:nth-child(9){width:110px!important;}

.edoc-table.d67-edoc-table th:nth-child(10),
.edoc-table.d67-edoc-table td:nth-child(10){width:165px!important;}

.d67-actions-td{
  background:#fff!important;
  box-shadow:none!important;
  vertical-align:top!important;
}

.d67-actions-td .edoc-actions-cell{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  min-width:140px!important;
}

.d67-actions-td .tiny{
  width:100%!important;
  min-width:128px!important;
  height:32px!important;
  border-radius:10px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}

.d67-validate-btn{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}

.d67-file-td{
  white-space:normal!important;
  overflow:visible!important;
  word-break:break-word!important;
  line-height:1.3!important;
}

.d67-file-td .badge{
  display:inline-flex!important;
  width:auto!important;
  min-width:auto!important;
  margin:2px 0!important;
  padding:4px 8px!important;
  border-radius:999px!important;
  box-shadow:none!important;
  font-size:10px!important;
}

.d67-file-td small{
  display:block!important;
  margin-top:3px!important;
  white-space:normal!important;
  word-break:break-all!important;
}

/* D68 */
.d68-storage-ok{
  color:#006f5f;
  font-size:11px;
  font-weight:900;
}


/* D69 - Progreso visible + desbloqueo */
#d69ProgressOverlay{
  position:fixed;
  inset:auto 24px 24px auto;
  z-index:99999;
  display:none;
  pointer-events:none;
}

#d69ProgressOverlay.show{
  display:block;
}

.d69-progress-card{
  min-width:320px;
  max-width:460px;
  background:#fff;
  border:1px solid #d8e4ef;
  border-left:6px solid #007a68;
  border-radius:18px;
  box-shadow:0 20px 50px rgba(16,24,40,.22);
  padding:16px 18px;
  display:flex;
  align-items:center;
  gap:14px;
}

.d69-spinner{
  width:28px;
  height:28px;
  border:4px solid #d8efe7;
  border-top-color:#007a68;
  border-radius:50%;
  animation:d69spin .9s linear infinite;
  flex:0 0 auto;
}

@keyframes d69spin{
  to{transform:rotate(360deg);}
}

#d69ProgressTitle{
  font-weight:950;
  color:#0b2440;
  font-size:15px;
  margin-bottom:3px;
}

#d69ProgressMsg{
  color:#667085;
  font-size:13px;
  line-height:1.3;
  max-width:360px;
  word-break:break-word;
}

.is-busy{
  opacity:.65!important;
  cursor:wait!important;
}


/* D70 - Semáforo + vista previa */
#edocReqTecnicos,
.edoc-req-tecnicos{
  display:none!important;
}

.edoc-table.d70-edoc-table{
  min-width:1280px!important;
  table-layout:fixed!important;
}

.edoc-table.d70-edoc-table th,
.edoc-table.d70-edoc-table td{
  position:static!important;
}

.d70-status-cell{
  vertical-align:top!important;
}

.d70-status{
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:8px 9px;
  border-radius:12px;
  border:1px solid #e6edf4;
  background:#fff;
  min-width:130px;
}

.d70-status b{
  display:block;
  font-size:12px;
  line-height:1.1;
  color:#101828;
}

.d70-status small{
  display:block;
  margin-top:3px;
  font-size:10px;
  line-height:1.25;
  color:#667085;
  max-width:150px;
}

.d70-dot{
  width:13px;
  height:13px;
  border-radius:50%;
  margin-top:1px;
  flex:0 0 auto;
  box-shadow:0 0 0 4px rgba(16,24,40,.04);
}

.d70-green{
  border-color:#b8ded4;
  background:#f6fffb;
}

.d70-green .d70-dot{
  background:#12b76a;
}

.d70-yellow{
  border-color:#f6c85f;
  background:#fff8e8;
}

.d70-yellow .d70-dot{
  background:#f79009;
}

.d70-red{
  border-color:#f5b5b0;
  background:#fff1f0;
}

.d70-red .d70-dot{
  background:#f04438;
}

.d70-action-cell .edoc-actions-cell,
.d70-action-cell{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  align-items:stretch!important;
}

.d70-action-cell .tiny{
  width:100%!important;
  min-width:130px!important;
  height:32px!important;
  border-radius:10px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}

.d70-preview-btn{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}

.edoc-table.d70-edoc-table th:nth-child(8),
.edoc-table.d70-edoc-table td:nth-child(8){
  width:185px!important;
  min-width:185px!important;
}

.edoc-table.d70-edoc-table th:nth-child(10),
.edoc-table.d70-edoc-table td:nth-child(10){
  width:165px!important;
  min-width:165px!important;
}


/* D71 - Sin Requisito y validación automática */
.d71-hide-col{
  display:none!important;
}

.edoc-table.d71-edoc-table th:nth-child(7),
.edoc-table.d71-edoc-table td:nth-child(7){
  display:none!important;
}

.edoc-table.d71-edoc-table{
  min-width:1120px!important;
  table-layout:fixed!important;
}

.edoc-table.d71-edoc-table th,
.edoc-table.d71-edoc-table td{
  position:static!important;
}

.edoc-table.d71-edoc-table th:nth-child(1),
.edoc-table.d71-edoc-table td:nth-child(1){width:44px!important;}

.edoc-table.d71-edoc-table th:nth-child(2),
.edoc-table.d71-edoc-table td:nth-child(2){width:190px!important;}

.edoc-table.d71-edoc-table th:nth-child(3),
.edoc-table.d71-edoc-table td:nth-child(3){width:130px!important;}

.edoc-table.d71-edoc-table th:nth-child(4),
.edoc-table.d71-edoc-table td:nth-child(4){width:180px!important;}

.edoc-table.d71-edoc-table th:nth-child(5),
.edoc-table.d71-edoc-table td:nth-child(5){width:350px!important;}

.edoc-table.d71-edoc-table th:nth-child(6),
.edoc-table.d71-edoc-table td:nth-child(6){width:230px!important;}

.edoc-table.d71-edoc-table th:nth-child(8),
.edoc-table.d71-edoc-table td:nth-child(8){width:190px!important;}

.edoc-table.d71-edoc-table th:nth-child(9),
.edoc-table.d71-edoc-table td:nth-child(9){width:110px!important;}

.edoc-table.d71-edoc-table th:nth-child(10),
.edoc-table.d71-edoc-table td:nth-child(10){width:165px!important;}

.d71-action-cell .edoc-actions-cell,
.d71-action-cell{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  align-items:stretch!important;
}

.d71-action-cell .tiny{
  width:100%!important;
  min-width:130px!important;
  height:32px!important;
  border-radius:10px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}

/* D72 */
.d72-pending-ok{
  color:#006f5f;
  font-size:11px;
  font-weight:900;
}


/* D73 - Pedimento fuente */
.d73-pedimento-fuente{
  border-left-color:#667085!important;
}

.d73-pedimento-fuente .pill.ok,
.d73-pedimento-fuente .badge.ok{
  background:#f2f4f7!important;
  color:#344054!important;
  border-color:#d0d5dd!important;
}

/* D75 - Enviar VUCEM */
.d75-send-btn{
  background:#007a68!important;
  color:#fff!important;
  border-color:#007a68!important;
}
.d75-package-btn{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}

/* D76 - Estatus VUCEM y sin Tipo VUCEM */
.d76-hide-col{
  display:none!important;
}

.edoc-table.d76-edoc-table th:nth-child(5),
.edoc-table.d76-edoc-table td:nth-child(5){
  display:none!important;
}

.edoc-table.d76-edoc-table{
  min-width:980px!important;
  table-layout:fixed!important;
}

.d76-envio{
  display:flex;
  gap:9px;
  align-items:flex-start;
  border:1px solid #e6edf4;
  border-radius:12px;
  padding:8px 9px;
  background:#fff;
  min-width:165px;
}

.d76-envio b{
  display:block;
  font-size:12px;
  color:#101828;
  line-height:1.15;
}

.d76-envio small{
  display:block;
  margin-top:3px;
  font-size:10px;
  color:#667085;
  line-height:1.25;
  word-break:break-word;
}

.d76-dot{
  width:13px;
  height:13px;
  border-radius:50%;
  margin-top:1px;
  flex:0 0 auto;
}

.d76-green{
  background:#f6fffb;
  border-color:#b8ded4;
}
.d76-green .d76-dot{background:#12b76a;}

.d76-yellow{
  background:#fff8e8;
  border-color:#f6c85f;
}
.d76-yellow .d76-dot{background:#f79009;}

.d76-red{
  background:#fff1f0;
  border-color:#f5b5b0;
}
.d76-red .d76-dot{background:#f04438;}

.d76-status-btn{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}

/* D77 - Consulta respuesta VUCEM */
.d77-consulta-btn{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}
.d77-edoc-num{
  color:#006f5f;
  font-family:var(--mono);
  font-size:12px;
  word-break:break-all;
}

/* D78 - Estatus VUCEM en Documentos generales */
.d78-doc-vucem-status{display:flex;gap:8px;align-items:flex-start;margin-top:8px;padding:7px 9px;border-radius:12px;border:1px solid #e6edf4;max-width:310px;background:#fff;}
.d78-doc-vucem-status b{display:block;font-size:11px;line-height:1.15;color:#101828;}
.d78-doc-vucem-status small{display:block;margin-top:2px;font-size:10px;line-height:1.2;color:#667085;word-break:break-all;}
.d78-dot{width:11px;height:11px;border-radius:50%;margin-top:1px;flex:0 0 auto;}
.d78-green{background:#f6fffb;border-color:#b8ded4;}.d78-green .d78-dot{background:#12b76a;}
.d78-yellow{background:#fff8e8;border-color:#f6c85f;}.d78-yellow .d78-dot{background:#f79009;}
.d78-red{background:#fff1f0;border-color:#f5b5b0;}.d78-red .d78-dot{background:#f04438;}
.d78-edoc-num{color:#006f5f;font-family:var(--mono);font-size:12px;word-break:break-all;}

/* D79 */
.d79-consulta-firmada{
  border-color:#b8ded4!important;
  color:#006f5f!important;
  background:#f6fffb!important;
}

/* D80 - Polling automático eDocument */
.d80-doc-vucem-status{
  display:flex;gap:8px;align-items:flex-start;margin-top:8px;padding:7px 9px;border-radius:12px;border:1px solid #e6edf4;max-width:320px;background:#fff;
}
.d80-doc-vucem-status b{display:block;font-size:11px;line-height:1.15;color:#101828;}
.d80-doc-vucem-status small{display:block;margin-top:2px;font-size:10px;line-height:1.2;color:#667085;word-break:break-all;}
.d80-dot{width:11px;height:11px;border-radius:50%;margin-top:1px;flex:0 0 auto;}
.d80-green{background:#f6fffb;border-color:#b8ded4;}.d80-green .d80-dot{background:#12b76a;}
.d80-yellow{background:#fff8e8;border-color:#f6c85f;}.d80-yellow .d80-dot{background:#f79009;}
.d80-red{background:#fff1f0;border-color:#f5b5b0;}.d80-red .d80-dot{background:#f04438;}
.d80-edoc-num{color:#006f5f;font-family:var(--mono);font-size:12px;word-break:break-all;}
.d80-final-pill{
  width:100%;text-align:center;border-radius:10px;padding:8px 10px;background:#ecfbf6;color:#006f5f;border:1px solid #b8ded4;font-weight:950;font-size:12px;
}
.d80-polling-pill{
  width:100%;text-align:center;border-radius:10px;padding:8px 10px;background:#fff8e8;color:#8a5700;border:1px solid #f6c85f;font-weight:950;font-size:11px;
}

/* D82 */
.d82-lock-pill{
  width:100%;
  text-align:center;
  border-radius:10px;
  padding:8px 10px;
  background:#f2f4f7;
  color:#344054;
  border:1px solid #d0d5dd;
  font-weight:950;
  font-size:12px;
}

/* D83 - Vista eDocuments final limpia */
.d83-edoc-table{
  min-width:1050px!important;
}

.d83-status-final,
.d83-status-pending{
  display:flex;
  gap:9px;
  align-items:flex-start;
  border-radius:14px;
  padding:9px 10px;
  min-width:175px;
}

.d83-status-final{
  background:#f6fffb;
  border:1px solid #b8ded4;
}

.d83-status-pending{
  background:#fff8e8;
  border:1px solid #f6c85f;
}

.d83-dot-green,
.d83-dot-yellow{
  width:12px;
  height:12px;
  border-radius:50%;
  margin-top:2px;
  flex:0 0 auto;
}

.d83-dot-green{background:#12b76a;}
.d83-dot-yellow{background:#f79009;}

.d83-status-final b,
.d83-status-pending b{
  display:block;
  font-size:12px;
  color:#101828;
  line-height:1.15;
}

.d83-status-final small,
.d83-status-pending small{
  display:block;
  margin-top:3px;
  font-size:10px;
  color:#667085;
  line-height:1.25;
  word-break:break-all;
}

.d83-edoc-num{
  color:#006f5f;
  font-family:var(--mono);
  font-size:12px;
  word-break:break-all;
}

.d83-file-main{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-start;
}

.d83-file-main b{
  font-size:13px;
  color:#101828;
  word-break:break-word;
}

.d83-file-pill{
  display:inline-flex;
  align-items:center;
  width:max-content;
  border-radius:999px;
  padding:4px 8px;
  background:#063b63;
  color:#fff;
  font-size:10px;
  font-weight:950;
}

.d83-tech-details{
  margin-top:8px;
  max-width:260px;
}

.d83-tech-details summary{
  cursor:pointer;
  font-size:11px;
  font-weight:900;
  color:#006f5f;
}

.d83-tech-grid{
  display:grid;
  gap:6px;
  margin-top:8px;
  padding:8px;
  background:#f8fafc;
  border:1px solid #e6edf4;
  border-radius:10px;
}

.d83-tech-grid span{
  display:block;
  font-size:9px;
  text-transform:uppercase;
  color:#667085;
  font-weight:900;
  letter-spacing:.04em;
}

.d83-tech-grid b{
  display:block;
  font-size:10px;
  color:#101828;
  word-break:break-all;
}

.d83-actions-box{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  align-items:stretch!important;
}

.d83-final-pill{
  width:100%;
  text-align:center;
  border-radius:10px;
  padding:8px 10px;
  background:#ecfbf6;
  color:#006f5f;
  border:1px solid #b8ded4;
  font-weight:950;
  font-size:12px;
}

.d83-actions-box button{
  width:100%!important;
  min-width:130px!important;
}

/* D84 - Tabla final eDocuments */
.d84-polling-status{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  border-radius:14px;
  margin:0 0 12px;
  border:1px solid #e6edf4;
  background:#fff;
}

.d84-polling-status span{
  width:11px;
  height:11px;
  border-radius:50%;
  flex:0 0 auto;
}

.d84-polling-status.active{
  background:#fff8e8;
  border-color:#f6c85f;
}

.d84-polling-status.active span{
  background:#f79009;
  box-shadow:0 0 0 4px rgba(247,144,9,.12);
}

.d84-polling-status.done{
  background:#f6fffb;
  border-color:#b8ded4;
}

.d84-polling-status.done span{
  background:#12b76a;
  box-shadow:0 0 0 4px rgba(18,183,106,.12);
}

.d84-polling-status b{
  font-size:13px;
  color:#101828;
}

.d84-polling-status small{
  color:#667085;
  font-size:12px;
}

.d84-final-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  background:#fff;
  border:1px solid #e6edf4;
  border-radius:16px;
  overflow:hidden;
}

.d84-final-table th{
  text-align:left;
  background:#f8fafc;
  color:#667085;
  font-size:11px;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding:12px 10px;
  border-bottom:1px solid #e6edf4;
}

.d84-final-table td{
  padding:14px 10px;
  vertical-align:top;
  border-bottom:1px solid #edf2f7;
  color:#101828;
  font-size:13px;
}

.d84-final-table tr:last-child td{
  border-bottom:0;
}

.d84-final-table th:nth-child(1),
.d84-final-table td:nth-child(1){width:42px;}

.d84-final-table th:nth-child(2),
.d84-final-table td:nth-child(2){width:240px;}

.d84-final-table th:nth-child(3),
.d84-final-table td:nth-child(3){width:180px;}

.d84-final-table th:nth-child(4),
.d84-final-table td:nth-child(4){width:120px;}

.d84-final-table th:nth-child(5),
.d84-final-table td:nth-child(5){width:190px;}

.d84-final-table th:nth-child(6),
.d84-final-table td:nth-child(6){width:110px;}

.d84-final-table th:nth-child(7),
.d84-final-table td:nth-child(7){width:120px;}

.d84-final-table th:nth-child(8),
.d84-final-table td:nth-child(8){width:135px;}

.d84-final-table small{
  display:block;
  color:#667085;
  font-size:11px;
  margin-top:3px;
  line-height:1.25;
}

.d84-semaforo{
  display:flex;
  gap:8px;
  align-items:flex-start;
  border-radius:12px;
  padding:8px 9px;
  border:1px solid #e6edf4;
}

.d84-semaforo > span{
  width:11px;
  height:11px;
  border-radius:50%;
  margin-top:2px;
  flex:0 0 auto;
}

.d84-semaforo b{
  display:block;
  font-size:12px;
  color:#101828;
}

.d84-semaforo small{
  font-size:10px;
}

.d84-green{
  background:#f6fffb;
  border-color:#b8ded4;
}

.d84-green > span{
  background:#12b76a;
}

.d84-yellow{
  background:#fff8e8;
  border-color:#f6c85f;
}

.d84-yellow > span{
  background:#f79009;
}

.d84-red{
  background:#fff1f0;
  border-color:#f5b5b0;
}

.d84-red > span{
  background:#f04438;
}

.d84-gray{
  background:#f8fafc;
  border-color:#e6edf4;
}

.d84-gray > span{
  background:#98a2b3;
}

.d84-op,
.d84-edoc{
  color:#006f5f;
  word-break:break-all;
  font-size:12px;
}

.d84-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.d84-actions button,
.d84-final-pill{
  width:100%!important;
  min-width:0!important;
  height:32px!important;
  border-radius:10px!important;
  font-size:11px!important;
}

.d84-final-pill{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#ecfbf6;
  color:#006f5f;
  border:1px solid #b8ded4;
  font-weight:950;
}

.d84-details{
  margin-top:8px;
}

.d84-details summary{
  cursor:pointer;
  color:#006f5f;
  font-weight:900;
  font-size:11px;
}

.d84-detail-grid{
  margin-top:8px;
  display:grid;
  grid-template-columns:1fr;
  gap:6px;
  background:#f8fafc;
  border:1px solid #e6edf4;
  border-radius:10px;
  padding:8px;
}

.d84-detail-grid span{
  display:block;
  color:#667085;
  font-size:9px;
  text-transform:uppercase;
  font-weight:900;
}

.d84-detail-grid b{
  display:block;
  color:#101828;
  font-size:10px;
  word-break:break-all;
}

@media(max-width:1000px){
  .d84-final-table{
    min-width:1050px;
  }
}

/* D96 - eDocuments estable y sin arrastre entre expedientes */
.d96-state{
  display:flex;
  align-items:flex-start;
  gap:8px;
  border-radius:12px;
  padding:8px 9px;
  border:1px solid #e6edf4;
  background:#f8fafc;
  min-width:150px;
}

.d96-state > span{
  width:10px;
  height:10px;
  border-radius:50%;
  margin-top:2px;
  flex:0 0 auto;
  background:#98a2b3;
}

.d96-state b{
  display:block;
  font-size:12px;
  color:#101828;
  line-height:1.1;
}

.d96-state small{
  display:block;
  font-size:10px;
  color:#667085;
  margin-top:2px;
  line-height:1.15;
}

.d96-state.ok{
  background:#f6fffb;
  border-color:#b8ded4;
}

.d96-state.ok > span{
  background:#12b76a;
}

.d96-state.warn{
  background:#fff8e8;
  border-color:#f6c85f;
}

.d96-state.warn > span{
  background:#f79009;
}

.d96-state.bad{
  background:#fff1f0;
  border-color:#f5b5b0;
}

.d96-state.bad > span{
  background:#f04438;
}

.d96-edoc{
  color:#006f5f;
  word-break:break-all;
  font-size:12px;
}

.d96-actions{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.d96-actions button,
.d96-final-pill{
  width:100%;
  min-width:110px;
  height:32px;
  border-radius:10px;
  font-size:11px;
}

.d96-final-pill{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#ecfbf6;
  color:#006f5f;
  border:1px solid #b8ded4;
  font-weight:950;
}

.d96-mini-details{
  margin-top:6px;
}

.d96-mini-details summary{
  cursor:pointer;
  color:#006f5f;
  font-size:11px;
  font-weight:900;
}

.d96-mini-details div{
  font-size:10px;
  color:#667085;
  word-break:break-all;
  margin-top:3px;
}

.d96-cuenta-ok{
  background:#f6fffb!important;
  border-color:#12b76a!important;
  box-shadow:inset 4px 0 0 #12b76a!important;
}

/* D96: ocultar restos visuales de parches anteriores */
.d78-doc-vucem-status,
.d80-doc-vucem-status,
.d83-status-final,
.d83-status-pending,
.d86-doc-vucem-status,
.d88-doc-status,
.d89-doc-status,
.d91-status,
.d92-status{
  display:none!important;
}

/* D97 - Documentos/eDocuments por expediente actual */
.d97-doc-card{
  display:grid;
  grid-template-columns:54px 1fr auto;
  gap:14px;
  align-items:center;
  border:1px solid #d9e7e2;
  border-left:4px solid #006f5f;
  border-radius:18px;
  padding:18px;
  background:#fff;
  box-shadow:0 8px 22px rgba(16,24,40,.04);
  min-height:112px;
}

.d97-doc-icon{
  width:42px;
  height:42px;
  border-radius:13px;
  background:#ecfbf6;
  border:1px solid #c7eadf;
  color:#006f5f;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:900;
}

.d97-doc-main h4{
  margin:0 0 4px;
  font-size:16px;
  color:#101828;
  word-break:break-word;
}

.d97-doc-main p{
  margin:0;
  color:#667085;
  font-size:12px;
}

.d97-doc-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}

.d97-badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  font-weight:950;
  border:1px solid #d0d5dd;
  background:#f2f4f7;
  color:#344054;
}

.d97-badge.ok{
  background:#ecfbf6;
  color:#006f5f;
  border-color:#b8ded4;
}

.d97-badge.muted{
  background:#f8fafc;
  color:#667085;
}

.d97-doc-actions{
  display:flex;
  gap:8px;
}

.d97-state{
  display:flex;
  align-items:flex-start;
  gap:8px;
  border-radius:12px;
  padding:8px 9px;
  border:1px solid #e6edf4;
  background:#f8fafc;
  min-width:150px;
}

.d97-state > span{
  width:10px;
  height:10px;
  border-radius:50%;
  margin-top:2px;
  flex:0 0 auto;
  background:#98a2b3;
}

.d97-state b{
  display:block;
  font-size:12px;
  color:#101828;
  line-height:1.1;
}

.d97-state small{
  display:block;
  font-size:10px;
  color:#667085;
  margin-top:2px;
  line-height:1.15;
}

.d97-state.ok{
  background:#f6fffb;
  border-color:#b8ded4;
}

.d97-state.ok > span{
  background:#12b76a;
}

.d97-state.warn{
  background:#fff8e8;
  border-color:#f6c85f;
}

.d97-state.warn > span{
  background:#f79009;
}

.d97-state.bad{
  background:#fff1f0;
  border-color:#f5b5b0;
}

.d97-state.bad > span{
  background:#f04438;
}

.d97-edoc{
  color:#006f5f;
  word-break:break-all;
  font-size:12px;
}

.d97-actions{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.d97-actions button,
.d97-final-pill{
  width:100%;
  min-width:110px;
  height:32px;
  border-radius:10px;
  font-size:11px;
}

.d97-final-pill{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#ecfbf6;
  color:#006f5f;
  border:1px solid #b8ded4;
  font-weight:950;
}

/* D98 - ocultar y eliminar grid viejo D58 */
#d58DocsGrid{
  display:none!important;
}

.d98-doc-card{
  display:grid;
  grid-template-columns:54px 1fr auto;
  gap:14px;
  align-items:center;
  border:1px solid #d9e7e2;
  border-left:4px solid #006f5f;
  border-radius:18px;
  padding:18px;
  background:#fff;
  box-shadow:0 8px 22px rgba(16,24,40,.04);
  min-height:112px;
}

.d98-doc-icon{
  width:42px;
  height:42px;
  border-radius:13px;
  background:#ecfbf6;
  border:1px solid #c7eadf;
  color:#006f5f;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:900;
}

.d98-doc-main h4{
  margin:0 0 4px;
  font-size:16px;
  color:#101828;
  word-break:break-word;
}

.d98-doc-main p{
  margin:0;
  color:#667085;
  font-size:12px;
}

.d98-doc-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}

.d98-badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  font-weight:950;
  border:1px solid #d0d5dd;
  background:#f2f4f7;
  color:#344054;
}

.d98-badge.ok{
  background:#ecfbf6;
  color:#006f5f;
  border-color:#b8ded4;
}

.d98-badge.muted{
  background:#f8fafc;
  color:#667085;
}

.d98-doc-actions{
  display:flex;
  gap:8px;
}

/* ===========================
   D106 - Layout limpio Documentos/eDocuments
   =========================== */
body.d34-editing #view-expedientes .layout{
  display:block!important;
  padding:8px 10px 18px!important;
}
body.d34-editing #view-expedientes .layout > .panel:first-child{
  display:none!important;
}
body.d34-editing #view-expedientes .layout > .panel.detail{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0!important;
}
body.d34-editing #expedienteEditor{width:100%!important;}
body.d34-editing .editor-head{
  position:sticky;
  top:0;
  z-index:20;
  background:#fffefa;
  border-radius:12px;
}
#docsGeneralesList.d106-docs-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
  align-items:start!important;
}
.d106-doc-card{
  position:relative;
  display:grid;
  grid-template-columns:46px 1fr auto;
  gap:14px;
  min-height:104px!important;
  height:auto!important;
  padding:16px!important;
  border:1px solid #d7e2ee;
  border-left:4px solid #087464;
  border-radius:14px;
  background:#fff;
  box-shadow:none!important;
}
.d106-doc-icon{
  width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background:#ecfdf5;border:1px solid #c7f0df;color:#087464;font-weight:900;
}
.d106-doc-main h4{margin:0 0 4px;font-size:15px;line-height:1.25;word-break:break-word;color:#07162d;}
.d106-doc-main p{margin:0 0 8px;font-size:12px;color:#536174;}
.d106-doc-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px;}
.d106-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:800;border:1px solid #dbe5f1;background:#f8fafc;color:#475569;}
.d106-badge.ok{background:#ecfdf5;border-color:#bbf7d0;color:#065f46;}
.d106-badge.warn,.d106-badge.ready{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.d106-badge.bad{background:#fef2f2;border-color:#fecaca;color:#991b1b;}
.d106-vucem-box{margin-top:8px;padding:10px;border:1px solid #dbeafe;background:#f8fbff;border-radius:12px;max-width:100%;}
.d106-vucem-box label{display:block;margin:0;}
.d106-vucem-box label span{display:block;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#475569;margin-bottom:5px;}
.d106-vucem-box select{width:100%;min-height:36px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:6px 10px;font-size:12px;font-weight:700;}
.d106-vucem-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px;font-size:11px;color:#536174;}
.d106-vucem-meta span{border:1px solid #bfdbfe;background:#eff6ff;color:#0b4a7c;border-radius:999px;padding:4px 9px;font-weight:900;}
.d106-doc-actions{display:flex;gap:8px;align-items:flex-start;}
.d106-edoc-state{display:inline-flex;align-items:flex-start;gap:4px;flex-direction:column;border-radius:10px;padding:8px 10px;border:1px solid #dbe5f1;background:#f8fafc;color:#334155;min-width:150px;}
.d106-edoc-state.ok{background:#ecfdf5;border-color:#a7f3d0;color:#065f46;}
.d106-edoc-state.warn,.d106-edoc-state.ready{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.d106-edoc-state.bad{background:#fef2f2;border-color:#fecaca;color:#991b1b;}
.d106-edoc-state small{font-size:11px;font-weight:500;opacity:.75;}
.d106-final-pill{display:inline-flex;border-radius:10px;padding:6px 10px;background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46;font-weight:900;font-size:12px;}
.d106-edoc-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.d106-edoc-code{color:#087464;}
@media(max-width:1100px){#docsGeneralesList.d106-docs-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:720px){#docsGeneralesList.d106-docs-grid{grid-template-columns:1fr!important;}.d106-doc-card{grid-template-columns:40px 1fr;}.d106-doc-actions{grid-column:1/-1;}}

/* ===========================
   D107 - Layout estable sin saltos
   =========================== */
body.d107-editing #view-expedientes .layout{
  display:block!important;
  padding:8px 10px 18px!important;
}
body.d107-editing #view-expedientes .layout > .panel:first-child{
  display:none!important;
}
body.d107-editing #view-expedientes .layout > .panel.detail{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0!important;
}
body.d107-editing #expedienteEditor{width:100%!important;}
body.d107-editing .editor-head{
  position:sticky;
  top:0;
  z-index:20;
  background:#fffefa;
  border-radius:12px;
}
#docsGeneralesList.d107-docs-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
  align-items:start!important;
}
.d107-doc-card{
  position:relative;
  display:grid;
  grid-template-columns:46px 1fr auto;
  gap:14px;
  min-height:104px!important;
  height:auto!important;
  padding:16px!important;
  border:1px solid #d7e2ee;
  border-left:4px solid #087464;
  border-radius:14px;
  background:#fff;
  box-shadow:none!important;
}
.d107-doc-icon{
  width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background:#ecfdf5;border:1px solid #c7f0df;color:#087464;font-weight:900;
}
.d107-doc-main h4{margin:0 0 4px;font-size:15px;line-height:1.25;word-break:break-word;color:#07162d;}
.d107-doc-main p{margin:0 0 8px;font-size:12px;color:#536174;}
.d107-doc-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px;}
.d107-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:800;border:1px solid #dbe5f1;background:#f8fafc;color:#475569;}
.d107-badge.ok{background:#ecfdf5;border-color:#bbf7d0;color:#065f46;}
.d107-badge.warn,.d107-badge.ready{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.d107-badge.bad{background:#fef2f2;border-color:#fecaca;color:#991b1b;}
.d107-vucem-box{margin-top:8px;padding:10px;border:1px solid #dbeafe;background:#f8fbff;border-radius:12px;max-width:100%;}
.d107-vucem-box label{display:block;margin:0;}
.d107-vucem-box label span{display:block;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#475569;margin-bottom:5px;}
.d107-vucem-box select{width:100%;min-height:36px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:6px 10px;font-size:12px;font-weight:700;}
.d107-vucem-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px;font-size:11px;color:#536174;}
.d107-vucem-meta span{border:1px solid #bfdbfe;background:#eff6ff;color:#0b4a7c;border-radius:999px;padding:4px 9px;font-weight:900;}
.d107-doc-actions{display:flex;gap:8px;align-items:flex-start;}
.d107-edoc-state{display:inline-flex;align-items:flex-start;gap:4px;flex-direction:column;border-radius:10px;padding:8px 10px;border:1px solid #dbe5f1;background:#f8fafc;color:#334155;min-width:150px;}
.d107-edoc-state.ok{background:#ecfdf5;border-color:#a7f3d0;color:#065f46;}
.d107-edoc-state.warn,.d107-edoc-state.ready{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.d107-edoc-state.bad{background:#fef2f2;border-color:#fecaca;color:#991b1b;}
.d107-edoc-state small{font-size:11px;font-weight:500;opacity:.75;}
.d107-final-pill{display:inline-flex;border-radius:10px;padding:6px 10px;background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46;font-weight:900;font-size:12px;}
.d107-edoc-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.d107-edoc-code{color:#087464;}
@media(max-width:1100px){#docsGeneralesList.d107-docs-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:720px){#docsGeneralesList.d107-docs-grid{grid-template-columns:1fr!important;}.d107-doc-card{grid-template-columns:40px 1fr;}.d107-doc-actions{grid-column:1/-1;}}

/* D109 - eDocuments render único sin decoradores post-render */
.d109-state{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;border:1px solid #d8e4ef;background:#f8fbff;min-width:150px}
.d109-state>span{width:10px;height:10px;border-radius:999px;background:#94a3b8;flex:0 0 auto}
.d109-state b{display:block;font-size:12px;color:#0f172a}
.d109-state small{display:block;font-size:11px;color:#64748b;margin-top:1px}
.d109-green{background:#ecfdf5;border-color:#a7f3d0}.d109-green>span{background:#10b981}
.d109-yellow{background:#fffbeb;border-color:#fde68a}.d109-yellow>span{background:#f59e0b}
.d109-red{background:#fef2f2;border-color:#fecaca}.d109-red>span{background:#ef4444}
.d109-gray{background:#f8fafc;border-color:#e2e8f0}.d109-gray>span{background:#94a3b8}
.d109-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.d109-final-pill{display:inline-flex;align-items:center;justify-content:center;border:1px solid #a7f3d0;background:#ecfdf5;color:#065f46;border-radius:10px;padding:6px 10px;font-weight:800;font-size:12px}
.d109-edoc-row td{vertical-align:top}

/* ===========================
   D113 - Documentos generales tabla fija sin VUCEM
   =========================== */
#tab-documentos #docsGeneralesList.mve-d113-docs-host{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  padding:0 !important;
  margin:14px 0 0 0 !important;
  overflow:visible !important;
  grid-template-columns:none !important;
  align-items:initial !important;
}
#tab-documentos #docsGeneralesList.mve-d113-docs-host .mve-d113-table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  border:1px solid #d8e3ef !important;
  border-radius:14px !important;
  background:#fff !important;
}
#tab-documentos #docsGeneralesList.mve-d113-docs-host .mve-d113-doc-table{
  width:100% !important;
  min-width:860px !important;
  table-layout:fixed !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
  margin:0 !important;
  background:#fff !important;
}
.mve-d113-doc-table th{
  background:#f4f7fb !important;
  color:#58677c !important;
  font-size:11px !important;
  line-height:1.2 !important;
  letter-spacing:.08em !important;
  text-transform:uppercase !important;
  font-weight:900 !important;
  padding:12px 12px !important;
  border-bottom:1px solid #d8e3ef !important;
  text-align:left !important;
  white-space:nowrap !important;
}
.mve-d113-doc-table td{
  background:#fff !important;
  color:#09203f !important;
  font-size:13px !important;
  line-height:1.25 !important;
  padding:12px 12px !important;
  border-bottom:1px solid #e7edf5 !important;
  vertical-align:middle !important;
  word-break:break-word !important;
  overflow:visible !important;
}
.mve-d113-doc-table tr:last-child td{border-bottom:0 !important;}
.mve-d113-doc-table th:nth-child(1), .mve-d113-doc-table td:nth-child(1){width:48px !important;text-align:center !important;}
.mve-d113-doc-table th:nth-child(2), .mve-d113-doc-table td:nth-child(2){width:34% !important;}
.mve-d113-doc-table th:nth-child(3), .mve-d113-doc-table td:nth-child(3){width:24% !important;}
.mve-d113-doc-table th:nth-child(4), .mve-d113-doc-table td:nth-child(4){width:110px !important;}
.mve-d113-doc-table th:nth-child(5), .mve-d113-doc-table td:nth-child(5){width:130px !important;}
.mve-d113-doc-table th:nth-child(6), .mve-d113-doc-table td:nth-child(6){width:170px !important;}
.mve-d113-doc-table small{font-size:10px !important;color:#66758a !important;}
.mve-d113-num{color:#62728a !important;font-weight:900 !important;}
.mve-d113-badge{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:80px !important;
  padding:4px 9px !important;
  border-radius:999px !important;
  border:1px solid #d8e3ef !important;
  font-size:10px !important;
  font-weight:900 !important;
  background:#f8fafc !important;
  color:#334155 !important;
}
.mve-d113-ok{background:#ecfdf5 !important;border-color:#a7f3d0 !important;color:#047857 !important;}
.mve-d113-ready{background:#eff6ff !important;border-color:#bfdbfe !important;color:#1d4ed8 !important;}
.mve-d113-warn{background:#fffbeb !important;border-color:#fde68a !important;color:#92400e !important;}
.mve-d113-bad{background:#fef2f2 !important;border-color:#fecaca !important;color:#b91c1c !important;}
.mve-d113-neutral{background:#f8fafc !important;border-color:#d8e3ef !important;color:#475569 !important;}
.mve-d113-actions{
  display:flex !important;
  gap:6px !important;
  align-items:center !important;
  white-space:nowrap !important;
}
.mve-d113-actions button{margin:0 !important;padding:7px 10px !important;font-size:11px !important;}
.mve-d113-empty{border:1px solid #d8e3ef !important;border-radius:12px !important;padding:16px !important;background:#fff !important;}


/* ===========================
   D114 - Ajuste final tabla Documentos + modal Pago
   =========================== */
#tab-documentos #docsGeneralesList.mve-d113-docs-host,
#tab-documentos #docsGeneralesList.mve-d108-docs-host{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
}
#tab-documentos #docsGeneralesList .mve-d113-table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
}
#tab-documentos #docsGeneralesList .mve-d113-doc-table{
  width:100% !important;
  min-width:980px !important;
  table-layout:fixed !important;
}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th,
#tab-documentos #docsGeneralesList .mve-d113-doc-table td{
  height:auto !important;
  min-height:0 !important;
  padding:10px 12px !important;
  vertical-align:middle !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(1),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(1){width:48px !important;}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(2),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(2){width:38% !important;}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(3),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(3){width:24% !important;}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(4),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(4){width:120px !important;}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(5),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(5){width:140px !important;}
#tab-documentos #docsGeneralesList .mve-d113-doc-table th:nth-child(6),
#tab-documentos #docsGeneralesList .mve-d113-doc-table td:nth-child(6){width:190px !important;}
#btnGuardarPagoSinAplicarD114{margin-right:8px !important;}


/* D116 - Documentos generales deduplicados y tabla estable */
.mve-d116-docs-host{width:100%;max-width:none;overflow:visible!important;}
.mve-d116-table-wrap{width:100%;max-width:100%;overflow-x:auto!important;border:1px solid #d9e4ef;border-radius:14px;background:#fff;}
.mve-d116-doc-table{width:100%;min-width:980px;table-layout:auto;border-collapse:collapse;}
.mve-d116-doc-table th,.mve-d116-doc-table td{white-space:normal;vertical-align:middle;}
.mve-d116-doc-table th:nth-child(1),.mve-d116-doc-table td:nth-child(1){width:48px;}
.mve-d116-doc-table th:nth-child(2),.mve-d116-doc-table td:nth-child(2){min-width:330px;}
.mve-d116-doc-table th:nth-child(3),.mve-d116-doc-table td:nth-child(3){min-width:220px;}
.mve-d116-doc-table th:nth-child(4),.mve-d116-doc-table td:nth-child(4){width:150px;}
.mve-d116-doc-table th:nth-child(5),.mve-d116-doc-table td:nth-child(5){width:150px;}
.mve-d116-doc-table th:nth-child(6),.mve-d116-doc-table td:nth-child(6){width:210px;}
.mve-d116-doc-table .mve-d113-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;}


/* D118 - Tabs finales aislados de listeners legacy */
.mve-d118-tab{
  background:#ffffff!important;
  border:1px solid #d7e0ea!important;
  color:#344054!important;
  border-radius:999px!important;
  font-weight:850!important;
  box-shadow:0 1px 2px rgba(16,24,40,.04)!important;
  padding:8px 14px!important;
}
.mve-d118-tab.active{
  background:#12355b!important;
  border-color:#12355b!important;
  color:#ffffff!important;
  box-shadow:0 8px 18px rgba(18,53,91,.18)!important;
}

/* D123 - Mejora visual modal Conciliar Pedimento */
.pedimento-dialog-v123{
  width:min(1460px,96vw)!important;
  height:min(900px,94vh)!important;
  max-height:94vh!important;
  margin:3vh auto!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  background:#f8fafc!important;
}

.pedimento-head-v123{
  flex:0 0 auto!important;
  align-items:center!important;
  padding:14px 18px!important;
  background:linear-gradient(180deg,#ffffff,#fbfdff)!important;
}

.pedimento-head-v123 h2{margin:0 0 4px!important;color:#0b1f3a!important;font-size:18px!important;letter-spacing:.01em}
.pedimento-head-v123 p{margin:0!important;color:#667085!important;font-size:12px!important}

.pedimento-info-v123{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:10px!important;
  padding:12px 14px!important;
  border-bottom:1px solid #dfe7f0!important;
  background:#f4f8fc!important;
}

.pedimento-info-v123>div{
  border:1px solid #d9e4ef!important;
  border-left:4px solid #00866f!important;
  border-radius:12px!important;
  padding:10px 12px!important;
  background:#fff!important;
  min-width:0!important;
  box-shadow:0 2px 8px rgba(16,24,40,.035)!important;
}

.pedimento-info-v123 span{
  display:block!important;
  margin-bottom:5px!important;
  color:#667085!important;
  font-size:10px!important;
  line-height:1.1!important;
  font-weight:900!important;
  text-transform:uppercase!important;
  letter-spacing:.06em!important;
}

.pedimento-info-v123 b{
  display:block!important;
  color:#006f5f!important;
  font-family:var(--mono)!important;
  font-size:13px!important;
  line-height:1.25!important;
  overflow-wrap:anywhere!important;
}

.pedimento-body-v123{
  flex:1 1 auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:minmax(680px,1.45fr) minmax(360px,.75fr)!important;
  gap:12px!important;
  padding:12px!important;
  overflow:hidden!important;
  background:#eef4fa!important;
}

.pedimento-main-v123,
.pedimento-side-v123{
  min-height:0!important;
  overflow:auto!important;
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  padding-right:2px!important;
}

.pedimento-section-v123{
  background:#fff!important;
  border:1px solid #d8e4ef!important;
  border-radius:14px!important;
  box-shadow:0 6px 18px rgba(16,24,40,.045)!important;
  overflow:hidden!important;
}

.pedimento-section-head-v123{
  display:flex!important;
  justify-content:space-between!important;
  align-items:flex-start!important;
  gap:12px!important;
  padding:12px 14px!important;
  border-bottom:1px solid #e5edf4!important;
  background:#fbfdff!important;
}

.pedimento-section-head-v123 h3,
.pedimento-section-v123 h3{
  margin:0!important;
  color:#12355b!important;
  font-size:14px!important;
  font-weight:900!important;
}

.pedimento-section-head-v123 p{
  margin:3px 0 0!important;
  color:#667085!important;
  font-size:12px!important;
}

.pedimento-table-wrap-v123{
  max-height:260px!important;
  overflow:auto!important;
  border-top:0!important;
  background:#fff!important;
}

.pedimento-table{
  width:100%!important;
  min-width:1080px!important;
  border-collapse:separate!important;
  border-spacing:0!important;
  font-size:12px!important;
}

.pedimento-table thead th{
  position:sticky!important;
  top:0!important;
  z-index:2!important;
  background:#f5f8fb!important;
  color:#56647a!important;
  text-transform:uppercase!important;
  letter-spacing:.05em!important;
  font-size:10px!important;
  border-bottom:1px solid #dfe7f0!important;
  padding:10px 10px!important;
}

.pedimento-table tbody td{
  padding:10px!important;
  border-bottom:1px solid #e8eef5!important;
  vertical-align:middle!important;
}

.ped-match-select{
  min-height:34px!important;
  border-radius:10px!important;
  font-size:12px!important;
}

.ped-match-reasons{
  margin-top:5px!important;
  font-size:11px!important;
  color:#667085!important;
  white-space:normal!important;
}

.ped-score{
  min-width:48px!important;
  justify-content:center!important;
}

.pedimento-extra-card-v123{
  padding:12px!important;
  max-height:160px!important;
  overflow:auto!important;
}

.pedimento-extra-card-v123 h3{margin-bottom:8px!important}

.ped-mini-row{
  border-radius:10px!important;
  padding:8px 9px!important;
  margin-bottom:6px!important;
  line-height:1.35!important;
}

.pedimento-checklist-v123{
  padding:12px!important;
  max-height:none!important;
  overflow:visible!important;
  border-top:1px solid #d8e4ef!important;
}

.pedimento-checklist-v123 .pedimento-checklist-head{
  display:block!important;
  margin-bottom:10px!important;
}

.pedimento-checklist-v123 .pedimento-checklist-head p{
  margin-top:4px!important;
  font-size:11px!important;
  line-height:1.35!important;
}

.pedimento-checklist-v123 .pedimento-checklist-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}

.pedimento-checklist-v123 .checklist-doc{
  grid-template-columns:30px 1fr!important;
  gap:8px!important;
  padding:9px 10px!important;
  border-radius:12px!important;
}

.pedimento-checklist-v123 .check-icon{
  width:24px!important;
  height:24px!important;
  font-size:12px!important;
}

.pedimento-checklist-v123 .checkline{
  align-items:flex-start!important;
}

.pedimento-checklist-v123 .checklist-doc strong{
  font-size:12px!important;
}

.pedimento-checklist-v123 .checklist-doc p,
.pedimento-checklist-v123 .checklist-doc small{
  font-size:11px!important;
  line-height:1.35!important;
}

.pedimento-prorrateo-v123{
  padding:0!important;
  max-height:none!important;
  overflow:visible!important;
}

.pedimento-prorrateo-v123 .pedimento-prorrateo-head{
  padding:12px 14px!important;
  margin:0!important;
  border-bottom:1px solid #e5edf4!important;
  background:#fff!important;
}

.pedimento-prorrateo-v123 #pedimentoProrrateoResumen{
  padding:12px 14px!important;
}

.pedimento-prorrateo-actions{
  flex-shrink:0!important;
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.pedimento-foot-v123{
  flex:0 0 auto!important;
  align-items:center!important;
  padding:12px 18px!important;
  background:#ffffff!important;
  box-shadow:0 -10px 25px rgba(16,24,40,.06)!important;
  z-index:3!important;
}

.pedimento-foot-v123 .secondary,
.pedimento-foot-v123 .primary{
  min-height:38px!important;
  border-radius:12px!important;
}

body.mve-modal-open{
  overflow:hidden!important;
}

@media(max-width:1180px){
  .pedimento-body-v123{grid-template-columns:1fr!important;overflow:auto!important}
  .pedimento-main-v123,.pedimento-side-v123{overflow:visible!important}
  .pedimento-info-v123{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .pedimento-table-wrap-v123{max-height:320px!important}
}

@media(max-width:760px){
  .pedimento-dialog-v123{width:98vw!important;height:96vh!important;margin:2vh auto!important;border-radius:14px!important}
  .pedimento-info-v123{grid-template-columns:1fr 1fr!important;gap:8px!important;padding:10px!important}
  .pedimento-body-v123{padding:10px!important}
  .pedimento-foot-v123{display:grid!important;grid-template-columns:1fr!important}
  .pedimento-foot-v123 button{width:100%!important}
}


/* D124 - acciones en checklist de factura */
.factura-checklist-grid-d124 .factura-check-item{align-items:flex-start;}
.factura-checklist-grid-d124 .fc-body-d124{min-width:0;}
.factura-checklist-grid-d124 .fc-action-d124{margin-top:8px;padding:6px 10px;font-size:11px;line-height:1;white-space:nowrap;}
.factura-checklist-grid-d124 .factura-check-item.pending .fc-action-d124{border-color:#b9d7ff;background:#f7fbff;}


/* D125 - Modal incrementables con prorrateo por FOB */
.incrementables-mode-d125{
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap:10px;
  width:100%;
  margin:0 0 12px;
}
.incrementables-mode-d125 .d125-radio{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border:1px solid #cfe0f2;
  border-radius:12px;
  background:#f8fbff;
  font-weight:800;
  color:#0b2a4a;
}
.incrementables-preview-d125{
  grid-column:1 / -1;
  border:1px solid #d9e6f5;
  border-radius:12px;
  padding:10px;
  background:#fff;
  max-height:210px;
  overflow:auto;
}
.d125-prorrateo-title{margin-bottom:8px;color:#0b2a4a;}
.d125-prorrateo-table{width:100%;border-collapse:collapse;font-size:12px;}
.d125-prorrateo-table th,.d125-prorrateo-table td{border-bottom:1px solid #e3edf7;padding:7px;text-align:left;vertical-align:top;}
.d125-prorrateo-table th{background:#f3f7fc;text-transform:uppercase;letter-spacing:.04em;color:#526070;}
.d125-prorrateo-table .right{text-align:right;}
@media(max-width:900px){.incrementables-mode-d125{grid-template-columns:1fr;}}


/* D126 - checklist incrementables sin botón de carga directo */
.fc-action-d124[data-d124-check-action="subir-incrementable"],
[data-d124-check-action="subir-incrementable"]{
  display:none !important;
}
.factura-check-item.pending .fc-body-d124 p[data-d126-rewritten="1"]{
  color:#52627a;
}


/* =========================================================
   D128 - ancho cómodo en pagos e incrementables
   ========================================================= */
.factura-card.expanded .pagos-block .table-wrap,
.factura-card.expanded .d39-pagos-wrap,
.factura-card.expanded .d39-inc-wrap{
  overflow-x:auto!important;
  width:100%!important;
}

/* Pagos al proveedor: evitar que "Transferencia" se corte */
.pagos-table,
.d39-pagos-table{
  min-width:1500px!important;
  table-layout:fixed!important;
}
.pagos-table th:nth-child(1), .pagos-table td:nth-child(1),
.d39-pagos-table th:nth-child(1), .d39-pagos-table td:nth-child(1){width:42px!important;}
.pagos-table th:nth-child(2), .pagos-table td:nth-child(2),
.d39-pagos-table th:nth-child(2), .d39-pagos-table td:nth-child(2){width:190px!important;}
.pagos-table th:nth-child(3), .pagos-table td:nth-child(3),
.d39-pagos-table th:nth-child(3), .d39-pagos-table td:nth-child(3){width:150px!important;}
.pagos-table th:nth-child(4), .pagos-table td:nth-child(4),
.d39-pagos-table th:nth-child(4), .d39-pagos-table td:nth-child(4){width:145px!important;}
.pagos-table th:nth-child(5), .pagos-table td:nth-child(5),
.d39-pagos-table th:nth-child(5), .d39-pagos-table td:nth-child(5){width:150px!important;}
.pagos-table th:nth-child(6), .pagos-table td:nth-child(6),
.d39-pagos-table th:nth-child(6), .d39-pagos-table td:nth-child(6){width:200px!important;min-width:200px!important;}
.pagos-table th:nth-child(7), .pagos-table td:nth-child(7),
.d39-pagos-table th:nth-child(7), .d39-pagos-table td:nth-child(7){width:110px!important;}
.pagos-table th:nth-child(8), .pagos-table td:nth-child(8),
.d39-pagos-table th:nth-child(8), .d39-pagos-table td:nth-child(8){width:155px!important;}
.pagos-table th:nth-child(9), .pagos-table td:nth-child(9),
.d39-pagos-table th:nth-child(9), .d39-pagos-table td:nth-child(9){width:150px!important;}
.pagos-table th:nth-child(10), .pagos-table td:nth-child(10),
.d39-pagos-table th:nth-child(10), .d39-pagos-table td:nth-child(10){width:300px!important;}
.pagos-table th:nth-child(11), .pagos-table td:nth-child(11),
.d39-pagos-table th:nth-child(11), .d39-pagos-table td:nth-child(11){width:54px!important;}

.pagos-table select,
.d39-pagos-table select,
.d39-pago-forma{
  min-width:170px!important;
  width:100%!important;
  max-width:none!important;
  padding-right:34px!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
.d39-pago-estado,
.pago-estado-combo{min-width:130px!important;}
.d39-pago-comentario,
.pago-comentarios{min-width:280px!important;width:100%!important;}

/* Incrementables: columnas más legibles */
.d39-inc-table,
.incrementables-table,
.conceptos-table{
  min-width:1280px!important;
  table-layout:fixed!important;
}
.d39-inc-table th:nth-child(1), .d39-inc-table td:nth-child(1),
.incrementables-table th:nth-child(1), .incrementables-table td:nth-child(1),
.conceptos-table th:nth-child(1), .conceptos-table td:nth-child(1){width:220px!important;}
.d39-inc-table th:nth-child(2), .d39-inc-table td:nth-child(2),
.incrementables-table th:nth-child(2), .incrementables-table td:nth-child(2),
.conceptos-table th:nth-child(2), .conceptos-table td:nth-child(2){width:320px!important;}
.d39-inc-table th:nth-child(3), .d39-inc-table td:nth-child(3),
.incrementables-table th:nth-child(3), .incrementables-table td:nth-child(3),
.conceptos-table th:nth-child(3), .conceptos-table td:nth-child(3){width:170px!important;}
.d39-inc-table th:nth-child(4), .d39-inc-table td:nth-child(4),
.incrementables-table th:nth-child(4), .incrementables-table td:nth-child(4),
.conceptos-table th:nth-child(4), .conceptos-table td:nth-child(4){width:130px!important;}
.d39-inc-table th:nth-child(5), .d39-inc-table td:nth-child(5),
.incrementables-table th:nth-child(5), .incrementables-table td:nth-child(5),
.conceptos-table th:nth-child(5), .conceptos-table td:nth-child(5){width:165px!important;}
.d39-inc-table th:nth-child(6), .d39-inc-table td:nth-child(6){width:240px!important;}
.d39-inc-table th:nth-child(7), .d39-inc-table td:nth-child(7){width:54px!important;}

.d39-inc-table input,
.d39-inc-table select,
.incrementablesRows input,
.incrementablesRows select{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  height:36px!important;
  font-size:12px!important;
}
.d39-inc-tipo{min-width:190px!important;}
.d39-inc-concepto{min-width:280px!important;}
.d39-inc-moneda{min-width:90px!important;text-transform:uppercase;}
.d39-inc-monto{min-width:140px!important;}


/* D138 - carga física solo en Documentos generales */
.d138-disabled-upload{display:none!important;}
.docsFacturaList .doc-item{background:#f8fafc;border:1px solid #d9e4f2;border-radius:12px;padding:10px 12px;margin:8px 0;}
.ia-status.d138-factura-status{margin:10px 0;padding:10px 12px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff;color:#0f3c76;font-weight:700;}
.ia-status.d138-factura-status.ok{border-color:#99f6e4;background:#ecfdf5;color:#047857;}
.ia-status.d138-factura-status.error{border-color:#fecaca;background:#fff1f2;color:#b91c1c;}

/* D140 - catálogo VUCEM visible en modal de clasificación */
.clasificar-doc-row.d140-vucem-row{
  grid-template-columns:46px minmax(210px,1.1fr) minmax(240px,.9fr) minmax(260px,1fr) minmax(260px,1fr) !important;
  align-items:center;
}
.d140-vucem-wrap select,.d140-doc-tipo-wrap select{width:100%;}
.d140-doc-desc small{display:block;margin-top:3px;font-size:11px;color:#667085;line-height:1.25;}
@media(max-width:1100px){
  .clasificar-doc-row.d140-vucem-row{grid-template-columns:42px 1fr !important;}
  .clasificar-doc-row.d140-vucem-row label,.clasificar-doc-row.d140-vucem-row .clasificar-doc-desc{grid-column:1/-1;}
}

/* D146 - VUCEM unificado en Documentos generales */
#tab-edocuments,
button[data-tab="edocuments"],
button[data-d118-tab="edocuments"],
.mve-d118-tab[data-d118-tab="edocuments"]{display:none!important;}
.d146-rfc-consulta-field{display:block;min-width:240px;}
.d146-doc-note{margin:0 0 10px 0;}
.mve-d146-table-wrap{overflow-x:auto;border-radius:14px;border:1px solid #d9e5f2;background:#fff;}
.mve-d146-doc-table{width:100%;min-width:1180px;border-collapse:collapse;table-layout:auto;}
.mve-d146-doc-table th{white-space:nowrap;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#56657a;background:#f5f8fc;padding:12px 14px;border-bottom:1px solid #d9e5f2;text-align:left;}
.mve-d146-doc-table td{padding:14px;border-bottom:1px solid #e6edf5;vertical-align:middle;}
.mve-d146-doc-table td:nth-child(2){min-width:260px;}
.mve-d146-doc-table td:nth-child(4){min-width:160px;}
.mve-d146-doc-table td:nth-child(6){min-width:165px;}
.d146-doc-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-width:210px;}
.d146-doc-actions .tiny{min-width:76px;}
.badge.muted{background:#eef2f7;color:#546275;border:1px solid #d9e2ee;}
.bad-text{color:#b42318;font-weight:700;}


/* =========================================================
   D147 - Documentos compactos + catálogo A.A.
   ========================================================= */
.mve-d147-docs-host{width:100%;overflow:hidden;}
.d147-doc-toolbar-note{margin:0 0 10px;padding:10px 14px;border:1px solid #d7e5f3;border-radius:12px;background:#f7fbff;color:#334155;font-size:13px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.d147-doc-toolbar-note.ok{background:#eefbf6;border-color:#b7ead8;color:#006b55;}
.d147-doc-toolbar-note.muted{background:#f8fafc;border-color:#d7e5f3;color:#52637a;}
.d147-doc-table-wrap{width:100%;overflow-x:auto;border:1px solid #d7e5f3;border-radius:14px;background:#fff;}
.d147-doc-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:13px;}
.d147-doc-table th{background:#f4f7fb;color:#53627a;text-transform:uppercase;letter-spacing:.08em;font-size:11px;font-weight:800;text-align:left;padding:12px 10px;border-bottom:1px solid #dbe7f3;white-space:nowrap;}
.d147-doc-table td{padding:12px 10px;border-bottom:1px solid #e5edf6;vertical-align:middle;}
.d147-doc-table tbody tr:last-child td{border-bottom:none;}
.d147-doc-table tbody tr:hover{background:#fbfdff;}
.d147-col-num{width:42px;text-align:center;color:#0b2b55;font-weight:800;}
.d147-doc-name{width:32%;min-width:260px;}
.d147-doc-name b{display:block;color:#001d3d;font-size:14px;line-height:1.25;white-space:normal;overflow-wrap:anywhere;}
.d147-doc-name small,.d147-doc-type small,.d147-doc-status small{display:block;color:#64748b;font-size:11px;line-height:1.35;margin-top:2px;overflow-wrap:anywhere;}
.d147-doc-type{width:20%;min-width:180px;}
.d147-doc-type>b{display:block;font-weight:700;color:#0f2442;margin-bottom:4px;}
.d147-vucem-code{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;}
.d147-code{display:inline-flex;align-items:center;justify-content:center;min-width:42px;padding:4px 8px;border-radius:999px;background:#eef6ff;border:1px solid #cfe2ff;color:#06447d;font-weight:800;}
.d147-no-aplica{display:inline-flex;padding:4px 8px;border-radius:999px;background:#eef2f7;border:1px solid #dce4ee;color:#475569;font-weight:800;}
.d147-doc-relation{width:12%;min-width:110px;color:#0f2442;font-weight:700;}
.d147-doc-status{width:16%;min-width:170px;}
.d147-status{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:5px 12px;font-weight:800;font-size:12px;border:1px solid transparent;}
.d147-status-ok{background:#e9fbf2;color:#007e66;border-color:#a9ecd5;}
.d147-status-warn{background:#fff7e8;color:#9a5b00;border-color:#ffd99a;}
.d147-status-bad{background:#fff1f1;color:#b91c1c;border-color:#ffc6c6;}
.d147-status-ready{background:#eff6ff;color:#0b55c8;border-color:#bfdbfe;}
.d147-doc-actions{width:18%;min-width:210px;display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.d147-doc-actions button{min-width:74px;}
.d147-aa-field{min-width:260px;}
.d147-aa-select-line{display:flex;gap:8px;align-items:center;}
.d147-aa-select-line select{flex:1;min-width:180px;}
#opAgenteAduanalHint{display:block;margin-top:4px;color:#64748b;font-size:11px;line-height:1.25;}
.d147-aa-catalog-panel{margin-top:16px;}
.d147-aa-form{display:grid;grid-template-columns:1.2fr .7fr 1fr 1fr .9fr auto;gap:12px;align-items:end;border:1px solid #d7e5f3;background:#fbfdff;padding:14px;border-radius:14px;margin:12px 0;}
.d147-aa-form label{display:flex;flex-direction:column;gap:6px;}
.d147-aa-form label span{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#53627a;}
.d147-aa-form input,.d147-aa-form select{height:40px;border:1px solid #cbdbea;border-radius:10px;padding:0 10px;background:#fff;}
.d147-aa-list{display:grid;gap:8px;}
.d147-aa-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #d7e5f3;border-radius:12px;background:#fff;}
.d147-aa-item b{display:block;color:#0b2b55;}
.d147-aa-item small{display:block;color:#64748b;margin-top:3px;line-height:1.35;}
@media (max-width:1100px){
  .d147-doc-table{min-width:980px;}
  .d147-aa-form{grid-template-columns:1fr 1fr;}
  .d147-aa-form button{grid-column:1/-1;}
}


/* D148 - Borrador de envío MVE */
.d148-mve-draft{white-space:normal;font-family:inherit;background:transparent;border:0;padding:0;color:#1b2a3a;}
.d148-draft-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px;padding:14px 16px;border:1px solid #d9e4ef;border-radius:14px;background:#f8fbff;}
.d148-draft-head h3{margin:0 0 4px;font-size:18px;}
.d148-draft-head p{margin:0;color:#5f6f80;font-size:13px;}
.d148-draft-status{white-space:nowrap;}
.d148-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;background:#eef3f8;color:#43566b;font-size:12px;font-weight:700;margin:2px;}
.d148-badge.ok{background:#e8f7ef;color:#176c3b;}
.d148-badge.warn{background:#fff4db;color:#8a5b00;}
.d148-badge.bad{background:#ffe8e8;color:#9c1f1f;}
.d148-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0 16px;}
.d148-card{border:1px solid #d9e4ef;background:#fff;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:5px;min-height:94px;}
.d148-card b{font-size:13px;color:#172435;}
.d148-card span{font-size:12px;color:#4d5d6d;line-height:1.25;word-break:break-word;}
.d148-validation{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:10px 0 18px;}
.d148-validation>div{border:1px solid #d9e4ef;border-radius:12px;padding:12px;background:#fff;}
.d148-validation>div.bad{border-color:#ffc6c6;background:#fff8f8;}
.d148-validation>div.warn{border-color:#ffe1a5;background:#fffaf0;}
.d148-validation>div.ok{border-color:#bfe9ce;background:#f7fff9;}
.d148-validation b{display:block;margin-bottom:6px;}
.d148-validation p,.d148-validation ul{margin:0;font-size:13px;}
.d148-validation ul{padding-left:18px;}
.d148-table-wrap{overflow:auto;border:1px solid #d9e4ef;border-radius:12px;background:#fff;margin:8px 0 16px;}
.d148-table{width:100%;border-collapse:collapse;font-size:12px;}
.d148-table th{background:#f3f7fb;color:#33475b;text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.02em;padding:9px 10px;border-bottom:1px solid #d9e4ef;white-space:nowrap;}
.d148-table td{padding:9px 10px;border-bottom:1px solid #eef3f7;vertical-align:top;}
.d148-table tr:last-child td{border-bottom:0;}
.d148-table tr.muted td{color:#7b8998;background:#fafbfc;}
.d148-doc-summary{margin:4px 0 8px;}
.d148-json{border:1px dashed #c9d7e4;border-radius:12px;background:#fbfdff;padding:10px 12px;margin-top:12px;}
.d148-json summary{font-weight:700;cursor:pointer;}
.d148-json pre{font-size:11px;max-height:360px;overflow:auto;background:#0e1726;color:#e9f2ff;padding:12px;border-radius:10px;}
.d148-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px;}
.ok-text{color:#176c3b;}.warn-text{color:#8a5b00;}.bad-text{color:#9c1f1f;}
@media(max-width:1100px){.d148-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.d148-validation{grid-template-columns:1fr;}}
@media(max-width:720px){.d148-grid{grid-template-columns:1fr;}.d148-draft-head{flex-direction:column;}.d148-actions{justify-content:flex-start;flex-wrap:wrap;}}


/* =========================================================
   D150 - Borrador MVE robusto + auditoria visual
   ========================================================= */
#tab-mve .section-head{align-items:center;gap:12px;flex-wrap:wrap}
.d150-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.d150-draft{display:flex;flex-direction:column;gap:14px}
.d150-banner{border:1px solid #bfe7da;background:#f0fff9;color:#006b5b;border-radius:14px;padding:12px 14px;font-weight:800}
.d150-banner.warn{border-color:#ffdf9b;background:#fff9e8;color:#875c00}
.d150-banner.bad{border-color:#ffb5b5;background:#fff2f2;color:#8a1111}
.d150-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.d150-card{border:1px solid #d7e5f5;border-radius:14px;background:#fff;padding:12px;box-shadow:0 4px 14px rgba(10,45,85,.04);min-height:92px}
.d150-card b{display:block;margin-bottom:8px;color:#0b2b4f;font-size:13px;letter-spacing:.02em}
.d150-card span{display:block;color:#51657c;font-size:12px;line-height:1.35;margin:3px 0;word-break:break-word}
.d150-card strong{font-size:18px;color:#006b5b}
.d150-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.d150-panel{border:1px solid #d7e5f5;border-radius:14px;background:#fff;padding:12px}
.d150-panel h4{margin:0 0 8px;font-size:13px;color:#0b2b4f}.d150-panel ul{margin:6px 0 0 18px;padding:0}.d150-panel li{margin:4px 0;color:#344960}
.d150-table-wrap{border:1px solid #d7e5f5;border-radius:14px;overflow:auto;background:#fff}.d150-table{width:100%;border-collapse:collapse;font-size:12px;min-width:850px}.d150-table th{background:#f3f7fb;color:#58687d;text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.05em;padding:10px 12px;border-bottom:1px solid #dbe7f3}.d150-table td{padding:11px 12px;border-bottom:1px solid #edf2f7;vertical-align:top}.d150-table tr:last-child td{border-bottom:0}.d150-muted{color:#8290a3}.d150-ok{color:#00856f;font-weight:900}.d150-warn{color:#9b6500;font-weight:900}.d150-bad{color:#b42318;font-weight:900}.d150-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:4px}.d150-json{border:1px solid #d7e5f5;border-radius:14px;background:#fff;padding:12px}.d150-json pre{white-space:pre-wrap;word-break:break-word;max-height:300px;overflow:auto;background:#f6f9fc;border-radius:10px;padding:12px}.d150-audit-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.d150-audit-item{border:1px solid #d7e5f5;border-radius:12px;padding:10px;background:#fff}.d150-audit-item b{display:block;font-size:12px;color:#0b2b4f}.d150-audit-item span{font-size:18px;font-weight:900;color:#006b5b}
@media(max-width:1200px){.d150-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.d150-two{grid-template-columns:1fr}.d150-audit-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.d150-grid,.d150-audit-list{grid-template-columns:1fr}}


/* =========================================================
   D157 - Limpieza segura pre-siguiente etapa
   ========================================================= */
button[data-tab="edocuments"],
button[data-d118-tab="edocuments"],
#tab-edocuments,
[data-tab-content="edocuments"]{
  display:none !important;
}
.d157-mve-status-card{
  margin:14px 0;
  padding:16px;
  border:1px solid #d7e3f2;
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,42,70,.05);
}
.d157-mve-status-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}
.d157-mve-status-head h4{
  margin:0 0 4px;
  font-size:15px;
}
.d157-mve-status-head p{
  margin:0;
  color:#5b6b82;
  font-size:12px;
}
.d157-status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 12px;
  border-radius:999px;
  background:#eef6ff;
  border:1px solid #b8d8ff;
  font-weight:800;
  color:#0f4c81;
  white-space:nowrap;
}
.d157-status-pill.ok{
  background:#eafaf2;
  border-color:#9de2bd;
  color:#007a54;
}
.d157-status-pill.bad{
  background:#fff0f0;
  border-color:#ffc4c4;
  color:#b42318;
}
.d157-mve-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.d157-mve-grid .box{
  background:#f8fbff;
  border:1px solid #e1ebf7;
  border-radius:12px;
  padding:10px 12px;
}
.d157-mve-grid .box span{
  display:block;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#607089;
  font-size:10px;
  font-weight:800;
  margin-bottom:4px;
}
.d157-mve-grid .box b{
  color:#06213d;
  font-size:13px;
  word-break:break-word;
}
.d157-audit-panel{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px dashed #bcd0e7;
  background:#fbfdff;
}
.d157-audit-panel pre{
  margin:8px 0 0;
  white-space:pre-wrap;
  max-height:280px;
  overflow:auto;
  font-size:11px;
}
@media(max-width:1100px){.d157-mve-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* D165 - Módulo Embarques CargoWise integrado */
.cw-shipments-table th,
.cw-shipments-table td{font-size:13px;vertical-align:top}
.cw-pill{display:inline-block;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#243c96;font-weight:700;font-size:12px}
.cw-actions{display:flex;gap:8px;flex-wrap:wrap}
.cw-mini{font-size:12px;color:#667085;margin-top:4px}
.sidebar .nav[href]{box-sizing:border-box;width:100%;border:0;background:transparent;color:inherit;padding:12px 14px;border-radius:12px;margin:4px 0;font:inherit;cursor:pointer}
.sidebar .nav[href]:hover{background:rgba(255,255,255,.08)}

/* D166 Shipment-MVE link */
.cw-pill.ok{background:#e6f7f1;color:#067647;border-color:#abefc6;}
.cw-actions{display:flex;gap:8px;align-items:center;}
