:root {
  color-scheme: dark;
  --ink: #f4fbf7;
  --muted: #a9b9b1;
  --soft: #17251f;
  --line: rgba(255, 255, 255, 0.12);
  --panel: #13211b;
  --panel-2: #182a23;
  --green: #0d6f53;
  --green-dark: #084433;
  --lime: #b7ef65;
  --amber: #d8891c;
  --red: #c94d3f;
  --blue: #326bba;
  --page: #0b1411;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #101a16 0%, #0b1411 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.auth-locked {
  overflow: hidden;
}

button,
a,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

body.auth-locked .app-shell {
  display: none;
}

body.pda-only:not(.auth-locked) .app-shell {
  display: block;
}

body.pda-only .sidebar,
body.pda-only .topbar,
body.pda-only .mobile-nav,
body.pda-only .demo-banner,
body.pda-only [data-view]:not([data-view="pda"]) {
  display: none !important;
}

body.pda-only .workspace {
  min-height: 100vh;
  padding: 14px;
}

body.pda-only .app-view {
  max-width: 100%;
}

body.pda-only .pda-tablet-shell {
  min-height: calc(100vh - 28px);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: #0b1411;
}

body.auth-locked .login-screen {
  display: grid;
}

.login-panel {
  display: grid;
  width: min(440px, 100%);
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 6px;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel p {
  color: var(--muted);
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.login-error {
  min-height: 20px;
  color: #ffd0ca;
  font-weight: 800;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #101a16;
}

.brand,
.topbar,
.top-actions,
.view-head,
.view-actions,
.section-row,
.modal-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--lime), #43c889);
  color: #0d251c;
  font-weight: 950;
}

.brand p,
.brand span,
.sidebar-status p,
.eyebrow,
.view-head p,
.kpi-card p,
.status-card h3,
.status-card b,
.alert-card p,
.action-card p,
.quality-card p,
.line-detail-card p,
.orders p,
.plan-board p {
  margin: 0;
}

.pda-tablet-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
  min-height: calc(100vh - 160px);
}

.pda-tablet-shell > * {
  min-width: 0;
}

.pda-tablet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pda-tablet-head span,
.pda-tablet-metrics span,
.pda-tablet-order label,
.pda-tablet-progress label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pda-tablet-head h2 {
  margin: 4px 0 0;
  font-size: 36px;
  line-height: 1;
}

.pda-tablet-head strong {
  min-width: 150px;
  padding: 14px 18px;
  border-radius: 8px;
  background: rgba(183, 239, 101, 0.12);
  color: var(--lime);
  text-align: center;
  font-size: 20px;
}

.pda-tablet-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pda-tablet-live {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pda-tablet-metrics div {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.pda-tablet-live div {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 111, 83, 0.12);
}

.pda-tablet-metrics strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.12;
}

.pda-tablet-live span,
.pda-tablet-live small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pda-tablet-live strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
}

.pda-tablet-order,
.pda-tablet-progress {
  display: grid;
  gap: 12px;
}

.pda-tablet-order {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pda-tablet-progress {
  grid-template-columns: 180px 160px minmax(0, 1fr);
}

.pda-tablet-order label,
.pda-tablet-progress label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pda-tablet-order input,
.pda-tablet-order select,
.pda-tablet-progress input,
.pda-tablet-progress select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  font-size: 18px;
}

.pda-tablet-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pda-tablet-actions button {
  min-height: 74px;
  font-size: 22px;
}

.pda-tablet-timeline {
  display: grid;
  gap: 10px;
}

.brand p {
  font-size: 18px;
  font-weight: 900;
}

.brand span,
.sidebar-status p,
.view-head p {
  color: var(--muted);
  font-size: 13px;
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-section {
  margin: 10px 0 4px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.main-nav a,
.mobile-nav a {
  text-decoration: none;
}

.main-nav a {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: #b9c8c1;
  font-weight: 760;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.main-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.main-nav a.active {
  box-shadow: inset 3px 0 0 var(--lime);
}

.main-nav b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--amber);
  color: #170f03;
  font-size: 12px;
}

.sidebar-status {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-status span {
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-status strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.workspace {
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 54px) 42px;
}

.demo-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 2px solid rgba(216, 137, 28, 0.88);
  border-radius: 8px;
  background: #3b2107;
  color: #fff6e8;
  box-shadow: 0 14px 34px rgba(216, 137, 28, 0.18);
}

.demo-banner strong {
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--amber);
  color: #170f03;
  font-size: 13px;
  font-weight: 950;
}

.demo-banner span {
  font-weight: 820;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.topbar > div:first-child {
  display: none;
}

.topbar {
  justify-content: flex-end;
}

.eyebrow {
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  font-size: 32px;
  line-height: 1.05;
}

.top-actions {
  gap: 12px;
}

.view-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.action-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.action-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.role-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.report-audience {
  display: grid;
  min-width: 150px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.quality-filter {
  display: grid;
  min-width: 140px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.production-filter {
  display: grid;
  min-width: 140px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1d18;
  color: var(--ink);
  padding: 0 12px;
}

.live-pill,
.data-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(183, 239, 101, 0.12);
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
}

.source-pill,
.connection-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.source-pill[data-mode="production"] {
  border-color: rgba(57, 149, 255, 0.42);
  background: rgba(57, 149, 255, 0.12);
  color: #bcdcff;
}

.source-pill[data-mode="demo"] {
  border-color: rgba(216, 137, 28, 0.62);
  background: rgba(216, 137, 28, 0.16);
  color: #ffd79c;
}

.connection-pill i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.connection-pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.connection-pill[data-connection-state="connected"] i {
  background: var(--lime);
  box-shadow: 0 0 14px rgba(183, 239, 101, 0.65);
}

.connection-pill[data-connection-state="syncing"] i {
  background: #3995ff;
  box-shadow: 0 0 14px rgba(57, 149, 255, 0.65);
}

.connection-pill[data-connection-state="offline"] i,
.connection-pill[data-connection-state="error"] i {
  background: var(--red);
  box-shadow: 0 0 14px rgba(201, 77, 63, 0.55);
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(183, 239, 101, 0.7);
}

.data-status.error {
  background: rgba(201, 77, 63, 0.16);
  color: #ffb9ad;
}

.app-view {
  display: none;
  width: 100%;
  min-width: 0;
  max-width: 1240px;
  animation: viewIn 0.18s ease;
}

.app-view.active {
  display: block;
}

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

.view-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.view-head.compact {
  margin-bottom: 18px;
}

.view-head h2 {
  font-size: clamp(28px, 3vw, 42px);
}

.kpi-grid,
.status-grid,
.quality-layout,
.data-summary,
.validation-summary,
.production-summary,
.history-summary,
.action-summary {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card {
  min-height: 164px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
}

.kpi-card span,
.quality-card span,
.analysis-card span,
.line-detail-card span,
.orders span,
.plan-board span,
.action-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 0.95;
}

.kpi-card p {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

[data-list="line-status"] {
  display: contents;
}

.status-card,
.line-detail-card {
  width: 100%;
  text-align: left;
}

.status-card {
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.status-card:hover,
.line-detail-card:hover,
.alert-center li:hover {
  transform: translateY(-2px);
  border-color: rgba(183, 239, 101, 0.38);
}

.status-card > span {
  display: inline-grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 950;
}

.status-card h3 {
  margin-top: 14px;
  font-size: 18px;
}

.status-card b {
  display: block;
  margin-top: 18px;
  color: var(--lime);
  font-size: 12px;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.status-card small {
  color: #ffd39a;
  font-size: 15px;
  font-weight: 900;
}

.status-card.attention,
.line-detail-card.attention,
.orders .attention {
  border-color: rgba(216, 137, 28, 0.55);
  background: linear-gradient(180deg, rgba(216, 137, 28, 0.16), rgba(216, 137, 28, 0.06));
}

.attention-block,
.pending-block {
  margin-top: 34px;
}

.attention-block h2,
.pending-block h2 {
  font-size: 22px;
}

.alert-card,
.panel,
.quality-card,
.analysis-card,
.action-card,
.line-detail-card,
.orders article,
.plan-board article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.primary-alert {
  margin-top: 14px;
  padding: 22px;
}

.primary-alert > div {
  display: flex;
  gap: 14px;
}

.alert-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--amber);
  color: #170f03;
  font-weight: 950;
}

.alert-card h3 {
  font-size: 24px;
}

.decision-item > div span:not(.alert-icon) {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.alert-card p {
  margin-top: 6px;
  color: var(--muted);
}

dl {
  margin: 0;
}

.alert-card dl,
.line-detail-card dl,
.line-side-panel dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 900;
}

.alert-card footer,
.analysis-card footer,
.plant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.primary-btn,
.danger-btn,
.secondary-btn,
.file-control,
.secondary-file-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 850;
}

.primary-btn {
  gap: 8px;
  border: 0;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 14px 32px rgba(13, 111, 83, 0.26);
}

.danger-btn {
  border: 0;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 14px 32px rgba(201, 77, 63, 0.24);
}

.secondary-btn {
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.secondary-file-control {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.secondary-file-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.section-row {
  justify-content: space-between;
  gap: 12px;
}

.section-row a {
  color: var(--lime);
  font-weight: 850;
  text-decoration: none;
}

.pending-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.pending-actions:empty::before,
[data-list="attention-items"]:empty::before {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 850;
  content: "Sin datos suficientes";
}

.action-card {
  padding: 16px;
}

.action-card h3,
.action-card h4 {
  margin: 0;
  font-size: 16px;
}

.action-card p {
  margin-top: 8px;
  color: var(--muted);
}

.production-attention,
.analysis-context,
.action-detail {
  margin-top: 18px;
  padding: 18px;
}

.production-problem {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.production-problem strong,
.production-problem b {
  font-size: 18px;
}

.production-problem b {
  color: #ffd39a;
}

[data-list="analysis-hypotheses"] {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

[data-list="analysis-hypotheses"] button {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  text-align: left;
}

[data-list="analysis-hypotheses"] li.active button {
  border-color: rgba(183, 239, 101, 0.56);
  background: rgba(183, 239, 101, 0.1);
}

[data-list="analysis-hypotheses"] small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.analysis-context dl,
.action-detail dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.analysis-engineering-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.analysis-engineering-grid article {
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.analysis-engineering-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.analysis-engineering-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 17px;
}

.analysis-engineering-grid p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.context-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.similar-case-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(183, 239, 101, 0.34);
  border-radius: 8px;
  background: rgba(183, 239, 101, 0.08);
}

.action-problem {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

[data-action-row].dragging {
  opacity: 0.55;
}

[data-kanban].drop-target {
  outline: 2px solid rgba(183, 239, 101, 0.55);
  outline-offset: 4px;
  background: rgba(183, 239, 101, 0.08);
}

.import-zone h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.import-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.import-conflict {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(216, 137, 28, 0.62);
  border-radius: 8px;
  background: rgba(216, 137, 28, 0.12);
}

.import-conflict[hidden] {
  display: none;
}

.import-conflict span {
  color: #ffd79c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.import-conflict strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.import-conflict p {
  margin: 4px 0 0;
  color: var(--muted);
}

.import-conflict ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-conflict li {
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: rgba(0, 0, 0, 0.18);
}

.import-advanced {
  margin-top: 18px;
}

.import-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.import-advanced summary b {
  color: var(--lime);
  font-size: 13px;
}

.action-card span {
  display: inline-flex;
  margin-top: 14px;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(183, 239, 101, 0.12);
  color: var(--lime);
}

.tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tabs button,
.filters button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  padding: 0 14px;
  font-weight: 850;
}

.tabs button.active,
.filters button.active {
  background: var(--lime);
  color: #0d251c;
}

.production-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.production-lines,
.orders,
.plan-board,
.production-insights,
.analysis-flow,
.report-layout,
.settings-layout {
  display: grid;
  gap: 14px;
}

.production-insights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.line-detail-card {
  padding: 18px;
  color: var(--ink);
}

.line-detail-card h3 {
  margin-top: 8px;
  font-size: 22px;
}

.line-detail-card p {
  margin-top: 6px;
  color: var(--muted);
}

.line-detail-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.line-side-panel {
  align-self: start;
  position: sticky;
  top: 28px;
  padding: 18px;
  border: 1px solid rgba(183, 239, 101, 0.24);
  border-radius: 8px;
  background: #0f1d18;
}

.line-side-panel > span {
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.line-side-panel h3 {
  margin-top: 10px;
}

.line-side-panel dl {
  grid-template-columns: 1fr;
}

.quality-layout {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-card {
  min-height: 150px;
  padding: 20px;
}

.quality-card strong {
  display: block;
  margin-top: 18px;
  font-size: 34px;
}

.quality-card p {
  margin-top: 10px;
  color: var(--muted);
}

.quality-trends,
.import-zone {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quality-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.trend-bars {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 160px;
  margin-top: 18px;
}

.trend-bars span {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--lime), var(--green));
}

.alert-center,
.signal-list,
.report-steps,
.supervisor-actions,
.history-chart {
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert-center {
  display: grid;
  gap: 12px;
}

.alert-center li {
  display: grid;
  grid-template-columns: 74px 1fr max-content;
  gap: 10px 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.alert-center span {
  grid-row: span 2;
  display: grid;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--amber);
  color: #170f03;
  font-weight: 950;
}

.severity-badge {
  grid-row: span 2;
  display: grid;
  min-width: 82px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #170f03;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.severity-badge.severity-critica {
  background: #e23d28;
  color: #fff;
}

.severity-badge.severity-alta {
  background: var(--amber);
}

.severity-badge.severity-media {
  background: #f4d44d;
}

.severity-badge.severity-baja {
  background: #aeb8b2;
}

.alert-center small {
  color: var(--muted);
}

.alert-center a {
  grid-row: span 2;
  color: var(--lime);
  font-weight: 900;
  text-decoration: none;
}

.analysis-flow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-card {
  min-height: 210px;
  padding: 22px;
}

.analysis-card strong {
  display: block;
  margin-top: 18px;
  font-size: 36px;
}

.analysis-card p,
.analysis-card li {
  color: var(--muted);
}

.analysis-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.analysis-card.hypothesis {
  border-color: rgba(50, 107, 186, 0.4);
}

.analysis-card.decision {
  border-color: rgba(183, 239, 101, 0.36);
}

.root-cause-form {
  margin-top: 16px;
}

.root-cause-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.root-cause-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.root-cause-cases {
  margin-top: 16px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.kanban section {
  min-height: 440px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.kanban h3 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.supervisor-actions {
  display: grid;
  gap: 10px;
}

.supervisor-actions li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.supervisor-actions li.is-empty {
  color: var(--muted);
}

.supervisor-action-head {
  display: block;
}

.supervisor-action-head span,
.supervisor-action-head strong {
  display: block;
}

.supervisor-action-head strong {
  margin-top: 3px;
}

.supervisor-action-head b {
  display: inline-flex;
  margin-top: 10px;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
}

.supervisor-action-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.evidence-control {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.verification-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(69, 216, 139, 0.28);
  border-radius: 999px;
  color: #b6f2cf;
  font-size: 12px;
  font-weight: 800;
}

.efficacy-mini,
.efficacy-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.efficacy-mini {
  margin-top: 10px;
}

.efficacy-chip.eficaz {
  color: #b6f2cf;
  border-color: rgba(69, 216, 139, 0.34);
  background: rgba(69, 216, 139, 0.08);
}

.efficacy-chip.parcialmente-eficaz {
  color: #ffe0a8;
  border-color: rgba(255, 196, 87, 0.32);
  background: rgba(255, 196, 87, 0.08);
}

.efficacy-chip.no-eficaz {
  color: #ffb5b5;
  border-color: rgba(255, 103, 103, 0.34);
  background: rgba(255, 103, 103, 0.08);
}

.effectiveness-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.effectiveness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.effectiveness-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.effectiveness-grid article > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.effectiveness-grid label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.before-after-grid {
  display: grid;
  gap: 10px;
}

.before-after-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.before-after-grid small {
  color: var(--muted);
}

.pending-efficacy {
  color: var(--muted);
  font-weight: 850;
}

.detail-evidence {
  display: block;
  margin-top: 14px;
}

.action-card .secondary-btn,
.signal-list .secondary-btn {
  margin-top: 10px;
}

.evidence-control label,
.plant-settings label,
.pda-form label,
.manual-entry-form label,
.history-filter label,
.action-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.action-summary,
.data-summary,
.production-summary,
.history-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.history-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.article-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.article-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.article-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.article-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 520px);
  gap: 12px;
  margin-top: 16px;
}

.articles-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.38fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.article-card span,
.article-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-card strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.article-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.article-card dd {
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.validation-panel,
.edit-panel,
.manual-entry-panel {
  margin-top: 16px;
  padding: 18px;
}

.validation-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  margin-top: 14px;
}

.action-summary div,
.data-summary div,
.validation-summary div,
.production-summary div,
.history-summary div,
.verification-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.action-summary span,
.data-summary span,
.validation-summary span,
.production-summary span,
.history-summary span,
.verification-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-summary strong,
.data-summary strong,
.validation-summary strong,
.production-summary strong,
.history-summary strong,
.verification-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.validation-summary button {
  align-self: stretch;
}

.validation-review {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.validation-review article {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1d18;
}

.validation-review article.state-blocked {
  border-color: rgba(201, 77, 63, 0.55);
}

.validation-review article.state-pending {
  border-color: rgba(216, 137, 28, 0.55);
}

.validation-review span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.validation-review strong {
  font-size: 15px;
}

.validation-review small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.validation-review button {
  justify-self: start;
  margin-top: auto;
}

.edit-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.edit-group {
  margin-top: 18px;
}

.edit-group h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.edit-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.2fr) repeat(4, minmax(98px, 0.55fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1d18;
}

.edit-row.state-blocked {
  border-color: rgba(201, 77, 63, 0.5);
}

.edit-row.state-pending {
  border-color: rgba(216, 137, 28, 0.5);
}

.edit-row.focused-review-row {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(183, 239, 101, 0.18);
}

.edit-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.edit-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(183, 239, 101, 0.12);
  color: var(--lime);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.edit-row.state-blocked .edit-meta span {
  background: rgba(201, 77, 63, 0.18);
  color: #ffb9ad;
}

.edit-row.state-pending .edit-meta span {
  background: rgba(216, 137, 28, 0.18);
  color: #ffd39a;
}

.edit-meta strong,
.edit-meta small {
  display: block;
}

.edit-meta strong {
  margin-top: 8px;
}

.edit-meta small {
  margin-top: 5px;
  color: var(--muted);
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.report-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.75fr);
  margin-top: 16px;
}

.report-layout .panel:first-child {
  grid-row: span 2;
}

.pilot-panel,
.shift-close-panel {
  margin-top: 16px;
}

.pilot-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.pilot-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.report-brief {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.report-brief span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-brief strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.08;
}

.report-brief p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.report-brief textarea {
  width: 100%;
  min-height: 270px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1d18;
  color: var(--ink);
  padding: 14px;
  line-height: 1.45;
}

.report-archive,
.action-audit {
  margin-top: 16px;
}

.report-archive p,
.action-audit p {
  margin: 6px 0 0;
  color: var(--muted);
}

.archive-actions,
.audit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-steps,
.signal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-steps li,
.signal-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.report-steps span,
.signal-list small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.history-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.history-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.history-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 140px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.history-chart li {
  flex: 1;
  display: grid;
  align-items: end;
  gap: 5px;
  text-align: center;
}

.history-chart div {
  min-height: 12px;
  border-radius: 8px 8px 0 0;
  background: var(--lime);
}

.history-chart strong,
.history-chart span {
  font-size: 11px;
}

.import-zone {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border-style: dashed;
  text-align: center;
}

.import-zone strong {
  font-size: clamp(26px, 3vw, 42px);
}

.file-control {
  position: relative;
  min-width: 190px;
  overflow: hidden;
  border: 0;
  background: var(--green);
  color: #fff;
  box-shadow: 0 14px 32px rgba(13, 111, 83, 0.26);
}

.excel-control {
  background: var(--blue);
}

.file-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.settings-layout {
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
  margin-top: 16px;
}

.plant-settings,
.pda-form,
.manual-entry-form {
  display: grid;
  gap: 12px;
}

.line-targets-editor,
.shift-editor {
  display: grid;
  gap: 10px;
}

.line-targets-editor > div,
.shift-editor > div {
  display: grid;
  grid-template-columns: 42px repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.shift-editor > div {
  grid-template-columns: 42px 90px 110px 110px minmax(0, 1fr);
}

.line-targets-editor span,
.shift-editor span {
  align-self: center;
  color: var(--lime);
  font-size: 13px;
  font-weight: 950;
}

.access-panel,
.pda-panel,
.advanced-tools {
  grid-column: 1 / -1;
}

.pda-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.manual-entry-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
}

.pda-form button,
.manual-entry-form button {
  align-self: end;
}

.pda-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pda-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.advanced-tools summary {
  cursor: pointer;
  color: var(--lime);
  font-weight: 900;
}

.advanced-tools .file-control,
.advanced-tools .secondary-btn {
  margin: 14px 8px 0 0;
}

.access-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.access-strip span {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(183, 239, 101, 0.12);
  color: var(--lime);
  font-size: 12px;
  font-weight: 850;
}

.access-audit-head {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.access-grid article {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.access-grid article.active {
  border-color: rgba(183, 239, 101, 0.7);
  background: rgba(183, 239, 101, 0.09);
}

.access-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
}

.access-grid strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.access-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.action-modal {
  display: grid;
  width: min(520px, 100%);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101a16;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(183, 239, 101, 0.35);
  border-radius: 8px;
  background: #13211b;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 850;
}

.toast[hidden] {
  display: none;
}

.import-zone.dragging {
  border-color: rgba(183, 239, 101, 0.7);
  background: rgba(183, 239, 101, 0.08);
}

.modal-head {
  justify-content: space-between;
}

.modal-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 24px;
}

.mobile-nav {
  display: none;
}

.is-disabled {
  opacity: 0.58;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 20px 16px 92px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .top-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .connection-pill {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 7px 11px;
  }

  .demo-banner {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-grid,
  .production-layout,
  .production-insights,
  .quality-layout,
  .quality-insights,
  .analysis-flow,
  .analysis-engineering-grid,
  .effectiveness-grid,
  .root-cause-grid,
  .kanban,
  .action-toolbar,
  .report-layout,
  .report-brief,
  .settings-layout,
  .history-filter,
  .history-insights,
  .history-summary,
  .article-summary,
  .article-toolbar,
  .article-card,
  .pda-tablet-metrics,
  .pda-tablet-live,
  .pda-tablet-order,
  .pda-tablet-progress,
  .action-summary,
  .production-summary,
  .pilot-summary,
  .edit-row,
  .validation-review,
  .data-summary {
    grid-template-columns: 1fr;
  }

  .pending-actions,
  .alert-card dl,
  .line-detail-card dl,
  .analysis-context dl,
  .action-detail dl,
  .production-problem,
  .access-grid,
  .line-targets-editor > div,
  .shift-editor > div,
  .pda-form,
  .manual-entry-form,
  .pda-summary,
  .pda-tablet-actions,
  .before-after-grid {
    grid-template-columns: 1fr;
  }

  .line-side-panel {
    position: static;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: rgba(16, 26, 22, 0.96);
    backdrop-filter: blur(14px);
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 76px;
  }

  .mobile-nav a {
    display: grid;
    min-height: 46px;
    place-items: center;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-nav a.active {
    background: rgba(183, 239, 101, 0.14);
    color: var(--lime);
  }
}

@media (max-width: 520px) {
  .topbar {
    display: none;
  }

  .view-head {
    align-items: flex-start;
  }

  .view-head .live-pill {
    display: none;
  }

  .kpi-card {
    min-height: 132px;
    padding: 16px;
  }

  .kpi-card strong {
    font-size: 32px;
  }

  .status-card {
    min-height: 142px;
  }

  .alert-center li {
    grid-template-columns: 1fr;
  }

  .alert-center span,
  .alert-center a {
    grid-row: auto;
  }
}
