:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #f97316;
  --primary-dark: #c2410c;
  --dark: #111827;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warning: #a16207;
  --warning-soft: #fef3c7;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(18px, env(safe-area-inset-left));
  background: rgba(17, 24, 39, 0.96);
  color: white;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { margin-top: 2px; color: #d1d5db; font-size: 12px; }

.container {
  width: min(860px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 56px;
}
.card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-card {
  padding: 32px 24px;
  background:
    radial-gradient(circle at top right, rgba(249,115,22,.16), transparent 38%),
    var(--surface);
}
.hero-card h1 { margin: 6px 0 10px; font-size: clamp(28px, 6vw, 42px); line-height: 1.05; }
.hero-card p { max-width: 600px; margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--primary-dark); font-size: 12px; font-weight: 800; letter-spacing: .11em; }

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: wait; opacity: .58; transform: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #ea580c; }
.btn-secondary { background: var(--dark); color: white; }
.btn-ghost { border: 1px solid #374151; background: transparent; color: white; }
.btn-block { width: 100%; }
.btn-large { min-height: 54px; font-size: 17px; }

.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dark);
  color: white;
  font-weight: 800;
}
.user-bar strong, .user-bar span { display: block; }
.user-bar span { color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: 21px; }
.lookup-form label { display: block; margin-bottom: 8px; font-weight: 700; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input[type="text"], textarea, select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: var(--text);
  outline: none;
}
input[type="text"] { min-height: 46px; padding: 10px 13px; }
textarea { padding: 12px 13px; resize: vertical; }
select { min-height: 44px; padding: 9px 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
.lookup-form small, .submit-panel small { display: block; margin-top: 9px; color: var(--muted); }

.status-card { display: flex; align-items: center; gap: 14px; }
.status-card strong, .status-card span { display: block; }
.status-card span { margin-top: 3px; color: var(--muted); }
.spinner {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 3px solid #fed7aa;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-card { display: flex; gap: 14px; border-color: #fecaca; background: #fffafa; }
.status-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 900;
}
.status-copy p { margin: 6px 0 14px; color: #7f1d1d; line-height: 1.45; }
details { margin: 10px 0 16px; }
pre { overflow: auto; max-height: 220px; padding: 12px; border-radius: 10px; background: #111827; color: #e5e7eb; font-size: 12px; white-space: pre-wrap; }

.equipment-title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.equipment-title-row h2 { margin: 4px 0 0; font-size: 30px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.equipment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.equipment-grid > div { padding: 14px; border-radius: 12px; background: var(--surface-soft); }
.equipment-grid span, .equipment-grid strong { display: block; }
.equipment-grid span { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.equipment-grid strong { overflow-wrap: anywhere; }

.question-group { margin-bottom: 18px; }
.group-header { margin-bottom: 10px; padding: 0 4px; color: #374151; font-size: 14px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.question-card { padding: 18px; }
.question-number { color: var(--muted); font-size: 12px; font-weight: 800; }
.question-text { margin: 6px 0 16px; font-size: 17px; font-weight: 720; line-height: 1.4; }
.answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.answer-options.has-na { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer-btn {
  min-height: 48px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: #374151;
  font-weight: 800;
}
.answer-btn.selected[data-value="Conforme"] { border-color: #16a34a; background: #dcfce7; color: #166534; }
.answer-btn.selected[data-value="Não Conforme"] { border-color: #dc2626; background: #fee2e2; color: #991b1b; }
.answer-btn.selected[data-value="Não se aplica"] { border-color: #6b7280; background: #f3f4f6; color: #374151; }
.nc-fields { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid #fecaca; border-radius: 12px; background: #fff7f7; }
.nc-fields label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 750; }
.required-mark { color: var(--danger); }
.photo-input {
  width: 100%;
  padding: 10px;
  border: 1px dashed #f87171;
  border-radius: 12px;
  background: white;
}
.photo-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.field-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important; }
.question-error { border-color: #fca5a5; }

.submit-panel { position: sticky; bottom: 0; z-index: 30; margin: 20px -12px -32px; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 78%, transparent); }
.validation-summary { margin-bottom: 10px; padding: 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.submit-panel small { text-align: center; }

.success-card { text-align: center; }
.success-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 32px; font-weight: 900; }
.success-card h2 { margin: 0 0 8px; }
.success-card p { color: var(--muted); }
.success-id { margin: 18px 0; padding: 14px; border-radius: 12px; background: var(--surface-soft); }
.success-id span, .success-id strong { display: block; }
.success-id span { color: var(--muted); font-size: 12px; }
.success-id strong { margin-top: 4px; overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .container { width: min(100% - 16px, 860px); padding-top: 14px; }
  .card { padding: 18px; border-radius: 15px; }
  .hero-card { padding: 26px 18px; }
  .brand span { display: none; }
  .input-row { grid-template-columns: 1fr; }
  .equipment-grid { grid-template-columns: 1fr; }
  .answer-options, .answer-options.has-na { grid-template-columns: 1fr; }
  .photo-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Acompanhamento mensal */
.app-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.nav-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4b5563;
  font-weight: 800;
}
.nav-btn.active { background: var(--dark); color: white; }
.dashboard-header-card h1 { margin: 5px 0 8px; font-size: clamp(26px, 5vw, 36px); }
.dashboard-header-card p { max-width: 600px; margin: 0; color: var(--muted); line-height: 1.5; }
.dashboard-heading { align-items: center; }
.dashboard-period { display: grid; grid-template-columns: auto minmax(230px, 300px); align-items: center; gap: 12px; margin-top: 20px; }
.dashboard-period label { font-weight: 800; }
.month-control { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.month-nav-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.month-nav-btn:hover { border-color: var(--primary); background: #fff7ed; }
.month-nav-btn:active { transform: scale(.96); }
.month-nav-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
input[type="month"], input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: var(--text);
  outline: none;
}
input[type="month"]:focus, input[type="search"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.summary-card span, .summary-card strong { display: block; }
.summary-card span { color: var(--muted); font-size: 13px; font-weight: 750; }
.summary-card strong { margin-top: 12px; font-size: 34px; line-height: 1; }
.summary-success { border-color: #bbf7d0; background: #f0fdf4; }
.summary-warning { border-color: #fde68a; background: #fffbeb; }
.summary-danger { border-color: #fecaca; background: #fff7f7; }
.progress-card { padding: 18px 20px; }
.progress-copy { display: flex; justify-content: space-between; gap: 14px; align-items: end; }
.progress-copy span, .progress-copy strong { display: block; }
.progress-copy span { color: var(--muted); font-size: 13px; }
.progress-copy > div > strong { margin-top: 3px; }
.progress-copy > strong { font-size: 22px; }
.progress-track { height: 12px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #fb923c); transition: width .25s ease; }
.dashboard-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.3fr; gap: 10px; margin-bottom: 16px; }
.dashboard-list { display: grid; gap: 10px; }
.dashboard-row {
  display: grid;
  grid-template-columns: minmax(105px, .8fr) minmax(120px, 1fr) minmax(150px, 1.5fr) minmax(120px, .9fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.dashboard-row:hover { border-color: #fdba74; }
.dashboard-cell span, .dashboard-cell strong { display: block; }
.dashboard-cell span { margin-bottom: 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.dashboard-cell strong { overflow-wrap: anywhere; font-size: 14px; }
.situation-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.situation-pending { background: #fef3c7; color: #92400e; }
.situation-progress { background: #dbeafe; color: #1d4ed8; }
.situation-conforme { background: #dcfce7; color: #166534; }
.situation-naoconforme { background: #fee2e2; color: #991b1b; }
.row-action { min-width: 116px; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 5px; color: var(--text); }
.details-card { border-color: #fdba74; }
.details-header { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.details-header h2 { margin: 5px 0 0; overflow-wrap: anywhere; }
.details-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.details-summary > div { padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.details-summary span, .details-summary strong { display: block; }
.details-summary span { color: var(--muted); font-size: 12px; }
.details-summary strong { margin-top: 4px; overflow-wrap: anywhere; }
.details-answers { display: grid; gap: 10px; }
.detail-answer { padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.detail-answer-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.detail-answer h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.detail-answer p { margin: 9px 0 0; color: #4b5563; line-height: 1.45; }
.detail-answer-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row { grid-template-columns: 1fr 1fr; }
  .dashboard-row .row-action { width: 100%; }
  .details-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .dashboard-heading { display: block; }
  .dashboard-heading .btn { width: 100%; margin-top: 16px; }
  .dashboard-period { grid-template-columns: 1fr; }
  .month-control { width: 100%; }
  .summary-grid { gap: 8px; }
  .summary-card { min-height: 96px; padding: 14px; }
  .summary-card strong { font-size: 28px; }
  .dashboard-filters { grid-template-columns: 1fr; }
  .dashboard-row { grid-template-columns: 1fr; gap: 9px; }
  .dashboard-cell span { margin-bottom: 1px; }
  .details-header { display: block; }
  .details-header .btn { width: 100%; margin-top: 14px; }
  .details-summary { grid-template-columns: 1fr; }
  .detail-answer-header { display: block; }
  .detail-answer-header .situation-pill { margin-top: 8px; }
  .success-actions { grid-template-columns: 1fr; }
}

/* Melhorias de acompanhamento - versão 1.8 */
.container {
  width: min(1120px, calc(100% - 24px));
}
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.summary-overdue {
  border-color: #fdba74;
  background: #fff7ed;
}
.summary-overdue strong { color: #c2410c; }

.dashboard-table-head {
  display: grid;
  grid-template-columns: minmax(105px, .8fr) minmax(110px, .9fr) minmax(150px, 1.35fr) minmax(125px, .95fr) minmax(120px, .9fr) minmax(116px, auto);
  gap: 12px;
  align-items: center;
  padding: 0 14px 9px;
  color: var(--muted);
}
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sort-button:hover,
.sort-button.active { color: var(--primary-dark); }
.sort-button span {
  flex: 0 0 auto;
  font-size: 9px;
}
.dashboard-action-heading {
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
}
.dashboard-row {
  grid-template-columns: minmax(105px, .8fr) minmax(110px, .9fr) minmax(150px, 1.35fr) minmax(125px, .95fr) minmax(120px, .9fr) minmax(116px, auto);
}
.situation-overdue {
  background: #ffedd5;
  color: #c2410c;
}
.dashboard-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.page-size-control select {
  width: auto;
  min-height: 36px;
  padding: 5px 28px 5px 9px;
}
.pagination-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.pagination-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: white;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.pagination-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: #fff7ed;
}
.pagination-button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

@media (max-width: 940px) {
  .dashboard-table-head { display: none; }
  .dashboard-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row .row-action { width: 100%; }
  .dashboard-footer { grid-template-columns: 1fr 1fr; }
  .pagination-control { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 16px, 1120px); }
  .dashboard-row { grid-template-columns: 1fr; }
  .dashboard-footer { grid-template-columns: 1fr; align-items: stretch; }
  .page-size-control { justify-content: space-between; }
  .pagination-control { grid-column: auto; justify-content: space-between; }
}

/* Regra mensal de atrasos - versão 1.9 */
.situation-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

/* =========================================================
   Layout responsivo mobile-first - versão 2.0
   Mantém o mesmo aplicativo e adapta a apresentação no celular.
   ========================================================= */
.dashboard-filters-panel { display: block; }
.filter-toggle { display: none; }
.dashboard-list-heading { align-items: center; }

@media (max-width: 700px) {
  :root {
    --radius: 14px;
    --shadow: 0 6px 18px rgba(17, 24, 39, 0.07);
  }

  body {
    background: #eef1f4;
    -webkit-tap-highlight-color: transparent;
  }

  body.details-open { overflow: hidden; }

  .topbar {
    min-height: 60px;
    padding: 8px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right));
  }

  .brand { gap: 9px; min-width: 0; }
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 21px;
  }
  .brand > div:last-child { min-width: 0; }
  .brand strong {
    overflow: hidden;
    max-width: 210px;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand span { display: none; }
  .topbar .btn-ghost {
    min-height: 38px;
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 14px;
  }

  .container {
    width: 100%;
    margin: 0;
    padding: 10px 10px calc(72px + env(safe-area-inset-bottom));
  }

  .card {
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .hero-card { padding: 22px 16px; }
  .hero-card h1 { font-size: 30px; }

  .user-bar {
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 13px;
  }
  .user-bar > div:last-child { min-width: 0; }
  .user-bar strong,
  .user-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-bar strong { font-size: 15px; }
  .user-bar span { font-size: 12px; }
  .avatar { width: 36px; height: 36px; }

  .app-nav {
    gap: 5px;
    margin-bottom: 10px;
    padding: 4px;
    border-radius: 13px;
  }
  .nav-btn {
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 9px;
    font-size: 13px;
  }

  .dashboard-header-card { padding: 14px; }
  .dashboard-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
  }
  .dashboard-heading .eyebrow { font-size: 10px; }
  .dashboard-header-card h1 {
    margin: 3px 0 0;
    font-size: 23px;
    line-height: 1.15;
  }
  .dashboard-header-card p { display: none; }
  .dashboard-heading .btn {
    width: auto !important;
    min-height: 38px;
    margin-top: 0 !important;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13px;
  }

  .dashboard-period {
    display: block;
    margin-top: 12px;
  }
  .dashboard-period label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
  }
  .month-control {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 7px;
  }
  .month-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 26px;
  }
  input[type="month"] {
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  .summary-card {
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    border-radius: 13px;
  }
  .summary-card span { font-size: 11px; }
  .summary-card strong {
    margin-top: 6px;
    font-size: 27px;
  }
  .summary-card:nth-child(5) {
    grid-column: 1 / -1;
    min-height: 58px;
    flex-direction: row;
    align-items: center;
  }
  .summary-card:nth-child(5) strong { margin-top: 0; }

  .progress-card { padding: 13px 14px; }
  .progress-copy { align-items: center; }
  .progress-copy span { font-size: 11px; }
  .progress-copy > div > strong { font-size: 14px; }
  .progress-copy > strong { font-size: 20px; }
  .progress-track { height: 8px; margin-top: 10px; }

  .dashboard-list-card { padding: 14px; }
  .dashboard-list-heading { margin-bottom: 10px; }
  .dashboard-list-heading h2 {
    margin-top: 3px;
    font-size: 20px;
  }

  .filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
  }
  .filter-toggle.has-active-filters {
    border-color: #fb923c;
    background: #fff7ed;
    color: var(--primary-dark);
  }
  .filter-count {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    line-height: 1;
  }
  .filter-chevron {
    font-size: 17px;
    line-height: 1;
    transition: transform .16s ease;
  }
  .filter-toggle.open .filter-chevron { transform: rotate(180deg); }

  .dashboard-filters-panel { display: none; }
  .dashboard-filters-panel.open {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
  }
  .dashboard-filters {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 0;
  }
  .dashboard-filters select,
  .dashboard-filters input[type="search"] {
    min-height: 42px;
    border-radius: 10px;
    font-size: 14px;
  }

  .dashboard-list { gap: 9px; }
  .dashboard-row {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) !important;
    gap: 10px 12px;
    padding: 13px;
    border-radius: 13px;
    background: white;
    box-shadow: 0 3px 10px rgba(17, 24, 39, .04);
  }
  .dashboard-cell span {
    margin-bottom: 2px;
    font-size: 10px;
  }
  .dashboard-cell strong { font-size: 14px; }
  .dashboard-cell:nth-child(3) {
    grid-column: 1 / -1;
    padding-top: 9px;
    border-top: 1px solid var(--border);
  }
  .dashboard-cell:nth-child(4),
  .dashboard-cell:nth-child(5) {
    padding-top: 4px;
  }
  .situation-pill {
    min-height: 25px;
    padding: 3px 9px;
    font-size: 11px;
  }
  .situation-note { font-size: 10px; }
  .row-action {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 43px;
    margin-top: 1px;
    border-radius: 10px;
    font-size: 14px;
  }

  .dashboard-footer {
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .dashboard-footer > #dashboardCounter {
    grid-column: 1 / -1;
    font-size: 12px;
  }
  .page-size-control {
    justify-content: flex-start;
    font-size: 12px;
  }
  .page-size-control select {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .pagination-control {
    grid-column: auto;
    justify-content: flex-end;
    gap: 7px;
    font-size: 12px;
  }
  .pagination-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  /* Detalhes em tela cheia no celular */
  .details-card {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0 12px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
  }
  .details-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin: 0 -12px 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
  }
  .details-header h2 { margin-top: 2px; font-size: 18px; }
  .details-header .eyebrow { font-size: 9px; }
  .details-header .btn {
    width: auto !important;
    min-height: 38px;
    margin-top: 0 !important;
    padding: 7px 12px;
  }
  .details-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
  }
  .details-summary > div { padding: 10px; }
  .details-summary > div:last-child { grid-column: 1 / -1; }
  .detail-answer { padding: 12px; background: white; }
  .detail-answer-header { display: block; }
  .detail-answer-header .situation-pill { margin-top: 7px; }

  /* Fluxo de inspeção */
  #lookupCard .section-heading { margin-bottom: 12px; }
  #lookupCard .section-heading h2 { font-size: 19px; }
  .lookup-form .input-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .lookup-form .btn { min-width: 74px; padding-inline: 12px; }
  .lookup-form small { font-size: 11px; }

  .equipment-card { padding: 14px; }
  .equipment-title-row h2 { font-size: 25px; }
  .equipment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 13px;
  }
  .equipment-grid > div { padding: 10px; }
  .equipment-grid > div:nth-child(2) { grid-column: 1 / -1; }
  .equipment-grid span { font-size: 10px; }
  .equipment-grid strong { font-size: 13px; }

  .question-group { margin-bottom: 12px; }
  .group-header {
    margin: 13px 0 7px;
    padding: 0 2px;
    font-size: 12px;
  }
  .question-card { padding: 14px; }
  .question-number { font-size: 10px; }
  .question-text {
    margin: 5px 0 12px;
    font-size: 15px;
    line-height: 1.35;
  }
  .answer-options,
  .answer-options.has-na {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .answer-options.has-na .answer-btn:last-child { grid-column: 1 / -1; }
  .answer-btn {
    min-height: 44px;
    padding: 7px 5px;
    border-radius: 10px;
    font-size: 13px;
  }
  .nc-fields {
    gap: 10px;
    margin-top: 10px;
    padding: 11px;
  }
  .photo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  #inspectionForm > .card { padding: 14px; }
  #generalObservation { min-height: 96px; }
  .submit-panel {
    margin: 12px -10px calc(-72px - env(safe-area-inset-bottom));
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  }
  .submit-panel .btn-large { min-height: 50px; }
  .submit-panel small { font-size: 10px; }

  .success-actions { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .brand strong { max-width: 175px; }
  .summary-card { min-height: 72px; }
  .dashboard-row { grid-template-columns: 1fr 1fr !important; }
  .dashboard-footer { grid-template-columns: 1fr; }
  .page-size-control { justify-content: space-between; }
  .pagination-control { justify-content: space-between; }
  .details-summary { grid-template-columns: 1fr; }
  .details-summary > div:last-child { grid-column: auto; }
}
