/* ATT-MO-FIELD-REF002-B2 — Jerarquía operativa de terreno.
   Scope estricto: FIELD · presentación, NO habilitaciones, telemetría ni backend.
   Resultados seleccionados no equivalen a autorización de turno.
   SAM y las imágenes de maquinaria quedan fuera de este paquete. */
body.field-shell.field-e4 {
  --b2-gold-light: #ffcf56;
  --b2-gold-deep: #da9215;
  --b2-blue-note: #14719b;
  --b2-ink: #092943;
  --b2-warning: #a96512;
  --b2-error: #a62637;
}

/* F01 / Pre-Start: progreso visual = resultados SELECCIONADOS, no aprobados. */
body.field-shell.field-e4 .e4-next-step.e4-prestart-active {
  border: 1px solid #e2ba6b !important;
  border-left: 5px solid #d49b22 !important;
  box-shadow: 0 7px 22px rgba(84, 54, 12, .12);
}
body.field-shell.field-e4 .e4-prestart-heading strong {
  font-size: clamp(18px, 4.6vw, 22px);
  line-height: 1.2;
}
body.field-shell.field-e4 .e4-prestart-progress > span {
  height: 11px;
  border-radius: 5px;
  background: #d7e1e9;
  border-color: #c5d2dc;
}
body.field-shell.field-e4 .e4-prestart-progress > span.is-reviewed {
  background: #2876aa;
  border-color: #14608f;
}
body.field-shell.field-e4 .e4-prestart-warning {
  padding: 9px 11px;
  border: 1px solid #e8d3a7;
  border-left: 4px solid #ba822d;
  border-radius: 9px;
  background: #fff9ed;
  color: #704819;
  font-size: 12px !important;
  line-height: 1.48 !important;
}
body.field-shell.field-e4 .e4-prestart-action #fieldStartShortcut {
  width: 100%;
  min-height: 61px;
  padding: 14px 17px;
  border-radius: 14px;
  border: 2px solid #a86a0b !important;
  background: linear-gradient(125deg, var(--b2-gold-light), #eeb02a) !important;
  color: var(--b2-ink) !important;
  box-shadow: 0 6px 0 #9e6b15, 0 13px 23px #5b431524 !important;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 900;
  letter-spacing: .012em;
  line-height: 1.2;
  text-wrap: balance;
}
body.field-shell.field-e4 .e4-prestart-action #fieldStartShortcut:focus-visible {
  outline: 4px solid #1974b3;
  outline-offset: 4px;
}

/* F02 / Inicio real de jornada. El botón mantiene las guardas originales. */
body.field-shell.field-e4 .e4-prestart-card #startShiftBtn {
  min-height: 64px;
  border-radius: 14px;
  border: 2px solid #a8750b !important;
  background: linear-gradient(120deg, #ffcf55, #f0af22) !important;
  color: #092943 !important;
  box-shadow: 0 5px 0 #a36d10, 0 11px 20px #173b521c;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}
body.field-shell.field-e4 .e4-prestart-card .checklist label {
  border-left: 4px solid #9bb8cc;
  background: #f1f7fa;
  padding: 14px 13px;
  font-size: 14px;
}
body.field-shell.field-e4 .e4-prestart-card .checklist select.precheck {
  min-height: 54px;
  border: 2px solid #a4bbc9;
  border-radius: 10px;
}

/* F02 / Estado. El atributo proviene SOLO del snapshot local existente.
   not-started ≠ autorización, shift-active ≠ máquina en movimiento. */
body.field-shell.field-e4 .e4-operation-overview {
  border: 1px solid #2f6380;
  border-left: 6px solid #7da7bd;
}
body.field-shell.field-e4 .e4-operation-overview[data-ref002-phase="shift-active"] {
  border-left-color: #34abd4;
}
body.field-shell.field-e4 .e4-operation-overview[data-ref002-phase="downtime"] {
  border-left-color: #e2a438;
}
body.field-shell.field-e4 .e4-operation-overview[data-ref002-phase="downtime"] .e4-operation-mode {
  background: #ffe1aa;
  color: #4e310b;
}
body.field-shell.field-e4 #e4OperationState {
  font-size: clamp(21px, 6vw, 29px);
  line-height: 1.14;
  letter-spacing: -.025em;
}
body.field-shell.field-e4 #e4OperationContext {
  font-size: 13px;
  line-height: 1.5;
}
body.field-shell.field-e4 #opsPanel > .tabs.e4-operation-actions {
  gap: 9px;
  border: 1px solid #c4d5e0;
  background: #e6eff5;
  box-shadow: 0 8px 18px #082e480f;
}
body.field-shell.field-e4 #opsPanel > .tabs.e4-operation-actions > .e4-operation-tab {
  min-height: 96px;
  border-width: 2px;
  border-radius: 15px;
  box-shadow: 0 3px 0 #153b5220;
  font-size: 13px;
  font-weight: 850;
}
body.field-shell.field-e4 #opsPanel > .tabs.e4-operation-actions > .e4-operation-tab.active {
  box-shadow: inset 0 -5px 0 #ffcf55, 0 5px 17px #082e4d2b;
}
body.field-shell.field-e4 .e4-activity-card .e4-activity-cta {
  min-height: 66px !important;
  padding: 13px 16px;
  border: 2px solid #aa7918 !important;
  border-radius: 14px !important;
  background: linear-gradient(120deg, #ffcf57, #edab1d) !important;
  color: #092943 !important;
  box-shadow: 0 4px 0 #a77716, 0 9px 17px #5e410a1c;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}
body.field-shell.field-e4 .e4-prestart-card #startShiftBtn:disabled,
body.field-shell.field-e4 .e4-activity-card .e4-activity-cta:disabled,
body.field-shell.field-e4 .e4-prestart-action #fieldStartShortcut:disabled {
  background: #d8e0e6 !important;
  color: #4f606c !important;
  border-color: #acbac4 !important;
  box-shadow: none !important;
  opacity: 1;
  cursor: not-allowed;
}

/* F04 / Trazabilidad local: categorías siempre textuales, color complementario. */
body.field-shell.field-e4 .e4-records-grid .e4-record-stat {
  border-top: 4px solid #33739a;
  border-radius: 13px;
  padding: 14px 9px;
}
body.field-shell.field-e4 .e4-records-grid .e4-record-stat:nth-child(2) {
  border-top-color: #d29b2f;
}
body.field-shell.field-e4 .e4-records-grid .e4-record-stat-error {
  border-top-color: #b63b49;
}
body.field-shell.field-e4 .e4-records-grid .e4-record-stat > span {
  font-size: 10px;
  line-height: 1.3;
}
body.field-shell.field-e4 .e4-records-grid .e4-record-stat strong {
  font-size: clamp(25px, 6.8vw, 36px);
  font-variant-numeric: tabular-nums;
}
body.field-shell.field-e4 .e4-records-tabs button {
  min-height: 54px;
  font-size: 13px;
  border-width: 2px;
}
body.field-shell.field-e4 .e4-records-tabs button[aria-pressed="true"] {
  background: #0d4568;
  border-color: #0d4568;
  color: #fff;
}
body.field-shell.field-e4 .e4-records-queue {
  border-left: 5px solid #4d829f;
}
body.field-shell.field-e4 .e4-records-queue #fieldRetry {
  min-height: 56px;
  font-weight: 850;
}
body.field-shell.field-e4 .e4-records-queue #fieldRetry:disabled {
  background: #dce5ea !important;
  color: #526c7c !important;
  opacity: 1;
  box-shadow: none;
}
body.field-shell.field-e4 .e4-event-list .event.e4-event-error {
  border-left: 4px solid #b73a48;
}
body.field-shell.field-e4 .e4-event-list .event.e4-event-pending {
  border-left: 4px solid #ca9430;
}
body.field-shell.field-e4 .e4-event-list .event.e4-event-received {
  border-left: 4px solid #237f63;
}

/* Noche: contraste intencional; no aclarar la marca ni declarar recepción remota. */
body.field-shell.field-e4[data-field-theme="night"] .e4-next-step.e4-prestart-active {
  border-color: #7e673d !important;
  border-left-color: #f1bd55 !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-prestart-warning {
  background: #433119;
  border-color: #856039;
  border-left-color: #e2b85f;
  color: #ffe6b9 !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-prestart-progress > span {
  background: #27475e;
  border-color: #476980;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-prestart-progress > span.is-reviewed {
  background: #5aaee0;
  border-color: #75c9ef;
}
body.field-shell.field-e4[data-field-theme="night"] #opsPanel > .tabs.e4-operation-actions {
  background: #132e45 !important;
  border-color: #506e88 !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-prestart-card .checklist label {
  background: #1b364a;
  border-left-color: #7694ae;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-records-grid .e4-record-stat strong {
  color: #f7fbff !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-records-grid .e4-record-stat:nth-child(2) strong {
  color: #ffcf70 !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-records-grid .e4-record-stat-error strong {
  color: #ffc7cc !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-records-tabs button[aria-pressed="true"] {
  background: #23628b !important;
  border-color: #8fc4e6 !important;
  color: #fff !important;
}
body.field-shell.field-e4[data-field-theme="night"] .e4-records-queue {
  border-left-color: #79b0ce !important;
}
@media(max-width:390px){
  body.field-shell.field-e4 .e4-prestart-heading strong{font-size:18px}
  body.field-shell.field-e4 .e4-records-grid .e4-record-stat{padding:12px 7px}
  body.field-shell.field-e4 .e4-records-grid .e4-record-stat>span{font-size:9.5px}
  body.field-shell.field-e4 #opsPanel > .tabs.e4-operation-actions > .e4-operation-tab{min-height:94px}
}
@media(prefers-reduced-motion:reduce){
  body.field-shell.field-e4 .e4-activity-card .e4-activity-cta,
  body.field-shell.field-e4 .e4-prestart-action #fieldStartShortcut,
  body.field-shell.field-e4 #opsPanel > .tabs.e4-operation-actions > .e4-operation-tab{
    transition:none!important;
    animation:none!important;
  }
}
