:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1a2840;
  --muted: #5a6a7e;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #e8762a;
  --accent-dark: #c0602a;
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --danger: #b91c1c;
  --tag-bg: #f1f5f9;
  --tag-text: #475569;
}

.tag-concreto {
  display: inline-block;
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0,0,0,0.05);
  margin-left: 4px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
}

body {
  margin: 0;
  background: linear-gradient(160deg, #f0f4f8 0%, #ffffff 60%, #eef2f7 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(circle at top left, rgba(37, 99, 168, 0.2), transparent 38%),
              radial-gradient(circle at bottom right, rgba(232, 118, 42, 0.2), transparent 42%),
              linear-gradient(160deg, #f0f4f8 0%, #ffffff 60%, #eef2f7 100%);
  z-index: 999;
  min-height: 100dvh;
}

.login-card {
  width: min(100%, 430px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  box-shadow: 0 24px 50px rgba(15, 30, 60, 0.18);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.login-card-splash {
  position: relative;
  padding: 28px 22px 22px;
  background: linear-gradient(145deg, rgba(26, 58, 92, 0.98), rgba(37, 99, 168, 0.94));
  color: #fff;
}

.login-card-splash::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -36px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(232, 118, 42, 0.4), transparent 66%);
}

.login-card-panel {
  padding: 20px 22px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff);
}

.login-card-brand {
  position: relative;
  z-index: 1;
}

.login-card-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.login-form-grid {
  display: grid;
  gap: 2px;
}

.login-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #f29a48 100%);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.42rem;
  line-height: 1.15;
  color: inherit;
}

.login-card p {
  margin: 0 0 16px;
  color: inherit;
  opacity: 0.88;
  font-size: 0.92rem;
  line-height: 1.45;
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 600;
}

.login-card input,
.login-card select {
  width: 100%;
  margin-top: 6px;
  min-height: 52px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  background: #f8fafc;
}

.login-card input:focus,
.login-card select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.12);
}

.login-card #loginEntrar {
  width: 100%;
  margin-top: 8px;
  min-height: 54px;
  border-radius: 16px;
  font-size: 1rem;
}

.login-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.82rem;
  line-height: 1.45;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell,
body.auth-locked #insFloatBar {
  visibility: hidden;
}

.auth-user-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.auth-logout-btn {
  padding: 8px 12px;
  min-height: auto;
  font-size: 0.8rem;
}

/* ── App Shell ────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: #0f1e3c;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.88rem;
  flex-shrink: 0; letter-spacing: 0.03em; color: #fff;
}
.sidebar-logo-name { display: flex; flex-direction: column; }
.sidebar-logo-title { font-weight: 800; font-size: 0.9rem; line-height: 1.25; }
.sidebar-logo-sub {
  font-size: 0.67rem; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.09em; margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 11px 16px 11px 14px;
  border: none; border-left: 3px solid transparent;
  background: transparent; color: rgba(255,255,255,0.6);
  text-align: left; cursor: pointer;
  font-size: 0.855rem; font-weight: 500; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.nav-item.nav-active {
  background: rgba(232,118,42,0.16); color: #fff;
  border-left-color: var(--accent); font-weight: 700;
}
.nav-icon-wrap {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800;
  flex-shrink: 0; letter-spacing: 0.02em;
}
.nav-item.nav-active .nav-icon-wrap { background: var(--accent); color: #fff; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sidebar-back {
  width: 100%; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px;
  background: transparent; color: rgba(255,255,255,0.65);
  cursor: pointer; font-size: 0.83rem; font-family: inherit;
  text-align: center; transition: background 0.15s, color 0.15s;
}
.sidebar-back:hover { background: rgba(255,255,255,0.09); color: #fff; }

/* ── Overlay mobile ───────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.visible { display: block; }

/* ── App main ─────────────────────────────────────── */
.app-main {
  margin-left: 0;
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left 0.25s ease;
}

/* Sidebar colapsada — desktop/tablet */
body.sidebar-hidden .sidebar { transform: translateX(-100%); }
body.sidebar-hidden .app-main  { margin-left: 0; }

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 0 20px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.sidebar-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
}
.topbar-title { font-size: 1.03rem; font-weight: 800; color: var(--text); letter-spacing: 0.02em; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar .sync-status {
  font-size: 0.75rem; padding: 5px 10px; border-radius: 20px;
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}

/* ── Page content ─────────────────────────────────── */
.page-content { flex: 1; padding: 20px 32px; background: transparent; }
.container { max-width: 1600px; margin: 0 auto; }

/* ── Dashboard hub ────────────────────────────────── */
.dash-welcome { margin-bottom: 20px; }
.dash-welcome h2 { margin: 0 0 4px; font-size: 1.2rem; }
.dash-welcome p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.hub-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hub-quick-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 16px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; text-align: center;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer; font-family: inherit;
}
.hub-quick-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #94a3b8; }
.hub-quick-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 0.9rem; letter-spacing: 0.03em;
}
.hub-quick-label { font-size: 0.83rem; font-weight: 600; color: #334155; }

/* ── Painel de Indicadores de Inspeção no Dashboard ── */
.ins-dash-panel {
  margin-top: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 18px 18px;
}
.ins-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.ins-dash-title {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}
.ins-dash-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ins-dash-filter-label {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ins-dash-date-input {
  font-size: 0.82rem;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.ins-dash-btn-hoje,
.ins-dash-btn-atualizar {
  font-size: 0.8rem;
  padding: 5px 11px;
}
.ins-dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .ins-dash-cards { grid-template-columns: repeat(2, 1fr); }
}
.ins-dash-card {
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.ins-dash-card-label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.ins-dash-card-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
}
.ins-dash-card-total  { background: #eff6ff; color: #1d4ed8; }
.ins-dash-card-ok     { background: #dcfce7; color: #166534; }
.ins-dash-card-r      { background: #fee2e2; color: #991b1b; }
.ins-dash-card-rr     { background: #fef9c3; color: #854d0e; }
.ins-dash-rate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.ins-dash-rate-label {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  min-width: 110px;
}
.ins-dash-rate-bar-track {
  flex: 1;
  height: 9px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}
.ins-dash-rate-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.ins-dash-rate-pct {
  font-size: 0.87rem;
  font-weight: 700;
  color: #b91c1c;
  min-width: 36px;
  text-align: right;
}
.ins-dash-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ins-dash-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.ins-dash-hist-date {
  min-width: 82px;
  color: #475569;
  font-weight: 600;
}
.ins-dash-hist-bar-track {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}
.ins-dash-hist-bar {
  height: 100%;
  background: #1e40af;
  border-radius: 99px;
}
.ins-dash-hist-count {
  min-width: 28px;
  text-align: right;
  color: #0f172a;
  font-weight: 700;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.sidebar-open { transform: translateX(0); }
  /* No mobile sidebar-hidden não aplica: o toggle usa overlay */
  body.sidebar-hidden .sidebar { transform: translateX(-100%); }
  body.sidebar-hidden .app-main  { margin-left: 0; }
  .app-main { margin-left: 0; }
  .page-content { padding: 14px; }
  .topbar { padding: 0 14px; }
}
@media (min-width: 769px) {
  [data-back-btn] { display: none; }
}
@media (min-width: 769px) {
  body.mode-inspecao .ins-float-bar { left: 240px; transition: left 0.25s ease; }
  body.sidebar-hidden.mode-inspecao .ins-float-bar { left: 0; }
}

/* ── Legacy header (hidden) ───────────────────────── */
.header { display: none; }


.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.card h3 {
  margin: 14px 0 6px;
  font-size: 1rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--text);
}

.btn-back {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.18);
  color: var(--text);
  min-width: 88px;
}

.btn-back:hover {
  background: rgba(0,0,0,0.12);
}

.sync-card {
  padding: 10px 14px;
}

.sync-status {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
}

.sync-ok {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}

.sync-warn {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.sync-error {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.sync-pending {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.legend-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.legend-box ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.legend-box li {
  margin: 4px 0;
}

.report-box {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.report-header {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.report-summary {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.report-table {
  margin-bottom: 12px;
}

.report-sign,
.report-sign-line {
  margin-top: 10px;
  font-size: 0.9rem;
}

.rel-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rel-print-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  color: #0f172a;
}

.rel-print-header {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid #0f172a;
}

.rel-company {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.rel-print-header h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.rel-meta {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #475569;
}

.rel-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.rel-kpi-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.rel-kpi-grid span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

.rel-kpi-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.rel-section {
  margin-top: 16px;
}

.rel-section h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.rel-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body:not(.print-relatorio) .rel-full-table th,
body:not(.print-relatorio) .rel-full-table td,
body:not(.print-relatorio) .rel-summary-table th,
body:not(.print-relatorio) .rel-summary-table td {
  white-space: normal;
  vertical-align: top;
}

/* Custom screen column widths for the report table (only in display/screen mode) */
body:not(.print-relatorio) .rel-full-table th:nth-child(1),
body:not(.print-relatorio) .rel-full-table td:nth-child(1) {
  width: 70px !important;
  max-width: 70px !important;
  text-align: center !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(2),
body:not(.print-relatorio) .rel-full-table td:nth-child(2) {
  width: 320px !important;
  max-width: 320px !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(3),
body:not(.print-relatorio) .rel-full-table td:nth-child(3) {
  width: 140px !important;
  max-width: 140px !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(4),
body:not(.print-relatorio) .rel-full-table td:nth-child(4) {
  width: 80px !important;
  max-width: 80px !important;
  text-align: center !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(5),
body:not(.print-relatorio) .rel-full-table td:nth-child(5) {
  width: 80px !important;
  max-width: 80px !important;
  text-align: center !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(6),
body:not(.print-relatorio) .rel-full-table td:nth-child(6) {
  width: 220px !important;
  max-width: 220px !important;
}

.rel-print-footer {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #cbd5e1;
}

.rel-sign-block {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 56px;
  border-top: 1px solid #0f172a;
  max-width: 360px;
  padding-top: 6px;
  font-size: 0.82rem;
  color: #475569;
}

.rel-footer-note {
  font-size: 0.75rem;
  color: #64748b;
}

@media (min-width: 640px) {
  .rel-actions {
    grid-template-columns: 1fr 1fr;
  }

  .rel-print-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .rel-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.dash-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #f8fafc;
}

.dash-card.setor-1 {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.dash-card.setor-2 {
  border-color: #34d399;
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 100%);
}

.dash-card.total {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #f8fafc 100%);
}

.dash-title {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.dash-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.dash-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.dash-chart {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  margin-bottom: 8px;
}

.dash-row {
  display: grid;
  grid-template-columns: 64px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dash-row:last-child {
  margin-bottom: 0;
}

.dash-bar-track {
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dash-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.dash-bar.setor-1 {
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

.dash-bar.setor-2 {
  background: linear-gradient(90deg, #34d399 0%, #059669 100%);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hub-item {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: center;
  min-height: 120px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  padding: 12px;
  text-align: center;
  cursor: pointer;
}

.hub-item:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  border-color: #60a5fa;
}

.hub-icon {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #1e40af;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hub-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.btn.primary,
.btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-color: var(--accent);
  color: #fff;
}

.btn:hover {
  background: rgba(232,118,42,0.08);
}

.btn.primary:hover,
.btn.active:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #a85124 100%);
}

.hidden {
  display: none !important;
}

.hint,
.muted,
.item-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.checklist {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
}

.check-row:nth-child(odd) {
  background: #f8fafc;
}

.sheet-box {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.sheet-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  background: rgba(37,99,168,0.06);
}

.sheet-grid-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid #0f172a;
  padding: 4px 5px;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.sheet-table th:nth-child(1),
.sheet-table td:nth-child(1) {
  width: 260px;
}

.sheet-table th:nth-child(3),
.sheet-table td:nth-child(3) {
  width: 260px;
}

.sheet-table th {
  background: #eef2f7;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.sheet-table td:nth-child(3),
.sheet-table td:nth-child(4),
.sheet-table td:nth-child(5) {
  text-align: center;
}

#viewInspecao .sheet-box {
  overflow-x: visible;
}

#viewInspecao .sheet-table {
  min-width: unset;
}

#viewInspecao .sheet-table th:nth-child(1),
#viewInspecao .sheet-table td:nth-child(1) {
  width: 9.4%;
}

#viewInspecao .sheet-table th:nth-child(2),
#viewInspecao .sheet-table td:nth-child(2) {
  width: 13.8%;
}

#viewInspecao .sheet-table th:nth-child(3),
#viewInspecao .sheet-table td:nth-child(3) {
  width: 18%;
}

#viewInspecao .sheet-table th:nth-child(4),
#viewInspecao .sheet-table td:nth-child(4) {
  width: auto;
}

#viewInspecao .sheet-table th:nth-child(5),
#viewInspecao .sheet-table td:nth-child(5) {
  width: 16%;
}

#viewInspecao .sheet-table select {
  width: 100%;
  min-height: 38px;
  padding: 8px;
}

.sheet-row-select {
  cursor: pointer;
}

.sheet-row-select:hover {
  background: #eff6ff;
}

.sheet-row-active {
  background: #dbeafe;
}

/* Filtro de forma na tabela */
.sheet-filter-row {
  padding: 6px 0 4px;
}
.sheet-filter-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #f8fafc;
  outline: none;
}
.sheet-filter-row input:focus {
  border-color: var(--accent);
  background: #fff;
}

/* Floating save bar — visível em inspeção em todos os tamanhos */
.ins-float-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid var(--line);
  padding: 10px 16px;
  z-index: 200;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.13);
}
.ins-float-salvar {
  width: 100%;
  font-size: 1rem;
  padding: 14px;
}
body.mode-inspecao .ins-float-bar {
  display: block;
}
body.mode-inspecao .container {
  padding-bottom: 80px;
}

/* ── Modal de resultado da inspeção ─────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.modal-visible {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  text-align: center;
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
  line-height: 1;
}
.modal-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: #0f172a;
}
.modal-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 22px;
}
.modal-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
}
.stat-ok  { background: #dcfce7; color: #166534; }
.stat-rr  { background: #fef9c3; color: #854d0e; }
.stat-r   { background: #fee2e2; color: #991b1b; }
.stat-label { text-align: left; }
.stat-count {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 60px;
  text-align: right;
}
.modal-ok {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
}

.concreto-tipo-options {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.concreto-tipo-option {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.concreto-tipo-option:hover,
.concreto-tipo-option:focus {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* ── Loading modal ───────────────────────────────────── */
.modal-box-loading {
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 300px;
}
.loading-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid #e2e8f0;
  border-top-color: #1e40af;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-msg {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
  text-align: center;
}

body.mode-liberacao .ins-related {
  display: none !important;
}

.lib-cell {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.lib-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.lib-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #0f172a;
  border-radius: 6px;
  padding: 18px 30px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  min-height: 72px;
  text-align: left;
}

.lib-btn-model {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}

.lib-btn-forma {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
}

tr.row-liberada td {
  background: #dcfce7 !important;
  border-color: #16a34a;
}

.lib-btn.active.btn-liberado {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}

.lib-btn.active.btn-nao {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.lib-btn.active.btn-manut {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.forma-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forma-grid.forma-grid-blocos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.forma-block-wrap {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px;
}

.forma-block-divider {
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #1e3a8a;
  background: #dbeafe;
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 6px;
  border: 1px solid #93c5fd;
}

.forma-block {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  min-width: 0;
}

.forma-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.forma-col-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e40af;
  padding: 4px 0 6px;
  border-bottom: 2px solid #1e40af;
  margin-bottom: 6px;
}

.forma-btn {
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  text-align: left;
  width: 100%;
  display: grid;
  grid-template-columns: 86px 128px;
  align-items: center;
  gap: 8px;
  justify-content: start;
}

.forma-numero {
  font-weight: 800;
  color: inherit;
  white-space: nowrap;
  text-align: left;
}

.forma-modelo {
  color: inherit;
  opacity: 0.9;
  font-size: 0.74rem;
  white-space: nowrap;
  width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.forma-btn:hover {
  background: #dbeafe;
}

.forma-btn:active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.95);
}

.forma-btn.clicked {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}

.forma-btn-done {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #166534 !important;
  opacity: 0.7;
  cursor: not-allowed;
}

.forma-btn-done:hover {
  background: #dcfce7 !important;
}

.btn-limpar {
  margin-top: 16px;
  width: 100%;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 0.85rem;
}

.btn-limpar:hover {
  background: #fde68a;
}

.acmp-total {
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.acmp-setor-grupo {
  margin-bottom: 16px;
}

.acmp-setor-header {
  font-weight: 700;
  font-size: 0.92rem;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  border-radius: 8px 8px 0 0;
  padding: 7px 10px;
}

.acmp-table {
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.acmp-table th:nth-child(1),
.acmp-table td:nth-child(1) {
  width: 9%;
}

.acmp-table th:nth-child(2),
.acmp-table td:nth-child(2) {
  width: 14%;
}

.acmp-table th:nth-child(3),
.acmp-table td:nth-child(3) {
  width: 9%;
}

.acmp-table th:nth-child(4),
.acmp-table td:nth-child(4),
.acmp-table th:nth-child(5),
.acmp-table td:nth-child(5) {
  width: auto;
}

.acmp-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 0.75rem;
  background: #fff;
}

.acmp-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-acmp-salvar {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
  font-weight: 700;
}

.btn-acmp-salvar:hover {
  background: #d1fae5;
}

.btn-acmp-imprimir {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1e3a8a;
  font-weight: 700;
}

.btn-acmp-imprimir:hover {
  background: #dbeafe;
}

@media print {
  body * {
    visibility: hidden;
  }
  #viewAcmpConcretagem,
  #viewAcmpConcretagem * {
    visibility: visible;
  }
  #viewAcmpConcretagem {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border: none;
    box-shadow: none;
  }
  .acmp-action-row,
  .section-title-row .btn-back,
  .btn-acmp-salvar,
  .btn-acmp-imprimir,
  #acmpFeedback,
  #acmpCarregar,
  .grid {
    display: none !important;
  }
  .acmp-input {
    border: none;
    background: transparent;
    padding: 0;
  }
}

.lib-feedback {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-align: center;
}

.lib-feedback.feedback-ok {
  background: #ecfdf5;
  border: 1px solid #34d399;
  color: #065f46;
}

.lib-feedback.feedback-error {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}

.thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.item-main {
  min-width: 0;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

/* ================================================
   PRODUCAO / LIBERACAO — PREMIUM OPERATIONAL UI
   ================================================ */

.lib-global-panel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.lib-global-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lib-global-fields label {
  margin-bottom: 0;
}

.lib-dual-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.lib-sector-block {
  border-radius: 14px;
  border: 2px solid #334155;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.lib-sector-1 {
  border-color: #1e40af;
}

.lib-sector-2 {
  border-color: #065f46;
}

.lib-sector-3 {
  border-color: #7c3aed;
}

.lib-sector-4 {
  border-color: #b45309;
}

.lib-sector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  gap: 8px;
}

.lib-sector-1 .lib-sector-header {
  background: linear-gradient(90deg, #1e40af 0%, #1d4ed8 100%);
  color: #ffffff;
}

.lib-sector-2 .lib-sector-header {
  background: linear-gradient(90deg, #065f46 0%, #047857 100%);
  color: #ffffff;
}

.lib-sector-3 .lib-sector-header {
  background: linear-gradient(90deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
}

.lib-sector-4 .lib-sector-header {
  background: linear-gradient(90deg, #b45309 0%, #d97706 100%);
  color: #ffffff;
}

.lib-sector-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.lib-sector-counter {
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  transition: background 0.2s;
}

.lib-sector-counter.counter-done {
  background: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.lib-sector-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px;
  background: #f8fafc;
}

.lib-sector-cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.lib-setor4-panel {
  margin-bottom: 14px;
}

.lib-forms-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* FORMA CARD */
.forma-card {
  position: relative;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  padding: 8px 4px;
  min-height: 54px;
  width: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background 0.1s, border-color 0.1s, transform 0.07s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-align: center;
  font-family: inherit;
  line-height: 1;
}

.forma-card:active:not(:disabled) {
  transform: scale(0.91);
}

.fc-number {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.fc-tipo {
  display: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 4px;
  text-align: center;
}

/* Setor 4: modelo como label — texto mais longo, fonte menor */
.lib-sector-4 .fc-number {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}

.fc-status {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  min-height: 1em;
}

.forma-card.is-idle {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1e293b;
}

.forma-card.is-idle:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(59,130,246,0.18);
}

.forma-card.is-saving {
  border-color: #818cf8;
  background: #eef2ff;
  color: #4338ca;
  cursor: wait;
  animation: forma-pulse 0.7s ease infinite;
}

.forma-card.is-saved {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
  cursor: default;
  opacity: 0.88;
}

.forma-card.is-liberada {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
  cursor: pointer;
  opacity: 0.95;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.forma-card.is-liberada:hover {
  background: #bfdbfe;
  border-color: #1d4ed8;
}


.forma-card.is-error {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
  animation: forma-shake 0.3s ease;
}

@keyframes forma-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes forma-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.lib-dummy-table { display: none; }

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-title {
    min-width: 0;
    font-size: 0.96rem;
  }

  .topbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .auth-user-badge {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar .sync-status {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
    text-align: center;
  }

  .page-content {
    padding: 10px 12px;
  }

  .container {
    padding: 0;
  }

  .card {
    padding: 12px;
    border-radius: 14px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title-row .btn-back {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-item {
    min-height: 108px;
  }

  .hub-icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hub-icon-btn {
    min-height: 132px;
    padding: 16px 10px 14px;
    gap: 10px;
  }

  .hub-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 0.85rem;
  }

  .hub-icon-lbl {
    font-size: 0.72rem;
  }

  .sheet-box,
  #viewInspecao .sheet-box,
  #viewMontagemPostes .sheet-box,
  #viewUsuarios .sheet-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sheet-table {
    min-width: 560px;
    table-layout: auto;
  }

  .sheet-table th,
  .sheet-table td {
    padding: 6px 7px;
    font-size: 0.74rem;
  }

  #viewMontagemPostes .sheet-box {
    overflow-x: visible;
  }

  #viewMontagemPostes .sheet-table {
    min-width: 0;
    border-collapse: separate;
  }

  #viewMontagemPostes .sheet-table thead {
    display: none;
  }

  #viewMontagemPostes .sheet-table tbody {
    display: grid;
    gap: 10px;
    justify-items: center;
  }

  #viewMontagemPostes .sheet-table tr {
    width: 100%;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] {
    display: block;
    width: min(100%, 420px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 30, 60, 0.06);
    padding: 12px 14px;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td {
    display: block;
    width: 100%;
    border: none;
    padding: 0;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td + td {
    margin-top: 8px;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
    text-align: center;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td:first-child {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--primary);
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td:nth-child(2) {
    color: #334155;
    font-weight: 600;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td:nth-child(3) {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1f2937;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td:last-child {
    margin-top: 12px;
  }

  #viewMontagemPostes .sheet-table tr[data-forma-numero] td:last-child .mp-open-btn {
    max-width: 320px;
    margin: 0 auto;
  }

  #viewMontagemPostes .sheet-table tr:not([data-forma-numero]) td {
    text-align: center;
    padding: 10px 8px;
  }

  .mp-detalhe-header {
    grid-template-columns: 1fr;
  }

  .mp-status-box {
    text-align: center;
  }

  .mp-status-title {
    text-align: center;
  }

  .mp-status-buttons {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
    justify-items: center;
  }

  .mp-status-btn,
  .mp-open-btn,
  #mpFinalizarPoste,
  .ug-form .btn {
    width: 100%;
  }

  #mpFinalizarPoste {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  #viewMontagemPostes .sheet-topline {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }

  #viewMontagemPostes .sheet-filter-row {
    justify-content: center;
  }

  #viewMontagemPostes #mpFormaFiltro {
    text-align: center;
  }

  /* ── Responsive Inspeção Setor 3 e 4 ──────────────── */
  #viewInspecao .sheet-box {
    overflow-x: visible;
    padding: 2px;
  }

  #viewInspecao .sheet-table {
    min-width: 0;
    border-collapse: separate;
  }

  #viewInspecao .sheet-table thead {
    display: none;
  }

  #viewInspecao .sheet-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    width: 100%;
  }

  #viewInspecao .sheet-table tr {
    width: 100%;
  }

  #viewInspecao .sheet-table tr[data-record-id] {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 30, 60, 0.06);
    padding: 12px 14px;
  }

  #viewInspecao .sheet-table tr[data-record-id] td {
    display: block;
    width: 100%;
    border: none;
    padding: 4px 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.88rem;
    border-bottom: 1px dashed #f1f5f9;
  }

  #viewInspecao .sheet-table tr[data-record-id] td[data-label="Status"],
  #viewInspecao .sheet-table tr[data-record-id] td[data-label="Código Recusa"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px dashed #f1f5f9;
  }

  #viewInspecao .sheet-table tr[data-record-id] td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
  }

  #viewInspecao .sheet-table tr[data-record-id] td[data-label="Status"]::before,
  #viewInspecao .sheet-table tr[data-record-id] td[data-label="Código Recusa"]::before {
    margin-bottom: 2px;
  }

  #viewInspecao .sheet-table tr[data-record-id] td:not([data-label="Status"]):not([data-label="Código Recusa"]) {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #viewInspecao .sheet-table tr[data-record-id] td:last-child {
    border-bottom: none;
  }

  #viewInspecao .sheet-table tr[data-record-id] td:first-child {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--primary);
  }

  #viewInspecao .sheet-table tr[data-record-id] td:first-child::before {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
  }

  #viewInspecao .sheet-table select {
    width: 100%;
    max-width: 100%;
    min-height: 38px;
    padding: 8px;
    font-size: 0.88rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #60a5fa;
  }

  #insSetorGroup {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  #insSetorGroup .sector-filter-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.78rem;
    text-align: center;
    white-space: nowrap;
  }

  #viewInspecao .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #viewInspecao .grid > label,
  #viewInspecao .grid > div {
    grid-column: span 2;
  }

  #viewInspecao .grid > label:nth-child(1),
  #viewInspecao .grid > label:nth-child(2) {
    grid-column: span 1;
  }

  #viewInspecao #insCarregarLiberados {
    width: 100%;
    margin-top: 8px;
  }

  .item {
    flex-direction: column;
  }

  .sheet-grid-wrap {
    grid-template-columns: 1fr 1fr;
  }

  .forma-btn {
    grid-template-columns: 78px 112px;
    gap: 6px;
  }

  .forma-modelo {
    width: 112px;
  }

  .checklist {
    grid-template-columns: 1fr;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .lib-dual-panel {
    grid-template-columns: 1fr;
  }

  .lib-sector-cols-3 {
    grid-template-columns: 1fr;
  }

  .lib-global-fields {
    grid-template-columns: 1fr;
  }

  .lib-sector-cols {
    gap: 3px;
    padding: 6px;
  }

  .forma-card {
    min-height: 50px;
    padding: 6px 3px;
  }

  .fc-number {
    font-size: 0.88rem;
  }

  .forma-grid.forma-grid-blocos {
    gap: 6px;
  }

  .dash-row {
    grid-template-columns: 56px 1fr 34px;
    gap: 6px;
  }

  #viewInspecao .sheet-table {
    min-width: 0;
    font-size: 0.82rem;
  }

  #viewInspecao .sheet-table th,
  #viewInspecao .sheet-table td {
    padding: 7px 6px;
  }

  #viewInspecao .sheet-table input[type="text"] {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .sidebar-toggle-btn {
    width: 34px;
    height: 34px;
  }

  .topbar-title {
    font-size: 0.9rem;
  }

  .auth-user-badge,
  .auth-logout-btn {
    font-size: 0.74rem;
  }

  .card h2,
  .section-title-row h2 {
    font-size: 1.02rem;
  }

  .login-card {
    width: 100%;
    min-height: calc(100dvh - 32px);
    border-radius: 24px;
  }

  .login-card-splash {
    padding: 26px 18px 18px;
  }

  .login-card-panel {
    padding: 18px 18px 20px;
  }

  .login-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .login-card h1 {
    font-size: 1.24rem;
  }

  .login-card p {
    font-size: 0.86rem;
  }

  .hub-icon-grid {
    gap: 8px;
  }

  .hub-icon-btn {
    min-height: 120px;
    padding: 14px 8px 12px;
  }

  .hub-icon-circle {
    width: 46px;
    height: 46px;
    font-size: 0.78rem;
  }

  .hub-icon-lbl {
    font-size: 0.68rem;
  }

  input,
  select,
  textarea,
  .btn {
    font-size: 16px;
  }
}

/* ── Hub Início — ícones 3 colunas ───────────────── */
.hub-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px 0;
}
.hub-icon-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
}
.hub-icon-btn:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: #94a3b8;
  transform: translateY(-2px);
}
.hub-icon-btn:active { transform: translateY(0); }
.hub-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
.hub-icon-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  line-height: 1.3;
}
@media (max-width: 480px) {
  .hub-icon-grid { gap: 10px; }
  .hub-icon-circle { width: 52px; height: 52px; font-size: 0.85rem; }
}

/* ── Dashboard — KPI, charts, history ───────────── */
.db-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.db-toolbar-label {
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-toolbar-label input {
  font-size: 0.85rem;
  padding: 7px 10px;
}
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .db-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .db-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
.db-kpi-card {
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}
.db-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.db-kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.db-kpi-prod { background: #eff6ff; color: #1d4ed8; }
.db-kpi-ins  { background: #f0fdfa; color: #0f766e; }
.db-kpi-ok   { background: #dcfce7; color: #166534; }
.db-kpi-r    { background: #fee2e2; color: #991b1b; }
.db-kpi-rr   { background: #fef9c3; color: #854d0e; }
.db-kpi-pct  { background: #fdf2f8; color: #9d174d; }

.db-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .db-charts-row { grid-template-columns: 1fr; }
}
.db-charts-row-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .db-charts-row-equal { grid-template-columns: 1fr; }
}
.db-chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.db-chart-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}
.db-chart-wrap {
  position: relative;
  height: 240px;
}
.db-hist-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.db-hist-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}

/* ── Page filter card ─────────────────────────── */
.page-fc {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.page-fc-grid label { margin-bottom: 0; }
.btn-row-full {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
}
.acmp-bar {
  flex-direction: row;
  align-items: flex-end;
  flex-wrap: wrap;
}
.acmp-bar label { margin-bottom: 0; flex: 1; min-width: 120px; }
.acmp-action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.acmp-action-row .btn {
  flex: 1;
  font-size: 0.9rem;
  padding: 11px;
}

/* ── Acompanhamento KPI cards ─────────────────── */
.acmp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.acmp-kpi {
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
}
.acmp-kpi-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.acmp-kpi-val {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.acmp-kpi-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Dashboard Montagem - mobile first */
#viewMontagemIndicadores {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 12px;
  background: #f6f8fb;
}
.mi-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -12px -12px 12px;
  padding: 12px;
  background: rgba(246, 248, 251, 0.96);
  border-bottom: 1px solid #dbe3ee;
  backdrop-filter: blur(10px);
}
.mi-topbar h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.1rem;
  line-height: 1.15;
  font-weight: 850;
}
.mi-topbar p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
}
.mi-topbar-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.mi-icon-btn,
.mi-secondary-btn,
.mi-primary-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}
.mi-icon-btn {
  background: #fff;
  color: #1e293b;
}
.mi-icon-btn-primary,
.mi-primary-btn {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}
.mi-secondary-btn {
  background: #e2e8f0;
  color: #475569;
}
.mi-primary-btn {
  flex: 1;
}
.mi-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}
.mi-drawer-overlay.hidden {
  display: none !important;
}
.mi-drawer-content {
  width: 100%;
  max-width: 420px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.22);
}
.mi-drawer-header,
.mi-drawer-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-color: #e2e8f0;
}
.mi-drawer-header {
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}
.mi-drawer-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
}
.mi-drawer-close-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.mi-drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
}
.mi-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mi-drawer-field label {
  color: #475569;
  font-size: 0.79rem;
  font-weight: 750;
}
.mi-drawer-footer {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.mi-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 6px;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mi-tabs-bar::-webkit-scrollbar {
  display: none;
}
.mi-tab-btn {
  min-height: 38px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.mi-tab-btn.active {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
}
.mi-tab-section {
  display: none;
}
.mi-tab-section.active {
  display: block;
}
.mi-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mi-kpi-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mi-kpi-programado { border-left-color: #2563eb; }
.mi-kpi-realizado { border-left-color: #4f46e5; }
.mi-kpi-atingimento { border-left-color: #059669; }
.mi-kpi-dia { border-left-color: #d97706; }
.mi-kpi-aprovados { border-left-color: #16a34a; }
.mi-kpi-recusados { border-left-color: #dc2626; }
.mi-kpi-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}
.mi-kpi-val {
  color: #0f172a;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 850;
  word-break: break-word;
}
.mi-section-heading {
  margin: 18px 0 10px;
  color: #172033;
  font-size: 0.95rem;
  font-weight: 850;
}
.mi-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.mi-chart-card,
.mi-listagem-wrap {
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.mi-chart-card {
  padding: 12px;
}
.mi-chart-title {
  margin-bottom: 10px;
  color: #172033;
  font-size: 0.88rem;
  font-weight: 850;
}
.mi-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(230px, 68vw, 320px);
}
.mi-progress-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.mi-progress-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  color: #475569;
  font-size: 0.84rem;
}
.mi-progress-track,
.mi-sector-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.mi-progress-fill,
.mi-sector-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.35s ease;
}
.mi-progress-pct {
  color: #1d4ed8;
  font-size: 1.45rem;
  font-weight: 850;
  text-align: right;
}
.mi-sector-progress-list,
.mi-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mi-sector-row,
.mi-ranking-row {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.mi-sector-meta,
.mi-ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 0.82rem;
}
.mi-sector-name,
.mi-ranking-name {
  min-width: 0;
  color: #172033;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.mi-sector-numbers,
.mi-ranking-value {
  flex: 0 0 auto;
  font-weight: 850;
}
.mi-ranking-value {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.76rem;
}
.mi-ranking-value strong {
  border-radius: 6px;
  padding: 3px 8px;
  background: #eff6ff;
  color: #1d4ed8;
}
.mi-sector-fill {
  background: #059669;
}
.mi-listagem-wrap {
  margin-top: 14px;
  padding: 12px;
}
.mi-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mi-list-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 850;
}
.mi-list-header span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f7;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
}
.mi-table-responsive {
  display: none;
}
.mi-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.mi-table th,
.mi-table td {
  padding: 10px;
  text-align: center;
}
.mi-table th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  cursor: pointer;
}
.mi-table tr {
  border-bottom: 1px solid #f1f5f9;
}
.mi-cards-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mi-mobile-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}
.mi-mobile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.mi-mobile-title {
  min-width: 0;
  color: #0f172a;
  font-size: 0.93rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.mi-mobile-subtitle {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.mi-status-pill {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}
.mi-status-a { background: #dcfce7; color: #166534; }
.mi-status-r { background: #fee2e2; color: #991b1b; }
.mi-status-rr { background: #fef3c7; color: #92400e; }
.mi-status-open { background: #e2e8f0; color: #475569; }
.mi-mobile-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
}
.mi-mobile-field {
  min-width: 0;
}
.mi-mobile-field span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}
.mi-mobile-field strong {
  display: block;
  margin-top: 2px;
  color: #172033;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.mi-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.mi-pagination-info {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}
.mi-pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mi-page-btn {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.mi-page-btn.active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}
.mi-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 340px) {
  #viewMontagemIndicadores {
    padding: 10px;
  }
  .mi-topbar {
    margin: -10px -10px 10px;
    padding: 10px;
  }
  .mi-icon-btn {
    padding: 0 9px;
    font-size: 0.76rem;
  }
  .mi-tab-btn {
    font-size: 0.72rem;
  }
  .mi-kpi-card {
    padding: 10px;
  }
  .mi-kpi-val {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  #viewMontagemIndicadores {
    padding: 20px;
  }
  .mi-topbar {
    position: static;
    margin: 0 0 16px;
    padding: 0 0 14px;
    background: transparent;
    backdrop-filter: none;
  }
  .mi-topbar h2 {
    font-size: 1.35rem;
  }
  .mi-kpis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .mi-kpi-card {
    padding: 16px;
  }
  .mi-kpi-val {
    font-size: 1.75rem;
  }
  .mi-charts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .mi-chart-card-wide {
    grid-column: 1 / -1;
  }
  .mi-chart-canvas-wrap {
    height: 300px;
  }
  .mi-table-responsive {
    display: block;
    overflow-x: auto;
  }
  .mi-cards-mobile-list {
    display: none;
  }
  .mi-progress-meta {
    grid-template-columns: repeat(2, 1fr);
  }
  .mi-tabs-bar {
    display: none;
  }
  .mi-tab-section {
    display: block;
    margin-top: 18px;
  }
}

@media (min-width: 1024px) {
  #viewMontagemIndicadores {
    padding: 24px;
  }
  .mi-chart-canvas-wrap {
    height: 320px;
  }
  .mi-kpis-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1366px) {
  .mi-charts-row {
    gap: 20px;
  }
  .mi-chart-card,
  .mi-listagem-wrap {
    padding: 16px;
  }
}

@media (min-width: 1920px) {
  #viewMontagemIndicadores {
    max-width: 1680px;
    margin-inline: auto;
  }
}
.acmp-kpi-s1  { background: #eff6ff; color: #1d4ed8; }
.acmp-kpi-s2  { background: #ecfdf5; color: #065f46; }
.acmp-kpi-s3  { background: #f5f3ff; color: #5b21b6; }
.acmp-kpi-s4  { background: #fff7ed; color: #9a3412; }
.acmp-kpi-tot { background: #fef9c3; color: #854d0e; }

/* ── Layout desktop: Relatórios e Histórico ───────────────── */
.desktop-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.page-fc-sticky {
  margin-bottom: 0;
}

.report-box-lg,
.hist-list-lg {
  margin-top: 0;
  min-height: 420px;
}

.hist-list-lg .item {
  border-radius: 12px;
  padding: 12px;
}

@media (min-width: 1280px) {
  #viewRelatorio,
  #viewHistorico {
    padding: 18px;
  }

  .desktop-split {
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
  }

  .desktop-split-left .page-fc-sticky {
    position: sticky;
    top: 86px;
  }

  .desktop-split-right {
    min-width: 0;
  }

  .report-box-lg,
  .hist-list-lg {
    min-height: 600px;
    max-height: calc(100vh - 210px);
    overflow: auto;
    padding: 14px;
  }

  .hist-list-lg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1600px) {
  .desktop-split {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .hist-list-lg {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Dashboard — sections dividers ───────────────── */
.db-section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.db-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
  flex-shrink: 0;
}
.db-section-lbl {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

/* Full-width chart row */
.db-charts-row-full {
  display: grid;
  grid-template-columns: 1fr;
}

/* Taller wrap for NC horizontal bar */
.db-chart-wrap-nc {
  position: relative;
  height: 300px;
}

.mp-open-btn {
  min-width: 140px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  font-size: 0.88rem;
}

.mp-open-btn:hover {
  background: #c55a14;
}

.mp-open-btn.mp-open-btn--review {
  background: #16a34a;
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body.print-relatorio {
    background: #fff !important;
  }

  body.print-relatorio * {
    visibility: hidden !important;
  }

  body.print-relatorio #relatorioSetorOutput,
  body.print-relatorio #relatorioSetorOutput * {
    visibility: visible !important;
  }

  body.print-relatorio #relatorioSetorOutput {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
  }

  body.print-relatorio .rel-print-doc {
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  body.print-relatorio .rel-table-wrap {
    overflow: visible !important;
  }

  body.print-relatorio .report-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 7pt !important;
  }

  body.print-relatorio .report-table th,
  body.print-relatorio .report-table td {
    border: 1px solid #cbd5e1 !important;
    padding: 3px 4px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    line-height: 1.18 !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(1),
  body.print-relatorio .rel-full-table td:nth-child(1) {
    width: 12% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(2),
  body.print-relatorio .rel-full-table td:nth-child(2) {
    width: 24% !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(3),
  body.print-relatorio .rel-full-table td:nth-child(3) {
    width: 22% !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(4),
  body.print-relatorio .rel-full-table td:nth-child(4) {
    width: 10% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(5),
  body.print-relatorio .rel-full-table td:nth-child(5) {
    width: 10% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(6),
  body.print-relatorio .rel-full-table td:nth-child(6) {
    width: 22% !important;
  }

  body.print-relatorio .rel-summary-table th:nth-child(2),
  body.print-relatorio .rel-summary-table td:nth-child(2) {
    width: 80px !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-summary-table th:nth-child(4),
  body.print-relatorio .rel-summary-table td:nth-child(4) {
    width: 80px !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-kpi-grid {
    display: block !important;
    margin: 8px 0 12px !important;
    padding: 6px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    break-inside: avoid;
  }

  body.print-relatorio .rel-kpi-grid > div {
    display: inline !important;
    margin: 0 18px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body.print-relatorio .rel-kpi-grid span,
  body.print-relatorio .rel-kpi-grid strong {
    display: inline !important;
    margin: 0 !important;
    font-size: 9pt !important;
    color: #0f172a !important;
  }

  body.print-relatorio .rel-kpi-grid span::after {
    content: ": ";
  }

  body.print-relatorio .rel-print-header,
  body.print-relatorio .rel-summary-section {
    break-inside: avoid;
  }

  body.print-relatorio .rel-print-footer {
    margin-top: 52px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-relatorio .rel-sign-block {
    min-height: 40px !important;
    max-width: 420px !important;
    margin-top: 80px !important;
  }
}

.mp-open-btn.mp-open-btn--review:hover {
  background: #15803d;
}

.mp-open-btn.mp-open-btn--inspecionado {
  background: var(--primary-light);
}

.mp-open-btn.mp-open-btn--inspecionado:hover {
  background: var(--primary);
}

/* Montagem Postes — table column sizing + alignment */
#viewMontagemPostes .sheet-table th,
#viewMontagemPostes .sheet-table td {
  text-align: center;
  vertical-align: middle;
}

#viewMontagemPostes .sheet-table th:nth-child(1),
#viewMontagemPostes .sheet-table td:nth-child(1),
#viewMontagemPostes .sheet-table th:nth-child(2),
#viewMontagemPostes .sheet-table td:nth-child(2),
#viewMontagemPostes .sheet-table th:nth-child(3),
#viewMontagemPostes .sheet-table td:nth-child(3) {
  width: 90px;
  max-width: 90px;
  white-space: nowrap;
}

#viewMontagemPostes .sheet-table th:nth-child(4),
#viewMontagemPostes .sheet-table td:nth-child(4) {
  min-width: 160px;
  width: 160px;
}

.mp-detalhe-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 14px;
}

.mp-checklist-wrap {
  display: grid;
  gap: 12px;
}

.mp-status-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}

.mp-status-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.mp-status-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-status-btn {
  background: #fff;
  border: 1px solid #94a3b8;
  color: #334155;
  font-weight: 700;
}

.mp-status-btn.active[data-mp-status="A"],
.mp-status-btn.active[data-ins-status="A"] {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

.mp-status-btn.active[data-mp-status="R"],
.mp-status-btn.active[data-ins-status="R"] {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.mp-status-btn.active[data-mp-status="RR"],
.mp-status-btn.active[data-ins-status="RR"] {
  background: #fef9c3;
  border-color: #eab308;
  color: #854d0e;
}

.mp-motivo-wrap {
  margin-top: 10px;
}

.mp-resumo-body {
  text-align: left;
  display: grid;
  gap: 6px;
  color: #1e293b;
  font-size: 0.9rem;
}

.mp-checklist-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.mp-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  background: #f0f4f8;
  border-radius: 8px;
  padding: 8px 12px;
  margin-left: -12px;
  margin-right: -12px;
  margin-top: -12px;
}

.mp-checklist-header strong {
  color: #1e40af;
  font-size: 0.9rem;
}

.mp-checklist-flag {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
}

.mp-checklist-flag.ok {
  background: #dcfce7;
  color: #166534;
}

.mp-checklist-flag.pendente {
  background: #fee2e2;
  color: #991b1b;
}

.mp-checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed #e2e8f0;
}

.mp-checklist-item:first-of-type {
  border-top: none;
}

.mp-checklist-item-text {
  font-weight: 600;
  color: #1e293b;
}

.mp-yn-group {
  display: inline-flex;
  gap: 6px;
}

.mp-yn-btn {
  border: 1px solid #94a3b8;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  min-width: 58px;
  padding: 7px 10px;
  font-weight: 700;
  cursor: pointer;
}

.mp-yn-btn.active[data-mp-value="sim"] {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

.mp-yn-btn.active[data-mp-value="nao"] {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.mp-finalizar-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

#mpFinalizarPoste {
  width: 100%;
  max-width: 400px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
}

@media (max-width: 700px) {
  .mp-checklist-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .mp-open-btn {
    min-width: 110px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

/* Gestão de Usuários */
.ug-form {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.ug-form h3,
.ug-list-wrap h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 12px;
}

.ug-list-wrap {
  margin-top: 4px;
}

.ug-del-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.ug-del-btn:hover {
  background: #fecaca;
}

/* ================================================
   KIOSK MODE PREMIUM FOR SECTORS 1, 2, 3
   ================================================ */
body.kiosk-active .sidebar {
  display: none !important;
}
body.kiosk-active .topbar {
  display: none !important;
}
body.kiosk-active .app-main {
  margin-left: 0 !important;
}

/* ── Fixed Sidebar Desktop / Collapsible via Button ── */
@media (min-width: 769px) {
  .sidebar {
    transform: none; /* Fixed by default on PC */
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .app-main {
    margin-left: 240px; /* Takes up space by default on PC */
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* When hidden via toggle button on PC */
  body.sidebar-hidden .sidebar {
    transform: translateX(-240px);
  }
  body.sidebar-hidden .app-main {
    margin-left: 0;
  }

  /* Inspection float bar adjustment */
  body.mode-inspecao .ins-float-bar {
    left: 240px;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sidebar-hidden.mode-inspecao .ins-float-bar {
    left: 0;
  }
}
body.kiosk-active .page-content {
  padding: 40px !important;
  max-width: 100% !important;
  width: 100% !important;
}
body.kiosk-active .container {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Kiosk Specific View Header */
.kiosk-header {
  display: none;
  background: linear-gradient(135deg, #0f1e3c 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 24px 32px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(15, 30, 60, 0.15);
  position: relative;
  overflow: hidden;
}

body.kiosk-active .kiosk-header {
  display: block;
}

/* Ocultar título padrão e painel global no modo quiosque */
body.kiosk-active #viewLiberacao > .section-title-row,
body.kiosk-active #viewLiberacao > .lib-global-panel,
body.kiosk-active #viewLiberacao > .btn-limpar {
  display: none !important;
}

.kiosk-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.kiosk-title-group {
  display: flex;
  flex-direction: column;
}

.kiosk-subtitle {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  font-weight: 600;
}

.kiosk-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 4px 0 0 0;
  letter-spacing: -0.02em;
}

.kiosk-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-kiosk {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-kiosk:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-kiosk.primary {
  background: #2563eb;
  border-color: #3b82f6;
}

.btn-kiosk.primary:hover {
  background: #1d4ed8;
}

.btn-kiosk.back {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-kiosk.back:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}

/* Kiosk Global Fields */
.kiosk-fields-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 24px;
  align-items: end;
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .kiosk-fields-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.kiosk-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kiosk-field label {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kiosk-input {
  font-size: 1.5rem !important; /* FONTE AUMENTADA DO OPERADOR E DATA */
  font-weight: 700 !important;
  color: #ffffff !important;
  background: rgba(15, 30, 60, 0.6) !important;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  padding: 12px 18px !important;
  height: auto !important;
  width: 100%;
}

.kiosk-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4) !important;
  outline: none;
}

select.kiosk-input {
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 18px center !important;
  background-size: 1.4rem !important;
  padding-right: 46px !important;
  cursor: pointer;
}

.kiosk-input option {
  background-color: #0f1e3c !important; /* Premium dark background */
  color: #ffffff !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
}

#libColaborador {
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 1.1rem !important;
  padding-right: 40px !important;
  background-color: #ffffff !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 10px !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  cursor: pointer;
}

#libColaborador:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
  outline: none;
}

#libColaborador option {
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}

/* Switch e Toggle Switch de Programação */
.kiosk-toggle-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px dashed rgba(245, 158, 11, 0.25);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.kiosk-toggle-field:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
}

.kiosk-toggle-field.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.kiosk-toggle-label {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.kiosk-toggle-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fef3c7;
}

.kiosk-toggle-subtitle {
  font-size: 0.76rem;
  color: #fcd34d;
  opacity: 0.9;
}

.kiosk-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  margin: 0;
}

.kiosk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.kiosk-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.25);
  transition: .3s;
  border-radius: 34px;
}

.kiosk-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.kiosk-switch input:checked + .kiosk-slider {
  background-color: #f59e0b;
}

.kiosk-switch input:checked + .kiosk-slider:before {
  transform: translateX(24px);
}

/* Custom styling for the Modo Liberação toggle button when active (Neon Orange) */
#kioskLibToggleField.active {
  background: rgba(255, 95, 0, 0.25) !important; /* Neon orange tint */
  border-color: #ff5f00 !important; /* Neon orange border */
  animation: pulse-border-orange 1.2s infinite !important;
}

#kioskLibToggleField.active .kiosk-toggle-title {
  color: #ffa94d !important; /* Light neon orange title */
}

#kioskLibToggleField.active .kiosk-toggle-subtitle {
  color: #ffffff !important;
}

#kioskLibCheckbox:checked + .kiosk-slider {
  background-color: #ff5f00 !important;
  box-shadow: 0 0 10px rgba(255, 95, 0, 0.6);
}

@keyframes pulse-border-orange {
  0% { box-shadow: 0 0 0 0 rgba(255, 95, 0, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 95, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 95, 0, 0); }
}

/* Custom styling for the Modo Programar toggle button when active (Neon Yellow) */
#kioskProgToggleField.active {
  background: rgba(250, 204, 21, 0.25) !important; /* Neon yellow tint */
  border-color: #facc15 !important; /* Neon yellow border */
  animation: pulse-border-yellow 1.2s infinite !important;
}

#kioskProgToggleField.active .kiosk-toggle-title {
  color: #fef08a !important; /* Light neon yellow title */
}

#kioskProgToggleField.active .kiosk-toggle-subtitle {
  color: #ffffff !important;
}

#kioskProgCheckbox:checked + .kiosk-slider {
  background-color: #facc15 !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
}

@keyframes pulse-border-yellow {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* Ampliação das colunas e grids no modo quiosque */
body.kiosk-active .lib-dual-panel {
  grid-template-columns: 1fr !important;
  gap: 24px;
}

body.kiosk-active .lib-sector-block {
  border-radius: 16px !important;
  border-width: 3px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

body.kiosk-active .lib-sector-header {
  padding: 18px 24px !important;
}

body.kiosk-active .lib-sector-title {
  font-size: 1.3rem !important;
  letter-spacing: 0.1em;
}

body.kiosk-active .lib-sector-counter {
  font-size: 1.1rem !important;
  padding: 5px 14px !important;
}

body.kiosk-active .lib-sector-cols {
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  padding: 24px !important;
  background: #f1f5f9 !important;
}

/* Card das formas ampliado para o Quiosque */
body.kiosk-active .forma-card {
  min-height: 84px !important;
  border-width: 3px !important;
  border-radius: 14px !important;
  padding: 14px 10px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
}

body.kiosk-active .forma-card .fc-number {
  font-size: 1.4rem !important;
  font-weight: 900 !important;
}

body.kiosk-active .forma-card .fc-tipo {
  font-size: 0.9rem !important;
  padding: 4px 10px !important;
  margin-top: 6px !important;
  border-radius: 8px !important;
}

body.kiosk-active .forma-card .fc-status {
  font-size: 1.1rem !important;
}

/* Destaque para formas programadas */
.forma-card.is-programmed:not(.is-saved):not(.is-saving):not(.is-liberada) {
  border-color: #d97706 !important; /* Cor âmbar premium */
  background: #fef3c7 !important;
  color: #92400e !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18) !important;
}

.forma-card.is-programmed:not(.is-saved):not(.is-saving):not(.is-liberada):hover {
  background: #fde68a !important;
  border-color: #b45309 !important;
  color: #78350f !important;
}

/* ================================================
   SETOR 4 MULTI-SECTION PREMIUM LAYOUT
   ================================================ */
.s4-layout-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.s4-section-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e3a8a;
  padding: 12px 20px;
  background: #eff6ff;
  border-left: 6px solid #3b82f6;
  border-radius: 8px;
  margin-top: 14px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.s4-mapa-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.s4-mapa-container-2col {
  grid-template-columns: 1fr 1fr !important;
}

@media (max-width: 1024px) {
  .s4-mapa-container,
  .s4-mapa-container-2col {
    grid-template-columns: 1fr !important;
  }
}

.s4-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.s4-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.s4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.s4-table th,
.s4-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.s4-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.s4-table tr:last-child td {
  border-bottom: none;
}

.s4-forma-cell {
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.15s ease;
  text-align: center;
}

.s4-forma-cell:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.s4-forma-cell.is-saved {
  background: #dcfce7 !important;
  color: #166534 !important;
  font-weight: 800;
}

.s4-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.75rem;
}

.s4-legend-header {
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  font-size: 0.7rem;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
}

.s4-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  margin: 10px 0 6px 0;
  border-bottom: 2px solid #cbd5e1;
  padding-bottom: 4px;
}

.s4-usina-box {
  background: #cbd5e1;
  color: #1e293b;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  border: 2px dashed #94a3b8;
}


/* ── Setor 4 Quiosque Premium Layout ── */
body.kiosk-active .lib-sector-4 {
  border-color: #b45309 !important;
}

body.kiosk-active #libSetor4Cols {
  display: block !important;
  width: 100% !important;
  padding: 20px !important;
  background: #f8fafc !important;
}

body.kiosk-active .s4-layout-wrapper {
  gap: 20px !important;
  width: 100% !important;
}

body.kiosk-active .s4-mapa-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 18px !important;
  width: 100% !important;
}

body.kiosk-active .s4-col {
  gap: 16px !important;
}

body.kiosk-active .s4-table-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05) !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff !important;
}

body.kiosk-active .s4-table {
  font-size: 1.15rem !important;
  width: 100% !important;
}

body.kiosk-active .s4-table th {
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  padding: 16px 12px !important;
  background: #f1f5f9 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body.kiosk-active .s4-table td {
  padding: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

body.kiosk-active .s4-forma-cell {
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  padding: 18px 12px !important;
  text-align: center !important;
  vertical-align: middle !important;
  cursor: pointer !important;
  background: #f8fafc !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

body.kiosk-active .s4-forma-cell:hover {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

body.kiosk-active .s4-forma-cell.is-saved {
  background: #dcfce7 !important;
  color: #15803d !important;
}

body.kiosk-active .s4-table td:nth-child(2) {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  text-align: center !important;
  vertical-align: middle !important;
  padding: 18px 12px !important;
  background: #ffffff !important;
  white-space: nowrap !important;
}

/* ── Sector filter button group ── */
.sector-btn-group {
  display: inline-flex;
  gap: 8px;
  margin-top: 4px;
}
.sector-filter-btn {
  padding: 8px 16px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  transition: all 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
}
.sector-filter-btn:hover {
  background: #e2e8f0;
}
.sector-filter-btn.active {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent-dark) !important;
}

/* ── Mounted post list items (green) ── */
tr.row-montado {
  background-color: #ecfdf5 !important;
}
.btn-montado {
  background-color: #10b981 !important;
  color: white !important;
  border-color: #059669 !important;
  pointer-events: none;
}

/* ── Advanced montagem checklist styles ── */
.mp-checklist-item-wrapper {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 6px;
}
.mp-checklist-item-wrapper:last-child {
  border-bottom: none;
}
.mp-checklist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.critico-dot {
  font-size: 0.85rem;
  margin-right: 4px;
}
.mp-yn-group {
  display: flex;
  gap: 6px;
}
.mp-yn-group .mp-yn-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mp-yn-group .mp-yn-btn:hover {
  background: #e2e8f0;
}
.mp-yn-group .mp-yn-btn.btn-aprovado.active {
  background: #10b981 !important;
  color: white !important;
  border-color: #059669 !important;
}
.mp-yn-group .mp-yn-btn.btn-reprovado.active {
  background: #ef4444 !important;
  color: white !important;
  border-color: #b91c1c !important;
}
.mp-reprovado-actions {
  margin-top: 10px;
  padding: 10px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px dashed #fca5a5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-photo-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.mp-photo-upload-label:hover {
  background: #fff5f5;
}
.mp-photo-upload-label input[type="file"] {
  display: none;
}
.mp-item-photo-preview {
  display: flex;
  align-items: center;
}
.mp-item-photo-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.mp-segregar-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.82rem;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  align-self: flex-start;
}

/* Premium Status Badges for Montagem Postes list */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.status-badge-aprovado {
  background-color: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}
.status-badge-reprovado {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}

/* ── Botões Ricos: Tipo de Concreto ──────────────────── */

.btn-concreto-rich {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s, filter 0.2s;
  width: 100%;
}

.btn-concreto-rich:hover {
  filter: brightness(0.95);
}

.btn-concreto-rich:active {
  transform: scale(0.98);
}

.btn-concreto-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-concreto-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-concreto-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: inherit;
}

.btn-concreto-desc {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 500;
}

.concreto-opt-padrao {
  background-color: #eef5e5;
  color: #1b4d1b;
}

.concreto-opt-seco {
  background-color: #fceceb;
  color: #5c1816;
}

.concreto-opt-segregado {
  background-color: #fcefdc;
  color: #5c3a12;
}

.concreto-opt-exsudado {
  background-color: #eaf3fd;
  color: #0b345e;
}

/* ── Módulo de Análise de Produtividade ────────────────────────── */
.pa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.pa-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.pa-alerts-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.pa-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.pa-alert-warning {
  background-color: #fffbeb;
  border-color: #fef08a;
  color: #713f12;
}

.pa-alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.badge-parada {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  width: 90px;
}

.badge-verde {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-amarelo {
  background-color: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.badge-vermelho {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- LAYOUT DE PRODUTIVIDADE E GLOSSÁRIO --- */
.pa-kpi-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
}
.pa-kpi-icon {
  font-size: 1.4rem;
  background: rgba(0,0,0,0.03);
  padding: 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Glossário */
.pa-glossary-panel {
  padding: 24px;
  margin-top: 32px;
  color: #334155;
}
.pa-glossary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pa-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.pa-glossary-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.pa-glossary-item h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pa-glossary-item p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

/* --- REFINAMENTOS DE UI E MOBILE PARA PRODUTIVIDADE --- */
.pa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.pa-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.pa-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

#viewProdAnalise {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 12px;
  background: #f6f8fb;
}
#viewProdAnalise *,
#viewProdAnalise *::before,
#viewProdAnalise *::after {
  box-sizing: border-box;
}
.pa-topbar {
  margin: -12px -12px 12px;
}
.pa-topbar .mi-topbar-actions {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pa-topbar .mi-icon-btn {
  min-width: 0;
  padding-inline: 9px;
}
.pa-tab-section {
  display: none;
}
.pa-tab-section.active {
  display: block;
}
.pa-tabs-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pa-tabs-bar::-webkit-scrollbar {
  display: none;
}
.pa-tabs-bar .mi-tab-btn {
  min-width: 0;
  padding-inline: 8px;
  overflow: visible;
}
.pa-kpis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pa-kpis-grid .mi-kpi-card {
  min-width: 0;
  min-height: 92px;
}
.pa-kpis-grid .mi-kpi-val,
.pa-kpis-grid .db-kpi-sub {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal !important;
}
.pa-kpis-grid .db-kpi-sub {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}
.pa-drawer-footer {
  flex-wrap: wrap;
}
.pa-drawer-footer .mi-primary-btn {
  flex-basis: 100%;
}
.pa-table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pa-table-wrap .mi-table {
  width: 100%;
  table-layout: fixed;
}
.pa-table-wrap .mi-table th:nth-child(1),
.pa-table-wrap .mi-table td:nth-child(1) {
  width: 70px;
}
.pa-table-wrap .mi-table th:nth-child(2),
.pa-table-wrap .mi-table td:nth-child(2) {
  width: 120px;
}
.pa-table-wrap .mi-table th:nth-child(3),
.pa-table-wrap .mi-table td:nth-child(3) {
  width: 220px;
}
.pa-table-wrap .mi-table th:nth-child(4),
.pa-table-wrap .mi-table td:nth-child(4) {
  width: 80px;
}
.pa-table-wrap .mi-table th:nth-child(5),
.pa-table-wrap .mi-table td:nth-child(5) {
  width: 140px;
}
.pa-volume-sector-list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pa-volume-sector-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.pa-volume-sector-head,
.pa-volume-sector-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  font-size: 0.82rem;
}
.pa-volume-sector-head strong {
  color: #0f172a;
}
.pa-volume-sector-track {
  display: flex;
  height: 12px;
  min-width: 8px;
  max-width: 100%;
  overflow: hidden;
  margin: 8px 0;
  border-radius: 999px;
  background: #e2e8f0;
}
.pa-volume-padrao {
  background: #2563eb;
}
.pa-volume-fora {
  background: #dc2626;
}
.pa-journey-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.pa-journey-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}
.pa-journey-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #172033;
  font-size: 0.9rem;
}
.pa-journey-card-head span {
  color: #2563eb;
  font-weight: 850;
}
.pa-journey-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 10px;
}
.pa-journey-card-grid span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}
.pa-journey-card-grid strong {
  display: block;
  margin-top: 2px;
  color: #172033;
  font-size: 0.88rem;
}

@media (min-width: 768px) {
  #viewProdAnalise {
    padding: 20px;
  }
  .pa-topbar {
    margin: 0 0 16px;
  }
  .pa-tabs-bar {
    display: none;
  }
  .pa-tab-section {
    display: block;
    margin-top: 18px;
  }
  .pa-kpis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pa-journey-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pa-journey-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  #viewProdAnalise {
    padding: 10px;
  }
  .pa-topbar {
    margin: -10px -10px 10px;
    padding: 10px;
  }
  .pa-topbar .mi-icon-btn {
    padding-inline: 7px;
    font-size: 0.72rem;
  }
  .pa-tabs-bar {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
  }
  .pa-tabs-bar .mi-tab-btn {
    font-size: 0.7rem;
    padding-inline: 6px;
  }
  .pa-kpis-grid .mi-kpi-card {
    padding: 10px;
  }
  .pa-kpis-grid .mi-kpi-val {
    font-size: 1.18rem;
  }
}

@media (min-width: 1024px) {
  #viewProdAnalise {
    padding: 24px;
  }
  .pa-kpis-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .pa-journey-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .pa-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .pa-filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  .pa-action-group {
    justify-content: space-between;
    width: 100%;
  }
  .pa-action-group button {
    flex: 1;
    padding: 8px 0;
  }
  .db-toolbar-label {
    width: 100%;
  }
  .db-toolbar-label input, .db-toolbar-label select {
    width: 100% !important;
    height: 40px;
  }
  .db-kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .db-kpi-card {
    padding: 10px 8px;
    gap: 4px;
  }
  .pa-kpi-header {
    gap: 6px;
    margin-bottom: 4px;
  }
  .pa-kpi-icon {
    font-size: 1.1rem;
    padding: 6px;
  }
  .db-kpi-label {
    font-size: 0.65rem;
  }
  .db-kpi-val {
    font-size: 1.3rem;
  }
}

@media print {
  .page-break {
    page-break-before: always !important;
    break-before: page !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Inspeção Setor 3 e 4 — layout mobile-first */
#viewInspecao { width: 100%; min-width: 0; }
#viewInspecao .section-title-row h2 { font-size: 1.125rem; }
#viewInspecao .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
#viewInspecao .grid > label,
#viewInspecao .grid > div { min-width: 0; grid-column: auto; }
#viewInspecao .grid label,
#viewInspecao .kiosk-toggle-field > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#viewInspecao .grid input,
#viewInspecao .grid select { width: 100%; min-width: 0; }
#viewInspecao .kiosk-toggle-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}
#viewInspecao #insSetorGroup {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}
#viewInspecao #insSetorGroup .sector-filter-btn {
  flex: 1 1 100px;
  min-width: 100px;
  white-space: normal;
}
#viewInspecao .sheet-box {
  width: 100%;
  min-width: 0;
  overflow-x: visible;
}
#viewInspecao .sheet-topline,
#viewInspecao .sheet-filter-row,
#viewInspecao .sheet-filter-row input { min-width: 0; max-width: 100%; }
#viewInspecao .sheet-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
}
#viewInspecao .sheet-table thead { display: none; }
#viewInspecao .sheet-table tbody {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
#viewInspecao .sheet-table tr,
#viewInspecao .sheet-table tr[data-record-id],
#viewInspecao .sheet-table tr[data-record-id] td {
  min-width: 0;
  max-width: 100%;
}
#viewInspecao .sheet-table tr[data-record-id] { display: block; width: 100%; }
#viewInspecao .sheet-table tr[data-record-id] td { overflow-wrap: anywhere; }
#viewInspecao .sheet-table tr[data-record-id] td:last-child .btn {
  width: 100%;
  max-width: none;
}
.ins-float-bar {
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
body.mode-inspecao .container {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  #viewInspecao .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  #viewInspecao .sheet-table tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  #viewInspecao .sheet-table tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Sequencia Setor 3 Styles */
.seq-s3-float-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card, #fff);
  border-top: 2px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  z-index: 200;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.13);
}
body.mode-sequencia-s3 .seq-s3-float-bar {
  display: block;
}
body.mode-sequencia-s3 .container {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
@media (min-width: 1024px) {
  body.mode-sequencia-s3 .seq-s3-float-bar {
    left: 240px;
    transition: left 0.25s ease;
  }
  body.sidebar-hidden.mode-sequencia-s3 .seq-s3-float-bar {
    left: 0;
  }
}

#viewSequenciaS3 .section-title-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#viewSequenciaS3 .section-title-row .btn-back {
  width: auto;
  padding: 8px 16px;
}

.seq-s3-list {
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  border-radius: 8px;
  overflow: hidden;
}

.seq-s3-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.08));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.seq-s3-item:last-child {
  border-bottom: none;
}

.seq-s3-forma-badge {
  font-weight: 700;
  color: var(--primary-light, #2563a8);
  font-size: 1.05rem;
  min-width: 60px;
  text-align: left;
}

.seq-s3-select-wrapper {
  flex-grow: 1;
  position: relative;
  max-width: calc(100% - 72px);
}

.seq-s3-select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, rgba(0,0,0,0.15));
  background: var(--bg, #f0f4f8);
  color: var(--text, #1a2840);
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.seq-s3-select:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.seq-s3-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted, #5a6a7e);
  font-size: 0.75rem;
}

@media (min-width: 768px) {
  .seq-s3-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
  }
  .seq-s3-item {
    border-bottom: 1px solid var(--line, rgba(0,0,0,0.08));
  }
}

@media (min-width: 1024px) {
  .seq-s3-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}




/* Global styles for active Modo ODIN (Neon Red Theme) */
body.odin-active .kiosk-header {
  border: 3px solid #ff0000 !important;
  box-shadow: 0 0 20px #ff0000, inset 0 0 20px rgba(255, 0, 0, 0.4) !important;
  background: linear-gradient(135deg, #2d0000 0%, #7f0000 100%) !important;
}

body.odin-active .kiosk-header .kiosk-title {
  color: #ff3333 !important;
  text-shadow: 0 0 8px #ff0000 !important;
}

body.odin-active .kiosk-header .kiosk-subtitle {
  color: #ff9999 !important;
}

body.odin-active .forma-card.is-liberada {
  border: 2.5px solid #ff0000 !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.6) !important;
}

body.odin-active .forma-card.is-programmed {
  border: 2.5px solid #ff0000 !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.6) !important;
}

body.odin-active .forma-card:hover {
  border-color: #ff3333 !important;
  box-shadow: 0 0 15px #ff0000, inset 0 0 8px rgba(255, 0, 0, 0.5) !important;
  transform: scale(1.03);
}

/* Global styles for active Modo Liberação (Neon Orange Theme) */
body.liberation-active .kiosk-header {
  border: 3px solid #ff4500 !important;
  box-shadow: 0 0 20px #ff4500, inset 0 0 20px rgba(255, 69, 0, 0.4) !important;
  background: linear-gradient(135deg, #3a1500 0%, #8c3200 100%) !important;
}

body.liberation-active .kiosk-header .kiosk-title {
  color: #ffaa66 !important;
  text-shadow: 0 0 8px #ff4500 !important;
}

body.liberation-active .kiosk-header .kiosk-subtitle {
  color: #ffd8b3 !important;
}

body.liberation-active .forma-card.is-liberada {
  border: 2.5px solid #ff4500 !important;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.6) !important;
}

body.liberation-active .forma-card.is-programmed {
  border: 2.5px solid #ff4500 !important;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.6) !important;
}

body.liberation-active .forma-card:hover {
  border-color: #ffaa66 !important;
  box-shadow: 0 0 15px #ff4500, inset 0 0 8px rgba(255, 69, 0, 0.5) !important;
  transform: scale(1.03);
}

/* Version badge styling in the top bar */
.sw-version-badge {
  background: rgba(30, 64, 175, 0.15);
  border: 1px solid rgba(30, 64, 175, 0.3);
  color: #3b82f6;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 9999px;
  margin-left: 12px;
  display: inline-block;
  align-self: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

body.liberation-active .sw-version-badge {
  background: rgba(255, 69, 0, 0.15) !important;
  border: 1px solid #ff4500 !important;
  color: #ffaa66 !important;
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.4) !important;
}

body.odin-active .sw-version-badge {
  background: rgba(255, 0, 0, 0.15) !important;
  border: 1px solid #ff0000 !important;
  color: #ff9999 !important;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.4) !important;
}

/* Relatorio Enc. Producao: compact 7-column layout */
body:not(.print-relatorio) .rel-full-table {
  table-layout: fixed;
  width: 100%;
}

body:not(.print-relatorio) .rel-full-table th,
body:not(.print-relatorio) .rel-full-table td {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  padding-left: 6px;
  padding-right: 6px;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(1),
body:not(.print-relatorio) .rel-full-table td:nth-child(1) {
  width: 8% !important;
  text-align: center !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(2),
body:not(.print-relatorio) .rel-full-table td:nth-child(2) {
  width: 34% !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(3),
body:not(.print-relatorio) .rel-full-table td:nth-child(3) {
  width: 12% !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(4),
body:not(.print-relatorio) .rel-full-table td:nth-child(4),
body:not(.print-relatorio) .rel-full-table th:nth-child(5),
body:not(.print-relatorio) .rel-full-table td:nth-child(5),
body:not(.print-relatorio) .rel-full-table th:nth-child(6),
body:not(.print-relatorio) .rel-full-table td:nth-child(6) {
  width: 7% !important;
  text-align: center !important;
}

body:not(.print-relatorio) .rel-full-table th:nth-child(7),
body:not(.print-relatorio) .rel-full-table td:nth-child(7) {
  width: 18% !important;
}

@media print {
  body.print-relatorio .rel-full-table {
    table-layout: fixed !important;
    width: 100% !important;
  }

  body.print-relatorio .rel-full-table th,
  body.print-relatorio .rel-full-table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(1),
  body.print-relatorio .rel-full-table td:nth-child(1) {
    width: 8% !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(2),
  body.print-relatorio .rel-full-table td:nth-child(2) {
    width: 32% !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(3),
  body.print-relatorio .rel-full-table td:nth-child(3) {
    width: 12% !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(4),
  body.print-relatorio .rel-full-table td:nth-child(4),
  body.print-relatorio .rel-full-table th:nth-child(5),
  body.print-relatorio .rel-full-table td:nth-child(5),
  body.print-relatorio .rel-full-table th:nth-child(6),
  body.print-relatorio .rel-full-table td:nth-child(6) {
    width: 7% !important;
    text-align: center !important;
  }

  body.print-relatorio .rel-full-table th:nth-child(7),
  body.print-relatorio .rel-full-table td:nth-child(7) {
    width: 20% !important;
  }
}

.mi-fixed-filters-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  margin-bottom: 16px !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.mi-filter-item {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.mi-filter-item label {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

.mi-filter-item .input-field {
  width: auto !important;
  height: 34px !important;
  padding: 4px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  font-size: 0.82rem !important;
  color: #1e293b !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.mi-filter-item .input-field:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.mi-filter-search {
  flex-grow: 1 !important;
  min-width: 180px !important;
}

.mi-filter-search .input-field {
  width: 100% !important;
  min-width: 180px !important;
}

.mi-filter-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 6px !important;
}

/* =========================================================
   MODO MANUTENÇÃO
   ========================================================= */

body.manutencao-active .kiosk-header {
  background: #fff7ed !important;
  border-bottom: 4px solid #f59e0b !important;
  box-shadow: 0 3px 14px rgba(217, 119, 6, 0.18) !important;
}

body.manutencao-active .kiosk-header .kiosk-title {
  color: #78350f !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}

body.manutencao-active .kiosk-header .kiosk-subtitle {
  color: #92400e !important;
  font-weight: 800 !important;
}

body.manutencao-active .sw-version-badge {
  background: #0f172a !important;
  color: #facc15 !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.9) !important;
}

body.manutencao-active .forma-card:not(.is-manutencao):hover,
body.manutencao-active .s4-forma-cell:not(.is-manutencao):hover {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22) !important;
  cursor: pointer;
  transform: translateY(-2px);
}

/* FORMAS QUE ESTÃO EFETIVAMENTE PARADAS / EM MANUTENÇÃO */
.forma-card.is-manutencao,
.s4-forma-cell.is-manutencao {
  background: #fce7f3 !important;
  border: 3px dashed #db2777 !important;
  color: #831843 !important;
  box-shadow: 0 0 18px rgba(219, 39, 119, 0.28) !important;
  position: relative;
}

.forma-card.is-manutencao .fc-number {
  color: #831843 !important;
  font-weight: 900 !important;
}

.forma-card.is-manutencao::after {
  content: "🛠️ PARADA";
  position: absolute;
  top: 3px;
  right: 4px;
  background: #be185d;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

td.s4-forma-cell.is-manutencao::after {
  content: " 🛠️ PARADA";
  color: #be185d;
  font-weight: 900;
  font-size: 0.72rem;
}

.rm-tabela-row {
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.rm-tabela-row:hover {
  background-color: #fef9c3 !important;
}
.rm-tabela-row.rm-row-parada:hover {
  background-color: #fef08a !important;
}

.manutencao-kpi-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.manutencao-kpi-title {
  font-weight: 900;
  color: #78350f;
  margin-bottom: 10px;
}

.manutencao-kpi-grid,
.rm-filtros {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.manutencao-kpi-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manutencao-kpi-card span {
  font-weight: 800;
  color: #475569;
}

.manutencao-kpi-card strong {
  font-size: 2rem;
  color: #b45309;
  line-height: 1;
}

.rm-filtros {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.rm-filtros label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 140px;
  flex: 1;
}

.rm-filtros .kiosk-input,
.rm-filtros select,
.rm-filtros input[type="date"] {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  min-height: 42px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rm-filtros button#rmBtnLimparFiltros {
  height: 42px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rm-filtros button#rmBtnLimparFiltros:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Impressão do Relatório de Manutenção */
@media print {
  body.print-relatorio-manutencao #appSidebar,
  body.print-relatorio-manutencao .sidebar-overlay,
  body.print-relatorio-manutencao .mi-topbar-actions,
  body.print-relatorio-manutencao .mi-list-header h3,
  body.print-relatorio-manutencao .mi-list-header span {
    display: none !important;
  }

  body.print-relatorio-manutencao #viewTratativaDefeitos {
    display: none !important;
  }

  body.print-relatorio-manutencao #viewRelatorioManutencao {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.print-relatorio-manutencao table {
    width: 100% !important;
    font-size: 8pt !important;
    border-collapse: collapse !important;
  }

  body.print-relatorio-manutencao th,
  body.print-relatorio-manutencao td {
    border: 1px solid #cbd5e1 !important;
    padding: 4px 6px !important;
  }

  /* Impressão do Relatório de Tratativa de Defeitos */
  body.print-relatorio-defeitos #appSidebar,
  body.print-relatorio-defeitos .sidebar-overlay,
  body.print-relatorio-defeitos .mi-topbar-actions,
  body.print-relatorio-defeitos .rm-filtros,
  body.print-relatorio-defeitos .mi-list-header,
  body.print-relatorio-defeitos #viewRelatorioManutencao {
    display: none !important;
  }

  body.print-relatorio-defeitos #viewTratativaDefeitos {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.print-relatorio-defeitos table {
    width: 100% !important;
    font-size: 8pt !important;
    border-collapse: collapse !important;
  }

  body.print-relatorio-defeitos th,
  body.print-relatorio-defeitos td {
    border: 1px solid #64748b !important;
    padding: 5px 6px !important;
  }

  body.print-relatorio-defeitos th:last-child,
  body.print-relatorio-defeitos td:last-child {
    display: none !important;
  }

  body.print-relatorio-defeitos::after {
    content: "\A\A ______________________________________                      ______________________________________\A Assinatura do Responsável de Qualidade                                  Assinatura do Encarregado da Fábrica";
    white-space: pre-wrap;
    display: block;
    margin-top: 35px;
    font-size: 8.5pt;
    font-weight: bold;
    color: #334155;
  }
}

/* Regras de largura e contenção para a Tabela de Tratativa de Defeitos */
.print-defeitos-table th:nth-child(5),
.print-defeitos-table td:nth-child(5) {
  min-width: 130px;
  width: 130px;
  text-align: center;
  box-sizing: border-box;
}

.print-defeitos-table th:nth-child(9),
.print-defeitos-table td:nth-child(9) {
  min-width: 140px;
  width: 140px;
  text-align: center;
  box-sizing: border-box;
}

.td-badge {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Icones especificos por tipo de defeito no checklist de inspecao S3/S4 ── */
.item-defeito-icon {
  font-size: 1.15rem;
  margin-right: 5px;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}
.critico-dot {
  font-size: 0.7rem;
  font-weight: 900;
  color: #b91c1c !important;
  margin-right: 4px;
  background: #fee2e2;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  letter-spacing: 0;
}
