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

.ux-v40{
  --ux-navy:#1a1814;
  --ux-navy-soft:#2a2721;
  --ux-blue:#709374;
  --ux-blue-dark:#5c745f;
  --ux-blue-soft:#f6f5f3;
  --ux-canvas:#f8f7f6;
  --ux-surface:#ffffff;
  --ux-surface-2:#fbfaf9;
  --ux-border:#e6e4e1;
  --ux-border-strong:#d7d5d0;
  --ux-text:#27241f;
  --ux-muted:#7e7a73;
  --ux-success:#446451;
  --ux-success-bg:#eef4f0;
  --ux-warning:#716041;
  --ux-warning-bg:#f7f4ea;
  --ux-danger:#865753;
  --ux-danger-bg:#faf3f2;
  --ux-radius-sm:10px;
  --ux-radius:14px;
  --ux-radius-lg:20px;
  --ux-shadow:0 10px 28px rgba(26,24,20,.055);
  --ux-shadow-float:0 18px 48px rgba(26,24,20,.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:#83807a;}
.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:#58534a;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:#b4c6b7;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:#58544b;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:#f7f6f4;color:#6a665f;}
.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(112,147,116,.16);}
.ux-v40 .btn.primary:hover{background:var(--ux-blue-dark);box-shadow:0 7px 18px rgba(112,147,116,.22);}
.ux-v40 .btn.outline{border-color:var(--ux-border-strong);background:#ffffff;}
.ux-v40 .btn.outline:hover{border-color:#a6baa8;background:#fcfcfb;}
.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:#9cb39e;box-shadow:0 0 0 3px rgba(112,147,116,.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:#5b5750;}

/* ---------- 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:#cad9cf;background:var(--ux-success-bg);color:var(--ux-success);}
.ux-v40 .alert.error{border-color:#dfcac8;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:#94928d;}
.ux-v40 .dashboard-status-band .is-good{background:linear-gradient(180deg,#f9fbf9 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,#fcf9f9 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(26,24,20,.12);
}
.ux-v40 .dashboard-primary-actions .eyebrow{color:#97b29a;}
.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:#6f9073;border-color:#80a284;}
.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:#d5d1c9;line-height:1.3;}
.ux-v40 .dashboard-action.is-primary small{color:#f7f6f4;}
.ux-v40 .dashboard-action i{font-style:normal;color:#cec9c0;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(26,24,20,.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:#93908b;}
.ux-v40 .attention-card.danger{background:#fefbfb;border-color:#e4d6d5;}
.ux-v40 .attention-card.warning{background:#fefdfa;border-color:#e0dbcd;}
.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 #efeeec;}
.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:#6d6961;list-style:none;}
.ux-v40 .dashboard-help>summary::after{content:'⌄';float:right;color:#959189;}
.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:#8d8982;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:#f5f4f2;color:#696253;font-size:.74rem;font-weight:750;}
.ux-v40 .filter-chip span{color:#858075;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:#f9f8f7;color:#817e78;font-size:.65rem;letter-spacing:.055em;}
.ux-v40 .inventory-table td{padding:12px;border-color:#eeedec;}
.ux-v40 .inventory-table tbody tr{transition:background .12s;}
.ux-v40 .inventory-table tbody tr:hover{background:#fbfbfa;}
.ux-v40 .inventory-table .item-link{color:#443f36;font-weight:820;}
.ux-v40 .inventory-table small{color:#8f8c86;}
.ux-v40 .sort-link{gap:4px;}
.ux-v40 .inventory-open .table-arrow{width:31px;height:31px;border-radius:9px;background:#f6f5f3;color:#696459;}
.ux-v40 .bulk-toolbar{border-radius:13px;background:#f8f8f7;border-color:#e3e0db;box-shadow:none;}
.ux-v40 .pager{margin-top:16px;}
.ux-v40 .empty,.ux-v40 .empty-state,.ux-v40 .search-empty-state{border:1px dashed #d9d7d3;background:#fbfbfa;border-radius:14px;color:#79766f;}

/* =========================================================
   BÚSQUEDA GLOBAL
   ========================================================= */
.ux-v40 .global-search-shell{padding:20px;background:linear-gradient(135deg,#ffffff,#fbfbfa);}
.ux-v40 .global-search-form>label{font-size:.76rem;text-transform:uppercase;letter-spacing:.07em;color:#7d7a73;}
.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:#f7f6f4;border-color:#e7e5e1;}
.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:#b5c5b7;box-shadow:0 8px 20px rgba(26,24,20,.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:#6e6a62;}
.ux-v40 .pending-kpi b{font-size:.82rem;min-width:24px;padding:2px 6px;border-radius:999px;background:#f3f2f0;text-align:center;}
.ux-v40 .pending-kpi small{display:none;}
.ux-v40 .pending-kpi.is-active{border-color:#a7bba9;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:#f7f0ef;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 #eeedec;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:#f4f3f1;}
.ux-v40 .new-reception-actions .btn{min-width:150px;border:0;box-shadow:none;background:transparent;color:#6b6861;}
.ux-v40 .new-reception-actions .btn.primary{background:#ffffff;color:var(--ux-blue-dark);box-shadow:0 2px 8px rgba(26,24,20,.06);}
.ux-v40 .create-card{padding:22px;}
.ux-v40 .scan-help{margin-bottom:18px;border-radius:12px;background:#f8f7f6;border:1px solid #e9e7e4;}
.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:#f9f9f8;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:#f9f8f7;}
.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:#efeeed;color:var(--ux-text);}
.ux-v40 .small-title{color:#847f74;}
.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:#f6f5f3;border:1px solid #e8e6e2;}
.ux-v40 .page-shell.product .record-summary .phase-chip i{background:#79997d;}
.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(112,147,116,.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:#afc1b1;box-shadow:0 0 0 2px rgba(112,147,116,.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:#94928d;}
.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:#f5f4f2;font-size:.69rem;color:#7a7770;}
.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:#7a7770;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:#a9bdab;background:#faf9f8;}
.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:#d2cec7;background:#fcfcfb;}

/* =========================================================
   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:#443f36;}
.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(26,24,20,.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(26,24,20,.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:#f8f8f7;}
.ux-v40 .auth-copy{border-radius:24px;background:radial-gradient(ellipse at 85% 100%,#635c4e 0,transparent 55%),linear-gradient(145deg,#1a1814,#312d26);}
.ux-v40 .auth-card{border-radius:20px;box-shadow:0 18px 45px rgba(26,24,20,.08);}

/* ---------- Footer ---------- */
.ux-v40 .site-footer{border-color:var(--ux-border);background:#ffffff;color:#96938d;}
.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(26,24,20,.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(26,24,20,.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 #e6e4df!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:#f7f6f4;}
  .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:#94928d;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 #f2f1ef!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 #f2f1ef!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:#f7f6f4!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:#f1f0ee;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:#6c6860;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:#706c64;
  --ux-border:#e2e0dd;
  --ux-border-strong:#cfccc7;
}
.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:#6c675c!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:#27241f!important;}
.ux-v40 .page-shell.product .record-summary small{color:#706c64!important;}
.ux-v40 .page-shell.product .record-summary .badge.good{color:#385744!important;background:#eaf1ec!important;}
.ux-v40 .page-shell.product .record-summary .badge.defect{color:#7c4e4a!important;background:#f6eceb!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(26,24,20,.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:#446451!important;}
.ux-v40 .dashboard-status-band .is-defect span,
.ux-v40 .dashboard-status-band .is-defect small{color:#865753!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:#865753;color:#ffffff;border-color:#865753;}
.ux-v40 .bulk-toolbar-actions .btn.danger:hover,
.ux-v40 .modal-actions .btn.danger:hover{background:#724945;border-color:#724945;}
.ux-v40 .danger-confirm-card{max-width:620px;}
.ux-v40 .danger-eyebrow{color:#865753!important;}
.ux-v40 .bulk-delete-warning{margin:18px 0;padding:16px 18px;border:1px solid #e1d0ce;border-radius:13px;background:#fbf7f7;color:#423433;}
.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:#5e594e!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:#2b2822!important;
}
.ux-v40 .page-shell.product .record-summary small{
  color:#6b665d!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 #e0ddd8!important;
  border-radius:10px!important;
  background:#f8f7f5!important;
  color:#3c3830!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip span{
  color:#3c3830!important;
  font-weight:850!important;
  line-height:1.2!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip b{
  color:#4d483d!important;
  background:#ebe9e6!important;
  border:1px solid #dbd8d2!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.balda b{
  color:#324d3e!important;
  background:#e6eee9!important;
  border-color:#cad9d0!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.palet b{
  color:#6a6354!important;
  background:#f1f0ed!important;
  border-color:#beccc0!important;
}
.ux-v40 .page-shell.product .record-summary .storage-chip.legacy b{
  color:#634e3a!important;
  background:#f5efe5!important;
  border-color:#dcd0be!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:#3c3830!important;
  background:#f5f4f2!important;
  border:1px solid #e5e2dd!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 #efeeed!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 #edebe8!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 #efeeec!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(150,146,138,.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:#58534a;
  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:#acbeae;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(112,147,116,.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:#151411;
    --ux-navy-soft:#24211c;
    --ux-blue:#7ea082;
    --ux-blue-dark:#99b59c;
    --ux-blue-soft:#322f28;
    --ux-canvas:#151310;
    --ux-surface:#1d1b16;
    --ux-surface-2:#24221d;
    --ux-border:#3c3831;
    --ux-border-strong:#565148;
    --ux-text:#f3f2f0;
    --ux-muted:#b5b1aa;
    --ux-success:#97c0a6;
    --ux-success-bg:#19241f;
    --ux-warning:#cdbe99;
    --ux-warning-bg:#29251d;
    --ux-danger:#cfa39f;
    --ux-danger-bg:#2c2121;
    --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:#867c69;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(22,21,18,.96)!important;border-color:var(--ux-border)!important;
  }
  html[data-theme="dark"] .ux-v40 .brand-caption{color:#aca8a0!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:#dcd9d3!important;}
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{color:#d7d4ce!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:#acc7af!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{background:#201e19!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:#dad8d3!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:#acc7af!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:#2a2721!important;color:#d7d4ce!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:#191714!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:#908c84!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:#c0bdb6!important;}
  html[data-theme="dark"] .ux-v40 input[type=file]{background:#191714!important;}

  /* Botones */
  html[data-theme="dark"] .ux-v40 .btn.outline{background:#23211c!important;color:#e7e5e1!important;border-color:var(--ux-border-strong)!important;}
  html[data-theme="dark"] .ux-v40 .btn.outline:hover{background:#302c25!important;border-color:#9a917f!important;}
  html[data-theme="dark"] .ux-v40 .text-action:hover{background:#2e2b24!important;color:#eae8e4!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,#171f1c 0%,#1d1b16 100%)!important;}
  html[data-theme="dark"] .ux-v40 .dashboard-status-band .is-defect{background:linear-gradient(180deg,#251c1d 0%,#1d1b16 100%)!important;}
  html[data-theme="dark"] .ux-v40 .attention-card.danger{background:#20191a!important;border-color:#4c3838!important;}
  html[data-theme="dark"] .ux-v40 .attention-card.warning{background:#211e18!important;border-color:#494231!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:#282520!important;border-color:#4c473e!important;}
  html[data-theme="dark"] .ux-v40 .filter-chip{background:#36322a!important;color:#b4ccb7!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:#24221d!important;color:#b8b5ae!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 table td{border-color:#35322b!important;color:#eae8e5;}
  html[data-theme="dark"] .ux-v40 tbody tr:hover{background:#24221d!important;}
  html[data-theme="dark"] .ux-v40 .inventory-open .table-arrow{background:#2d2a24!important;color:#cdc8bf!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:#1e1c18!important;border-color:#565249!important;color:#b8b5ae!important;}
  html[data-theme="dark"] .ux-v40 .search-summary{background:#2c2923!important;border-color:#524c40!important;color:#bac8bc!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:#2e2b25!important;border-color:#4f4a3f!important;color:#eae8e4!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .status-marker{background:#282621!important;color:#c1beb7!important;}
  html[data-theme="dark"] .ux-v40 .page-shell.product .stage-toggle{background:#27241e!important;border-color:var(--ux-border)!important;color:#cfccc5!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:#403c35!important;color:#b5b1aa!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip{background:#2e2b25!important;border-color:#524d42!important;color:#e2e0db!important;}

  /* Recepción y escaneo */
  html[data-theme="dark"] .ux-v40 .new-reception-actions{background:#27241e!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .new-reception-actions .btn.primary{background:#3a362d!important;color:#b5ccb8!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:#23211c!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:#292620!important;border-color:#585348!important;color:#abc6ae!important;}
  html[data-theme="dark"] .ux-v40 input[data-just-scanned="1"]{background:#19241f!important;}

  /* Gestión */
  html[data-theme="dark"] .ux-v40 .management-tabs{background:#23201b!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .management-tabs a{color:#cfccc6!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:#39352c!important;color:#aec8b1!important;}
  html[data-theme="dark"] .ux-v40 .client-summary>div,
  html[data-theme="dark"] .ux-v40 .client-code-metrics>div{background:#22201b!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:#27241f!important;border-color:#575249!important;color:#dfdcd6!important;}
  html[data-theme="dark"] .ux-v40 .mini-btn-danger{background:#261d1e!important;border-color:#5c4242!important;color:#d7b5b2!important;}
  html[data-theme="dark"] .ux-v40 .mini-btn-enable{background:#1a2420!important;border-color:#40554a!important;color:#a8c9b4!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:#2e2b25!important;color:#dbd8d3!important;}
  html[data-theme="dark"] .ux-v40 .pending-kpi.danger b{background:#302323!important;color:#d5b3b0!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:#22201b!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:#23201b!important;border-color:var(--ux-border)!important;color:#c1beb7!important;}
  html[data-theme="dark"] .ux-v40 .excel-step.is-active{background:#36322a!important;border-color:#7f7665!important;color:#c0d2c2!important;}
  html[data-theme="dark"] .ux-v40 .excel-safety-note{background:#25221c!important;border-color:#58503b!important;color:#d0c6a9!important;}

  /* Modales */
  html[data-theme="dark"] .ux-v40 .app-modal{background:rgba(8,7,6,.68)!important;}
  html[data-theme="dark"] .ux-v40 .app-modal-card{background:#1d1b16!important;border-color:#48443c!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:#2a2721!important;border-color:var(--ux-border)!important;color:#d9d6d1!important;}
  html[data-theme="dark"] .ux-v40 .bulk-delete-warning{background:#261d1e!important;border-color:#584242!important;color:#d5c1bf!important;}

  /* Login / footer */
  html[data-theme="dark"] .ux-v40.login-body{background:#151310!important;}
  html[data-theme="dark"] .ux-v40 .auth-card{background:#1d1b16!important;border-color:var(--ux-border)!important;}
  html[data-theme="dark"] .ux-v40 .site-footer{background:#1a1814!important;border-color:var(--ux-border)!important;color:#a19d96!important;}
  html[data-theme="dark"] .ux-v40 .project-signature{color:#aaa69f!important;}

  /* Móvil */
  @media(max-width:820px){
    html[data-theme="dark"] .ux-v40 .top-nav{background:#1c1a16!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:#151310!important;}
    html[data-theme="dark"] .ux-v40 .inventory-table tr,
    html[data-theme="dark"] .ux-v40 .batch-table tr{background:#1d1b16!important;border-color:var(--ux-border)!important;}
    html[data-theme="dark"] .ux-v40 .inventory-card-open{background:#312d26!important;color:#aec6b1!important;}
  }
}

/* v40.5 · ajuste semántico de chips/badges en oscuro */
@media screen{
  html[data-theme="dark"] .ux-v40 .badge{
    background:#2e2b24!important;color:#d0ccc6!important;border-color:#48443c!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.good,
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.good{
    background:#1d2a24!important;color:#a2c7b0!important;border-color:#3d5247!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.defect,
  html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.defect{
    background:#2d2222!important;color:#d4adaa!important;border-color:#594141!important;
  }
  html[data-theme="dark"] .ux-v40 .badge.historic{
    background:#2d2a25!important;color:#b9b6b0!important;border-color:#4b4842!important;
  }
  html[data-theme="dark"] .ux-v40 .permission-pill{
    background:#312e27!important;border-color:#585246!important;color:#b4cab7!important;
  }
  html[data-theme="dark"] .ux-v40 .storage-chip b{
    background:#34312a!important;color:#dad7d1!important;
  }
  html[data-theme="dark"] .ux-v40 .storage-chip span{color:#e7e5e1!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.balda b{background:#1e2b25!important;color:#a6c6b2!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.palet b{background:#343028!important;color:#adc5b0!important;}
  html[data-theme="dark"] .ux-v40 .storage-chip.legacy b{background:#2e2820!important;color:#cebfa3!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:#aca8a0!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:#5a554c!important;
  text-align:center!important;
  font-size:.84rem!important;
  font-weight:850!important;
  line-height:1.15!important;
  box-shadow:0 2px 0 rgba(53,49,42,.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:#eae8e5;
}
.ux-v40 .management-tabs a:hover,
.ux-v40 .management-tabs a:focus-visible{
  background:#fbfaf9!important;
  border-color:#d3cfc6!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:#88a58b;
}

@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:#22201b!important;
    border-color:var(--ux-border)!important;
    color:#d5d2cd!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] .ux-v40 .management-tabs a::after{background:#48443b!important;}
  html[data-theme="dark"] .ux-v40 .management-tabs a:hover,
  html[data-theme="dark"] .ux-v40 .management-tabs a:focus-visible{
    background:#35312a!important;
    border-color:#736c5e!important;
    color:#b4ccb7!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:#90af94!important;}
}


/* =========================================================
   DPUNTO STOCK · UX/UI v40.7
   Marca del nav adaptable a tema claro/oscuro.
   ========================================================= */
.ux-v40 .brand-v407{
  --brand-ink:#2c2923;
  --brand-accent:#709374;
  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:#f8f7f5;
    --brand-accent:#95b699;
  }
  html[data-theme="dark"] .ux-v40 .brand-v407 .brand-symbol-cut{fill:#1c1a16;}
  html[data-theme="dark"] .ux-v40 .brand-v407:hover .brand-word{color:#afc9b2!important;}
  html[data-theme="dark"] .ux-v40 .brand-v407:hover .brand-symbol-shell{fill:#afc9b2;}
}

@media print{
  .ux-v40 .brand-v407{--brand-ink:#2c2923;--brand-accent:#709374;}
  .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%,#f7f6f5 100%)!important;
  border-color:#dedcd7!important;
  color:#504c43!important;
  box-shadow:0 4px 14px rgba(26,24,20,.06), inset 0 1px 0 rgba(255,255,255,.9)!important;
}
.ux-v40 .theme-toggle:hover{
  background:linear-gradient(180deg,#ffffff 0%,#f5f4f2 100%)!important;
  border-color:#acbeae!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%,#f0efec 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92), 0 1px 4px rgba(23,21,18,.10)!important;
  color:#474238!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,#27241f 0%,#23201b 100%)!important;
    border-color:#4d4940!important;
    color:#e7e5e1!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,#39352c 0%,#353129 100%)!important;
    border-color:#7e7769!important;
    color:#b4ccb7!important;
  }
  html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
    background:linear-gradient(180deg,#3e3930 0%,#302c25 100%)!important;
    color:#bad1bd!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:#b4b0a8!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:#eae8e5!important;
    border-color:#38342d!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,#7ea082 0%,#6c866f 100%)!important;
    border-color:#7ea082!important;
    color:#14120f!important;
    box-shadow:0 8px 20px rgba(85,79,67,.28)!important;
  }
  html[data-theme="dark"] .ux-v40 .btn.primary:hover,
  html[data-theme="dark"] .ux-v40 .confirm-danger:hover{
    background:linear-gradient(180deg,#94b498 0%,#7a9c7e 100%)!important;
    color:#14120f!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:#e7e5e0!important;
  }

  /* Alertas y estados. */
  html[data-theme="dark"] .ux-v40 .alert,
  html[data-theme="dark"] .ux-v40 .global-flash{
    background:#23211c!important;
    border-color:#49453c!important;
    color:#efedea!important;
  }
  html[data-theme="dark"] .ux-v40 .alert.success,
  html[data-theme="dark"] .ux-v40 .global-flash.success{background:#19241f!important;border-color:#41564b!important;color:#b4d0bf!important;}
  html[data-theme="dark"] .ux-v40 .alert.error,
  html[data-theme="dark"] .ux-v40 .global-flash.error{background:#2c2121!important;border-color:#5e4646!important;color:#dabebc!important;}
  html[data-theme="dark"] .ux-v40 .alert.warning,
  html[data-theme="dark"] .ux-v40 .global-flash.warning{background:#29251d!important;border-color:#5c543e!important;color:#d2c7a8!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:#90af94!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:#18211d!important;
  border-color:#455e50!important;
}
html[data-theme="dark"] .ux-v40 .hardware-scanner-dot{
  box-shadow:0 0 0 4px rgba(97,145,116,.18)!important;
}

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

html[data-theme="dark"] .ux-v40 .search-empty-state{
  background:#1e1c17!important;
  border-color:#585349!important;
  color:#ccc9c3!important;
}
html[data-theme="dark"] .ux-v40 .search-empty-state b{
  color:#f7f6f4!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:#27241f!important;
  color:#eae8e4!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:#e8e6e2!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:#8d8473!important;
  background:#282520!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:#1f1d18!important;
  color:#f1f0ed!important;
  border-color:#474239!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary>div{border-color:#474239!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:#bcb8af!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:#f4f3f1!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.good{
  background:#223028!important;color:#acd1b9!important;border-color:#41594a!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .badge.defect{
  background:#2d2021!important;color:#dbbcb9!important;border-color:#5d4343!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .phase-chip{
  background:#2d2a23!important;border-color:#615a4d!important;color:#f5f4f2!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .phase-chip i{background:#87a88b!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip{
  background:#f8f8f7!important;border-color:#e3e1de!important;color:#36322b!important;
}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip span{color:#695641!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip b{color:#4d483d!important;background:#ebe9e6!important;border-color:#dbd8d2!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.balda b{color:#324d3e!important;background:#e6eee9!important;border-color:#cad9d0!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.palet b{color:#6a6354!important;background:#f1f0ed!important;border-color:#beccc0!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .record-summary .storage-chip.legacy b{color:#634e3a!important;background:#f5efe5!important;border-color:#dcd0be!important;}
html[data-theme="dark"] .ux-v40 .page-shell.product .stage-toggle{background:#2b2821!important;color:#eceae7!important;border-color:#514c41!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:#161512!important;color:#f7f6f4!important;border-color:#5f5a4f!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:#a09b92!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:#f0eeeb!important;
}
html[data-theme="dark"] .ux-v40 .recent-row:hover{
  background:#2d2a23!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:#fbfbfa!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:#1f1d18!important;
  border-color:#4c473d!important;
  color:#f2f1ee!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:#f7f6f4!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:#bab6ae!important;
}
html[data-theme="dark"] .ux-v40 .audit-row:hover{background:#2b2822!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:#1f1d18!important;
  color:#f2f1ef!important;
  border-color:#4c473d!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:#c1beb7!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:#35312a;
  --brand-logo-secondary:#3a362e;
  --brand-logo-word:#2b2821;
}
html[data-theme="dark"]{
  --brand-logo-primary:#fcfcfb;
  --brand-logo-secondary:#f0efed;
  --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:#f5f4f2!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:#c2beb7!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:#4d473c!important;
  color:#ffffff!important;
  border:1px solid #89a08c!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:#f7f6f4!important;
}

/* Editor de almacén: igual de legible que trazabilidad */
html[data-theme="dark"] .ux-v40 .storage-editor{
  background:#1f1d18!important;
  border-color:#4e4940!important;
  color:#f2f1ee!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:#c4c0b9!important;
}
html[data-theme="dark"] .ux-v40 .storage-editor select,
html[data-theme="dark"] .ux-v40 .storage-editor input{
  background:#161512!important;
  border-color:#605b50!important;
  color:#f7f6f4!important;
}
html[data-theme="dark"] .ux-v40 .storage-editor input::placeholder{color:#9e9a91!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(22,21,18,.06)!important;
}
.ux-v40 .nav-toggle span{
  display:block!important;width:20px!important;height:2.5px!important;border-radius:999px!important;background:#4a453a!important;margin:2.5px 0!important;
}
html[data-theme="dark"] .ux-v40 .nav-toggle{background:#26231e!important;border-color:#575249!important;box-shadow:0 10px 24px rgba(0,0,0,.28)!important;}
html[data-theme="dark"] .ux-v40 .nav-toggle span{background:#f8f7f6!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:#1d1b17!important;border-right:1px solid #4f4a41!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:#f3f2ef!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary,
  html[data-theme="dark"] .ux-v40 .top-nav>a{border-color:#3f3b32!important;}
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{background:#23211c!important;border-left:2px solid #4f4a40!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:#2c2923!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:#fbfbfa!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:#38342c!important;
    color:#f5f4f3!important;
    border:1px solid #524c41!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:#413c33!important;
    color:#ffffff!important;
    border-color:#6f6758!important;
  }
  .ux-v40 .top-nav .nav-group>summary::after{
    color:#e9e7e3!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:#2b2822!important;
    border:1px solid #4a453b!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:#f0efed!important;
  }
  .ux-v40 .top-nav .nav-dropdown>a:hover,
  .ux-v40 .top-nav .nav-dropdown .logout button:hover{
    background:#3a362d!important;
    color:#ffffff!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav{
    background:#1e1c17!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav{
    background:#191714!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{
    background:#38342c!important;
    color:#f5f4f3!important;
    border-color:#524c41!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:#413c33!important;
    color:#ffffff!important;
    border-color:#6f6758!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:#f8f7f5!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:#fafaf9!important;
    border-right:1px solid #e3e1de!important;
    box-shadow:20px 0 50px rgba(26,24,20,.14)!important;
  }
  html[data-theme="light"] .ux-v40.nav-open::after,
  html[data-theme="light"] .ux-v40.nav-open:after{
    background:rgba(48,44,37,.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:#3e3a31!important;
    border:1px solid #e0ddd8!important;
    box-shadow:0 4px 14px rgba(26,24,20,.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:#f6f5f3!important;
    color:#7a7160!important;
    border-color:#aebfb0!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-group>summary::after{
    color:#777268!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown{
    background:#ffffff!important;
    border:1px solid #e5e3e0!important;
    border-left:2px solid #acbcae!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:#4e4940!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:#f8f7f5!important;
    color:#7d7462!important;
  }
  html[data-theme="light"] .ux-v40 .top-nav .nav-dropdown .logout{
    border-color:#eae9e6!important;
  }

  /* MODO OSCURO: preservar diseño oscuro */
  html[data-theme="dark"] .ux-v40 .top-nav{
    background:#191714!important;
    border-right:1px solid #4d4940!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav>a,
  html[data-theme="dark"] .ux-v40 .top-nav .nav-group>summary{
    background:#38342c!important;
    color:#f5f4f3!important;
    border-color:#524c41!important;
  }
  html[data-theme="dark"] .ux-v40 .top-nav .nav-dropdown{
    background:#2b2822!important;
    border-color:#4a453b!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:#f0efed!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:#37332c!important;
  border-color:#e8e6e3!important;
}
html[data-theme="light"] .ux-v40 .pending-row:hover{
  background:#f5f4f3!important;
  border-color:#dad6cf!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:#37332c!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:#302c25!important;
}
html[data-theme="light"] .ux-v40 .pending-reasons span{
  background:#f3f2ef!important;
  border-color:#dbd8d2!important;
  color:#5e574a!important;
}
html[data-theme="light"] .ux-v40 .pending-row:hover .pending-reasons span{
  background:#eceae7!important;
  border-color:#cfcac1!important;
  color:#454036!important;
}
html[data-theme="light"] .ux-v40 .attention-card.warning{
  background:#f9f9f8!important;
  border-color:#e0ddd7!important;
  border-left-color:#9b9280!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:#524c41!important;
}
html[data-theme="light"] .ux-v40 .attention-card.warning:hover{
  background:#f5f4f3!important;
  border-color:#d4d0c8!important;
}

/* MODO OSCURO · Pendientes */
html[data-theme="dark"] .ux-v40 .pending-row{
  background:#201e19!important;
  color:#f2f1ef!important;
  border-color:#444038!important;
}
html[data-theme="dark"] .ux-v40 .pending-row:hover{
  background:#37332c!important;
  border-color:#645e52!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:#eceae7!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:#3a362d!important;
  border-color:#635d50!important;
  color:#becec0!important;
}
html[data-theme="dark"] .ux-v40 .pending-row:hover .pending-reasons span{
  background:#4d483d!important;
  border-color:#837b6c!important;
  color:#f9f8f7!important;
}
html[data-theme="dark"] .ux-v40 .attention-card.warning{
  background:#27241e!important;
  border-color:#524d42!important;
  border-left-color:#a39b8b!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:#eceae6!important;
}
html[data-theme="dark"] .ux-v40 .attention-card.warning:hover{
  background:#37332c!important;
  border-color:#746d5f!important;
}

/* Mantener la acción principal acorde a cada tema */
html[data-theme="light"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#6b856e,#76977a)!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions{
  background:linear-gradient(135deg,#443f35,#5b5447)!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,#f0efec 0%,#e9e7e4 100%)!important;
  color:#37332c!important;
  border:1px solid #dddad4!important;
  box-shadow:0 12px 28px rgba(67,62,53,.08)!important;
}
html[data-theme="light"] .ux-v40 .dashboard-primary-actions .eyebrow{color:#6f695d!important;}
html[data-theme="light"] .ux-v40 .dashboard-primary-actions h2{color:#312e27!important;}
html[data-theme="light"] .ux-v40 .dashboard-action{
  background:#fafaf9!important;
  border-color:#dcd9d3!important;
  color:#37332c!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action:hover{
  background:#f6f5f3!important;
  border-color:#c4bfb5!important;
  transform:translateY(-1px);
}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary{
  background:#827966!important;
  border-color:#827966!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action.is-primary:hover{
  background:#726a5a!important;
  border-color:#726a5a!important;
}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) b{color:#37332c!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) small{color:#827e76!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) i{color:#7e796e!important;}
html[data-theme="light"] .ux-v40 .dashboard-action:not(.is-primary) .action-icon{
  background:#f0eeeb!important;color:#676051!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:#fbfbfa!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,#1f1d18 0%,#2d2a24 100%)!important;
  color:#f2f1ef!important;
  border:1px solid #433f37!important;
  box-shadow:0 16px 36px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions .eyebrow{color:#aea9a0!important;}
html[data-theme="dark"] .ux-v40 .dashboard-primary-actions h2{color:#f6f5f3!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action{
  background:#302c25!important;
  border-color:#504b42!important;
  color:#efedea!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action:hover{
  background:#3e3930!important;
  border-color:#6c665a!important;
  transform:translateY(-1px);
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary{
  background:#645d4f!important;
  border-color:#7a7160!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary:hover{
  background:#736b5b!important;
  border-color:#8b816e!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action b{color:#f6f5f3!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action small{color:#cdcac4!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action i{color:#c7c3ba!important;}
html[data-theme="dark"] .ux-v40 .dashboard-action .action-icon{
  background:#474237!important;color:#edece9!important;
}
html[data-theme="dark"] .ux-v40 .dashboard-action.is-primary .action-icon{background:#7b7261!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:#1f1d18!important;
  border-color:#47433b!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:#292620!important;
  border-color:#5d584d!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:#f2f1ef!important;}
html[data-theme="dark"] .ux-v40 .phase-grid-flow .phase-total{
  background:#2b2822!important;
  border:1px solid #49453c!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:#282520!important;
  border-color:#5e594e!important;
  color:#eae8e4!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:#28251f!important;
  border-color:#575247!important;
  color:#ebe9e5!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:#e7e5e1!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:#36322b!important;
  color:#eceae7!important;
  border-color:#605b51!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:#212e28!important;color:#b5cfbe!important;border-color:#435a4d!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:#37332b!important;color:#b1c6b3!important;border-color:#6f6757!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:#2d2922!important;color:#c9ba9e!important;border-color:#584e3c!important;}

/* Paginación: elimina los botones blancos en dark */
html[data-theme="dark"] .ux-v40 .pager>span{color:#9f9b93!important;}
html[data-theme="dark"] .ux-v40 .pager .btn.outline{
  background:#2a2721!important;
  border-color:#5e594e!important;
  color:#ebe9e5!important;
}
html[data-theme="dark"] .ux-v40 .pager .btn.outline:hover{
  background:#3b372e!important;
  border-color:#7b7467!important;
  color:#f9f9f8!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages a{
  background:#28251f!important;
  border-color:#58534a!important;
  color:#d4d1ca!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages a:hover{
  background:#3c3830!important;
  border-color:#7c7567!important;
  color:#f9f9f8!important;
}
html[data-theme="dark"] .ux-v40 .pager-pages b{
  background:#79705f!important;
  border-color:#8f8571!important;
  color:#fbfbfb!important;
}

/* En claro la paginación también usa una superficie menos brillante */
html[data-theme="light"] .ux-v40 .pager-pages a{
  background:#f8f7f5!important;
  border-color:#dcd9d4!important;
  color:#5d584d!important;
}
html[data-theme="light"] .ux-v40 .pager-pages a:hover{background:#f2f1ef!important;border-color:#c3c0b9!important;}
html[data-theme="light"] .ux-v40 .pager-pages b{background:#847b68!important;border-color:#847b68!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:#2c2923!important;
  border-color:#4c463b!important;
  color:#f8f7f6!important;
  box-shadow:0 6px 18px rgba(26,24,20,.14), inset 0 1px 0 rgba(255,255,255,.04)!important;
}
html[data-theme="light"] .ux-v40 .theme-toggle-icon{
  background:#3c382f!important;
  color:#f0efed!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:#f8f8f7!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:#3a362e!important;
  border-color:#6e6657!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:#27241f!important;
  border-color:#504b42!important;
  color:#f3f2f0!important;
}
html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
  background:#3e3930!important;
  color:#f0eeeb!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:#36322a!important;
  border-color:#797265!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:#36322a!important;
  border-color:#736c5d!important;
  color:#fbfbfa!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-popover{
  background:#26231e!important;
  border-color:#4f4a3f!important;
  box-shadow:0 18px 38px rgba(0,0,0,.45)!important;
}
html[data-theme="dark"] .ux-v40 .inventory-action-menu-title{
  color:#c6c1b8!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:#f7f6f4!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:#37332c!important;
}
html[data-theme="light"] .ux-v40 .inventory-action-popover{
  background:#fdfdfd!important;
  border-color:#e5e3e0!important;
}
html[data-theme="light"] .ux-v40 .inventory-action-popover a,
html[data-theme="light"] .ux-v40 .inventory-action-popover a b{color:#3f3b32!important;}
html[data-theme="light"] .ux-v40 .inventory-action-popover a small{color:#87837a!important;}
html[data-theme="light"] .ux-v40 .inventory-action-popover a:hover{background:#f6f5f4!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:#26231e!important;
  border-color:#4f4a3f!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:#eeece9!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-report-cards{
  background:#201e19!important;
  color:#f6f5f3!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:#f7f6f4!important;
  border-color:#4f4a41!important;
}
html[data-theme="light"] .ux-v40 .excel-print-report-cards{
  background:#fafaf9!important;
  color:#3e3a31!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:#2c2922!important;
  border-color:#4f4a3f!important;
}
.ux-v40 .excel-print-summary-card small{font-size:.72rem;font-weight:800;color:#87837b;text-transform:uppercase;letter-spacing:.05em;}
.ux-v40 .excel-print-summary-card b{font-size:1.35rem;line-height:1.05;color:#3e3a31;}
.ux-v40 .excel-print-summary-card span{font-size:.78rem;color:#7f7b72;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card small{color:#c6c1b7!important;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card b{color:#fbfbfa!important;}
html[data-theme="dark"] .ux-v40 .excel-print-summary-card span{color:#d9d5ce!important;}
.ux-v40 .excel-print-summary-card.is-total{background:linear-gradient(180deg,#719175,#887e6b);border-color:#719075;}
.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:#e1cdd5}.ux-v40 .excel-print-summary-card.phase-2{border-color:#d8cead}.ux-v40 .excel-print-summary-card.phase-3{border-color:#b6cab9}.ux-v40 .excel-print-summary-card.phase-4{border-color:#bed0c6}.ux-v40 .excel-print-summary-card.phase-5{border-color:#d2c8be}.ux-v40 .excel-print-summary-card.phase-6{border-color:#d4caac}

.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:#292621!important;border-color:#4d483e!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:#7b776e;}
.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:#f6f5f4;color:#524c41;font-size:.7rem;}
html[data-theme="dark"] .ux-v40 .excel-print-card-top{color:#d7d3cc!important;}
html[data-theme="dark"] .ux-v40 .excel-print-card .qty-badge{background:#3c382f!important;color:#f8f8f7!important;}
.ux-v40 .excel-print-card h3{margin:0;font-size:.92rem;line-height:1.15;color:#3e3930;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-card h3{color:#fbfbfa!important;}
.ux-v40 .excel-print-card-meta{display:flex;justify-content:space-between;gap:8px;font-size:.74rem;font-weight:700;color:#7d786f;}
.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:#d8d5ce!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:#7d7970;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .ux-v40 .excel-print-card-data span{color:#dedbd5!important;}
.ux-v40 .excel-print-card.phase-1{border-top:3px solid #9d6b6e}.ux-v40 .excel-print-card.phase-2{border-top:3px solid #9e8155}.ux-v40 .excel-print-card.phase-3{border-top:3px solid #7aa27f}.ux-v40 .excel-print-card.phase-4{border-top:3px solid #608166}.ux-v40 .excel-print-card.phase-5{border-top:3px solid #836450}.ux-v40 .excel-print-card.phase-6{border-top:3px solid #888157}
@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:#161512!important}
  .excel-print-report-cards .compact-print-head{margin:0 0 2.4mm!important;padding-bottom:1.5mm!important;border-bottom:.35mm solid #24221d!important;break-after:avoid}
  .excel-print-report-cards .compact-print-head .eyebrow{font-size:6pt!important;margin:0 0 .7mm!important;color:#848079!important}
  .excel-print-report-cards .compact-print-head h1{font-size:11pt!important;margin:0 0 .6mm!important;color:#161512!important}
  .excel-print-report-cards .compact-print-head p,.excel-print-report-cards .excel-print-meta span{font-size:6pt!important;color:#75726c!important}
  .excel-print-report-cards .excel-print-meta b{font-size:8pt!important;color:#161512!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 #c9c7c2!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:#75726c!important}
  .excel-print-report-cards .excel-print-summary-card b{font-size:8.2pt!important;color:#161512!important}
  .excel-print-report-cards .excel-print-summary-card span{font-size:4.7pt!important;color:#76736d!important;white-space:normal!important}
  .excel-print-report-cards .excel-print-summary-card.is-total{background:#719075!important;border-color:#719075!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 #c6c4bf!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:#73706a!important}
  .excel-print-report-cards .excel-print-card .qty-badge{padding:.25mm .8mm!important;font-size:4.5pt!important;background:#f5f4f2!important;color:#4d483d!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:#161512!important}
  .excel-print-report-cards .excel-print-card-meta{font-size:4.55pt!important;color:#75726c!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:#77746e!important}
  .excel-print-report-cards .excel-print-card.phase-1{border-top:.8mm solid #9d6b6e!important}.excel-print-report-cards .excel-print-card.phase-2{border-top:.8mm solid #9e8155!important}.excel-print-report-cards .excel-print-card.phase-3{border-top:.8mm solid #7aa27f!important}.excel-print-report-cards .excel-print-card.phase-4{border-top:.8mm solid #608166!important}.excel-print-report-cards .excel-print-card.phase-5{border-top:.8mm solid #836450!important}.excel-print-report-cards .excel-print-card.phase-6{border-top:.8mm solid #888157!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:#27241f!important;
  border:1px solid #504b42!important;
  color:#f8f7f5!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:#37332c!important;
  border-color:#766f61!important;
  color:#ffffff!important;
}
html[data-theme="dark"] .ux-v40 .nav-toggle span{background:#f8f7f5!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:#fbfbfa!important;
  border:1px solid #dfdcd6!important;
  color:#4f4a3f!important;
  box-shadow:0 4px 12px rgba(26,24,20,.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:#f5f4f2!important;
  border-color:#c9c4ba!important;
  color:#433e34!important;
}
html[data-theme="light"] .ux-v40 .nav-toggle span{background:#4f4a3f!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:#2b2822!important;
  border:1px solid #4e493f!important;
  color:#edebe7!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .modal-close:hover{
  background:#38342c!important;
  border-color:#736d60!important;
  color:#ffffff!important;
}
html[data-theme="light"] .ux-v40 .modal-close{
  background:#f5f4f2!important;
  border:1px solid #e3e1dc!important;
  color:#5c574d!important;
  box-shadow:none!important;
}
html[data-theme="light"] .ux-v40 .modal-close:hover{
  background:#efeeeb!important;
  border-color:#c9c5bc!important;
  color:#454037!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:#454037!important;
}
html[data-theme="dark"] .ux-v40 .theme-toggle,
html[data-theme="dark"] .ux-v40 .theme-toggle-icon{
  color:#f7f6f4!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:#f2f1ef!important;
}
html[data-theme="dark"] .ux-v40 .excel-step{
  background:#23211c!important;
  border-color:#4d483e!important;
  color:#eceae6!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-step>span{
  background:#37332c!important;
  color:#eeedea!important;
  border:1px solid #635d50!important;
}
html[data-theme="dark"] .ux-v40 .excel-step b{color:#f8f7f5!important;}
html[data-theme="dark"] .ux-v40 .excel-step small{color:#bcb8af!important;}
html[data-theme="dark"] .ux-v40 .excel-step.is-current,
html[data-theme="dark"] .ux-v40 .excel-step.is-active{
  background:#36322a!important;
  border-color:#7b7362!important;
  box-shadow:0 0 0 2px rgba(122,151,125,.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:#708f73!important;
  border-color:#708f73!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:#23211c!important;
  border-color:#4d483e!important;
  color:#f1f0ed!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:#bdb9b1!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:#f7f6f4!important;
}

html[data-theme="dark"] .ux-v40 .tool-icon{
  background:#37332c!important;
  color:#9ab69d!important;
  border:1px solid #655f52!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .ux-v40 .excel-card-actions .btn.outline{
  background:#2e2b25!important;
  border-color:#625c51!important;
  color:#eceae6!important;
}
html[data-theme="dark"] .ux-v40 .excel-card-actions .btn.outline:hover{
  background:#3c382f!important;
  border-color:#80796c!important;
  color:#ffffff!important;
}

html[data-theme="dark"] .ux-v40 .excel-drop-zone{
  background:#1e1c17!important;
  border-color:#5b564b!important;
  color:#edebe7!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone:hover,
html[data-theme="dark"] .ux-v40 .excel-drop-zone.is-dragging{
  background:#2b2822!important;
  border-color:#8d8472!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone.has-file{
  background:#302c25!important;
  border-color:#8a806d!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-icon{
  background:#3c382f!important;
  color:#a4bfa7!important;
  border:1px solid #665f52!important;
}
html[data-theme="dark"] .ux-v40 .excel-drop-zone b,
html[data-theme="dark"] .ux-v40 .excel-file-name{color:#f7f6f5!important;}
html[data-theme="dark"] .ux-v40 .excel-drop-zone small{color:#bdb9b0!important;}

html[data-theme="dark"] .ux-v40 .excel-summary.has-errors{
  background:#241b1c!important;
  border-color:#574041!important;
}
html[data-theme="dark"] .ux-v40 .excel-summary.has-errors b{color:#d8b8b6!important;}
html[data-theme="dark"] .ux-v40 .excel-summary.is-ok{
  background:#18211d!important;
  border-color:#3e5246!important;
}
html[data-theme="dark"] .ux-v40 .excel-summary.is-ok b{color:#a8c7b3!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:#201e19!important;
  color:#eceae7!important;
  border-color:#4b463d!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-table thead th{
  background:#302c25!important;
  color:#f5f4f2!important;
  border-color:#585348!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-table tr.row-has-error td{
  background:#261d1e!important;
}
html[data-theme="dark"] .ux-v40 .excel-preview-caption{color:#bdb9b0!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:#3e3a31!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:#292620!important;
    border:1px solid #615b50!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:#35312a!important;
    border-color:#787267!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(122,162,127,.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:#527656!important;
  box-shadow:0 3px 10px rgba(49,78,52,.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:#efeeeb!important;
  border:1px solid #dcdad7!important;
  box-shadow:inset 0 1px 2px rgba(47,44,37,.08)!important;
}
html[data-theme="light"] .ux-v40 .theme-switch-sun{color:#ffffff!important;}
html[data-theme="light"] .ux-v40 .theme-switch-moon{color:#b2afa9!important;}
html[data-theme="light"] .ux-v40 .theme-switch-thumb{transform:translateX(0)!important;background:#527656!important;}
html[data-theme="light"] .ux-v40 .theme-toggle.theme-switch:hover .theme-switch-track{background:#ebe9e6!important;border-color:#cfccc7!important;}

/* modo oscuro */
html[data-theme="dark"] .ux-v40 .theme-switch-track{
  background:#191815!important;
  border:1px solid #35332f!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:#8d8a85!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:#527656!important;}
html[data-theme="dark"] .ux-v40 .theme-toggle.theme-switch:hover .theme-switch-track{background:#1f1e1b!important;border-color:#46433d!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(112,147,116,.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(82,118,86,.18),0 3px 10px rgba(49,78,52,.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:#efeeeb!important;
  border-color:#dcdad7!important;
  box-shadow:inset 0 1px 2px rgba(47,44,37,.08)!important;
}
html[data-theme="light"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-thumb{
  background:#527656!important;
  transform:translateX(0)!important;
  box-shadow:0 3px 10px rgba(49,78,52,.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:#b2afa9!important;}

html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-track{
  background:#191815!important;
  border-color:#35332f!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:#527656!important;
  transform:translateX(36px)!important;
  box-shadow:0 3px 10px rgba(49,78,52,.25)!important;
}
html[data-theme="dark"] .ux-v40 button.theme-toggle.theme-switch:hover .theme-switch-sun{color:#8d8a85!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:#efeeeb!important;
  border:1px solid #dcdad7!important;
  box-shadow:inset 0 1px 2px rgba(47,44,37,.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:#527656!important;
  transform:translateX(0)!important;
  box-shadow:0 3px 10px rgba(49,78,52,.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:#b2afa9!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:#191815!important;
  border:1px solid #35332f!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:#527656!important;
  transform:translateX(36px)!important;
  box-shadow:0 3px 10px rgba(49,78,52,.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:#8d8a85!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:#1e1c18!important;
  color:#f4f3f0!important;
  border-color:#4f4a3f!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:#c4c0b9!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:#f7f6f4!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:#26231e!important;
  color:#f7f6f4!important;
  border-color:#5f594d!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:#ada9a0!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:#1e1c18!important;
  border-color:#4f4a3f!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:#f5f4f2!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:#1b1915!important;
}
html[data-theme="dark"] .ux-v40 .excel-print-head{border-bottom-color:#585348!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table-frame{border-color:#4f4a3f!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table th,
html[data-theme="dark"] .ux-v40 .excel-full-table td{border-color:#4f4a3f!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table thead .excel-columns-row th{background:#2c2922!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table tbody tr:nth-child(even){background:#24211c!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g1{background:#38352e!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g2{background:#322f23!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g3{background:#37332b!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g4{background:#232e28!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g5{background:#322a26!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g6{background:#333025!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g7{background:#29342d!important;}
html[data-theme="dark"] .ux-v40 .excel-full-table .g8,
html[data-theme="dark"] .ux-v40 .excel-full-table .gmeta{background:#312e29!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 #d3d0cb!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 #d3d0cb!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 #d3d0cb!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 #e4e2df!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:#433f36!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 #e3e1de!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 #504b42!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 #d3d1cd!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:#3c3a34!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 #aeaca7!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 #aeaca7!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 #aeaca7!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 #d2d0cd!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:#4b463d!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:#23211c!important;
    color:#eeece9!important;
    border-color:#5f594d!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:#6d8f71!important;
    color:#ffffff!important;
    border-color:#6d8f71!important;
  }
  html[data-theme="dark"] body.ux-v40 .batch-reception .stage-actions .btn:focus-visible{
    outline:2px solid #8caf90!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:#f7f6f5;
}
.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 #e4e2dd;
  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:#f6f5f3;
  color:#68846b;
  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:#706c64;
  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 #e8e6e2;
  border-radius:11px;
  background:#fbfaf9;
  color:#686359;
  font-size:.8rem;
  font-weight:800;
}
.system-error-status i{
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-radius:999px;
  background:#608970;
}
.system-error-status .is-down i{background:#ab726e;}
.system-error-hint{
  margin:18px 0 0;
  padding:14px 16px;
  border-left:3px solid #88a48b;
  border-radius:8px;
  background:#f9f9f8;
  color:#6b665c;
  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:#97948d;
  font-size:.72rem;
  letter-spacing:.02em;
}
html[data-theme="dark"] .system-error-body{background:#151310!important;}
html[data-theme="dark"] .system-error-card{
  background:#1e1c18!important;
  border-color:#4b463d!important;
  color:#f4f3f0!important;
}
html[data-theme="dark"] .system-error-mark{background:#312e27!important;color:#adc8b0!important;}
html[data-theme="dark"] .system-error-lead,
html[data-theme="dark"] .system-error-hint{color:#c7c4bd!important;}
html[data-theme="dark"] .system-error-status span{
  background:#26231d!important;
  border-color:#4b463d!important;
  color:#d6d3cd!important;
}
html[data-theme="dark"] .system-error-hint{
  background:#26231d!important;
  border-left-color:#829f85!important;
}
html[data-theme="dark"] .system-error-reference{color:#a19d95!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,#88837a);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:#aeaaa1!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 #4b463d!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:#23211c!important;
    border-color:#5f594d!important;
    color:#eeece9!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:#789a7c!important;
    border-color:#789a7c!important;
    color:#14120f!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,#e6e4e1);
}
.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,#88837a);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:#4b463d!important;}
html[data-theme="dark"] .ux-v40 .notification-settings-form .field-note{color:#aeaaa1!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:#adc8b0!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 #c2c0bc!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;
  }
}
