/* =========================================================
   DPUNTO STOCK · UX/UI v40
   Capa de sistema visual unificada sobre la lógica existente.
   ========================================================= */

.ux-v40{
  --ux-navy:#0d1621;
  --ux-navy-soft:#172534;
  --ux-blue:#518dcf;
  --ux-blue-dark:#4071a7;
  --ux-blue-soft:#eef4fb;
  --ux-canvas:#f4f7fa;
  --ux-surface:#ffffff;
  --ux-surface-2:#f8fafc;
  --ux-border:#dee3e9;
  --ux-border-strong:#ccd3db;
  --ux-text:#18222e;
  --ux-muted:#6c7885;
  --ux-success:#37714e;
  --ux-success-bg:#ecf6f0;
  --ux-warning:#84662e;
  --ux-warning-bg:#fdf6e4;
  --ux-danger:#9a463f;
  --ux-danger-bg:#fdf1ef;
  --ux-radius-sm:10px;
  --ux-radius:14px;
  --ux-radius-lg:20px;
  --ux-shadow:0 10px 28px rgba(13,22,33,.055);
  --ux-shadow-float:0 18px 48px rgba(13,22,33,.14);
  --ux-max:1320px;
  background:var(--ux-canvas);
  color:var(--ux-text);
}

.ux-v40 .container,
.ux-v40 .header-inner{width:min(calc(100% - 56px),var(--ux-max));}
.ux-v40 .page-shell{padding:36px 0 68px;}
.ux-v40 h1,.ux-v40 h2,.ux-v40 h3{letter-spacing:-.025em;}
.ux-v40 h1{font-size:clamp(2rem,3vw,3.15rem);}
.ux-v40 h2{font-size:clamp(1.35rem,2vw,1.85rem);}
.ux-v40 .eyebrow{margin-bottom:8px;font-size:.72rem;letter-spacing:.14em;color:var(--ux-blue-dark);}
.ux-v40 .lead{color:var(--ux-muted);max-width:760px;}
.ux-v40 .fine,.ux-v40 .muted,.ux-v40 .hint{color:var(--ux-muted);}

/* ---------- Header / marca / navegación ---------- */
.ux-v40 .header{
  background:rgba(255,255,255,.97);
  border-bottom:1px solid var(--ux-border);
  box-shadow:none;
  backdrop-filter:saturate(140%) blur(12px);
}
.ux-v40 .header-inner{min-height:76px;height:76px;gap:24px;}
.ux-v40 .brand{gap:13px;}
.ux-v40 .brand img{width:125px;max-height:47px;}
.ux-v40 .brand-divider{height:25px;border-color:var(--ux-border-strong);}
.ux-v40 .brand-caption{font-size:.7rem;letter-spacing:.12em;color:#747e88;}
.ux-v40 .header-actions{display:flex;align-items:center;gap:12px;margin-left:auto;min-width:0;height:100%;}
.ux-v40 .header-search-link{
  display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 13px;
  border:1px solid var(--ux-border);border-radius:11px;background:var(--ux-surface-2);
  color:#425060;font-size:.82rem;font-weight:800;transition:.16s ease;
}
.ux-v40 .header-search-link>span:first-child{font-size:1.12rem;line-height:1;}
.ux-v40 .header-search-link:hover,.ux-v40 .header-search-link.is-active{border-color:#bad1eb;background:var(--ux-blue-soft);color:var(--ux-blue-dark);}
.ux-v40 .top-nav{display:flex;align-items:center;gap:5px;height:100%;}
.ux-v40 .top-nav>a,
.ux-v40 .top-nav .nav-group>summary,
.ux-v40 .top-nav .nav-group[open]>summary{
  display:inline-flex;align-items:center;justify-content:center;align-self:center;gap:6px;line-height:1;
  min-height:40px;height:40px;padding:0 11px;border:0;border-radius:10px;
  color:#44515f;font-size:.84rem;font-weight:760;
}
.ux-v40 .top-nav .nav-group{display:flex;align-items:center;height:40px;}
.ux-v40 .top-nav .nav-group>summary::after{display:inline-flex;align-items:center;line-height:1;transform:translateY(1px);}
.ux-v40 .top-nav>a:hover,
.ux-v40 .top-nav>a[aria-current=page],
.ux-v40 .top-nav .nav-group>summary:hover,
.ux-v40 .top-nav .nav-group>summary[aria-current=page],
.ux-v40 .top-nav .nav-group[open]>summary{
  background:var(--ux-blue-soft);color:var(--ux-blue-dark);border:0;
}
.ux-v40 .top-nav .nav-group{height:40px;}
.ux-v40 .top-nav .nav-dropdown,
.ux-v40 .top-nav .nav-group[open]>.nav-dropdown{
  top:calc(100% + 10px);width:238px;min-width:238px;padding:7px;
  border:1px solid var(--ux-border);border-radius:14px;box-shadow:var(--ux-shadow-float);
}
.ux-v40 .top-nav .nav-dropdown>a{padding:10px 11px;border-radius:9px;font-size:.84rem;}
.ux-v40 .top-nav .nav-dropdown>a:hover,.ux-v40 .top-nav .nav-dropdown>a[aria-current=page]{background:var(--ux-blue-soft);color:var(--ux-blue-dark);}
.ux-v40 .top-nav .nav-dropdown .logout{margin-top:4px;padding-top:7px;border-color:var(--ux-border);}
.ux-v40 .top-nav .nav-dropdown .logout button{min-height:38px;padding:8px 10px;border-radius:9px;background:#f3f6f8;color:#596470;}
.ux-v40 .nav-toggle{border:1px solid var(--ux-border);border-radius:11px;background:#ffffff;}

/* ---------- Cabeceras y botones ---------- */
.ux-v40 .page-heading{align-items:flex-end;margin-bottom:28px;}
.ux-v40 .page-heading h1{margin-bottom:10px;}
.ux-v40 .btn{
  min-height:42px;padding:10px 16px;border-radius:10px;gap:9px;font-size:.86rem;font-weight:800;
  transition:transform .14s ease,box-shadow .14s ease,background .14s ease,border-color .14s ease;
}
.ux-v40 .btn.primary{background:var(--ux-blue);box-shadow:0 5px 14px rgba(81,141,207,.16);}
.ux-v40 .btn.primary:hover{background:var(--ux-blue-dark);box-shadow:0 7px 18px rgba(81,141,207,.22);}
.ux-v40 .btn.outline{border-color:var(--ux-border-strong);background:#ffffff;}
.ux-v40 .btn.outline:hover{border-color:#a5c1e2;background:#f8fcff;}
.ux-v40 .text-link{border:0;color:var(--ux-blue-dark);}

/* ---------- Formularios ---------- */
.ux-v40 input:not([type=checkbox]):not([type=hidden]),
.ux-v40 textarea,
.ux-v40 select{
  min-height:44px;margin-top:6px;padding:9px 11px;border:1px solid var(--ux-border-strong);
  border-radius:10px;background:#ffffff;color:var(--ux-text);transition:border-color .15s,box-shadow .15s;
}
.ux-v40 input:not([type=checkbox]):not([type=hidden]):focus,
.ux-v40 textarea:focus,.ux-v40 select:focus{border-color:#95b8df;box-shadow:0 0 0 3px rgba(81,141,207,.11);outline:0;}
.ux-v40 label.field,.ux-v40 label.search-field,.ux-v40 .filters label,
.ux-v40 .upload-form label,.ux-v40 .user-form label,.ux-v40 .answer-form label,
.ux-v40 .message-form label,.ux-v40 .commit-form label{font-size:.78rem;color:#495462;}

/* ---------- Avisos ---------- */
.ux-v40 .alert,.ux-v40 .notice{
  border-radius:12px;box-shadow:none;border-width:1px;
}
.ux-v40 .alert{padding:13px 16px;}
.ux-v40 .alert:not(.error){border-color:#c4dfcd;background:var(--ux-success-bg);color:var(--ux-success);}
.ux-v40 .alert.error{border-color:#e8c3bf;background:var(--ux-danger-bg);color:var(--ux-danger);}
.ux-v40 .global-flash{position:relative;animation:uxFlashIn .2s ease both;}
@keyframes uxFlashIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

/* ---------- Superficies ---------- */
.ux-v40 .panel-box,.ux-v40 .create-card,.ux-v40 .table-shell,
.ux-v40 .stage-card,.ux-v40 .auth-card,.ux-v40 .excel-panel,
.ux-v40 .pending-shell,.ux-v40 .global-search-shell{
  border-color:var(--ux-border);box-shadow:var(--ux-shadow);border-radius:var(--ux-radius-lg);
}

/* =========================================================
   RESUMEN
   ========================================================= */
.ux-v40 .page-shell.dashboard .page-heading{margin-bottom:20px;}
.ux-v40 .dashboard-command{display:grid;gap:18px;margin-bottom:30px;}
.ux-v40 .dashboard-status-band{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));background:#ffffff;border:1px solid var(--ux-border);
  border-radius:var(--ux-radius-lg);overflow:hidden;box-shadow:var(--ux-shadow);
}
.ux-v40 .dashboard-status-band>div{min-height:116px;padding:20px 23px;display:grid;align-content:center;gap:2px;border-right:1px solid var(--ux-border);}
.ux-v40 .dashboard-status-band>div:last-child{border-right:0;}
.ux-v40 .dashboard-status-band span{font-size:.77rem;font-weight:800;color:var(--ux-muted);text-transform:uppercase;letter-spacing:.06em;}
.ux-v40 .dashboard-status-band b{font-size:2rem;line-height:1.1;letter-spacing:-.05em;}
.ux-v40 .dashboard-status-band small{font-size:.76rem;color:#889099;}
.ux-v40 .dashboard-status-band .is-good{background:linear-gradient(180deg,#f8fcf9 0%,#ffffff 100%);}
.ux-v40 .dashboard-status-band .is-good span,.ux-v40 .dashboard-status-band .is-good small{color:var(--ux-success);}
.ux-v40 .dashboard-status-band .is-defect{background:linear-gradient(180deg,#fef8f7 0%,#ffffff 100%);}
.ux-v40 .dashboard-status-band .is-defect span,.ux-v40 .dashboard-status-band .is-defect small{color:var(--ux-danger);}
.ux-v40 .dashboard-status-band .is-good b,.ux-v40 .dashboard-status-band .is-defect b{color:var(--ux-text);}
.ux-v40 .dashboard-primary-actions{
  display:grid;grid-template-columns:minmax(190px,.58fr) minmax(0,1.8fr);gap:20px;align-items:center;
  padding:22px 24px;background:linear-gradient(135deg,var(--ux-navy),var(--ux-navy-soft));color:#ffffff;border-radius:var(--ux-radius-lg);
  box-shadow:0 16px 38px rgba(13,22,33,.12);
}
.ux-v40 .dashboard-primary-actions .eyebrow{color:#8cb4e2;}
.ux-v40 .dashboard-primary-actions h2{margin:0;color:#ffffff;}
.ux-v40 .dashboard-action-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.ux-v40 .dashboard-action{
  min-width:0;min-height:88px;padding:14px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;
  border:1px solid rgba(255,255,255,.13);border-radius:13px;background:rgba(255,255,255,.065);transition:.15s ease;
}
.ux-v40 .dashboard-action:hover{background:rgba(255,255,255,.11);transform:translateY(-1px);}
.ux-v40 .dashboard-action.is-primary{background:#538bc8;border-color:#689edb;}
.ux-v40 .dashboard-action .action-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:rgba(255,255,255,.11);font-size:1.2rem;font-weight:700;}
.ux-v40 .dashboard-action span:nth-child(2){display:grid;gap:2px;min-width:0;}
.ux-v40 .dashboard-action b{font-size:.9rem;color:#ffffff;}
.ux-v40 .dashboard-action small{font-size:.7rem;color:#c2cedc;line-height:1.3;}
.ux-v40 .dashboard-action.is-primary small{color:#eef5fd;}
.ux-v40 .dashboard-action i{font-style:normal;color:#b6c6d8;font-size:1.1rem;}

.ux-v40 .page-shell.dashboard .block-title{align-items:flex-end;margin-bottom:14px;}
.ux-v40 .phase-grid.phase-grid-flow{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-bottom:32px;}
.ux-v40 .phase-grid-flow .phase-card{
  min-height:122px;padding:15px 14px;border:1px solid var(--ux-border);border-top:3px solid var(--phase-color);
  border-radius:13px;box-shadow:none;
}
.ux-v40 .phase-grid-flow .phase-card:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(13,22,33,.07);}
.ux-v40 .phase-grid-flow .phase-card-head{align-items:flex-start;}
.ux-v40 .phase-grid-flow .phase-total{font-size:.67rem;padding:3px 7px;}
.ux-v40 .phase-grid-flow .phase-card h3{font-size:.91rem;margin:10px 0 8px;}
.ux-v40 .phase-grid-flow .phase-go{font-size:.72rem;}

.ux-v40 .dashboard-focus{margin-top:6px;}
.ux-v40 .attention-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;}
.ux-v40 .attention-card{
  min-height:126px;padding:16px;background:#ffffff;border:1px solid var(--ux-border);border-radius:14px;box-shadow:none;
}
.ux-v40 .attention-card span{font-size:.78rem;color:var(--ux-muted);font-weight:800;}
.ux-v40 .attention-card b{font-size:1.75rem;}
.ux-v40 .attention-card small{font-size:.71rem;line-height:1.35;color:#858f99;}
.ux-v40 .attention-card.danger{background:#fffafa;border-color:#ebd1ce;}
.ux-v40 .attention-card.warning{background:#fffdf9;border-color:#e8dfc5;}
.ux-v40 .dashboard-recent{margin-top:30px;}
.ux-v40 .recent-list{background:#ffffff;border:1px solid var(--ux-border);border-radius:var(--ux-radius-lg);overflow:hidden;}
.ux-v40 .recent-row{padding:13px 16px;border-bottom:1px solid #eaedf1;}
.ux-v40 .recent-row:last-child{border-bottom:0;}
.ux-v40 .dashboard-help{margin-top:22px;background:#ffffff;border:1px solid var(--ux-border);border-radius:14px;overflow:hidden;}
.ux-v40 .dashboard-help>summary{cursor:pointer;padding:14px 17px;font-size:.82rem;font-weight:800;color:#5a6674;list-style:none;}
.ux-v40 .dashboard-help>summary::after{content:'⌄';float:right;color:#828e9c;}
.ux-v40 .dashboard-help[open]>summary::after{content:'⌃';}
.ux-v40 .dashboard-help-grid{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--ux-border);}
.ux-v40 .dashboard-help-grid article{padding:18px 20px;}
.ux-v40 .dashboard-help-grid article+article{border-left:1px solid var(--ux-border);}
.ux-v40 .dashboard-help-grid p{color:var(--ux-muted);font-size:.86rem;margin-bottom:8px;}

/* =========================================================
   INVENTARIO / FILTROS / TABLAS
   ========================================================= */
.ux-v40 .page-shell.products .page-heading{margin-bottom:22px;}
.ux-v40 .inventory-filters{
  position:relative;display:grid;grid-template-columns:minmax(280px,2.2fr) minmax(150px,.85fr) minmax(140px,.75fr) minmax(140px,.75fr);
  gap:12px;padding:16px;margin-bottom:11px;border:1px solid var(--ux-border);border-radius:16px;background:#ffffff;box-shadow:var(--ux-shadow);
}
.ux-v40 .inventory-filters .search-field{grid-column:auto;}
.ux-v40 .inventory-filters .search-field input{font-size:.94rem;}
.ux-v40 .inventory-mobile-quick-actions{display:flex!important;gap:8px;align-items:end;}
.ux-v40 .inventory-mobile-quick-actions .btn{min-height:44px;}
.ux-v40 .inventory-mobile-quick-actions .btn:first-child{display:inline-flex;}
/* Principales visibles: búsqueda, cliente, estado y fase. El resto se revela con Más filtros. */
.ux-v40 .inventory-filters>label:not(.search-field){display:none;}
.ux-v40 .inventory-filters>label:has(select[name="client"]),
.ux-v40 .inventory-filters>label:has(select[name="state"]),
.ux-v40 .inventory-filters>label:has(select[name="phase"]){display:block;}
.ux-v40 .inventory-filters.mobile-filters-open{grid-template-columns:repeat(4,minmax(0,1fr));}
.ux-v40 .inventory-filters.mobile-filters-open .search-field{grid-column:span 2;}
.ux-v40 .inventory-filters.mobile-filters-open>label:not(.search-field){display:block;}
.ux-v40 .inventory-filters.mobile-filters-open .inventory-mobile-quick-actions{grid-column:span 2;justify-content:flex-end;}
.ux-v40 .inventory-filters .filter-actions{display:none;}
.ux-v40 .inventory-filters.mobile-filters-open .filter-actions{display:flex;grid-column:1/-1;justify-content:flex-end;padding-top:4px;border-top:1px solid var(--ux-border);}
.ux-v40 .active-filter-bar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 0 14px;padding:4px 2px;}
.ux-v40 .active-filter-label{font-size:.73rem;font-weight:850;color:#7c8793;text-transform:uppercase;letter-spacing:.06em;}
.ux-v40 .filter-chip{display:inline-flex;align-items:center;gap:4px;min-height:29px;padding:4px 9px;border-radius:999px;background:#eef3f9;color:#3f5d7d;font-size:.74rem;font-weight:750;}
.ux-v40 .filter-chip span{color:#6b7c8f;font-weight:650;}
.ux-v40 .filter-chip b{font-size:.9rem;}
.ux-v40 .clear-filter-link{font-size:.75rem;font-weight:800;color:var(--ux-blue-dark);margin-left:3px;}

.ux-v40 .table-shell{overflow:visible;background:#ffffff;}
.ux-v40 .table-title{padding:15px 17px;background:#ffffff;border-bottom:1px solid var(--ux-border);}
.ux-v40 .inventory-table-wrap{border-radius:0 0 var(--ux-radius-lg) var(--ux-radius-lg);}
.ux-v40 .inventory-table{font-size:.79rem;}
.ux-v40 .inventory-table th{position:sticky;top:76px;z-index:6;padding:11px 12px;background:#f6f8fa;color:#727b87;font-size:.65rem;letter-spacing:.055em;}
.ux-v40 .inventory-table td{padding:12px;border-color:#eaedf0;}
.ux-v40 .inventory-table tbody tr{transition:background .12s;}
.ux-v40 .inventory-table tbody tr:hover{background:#f8fbfd;}
.ux-v40 .inventory-table .item-link{color:#293b51;font-weight:820;}
.ux-v40 .inventory-table small{color:#818a94;}
.ux-v40 .sort-link{gap:4px;}
.ux-v40 .inventory-open .table-arrow{width:31px;height:31px;border-radius:9px;background:#f2f4f7;color:#506072;}
.ux-v40 .bulk-toolbar{border-radius:13px;background:#f4f7fb;border-color:#d2deec;box-shadow:none;}
.ux-v40 .pager{margin-top:16px;}
.ux-v40 .empty,.ux-v40 .empty-state,.ux-v40 .search-empty-state{border:1px dashed #cfd6dd;background:#f9fbfc;border-radius:14px;color:#687380;}

/* =========================================================
   BÚSQUEDA GLOBAL
   ========================================================= */
.ux-v40 .global-search-shell{padding:20px;background:linear-gradient(135deg,#ffffff,#f8fbfd);}
.ux-v40 .global-search-form>label{font-size:.76rem;text-transform:uppercase;letter-spacing:.07em;color:#6d7783;}
.ux-v40 .global-search-box{display:grid;grid-template-columns:1fr auto;gap:9px;margin-top:5px;}
.ux-v40 .global-search-box input{min-height:52px;margin:0;padding:12px 15px;font-size:1rem;border-radius:12px;}
.ux-v40 .global-search-box .btn{min-height:52px;padding-inline:22px;}
.ux-v40 .search-summary{border-radius:12px;background:#f0f5fb;border-color:#d6e3f2;}
.ux-v40 .search-group{margin-top:25px;}
.ux-v40 .search-result-grid{gap:10px;}
.ux-v40 .search-result-card{border-color:var(--ux-border);border-radius:13px;box-shadow:none;transition:.14s ease;}
.ux-v40 .search-result-card:hover{border-color:#bbd0e9;box-shadow:0 8px 20px rgba(13,22,33,.06);transform:translateY(-1px);}

/* =========================================================
   PENDIENTES / TRAZABILIDAD
   ========================================================= */
.ux-v40 .pending-overview{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:15px;}
.ux-v40 .pending-kpi{
  min-height:38px;padding:8px 12px;display:flex;align-items:center;gap:8px;border:1px solid var(--ux-border);
  border-radius:999px;background:#ffffff;box-shadow:none;
}
.ux-v40 .pending-kpi span{font-size:.78rem;font-weight:800;color:#5b6775;}
.ux-v40 .pending-kpi b{font-size:.82rem;min-width:24px;padding:2px 6px;border-radius:999px;background:#eff1f4;text-align:center;}
.ux-v40 .pending-kpi small{display:none;}
.ux-v40 .pending-kpi.is-active{border-color:#a7c3e2;background:var(--ux-blue-soft);color:var(--ux-blue-dark);}
.ux-v40 .pending-kpi.is-active span{color:var(--ux-blue-dark);}
.ux-v40 .pending-kpi.danger b{background:#fbedeb;color:var(--ux-danger);}
.ux-v40 .pending-shell{padding:0;background:#ffffff;overflow:hidden;}
.ux-v40 .pending-shell>.block-title{padding:18px 20px;margin:0;border-bottom:1px solid var(--ux-border);}
.ux-v40 .pending-list{display:grid;gap:0;}
.ux-v40 .pending-row{border:0;border-bottom:1px solid #eaedf0;border-radius:0;padding:14px 18px;}
.ux-v40 .pending-row:last-child{border-bottom:0;}
.ux-v40 .pending-reasons span{border-radius:999px;}
.ux-v40 .pending-pager{padding:14px 18px;margin:0;border-top:1px solid var(--ux-border);}
.ux-v40 .page-shell.audit .filters{box-shadow:none;}
.ux-v40 .audit-list,.ux-v40 .audit-card{border-color:var(--ux-border);}

/* =========================================================
   NUEVA RECEPCIÓN / ESCÁNER / FORMULARIOS
   ========================================================= */
.ux-v40 .new-reception-actions{display:inline-flex;gap:4px;padding:4px;margin-bottom:17px;border:1px solid var(--ux-border);border-radius:13px;background:#f0f2f5;}
.ux-v40 .new-reception-actions .btn{min-width:150px;border:0;box-shadow:none;background:transparent;color:#5a6572;}
.ux-v40 .new-reception-actions .btn.primary{background:#ffffff;color:var(--ux-blue-dark);box-shadow:0 2px 8px rgba(13,22,33,.06);}
.ux-v40 .create-card{padding:22px;}
.ux-v40 .scan-help{margin-bottom:18px;border-radius:12px;background:#f3f6fb;border:1px solid #dbe5f2;}
.ux-v40 .fields-grid{gap:15px;}
.ux-v40 .batch-shared-card{padding:22px;}
.ux-v40 .batch-shared-grid{gap:14px;}
.ux-v40 .batch-scan-toolbar{margin-top:20px;padding:17px;border-radius:14px;background:#f6f9fb;border:1px solid var(--ux-border);}
.ux-v40 .batch-table-wrap{border:1px solid var(--ux-border);border-radius:13px;overflow:auto;}
.ux-v40 .batch-table th{background:#f6f8fa;}
.ux-v40 .stage-actions{border-top-color:var(--ux-border);}

/* =========================================================
   FICHA DE PRODUCTO
   ========================================================= */
.ux-v40 .page-shell.product .record-summary{
  border:1px solid var(--ux-border);border-radius:var(--ux-radius-lg);background:#ffffff;box-shadow:var(--ux-shadow);overflow:hidden;color:var(--ux-text);
}
.ux-v40 .page-shell.product .record-summary>div{border-color:#ebeef1;color:var(--ux-text);}
.ux-v40 .small-title{color:#6b7b8d;}
.ux-v40 .page-shell.product .record-summary b{color:var(--ux-text);}
.ux-v40 .page-shell.product .record-summary small{color:var(--ux-muted);}
.ux-v40 .page-shell.product .record-summary .badge{align-self:flex-start;}
.ux-v40 .page-shell.product .record-summary .phase-chip{color:var(--ux-text);background:#f0f5f9;border:1px solid #dce5ee;}
.ux-v40 .page-shell.product .record-summary .phase-chip i{background:#6195cf;}
.ux-v40 .page-shell.product .record-summary .storage-chip{align-self:flex-start;}
.ux-v40 .page-shell.product .record-summary .progress-warning{color:var(--ux-warning);font-weight:700;}
.ux-v40 .page-shell.product .timeline.timeline-flow{gap:7px;margin-bottom:28px;}
.ux-v40 .page-shell.product .timeline-step{min-height:100px;padding:13px 11px;border-radius:13px;box-shadow:none;border-color:var(--ux-border);}
.ux-v40 .page-shell.product .timeline-step.current{box-shadow:0 0 0 2px rgba(81,141,207,.12);}
.ux-v40 .page-shell.product .fields-heading{margin-top:4px;}
.ux-v40 .page-shell.product .stages{display:grid;grid-template-columns:1fr;gap:10px;}
.ux-v40 .page-shell.product .stages>.stage-card,
.ux-v40 .page-shell.product .stages>.group-1,
.ux-v40 .page-shell.product .stages>.group-4,
.ux-v40 .page-shell.product .stages>.group-5,
.ux-v40 .page-shell.product .stages>.group-6,
.ux-v40 .page-shell.product .stages>.group-7,
.ux-v40 .page-shell.product .stages>.group-8{grid-column:1/-1;margin:0;height:auto;}
.ux-v40 .page-shell.product .stage-card{overflow:hidden;border-radius:15px;box-shadow:none;background:#ffffff;}
.ux-v40 .page-shell.product .stage-card.stage-current{border-color:#b2cbe7;box-shadow:0 0 0 2px rgba(81,141,207,.09);}
.ux-v40 .page-shell.product .stage-head{min-height:68px;padding:13px 16px;background:#ffffff;border-bottom:1px solid var(--ux-border);}
.ux-v40 .page-shell.product .stage-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--phase-bg);color:var(--phase-color);font-size:.7rem;font-weight:900;}
.ux-v40 .page-shell.product .stage-head small{font-size:.64rem;color:#889099;}
.ux-v40 .page-shell.product .stage-head h3{margin:2px 0 0;font-size:1rem;}
.ux-v40 .page-shell.product .status-marker{padding:4px 8px;border-radius:999px;background:#f1f4f6;font-size:.69rem;color:#6a7480;}
.ux-v40 .page-shell.product .stage-toggle{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--ux-border);border-radius:9px;background:#ffffff;color:#697481;font-weight:900;}
.ux-v40 .page-shell.product .stage-form{padding:18px;}
.ux-v40 .page-shell.product .read-fields{padding:18px;}
.ux-v40 .page-shell.product .stage-lock-notice{margin:14px 16px;border-radius:11px;}
.ux-v40 .page-shell.product .stage-card.is-collapsed .stage-form,
.ux-v40 .page-shell.product .stage-card.is-collapsed .read-fields,
.ux-v40 .page-shell.product .stage-card.is-collapsed .stage-lock-notice{display:none!important;}
.ux-v40 .page-shell.product .stage-card.is-collapsed .stage-head{border-bottom:0;}
.ux-v40 .page-shell.product .history{margin-top:16px;border:1px solid var(--ux-border);border-radius:14px;background:#ffffff;}
.ux-v40 .page-shell.product .history>summary{padding:14px 16px;}

/* =========================================================
   EXCEL
   ========================================================= */
.ux-v40 .excel-steps{gap:7px;}
.ux-v40 .excel-step{border-radius:12px;border-color:var(--ux-border);box-shadow:none;}
.ux-v40 .excel-step.is-active{border-color:#a9c5e4;background:#f5f8fd;}
.ux-v40 .excel-workspace .panel-box,.ux-v40 .excel-workspace .excel-panel{box-shadow:none;}
.ux-v40 .excel-drop-zone{border-radius:14px;border-color:#c1ccd8;background:#fafcfd;}

/* =========================================================
   GESTIÓN: CLIENTES / CENTROS / CUENTAS
   ========================================================= */
.ux-v40 .client-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px;}
.ux-v40 .client-summary>div{min-width:150px;flex:1;padding:13px 16px;border-radius:13px;box-shadow:none;}
.ux-v40 .client-summary b{font-size:1.35rem;color:#293b51;}
.ux-v40 .users-layout.catalog-layout{grid-template-columns:1fr;gap:18px;}
.ux-v40 .users-layout .panel-box{box-shadow:none;}
.ux-v40 .section-heading-actions{align-items:flex-end;}
.ux-v40 .client-code-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.ux-v40 .client-code-card{border-color:var(--ux-border);border-radius:14px;box-shadow:none;}
.ux-v40 .client-code-card-head{padding:14px 15px;border-bottom:1px solid var(--ux-border);}
.ux-v40 .client-code-description,.ux-v40 .client-code-metrics,.ux-v40 .client-code-actions{padding-left:15px;padding-right:15px;}
.ux-v40 .client-code-actions{gap:7px;}
.ux-v40 .mini-btn{border-radius:9px;}
.ux-v40 .site-card,.ux-v40 .account-card,.ux-v40 .admin-card{border-color:var(--ux-border);box-shadow:none;border-radius:14px;}
.ux-v40 .app-modal:not(.ios-scanner-modal)::backdrop{background:rgba(13,22,33,.55);backdrop-filter:blur(3px);}
.ux-v40 .app-modal-card:not(.ios-scanner-card){border-radius:18px;border:1px solid var(--ux-border);box-shadow:0 25px 70px rgba(13,22,33,.22);}
.ux-v40 .app-modal-head{border-bottom-color:var(--ux-border);}
.ux-v40 .modal-actions{border-top-color:var(--ux-border);}

/* ---------- Login ---------- */
.ux-v40.login-body{background:#f5f8fa;}
.ux-v40 .auth-copy{border-radius:24px;background:radial-gradient(ellipse at 85% 100%,#37577a 0,transparent 55%),linear-gradient(145deg,#0d1621,#1a2b3d);}
.ux-v40 .auth-card{border-radius:20px;box-shadow:0 18px 45px rgba(13,22,33,.08);}

/* ---------- Footer ---------- */
.ux-v40 .site-footer{border-color:var(--ux-border);background:#ffffff;color:#88919b;}
.ux-v40 .site-footer .container{min-height:60px;}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media(max-width:1100px){
  .ux-v40 .header-search-link>span:last-child{display:none;}
  .ux-v40 .header-search-link{width:40px;justify-content:center;padding:0;}
  .ux-v40 .dashboard-primary-actions{grid-template-columns:1fr;}
  .ux-v40 .dashboard-action-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .ux-v40 .phase-grid.phase-grid-flow{grid-template-columns:repeat(3,minmax(0,1fr));}
  .ux-v40 .attention-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .ux-v40 .inventory-filters{grid-template-columns:2fr 1fr 1fr;}
  .ux-v40 .inventory-filters.mobile-filters-open{grid-template-columns:repeat(3,minmax(0,1fr));}
  .ux-v40 .inventory-filters.mobile-filters-open .search-field{grid-column:span 2;}
  .ux-v40 .client-code-list{grid-template-columns:1fr;}
}

@media(max-width:820px){
  .ux-v40 .container,.ux-v40 .header-inner{width:min(calc(100% - 28px),var(--ux-max));}
  .ux-v40 .header-inner{height:68px;min-height:68px;}
  .ux-v40 .brand img{width:108px;}
  .ux-v40 .brand-divider,.ux-v40 .brand-caption{display:none;}
  .ux-v40 .header-actions{gap:7px;}
  .ux-v40 .nav-toggle{display:grid;order:3;z-index:1505;}
  .ux-v40 .header-search-link{order:2;}
  .ux-v40 .top-nav{
    position:fixed!important;top:0!important;right:auto!important;bottom:0!important;left:0!important;z-index:1500!important;
    width:min(86vw,340px)!important;max-height:none!important;height:100dvh!important;padding:88px 14px 20px!important;
    display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:5px!important;
    background:#ffffff!important;border-right:1px solid var(--ux-border)!important;box-shadow:20px 0 50px rgba(13,22,33,.18)!important;
    transform:translateX(-105%);transition:transform .2s ease;overflow-y:auto!important;
  }
  .ux-v40 .top-nav.open{transform:translateX(0);visibility:visible;pointer-events:auto;}
  .ux-v40 .top-nav:not(.open){visibility:hidden;pointer-events:none;}
  .ux-v40.nav-open::after,.ux-v40.nav-open:after{content:'';position:fixed;inset:0;z-index:1450;background:rgba(13,22,33,.42);}
  .ux-v40 .top-nav>a,
  .ux-v40 .top-nav .nav-group>summary,
  .ux-v40 .top-nav .nav-group[open]>summary{width:100%;height:46px;min-height:46px;justify-content:space-between;padding:0 12px;border-radius:10px;}
  .ux-v40 .top-nav .nav-group{width:100%;height:auto;}
  .ux-v40 .top-nav .nav-dropdown,
  .ux-v40 .top-nav .nav-group[open]>.nav-dropdown,
  .ux-v40 .top-nav .nav-group:last-of-type>.nav-dropdown{
    position:static!important;width:100%!important;min-width:0!important;max-width:none!important;margin:2px 0 4px!important;padding:3px 4px 5px 11px!important;
    border:0!important;border-left:2px solid #dbe2ea!important;border-radius:0!important;box-shadow:none!important;
  }
  .ux-v40 .top-nav .nav-dropdown>a{min-height:41px;padding:9px 11px;}
  .ux-v40 .top-nav .nav-dropdown .logout{margin-top:2px;}
  .ux-v40 .page-shell{padding:24px 0 48px;}
  .ux-v40 .page-heading{display:block;margin-bottom:20px;}
  .ux-v40 .page-heading>.btn,.ux-v40 .page-heading>a{width:100%;margin-top:14px;}
  .ux-v40 .dashboard-status-band{grid-template-columns:1fr 1fr 1fr;}
  .ux-v40 .dashboard-status-band>div{min-height:96px;padding:15px;border-right:1px solid var(--ux-border);}
  .ux-v40 .dashboard-status-band b{font-size:1.65rem;}
  .ux-v40 .dashboard-status-band span{font-size:.66rem;}
  .ux-v40 .dashboard-action-grid{grid-template-columns:1fr;}
  .ux-v40 .dashboard-action{min-height:72px;}
  .ux-v40 .phase-grid.phase-grid-flow{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ux-v40 .attention-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ux-v40 .dashboard-help-grid{grid-template-columns:1fr;}
  .ux-v40 .dashboard-help-grid article+article{border-left:0;border-top:1px solid var(--ux-border);}
  .ux-v40 .inventory-filters,
  .ux-v40 .inventory-filters.mobile-filters-open{grid-template-columns:1fr!important;padding:13px;gap:10px;}
  .ux-v40 .inventory-filters .search-field,
  .ux-v40 .inventory-filters.mobile-filters-open .search-field{grid-column:1!important;}
  .ux-v40 .inventory-filters>label:not(.search-field){display:none!important;}
  .ux-v40 .inventory-filters.mobile-filters-open>label:not(.search-field){display:block!important;}
  .ux-v40 .inventory-mobile-quick-actions,
  .ux-v40 .inventory-filters.mobile-filters-open .inventory-mobile-quick-actions{grid-column:1!important;display:grid!important;grid-template-columns:1fr 1fr;}
  .ux-v40 .inventory-mobile-quick-actions .btn:first-child{display:inline-flex;}
  .ux-v40 .inventory-filters.mobile-filters-open .filter-actions{grid-column:1!important;}
  .ux-v40 .inventory-table-wrap{overflow:visible;}
  .ux-v40 .inventory-table,.ux-v40 .inventory-table tbody,.ux-v40 .inventory-table tr,.ux-v40 .inventory-table td{display:block;width:100%;}
  .ux-v40 .inventory-table thead{display:none;}
  .ux-v40 .inventory-table tbody{display:grid;gap:9px;padding:10px;background:#f3f6f8;}
  .ux-v40 .inventory-table tr{position:relative;padding:14px 14px 12px;border:1px solid var(--ux-border);border-radius:14px;background:#ffffff;box-shadow:none;}
  .ux-v40 .inventory-table td{min-height:0!important;padding:4px 0!important;border:0!important;text-align:left!important;}
  .ux-v40 .inventory-table td::before{display:inline-block;min-width:112px;margin-right:6px;color:#889099;font-size:.66rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em;content:attr(data-label);}
  .ux-v40 .inventory-table .reference-col{padding-bottom:8px!important;margin-bottom:5px;border-bottom:1px solid #edf1f4!important;}
  .ux-v40 .inventory-table .reference-col::before{display:block;margin-bottom:3px;}
  .ux-v40 .inventory-table .reference-col .item-link{font-size:1rem;}
  .ux-v40 .inventory-table .open-col{margin-top:8px;padding-top:9px!important;border-top:1px solid #edf1f4!important;}
  .ux-v40 .inventory-table .open-col::before{display:none;}
  .ux-v40 .inventory-card-open{width:100%!important;height:auto!important;min-height:40px!important;justify-content:center!important;border-radius:10px!important;background:#f1f5fa!important;color:var(--ux-blue-dark)!important;}
  .ux-v40 .inventory-open-mobile{display:inline!important;}
  .ux-v40 .inventory-open-desktop{display:none!important;}
  .ux-v40 .select-col{position:absolute!important;right:12px;top:10px;width:auto!important;z-index:2;}
  .ux-v40 .select-col::before{display:none!important;}
  .ux-v40 .global-search-box{grid-template-columns:1fr;}
  .ux-v40 .global-search-box .btn{width:100%;}
  .ux-v40 .pending-shell>.block-title{display:block;}
  .ux-v40 .pending-row{grid-template-columns:1fr;gap:9px;}
  .ux-v40 .pending-meta{text-align:left;}
  .ux-v40 .pending-actions .btn{width:100%;}
  .ux-v40 .page-shell.product .timeline.timeline-flow{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ux-v40 .page-shell.product .timeline-step{min-height:86px;}
  .ux-v40 .page-shell.product .stage-head{padding:12px;gap:9px;}
  .ux-v40 .page-shell.product .status-marker{display:none;}
  .ux-v40 .page-shell.product .stage-form,.ux-v40 .page-shell.product .read-fields{padding:14px;}
  .ux-v40 .client-code-list{grid-template-columns:1fr;}
}

@media(max-width:560px){
  .ux-v40 .container,.ux-v40 .header-inner{width:min(calc(100% - 22px),var(--ux-max));}
  .ux-v40 .page-shell{padding-top:20px;}
  .ux-v40 h1{font-size:1.9rem;}
  .ux-v40 .dashboard-status-band{grid-template-columns:1fr;}
  .ux-v40 .dashboard-status-band>div{min-height:78px;grid-template-columns:1fr auto;align-items:center;border-right:0;border-bottom:1px solid var(--ux-border);}
  .ux-v40 .dashboard-status-band>div:last-child{border-bottom:0;}
  .ux-v40 .dashboard-status-band b{grid-row:1/3;grid-column:2;align-self:center;}
  .ux-v40 .dashboard-status-band small{grid-column:1;}
  .ux-v40 .dashboard-primary-actions{padding:18px 15px;gap:15px;}
  .ux-v40 .phase-grid.phase-grid-flow{grid-template-columns:1fr 1fr;gap:7px;}
  .ux-v40 .phase-grid-flow .phase-card{min-height:108px;padding:12px;}
  .ux-v40 .attention-grid{grid-template-columns:1fr 1fr;gap:7px;}
  .ux-v40 .attention-card{min-height:112px;padding:13px;}
  .ux-v40 .pending-overview{display:grid;grid-template-columns:1fr 1fr;}
  .ux-v40 .pending-kpi{justify-content:space-between;border-radius:11px;}
  .ux-v40 .new-reception-actions{display:grid;grid-template-columns:1fr;width:100%;}
  .ux-v40 .new-reception-actions .btn{width:100%;}
  .ux-v40 .client-summary{display:grid;grid-template-columns:1fr 1fr;}
  .ux-v40 .client-summary>div:last-child{grid-column:1/-1;}
}

@media(prefers-reduced-motion:reduce){
  .ux-v40 *, .ux-v40 *::before, .ux-v40 *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}
}

/* Gestión: navegación secundaria dentro de una sola arquitectura */
.ux-v40 .management-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:-5px 0 18px;padding:5px;background:#eceff3;border:1px solid var(--ux-border);border-radius:13px;width:max-content;max-width:100%;}
.ux-v40 .management-tabs a{display:inline-flex;align-items:center;min-height:36px;padding:7px 12px;border-radius:9px;color:#596573;font-size:.79rem;font-weight:820;}
.ux-v40 .management-tabs a:hover,.ux-v40 .management-tabs a:focus-visible{background:#ffffff;color:var(--ux-blue-dark);}
@media(max-width:560px){.ux-v40 .management-tabs{display:grid;grid-template-columns:1fr 1fr;width:100%;}.ux-v40 .management-tabs a{justify-content:center;}}


/* =========================================================
   DPUNTO STOCK · UX/UI v40.1 corrective layer
   Contraste, navegación, gestión y seguridad de acciones.
   ========================================================= */
.ux-v40{
  --ux-muted:#5c6978;
  --ux-border:#d9dfe6;
  --ux-border-strong:#c2cbd4;
}
.ux-v40 .fine,.ux-v40 .muted,.ux-v40 .hint{color:var(--ux-muted);}
.ux-v40 .small-title,
.ux-v40 .record-summary .small-title,
.ux-v40 .record-summary [class*="title"]{color:#536375!important;}
.ux-v40 .page-shell.product .record-summary,
.ux-v40 .page-shell.product .record-summary>div,
.ux-v40 .page-shell.product .record-summary b,
.ux-v40 .page-shell.product .record-summary strong{color:#18222e!important;}
.ux-v40 .page-shell.product .record-summary small{color:#5c6978!important;}
.ux-v40 .page-shell.product .record-summary .badge.good{color:#2c6342!important;background:#e7f4eb!important;}
.ux-v40 .page-shell.product .record-summary .badge.defect{color:#913c35!important;background:#fae9e7!important;}

/* Navegación PC: misma caja y misma línea base para enlaces y summaries. */
.ux-v40 .top-nav{align-items:center!important;}
.ux-v40 .top-nav>a,
.ux-v40 .top-nav .nav-group>summary,
.ux-v40 .top-nav .nav-group[open]>summary{
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:40px!important;
  min-height:40px!important;
  padding-block:0!important;
  margin:0!important;
  line-height:40px!important;
  vertical-align:middle!important;
}
.ux-v40 .top-nav .nav-group{display:flex!important;align-items:center!important;height:40px!important;margin:0!important;}
.ux-v40 .top-nav .nav-group>summary::after{line-height:1!important;margin-top:1px!important;transform:none!important;}

/* Scrim real: el menú móvil siempre puede cerrarse tocando fuera. */
.ux-v40 .nav-scrim{display:none;border:0;padding:0;background:transparent;}
.ux-v40.nav-open::after,.ux-v40.nav-open:after{content:none!important;display:none!important;}
@media(max-width:820px){
  .ux-v40.nav-open{overflow:hidden;}
  .ux-v40.nav-open .nav-scrim{
    display:block;position:fixed;inset:0;z-index:1450;background:rgba(13,22,33,.48);cursor:pointer;
  }
  .ux-v40 .top-nav{z-index:1500!important;}
  .ux-v40 .nav-toggle{position:relative;z-index:1510!important;}
  .ux-v40 .top-nav .nav-group,
  .ux-v40 .top-nav .nav-group[open]{display:block!important;width:100%!important;height:auto!important;}
  .ux-v40 .top-nav .nav-group>summary,
  .ux-v40 .top-nav .nav-group[open]>summary{display:flex!important;line-height:1.25!important;}
}

/* Dashboard: cifras neutrales; significado cromático en las etiquetas de estado. */
.ux-v40 .dashboard-status-band .is-good b,
.ux-v40 .dashboard-status-band .is-defect b{color:var(--ux-text)!important;}
.ux-v40 .dashboard-status-band .is-good span,
.ux-v40 .dashboard-status-band .is-good small{color:#37714e!important;}
.ux-v40 .dashboard-status-band .is-defect span,
.ux-v40 .dashboard-status-band .is-defect small{color:#9a463f!important;}

/* Código cliente: ningún identificador ni dato puede provocar overflow. */
.ux-v40 .client-code-list,
.ux-v40 .client-code-card,
.ux-v40 .client-code-card>*{min-width:0!important;max-width:100%;}
.ux-v40 .client-code-card{overflow:hidden;}
.ux-v40 .client-code-identity,
.ux-v40 .client-code-description,
.ux-v40 .client-code-metrics,
.ux-v40 .client-code-actions{min-width:0!important;max-width:100%;}
.ux-v40 .client-code-value,
.ux-v40 .client-code-description b,
.ux-v40 .client-code-description small{
  display:block;max-width:100%;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word;
}
.ux-v40 .client-code-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.ux-v40 .client-code-more-actions{grid-column:1/-1;min-width:0;}

/* Centros por cliente: operaciones legibles y proporcionadas. */
.ux-v40 .site-catalog-table{table-layout:fixed!important;width:100%;}
.ux-v40 .site-catalog-table th:nth-child(1){width:12%!important;}
.ux-v40 .site-catalog-table th:nth-child(2){width:20%!important;}
.ux-v40 .site-catalog-table th:nth-child(3){width:18%!important;}
.ux-v40 .site-catalog-table th:nth-child(4){width:9%!important;}
.ux-v40 .site-catalog-table th:nth-child(5){width:11%!important;}
.ux-v40 .site-catalog-table th:nth-child(6){width:30%!important;}
.ux-v40 .site-catalog-table td{min-width:0;overflow-wrap:anywhere;}
.ux-v40 .site-actions-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%;align-items:stretch;
}
.ux-v40 .site-actions-grid>button,
.ux-v40 .site-actions-grid>form{min-width:0!important;width:100%!important;margin:0!important;}
.ux-v40 .site-actions-grid .mini-btn{
  width:100%!important;min-width:0!important;min-height:42px!important;padding:8px 10px!important;white-space:normal!important;line-height:1.18!important;
}
.ux-v40 .site-actions-grid>form:last-of-type{grid-column:1/-1;}
@media(max-width:820px){
  .ux-v40 .site-actions-grid{grid-template-columns:1fr!important;}
  .ux-v40 .site-actions-grid>form:last-of-type{grid-column:auto!important;}
}

/* Eliminación masiva: acción diferenciada y consecuencias explícitas. */
.ux-v40 .bulk-toolbar-actions .btn.danger,
.ux-v40 .modal-actions .btn.danger{background:#9a463f;color:#ffffff;border-color:#9a463f;}
.ux-v40 .bulk-toolbar-actions .btn.danger:hover,
.ux-v40 .modal-actions .btn.danger:hover{background:#843933;border-color:#843933;}
.ux-v40 .danger-confirm-card{max-width:620px;}
.ux-v40 .danger-eyebrow{color:#9a463f!important;}
.ux-v40 .bulk-delete-warning{margin:18px 0;padding:16px 18px;border:1px solid #e9c9c6;border-radius:13px;background:#fdf5f5;color:#492f2c;}
.ux-v40 .bulk-delete-warning p{margin:0 0 10px;}
.ux-v40 .bulk-delete-warning ul{margin:0;padding-left:20px;display:grid;gap:7px;}

/* =========================================================
   DPUNTO STOCK · UX/UI v40.2 legibility layer
   Contraste de ubicación y tipografía sin palabras partidas.
   ========================================================= */

/* El legado usaba overflow-wrap:anywhere de forma global. En la UI nueva
   las palabras normales nunca deben romperse por la mitad. */
.ux-v40 :where(h1,h2,h3,h4,p,span,b,strong,small,a,label,button,summary,th,dt,dd){
  overflow-wrap:normal;
  word-break:normal;
  hyphens:none;
}

/* Los datos libres sí pueden ser largos, pero se parten solo cuando es necesario. */
.ux-v40 :where(.mono,.client-code-value,.client-code-description b,.client-code-description small,
  .record-summary .mono,.read-fields dd,.audit-card code,.history code,
  .storage-chip span,.product-description,.long-value){
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}

/* Ficha: títulos secundarios con contraste real. */
.ux-v40 .page-shell.product .record-summary .small-title{
  color:#455567!important;
  font-weight:900!important;
  letter-spacing:.055em!important;
}
.ux-v40 .page-shell.product .record-summary b,
.ux-v40 .page-shell.product .record-summary strong{
  color:#1a2633!important;
}
.ux-v40 .page-shell.product .record-summary small{
  color:#556373!important;
}

/* Balda / Palet actual: el valor no puede heredar el blanco del resumen antiguo. */
.ux-v40 .page-shell.product .record-summary .storage-chip{
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  max-width:100%!important;
  padding:5px 8px!important;
  border:1px solid #d4dce4!important;
  border-radius:10px!important;
  background:#f3f7fa!important;
  color:#263546!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip span{
  color:#263546!important;
  font-weight:850!important;
  line-height:1.2!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip b{
  color:#334457!important;
  background:#e2e8ef!important;
  border:1px solid #ccd5e0!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.balda b{
  color:#27583d!important;
  background:#e2f2e8!important;
  border-color:#c4dfcf!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.palet b{
  color:#3b5d83!important;
  background:#e6eff8!important;
  border-color:#cadaec!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.legacy b{
  color:#744e29!important;
  background:#fcf0de!important;
  border-color:#e8d3b2!important;
}

/* Última fase: texto siempre visible además del punto de color. */
.ux-v40 .page-shell.product .record-summary .phase-chip{
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  width:max-content!important;
  max-width:100%!important;
  padding:5px 9px!important;
  color:#263546!important;
  background:#eef3f9!important;
  border:1px solid #d6e0ec!important;
  border-radius:999px!important;
  font-weight:850!important;
  white-space:nowrap!important;
}

/* En escritorio, títulos y acciones deben conservarse en una línea cuando caben. */
@media(min-width:821px){
  .ux-v40 .top-nav>a,
  .ux-v40 .top-nav .nav-group>summary,
  .ux-v40 .btn,
  .ux-v40 .mini-btn,
  .ux-v40 .management-tabs a,
  .ux-v40 .filter-actions .btn,
  .ux-v40 .bulk-toolbar-actions .btn{
    white-space:nowrap!important;
  }

  .ux-v40 th,
  .ux-v40 .small-title,
  .ux-v40 .client-code-label{
    white-space:nowrap;
  }

  /* La ficha usa columnas más generosas y salta antes a dos columnas. */
  .ux-v40 .page-shell.product .record-summary{
    grid-template-columns:1.05fr 1.35fr 1.2fr 1fr!important;
  }

  /* Acciones de centros: no partir 'Editar centro', 'Desactivar centro', etc. */
  .ux-v40 .site-actions-grid .mini-btn{
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    min-height:40px!important;
  }
}

/* Entre tablet grande y portátil estrecho, dos columnas son más legibles que
   cuatro columnas demasiado estrechas con títulos partidos. */
@media(min-width:821px) and (max-width:1180px){
  .ux-v40 .page-shell.product .record-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .ux-v40 .page-shell.product .record-summary>div{
    border-right:1px solid #ebeef1!important;
  }
}

/* En móvil se permite saltar de línea entre palabras, nunca dentro de una palabra. */
@media(max-width:820px){
  .ux-v40 :where(.btn,.mini-btn,.top-nav a,.top-nav summary,.management-tabs a,
    .site-actions-grid .mini-btn,.filter-actions .btn){
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  .ux-v40 .page-shell.product .record-summary .small-title{
    white-space:normal!important;
  }
  .ux-v40 .page-shell.product .record-summary .storage-chip{
    width:max-content!important;
    max-width:100%!important;
  }
}

/* Centros: si el viewport permite tabla, reservar espacio real a las acciones
   y evitar que los botones se conviertan en dos renglones. */
.ux-v40 .site-catalog-table th:nth-child(6){width:32%!important;}
.ux-v40 .site-actions-grid{
  grid-template-columns:repeat(2,minmax(125px,1fr))!important;
}
.ux-v40 .site-actions-grid>form:last-of-type{grid-column:1/-1;}
@media(max-width:1050px){
  .ux-v40 .site-actions-grid{grid-template-columns:1fr!important;}
  .ux-v40 .site-actions-grid>form:last-of-type{grid-column:auto!important;}
}

/* Badges y estados son unidades semánticas: nunca se parten. */
.ux-v40 :where(.badge,.state-badge,.phase-chip,.storage-chip b,.notify-state,.permission-pill){
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* =========================================================
   DPUNTO STOCK · UX/UI v40.3 precision fixes
   Fases completas · Acciones de cuentas · Estado de códigos
   ========================================================= */

/* FASES: nunca truncar ni partir nombres. Las tarjetas crecen con su contenido. */
.ux-v40 .phase-grid-flow .phase-card,
.ux-v40 .page-shell.product .timeline-step{
  height:auto!important;
  overflow:visible!important;
}
.ux-v40 .phase-grid-flow .phase-card h3,
.ux-v40 .timeline.timeline-flow .timeline-step .step-name,
.ux-v40 .product .timeline.timeline-flow .timeline-step .step-name{
  display:block!important;
  max-width:none!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  hyphens:none!important;
  line-height:1.25!important;
}
.ux-v40 .phase-grid-flow .phase-card h3{
  min-height:2.5em!important;
  margin:10px 0 10px!important;
}
.ux-v40 .timeline.timeline-flow .timeline-step .step-name,
.ux-v40 .product .timeline.timeline-flow .timeline-step .step-name{
  min-height:2.5em!important;
  align-self:start!important;
}
.ux-v40 .timeline.timeline-flow .timeline-step,
.ux-v40 .product .timeline.timeline-flow .timeline-step{
  min-height:138px!important;
  grid-template-rows:auto auto 1fr!important;
}
/* Antes de que seis columnas empiecen a comprimir títulos, pasar a tres. */
@media (min-width:821px) and (max-width:1480px){
  .ux-v40 .phase-grid.phase-grid-flow,
  .ux-v40 .timeline.timeline-flow,
  .ux-v40 .product .timeline.timeline-flow{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* CUENTAS DE ACCESO: la tabla real tiene cuatro columnas. Los anchos antiguos
   de seis columnas comprimían Acciones y hacían desbordar Gestionar contraseña. */
@media (min-width:821px){
  .ux-v40 .account-catalog-panel table{
    width:100%!important;
    table-layout:fixed!important;
  }
  .ux-v40 .account-catalog-panel th:nth-child(1),
  .ux-v40 .account-catalog-panel td:nth-child(1){width:39%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(2),
  .ux-v40 .account-catalog-panel td:nth-child(2){width:19%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(3),
  .ux-v40 .account-catalog-panel td:nth-child(3){width:12%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(4),
  .ux-v40 .account-catalog-panel td:nth-child(4){width:30%!important;}

  .ux-v40 .account-catalog-panel .account-actions-cell{
    min-width:0!important;
    width:auto!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .ux-v40 .account-actions-grid{
    width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(108px,.9fr) minmax(168px,1.45fr) minmax(92px,.8fr)!important;
    gap:10px!important;
    align-items:stretch!important;
  }
  .ux-v40 .account-actions-grid>form,
  .ux-v40 .account-actions-grid>button{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }
  .ux-v40 .account-actions-grid .mini-btn{
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    padding:9px 10px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    line-height:1.15!important;
    font-size:.78rem!important;
  }
  .ux-v40 .account-actions-grid .account-password-btn{
    padding-inline:12px!important;
  }
}
@media (min-width:821px) and (max-width:1120px){
  .ux-v40 .account-catalog-panel th:nth-child(1),
  .ux-v40 .account-catalog-panel td:nth-child(1){width:32%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(2),
  .ux-v40 .account-catalog-panel td:nth-child(2){width:18%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(3),
  .ux-v40 .account-catalog-panel td:nth-child(3){width:13%!important;}
  .ux-v40 .account-catalog-panel th:nth-child(4),
  .ux-v40 .account-catalog-panel td:nth-child(4){width:37%!important;}
  .ux-v40 .account-actions-grid{
    grid-template-columns:1fr 1.35fr!important;
  }
  .ux-v40 .account-actions-grid .account-delete-btn{
    grid-column:1/-1!important;
  }
}

/* CÓDIGOS CLIENTE: el badge de estado ocupa su propia línea dentro del bloque
   de identidad. Así no invade ni el código ni la descripción de la tarjeta. */
@media (min-width:721px){
  .ux-v40 .client-code-card{
    grid-template-columns:minmax(145px,.85fr) minmax(0,1.25fr) minmax(180px,.95fr)!important;
    grid-template-areas:
      "head desc metrics"
      "actions actions actions"!important;
    column-gap:16px!important;
    row-gap:14px!important;
    align-items:start!important;
  }
  .ux-v40 .client-code-card-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"identity" "status"!important;
    align-content:start!important;
    align-items:start!important;
    justify-items:start!important;
    gap:9px!important;
    min-width:0!important;
    padding:0 0 10px!important;
    border-bottom:0!important;
  }
  .ux-v40 .client-code-identity{
    grid-area:identity!important;
    width:100%!important;
    min-width:0!important;
  }
  .ux-v40 .client-code-status{
    grid-area:status!important;
    position:static!important;
    float:none!important;
    width:auto!important;
    max-width:100%!important;
    margin:0!important;
    justify-self:start!important;
    align-self:start!important;
  }
  .ux-v40 .client-code-status .badge{
    position:static!important;
    margin:0!important;
  }
  .ux-v40 .client-code-description{
    padding-left:16px!important;
    padding-right:0!important;
    border-left:1px solid #e6eaef!important;
    align-self:stretch!important;
  }
  .ux-v40 .client-code-metrics{
    padding:0!important;
    align-self:start!important;
  }
  .ux-v40 .client-code-actions{
    padding:12px 0 0!important;
    border-top:1px solid #eaedf1!important;
    width:100%!important;
  }
}

/* En móvil el badge sigue junto a la identidad, pero nunca sobre contenido. */
@media (max-width:720px){
  .ux-v40 .client-code-card-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:10px!important;
    align-items:start!important;
  }
  .ux-v40 .client-code-status{
    position:static!important;
    margin:0!important;
    align-self:start!important;
  }
}

/* =========================================================
   DPUNTO STOCK · UX/UI v40.4 precision fixes
   KPIs centrados · Timeline sin solapes · Inventario estable
   ========================================================= */

/* GESTIÓN · Resumen de clientes: cifra y etiqueta siempre centradas. */
.ux-v40 .client-summary>div{
  display:grid!important;
  grid-template-columns:1fr!important;
  justify-items:center!important;
  align-content:center!important;
  text-align:center!important;
}
.ux-v40 .client-summary>div>b,
.ux-v40 .client-summary>div>span{
  width:100%!important;
  text-align:center!important;
  justify-self:center!important;
}

/* RECORRIDO DE LA PIEZA · cada elemento reserva el espacio de su contenido.
   En seis columnas la flecha vive únicamente en el hueco entre tarjetas. */
@media (min-width:1481px){
  .ux-v40 .page-shell.product .timeline.timeline-flow,
  .ux-v40 .timeline.timeline-flow,
  .ux-v40 .phase-grid.phase-grid-flow{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:30px!important;
  }
  .ux-v40 .phase-grid.phase-grid-flow .phase-card:not(:last-child)::after{
    width:24px!important;
    height:24px!important;
    right:-15px!important;
    top:50%!important;
    transform:translate(50%,-50%)!important;
    font-size:.88rem!important;
    pointer-events:none!important;
  }
  .ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step:not(:last-child)::after,
  .ux-v40 .timeline.timeline-flow .timeline-step:not(:last-child)::after{
    display:grid!important;
    width:24px!important;
    height:24px!important;
    right:-15px!important;
    top:50%!important;
    transform:translate(50%,-50%)!important;
    font-size:.88rem!important;
    z-index:1!important;
    pointer-events:none!important;
  }
}
/* Al pasar a 3/2 columnas no existe una continuidad horizontal única;
   se eliminan los conectores para impedir flechas sobre tarjetas/textos. */
@media (max-width:1480px){
  .ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step::after,
  .ux-v40 .timeline.timeline-flow .timeline-step::after,
  .ux-v40 .phase-grid.phase-grid-flow .phase-card::after{
    display:none!important;
  }
}
.ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step,
.ux-v40 .timeline.timeline-flow .timeline-step{
  min-width:0!important;
  padding:15px 14px!important;
  gap:9px!important;
}
.ux-v40 .page-shell.product .timeline.timeline-flow .step-num,
.ux-v40 .timeline.timeline-flow .step-num{
  display:inline-flex!important;
  width:max-content!important;
  min-width:26px!important;
  height:26px!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 7px!important;
  border-radius:999px!important;
  background:var(--phase-bg)!important;
  line-height:1!important;
}
.ux-v40 .page-shell.product .timeline.timeline-flow .step-name,
.ux-v40 .timeline.timeline-flow .step-name{
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  line-height:1.28!important;
}
.ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step>small,
.ux-v40 .timeline.timeline-flow .timeline-step>small{
  display:block!important;
  margin-top:3px!important;
  padding-top:8px!important;
  border-top:1px solid rgba(130,143,158,.20)!important;
  line-height:1.25!important;
}

/* INVENTARIO PC · reservar anchura suficiente a Fase logística para que su
   chip jamás invada Solicitante. Si el viewport es estrecho, la tabla puede
   desplazarse horizontalmente en vez de superponer información. */
@media (min-width:821px){
  .ux-v40 .inventory-table-wrap{
    overflow-x:auto!important;
    overflow-y:visible!important;
  }
  .ux-v40 .inventory-table{
    table-layout:fixed!important;
    min-width:1210px!important;
  }
  .ux-v40 .inventory-table th.select-col{width:3.5%!important;}
  .ux-v40 .inventory-table th.id-col{width:4%!important;}
  .ux-v40 .inventory-table th.client-col{width:7.5%!important;}
  .ux-v40 .inventory-table th.reference-col{width:14%!important;}
  .ux-v40 .inventory-table th.serial-col{width:7.5%!important;}
  .ux-v40 .inventory-table th.state-col{width:7%!important;}
  .ux-v40 .inventory-table th.phase-col{width:12%!important;}
  .ux-v40 .inventory-table th.request-col{width:11%!important;}
  .ux-v40 .inventory-table th.destination-col{width:10%!important;}
  .ux-v40 .inventory-table th.location-col{width:10%!important;}
  .ux-v40 .inventory-table th.updated-col{width:7%!important;}
  .ux-v40 .inventory-table th.open-col{width:4%!important;}

  .ux-v40 .inventory-table td.phase-col,
  .ux-v40 .inventory-table th.phase-col{
    overflow:visible!important;
  }
  .ux-v40 .inventory-table td.phase-col .phase-chip{
    max-width:none!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    vertical-align:middle!important;
  }
  .ux-v40 .inventory-table td.request-col{
    position:relative!important;
    z-index:0!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }
}

/* En móvil el inventario vuelve a tarjetas sin ancho mínimo de tabla. */
@media (max-width:820px){
  .ux-v40 .inventory-table{min-width:0!important;table-layout:auto!important;}
  .ux-v40 .inventory-table td.phase-col .phase-chip{
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
}


/* =========================================================
   DPUNTO STOCK · UX/UI v40.5 · MODO OSCURO
   Tema persistente, accesible y sin alterar la lógica funcional.
   ========================================================= */

/* Control de tema */
.ux-v40 .theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:40px;height:40px;padding:0 12px;border:1px solid var(--ux-border);
  border-radius:11px;background:var(--ux-surface-2);color:#425060;
  font:inherit;font-size:.8rem;font-weight:800;cursor:pointer;white-space:nowrap;
  transition:background .15s,border-color .15s,color .15s,transform .15s;
}
.ux-v40 .theme-toggle:hover{border-color:#afc8e4;background:var(--ux-blue-soft);color:var(--ux-blue-dark);}
.ux-v40 .theme-toggle:active{transform:translateY(1px);}
.ux-v40 .theme-toggle:focus-visible{outline:3px solid rgba(81,141,207,.22);outline-offset:2px;}
.ux-v40 .theme-toggle-icon{font-size:1rem;line-height:1;width:18px;text-align:center;}
.ux-v40 .theme-toggle-alone{margin-left:auto;}
@media(max-width:980px){.ux-v40 .theme-toggle-label{display:none}.ux-v40 .theme-toggle{width:40px;padding:0}}
@media(max-width:820px){.ux-v40 .header-actions .theme-toggle{order:-1;flex:0 0 40px}}

@media screen{
  html[data-theme="dark"] body.ux-v40{
    --ux-navy:#0c121a;
    --ux-navy-soft:#141f2c;
    --ux-blue:#659cd9;
    --ux-blue-dark:#8eb6e5;
    --ux-blue-soft:#1d2c3d;
    --ux-canvas:#0c1219;
    --ux-surface:#121921;
    --ux-surface-2:#17202a;
    --ux-border:#2b3642;
    --ux-border-strong:#404e5e;
    --ux-text:#edf1f6;
    --ux-muted:#a3aebc;
    --ux-success:#86d1a2;
    --ux-success-bg:#152820;
    --ux-warning:#e3c783;
    --ux-warning-bg:#2e2718;
    --ux-danger:#e3928b;
    --ux-danger-bg:#301d1d;
    --ux-shadow:0 10px 28px rgba(0,0,0,.18);
    --ux-shadow-float:0 18px 48px rgba(0,0,0,.34);
    background:var(--ux-canvas)!important;color:var(--ux-text)!important;
  }
  html[data-theme="dark"] body.ux-v40::selection{background:#4b75a4;color:#ffffff;}

  /* Texto y superficies base */
  html[data-theme="dark"] .ux-v40 h1,
  html[data-theme="dark"] .ux-v40 h2,
  html[data-theme="dark"] .ux-v40 h3,
  html[data-theme="dark"] .ux-v40 h4,
  html[data-theme="dark"] .ux-v40 strong,
  html[data-theme="dark"] .ux-v40 b{color:var(--ux-text);}
  html[data-theme="dark"] .ux-v40 .lead,
  html[data-theme="dark"] .ux-v40 .fine,
  html[data-theme="dark"] .ux-v40 .muted,
  html[data-theme="dark"] .ux-v40 .hint{color:var(--ux-muted)!important;}

  html[data-theme="dark"] .ux-v40 .header{
    background:rgba(13,19,27,.96)!important;border-color:var(--ux-border)!important;
  }
  html[data-theme="dark"] .ux-v40 .brand-caption{color:#99a5b3!important;}
  html[data-theme="dark"] .ux-v40 .brand-divider{border-color:var(--ux-border-strong)!important;}
  html[data-theme="dark"] .ux-v40 .header-search-link,
  html[data-theme="dark"] .ux-v40 .theme-toggle,
  html[data-theme="dark"] .ux-v40 .nav-toggle{background:var(--ux-surface-2)!important;border-color:var(--ux-border)!important;color:#ced7e1!important;}
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{color:#c9d2dc!important;}
  html[data-theme="dark"] .ux-v40 .top-nav>a:hover,
  html[data-theme="dark"] .ux-v40 .top-nav>a[aria-current=page],
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary:hover,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary[aria-current=page],
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group[open]>summary{background:var(--ux-blue-soft)!important;color:#a9ccf3!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{background:#141c25!important;border-color:var(--ux-border)!important;box-shadow:var(--ux-shadow-float)!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown>a{color:#ced6df!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown>a:hover,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown>a[aria-current=page]{background:var(--ux-blue-soft)!important;color:#a9ccf3!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown .logout{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown .logout button{background:#1c252f!important;color:#c9d2dd!important;}

  /* Contenedores principales */
  html[data-theme="dark"] .ux-v40 .panel-box,
  html[data-theme="dark"] .ux-v40 .create-card,
  html[data-theme="dark"] .ux-v40 .table-shell,
  html[data-theme="dark"] .ux-v40 .stage-card,
  html[data-theme="dark"] .ux-v40 .auth-card,
  html[data-theme="dark"] .ux-v40 .excel-panel,
  html[data-theme="dark"] .ux-v40 .pending-shell,
  html[data-theme="dark"] .ux-v40 .global-search-shell,
  html[data-theme="dark"] .ux-v40 .client-catalog-panel,
  html[data-theme="dark"] .ux-v40 .site-catalog-panel,
  html[data-theme="dark"] .ux-v40 .account-catalog-panel,
  html[data-theme="dark"] .ux-v40 .client-code-card,
  html[data-theme="dark"] .ux-v40 .batch-shared-card,
  html[data-theme="dark"] .ux-v40 .audit-shell,
  html[data-theme="dark"] .ux-v40 .search-result-card,
  html[data-theme="dark"] .ux-v40 .danger-confirm-card{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;box-shadow:var(--ux-shadow)!important;}

  /* Formularios */
  html[data-theme="dark"] .ux-v40 input:not([type=checkbox]):not([type=hidden]),
  html[data-theme="dark"] .ux-v40 textarea,
  html[data-theme="dark"] .ux-v40 select{background:#0f161e!important;color:var(--ux-text)!important;border-color:var(--ux-border-strong)!important;}
  html[data-theme="dark"] .ux-v40 input::placeholder,
  html[data-theme="dark"] .ux-v40 textarea::placeholder{color:#7c8998!important;opacity:1;}
  html[data-theme="dark"] .ux-v40 label.field,
  html[data-theme="dark"] .ux-v40 label.search-field,
  html[data-theme="dark"] .ux-v40 .filters label,
  html[data-theme="dark"] .ux-v40 .upload-form label,
  html[data-theme="dark"] .ux-v40 .user-form label,
  html[data-theme="dark"] .ux-v40 .answer-form label,
  html[data-theme="dark"] .ux-v40 .message-form label,
  html[data-theme="dark"] .ux-v40 .commit-form label{color:#b0bac6!important;}
  html[data-theme="dark"] .ux-v40 input[type=file]{background:#0f161e!important;}

  /* Botones */
  html[data-theme="dark"] .ux-v40 .btn.outline{background:#161f29!important;color:#dde4eb!important;border-color:var(--ux-border-strong)!important;}
  html[data-theme="dark"] .ux-v40 .btn.outline:hover{background:#1e2a37!important;border-color:#6b8aae!important;}
  html[data-theme="dark"] .ux-v40 .text-action:hover{background:#1d2835!important;color:#dee6f0!important;}

  /* Dashboard */
  html[data-theme="dark"] .ux-v40 .dashboard-status-band,
  html[data-theme="dark"] .ux-v40 .recent-list,
  html[data-theme="dark"] .ux-v40 .dashboard-help,
  html[data-theme="dark"] .ux-v40 .attention-card{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-status-band>div{border-color:var(--ux-border)!important;background:transparent!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-status-band .is-good{background:linear-gradient(180deg,#14221d 0%,#121921 100%)!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-status-band .is-defect{background:linear-gradient(180deg,#28191a 0%,#121921 100%)!important;}
  html[data-theme="dark"] .ux-v40 .attention-card.danger{background:#221718!important;border-color:#543030!important;}
  html[data-theme="dark"] .ux-v40 .attention-card.warning{background:#241f15!important;border-color:#524628!important;}
  html[data-theme="dark"] .ux-v40 .recent-row{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-help-grid{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-help-grid article+article{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-card{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;}

  /* Inventario, tablas y filtros */
  html[data-theme="dark"] .ux-v40 .inventory-filters,
  html[data-theme="dark"] .ux-v40 .table-title,
  html[data-theme="dark"] .ux-v40 .table-shell{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .active-filter-bar,
  html[data-theme="dark"] .ux-v40 .bulk-toolbar,
  html[data-theme="dark"] .ux-v40 .bulk-toolbar-compact{background:#182330!important;border-color:#354455!important;}
  html[data-theme="dark"] .ux-v40 .filter-chip{background:#1f2f41!important;color:#b6d4f5!important;}
  html[data-theme="dark"] .ux-v40 .inventory-table th,
  html[data-theme="dark"] .ux-v40 .batch-table th,
  html[data-theme="dark"] .ux-v40 .client-catalog-table th,
  html[data-theme="dark"] .ux-v40 .site-catalog-table th,
  html[data-theme="dark"] .ux-v40 .users-table th{background:#17202a!important;color:#a7b2bf!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 table td{border-color:#242f3c!important;color:#e1e7ee;}
  html[data-theme="dark"] .ux-v40 tbody tr:hover{background:#17202a!important;}
  html[data-theme="dark"] .ux-v40 .inventory-open .table-arrow{background:#1e2833!important;color:#b1c4db!important;}
  html[data-theme="dark"] .ux-v40 .empty,
  html[data-theme="dark"] .ux-v40 .empty-state,
  html[data-theme="dark"] .ux-v40 .search-empty-state{background:#131a23!important;border-color:#404e5f!important;color:#a7b2bf!important;}
  html[data-theme="dark"] .ux-v40 .search-summary{background:#1a2735!important;border-color:#36485c!important;color:#c5d5e8!important;}

  /* Producto / fases */
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary,
  html[data-theme="dark"] .ux-v40 .page-shell.product .stage-card,
  html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head,
  html[data-theme="dark"] .ux-v40 .page-shell.product .history{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .phase-chip{background:#1b2938!important;border-color:#354659!important;color:#dee6f0!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .status-marker{background:#1c242d!important;color:#b1bbc7!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .stage-toggle{background:#19222c!important;border-color:var(--ux-border)!important;color:#bfc9d5!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step>small{border-color:#2f3a46!important;color:#a3aebc!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip{background:#1d2936!important;border-color:#39495b!important;color:#d4dee9!important;}

  /* Recepción y escaneo */
  html[data-theme="dark"] .ux-v40 .new-reception-actions{background:#19222c!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .new-reception-actions .btn.primary{background:#243343!important;color:#b7d4f5!important;}
  html[data-theme="dark"] .ux-v40 .scan-help,
  html[data-theme="dark"] .ux-v40 .batch-scan-toolbar,
  html[data-theme="dark"] .ux-v40 .batch-table-wrap,
  html[data-theme="dark"] .ux-v40 .reception-notification-strip,
  html[data-theme="dark"] .ux-v40 .notification-statuses>div{background:#161f29!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;}
  html[data-theme="dark"] .ux-v40 .scan-inline,
  html[data-theme="dark"] .ux-v40 .client-photo-btn{background:#1a242f!important;border-color:#3f4f61!important;color:#a6caf3!important;}
  html[data-theme="dark"] .ux-v40 input[data-just-scanned="1"]{background:#152820!important;}

  /* Gestión */
  html[data-theme="dark"] .ux-v40 .management-tabs{background:#161e28!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .management-tabs a{color:#c0c9d4!important;}
  html[data-theme="dark"] .ux-v40 .management-tabs a:hover,
  html[data-theme="dark"] .ux-v40 .management-tabs a:focus-visible,
  html[data-theme="dark"] .ux-v40 .management-tabs a[aria-current=page]{background:#233242!important;color:#accdf4!important;}
  html[data-theme="dark"] .ux-v40 .client-summary>div,
  html[data-theme="dark"] .ux-v40 .client-code-metrics>div{background:#161e27!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;}
  html[data-theme="dark"] .ux-v40 .client-code-description{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .client-code-actions{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .mini-btn,
  html[data-theme="dark"] .ux-v40 .compact-action-btn{background:#19232d!important;border-color:#404f60!important;color:#d0dae5!important;}
  html[data-theme="dark"] .ux-v40 .mini-btn-danger{background:#291a1b!important;border-color:#663838!important;color:#e7a8a2!important;}
  html[data-theme="dark"] .ux-v40 .mini-btn-enable{background:#162820!important;border-color:#375e49!important;color:#9ad7b0!important;}

  /* Búsqueda, auditoría, pendientes */
  html[data-theme="dark"] .ux-v40 .pending-kpi,
  html[data-theme="dark"] .ux-v40 .audit-summary>div,
  html[data-theme="dark"] .ux-v40 .search-group{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .pending-kpi b{background:#202933!important;color:#ced6e0!important;}
  html[data-theme="dark"] .ux-v40 .pending-kpi.danger b{background:#361d1e!important;color:#e5a6a0!important;}
  html[data-theme="dark"] .ux-v40 .pending-row,
  html[data-theme="dark"] .ux-v40 .audit-row{border-color:var(--ux-border)!important;background:var(--ux-surface)!important;}
  html[data-theme="dark"] .ux-v40 .audit-change,
  html[data-theme="dark"] .ux-v40 .audit-detail-card{background:#161e27!important;border-color:var(--ux-border)!important;}

  /* Excel */
  html[data-theme="dark"] .ux-v40 .excel-drop-zone,
  html[data-theme="dark"] .ux-v40 .excel-tool-card,
  html[data-theme="dark"] .ux-v40 .excel-review,
  html[data-theme="dark"] .ux-v40 .excel-summary-grid>div{background:var(--ux-surface)!important;border-color:var(--ux-border)!important;color:var(--ux-text)!important;}
  html[data-theme="dark"] .ux-v40 .excel-step{background:#161e28!important;border-color:var(--ux-border)!important;color:#b1bbc7!important;}
  html[data-theme="dark"] .ux-v40 .excel-step.is-active{background:#1f2f41!important;border-color:#55708f!important;color:#cadef5!important;}
  html[data-theme="dark"] .ux-v40 .excel-safety-note{background:#292418!important;border-color:#635530!important;color:#e0ce99!important;}

  /* Modales */
  html[data-theme="dark"] .ux-v40 .app-modal{background:rgba(3,6,11,.68)!important;}
  html[data-theme="dark"] .ux-v40 .app-modal-card{background:#121921!important;border-color:#35414f!important;color:var(--ux-text)!important;box-shadow:0 24px 70px rgba(0,0,0,.55)!important;}
  html[data-theme="dark"] .ux-v40 .app-modal-head{border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .modal-close{background:#1c252f!important;border-color:var(--ux-border)!important;color:#ccd4de!important;}
  html[data-theme="dark"] .ux-v40 .bulk-delete-warning{background:#291a1b!important;border-color:#613939!important;color:#deb9b6!important;}

  /* Login / footer */
  html[data-theme="dark"] .ux-v40.login-body{background:#0c1219!important;}
  html[data-theme="dark"] .ux-v40 .auth-card{background:#121921!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .site-footer{background:#0f161f!important;border-color:var(--ux-border)!important;color:#8f9ba8!important;}
  html[data-theme="dark"] .ux-v40 .project-signature{color:#99a4b0!important;}

  /* Móvil */
  @media(max-width:820px){
    html[data-theme="dark"] .ux-v40 .top-nav{background:#111821!important;border-color:var(--ux-border)!important;box-shadow:20px 0 50px rgba(0,0,0,.42)!important;}
    html[data-theme="dark"] .ux-v40 .nav-scrim{background:rgba(0,0,0,.58)!important;}
    html[data-theme="dark"] .ux-v40 .inventory-table tbody{background:#0c1219!important;}
    html[data-theme="dark"] .ux-v40 .inventory-table tr,
    html[data-theme="dark"] .ux-v40 .batch-table tr{background:#121921!important;border-color:var(--ux-border)!important;}
    html[data-theme="dark"] .ux-v40 .inventory-card-open{background:#1d2b3a!important;color:#adccf1!important;}
  }
}

/* v40.5 · ajuste semántico de chips/badges en oscuro */
@media screen{
  html[data-theme="dark"] .ux-v40 .badge{
    background:#1f2933!important;color:#c1cad5!important;border-color:#35414f!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.good,
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.good{
    background:#182f24!important;color:#93d6ac!important;border-color:#345b46!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.defect,
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.defect{
    background:#321d1d!important;color:#e59f99!important;border-color:#633837!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.historic{
    background:#212831!important;color:#abb4be!important;border-color:#3c4651!important;
  }
  html[data-theme="dark"] .ux-v40 .permission-pill{
    background:#1d2b3b!important;border-color:#3a4e64!important;color:#b7d2f2!important;
  }
  html[data-theme="dark"] .ux-v40 .storage-chip b{
    background:#232e3b!important;color:#c9d5e2!important;
  }
  html[data-theme="dark"] .ux-v40 .storage-chip span{color:#dbe3ed!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.balda b{background:#193026!important;color:#99d3ae!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.palet b{background:#1d2d3f!important;color:#acccf0!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.legacy b{background:#33291b!important;color:#e0c491!important;}
  html[data-theme="dark"] .ux-v40 td small,
  html[data-theme="dark"] .ux-v40 .client-code-label,
  html[data-theme="dark"] .ux-v40 .site-action-note,
  html[data-theme="dark"] .ux-v40 .search-result-meta,
  html[data-theme="dark"] .ux-v40 .pending-meta,
  html[data-theme="dark"] .ux-v40 .recent-meta{color:#99a5b3!important;}
}

/* =========================================================
   DPUNTO STOCK · UX/UI v40.6
   Gestión móvil alineada · navegación de gestión en rejilla
   ========================================================= */

/* Resumen de Gestión: tres métricas con estructura idéntica.
   El número queda siempre centrado encima de su etiqueta. */
.ux-v40 .client-summary{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
}
.ux-v40 .client-summary>div,
.ux-v40 .client-summary>div:last-child{
  grid-column:auto!important;
  min-width:0!important;
  min-height:86px!important;
  padding:13px 10px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  text-align:center!important;
}
.ux-v40 .client-summary>div>b{
  display:block!important;
  width:100%!important;
  margin:0!important;
  font-size:1.45rem!important;
  line-height:1!important;
  text-align:center!important;
}
.ux-v40 .client-summary>div>span{
  display:block!important;
  width:100%!important;
  margin:0!important;
  line-height:1.22!important;
  text-align:center!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* Clientes / Centros / Cuentas / Administradores dejan de parecer enlaces
   seguidos y pasan a ser accesos visualmente separados en una rejilla. */
.ux-v40 .management-tabs{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  max-width:none!important;
  margin:-3px 0 20px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
}
.ux-v40 .management-tabs a{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:0!important;
  min-height:58px!important;
  padding:12px 14px!important;
  border:1px solid var(--ux-border)!important;
  border-radius:13px!important;
  background:#ffffff!important;
  color:#435263!important;
  text-align:center!important;
  font-size:.84rem!important;
  font-weight:850!important;
  line-height:1.15!important;
  box-shadow:0 2px 0 rgba(31,46,64,.025)!important;
  white-space:normal!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  transition:border-color .16s ease,background .16s ease,color .16s ease,transform .16s ease!important;
}
.ux-v40 .management-tabs a::after{
  content:'';
  position:absolute;
  left:14px;
  right:14px;
  bottom:8px;
  height:2px;
  border-radius:999px;
  background:#e1e7ee;
}
.ux-v40 .management-tabs a:hover,
.ux-v40 .management-tabs a:focus-visible{
  background:#f6fafe!important;
  border-color:#b9cbe0!important;
  color:var(--ux-blue-dark)!important;
  transform:translateY(-1px);
}
.ux-v40 .management-tabs a:hover::after,
.ux-v40 .management-tabs a:focus-visible::after{
  background:#77a4d7;
}

@media(max-width:820px){
  .ux-v40 .management-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .ux-v40 .management-tabs a{
    min-height:56px!important;
    padding:11px 10px!important;
  }
}

@media(max-width:560px){
  /* En móvil se mantienen las tres métricas en la misma fila para que las
     cifras compartan exactamente el mismo eje vertical. */
  .ux-v40 .client-summary{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .ux-v40 .client-summary>div,
  .ux-v40 .client-summary>div:last-child{
    grid-column:auto!important;
    min-height:92px!important;
    padding:10px 5px!important;
    gap:6px!important;
  }
  .ux-v40 .client-summary>div>b{
    font-size:1.32rem!important;
  }
  .ux-v40 .client-summary>div>span{
    font-size:clamp(.60rem,2.65vw,.70rem)!important;
    line-height:1.18!important;
  }
}

@media(max-width:360px){
  .ux-v40 .client-summary{gap:5px!important;}
  .ux-v40 .client-summary>div,
  .ux-v40 .client-summary>div:last-child{padding:9px 3px!important;}
  .ux-v40 .client-summary>div>span{font-size:.58rem!important;}
  .ux-v40 .management-tabs{gap:6px!important;}
  .ux-v40 .management-tabs a{font-size:.75rem!important;padding:10px 7px!important;}
}

@media screen{
  html[data-theme="dark"] .ux-v40 .management-tabs{
    background:transparent!important;
    border:0!important;
  }
  html[data-theme="dark"] .ux-v40 .management-tabs a{
    background:#161e27!important;
    border-color:var(--ux-border)!important;
    color:#c8d0da!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] .ux-v40 .management-tabs a::after{background:#34404f!important;}
  html[data-theme="dark"] .ux-v40 .management-tabs a:hover,
  html[data-theme="dark"] .ux-v40 .management-tabs a:focus-visible{
    background:#202f3f!important;
    border-color:#516780!important;
    color:#b5d3f6!important;
  }
  html[data-theme="dark"] .ux-v40 .management-tabs a:hover::after,
  html[data-theme="dark"] .ux-v40 .management-tabs a:focus-visible::after{background:#7fafe4!important;}
}


/* =========================================================
   DPUNTO STOCK · UX/UI v40.7
   Marca del nav adaptable a tema claro/oscuro.
   ========================================================= */
.ux-v40 .brand-v407{
  --brand-ink:#162739;
  --brand-accent:#518dcf;
  display:inline-flex!important;
  align-items:center!important;
  gap:13px!important;
  color:var(--brand-ink)!important;
  text-decoration:none!important;
  overflow:visible!important;
}
.ux-v40 .brand-v407 .brand-lockup{
  display:inline-flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
  min-width:0;
}
.ux-v40 .brand-v407 .brand-symbol{
  display:block;
  width:39px;
  height:39px;
  flex:0 0 39px;
  overflow:visible;
}
.ux-v40 .brand-v407 .brand-symbol-shell{fill:var(--brand-ink);}
.ux-v40 .brand-v407 .brand-symbol-cut{fill:var(--ux-surface);}
.ux-v40 .brand-v407 .brand-symbol-accent{fill:var(--brand-accent);}
.ux-v40 .brand-v407 .brand-word{
  display:block;
  color:var(--brand-ink)!important;
  font-size:2rem;
  line-height:.9;
  font-weight:850;
  letter-spacing:-.075em;
  white-space:nowrap;
}
.ux-v40 .brand-v407:hover .brand-word{color:var(--ux-blue-dark)!important;}
.ux-v40 .brand-v407:hover .brand-symbol-shell{fill:var(--ux-blue-dark);}

@media(max-width:1100px){
  .ux-v40 .brand-v407 .brand-symbol{width:35px;height:35px;flex-basis:35px;}
  .ux-v40 .brand-v407 .brand-word{font-size:1.78rem;}
}
@media(max-width:820px){
  .ux-v40 .brand-v407{max-width:calc(100% - 112px)!important;}
  .ux-v40 .brand-v407 .brand-symbol{width:34px;height:34px;flex-basis:34px;}
  .ux-v40 .brand-v407 .brand-word{font-size:1.7rem;}
}
@media(max-width:560px){
  .ux-v40 .brand-v407{gap:8px!important;}
  .ux-v40 .brand-v407 .brand-lockup{gap:5px;}
  .ux-v40 .brand-v407 .brand-symbol{width:31px;height:31px;flex-basis:31px;}
  .ux-v40 .brand-v407 .brand-word{font-size:1.55rem;}
}

@media screen{
  html[data-theme="dark"] .ux-v40 .brand-v407{
    --brand-ink:#f4f6f9;
    --brand-accent:#83b4ed;
  }
  html[data-theme="dark"] .ux-v40 .brand-v407 .brand-symbol-cut{fill:#111821;}
  html[data-theme="dark"] .ux-v40 .brand-v407:hover .brand-word{color:#adcff5!important;}
  html[data-theme="dark"] .ux-v40 .brand-v407:hover .brand-symbol-shell{fill:#adcff5;}
}

@media print{
  .ux-v40 .brand-v407{--brand-ink:#162739;--brand-accent:#518dcf;}
  .ux-v40 .brand-v407 .brand-symbol-cut{fill:#ffffff;}
}

/* =========================================================
   DPUNTO STOCK · UX/UI v40.8
   Modo oscuro más sólido · logo oficial raster · toggle refinado
   ========================================================= */

/* Marca del nav: usa el logo oficial proporcionado por el cliente.
   Se mantiene el aspecto exacto del logotipo y se mejora su nitidez. */
.ux-v40 .brand-v408{
  display:inline-flex!important;
  align-items:center!important;
  gap:13px!important;
  min-width:0!important;
  text-decoration:none!important;
  overflow:visible!important;
}
.ux-v40 .brand-v408 .brand-lockup{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex:0 0 auto!important;
  min-width:0!important;
}
.ux-v40 .brand-v408 .brand-logo-img{
  display:block!important;
  width:128px!important;
  max-width:128px!important;
  height:auto!important;
  object-fit:contain!important;
  image-rendering:auto;
}
@media(max-width:1100px){
  .ux-v40 .brand-v408 .brand-logo-img{width:122px!important;max-width:122px!important;}
}
@media(max-width:820px){
  .ux-v40 .brand-v408{max-width:calc(100% - 112px)!important;gap:10px!important;}
  .ux-v40 .brand-v408 .brand-logo-img{width:118px!important;max-width:118px!important;}
}
@media(max-width:560px){
  .ux-v40 .brand-v408{gap:8px!important;}
  .ux-v40 .brand-v408 .brand-logo-img{width:112px!important;max-width:112px!important;}
}

/* Toggle de tema con iconografía más cuidada. */
.ux-v40 .theme-toggle{
  gap:9px!important;
  min-height:42px!important;
  height:42px!important;
  padding:0 13px!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f3f6f9 100%)!important;
  border-color:#d3dae2!important;
  color:#3b4858!important;
  box-shadow:0 4px 14px rgba(13,22,33,.06), inset 0 1px 0 rgba(255,255,255,.9)!important;
}
.ux-v40 .theme-toggle:hover{
  background:linear-gradient(180deg,#ffffff 0%,#eef3f9 100%)!important;
  border-color:#afc8e4!important;
  color:var(--ux-blue-dark)!important;
}
.ux-v40 .theme-toggle-icon{
  width:22px!important;
  height:22px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,#fefefe 0%,#e9edf3 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92), 0 1px 4px rgba(12,20,29,.10)!important;
  color:#2f3f50!important;
  flex:0 0 22px!important;
}
.ux-v40 .theme-toggle-icon svg{display:block;width:15px;height:15px;}
.ux-v40 .theme-toggle-label{letter-spacing:.01em;}
@media(max-width:980px){
  .ux-v40 .theme-toggle{width:42px!important;padding:0!important;}
}

@media screen{
  /* Oscuro: el control se convierte en un chip consistente con el nav. */
  html[data-theme="dark"] .ux-v40 .theme-toggle{
    background:linear-gradient(180deg,#19222d 0%,#161e28 100%)!important;
    border-color:#384555!important;
    color:#dce4ec!important;
    box-shadow:0 6px 18px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04)!important;
  }
  html[data-theme="dark"] .ux-v40 .theme-toggle:hover{
    background:linear-gradient(180deg,#233242 0%,#212e3d 100%)!important;
    border-color:#5d728a!important;
    color:#b5d3f6!important;
  }
  html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
    background:linear-gradient(180deg,#273647 0%,#1d2a38 100%)!important;
    color:#bfdaf8!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 1px 6px rgba(0,0,0,.22)!important;
  }

  /* Refuerzo global de contraste para modo oscuro. */
  html[data-theme="dark"] .ux-v40,
  html[data-theme="dark"] .ux-v40 p,
  html[data-theme="dark"] .ux-v40 li,
  html[data-theme="dark"] .ux-v40 td,
  html[data-theme="dark"] .ux-v40 th,
  html[data-theme="dark"] .ux-v40 small,
  html[data-theme="dark"] .ux-v40 summary,
  html[data-theme="dark"] .ux-v40 label,
  html[data-theme="dark"] .ux-v40 .field-note,
  html[data-theme="dark"] .ux-v40 .fine,
  html[data-theme="dark"] .ux-v40 .table-title span,
  html[data-theme="dark"] .ux-v40 .table-title p,
  html[data-theme="dark"] .ux-v40 .empty,
  html[data-theme="dark"] .ux-v40 .empty-state,
  html[data-theme="dark"] .ux-v40 .app-modal-note,
  html[data-theme="dark"] .ux-v40 .confirm-modal-message{
    color:var(--ux-text)!important;
  }
  html[data-theme="dark"] .ux-v40 .eyebrow,
  html[data-theme="dark"] .ux-v40 .muted,
  html[data-theme="dark"] .ux-v40 .hint,
  html[data-theme="dark"] .ux-v40 .fine,
  html[data-theme="dark"] .ux-v40 .field-note,
  html[data-theme="dark"] .ux-v40 .table-title p,
  html[data-theme="dark"] .ux-v40 .search-result-meta,
  html[data-theme="dark"] .ux-v40 .recent-meta,
  html[data-theme="dark"] .ux-v40 .pending-meta,
  html[data-theme="dark"] .ux-v40 .client-code-scope,
  html[data-theme="dark"] .ux-v40 .site-meta,
  html[data-theme="dark"] .ux-v40 .status-note,
  html[data-theme="dark"] .ux-v40 .history time{
    color:#a1adbb!important;
  }

  /* Contenedores que seguían mostrando combinaciones pobres de color. */
  html[data-theme="dark"] .ux-v40 .kpi,
  html[data-theme="dark"] .ux-v40 .client-summary > div,
  html[data-theme="dark"] .ux-v40 .dashboard-status-band > div,
  html[data-theme="dark"] .ux-v40 .dashboard-help-grid article,
  html[data-theme="dark"] .ux-v40 .record-summary > div,
  html[data-theme="dark"] .ux-v40 .phase-card,
  html[data-theme="dark"] .ux-v40 .history-entry,
  html[data-theme="dark"] .ux-v40 .request-card,
  html[data-theme="dark"] .ux-v40 .auth-copy,
  html[data-theme="dark"] .ux-v40 .client-management-grid > a,
  html[data-theme="dark"] .ux-v40 .search-result-card,
  html[data-theme="dark"] .ux-v40 .notification-card,
  html[data-theme="dark"] .ux-v40 .admin-management,
  html[data-theme="dark"] .ux-v40 .user-row-compact,
  html[data-theme="dark"] .ux-v40 .site-more-row td,
  html[data-theme="dark"] .ux-v40 .filters,
  html[data-theme="dark"] .ux-v40 .inventory-table tr,
  html[data-theme="dark"] .ux-v40 .batch-table tr{
    background:var(--ux-surface)!important;
    border-color:var(--ux-border)!important;
    color:var(--ux-text)!important;
  }
  html[data-theme="dark"] .ux-v40 .record-summary > div:nth-child(n),
  html[data-theme="dark"] .ux-v40 .dashboard-help-grid article + article{
    border-color:var(--ux-border)!important;
  }

  /* Tablas y listados: evita texto blanco sobre celdas claras. */
  html[data-theme="dark"] .ux-v40 .inventory-table td,
  html[data-theme="dark"] .ux-v40 .batch-table td,
  html[data-theme="dark"] .ux-v40 .client-catalog-table td,
  html[data-theme="dark"] .ux-v40 .site-catalog-table td,
  html[data-theme="dark"] .ux-v40 .users-table td,
  html[data-theme="dark"] .ux-v40 .inventory-card-meta,
  html[data-theme="dark"] .ux-v40 .inventory-card-tags,
  html[data-theme="dark"] .ux-v40 .inventory-card-main,
  html[data-theme="dark"] .ux-v40 .inventory-card-phase{
    color:#e1e7ee!important;
    border-color:#27323e!important;
  }
  html[data-theme="dark"] .ux-v40 .users-table tbody tr,
  html[data-theme="dark"] .ux-v40 .client-catalog-table tbody tr,
  html[data-theme="dark"] .ux-v40 .site-catalog-table tbody tr{
    background:var(--ux-surface)!important;
  }

  /* Botones para que no queden textos claros sobre fondos claros. */
  html[data-theme="dark"] .ux-v40 .btn.primary,
  html[data-theme="dark"] .ux-v40 .confirm-danger{
    background:linear-gradient(180deg,#659cd9 0%,#5384ba 100%)!important;
    border-color:#659cd9!important;
    color:#09111a!important;
    box-shadow:0 8px 20px rgba(46,75,106,.28)!important;
  }
  html[data-theme="dark"] .ux-v40 .btn.primary:hover,
  html[data-theme="dark"] .ux-v40 .confirm-danger:hover{
    background:linear-gradient(180deg,#83b3e9 0%,#6198d4 100%)!important;
    color:#09111a!important;
  }
  html[data-theme="dark"] .ux-v40 .btn.outline,
  html[data-theme="dark"] .ux-v40 .mini-btn,
  html[data-theme="dark"] .ux-v40 .compact-action-btn,
  html[data-theme="dark"] .ux-v40 .header-search-link{
    color:#dce3eb!important;
  }

  /* Alertas y estados. */
  html[data-theme="dark"] .ux-v40 .alert,
  html[data-theme="dark"] .ux-v40 .global-flash{
    background:#171f28!important;
    border-color:#354150!important;
    color:#e7ecf2!important;
  }
  html[data-theme="dark"] .ux-v40 .alert.success,
  html[data-theme="dark"] .ux-v40 .global-flash.success{background:#152820!important;border-color:#385f4a!important;color:#a9dbbc!important;}
  html[data-theme="dark"] .ux-v40 .alert.error,
  html[data-theme="dark"] .ux-v40 .global-flash.error{background:#301d1d!important;border-color:#673d3d!important;color:#e7b4af!important;}
  html[data-theme="dark"] .ux-v40 .alert.warning,
  html[data-theme="dark"] .ux-v40 .global-flash.warning{background:#2e2718!important;border-color:#685a32!important;color:#e3d097!important;}
}


/* =========================================================
   v40.9 · Ajustes finales de contraste en modo oscuro + logo PNG
   ========================================================= */
.ux-v40 .brand-v408 .brand-logo-img{
  width:148px!important;
  max-width:148px!important;
  height:auto!important;
  object-fit:contain!important;
}
@media(max-width:1100px){
  .ux-v40 .brand-v408 .brand-logo-img{width:142px!important;max-width:142px!important;}
}
@media(max-width:820px){
  .ux-v40 .brand-v408 .brand-logo-img{width:136px!important;max-width:136px!important;}
}
@media(max-width:560px){
  .ux-v40 .brand-v408 .brand-logo-img{width:128px!important;max-width:128px!important;}
}

html[data-theme="dark"] .ux-v40 .notice,
html[data-theme="dark"] .ux-v40 .client-note,
html[data-theme="dark"] .ux-v40 .stage-lock-notice,
html[data-theme="dark"] .ux-v40 .global-search-form,
html[data-theme="dark"] .ux-v40 .hardware-scanner-status,
html[data-theme="dark"] .ux-v40 .client-code-more-actions>summary,
html[data-theme="dark"] .ux-v40 .client-code-more-menu,
html[data-theme="dark"] .ux-v40 .temp-secret-inline,
html[data-theme="dark"] .ux-v40 .excel-final-actions,
html[data-theme="dark"] .ux-v40 .excel-drop-zone,
html[data-theme="dark"] .ux-v40 .compact-notice.warning{
  background:var(--ux-surface-2)!important;
  border-color:var(--ux-border-strong)!important;
  color:var(--ux-text)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] .ux-v40 .notice,
html[data-theme="dark"] .ux-v40 .client-note,
html[data-theme="dark"] .ux-v40 .stage-lock-notice{
  border-left-color:#7fafe4!important;
}

html[data-theme="dark"] .ux-v40 .notice b,
html[data-theme="dark"] .ux-v40 .notice p,
html[data-theme="dark"] .ux-v40 .client-note h3,
html[data-theme="dark"] .ux-v40 .client-note p,
html[data-theme="dark"] .ux-v40 .stage-lock-notice b,
html[data-theme="dark"] .ux-v40 .stage-lock-notice p,
html[data-theme="dark"] .ux-v40 .global-search-form>label,
html[data-theme="dark"] .ux-v40 .global-search-form .fine,
html[data-theme="dark"] .ux-v40 .hardware-scanner-status b,
html[data-theme="dark"] .ux-v40 .hardware-scanner-status small,
html[data-theme="dark"] .ux-v40 .client-code-more-actions>summary,
html[data-theme="dark"] .ux-v40 .client-code-permission-note,
html[data-theme="dark"] .ux-v40 .temp-secret-inline>b,
html[data-theme="dark"] .ux-v40 .temp-secret-inline>small,
html[data-theme="dark"] .ux-v40 .excel-final-actions small,
html[data-theme="dark"] .ux-v40 .excel-drop-zone b,
html[data-theme="dark"] .ux-v40 .excel-drop-zone small,
html[data-theme="dark"] .ux-v40 .excel-file-name,
html[data-theme="dark"] .ux-v40 .compact-notice.warning,
html[data-theme="dark"] .ux-v40 .compact-notice.warning b{
  color:var(--ux-text)!important;
}

html[data-theme="dark"] .ux-v40 .hardware-scanner-status.has-read{
  background:#14251e!important;
  border-color:#3b684e!important;
}
html[data-theme="dark"] .ux-v40 .hardware-scanner-dot{
  box-shadow:0 0 0 4px rgba(78,164,112,.18)!important;
}

html[data-theme="dark"] .ux-v40 .global-search-form input,
html[data-theme="dark"] .ux-v40 .temp-secret-inline .temp-value{
  background:#0e151e!important;
  color:var(--ux-text)!important;
  border-color:var(--ux-border-strong)!important;
}

html[data-theme="dark"] .ux-v40 .search-empty-state{
  background:#131a22!important;
  border-color:#404f61!important;
  color:#bec6d1!important;
}
html[data-theme="dark"] .ux-v40 .search-empty-state b{
  color:#f1f5fa!important;
}

html[data-theme="dark"] .ux-v40 table thead th,
html[data-theme="dark"] .ux-v40 .batch-table th,
html[data-theme="dark"] .ux-v40 .inventory-table th,
html[data-theme="dark"] .ux-v40 .client-catalog-table th,
html[data-theme="dark"] .ux-v40 .site-catalog-table th,
html[data-theme="dark"] .ux-v40 .client-accounts-table th,
html[data-theme="dark"] .ux-v40 .scroll-table thead th{
  background:#19222d!important;
  color:#e0e7ee!important;
  border-color:var(--ux-border)!important;
}

html[data-theme="dark"] .ux-v40 .admin-management>summary,
html[data-theme="dark"] .ux-v40 .history>summary,
html[data-theme="dark"] .ux-v40 .dashboard-help>summary,
html[data-theme="dark"] .ux-v40 .client-code-more-actions>summary::after{
  color:#dde5ed!important;
}

html[data-theme="dark"] .ux-v40 .client-code-more-menu .mini-btn,
html[data-theme="dark"] .ux-v40 .client-code-actions .mini-btn,
html[data-theme="dark"] .ux-v40 td .mini-btn,
html[data-theme="dark"] .ux-v40 td .btn,
html[data-theme="dark"] .ux-v40 .action-cell .mini-btn{
  box-shadow:none!important;
}

html[data-theme="dark"] .ux-v40 .client-code-more-actions>summary:hover,
html[data-theme="dark"] .ux-v40 .client-code-more-actions[open]>summary,
html[data-theme="dark"] .ux-v40 .global-search-form:focus-within,
html[data-theme="dark"] .ux-v40 .hardware-scanner-status:hover{
  border-color:#637e9d!important;
  background:#1a232e!important;
}


/* =========================================================
   v41.0 · Correcciones finales de modo oscuro, logo y PDF
   ========================================================= */
.ux-v40 .brand-logo-dark{display:none;}
html[data-theme="dark"] .ux-v40 .brand-logo-light{display:none!important;}
html[data-theme="dark"] .ux-v40 .brand-logo-dark{display:block!important;}
html[data-theme="dark"] .ux-v40 .brand-v408 .brand-lockup{background:transparent!important;box-shadow:none!important;}

/* Producto · ficha y trazabilidad en modo oscuro */
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary>div,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-card,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields,
html[data-theme="dark"] .ux-v40 .page-shell.product .history,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step{
  background:#131b24!important;
  color:#e9eff5!important;
  border-color:#303f50!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary>div{border-color:#303f50!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .small-title,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary [class*="title"],
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head small,
html[data-theme="dark"] .ux-v40 .page-shell.product dt,
html[data-theme="dark"] .ux-v40 .page-shell.product label.field,
html[data-theme="dark"] .ux-v40 .page-shell.product .field-note,
html[data-theme="dark"] .ux-v40 .page-shell.product .fine,
html[data-theme="dark"] .ux-v40 .page-shell.product .hint,
html[data-theme="dark"] .ux-v40 .page-shell.product .eyebrow,
html[data-theme="dark"] .ux-v40 .page-shell.product .status-marker,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields dt{
  color:#a7b5c4!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary b,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary strong,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary small,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary p,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .mono,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head h3,
html[data-theme="dark"] .ux-v40 .page-shell.product dd,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields dd,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields b,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields span,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields p,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step b,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step span,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline-step small{
  color:#edf2f8!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.good{
  background:#1c3627!important;color:#9ce1b5!important;border-color:#386248!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.defect{
  background:#321b1d!important;color:#e9b1ab!important;border-color:#683838!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .phase-chip{
  background:#1b2735!important;border-color:#41566d!important;color:#edf3fa!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .phase-chip i{background:#71a5df!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip{
  background:#f5f7fa!important;border-color:#dbe0e6!important;color:#212f40!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip span{color:#7a5730!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip b{color:#334457!important;background:#e2e8ef!important;border-color:#ccd5e0!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.balda b{color:#27583d!important;background:#e2f2e8!important;border-color:#c4dfcf!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.palet b{color:#3b5d83!important;background:#e6eff8!important;border-color:#cadaec!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.legacy b{color:#744e29!important;background:#fcf0de!important;border-color:#e8d3b2!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-toggle{background:#1a2532!important;color:#e2e9f1!important;border-color:#38485a!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form input:not([type=checkbox]):not([type=hidden]),
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form select,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form textarea{
  background:#0d131b!important;color:#f1f5fa!important;border-color:#465668!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form input::placeholder,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form textarea::placeholder{color:#8a98a8!important;opacity:1;}

/* Últimos registros actualizados */
html[data-theme="dark"] .ux-v40 .recent-row,
html[data-theme="dark"] .ux-v40 .recent-row .recent-main,
html[data-theme="dark"] .ux-v40 .recent-row b,
html[data-theme="dark"] .ux-v40 .recent-row span,
html[data-theme="dark"] .ux-v40 .recent-row small,
html[data-theme="dark"] .ux-v40 .recent-row time{
  color:#e7edf4!important;
}
html[data-theme="dark"] .ux-v40 .recent-row:hover{
  background:#1c2734!important;
}
html[data-theme="dark"] .ux-v40 .recent-row:hover b,
html[data-theme="dark"] .ux-v40 .recent-row:hover span,
html[data-theme="dark"] .ux-v40 .recent-row:hover small,
html[data-theme="dark"] .ux-v40 .recent-row:hover time{
  color:#f7fafe!important;
}

/* Auditoría / Trazabilidad */
html[data-theme="dark"] .ux-v40 .audit-summary>div,
html[data-theme="dark"] .ux-v40 .audit-row,
html[data-theme="dark"] .ux-v40 .audit-detail-card,
html[data-theme="dark"] .ux-v40 .audit-change,
html[data-theme="dark"] .ux-v40 .audit-detail-meta>div,
html[data-theme="dark"] .ux-v40 .audit-before-after>div{
  background:#131b24!important;
  border-color:#344355!important;
  color:#eaf0f6!important;
}
html[data-theme="dark"] .ux-v40 .audit-summary b,
html[data-theme="dark"] .ux-v40 .audit-when b,
html[data-theme="dark"] .ux-v40 .audit-line>b,
html[data-theme="dark"] .ux-v40 .audit-fields>span,
html[data-theme="dark"] .ux-v40 .audit-detail-meta b,
html[data-theme="dark"] .ux-v40 .audit-change>b,
html[data-theme="dark"] .ux-v40 .audit-before-after p{
  color:#f1f5fa!important;
}
html[data-theme="dark"] .ux-v40 .audit-summary span,
html[data-theme="dark"] .ux-v40 .audit-when span,
html[data-theme="dark"] .ux-v40 .audit-main small,
html[data-theme="dark"] .ux-v40 .audit-fields small,
html[data-theme="dark"] .ux-v40 .audit-detail-meta span,
html[data-theme="dark"] .ux-v40 .audit-before-after span{
  color:#a7b3c1!important;
}
html[data-theme="dark"] .ux-v40 .audit-row:hover{background:#1b2632!important;}

/* Modales en oscuro */
html[data-theme="dark"] .ux-v40 .app-modal-card,
html[data-theme="dark"] .ux-v40 .management-modal .app-modal-card,
html[data-theme="dark"] .ux-v40 .danger-confirm-card{
  background:#131b24!important;
  color:#ebf0f6!important;
  border-color:#344355!important;
}
html[data-theme="dark"] .ux-v40 .app-modal-head small,
html[data-theme="dark"] .ux-v40 .modal-actions .hint,
html[data-theme="dark"] .ux-v40 .danger-confirm-card li{color:#b0bbc8!important;}

/* PDF de ficha más compacto y ordenado */
@media print{
  body.printing-inventory #dpunto-print-sheet{font-size:9.2pt!important;line-height:1.24!important;}
  body.printing-inventory #dpunto-print-sheet .print-report-head{margin:0 0 5mm!important;padding-bottom:2.5mm!important;}
  body.printing-inventory #dpunto-print-sheet .page-heading{margin-bottom:3.2mm!important;}
  body.printing-inventory #dpunto-print-sheet .page-heading h1{font-size:15pt!important;margin-bottom:1.5mm!important;}
  body.printing-inventory #dpunto-print-sheet .record-summary{grid-template-columns:repeat(4,1fr)!important;gap:2.2mm!important;}
  body.printing-inventory #dpunto-print-sheet .record-summary>div{padding:2.3mm 2.7mm!important;border-radius:8px!important;}
  body.printing-inventory #dpunto-print-sheet .timeline{margin-bottom:4mm!important;gap:2.5mm!important;}
  body.printing-inventory #dpunto-print-sheet .timeline-step{min-height:auto!important;padding:2.2mm 2.5mm!important;border-radius:8px!important;}
  body.printing-inventory #dpunto-print-sheet .timeline-step .phase-title,
  body.printing-inventory #dpunto-print-sheet .timeline-step b{font-size:8.6pt!important;}
  body.printing-inventory #dpunto-print-sheet .timeline-step small{font-size:7.1pt!important;}
  body.printing-inventory #dpunto-print-sheet .stages{display:grid!important;grid-template-columns:1fr!important;gap:2.5mm!important;}
  body.printing-inventory #dpunto-print-sheet .stage{margin:0!important;border-radius:8px!important;}
  body.printing-inventory #dpunto-print-sheet .stage-head{padding:2.4mm 2.8mm!important;min-height:auto!important;}
  body.printing-inventory #dpunto-print-sheet .stage-head h3{font-size:9.2pt!important;margin:0!important;}
  body.printing-inventory #dpunto-print-sheet .stage-head small,
  body.printing-inventory #dpunto-print-sheet .status-marker{font-size:6.9pt!important;}
  body.printing-inventory #dpunto-print-sheet .stage-form,
  body.printing-inventory #dpunto-print-sheet .read-fields{padding:2.6mm!important;}
  body.printing-inventory #dpunto-print-sheet .fields-grid,
  body.printing-inventory #dpunto-print-sheet .read-fields{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:2mm!important;}
  body.printing-inventory #dpunto-print-sheet .read-fields dt{font-size:6.8pt!important;margin-bottom:.7mm!important;}
  body.printing-inventory #dpunto-print-sheet .read-fields dd{font-size:8pt!important;line-height:1.18!important;}
}


/* =========================================================
   v41.1 · Ajustes finales de logo, responsive y contraste
   ========================================================= */
:root{
  --brand-logo-primary:#0b3054;
  --brand-logo-secondary:#153353;
  --brand-logo-word:#0b2641;
}
html[data-theme="dark"]{
  --brand-logo-primary:#f9fbfe;
  --brand-logo-secondary:#e3edfa;
  --brand-logo-word:#ffffff;
}
.ux-v40 .brand-v408 .brand-lockup{background:transparent!important;box-shadow:none!important;padding:0!important;}
.ux-v40 .brand-v408 .brand-logo-svg{display:block!important;width:150px!important;max-width:150px!important;line-height:0!important;}
.ux-v40 .brand-v408 .brand-logo-svg svg{display:block!important;width:100%!important;height:auto!important;overflow:visible;}
.ux-v40 .brand-v408 .brand-logo-word{
  fill:var(--brand-logo-word);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size:66px;
  font-weight:800;
  letter-spacing:-2.2px;
}
.ux-v40 .brand-v408 .brand-logo-dmark{fill:var(--brand-logo-primary);}
.ux-v40 .brand-v408 .brand-logo-dinner{fill:var(--brand-logo-secondary);}
.ux-v40 .brand-v408 .brand-logo-power-ring,
.ux-v40 .brand-v408 .brand-logo-power-stem{fill:none;stroke:var(--brand-logo-word);stroke-width:6.2;stroke-linecap:round;stroke-linejoin:round;}
.ux-v40 .brand-v408 .brand-logo-power-ring{opacity:.96;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:142px!important;max-width:142px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408{max-width:calc(100% - 112px)!important;gap:10px!important;}.ux-v40 .brand-v408 .brand-logo-svg{width:134px!important;max-width:134px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:126px!important;max-width:126px!important;}}

/* Mayor contraste general en fichas y listados de inventario en oscuro */
html[data-theme="dark"] .ux-v40 .record-summary h1,
html[data-theme="dark"] .ux-v40 .record-summary h2,
html[data-theme="dark"] .ux-v40 .record-summary h3,
html[data-theme="dark"] .ux-v40 .record-summary b,
html[data-theme="dark"] .ux-v40 .record-summary strong,
html[data-theme="dark"] .ux-v40 .record-summary p,
html[data-theme="dark"] .ux-v40 .record-summary span,
html[data-theme="dark"] .ux-v40 .record-summary .mono,
html[data-theme="dark"] .ux-v40 .product-title,
html[data-theme="dark"] .ux-v40 .inventory-item-title,
html[data-theme="dark"] .ux-v40 .inventory-card-main,
html[data-theme="dark"] .ux-v40 .inventory-card-main *:not(.badge):not(.state-badge):not(.phase-chip):not(.storage-chip):not(.storage-chip *),
html[data-theme="dark"] .ux-v40 .product-table td,
html[data-theme="dark"] .ux-v40 .product-table td a,
html[data-theme="dark"] .ux-v40 .product-table td b,
html[data-theme="dark"] .ux-v40 .product-table td span,
html[data-theme="dark"] .ux-v40 .product-table td small{
  color:#eef3f9!important;
}
html[data-theme="dark"] .ux-v40 .record-summary .eyebrow,
html[data-theme="dark"] .ux-v40 .record-summary .muted,
html[data-theme="dark"] .ux-v40 .product-table td .muted,
html[data-theme="dark"] .ux-v40 .inventory-card-meta,
html[data-theme="dark"] .ux-v40 .inventory-card-meta *{
  color:#b0bcc9!important;
}

/* Números / chips de los pasos */
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-mark,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline.timeline-flow .step-num,
html[data-theme="dark"] .ux-v40 .timeline.timeline-flow .step-num{
  background:#304359!important;
  color:#ffffff!important;
  border:1px solid #7fa3cb!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline.timeline-flow .step-name,
html[data-theme="dark"] .ux-v40 .timeline.timeline-flow .step-name,
html[data-theme="dark"] .ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step>small,
html[data-theme="dark"] .ux-v40 .timeline.timeline-flow .timeline-step>small{
  color:#f1f5fa!important;
}

/* Editor de almacén: igual de legible que trazabilidad */
html[data-theme="dark"] .ux-v40 .storage-editor{
  background:#131b24!important;
  border-color:#374657!important;
  color:#eaf0f6!important;
}
html[data-theme="dark"] .ux-v40 .storage-editor-title,
html[data-theme="dark"] .ux-v40 .storage-editor .field,
html[data-theme="dark"] .ux-v40 .storage-editor .field span,
html[data-theme="dark"] .ux-v40 .storage-legacy-note{
  color:#b2becb!important;
}
html[data-theme="dark"] .ux-v40 .storage-editor select,
html[data-theme="dark"] .ux-v40 .storage-editor input{
  background:#0d131b!important;
  border-color:#475769!important;
  color:#f1f5fa!important;
}
html[data-theme="dark"] .ux-v40 .storage-editor input::placeholder{color:#8997a6!important;opacity:1;}

/* Navegación responsive: botón hamburguesa y panel mejor visibles */
.ux-v40 .nav-toggle{
  width:44px!important;height:44px!important;padding:0!important;display:none;align-items:center!important;justify-content:center!important;
  border-radius:12px!important;background:#ffffff!important;border:1px solid var(--ux-border)!important;box-shadow:0 8px 18px rgba(11,20,29,.06)!important;
}
.ux-v40 .nav-toggle span{
  display:block!important;width:20px!important;height:2.5px!important;border-radius:999px!important;background:#304154!important;margin:2.5px 0!important;
}
html[data-theme="dark"] .ux-v40 .nav-toggle{background:#18212c!important;border-color:#404f60!important;box-shadow:0 10px 24px rgba(0,0,0,.28)!important;}
html[data-theme="dark"] .ux-v40 .nav-toggle span{background:#f1f6fd!important;}
@media(max-width:820px){
  .ux-v40 .nav-toggle{display:grid!important;}
  .ux-v40 .top-nav{background:#ffffff!important;}
  html[data-theme="dark"] .ux-v40 .top-nav{background:#121922!important;border-right:1px solid #384758!important;}
  html[data-theme="dark"] .ux-v40.nav-open::after,
  html[data-theme="dark"] .ux-v40.nav-open:after{background:rgba(0,0,0,.58)!important;backdrop-filter:blur(1px);}
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown .logout button{color:#ebf1f7!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary,
  html[data-theme="dark"] .ux-v40 .top-nav>a{border-color:#2b3746!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{background:#161f29!important;border-left:2px solid #374658!important;}
}

/* Hover y zonas con texto poco visible */
html[data-theme="dark"] .ux-v40 .recent-row:hover,
html[data-theme="dark"] .ux-v40 .pending-row:hover,
html[data-theme="dark"] .ux-v40 .search-result-row:hover,
html[data-theme="dark"] .ux-v40 .product-table tbody tr:hover{
  background:#1c2633!important;
}
html[data-theme="dark"] .ux-v40 .recent-row:hover *,
html[data-theme="dark"] .ux-v40 .pending-row:hover *,
html[data-theme="dark"] .ux-v40 .search-result-row:hover *,
html[data-theme="dark"] .ux-v40 .product-table tbody tr:hover td,
html[data-theme="dark"] .ux-v40 .product-table tbody tr:hover td *{
  color:#f6faff!important;
}


/* =========================================================
   v41.2 · menú móvil homogéneo + logo simplificado
   ========================================================= */
.ux-v40 .brand-v408 .brand-logo-svg{width:136px!important;max-width:136px!important;}
.ux-v40 .brand-v408 .brand-logo-word{
  font-size:58px;
  font-weight:800;
  letter-spacing:-2.1px;
}
.ux-v40 .brand-v408 .brand-logo-dmark{fill:var(--brand-logo-primary);}
.ux-v40 .brand-v408 .brand-logo-dinner{fill:var(--brand-logo-secondary);}
.ux-v40 .brand-v408 .brand-logo-power-ring,
.ux-v40 .brand-v408 .brand-logo-power-stem{stroke:var(--brand-logo-word);fill:none;stroke-width:5.4;stroke-linecap:round;stroke-linejoin:round;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:130px!important;max-width:130px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408 .brand-logo-svg{width:124px!important;max-width:124px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:120px!important;max-width:120px!important;}}

/* Botón hamburguesa mismo tamaño que buscar y modo */
.ux-v40 .nav-toggle{
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  border-radius:12px!important;
  padding:0!important;
  flex:0 0 42px!important;
  display:none;
  place-items:center!important;
}
.ux-v40 .nav-toggle span{width:18px!important;height:2.5px!important;margin:2px 0!important;}

/* Menú móvil: todas las opciones con el mismo lenguaje visual que inventario */
@media(max-width:820px){
  .ux-v40 .top-nav{
    gap:10px!important;
    padding:18px 12px 16px!important;
  }
  .ux-v40 .top-nav>a,
  .ux-v40 .top-nav .nav-group>summary{
    min-height:48px!important;
    border-radius:14px!important;
    padding:0 18px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-weight:800!important;
    font-size:1.02rem!important;
    background:#203144!important;
    color:#eef4fa!important;
    border:1px solid #35485e!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
  }
  .ux-v40 .top-nav>a:hover,
  .ux-v40 .top-nav>a[aria-current=page],
  .ux-v40 .top-nav .nav-group>summary:hover,
  .ux-v40 .top-nav .nav-group>summary[aria-current=page],
  .ux-v40 .top-nav .nav-group[open]>summary{
    background:#25394f!important;
    color:#ffffff!important;
    border-color:#49627e!important;
  }
  .ux-v40 .top-nav .nav-group>summary::after{
    color:#d8e5f4!important;
    margin-left:8px!important;
  }
  .ux-v40 .top-nav .nav-group,
  .ux-v40 .top-nav>a{width:100%!important;}
  .ux-v40 .top-nav .nav-dropdown{
    margin:8px 4px 2px 4px!important;
    padding:6px!important;
    border-radius:14px!important;
    background:#192634!important;
    border:1px solid #304155!important;
  }
  .ux-v40 .top-nav .nav-dropdown>a,
  .ux-v40 .top-nav .nav-dropdown .logout button{
    min-height:42px!important;
    border-radius:12px!important;
    display:flex!important;
    align-items:center!important;
    padding:0 14px!important;
    color:#e5eef8!important;
  }
  .ux-v40 .top-nav .nav-dropdown>a:hover,
  .ux-v40 .top-nav .nav-dropdown .logout button:hover{
    background:#233344!important;
    color:#ffffff!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav{
    background:#101a25!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav{
    background:#0e161f!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{
    background:#203144!important;
    color:#eef4fa!important;
    border-color:#35485e!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav>a:hover,
  html[data-theme="dark"] .ux-v40 .top-nav>a[aria-current=page],
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary:hover,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary[aria-current=page],
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group[open]>summary{
    background:#25394f!important;
    color:#ffffff!important;
    border-color:#49627e!important;
  }
}

/* Refuerzo global de legibilidad sobre fondos oscuros/azules */
html[data-theme="dark"] .ux-v40 .product-table td .code,
html[data-theme="dark"] .ux-v40 .product-table td .ref,
html[data-theme="dark"] .ux-v40 .inventory-card-main .code,
html[data-theme="dark"] .ux-v40 .inventory-card-main .ref,
html[data-theme="dark"] .ux-v40 .inventory-card-main a,
html[data-theme="dark"] .ux-v40 .inventory-card-main b,
html[data-theme="dark"] .ux-v40 .inventory-card-main strong,
html[data-theme="dark"] .ux-v40 .recent-row a,
html[data-theme="dark"] .ux-v40 .recent-row b,
html[data-theme="dark"] .ux-v40 .recent-row strong,
html[data-theme="dark"] .ux-v40 .recent-row span.primary{
  color:#f2f6fb!important;
}


/* =========================================================
   v41.3 · Logo final simplificado Dpunto
   ========================================================= */
.ux-v40 .brand-v408 .brand-logo-svg{width:138px!important;max-width:138px!important;display:block!important;line-height:0!important;}
.ux-v40 .brand-v408 .brand-logo-svg svg{display:block!important;width:100%!important;height:auto!important;overflow:visible;}
.ux-v40 .brand-v408 .brand-logo-word{
  fill:var(--brand-logo-word)!important;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size:58px!important;
  font-weight:800!important;
  letter-spacing:-2.1px!important;
}
.ux-v40 .brand-v408 .brand-logo-power-ring,
.ux-v40 .brand-v408 .brand-logo-power-stem{
  stroke:var(--brand-logo-word)!important;
  fill:none!important;
  stroke-width:5.4!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
/* anula por completo los logos/ornamentos anteriores */
.ux-v40 .brand-v408 .brand-logo-dmark,
.ux-v40 .brand-v408 .brand-logo-dinner,
.ux-v40 .brand-v408 .brand-logo-light,
.ux-v40 .brand-v408 .brand-logo-dark,
.ux-v40 .brand-v408 img{display:none!important;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:132px!important;max-width:132px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408 .brand-logo-svg{width:126px!important;max-width:126px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:120px!important;max-width:120px!important;}}


/* =========================================================
   v41.4 · Menú lateral móvil claro/oscuro correctamente separado
   ========================================================= */
@media(max-width:820px){
  /* MODO CLARO */
  html[data-theme="light"] .ux-v40 .top-nav{
    background:#f7fafc!important;
    border-right:1px solid #dae0e7!important;
    box-shadow:20px 0 50px rgba(13,22,33,.14)!important;
  }
  html[data-theme="light"] .ux-v40.nav-open::after,
  html[data-theme="light"] .ux-v40.nav-open:after{
    background:rgba(30,42,55,.28)!important;
    backdrop-filter:blur(1px);
  }
  html[data-theme="light"] .ux-v40 .top-nav>a,
  html[data-theme="light"] .ux-v40 .top-nav .nav-group>summary{
    background:#ffffff!important;
    color:#273648!important;
    border:1px solid #d4dce4!important;
    box-shadow:0 4px 14px rgba(13,22,33,.05)!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav>a:hover,
  html[data-theme="light"] .ux-v40 .top-nav>a[aria-current=page],
  html[data-theme="light"] .ux-v40 .top-nav .nav-group>summary:hover,
  html[data-theme="light"] .ux-v40 .top-nav .nav-group>summary[aria-current=page],
  html[data-theme="light"] .ux-v40 .top-nav .nav-group[open]>summary{
    background:#eef4fb!important;
    color:#426b98!important;
    border-color:#b2c9e3!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-group>summary::after{
    color:#5e6e81!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown{
    background:#ffffff!important;
    border:1px solid #dce2e9!important;
    border-left:2px solid #b0c6e0!important;
    box-shadow:none!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown>a,
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown .logout button{
    color:#374657!important;
    background:transparent!important;
    border:0!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown>a:hover,
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown>a[aria-current=page],
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown .logout button:hover{
    background:#f1f6fc!important;
    color:#426d9d!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown .logout{
    border-color:#e3e7ed!important;
  }

  /* MODO OSCURO: preservar diseño oscuro */
  html[data-theme="dark"] .ux-v40 .top-nav{
    background:#0e161f!important;
    border-right:1px solid #374556!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{
    background:#203144!important;
    color:#eef4fa!important;
    border-color:#35485e!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{
    background:#192634!important;
    border-color:#304155!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown .logout button{
    color:#e5eef8!important;
  }
}


/* =========================================================
   v41.5 · Logo Dpunto compacto y continuo
   ========================================================= */
.ux-v40 .brand-v408{gap:0!important;}
.ux-v40 .brand-v408 .brand-lockup{display:block!important;}
.ux-v40 .brand-v408 .brand-logo-svg{
  width:118px!important;
  max-width:118px!important;
  display:block!important;
  line-height:0!important;
}
.ux-v40 .brand-v408 .brand-logo-svg svg{
  display:block!important;
  width:100%!important;
  height:auto!important;
  overflow:visible!important;
}
.ux-v40 .brand-v408 .brand-divider,
.ux-v40 .brand-v408 .brand-caption{display:none!important;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:116px!important;max-width:116px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408 .brand-logo-svg{width:114px!important;max-width:114px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:112px!important;max-width:112px!important;}}


/* =========================================================
   v41.6 · favicon D + Pendientes sin amarillo
   ========================================================= */

/* MODO CLARO · Pendientes */
html[data-theme="light"] .ux-v40 .pending-row{
  background:#ffffff!important;
  color:#223141!important;
  border-color:#dfe5ec!important;
}
html[data-theme="light"] .ux-v40 .pending-row:hover{
  background:#eef4fa!important;
  border-color:#c4d3e5!important;
}
html[data-theme="light"] .ux-v40 .pending-title>b,
html[data-theme="light"] .ux-v40 .pending-main>span,
html[data-theme="light"] .ux-v40 .pending-meta small,
html[data-theme="light"] .ux-v40 .pending-meta b{
  color:#223141!important;
}
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-title>b,
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-main>span,
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-meta small,
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-meta b{
  color:#1c2a39!important;
}
html[data-theme="light"] .ux-v40 .pending-reasons span{
  background:#ebf1f7!important;
  border-color:#c9d6e4!important;
  color:#3e536a!important;
}
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-reasons span{
  background:#dfe9f4!important;
  border-color:#b7c7d9!important;
  color:#2a3d51!important;
}
html[data-theme="light"] .ux-v40 .attention-card.warning{
  background:#f6f8fb!important;
  border-color:#d1dbe6!important;
  border-left-color:#6c8baf!important;
}
html[data-theme="light"] .ux-v40 .attention-card.warning span,
html[data-theme="light"] .ux-v40 .attention-card.warning b,
html[data-theme="light"] .ux-v40 .attention-card.warning small{
  color:#36495d!important;
}
html[data-theme="light"] .ux-v40 .attention-card.warning:hover{
  background:#eef4fa!important;
  border-color:#bdcddf!important;
}

/* MODO OSCURO · Pendientes */
html[data-theme="dark"] .ux-v40 .pending-row{
  background:#141c25!important;
  color:#ebf0f6!important;
  border-color:#303d4c!important;
}
html[data-theme="dark"] .ux-v40 .pending-row:hover{
  background:#233140!important;
  border-color:#47596f!important;
}
html[data-theme="dark"] .ux-v40 .pending-title>b,
html[data-theme="dark"] .ux-v40 .pending-main>span,
html[data-theme="dark"] .ux-v40 .pending-meta small,
html[data-theme="dark"] .ux-v40 .pending-meta b{
  color:#e2e9f1!important;
}
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-title>b,
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-main>span,
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-meta small,
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-meta b{
  color:#ffffff!important;
}
html[data-theme="dark"] .ux-v40 .pending-reasons span{
  background:#243343!important;
  border-color:#44586f!important;
  color:#c8dbf0!important;
}
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-reasons span{
  background:#314459!important;
  border-color:#5f7690!important;
  color:#f2f8fe!important;
}
html[data-theme="dark"] .ux-v40 .attention-card.warning{
  background:#18222d!important;
  border-color:#39495b!important;
  border-left-color:#7495ba!important;
}
html[data-theme="dark"] .ux-v40 .attention-card.warning span,
html[data-theme="dark"] .ux-v40 .attention-card.warning b,
html[data-theme="dark"] .ux-v40 .attention-card.warning small{
  color:#dfe8f3!important;
}
html[data-theme="dark"] .ux-v40 .attention-card.warning:hover{
  background:#223141!important;
  border-color:#536880!important;
}

/* Mantener la acción principal acorde a cada tema */
html[data-theme="light"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#5083ba,#5d93ce)!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#273b52,#364f6c)!important;
}


/* =========================================================
   v41.7 · Paleta separada claro/oscuro · menos brillo en dark
   ========================================================= */

/* ---------- MODO CLARO ---------- */
html[data-theme="light"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#e9edf3 0%,#dfe6ee 100%)!important;
  color:#223141!important;
  border:1px solid #cfd7e2!important;
  box-shadow:0 12px 28px rgba(42,59,78,.08)!important;
}
html[data-theme="light"] .ux-v40 .dashboard-primary-actions .eyebrow{color:#536479!important;}
html[data-theme="light"] .ux-v40 .dashboard-primary-actions h2{color:#1e2b3a!important;}
html[data-theme="light"] .ux-v40 .dashboard-action{
  background:#f7fafc!important;
  border-color:#ced6e1!important;
  color:#223141!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action:hover{
  background:#f0f4f9!important;
  border-color:#acbbcd!important;
  transform:translateY(-1px);
}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary{
  background:#527296!important;
  border-color:#527296!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary:hover{
  background:#496483!important;
  border-color:#496483!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) b{color:#223141!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) small{color:#6e7b8a!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) i{color:#647488!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) .action-icon{
  background:#e8edf3!important;color:#445b74!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary b,
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary small,
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary i{color:#f7fafe!important;}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary .action-icon{background:rgba(255,255,255,.13)!important;color:#ffffff!important;}

/* ---------- MODO OSCURO ---------- */
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#131b24 0%,#1c2835 100%)!important;
  color:#ecf0f5!important;
  border:1px solid #2f3c4b!important;
  box-shadow:0 16px 36px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions .eyebrow{color:#98a6b6!important;}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions h2{color:#f0f4f9!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action{
  background:#1e2a37!important;
  border-color:#394859!important;
  color:#e7ecf2!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action:hover{
  background:#273647!important;
  border-color:#4f6177!important;
  transform:translateY(-1px);
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary{
  background:#3d5876!important;
  border-color:#4e6b8c!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary:hover{
  background:#476587!important;
  border-color:#5c7b9d!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action b{color:#f0f4f9!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action small{color:#bfc8d3!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action i{color:#b2bfcf!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action .action-icon{
  background:#2e3e50!important;color:#e2eaf4!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary .action-icon{background:#4e6c8e!important;color:#ffffff!important;}

/* Fases en dark: menos blancos, misma identidad cromática */
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-card{
  background:#131b24!important;
  border-color:#33404f!important;
  border-top-color:var(--phase-color)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-card:hover{
  background:#1a242f!important;
  border-color:#445466!important;
  border-top-color:var(--phase-color)!important;
  box-shadow:0 8px 20px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-card h3{color:#ecf0f5!important;}
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-total{
  background:#1d2630!important;
  border:1px solid #354150!important;
  color:var(--phase-color)!important;
}
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-go,
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-no{color:var(--phase-color)!important;}
html[data-theme="dark"] .ux-v40 .phase-grid.phase-grid-flow .phase-card:not(:last-child)::after{
  background:#1a242e!important;
  border-color:#455467!important;
  color:#dee6f0!important;
  box-shadow:0 4px 12px rgba(0,0,0,.22)!important;
}

/* Ubicación actual en oscuro: integrada, sin pastilla blanca */
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip,
html[data-theme="dark"] .ux-v40 .storage-chip{
  background:#1a232d!important;
  border-color:#3e4e60!important;
  color:#e1e8ef!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip span,
html[data-theme="dark"] .ux-v40 .storage-chip span{color:#dce3ec!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip b,
html[data-theme="dark"] .ux-v40 .storage-chip b{
  background:#24303d!important;
  color:#e2e9f1!important;
  border-color:#485869!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.balda b,
html[data-theme="dark"] .ux-v40 .storage-chip.balda b{background:#1b3428!important;color:#aadaba!important;border-color:#39644c!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.palet b,
html[data-theme="dark"] .ux-v40 .storage-chip.palet b{background:#203042!important;color:#b3ceed!important;border-color:#47617f!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.legacy b,
html[data-theme="dark"] .ux-v40 .storage-chip.legacy b{background:#322b1d!important;color:#dac08d!important;border-color:#635231!important;}

/* Paginación: elimina los botones blancos en dark */
html[data-theme="dark"] .ux-v40 .pager>span{color:#8b98a7!important;}
html[data-theme="dark"] .ux-v40 .pager .btn.outline{
  background:#1b2530!important;
  border-color:#455467!important;
  color:#e1e7ef!important;
}
html[data-theme="dark"] .ux-v40 .pager .btn.outline:hover{
  background:#253344!important;
  border-color:#5b7087!important;
  color:#f5f8fc!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages a{
  background:#1a232d!important;
  border-color:#415061!important;
  color:#c4ceda!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages a:hover{
  background:#273545!important;
  border-color:#5b7088!important;
  color:#f5f8fc!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages b{
  background:#476a91!important;
  border-color:#587ea8!important;
  color:#f8fbfe!important;
}

/* En claro la paginación también usa una superficie menos brillante */
html[data-theme="light"] .ux-v40 .pager-pages a{
  background:#f3f7fa!important;
  border-color:#d0d8e0!important;
  color:#445466!important;
}
html[data-theme="light"] .ux-v40 .pager-pages a:hover{background:#ecf0f5!important;border-color:#b2bdca!important;}
html[data-theme="light"] .ux-v40 .pager-pages b{background:#51749b!important;border-color:#51749b!important;color:#ffffff!important;}


/* =========================================================
   v41.8 · alineación de controles superiores + logo compacto
   ========================================================= */
/* Logo más compacto: la O/power se acerca a Dpunt */
.ux-v40 .brand-v408 .brand-logo-svg{width:122px!important;max-width:122px!important;}
.ux-v40 .brand-v408 .brand-logo-svg svg{overflow:visible!important;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:120px!important;max-width:120px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408 .brand-logo-svg{width:118px!important;max-width:118px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:116px!important;max-width:116px!important;}}

/* Controles superiores totalmente alineados y proporcionados */
.ux-v40 .header-inner{align-items:center!important;}
.ux-v40 .header-actions{align-items:center!important;gap:10px!important;}
.ux-v40 .header-search-link,
.ux-v40 .theme-toggle,
.ux-v40 .nav-toggle{
  min-height:44px!important;
  height:44px!important;
  border-radius:14px!important;
  box-sizing:border-box!important;
}
.ux-v40 .nav-toggle,
.ux-v40 .header-search-link,
.ux-v40 .header-actions .theme-toggle{
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  flex:0 0 44px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.ux-v40 .header-search-link>span:last-child,
.ux-v40 .theme-toggle-label{display:none!important;}
.ux-v40 .header-search-link>span:first-child,
.ux-v40 .theme-toggle-icon,
.ux-v40 .nav-toggle span{display:block;}
.ux-v40 .header-search-link>span:first-child{font-size:1.08rem!important;line-height:1!important;}
.ux-v40 .theme-toggle-icon{margin:0 auto!important;}
.ux-v40 .nav-toggle{gap:0!important;flex-direction:column!important;}
.ux-v40 .nav-toggle span{width:18px!important;height:2.5px!important;margin:2.25px 0!important;}

@media(max-width:980px){
  .ux-v40 .header-actions{gap:9px!important;}
}
@media(max-width:820px){
  .ux-v40 .header-actions{gap:9px!important;}
  .ux-v40 .header-search-link,
  .ux-v40 .theme-toggle,
  .ux-v40 .nav-toggle{
    width:46px!important;
    min-width:46px!important;
    max-width:46px!important;
    height:46px!important;
    min-height:46px!important;
    border-radius:14px!important;
  }
  .ux-v40 .theme-toggle-icon{width:22px!important;height:22px!important;}
  .ux-v40 .header-search-link>span:first-child{font-size:1.06rem!important;}
}
html[data-theme="light"] .ux-v40 .header-search-link,
html[data-theme="light"] .ux-v40 .theme-toggle,
html[data-theme="light"] .ux-v40 .nav-toggle{
  background:#1a2735!important;
  border-color:#314256!important;
  color:#f1f6fd!important;
  box-shadow:0 6px 18px rgba(13,22,33,.14), inset 0 1px 0 rgba(255,255,255,.04)!important;
}
html[data-theme="light"] .ux-v40 .theme-toggle-icon{
  background:#253446!important;
  color:#e2eefb!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 1px 4px rgba(0,0,0,.18)!important;
}
html[data-theme="light"] .ux-v40 .nav-toggle span{background:#f3f8fc!important;}
html[data-theme="light"] .ux-v40 .header-search-link:hover,
html[data-theme="light"] .ux-v40 .theme-toggle:hover,
html[data-theme="light"] .ux-v40 .nav-toggle:hover{
  background:#233345!important;
  border-color:#4a617b!important;
  color:#ffffff!important;
}
html[data-theme="dark"] .ux-v40 .header-search-link,
html[data-theme="dark"] .ux-v40 .theme-toggle,
html[data-theme="dark"] .ux-v40 .nav-toggle{
  background:#18222e!important;
  border-color:#394859!important;
  color:#ebf1f8!important;
}
html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
  background:#273647!important;
  color:#dfedfc!important;
}
html[data-theme="dark"] .ux-v40 .header-search-link:hover,
html[data-theme="dark"] .ux-v40 .theme-toggle:hover,
html[data-theme="dark"] .ux-v40 .nav-toggle:hover{
  background:#212f3f!important;
  border-color:#596d85!important;
  color:#ffffff!important;
}


/* =========================================================
   v41.9 · opciones legibles + impresión compacta por tarjetas
   ========================================================= */
/* Menú Opciones legible en claro y oscuro */
html[data-theme="dark"] .ux-v40 .inventory-action-menu[open]>summary{
  background:#212f3f!important;
  border-color:#506680!important;
  color:#f7fafe!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-popover{
  background:#17212d!important;
  border-color:#364658!important;
  box-shadow:0 18px 38px rgba(0,0,0,.45)!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-menu-title{
  color:#b0bece!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-popover a,
html[data-theme="dark"] .ux-v40 .inventory-action-popover a b,
html[data-theme="dark"] .ux-v40 .inventory-action-popover a small{
  color:#f1f5fa!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-popover a small{opacity:.82;}
html[data-theme="dark"] .ux-v40 .inventory-action-popover a:hover{
  background:#223141!important;
}
html[data-theme="light"] .ux-v40 .inventory-action-popover{
  background:#fbfdff!important;
  border-color:#dce2e9!important;
}
html[data-theme="light"] .ux-v40 .inventory-action-popover a,
html[data-theme="light"] .ux-v40 .inventory-action-popover a b{color:#283749!important;}
html[data-theme="light"] .ux-v40 .inventory-action-popover a small{color:#727f8f!important;}
html[data-theme="light"] .ux-v40 .inventory-action-popover a:hover{background:#f1f4f9!important;}

/* Pantalla de impresión legible en ambos temas */
.ux-v40 .excel-print-screen-actions,
.ux-v40 .excel-print-report-cards{
  border-radius:16px!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions{
  background:#17212d!important;
  border-color:#364658!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions .excel-print-hint,
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions>div,
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions b,
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions span{
  color:#e2ebf5!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-report-cards{
  background:#141c25!important;
  color:#eff4fa!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .compact-print-head,
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .compact-print-head p,
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .compact-print-head h1,
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .excel-print-meta,
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .excel-print-meta b,
html[data-theme="dark"] .ux-v40 .excel-print-report-cards .excel-print-meta span{
  color:#f1f5fa!important;
  border-color:#384758!important;
}
html[data-theme="light"] .ux-v40 .excel-print-report-cards{
  background:#f7fafc!important;
  color:#273648!important;
}

/* Nuevo layout compacto de impresión por tarjetas */
.ux-v40 .excel-print-report-cards{
  padding:18px!important;
  border:1px solid var(--border)!important;
}
.ux-v40 .compact-print-head{margin-bottom:14px!important;}
.ux-v40 .excel-print-summary-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.ux-v40 .excel-print-summary-card{
  display:grid;
  gap:2px;
  padding:12px 12px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.84);
  min-width:0;
}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card{
  background:#1b2633!important;
  border-color:#364658!important;
}
.ux-v40 .excel-print-summary-card small{font-size:.72rem;font-weight:800;color:#73808f;text-transform:uppercase;letter-spacing:.05em;}
.ux-v40 .excel-print-summary-card b{font-size:1.35rem;line-height:1.05;color:#273648;}
.ux-v40 .excel-print-summary-card span{font-size:.78rem;color:#6a7787;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card small{color:#adbdd0!important;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card b{color:#f7fafe!important;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card span{color:#c7d3e0!important;}
.ux-v40 .excel-print-summary-card.is-total{background:linear-gradient(180deg,#578dc8,#4877ab);border-color:#578cc7;}
.ux-v40 .excel-print-summary-card.is-total small,
.ux-v40 .excel-print-summary-card.is-total b,
.ux-v40 .excel-print-summary-card.is-total span{color:#ffffff!important;}
.ux-v40 .excel-print-summary-card.phase-1{border-color:#e9c5d4}.ux-v40 .excel-print-summary-card.phase-2{border-color:#ead79b}.ux-v40 .excel-print-summary-card.phase-3{border-color:#bcd4ef}.ux-v40 .excel-print-summary-card.phase-4{border-color:#b6d8c6}.ux-v40 .excel-print-summary-card.phase-5{border-color:#dbc8b5}.ux-v40 .excel-print-summary-card.phase-6{border-color:#e5d39b}

.ux-v40 .excel-print-cards{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.ux-v40 .excel-print-card{
  display:grid;
  gap:6px;
  min-width:0;
  padding:11px 11px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.92);
}
html[data-theme="dark"] .ux-v40 .excel-print-card{background:#1a2430!important;border-color:#354556!important;}
.ux-v40 .excel-print-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.76rem;font-weight:900;color:#677382;}
.ux-v40 .excel-print-card .id{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ux-v40 .excel-print-card .qty-badge{padding:2px 7px;border-radius:999px;background:#f1f4f9;color:#34485f;font-size:.7rem;}
html[data-theme="dark"] .ux-v40 .excel-print-card-top{color:#c4d1df!important;}
html[data-theme="dark"] .ux-v40 .excel-print-card .qty-badge{background:#273544!important;color:#f2f7fd!important;}
.ux-v40 .excel-print-card h3{margin:0;font-size:.92rem;line-height:1.15;color:#263648;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-card h3{color:#f7fafe!important;}
.ux-v40 .excel-print-card-meta{display:flex;justify-content:space-between;gap:8px;font-size:.74rem;font-weight:700;color:#677585;}
.ux-v40 .excel-print-card-meta span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-card-meta{color:#c6d2e0!important;}
.ux-v40 .excel-print-card-data{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;}
.ux-v40 .excel-print-card-data span{font-size:.71rem;line-height:1.2;color:#687585;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-card-data span{color:#ced9e5!important;}
.ux-v40 .excel-print-card.phase-1{border-top:3px solid #c5668f}.ux-v40 .excel-print-card.phase-2{border-top:3px solid #c19c42}.ux-v40 .excel-print-card.phase-3{border-top:3px solid #5a9be2}.ux-v40 .excel-print-card.phase-4{border-top:3px solid #59a376}.ux-v40 .excel-print-card.phase-5{border-top:3px solid #ac7d58}.ux-v40 .excel-print-card.phase-6{border-top:3px solid #ad8d3e}
@media(max-width:1100px){.ux-v40 .excel-print-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));}.ux-v40 .excel-print-cards{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:760px){.ux-v40 .excel-print-summary-grid,.ux-v40 .excel-print-cards{grid-template-columns:1fr 1fr;}.ux-v40 .excel-print-report-cards{padding:14px!important;}}
@media(max-width:520px){.ux-v40 .excel-print-summary-grid,.ux-v40 .excel-print-cards{grid-template-columns:1fr;}}

@media print{
  @page{size:A4 landscape;margin:5mm}
  .excel-print-screen-actions{display:none!important}
  .excel-print-report-cards{display:block!important;width:100%!important;margin:0!important;padding:0!important;border:0!important;background:#ffffff!important;color:#0b141d!important}
  .excel-print-report-cards .compact-print-head{margin:0 0 2.4mm!important;padding-bottom:1.5mm!important;border-bottom:.35mm solid #15202c!important;break-after:avoid}
  .excel-print-report-cards .compact-print-head .eyebrow{font-size:6pt!important;margin:0 0 .7mm!important;color:#737d8a!important}
  .excel-print-report-cards .compact-print-head h1{font-size:11pt!important;margin:0 0 .6mm!important;color:#0b141d!important}
  .excel-print-report-cards .compact-print-head p,.excel-print-report-cards .excel-print-meta span{font-size:6pt!important;color:#66707b!important}
  .excel-print-report-cards .excel-print-meta b{font-size:8pt!important;color:#0b141d!important}
  .excel-print-report-cards .excel-print-summary-grid{grid-template-columns:repeat(7,1fr)!important;gap:1.2mm!important;margin:0 0 2mm!important;break-inside:avoid-page}
  .excel-print-report-cards .excel-print-summary-card{padding:1.2mm 1.2mm 1mm!important;border:.18mm solid #bdc5ce!important;border-radius:2mm!important;background:#ffffff!important;box-shadow:none!important}
  .excel-print-report-cards .excel-print-summary-card small{font-size:4.8pt!important;color:#66707b!important}
  .excel-print-report-cards .excel-print-summary-card b{font-size:8.2pt!important;color:#0b141d!important}
  .excel-print-report-cards .excel-print-summary-card span{font-size:4.7pt!important;color:#67717c!important;white-space:normal!important}
  .excel-print-report-cards .excel-print-summary-card.is-total{background:#578cc7!important;border-color:#578cc7!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .excel-print-report-cards .excel-print-cards{grid-template-columns:repeat(15,minmax(0,1fr))!important;gap:1.05mm!important;align-items:stretch!important}
  .excel-print-report-cards .excel-print-card{padding:1.05mm .9mm .9mm!important;border-radius:1.7mm!important;border:.18mm solid #bac2cb!important;background:#ffffff!important;gap:.55mm!important;break-inside:avoid-page!important;page-break-inside:avoid!important;min-height:17.2mm!important}
  .excel-print-report-cards .excel-print-card-top{font-size:4.9pt!important;color:#646e79!important}
  .excel-print-report-cards .excel-print-card .qty-badge{padding:.25mm .8mm!important;font-size:4.5pt!important;background:#f0f3f7!important;color:#324458!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .excel-print-report-cards .excel-print-card h3{font-size:5.7pt!important;line-height:1.05!important;color:#0b141d!important}
  .excel-print-report-cards .excel-print-card-meta{font-size:4.55pt!important;color:#66707b!important;gap:.7mm!important}
  .excel-print-report-cards .excel-print-card-data{gap:.35mm .75mm!important}
  .excel-print-report-cards .excel-print-card-data span{font-size:4.45pt!important;line-height:1.05!important;color:#68727d!important}
  .excel-print-report-cards .excel-print-card.phase-1{border-top:.8mm solid #c5668f!important}.excel-print-report-cards .excel-print-card.phase-2{border-top:.8mm solid #c19c42!important}.excel-print-report-cards .excel-print-card.phase-3{border-top:.8mm solid #5a9be2!important}.excel-print-report-cards .excel-print-card.phase-4{border-top:.8mm solid #59a376!important}.excel-print-report-cards .excel-print-card.phase-5{border-top:.8mm solid #ac7d58!important}.excel-print-report-cards .excel-print-card.phase-6{border-top:.8mm solid #ad8d3e!important}
  .excel-print-report-cards .excel-print-card,.excel-print-report-cards .excel-print-summary-card{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
}


/* =========================================================
   v41.11 · nav solo móvil + controles superiores alineados
   ========================================================= */
/* El hamburguesa NO debe aparecer en escritorio/web. */
.ux-v40 .nav-toggle{display:none!important;}
@media(max-width:820px){
  .ux-v40 .nav-toggle{display:inline-flex!important;}
}

/* Tres controles con la misma caja, proporción y centrado. */
.ux-v40 .header-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
}
.ux-v40 .header-search-link,
.ux-v40 .header-actions .theme-toggle,
.ux-v40 .nav-toggle{
  width:46px!important;
  min-width:46px!important;
  max-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  max-height:46px!important;
  flex:0 0 46px!important;
  padding:0!important;
  margin:0!important;
  border-radius:14px!important;
  box-sizing:border-box!important;
  align-items:center!important;
  justify-content:center!important;
  vertical-align:middle!important;
}
.ux-v40 .header-search-link{display:inline-flex!important;}
.ux-v40 .header-search-link>span:last-child,
.ux-v40 .header-actions .theme-toggle-label{display:none!important;}

/* Búsqueda: icono SVG centrado, sin depender de la línea base de un carácter. */
.ux-v40 .header-search-icon{
  display:grid!important;
  place-items:center!important;
  width:20px!important;
  height:20px!important;
  line-height:0!important;
}
.ux-v40 .header-search-icon svg{display:block!important;width:19px!important;height:19px!important;}

/* Tema: SIN círculo/botón interior. El sol/luna vive directamente dentro del botón exterior. */
.ux-v40 .header-actions .theme-toggle-icon{
  display:grid!important;
  place-items:center!important;
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  flex:0 0 20px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
}
.ux-v40 .header-actions .theme-toggle-icon svg{
  display:block!important;
  width:19px!important;
  height:19px!important;
}

/* Hamburguesa perfectamente centrado dentro de su caja. */
.ux-v40 .nav-toggle{
  flex-direction:column!important;
  gap:4px!important;
}
.ux-v40 .nav-toggle span{
  display:block!important;
  width:20px!important;
  height:2.5px!important;
  margin:0!important;
  border-radius:999px!important;
}

/* Misma estética oscura en el tema oscuro. */
html[data-theme="dark"] .ux-v40 .header-search-link,
html[data-theme="dark"] .ux-v40 .header-actions .theme-toggle,
html[data-theme="dark"] .ux-v40 .nav-toggle{
  background:#18222e!important;
  border:1px solid #394859!important;
  color:#f1f6fc!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 6px 16px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .ux-v40 .header-search-link:hover,
html[data-theme="dark"] .ux-v40 .header-actions .theme-toggle:hover,
html[data-theme="dark"] .ux-v40 .nav-toggle:hover{
  background:#223141!important;
  border-color:#556a82!important;
  color:#ffffff!important;
}
html[data-theme="dark"] .ux-v40 .nav-toggle span{background:#f1f6fc!important;}

/* Modo claro: misma geometría, contraste propio. */
html[data-theme="light"] .ux-v40 .header-search-link,
html[data-theme="light"] .ux-v40 .header-actions .theme-toggle,
html[data-theme="light"] .ux-v40 .nav-toggle{
  background:#f7fbfe!important;
  border:1px solid #d1d9e4!important;
  color:#354659!important;
  box-shadow:0 4px 12px rgba(13,22,33,.06)!important;
}
html[data-theme="light"] .ux-v40 .header-search-link:hover,
html[data-theme="light"] .ux-v40 .header-actions .theme-toggle:hover,
html[data-theme="light"] .ux-v40 .nav-toggle:hover{
  background:#eef3f9!important;
  border-color:#aec0d5!important;
  color:#273a50!important;
}
html[data-theme="light"] .ux-v40 .nav-toggle span{background:#354659!important;}

/* Logo: power muy próximo, pero sin invadir la última letra. */
.ux-v40 .brand-v408 .brand-logo-svg{width:124px!important;max-width:124px!important;}
@media(max-width:1100px){.ux-v40 .brand-v408 .brand-logo-svg{width:122px!important;max-width:122px!important;}}
@media(max-width:820px){.ux-v40 .brand-v408 .brand-logo-svg{width:120px!important;max-width:120px!important;}}
@media(max-width:560px){.ux-v40 .brand-v408 .brand-logo-svg{width:118px!important;max-width:118px!important;}}


/* =========================================================
   v41.12 · Excel guiado oscuro + iconos transparentes
   ========================================================= */

/* ---------------------------------------------------------
   CIERRE DE MODALES
   La X se dibuja con dos trazos, sin glyph, sin cuadrado interno.
   --------------------------------------------------------- */
.ux-v40 .modal-close{
  position:relative!important;
  display:grid!important;
  place-items:center!important;
  width:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  padding:0!important;
  margin:0!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
  font-size:0!important;
  line-height:0!important;
  overflow:hidden!important;
  flex:0 0 38px!important;
}
.ux-v40 .modal-close::before,
.ux-v40 .modal-close::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:17px!important;
  height:2.6px!important;
  border-radius:999px!important;
  background:currentColor!important;
  transform-origin:center!important;
}
.ux-v40 .modal-close::before{transform:translate(-50%,-50%) rotate(45deg)!important;}
.ux-v40 .modal-close::after{transform:translate(-50%,-50%) rotate(-45deg)!important;}
html[data-theme="dark"] .ux-v40 .modal-close{
  background:#1c2631!important;
  border:1px solid #364657!important;
  color:#e2eaf2!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .modal-close:hover{
  background:#243140!important;
  border-color:#54687f!important;
  color:#ffffff!important;
}
html[data-theme="light"] .ux-v40 .modal-close{
  background:#f0f3f7!important;
  border:1px solid #d8dfe7!important;
  color:#445465!important;
  box-shadow:none!important;
}
html[data-theme="light"] .ux-v40 .modal-close:hover{
  background:#e7edf3!important;
  border-color:#b5c2d0!important;
  color:#2a3d52!important;
}

/* ---------------------------------------------------------
   ICONO CLARO / OSCURO
   Sin círculo ni cuadrado interior: SVG flotando directamente.
   --------------------------------------------------------- */
.ux-v40 .theme-toggle-icon,
.ux-v40 .header-actions .theme-toggle-icon,
.ux-v40 .theme-toggle-alone .theme-toggle-icon{
  display:grid!important;
  place-items:center!important;
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  min-height:22px!important;
  max-height:22px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  overflow:visible!important;
  color:inherit!important;
}
.ux-v40 .theme-toggle-icon svg,
.ux-v40 .header-actions .theme-toggle-icon svg,
.ux-v40 .theme-toggle-alone .theme-toggle-icon svg{
  display:block!important;
  width:20px!important;
  height:20px!important;
  background:transparent!important;
  overflow:visible!important;
}
html[data-theme="light"] .ux-v40 .theme-toggle,
html[data-theme="light"] .ux-v40 .theme-toggle-icon{
  color:#2a3d52!important;
}
html[data-theme="dark"] .ux-v40 .theme-toggle,
html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
  color:#eff5fc!important;
}

/* ---------------------------------------------------------
   EXCEL GUIADO · MODO OSCURO
   Todas las superficies siguen la misma jerarquía oscura.
   --------------------------------------------------------- */
html[data-theme="dark"] .ux-v40 .excel-workspace,
html[data-theme="dark"] .ux-v40 .excel-review{
  color:#ebf0f6!important;
}
html[data-theme="dark"] .ux-v40 .excel-step{
  background:#161f29!important;
  border-color:#354556!important;
  color:#e1e9f1!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-step>span{
  background:#223141!important;
  color:#e3ebf5!important;
  border:1px solid #45586e!important;
}
html[data-theme="dark"] .ux-v40 .excel-step b{color:#f3f6fa!important;}
html[data-theme="dark"] .ux-v40 .excel-step small{color:#a8b5c3!important;}
html[data-theme="dark"] .ux-v40 .excel-step.is-current,
html[data-theme="dark"] .ux-v40 .excel-step.is-active{
  background:#1f2f41!important;
  border-color:#536d8a!important;
  box-shadow:0 0 0 2px rgba(102,149,201,.08)!important;
}
html[data-theme="dark"] .ux-v40 .excel-step.is-current>span,
html[data-theme="dark"] .ux-v40 .excel-step.is-done>span,
html[data-theme="dark"] .ux-v40 .excel-step.is-active>span{
  background:#558bc6!important;
  border-color:#558bc6!important;
  color:#ffffff!important;
}

html[data-theme="dark"] .ux-v40 .excel-tool-card,
html[data-theme="dark"] .ux-v40 .excel-review,
html[data-theme="dark"] .ux-v40 .excel-summary,
html[data-theme="dark"] .ux-v40 .excel-final-actions,
html[data-theme="dark"] .ux-v40 .excel-safety-note{
  background:#161f29!important;
  border-color:#354556!important;
  color:#e9eff5!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-tool-card .eyebrow,
html[data-theme="dark"] .ux-v40 .excel-review .eyebrow,
html[data-theme="dark"] .ux-v40 .excel-summary small,
html[data-theme="dark"] .ux-v40 .excel-tool-card .fine,
html[data-theme="dark"] .ux-v40 .excel-final-actions small{
  color:#a9b6c5!important;
}
html[data-theme="dark"] .ux-v40 .excel-tool-card h2,
html[data-theme="dark"] .ux-v40 .excel-tool-card p,
html[data-theme="dark"] .ux-v40 .excel-review h2,
html[data-theme="dark"] .ux-v40 .excel-review p,
html[data-theme="dark"] .ux-v40 .excel-summary b,
html[data-theme="dark"] .ux-v40 .excel-summary span,
html[data-theme="dark"] .ux-v40 .excel-final-actions b{
  color:#f1f5fa!important;
}

html[data-theme="dark"] .ux-v40 .tool-icon{
  background:#223141!important;
  color:#8fb8e6!important;
  border:1px solid #475a70!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-card-actions .btn.outline{
  background:#1d2936!important;
  border-color:#46586d!important;
  color:#e1e9f1!important;
}
html[data-theme="dark"] .ux-v40 .excel-card-actions .btn.outline:hover{
  background:#263445!important;
  border-color:#60758c!important;
  color:#ffffff!important;
}

html[data-theme="dark"] .ux-v40 .excel-drop-zone{
  background:#121a23!important;
  border-color:#415265!important;
  color:#e2eaf2!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone:hover,
html[data-theme="dark"] .ux-v40 .excel-drop-zone.is-dragging{
  background:#1a2633!important;
  border-color:#627d9d!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone.has-file{
  background:#1c2a39!important;
  border-color:#5b7a9c!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-icon{
  background:#263445!important;
  color:#9dc2ed!important;
  border:1px solid #465a72!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone b,
html[data-theme="dark"] .ux-v40 .excel-file-name{color:#f1f6fb!important;}
html[data-theme="dark"] .ux-v40 .excel-drop-zone small{color:#a9b6c4!important;}

html[data-theme="dark"] .ux-v40 .excel-summary.has-errors{
  background:#27181a!important;
  border-color:#603738!important;
}
html[data-theme="dark"] .ux-v40 .excel-summary.has-errors b{color:#e6aca8!important;}
html[data-theme="dark"] .ux-v40 .excel-summary.is-ok{
  background:#14251d!important;
  border-color:#365a45!important;
}
html[data-theme="dark"] .ux-v40 .excel-summary.is-ok b{color:#9bd4b0!important;}

html[data-theme="dark"] .ux-v40 .excel-preview-table,
html[data-theme="dark"] .ux-v40 .excel-preview-table tbody tr,
html[data-theme="dark"] .ux-v40 .excel-preview-table td{
  background:#141c25!important;
  color:#e3e9f0!important;
  border-color:#354353!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-table thead th{
  background:#1e2a37!important;
  color:#eef3f9!important;
  border-color:#3f4f61!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-table tr.row-has-error td{
  background:#291a1c!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-caption{color:#a9b6c4!important;}

/* Mantener el claro sin contaminación de reglas oscuras. */
html[data-theme="light"] .ux-v40 .excel-step,
html[data-theme="light"] .ux-v40 .excel-tool-card,
html[data-theme="light"] .ux-v40 .excel-summary,
html[data-theme="light"] .ux-v40 .excel-final-actions{
  color:#273648!important;
}


/* =========================================================
   v41.13 · conectores del recorrido adaptados al modo oscuro
   ========================================================= */
@media (min-width:1481px){
  html[data-theme="dark"] .ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step:not(:last-child)::after,
  html[data-theme="dark"] .ux-v40 .timeline.timeline-flow .timeline-step:not(:last-child)::after,
  html[data-theme="dark"] .ux-v40 .phase-grid.phase-grid-flow .phase-card:not(:last-child)::after{
    background:#1a242f!important;
    border:1px solid #46576b!important;
    color:var(--phase-color)!important;
    box-shadow:0 4px 12px rgba(0,0,0,.26)!important;
  }
  html[data-theme="dark"] .ux-v40 .page-shell.product .timeline.timeline-flow .timeline-step.current:not(:last-child)::after,
  html[data-theme="dark"] .ux-v40 .timeline.timeline-flow .timeline-step.current:not(:last-child)::after{
    background:#212f3e!important;
    border-color:#5c6e83!important;
  }
}


/* =========================================================
   v41.14 · selector de tema deslizante integrado en el nav
   ========================================================= */
.ux-v40 .theme-toggle.theme-switch,
.ux-v40 .header-actions .theme-toggle.theme-switch,
.ux-v40 .theme-toggle-alone.theme-switch{
  width:78px!important;
  min-width:78px!important;
  max-width:78px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  outline:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 78px!important;
  overflow:visible!important;
}
.ux-v40 .theme-toggle.theme-switch:hover,
.ux-v40 .theme-toggle.theme-switch:active{
  background:transparent!important;
  box-shadow:none!important;
  transform:none!important;
}
.ux-v40 .theme-toggle.theme-switch:focus-visible{
  outline:3px solid rgba(90,155,226,.28)!important;
  outline-offset:3px!important;
  border-radius:999px!important;
}
.ux-v40 .theme-switch-track{
  position:relative!important;
  width:74px!important;
  height:38px!important;
  display:block!important;
  border-radius:999px!important;
  overflow:hidden!important;
  transition:background .2s ease,border-color .2s ease,box-shadow .2s ease!important;
}
.ux-v40 .theme-switch-icon{
  position:absolute!important;
  top:50%!important;
  z-index:2!important;
  width:24px!important;
  height:24px!important;
  margin-top:-12px!important;
  display:grid!important;
  place-items:center!important;
  pointer-events:none!important;
  transition:color .2s ease,opacity .2s ease!important;
}
.ux-v40 .theme-switch-icon svg{width:18px!important;height:18px!important;display:block!important;}
.ux-v40 .theme-switch-sun{left:7px!important;}
.ux-v40 .theme-switch-moon{right:7px!important;}
.ux-v40 .theme-switch-thumb{
  position:absolute!important;
  z-index:1!important;
  top:3px!important;
  left:3px!important;
  width:32px!important;
  height:32px!important;
  border-radius:50%!important;
  background:#1e71c0!important;
  box-shadow:0 3px 10px rgba(7,74,134,.25)!important;
  transition:transform .22s cubic-bezier(.2,.75,.25,1),background .2s ease!important;
}
.ux-v40 .theme-toggle-label{display:none!important;}

/* modo claro */
html[data-theme="light"] .ux-v40 .theme-switch-track{
  background:#e9edf1!important;
  border:1px solid #d3d9e0!important;
  box-shadow:inset 0 1px 2px rgba(28,41,56,.08)!important;
}
html[data-theme="light"] .ux-v40 .theme-switch-sun{color:#ffffff!important;}
html[data-theme="light"] .ux-v40 .theme-switch-moon{color:#a3adb8!important;}
html[data-theme="light"] .ux-v40 .theme-switch-thumb{transform:translateX(0)!important;background:#1e71c0!important;}
html[data-theme="light"] .ux-v40 .theme-toggle.theme-switch:hover .theme-switch-track{background:#e4e9ed!important;border-color:#c3cad3!important;}

/* modo oscuro */
html[data-theme="dark"] .ux-v40 .theme-switch-track{
  background:#13171b!important;
  border:1px solid #2b3139!important;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.025),0 2px 8px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .ux-v40 .theme-switch-sun{color:#818891!important;}
html[data-theme="dark"] .ux-v40 .theme-switch-moon{color:#ffffff!important;}
html[data-theme="dark"] .ux-v40 .theme-switch-thumb{transform:translateX(36px)!important;background:#1e71c0!important;}
html[data-theme="dark"] .ux-v40 .theme-toggle.theme-switch:hover .theme-switch-track{background:#181d22!important;border-color:#38414b!important;}

@media(max-width:820px){
  .ux-v40 .header-actions .theme-toggle.theme-switch{
    order:-1!important;
    width:76px!important;
    min-width:76px!important;
    max-width:76px!important;
    flex-basis:76px!important;
  }
  .ux-v40 .theme-switch-track{width:72px!important;height:38px!important;}
  html[data-theme="dark"] .ux-v40 .theme-switch-thumb{transform:translateX(34px)!important;}
}


/* =========================================================
   v41.15 · switch de tema sin rectángulo contenedor
   ========================================================= */
.ux-v40 .theme-toggle.theme-switch,
.ux-v40 .header-actions .theme-toggle.theme-switch,
.ux-v40 .theme-toggle-alone.theme-switch{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin:0!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  border-radius:0!important;
  flex:0 0 auto!important;
}
.ux-v40 .theme-toggle.theme-switch:hover,
.ux-v40 .header-actions .theme-toggle.theme-switch:hover,
.ux-v40 .theme-toggle-alone.theme-switch:hover,
.ux-v40 .theme-toggle.theme-switch:active,
.ux-v40 .header-actions .theme-toggle.theme-switch:active,
.ux-v40 .theme-toggle-alone.theme-switch:active{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  transform:none!important;
}
.ux-v40 .theme-toggle.theme-switch:focus-visible,
.ux-v40 .header-actions .theme-toggle.theme-switch:focus-visible,
.ux-v40 .theme-toggle-alone.theme-switch:focus-visible{
  outline:none!important;
}
.ux-v40 .theme-toggle.theme-switch:focus-visible .theme-switch-track,
.ux-v40 .header-actions .theme-toggle.theme-switch:focus-visible .theme-switch-track,
.ux-v40 .theme-toggle-alone.theme-switch:focus-visible .theme-switch-track{
  outline:3px solid rgba(81,141,207,.24)!important;
  outline-offset:2px!important;
}
@media(max-width:980px){
  .ux-v40 .header-actions .theme-toggle.theme-switch{order:0!important;}
}


/* =========================================================
   v41.16 · switch sin marco de foco exterior
   ========================================================= */
.ux-v40 button.theme-toggle.theme-switch,
.ux-v40 button.theme-toggle.theme-switch:focus,
.ux-v40 button.theme-toggle.theme-switch:focus-visible,
.ux-v40 button.theme-toggle.theme-switch:active{
  outline:none!important;
  outline-offset:0!important;
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  -webkit-tap-highlight-color:transparent!important;
}
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:active .theme-switch-track{
  outline:none!important;
  outline-offset:0!important;
  box-shadow:none!important;
}
/* El feedback de foco queda solo en el thumb, sin rectángulo exterior */
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-thumb{
  box-shadow:0 0 0 3px rgba(30,113,192,.18),0 3px 10px rgba(7,74,134,.25)!important;
}


/* =========================================================
   v41.18 · switch de tema sin hover
   ========================================================= */
.ux-v40 button.theme-toggle.theme-switch:hover,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-icon{
  filter:none!important;
  box-shadow:none!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track{
  background:#e9edf1!important;
  border-color:#d3d9e0!important;
  box-shadow:inset 0 1px 2px rgba(28,41,56,.08)!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb{
  background:#1e71c0!important;
  transform:translateX(0)!important;
  box-shadow:0 3px 10px rgba(7,74,134,.25)!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-sun{color:#ffffff!important;}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-moon{color:#a3adb8!important;}

html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track{
  background:#13171b!important;
  border-color:#2b3139!important;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.025),0 2px 8px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb{
  background:#1e71c0!important;
  transform:translateX(36px)!important;
  box-shadow:0 3px 10px rgba(7,74,134,.25)!important;
}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-sun{color:#818891!important;}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-moon{color:#ffffff!important;}
@media(max-width:820px){
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb{transform:translateX(34px)!important;}
}


/* =========================================================
   v41.19 · switch de tema sin hover ni feedback visual
   ========================================================= */
.ux-v40 button.theme-toggle.theme-switch,
.ux-v40 button.theme-toggle.theme-switch:hover,
.ux-v40 button.theme-toggle.theme-switch:focus,
.ux-v40 button.theme-toggle.theme-switch:focus-visible,
.ux-v40 button.theme-toggle.theme-switch:active{
  -webkit-appearance:none!important;
  appearance:none!important;
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  outline:0!important;
  outline-offset:0!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
  padding:0!important;
  margin:0!important;
}
.ux-v40 button.theme-toggle.theme-switch .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:active .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch .theme-switch-icon,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-icon,
.ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-icon,
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-icon,
.ux-v40 button.theme-toggle.theme-switch:active .theme-switch-icon,
.ux-v40 button.theme-toggle.theme-switch .theme-switch-thumb,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb,
.ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-thumb,
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-thumb,
.ux-v40 button.theme-toggle.theme-switch:active .theme-switch-thumb{
  filter:none!important;
  outline:0!important;
  outline-offset:0!important;
  transition:none!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-track,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-track,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-track,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-track{
  background:#e9edf1!important;
  border:1px solid #d3d9e0!important;
  box-shadow:inset 0 1px 2px rgba(28,41,56,.08)!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-thumb,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-thumb,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-thumb,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-thumb{
  background:#1e71c0!important;
  transform:translateX(0)!important;
  box-shadow:0 3px 10px rgba(7,74,134,.25)!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-sun,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-sun,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-sun,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-sun{color:#ffffff!important;}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-moon,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-moon,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-moon,
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-moon{color:#a3adb8!important;}

html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-track,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-track,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-track,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-track{
  background:#13171b!important;
  border:1px solid #2b3139!important;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.025),0 2px 8px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-thumb,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-thumb,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-thumb,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-thumb{
  background:#1e71c0!important;
  transform:translateX(36px)!important;
  box-shadow:0 3px 10px rgba(7,74,134,.25)!important;
}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-sun,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-sun,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-sun,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-sun{color:#818891!important;}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-moon,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-moon,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-moon,
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-moon{color:#ffffff!important;}
@media(max-width:820px){
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch .theme-switch-thumb,
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb,
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-thumb,
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-thumb,
  html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:active .theme-switch-thumb{transform:translateX(34px)!important;}
}


/* =========================================================
   v41.20 · elimina por completo el rectángulo exterior del switch
   ========================================================= */
.ux-v40 button.theme-toggle.theme-switch,
.ux-v40 .header-actions button.theme-toggle.theme-switch,
.ux-v40 .theme-toggle.theme-switch,
.ux-v40 .header-actions .theme-toggle.theme-switch{
  width:74px!important;
  min-width:74px!important;
  max-width:74px!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  padding:0!important;
  margin:0!important;
  border:none!important;
  outline:none!important;
  outline-offset:0!important;
  background:none!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  border-radius:999px!important;
  display:inline-block!important;
  vertical-align:middle!important;
  line-height:0!important;
  overflow:visible!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.ux-v40 button.theme-toggle.theme-switch::before,
.ux-v40 button.theme-toggle.theme-switch::after,
.ux-v40 .theme-toggle.theme-switch::before,
.ux-v40 .theme-toggle.theme-switch::after{
  content:none!important;
  display:none!important;
}
.ux-v40 button.theme-toggle.theme-switch:hover,
.ux-v40 button.theme-toggle.theme-switch:focus,
.ux-v40 button.theme-toggle.theme-switch:focus-visible,
.ux-v40 button.theme-toggle.theme-switch:active,
.ux-v40 .theme-toggle.theme-switch:hover,
.ux-v40 .theme-toggle.theme-switch:focus,
.ux-v40 .theme-toggle.theme-switch:focus-visible,
.ux-v40 .theme-toggle.theme-switch:active{
  border:none!important;
  outline:none!important;
  background:none!important;
  background-color:transparent!important;
  box-shadow:none!important;
  transform:none!important;
}
.ux-v40 .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:focus .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:focus-visible .theme-switch-track,
.ux-v40 button.theme-toggle.theme-switch:active .theme-switch-track{
  width:74px!important;
  height:38px!important;
  margin:0!important;
}
@media(max-width:820px){
  .ux-v40 button.theme-toggle.theme-switch,
  .ux-v40 .header-actions button.theme-toggle.theme-switch,
  .ux-v40 .theme-toggle.theme-switch,
  .ux-v40 .header-actions .theme-toggle.theme-switch,
  .ux-v40 .theme-switch-track,
  .ux-v40 button.theme-toggle.theme-switch .theme-switch-track{
    width:72px!important;
    min-width:72px!important;
    max-width:72px!important;
    height:38px!important;
  }
}


/* =========================================================
   v41.21 · contadores de pendientes sin fondo
   ========================================================= */
.ux-v40 .pending-kpi b,
.ux-v40 .pending-kpi.is-active b,
.ux-v40 .pending-kpi.danger b{
  background:transparent!important;
  box-shadow:none!important;
  border:0!important;
  padding:0!important;
  min-width:auto!important;
}
html[data-theme="dark"] .ux-v40 .pending-kpi b,
html[data-theme="dark"] .ux-v40 .pending-kpi.is-active b,
html[data-theme="dark"] .ux-v40 .pending-kpi.danger b{
  background:transparent!important;
  box-shadow:none!important;
  border:0!important;
}


/* =========================================================
   v41.22 · modales limpios + legibilidad oscuro + PDF ficha compacto
   ========================================================= */

/* Modales sin bordes exteriores ni sombras */
.ux-v40 .app-modal-card,
.ux-v40 .management-modal .app-modal-card,
.ux-v40 .danger-confirm-card,
html[data-theme="dark"] .ux-v40 .app-modal-card,
html[data-theme="dark"] .ux-v40 .management-modal .app-modal-card,
html[data-theme="dark"] .ux-v40 .danger-confirm-card{
  border:0!important;
  box-shadow:none!important;
}

/* Ficha de inventario/producto completamente legible en modo oscuro */
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary > div,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-card,
html[data-theme="dark"] .ux-v40 .page-shell.product .reception-notification-strip,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-form,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-lock-notice,
html[data-theme="dark"] .ux-v40 .page-shell.product .notice.inline{
  background:#131a23!important;
  color:#edf2f7!important;
  border-color:#364658!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .small-title,
html[data-theme="dark"] .ux-v40 .page-shell.product .eyebrow,
html[data-theme="dark"] .ux-v40 .page-shell.product .block-title p,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary small,
html[data-theme="dark"] .ux-v40 .page-shell.product .field,
html[data-theme="dark"] .ux-v40 .page-shell.product .field > span,
html[data-theme="dark"] .ux-v40 .page-shell.product .field label,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields dt,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head small,
html[data-theme="dark"] .ux-v40 .page-shell.product .reception-notification-strip small,
html[data-theme="dark"] .ux-v40 .page-shell.product .notify-state,
html[data-theme="dark"] .ux-v40 .page-shell.product .progress-warning{
  color:#b2becb!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary b,
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .mono,
html[data-theme="dark"] .ux-v40 .page-shell.product .block-title h2,
html[data-theme="dark"] .ux-v40 .page-shell.product .block-title h3,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-head h3,
html[data-theme="dark"] .ux-v40 .page-shell.product .read-fields dd,
html[data-theme="dark"] .ux-v40 .page-shell.product .notice.inline b,
html[data-theme="dark"] .ux-v40 .page-shell.product .notice.inline p,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-lock-notice b,
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-lock-notice p,
html[data-theme="dark"] .ux-v40 .page-shell.product .notification-statuses b,
html[data-theme="dark"] .ux-v40 .page-shell.product .notification-statuses span,
html[data-theme="dark"] .ux-v40 .page-shell.product .notification-strip-copy h3,
html[data-theme="dark"] .ux-v40 .page-shell.product .notification-strip-copy p{
  color:#f1f5fa!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product input,
html[data-theme="dark"] .ux-v40 .page-shell.product select,
html[data-theme="dark"] .ux-v40 .page-shell.product textarea{
  background:#17212d!important;
  color:#f1f5fa!important;
  border-color:#435569!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product input::placeholder,
html[data-theme="dark"] .ux-v40 .page-shell.product textarea::placeholder{
  color:#99a6b4!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .storage-chip{box-shadow:none!important;}

/* Inventario completo / tabla completa legible en oscuro */
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions{
  background:#131a23!important;
  border-color:#364658!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions,
html[data-theme="dark"] .ux-v40 .excel-print-screen-actions .excel-print-hint,
html[data-theme="dark"] .ux-v40 .excel-print-head h1,
html[data-theme="dark"] .ux-v40 .excel-print-head p,
html[data-theme="dark"] .ux-v40 .excel-print-meta b,
html[data-theme="dark"] .ux-v40 .excel-print-meta span,
html[data-theme="dark"] .ux-v40 .excel-full-table th,
html[data-theme="dark"] .ux-v40 .excel-full-table td{
  color:#eef3f9!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-report,
html[data-theme="dark"] .ux-v40 .excel-full-table-frame,
html[data-theme="dark"] .ux-v40 .excel-full-table{
  background:#101720!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-head{border-bottom-color:#3e4f62!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table-frame{border-color:#364658!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table th,
html[data-theme="dark"] .ux-v40 .excel-full-table td{border-color:#364658!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table thead .excel-columns-row th{background:#1c2632!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table tbody tr:nth-child(even){background:#161f2a!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g1{background:#27323f!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g2{background:#38321d!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g3{background:#23303f!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g4{background:#1e3328!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g5{background:#372921!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g6{background:#39331f!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g7{background:#25382c!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g8,
html[data-theme="dark"] .ux-v40 .excel-full-table .gmeta{background:#252c35!important;}

/* PDF de ficha del producto resumido en tarjetas y más compacto */
@media print{
  body.printing-inventory #dpunto-print-sheet .reception-notification-strip,
  body.printing-inventory #dpunto-print-sheet .mobile-phase-progress,
  body.printing-inventory #dpunto-print-sheet .stage-toggle,
  body.printing-inventory #dpunto-print-sheet .block-title > div > p:last-child{
    display:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .block-title{margin:0 0 2.2mm!important;}
  body.printing-inventory #dpunto-print-sheet .block-title .eyebrow{font-size:6pt!important;margin:0 0 .7mm!important;}
  body.printing-inventory #dpunto-print-sheet .block-title h2{font-size:10.5pt!important;margin:0!important;}
  body.printing-inventory #dpunto-print-sheet .record-summary{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:1.8mm!important;
    margin-bottom:2.6mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .record-summary > div{
    padding:1.8mm 2.1mm!important;
    border:.2mm solid #c6ced8!important;
    border-radius:2.3mm!important;
    background:#ffffff!important;
    box-shadow:none!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet .record-summary .small-title{font-size:5.3pt!important;display:block!important;margin-bottom:.7mm!important;}
  body.printing-inventory #dpunto-print-sheet .record-summary b,
  body.printing-inventory #dpunto-print-sheet .record-summary .mono{font-size:8.2pt!important;line-height:1.1!important;}
  body.printing-inventory #dpunto-print-sheet .record-summary small{font-size:5.5pt!important;line-height:1.1!important;}

  body.printing-inventory #dpunto-print-sheet .timeline{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:1.5mm!important;
    margin:0 0 2.6mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .timeline-step{
    min-height:auto!important;
    padding:1.5mm 1.7mm!important;
    border:.18mm solid #c6ced8!important;
    border-radius:2mm!important;
    gap:.8mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .timeline-step .step-num{width:5.2mm!important;height:5.2mm!important;min-width:5.2mm!important;font-size:6pt!important;}
  body.printing-inventory #dpunto-print-sheet .timeline-step .step-name{font-size:6.4pt!important;line-height:1.1!important;}
  body.printing-inventory #dpunto-print-sheet .timeline-step small{font-size:5.2pt!important;line-height:1.1!important;}

  body.printing-inventory #dpunto-print-sheet .stages{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:2mm!important;
    align-items:start!important;
  }
  body.printing-inventory #dpunto-print-sheet .stages > .group-1,
  body.printing-inventory #dpunto-print-sheet .stages > .group-7,
  body.printing-inventory #dpunto-print-sheet .stages > .group-8{grid-column:span 2!important;}
  body.printing-inventory #dpunto-print-sheet .stage-card{
    margin:0!important;
    border:.2mm solid #c6ced8!important;
    border-radius:2.4mm!important;
    background:#ffffff!important;
    box-shadow:none!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet .stage-head{
    min-height:auto!important;
    padding:1.7mm 2mm!important;
    gap:1.4mm!important;
    border-bottom:.18mm solid #dbe1e8!important;
  }
  body.printing-inventory #dpunto-print-sheet .stage-mark{width:6.2mm!important;height:6.2mm!important;min-width:6.2mm!important;font-size:6.1pt!important;}
  body.printing-inventory #dpunto-print-sheet .stage-head small{font-size:5.1pt!important;line-height:1.05!important;}
  body.printing-inventory #dpunto-print-sheet .stage-head h3{font-size:8pt!important;line-height:1.1!important;}
  body.printing-inventory #dpunto-print-sheet .status-marker{font-size:5.2pt!important;padding:.35mm .9mm!important;border-radius:999px!important;}
  body.printing-inventory #dpunto-print-sheet .stage-form,
  body.printing-inventory #dpunto-print-sheet .read-fields{padding:1.9mm 2mm!important;}
  body.printing-inventory #dpunto-print-sheet .fields-grid,
  body.printing-inventory #dpunto-print-sheet .read-fields{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:1.1mm 1.5mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .field,
  body.printing-inventory #dpunto-print-sheet .read-fields dt,
  body.printing-inventory #dpunto-print-sheet .read-fields dd{line-height:1.08!important;}
  body.printing-inventory #dpunto-print-sheet .field,
  body.printing-inventory #dpunto-print-sheet .read-fields dt{font-size:5.1pt!important;}
  body.printing-inventory #dpunto-print-sheet .read-fields dd,
  body.printing-inventory #dpunto-print-sheet .field .print-field-value{font-size:6.1pt!important;min-height:0!important;padding:0!important;}
  body.printing-inventory #dpunto-print-sheet .notice.inline,
  body.printing-inventory #dpunto-print-sheet .stage-lock-notice{
    padding:1.5mm 1.8mm!important;
    font-size:5.4pt!important;
    border-radius:1.8mm!important;
    grid-column:1 / -1!important;
  }
  body.printing-inventory #dpunto-print-sheet .stage-actions{display:none!important;}
}


/* =========================================================
   v41.23 · modales oscuros sin sombra + más aire en Mostrar más
   ========================================================= */

/* Elimina cualquier sombra exterior residual de TODOS los modales en oscuro. */
html[data-theme="dark"] .ux-v40 dialog.app-modal,
html[data-theme="dark"] .ux-v40 dialog.management-modal,
html[data-theme="dark"] .ux-v40 dialog.app-confirm-modal,
html[data-theme="dark"] .ux-v40 dialog.ios-scanner-modal,
html[data-theme="dark"] .ux-v40 .app-modal-card,
html[data-theme="dark"] .ux-v40 .management-modal .app-modal-card,
html[data-theme="dark"] .ux-v40 .confirm-modal-card,
html[data-theme="dark"] .ux-v40 .danger-confirm-card,
html[data-theme="dark"] .ux-v40 .audit-detail-card,
html[data-theme="dark"] .ux-v40 .ios-scanner-card{
  box-shadow:none!important;
  filter:none!important;
  -webkit-filter:none!important;
}
html[data-theme="dark"] .ux-v40 dialog.app-modal{
  border:0!important;
  outline:0!important;
  background:transparent!important;
}
html[data-theme="dark"] .ux-v40 dialog.app-modal::backdrop{
  box-shadow:none!important;
  filter:none!important;
}

/* Últimos registros actualizados · más espacio alrededor de Mostrar más. */
.ux-v40 .recent-list > .progressive-more-control{
  margin:0!important;
  padding:18px 16px 22px!important;
  border-top:1px solid var(--ux-border)!important;
  background:transparent!important;
}
.ux-v40 .recent-list > .progressive-more-control .progressive-more-btn{
  min-width:190px!important;
  min-height:44px!important;
  padding:10px 18px!important;
}
html[data-theme="dark"] .ux-v40 .recent-list > .progressive-more-control{
  border-top-color:#2f3b4a!important;
}


/* =========================================================
   v41.24 · borde fino para modales, sin sombras
   ========================================================= */
.ux-v40 .app-modal-card,
.ux-v40 .management-modal .app-modal-card,
.ux-v40 .danger-confirm-card{
  border:1px solid #dae0e7!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .app-modal-card,
html[data-theme="dark"] .ux-v40 .management-modal .app-modal-card,
html[data-theme="dark"] .ux-v40 .danger-confirm-card{
  border:1px solid #394859!important;
  box-shadow:none!important;
}

/* =========================================================
   v41.25 · ficha individual impresa en una hoja, legible color/B&N
   ========================================================= */
@media print{
  @page{size:A4 landscape;margin:5mm;}

  body.printing-inventory #dpunto-print-sheet{
    font-family:Arial,Helvetica,sans-serif!important;
    font-size:6.4pt!important;
    line-height:1.12!important;
    color:#111111!important;
    background:#ffffff!important;
  }
  body.printing-inventory #dpunto-print-sheet *{
    box-shadow:none!important;
    text-shadow:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-head{
    margin:0 0 2mm!important;
    padding:0 0 1.4mm!important;
    border-bottom:.35mm solid #222222!important;
    color:#111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-head b{font-size:10.2pt!important;color:#111111!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-head span{font-size:6.2pt!important;color:#333333!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-head small{font-size:5.8pt!important;color:#444444!important;}

  /* Cabecera de la pieza */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading{
    display:flex!important;
    align-items:flex-end!important;
    justify-content:space-between!important;
    gap:4mm!important;
    margin:0 0 2mm!important;
    padding:0!important;
    border:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading .eyebrow{font-size:5.2pt!important;color:#444444!important;margin:0 0 .6mm!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading h1{font-size:12.5pt!important;line-height:1!important;margin:0!important;color:#111111!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading p{font-size:6.1pt!important;line-height:1.1!important;margin:.6mm 0 0!important;color:#333333!important;max-width:190mm!important;}

  /* Resumen superior: tarjetas simples, alto contraste */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary{
    display:grid!important;
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:1.2mm!important;
    margin:0 0 2mm!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary>div{
    min-width:0!important;
    min-height:0!important;
    padding:1.3mm 1.5mm!important;
    border:.25mm solid #555555!important;
    border-radius:1.5mm!important;
    background:#ffffff!important;
    color:#111111!important;
    break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .small-title{
    display:block!important;
    margin:0 0 .55mm!important;
    font-size:4.7pt!important;
    line-height:1.05!important;
    letter-spacing:.03em!important;
    color:#444444!important;
    font-weight:800!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary b,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .mono{
    display:block!important;
    margin:0!important;
    font-size:6.9pt!important;
    line-height:1.08!important;
    color:#111111!important;
    overflow-wrap:anywhere!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary small{
    display:block!important;
    margin:.45mm 0 0!important;
    font-size:4.7pt!important;
    line-height:1.08!important;
    color:#444444!important;
  }

  /* Estados: siempre entendibles sin color */
  body.printing-inventory #dpunto-print-sheet .badge,
  body.printing-inventory #dpunto-print-sheet .phase-chip,
  body.printing-inventory #dpunto-print-sheet .storage-chip,
  body.printing-inventory #dpunto-print-sheet .status-marker{
    background:#ffffff!important;
    color:#111111!important;
    border:.25mm solid #444444!important;
    box-shadow:none!important;
    padding:.45mm .9mm!important;
    border-radius:999px!important;
    font-size:5.2pt!important;
    font-weight:800!important;
  }
  body.printing-inventory #dpunto-print-sheet .storage-chip b,
  body.printing-inventory #dpunto-print-sheet .storage-chip span,
  body.printing-inventory #dpunto-print-sheet .phase-chip,
  body.printing-inventory #dpunto-print-sheet .badge{color:#111111!important;background:#ffffff!important;}

  /* Títulos de sección mínimos */
  body.printing-inventory #dpunto-print-sheet .print-section-title{
    margin:1.4mm 0 1mm!important;
    padding:0 0 .7mm!important;
    border-bottom:.22mm solid #777777!important;
    color:#111111!important;
    font-size:7.2pt!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.04em!important;
  }

  /* Recorrido: 6 bloques compactos, sin depender de flechas/colores */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline{
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:1mm!important;
    margin:0 0 1.8mm!important;
    padding:0!important;
    list-style:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step{
    min-width:0!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:auto 1fr!important;
    grid-template-rows:auto auto!important;
    gap:.4mm .8mm!important;
    align-items:center!important;
    padding:1mm 1.2mm!important;
    border:.25mm solid #666666!important;
    border-radius:1.4mm!important;
    background:#ffffff!important;
    color:#111111!important;
    break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step::before,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step::after{display:none!important;content:none!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-num{
    grid-row:1 / span 2!important;
    width:5mm!important;
    height:5mm!important;
    min-width:5mm!important;
    display:grid!important;
    place-items:center!important;
    border:.25mm solid #333333!important;
    border-radius:50%!important;
    background:#ffffff!important;
    color:#111111!important;
    font-size:5.7pt!important;
    font-weight:900!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-name{font-size:5.8pt!important;line-height:1.05!important;color:#111111!important;font-weight:800!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step small{font-size:4.6pt!important;line-height:1.05!important;color:#333333!important;border:0!important;margin:0!important;padding:0!important;}

  /* Fases/datos: rejilla de 3 columnas tipo tarjeta */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row dense!important;
    gap:1.25mm!important;
    margin:0!important;
    align-items:start!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.stage-card,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-1,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-4,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-5,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-6,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-7,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-8{
    grid-column:span 1!important;
    min-width:0!important;
    height:auto!important;
    margin:0!important;
    border:.25mm solid #555555!important;
    border-radius:1.5mm!important;
    background:#ffffff!important;
    color:#111111!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    overflow:hidden!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head{
    display:flex!important;
    align-items:center!important;
    min-height:0!important;
    gap:1mm!important;
    padding:1mm 1.2mm!important;
    border:0!important;
    border-bottom:.2mm solid #aaaaaa!important;
    background:#f4f4f4!important;
    color:#111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-mark{
    width:5.2mm!important;
    height:5.2mm!important;
    min-width:5.2mm!important;
    display:grid!important;
    place-items:center!important;
    border:.22mm solid #444444!important;
    border-radius:50%!important;
    background:#ffffff!important;
    color:#111111!important;
    font-size:4.8pt!important;
    font-weight:900!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head small{font-size:4.3pt!important;line-height:1!important;color:#444444!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head h3{font-size:6.3pt!important;line-height:1.05!important;margin:.25mm 0 0!important;color:#111111!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .status-marker{margin-left:auto!important;white-space:nowrap!important;}

  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-form,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-lock-notice{
    padding:1.1mm 1.2mm!important;
    margin:0!important;
    background:#ffffff!important;
    color:#111111!important;
    border:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .fields-grid,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:.7mm 1.2mm!important;
    margin:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .field{
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    gap:.2mm!important;
    color:#444444!important;
    font-size:4.5pt!important;
    line-height:1.05!important;
    font-weight:700!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .print-field-value,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dd{
    display:block!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    color:#111111!important;
    font-size:5.35pt!important;
    line-height:1.08!important;
    font-weight:650!important;
    overflow-wrap:anywhere!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dt{font-size:4.4pt!important;color:#444444!important;margin:0!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .storage-editor{padding:0!important;border:0!important;background:#ffffff!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .storage-editor-title{font-size:4.5pt!important;color:#444444!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .storage-editor-grid{display:grid!important;grid-template-columns:1fr 2fr!important;gap:.8mm!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-compact .notice.inline,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-lock-notice{
    font-size:4.7pt!important;
    line-height:1.08!important;
    border-top:.2mm solid #bbbbbb!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .print-stage-empty .stage-head{border-bottom:0!important;}

  /* Evita colores problemáticos al imprimir en B/N */
  body.printing-inventory #dpunto-print-sheet .product-print-compact [class*="phase-"],
  body.printing-inventory #dpunto-print-sheet .product-print-compact .good,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .defect,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .done,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .current,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .later,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .legacy-locked{
    color:#111111!important;
  }
}


/* =========================================================
   v41.26 · impresión premium de ficha sin páginas vacías
   ========================================================= */
@media print{
  /* IMPORTANTÍSIMO: la UI no solo se oculta, se saca del flujo de impresión. */
  html:has(body.printing-inventory),
  body.printing-inventory{
    margin:0!important;
    padding:0!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
    background:#ffffff!important;
  }
  body.printing-inventory > *:not(#dpunto-print-sheet){
    display:none!important;
  }
  body.printing-inventory #dpunto-print-sheet{
    display:block!important;
    position:static!important;
    inset:auto!important;
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    visibility:visible!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet *{
    visibility:visible!important;
  }

  @page{size:A4 landscape;margin:4mm;}

  /* Cabecera propia de documento: compacta pero con jerarquía visual real. */
  body.printing-inventory #dpunto-print-sheet .product-print-premium-head{
    display:grid!important;
    grid-template-columns:34mm 1fr 31mm!important;
    align-items:end!important;
    gap:3mm!important;
    margin:0 0 2.2mm!important;
    padding:0 0 1.8mm!important;
    border-bottom:.55mm solid #111111!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    color:#111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-brand{
    display:grid!important;
    align-content:end!important;
    gap:.3mm!important;
    min-width:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-brand strong{
    font-size:13pt!important;
    line-height:.95!important;
    letter-spacing:-.5pt!important;
    color:#111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-brand span{
    font-size:4.7pt!important;
    letter-spacing:.13em!important;
    font-weight:800!important;
    color:#555555!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-title{
    min-width:0!important;
    padding-left:3mm!important;
    border-left:.35mm solid #777777!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-title small{
    display:block!important;
    margin:0 0 .45mm!important;
    font-size:4.7pt!important;
    font-weight:900!important;
    letter-spacing:.08em!important;
    color:#555555!important;
    text-transform:uppercase!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-title h1{
    margin:0!important;
    font-size:11.4pt!important;
    line-height:1.02!important;
    color:#111111!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-title p{
    margin:.55mm 0 0!important;
    font-size:5.3pt!important;
    line-height:1.08!important;
    color:#444444!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-meta{
    display:grid!important;
    justify-items:end!important;
    align-content:end!important;
    gap:.25mm!important;
    text-align:right!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-meta span{
    font-size:4.4pt!important;
    font-weight:900!important;
    letter-spacing:.08em!important;
    color:#555555!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-meta b{
    font-size:7.2pt!important;
    color:#111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-meta small{
    font-size:4.8pt!important;
    color:#555555!important;
  }

  /* Eliminamos cualquier cabecera antigua si quedara en el clon. */
  body.printing-inventory #dpunto-print-sheet .print-report-head,
  body.printing-inventory #dpunto-print-sheet .page-heading{
    display:none!important;
  }

  /* Resumen: siete tarjetas compactas, con lectura fuerte incluso en B/N. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:1.05mm!important;
    margin:0 0 1.7mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary>div{
    padding:1.05mm 1.25mm!important;
    border:.22mm solid #777777!important;
    border-left:.7mm solid #222222!important;
    border-radius:1.2mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .small-title{
    font-size:4.25pt!important;
    margin-bottom:.35mm!important;
    color:#555555!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary b,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .mono{
    font-size:6.25pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary small{
    font-size:4.15pt!important;
    margin-top:.3mm!important;
  }

  /* Separadores de sección más editoriales y menos “UI”. */
  body.printing-inventory #dpunto-print-sheet .print-section-title{
    display:flex!important;
    align-items:center!important;
    gap:1.6mm!important;
    margin:1mm 0 .8mm!important;
    padding:0!important;
    border:0!important;
    font-size:6pt!important;
    line-height:1!important;
    letter-spacing:.075em!important;
  }
  body.printing-inventory #dpunto-print-sheet .print-section-title::before{
    content:''!important;
    display:block!important;
    width:4mm!important;
    height:.55mm!important;
    background:#111111!important;
    flex:0 0 4mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .print-section-title::after{
    content:''!important;
    display:block!important;
    height:.2mm!important;
    background:#aaaaaa!important;
    flex:1 1 auto!important;
  }

  /* Línea de trazabilidad muy compacta. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline{
    gap:.8mm!important;
    margin:0 0 1.35mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step{
    padding:.8mm .9mm!important;
    border:.22mm solid #777777!important;
    border-radius:1mm!important;
    gap:.3mm .65mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-num{
    width:4.4mm!important;
    height:4.4mm!important;
    min-width:4.4mm!important;
    font-size:5.2pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-name{
    font-size:5.25pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step small{
    font-size:4.15pt!important;
  }

  /* Datos: 4 columnas = máximo aprovechamiento horizontal y solo dos filas para 8 bloques. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:1.05mm!important;
    align-items:stretch!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.stage-card,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-1,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-2,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-3,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-4,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-5,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-6,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-7,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-8{
    grid-column:span 1!important;
    border:.22mm solid #777777!important;
    border-radius:1.15mm!important;
    overflow:hidden!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head{
    padding:.75mm .9mm!important;
    gap:.7mm!important;
    border-bottom:.2mm solid #aaaaaa!important;
    background:#eeeeee!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-mark{
    width:4.4mm!important;
    height:4.4mm!important;
    min-width:4.4mm!important;
    border-radius:1mm!important;
    font-size:4.25pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head small{
    font-size:3.8pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head h3{
    font-size:5.55pt!important;
    margin:.1mm 0 0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .status-marker{
    font-size:4.1pt!important;
    padding:.25mm .65mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-form,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-lock-notice{
    padding:.75mm .9mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .fields-grid,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:.45mm .85mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .field{
    font-size:3.9pt!important;
    gap:.1mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .print-field-value,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dd{
    font-size:4.7pt!important;
    line-height:1.03!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dt,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .storage-editor-title{
    font-size:3.85pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .notice.inline,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-lock-notice{
    font-size:4.05pt!important;
    line-height:1.03!important;
  }

  /* Nada que no aporte información debe forzar otra página. */
  body.printing-inventory #dpunto-print-sheet .empty,
  body.printing-inventory #dpunto-print-sheet .empty-state,
  body.printing-inventory #dpunto-print-sheet .progressive-more-control,
  body.printing-inventory #dpunto-print-sheet .site-footer,
  body.printing-inventory #dpunto-print-sheet .header,
  body.printing-inventory #dpunto-print-sheet dialog{
    display:none!important;
  }
}


/* v41.27 · más espaciado en acciones de cabecera de la ficha */
.ux-v40 .page-heading-actions{gap:16px!important;margin-top:10px!important}.ux-v40 .page-heading-actions .btn{padding-left:20px!important;padding-right:20px!important}.ux-v40 .inline-heading-form{display:inline-flex!important;margin:0!important}@media(max-width:900px){.ux-v40 .page-heading-actions{gap:12px!important;margin-top:14px!important}}


/* =========================================================
   v41.28 · impresión de ficha: solo información necesaria
   ========================================================= */
@media print{
  /* Seguridad adicional: estos elementos nunca deben participar en el PDF. */
  body.printing-inventory #dpunto-print-sheet .hardware-scanner-status,
  body.printing-inventory #dpunto-print-sheet .history,
  body.printing-inventory #dpunto-print-sheet details.history,
  body.printing-inventory #dpunto-print-sheet .storage-legacy-note,
  body.printing-inventory #dpunto-print-sheet .notice.inline,
  body.printing-inventory #dpunto-print-sheet .reception-auto-note,
  body.printing-inventory #dpunto-print-sheet .reception-notification-strip,
  body.printing-inventory #dpunto-print-sheet .notification-retry-form,
  body.printing-inventory #dpunto-print-sheet .mobile-phase-progress,
  body.printing-inventory #dpunto-print-sheet .progress-warning,
  body.printing-inventory #dpunto-print-sheet .field-note,
  body.printing-inventory #dpunto-print-sheet .hint,
  body.printing-inventory #dpunto-print-sheet .fine,
  body.printing-inventory #dpunto-print-sheet .stage-actions,
  body.printing-inventory #dpunto-print-sheet .stage-toggle,
  body.printing-inventory #dpunto-print-sheet .progressive-more-control{
    display:none!important;
  }

  /* Nada puede montarse sobre otra tarjeta o dato. */
  body.printing-inventory #dpunto-print-sheet,
  body.printing-inventory #dpunto-print-sheet *{
    box-sizing:border-box!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact,
  body.printing-inventory #dpunto-print-sheet .record-summary,
  body.printing-inventory #dpunto-print-sheet .timeline,
  body.printing-inventory #dpunto-print-sheet .stages,
  body.printing-inventory #dpunto-print-sheet .stage-card,
  body.printing-inventory #dpunto-print-sheet .stage-head,
  body.printing-inventory #dpunto-print-sheet .stage-form,
  body.printing-inventory #dpunto-print-sheet .read-fields,
  body.printing-inventory #dpunto-print-sheet .fields-grid,
  body.printing-inventory #dpunto-print-sheet .storage-editor,
  body.printing-inventory #dpunto-print-sheet .storage-editor-grid{
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.printing-inventory #dpunto-print-sheet p,
  body.printing-inventory #dpunto-print-sheet span,
  body.printing-inventory #dpunto-print-sheet b,
  body.printing-inventory #dpunto-print-sheet strong,
  body.printing-inventory #dpunto-print-sheet small,
  body.printing-inventory #dpunto-print-sheet dt,
  body.printing-inventory #dpunto-print-sheet dd,
  body.printing-inventory #dpunto-print-sheet h1,
  body.printing-inventory #dpunto-print-sheet h2,
  body.printing-inventory #dpunto-print-sheet h3,
  body.printing-inventory #dpunto-print-sheet .print-field-value{
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
    max-width:100%!important;
  }

  /* Ubicación: solo título + valores reales, sin texto auxiliar. */
  body.printing-inventory #dpunto-print-sheet .storage-editor{
    padding:1.4mm 1.6mm!important;
    border:.18mm solid #c9d0d7!important;
    border-radius:1.7mm!important;
    background:#ffffff!important;
  }
  body.printing-inventory #dpunto-print-sheet .storage-editor-title{
    display:block!important;
    margin:0 0 .8mm!important;
    font-size:5.2pt!important;
    font-weight:800!important;
    color:#2e3742!important;
  }
  body.printing-inventory #dpunto-print-sheet .storage-editor-grid{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:1mm!important;
  }

  /* Los bloques sin datos quedan como cabecera de estado, sin ocupar altura artificial. */
  body.printing-inventory #dpunto-print-sheet .stage-card.print-stage-empty .stage-head{
    border-bottom:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .stage-card.print-stage-empty{
    min-height:0!important;
  }
}


/* =========================================================
   v41.29 · ficha individual en A4 VERTICAL
   ========================================================= */
@media print{
  @page productPortrait{size:A4 portrait;margin:6mm;}
  body.printing-inventory #dpunto-print-sheet{
    page:productPortrait!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
  }

  /* Cabecera compacta para aprovechar el ancho de A4 vertical. */
  body.printing-inventory #dpunto-print-sheet .product-print-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    gap:3mm!important;
    margin:0 0 2.5mm!important;
    padding:0 0 1.8mm!important;
    border-bottom:.45mm solid #111111!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-head b{font-size:10pt!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-head span{font-size:5.7pt!important;}
  body.printing-inventory #dpunto-print-sheet .product-print-head small{font-size:5.2pt!important;white-space:nowrap!important;}

  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:.5mm!important;
    margin:0 0 2.2mm!important;
    padding:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading h1{
    font-size:12pt!important;
    line-height:1.02!important;
    margin:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .page-heading p{
    max-width:none!important;
    font-size:5.8pt!important;
    line-height:1.08!important;
    margin:.4mm 0 0!important;
  }

  /* Resumen: 2 columnas para que los valores se lean bien en vertical. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:1.5mm!important;
    margin:0 0 2.2mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary>div{
    min-height:0!important;
    padding:1.55mm 1.8mm!important;
    border:.22mm solid #a3aab2!important;
    border-radius:1.8mm!important;
    background:#ffffff!important;
    box-shadow:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .small-title{
    font-size:5pt!important;
    line-height:1!important;
    margin:0 0 .55mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary b,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary .mono{
    font-size:7.4pt!important;
    line-height:1.08!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary small{
    font-size:5.15pt!important;
    line-height:1.06!important;
  }

  /* Recorrido: 3 columnas x 2 filas, legible en A4 vertical. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:1.2mm!important;
    margin:0 0 2.2mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step{
    min-height:0!important;
    padding:1.3mm 1.5mm!important;
    border:.2mm solid #a3aab2!important;
    border-radius:1.7mm!important;
    gap:.55mm!important;
    background:#ffffff!important;
    box-shadow:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-num{
    width:4.6mm!important;
    height:4.6mm!important;
    min-width:4.6mm!important;
    font-size:5.4pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .step-name{
    font-size:5.7pt!important;
    line-height:1.05!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .timeline-step small{
    font-size:4.55pt!important;
    line-height:1.04!important;
  }

  /* Datos de la pieza: 2 tarjetas por fila para mantener lectura cómoda. */
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:1.5mm!important;
    align-items:start!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.stage-card,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-1,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-4,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-5,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-6,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-7,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.group-8{
    grid-column:auto!important;
    min-width:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-card{
    margin:0!important;
    border:.22mm solid #a3aab2!important;
    border-radius:1.8mm!important;
    box-shadow:none!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    background:#ffffff!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head{
    min-height:0!important;
    padding:1.25mm 1.5mm!important;
    gap:1mm!important;
    border-bottom:.18mm solid #cacfd5!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-mark{
    width:5.5mm!important;
    height:5.5mm!important;
    min-width:5.5mm!important;
    font-size:5.45pt!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head small{
    font-size:4.55pt!important;
    line-height:1!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-head h3{
    font-size:6.9pt!important;
    line-height:1.05!important;
    margin:0!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .status-marker{
    font-size:4.5pt!important;
    padding:.25mm .7mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stage-form,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields{
    padding:1.35mm 1.5mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .fields-grid,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:.75mm 1.1mm!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .field,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dt,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .storage-editor-title{
    font-size:4.5pt!important;
    line-height:1.02!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .print-field-value,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .read-fields dd{
    font-size:5.35pt!important;
    line-height:1.04!important;
  }

  /* Evita páginas extra por bloques vacíos o separadores. */
  body.printing-inventory #dpunto-print-sheet .print-stage-empty,
  body.printing-inventory #dpunto-print-sheet .stage-card.print-stage-empty,
  body.printing-inventory #dpunto-print-sheet .print-section-title:empty{
    display:none!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* =========================================================
   v41.30 · recepción móvil oscura + páginas de error seguras
   ========================================================= */

/*
 * Android/iOS pueden conservar un fondo nativo claro en un botón recién
 * enfocado después de usar el escáner. En recepción múltiple se neutraliza
 * ese estado y se definen explícitamente todos los fondos en modo oscuro.
 */
@media (max-width:820px){
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions{
    background:transparent!important;
    border-top-color:#344354!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions::before,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions::after,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn::before,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn::after{
    content:none!important;
    display:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn{
    -webkit-appearance:none!important;
    appearance:none!important;
    -webkit-tap-highlight-color:transparent!important;
    background-clip:padding-box!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.outline,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.outline:hover,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.outline:active,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.outline:focus{
    background:#161f29!important;
    color:#e4ebf3!important;
    border-color:#435469!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.primary,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.primary:hover,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.primary:active,
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn.primary:focus{
    background:#4f89c9!important;
    color:#ffffff!important;
    border-color:#4f89c9!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn:focus-visible{
    outline:2px solid #77ade7!important;
    outline-offset:2px!important;
    box-shadow:none!important;
  }
}

/* Página autónoma de fallo. No depende de sesión ni de MariaDB. */
.system-error-body{
  min-height:100dvh;
  margin:0;
  background:#f3f6f9;
}
.system-error-shell{
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:clamp(20px,5vw,56px);
}
.system-error-card{
  width:min(100%,680px);
  padding:clamp(28px,5vw,48px);
  border:1px solid #d9e0e8;
  border-radius:22px;
  background:#ffffff;
  box-shadow:none;
  text-align:left;
}
.system-error-mark{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  margin-bottom:22px;
  border-radius:15px;
  background:#eef4fb;
  color:#477fbf;
  font-size:1.65rem;
  font-weight:900;
}
.system-error-card h1{
  margin:7px 0 13px;
  max-width:580px;
  font-size:clamp(1.75rem,4.5vw,2.55rem);
  line-height:1.08;
}
.system-error-lead{
  margin:0;
  max-width:590px;
  color:#5d6977;
  font-size:1rem;
  line-height:1.65;
}
.system-error-status{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin:25px 0 0;
}
.system-error-status span{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  padding:11px 12px;
  border:1px solid #dfe5eb;
  border-radius:11px;
  background:#f8fafc;
  color:#506071;
  font-size:.8rem;
  font-weight:800;
}
.system-error-status i{
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-radius:999px;
  background:#4f9a6c;
}
.system-error-status .is-down i{background:#c45c55;}
.system-error-hint{
  margin:18px 0 0;
  padding:14px 16px;
  border-left:3px solid #78a5d5;
  border-radius:8px;
  background:#f5f8fc;
  color:#536274;
  line-height:1.55;
}
.system-error-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:24px;
}
.system-error-reference{
  margin:22px 0 0;
  color:#87919d;
  font-size:.72rem;
  letter-spacing:.02em;
}
html[data-theme="dark"] .system-error-body{background:#0c1219!important;}
html[data-theme="dark"] .system-error-card{
  background:#131a23!important;
  border-color:#344354!important;
  color:#edf2f7!important;
}
html[data-theme="dark"] .system-error-mark{background:#1d2b3b!important;color:#a9cef5!important;}
html[data-theme="dark"] .system-error-lead,
html[data-theme="dark"] .system-error-hint{color:#b7c1cd!important;}
html[data-theme="dark"] .system-error-status span{
  background:#17212c!important;
  border-color:#344354!important;
  color:#c8d1dc!important;
}
html[data-theme="dark"] .system-error-hint{
  background:#17212c!important;
  border-left-color:#6f9fd2!important;
}
html[data-theme="dark"] .system-error-reference{color:#8e9aa8!important;}
@media(max-width:560px){
  .system-error-shell{padding:14px;align-items:center;}
  .system-error-card{padding:24px 19px;border-radius:17px;}
  .system-error-status{grid-template-columns:1fr;}
  .system-error-actions{display:grid;grid-template-columns:1fr;width:100%;}
  .system-error-actions .btn{width:100%;}
}

/* =========================================================
   v41.31 · recepción móvil, impresión completa y avisos por ficha
   ========================================================= */

.notification-email-field{grid-column:1/-1!important;}
.notification-email-field>small{display:block;margin-top:6px;color:var(--ux-muted,#718091);font-size:.72rem;line-height:1.4;}
.ux-v40 .notification-statuses{grid-template-columns:repeat(3,minmax(0,1fr));}
html[data-theme="dark"] .ux-v40 .notification-email-field>small{color:#98a7b7!important;}

/*
 * La regla responsive histórica hacía sticky la botonera con fondo blanco.
 * En Nueva recepción se desactiva ese panel flotante: los botones quedan dentro
 * de la superficie oscura real del formulario, sin rectángulo claro residual.
 */
@media(max-width:820px){
  .ux-v40 .page-shell.new .stage-actions{
    position:static!important;
    bottom:auto!important;
    z-index:auto!important;
    margin-top:15px!important;
    padding:14px 0 0!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .create-card .stage-actions,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .batch-reception .stage-actions{
    background:transparent!important;
    border-top:1px solid #344354!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn{
    -webkit-appearance:none!important;
    appearance:none!important;
    -webkit-tap-highlight-color:transparent!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.outline,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.outline:hover,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.outline:active,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.outline:focus{
    background:#161f29!important;
    border-color:#435469!important;
    color:#e4ebf3!important;
  }
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.primary,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.primary:hover,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.primary:active,
  html[data-theme="dark"] body.ux-v40 .page-shell.new .stage-actions .btn.primary:focus{
    background:#5d96d4!important;
    border-color:#5d96d4!important;
    color:#08111b!important;
  }
  .ux-v40 .notification-statuses{grid-template-columns:1fr;}
}

/* Inventario A:Y: las 25 columnas (24 BMC + ID WEB) se ajustan SIEMPRE al área imprimible. */
@media print{
  @page excelFull{size:A4 landscape;margin:5mm;}
  .excel-print-report{page:excelFull!important;width:100%!important;max-width:100%!important;}
  .excel-full-table-frame{
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
  }
  .excel-full-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
    font-size:4.7pt!important;
    line-height:1.04!important;
  }
  .excel-full-table th,.excel-full-table td{
    padding:.48mm .32mm!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    hyphens:auto!important;
  }
  .excel-full-table .excel-groups-row th{font-size:4.2pt!important;padding:.55mm .3mm!important;}
  .excel-full-table .excel-columns-row th{font-size:4.35pt!important;line-height:1.02!important;}
  .excel-full-table thead{display:table-header-group!important;}
  .excel-full-table tbody tr{break-inside:avoid-page!important;page-break-inside:avoid!important;}

  /* Ficha individual: nunca imprimir estados de trabajo, avisos ni fases vacías. */
  body.printing-inventory #dpunto-print-sheet .timeline,
  body.printing-inventory #dpunto-print-sheet .block-title,
  body.printing-inventory #dpunto-print-sheet .status-marker,
  body.printing-inventory #dpunto-print-sheet .stage-lock-notice,
  body.printing-inventory #dpunto-print-sheet .mobile-form-section-title,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages{
    margin-top:1.5mm!important;
  }
}


/* =========================================================
   v41.32 · observaciones internas + correos de alta/envío
   ========================================================= */
.notification-settings-form{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:end;
  padding-top:15px;
  border-top:1px solid var(--ux-border,#dde3ea);
}
.notification-settings-form .field{min-width:0;margin:0;}
.notification-settings-form input[type="email"]{width:100%;min-height:44px;}
.notification-settings-form .field-note{display:block;margin-top:6px;color:var(--ux-muted,#718091);font-size:.72rem;line-height:1.4;}
.notification-settings-form .btn{grid-column:1/-1;justify-self:end;min-height:44px;}
.ux-v40 .notification-statuses.notification-statuses-two{grid-template-columns:repeat(2,minmax(0,1fr));}
html[data-theme="dark"] .ux-v40 .notification-settings-form{border-top-color:#344354!important;}
html[data-theme="dark"] .ux-v40 .notification-settings-form .field-note{color:#98a7b7!important;}
@media(max-width:820px){
  .notification-settings-form{grid-template-columns:1fr;align-items:stretch;}
  .notification-settings-form .btn{grid-column:1;width:100%;justify-self:stretch;}
  .ux-v40 .notification-statuses.notification-statuses-two{grid-template-columns:1fr;}
}
@media print{
  body.printing-inventory #dpunto-print-sheet .notification-settings-form{display:none!important;}
}

/* =========================================================
   v41.34 · contraste inventario oscuro + impresión sin overflow
   ========================================================= */
@media screen{
  /* La referencia es el dato principal de la tarjeta: contraste suficiente en oscuro. */
  html[data-theme="dark"] body.ux-v40 .inventory-table .reference-col .item-link,
  html[data-theme="dark"] body.ux-v40 .inventory-table .reference-col .item-link:link,
  html[data-theme="dark"] body.ux-v40 .inventory-table .reference-col .item-link:visited,
  html[data-theme="dark"] body.ux-v40 .inventory-table .reference-col .item-link:hover,
  html[data-theme="dark"] body.ux-v40 .inventory-table .reference-col .item-link:focus{
    color:#a9cdf5!important;
  }

  /* Vista previa de tabla completa/seleccionada: ninguna anchura física forzada. */
  .excel-full-table-frame{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
  }
  .excel-full-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }
  .excel-full-table th,
  .excel-full-table td{
    min-width:0!important;
    max-width:none!important;
    width:auto!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
  }
}

@media print{
  /* Inventario completo o selección de 1..N piezas: siempre cabe en el área imprimible. */
  .excel-print-report,
  .excel-full-table-frame,
  .excel-full-table{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .excel-full-table-frame{
    overflow:hidden!important;
    border:0!important;
    border-radius:0!important;
  }
  .excel-full-table{
    table-layout:fixed!important;
    border-collapse:collapse!important;
    font-size:4.45pt!important;
    line-height:1.03!important;
  }
  .excel-full-table col{max-width:100%!important;}
  .excel-full-table th,
  .excel-full-table td{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    width:auto!important;
    padding:.42mm .28mm!important;
    white-space:normal!important;
    overflow:hidden!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    hyphens:auto!important;
    text-overflow:clip!important;
    vertical-align:top!important;
  }
  .excel-full-table .excel-groups-row th{
    font-size:3.95pt!important;
    line-height:1.02!important;
    padding:.46mm .24mm!important;
  }
  .excel-full-table .excel-columns-row th{
    font-size:4.05pt!important;
    line-height:1.01!important;
    padding:.45mm .25mm!important;
  }
  .excel-full-table thead{display:table-header-group!important;}
  .excel-full-table tr{break-inside:avoid-page!important;page-break-inside:avoid!important;}

  /* Ficha individual: cualquier bloque se adapta al A4 vertical sin invadir el contiguo. */
  body.printing-inventory #dpunto-print-sheet,
  body.printing-inventory #dpunto-print-sheet .product-print-compact,
  body.printing-inventory #dpunto-print-sheet .product-print-premium-head,
  body.printing-inventory #dpunto-print-sheet .record-summary,
  body.printing-inventory #dpunto-print-sheet .stages,
  body.printing-inventory #dpunto-print-sheet .stage-card,
  body.printing-inventory #dpunto-print-sheet .stage-head,
  body.printing-inventory #dpunto-print-sheet .stage-form,
  body.printing-inventory #dpunto-print-sheet .fields-grid,
  body.printing-inventory #dpunto-print-sheet .read-fields,
  body.printing-inventory #dpunto-print-sheet .storage-editor,
  body.printing-inventory #dpunto-print-sheet .storage-editor-grid{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact .record-summary>div,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .stages>.stage-card,
  body.printing-inventory #dpunto-print-sheet .product-print-title,
  body.printing-inventory #dpunto-print-sheet .product-print-meta{
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body.printing-inventory #dpunto-print-sheet .product-print-compact p,
  body.printing-inventory #dpunto-print-sheet .product-print-compact span,
  body.printing-inventory #dpunto-print-sheet .product-print-compact b,
  body.printing-inventory #dpunto-print-sheet .product-print-compact strong,
  body.printing-inventory #dpunto-print-sheet .product-print-compact small,
  body.printing-inventory #dpunto-print-sheet .product-print-compact dt,
  body.printing-inventory #dpunto-print-sheet .product-print-compact dd,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .mono,
  body.printing-inventory #dpunto-print-sheet .product-print-compact .print-field-value{
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
  }
}


/* =========================================================
   v41.35 · impresión íntegra en A4, sin recortes ni overflow
   ========================================================= */
@media print{
  /* Modos separados: ficha individual vertical; tablas/inventario horizontal. */
  @page productA4{size:A4 portrait;margin:6mm;}
  @page inventoryA4{size:A4 landscape;margin:4mm;}
  @page excelFull{size:A4 landscape;margin:3mm;}

  body.printing-inventory #dpunto-print-sheet.print-product-sheet{
    page:productA4!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet{
    page:inventoryA4!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  .excel-print-report{
    page:excelFull!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  /* Impresión desde la lista: 1 o varias piezas, siempre dentro de A4 horizontal. */
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .print-report-head{
    display:flex!important;
    justify-content:space-between!important;
    align-items:flex-end!important;
    gap:4mm!important;
    margin:0 0 3mm!important;
    padding:0 0 2mm!important;
    border-bottom:.35mm solid #333!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .print-inventory-table,
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table-wrap{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    font-size:6pt!important;
    line-height:1.08!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table th,
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table td{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    padding:1mm .8mm!important;
    border:.2mm solid #b8bec6!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    hyphens:auto!important;
    text-overflow:clip!important;
    vertical-align:top!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table thead{
    display:table-header-group!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table tr{
    break-inside:avoid-page!important;
    page-break-inside:avoid!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .id-col{width:5%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .client-col{width:8%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .reference-col{width:18%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .serial-col{width:10%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .state-col{width:8%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .phase-col{width:12%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .request-col{width:10%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .destination-col{width:10%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .location-col{width:11%!important;}
  body.printing-inventory #dpunto-print-sheet.print-inventory-sheet .inventory-table .updated-col{width:8%!important;}

  /* Tabla completa A:Y: 25 columnas dentro de una hoja A4 horizontal. El contenido
     se envuelve y aumenta la altura de la fila; nunca se recorta horizontalmente. */
  .excel-full-table-frame{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
  }
  .excel-full-table{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    font-size:4.55pt!important;
    line-height:1.08!important;
  }
  .excel-full-table col{min-width:0!important;max-width:100%!important;}
  .excel-full-table th,
  .excel-full-table td{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    padding:.5mm .32mm!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    hyphens:auto!important;
    text-overflow:clip!important;
    vertical-align:top!important;
  }
  .excel-full-table .excel-groups-row th{
    font-size:4.05pt!important;
    line-height:1.05!important;
    padding:.55mm .25mm!important;
  }
  .excel-full-table .excel-columns-row th{
    font-size:4.15pt!important;
    line-height:1.04!important;
    padding:.52mm .28mm!important;
  }
  .excel-full-table thead{display:table-header-group!important;}
  .excel-full-table tfoot{display:table-footer-group!important;}
  .excel-full-table tbody tr{
    break-inside:avoid-page!important;
    page-break-inside:avoid!important;
  }

  /* Ficha A4 vertical: ningún dato se trunca con puntos suspensivos. */
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-premium-head{
    grid-template-columns:27mm minmax(0,1fr) 24mm!important;
    gap:2.2mm!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-title,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-title h1,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-title p,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-meta,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact *{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-title h1,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-title p{
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .record-summary>div,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .stage-card,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .stage-head,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .stage-form,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .read-fields,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .fields-grid{
    overflow:visible!important;
  }
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact p,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact span,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact b,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact strong,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact small,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact dt,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact dd,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .mono,
  body.printing-inventory #dpunto-print-sheet.print-product-sheet .product-print-compact .print-field-value{
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
  }
}
