:root {
  --primary: #005a9c;
  --primary-hover: #00467a;
  --secondary: #009688;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  
  --sim-color: #16a34a;
  --sim-bg: #dcfce7;
  --nao-color: #dc2626;
  --nao-bg: #fee2e2;
  --na-color: #475569;
  --na-bg: #f1f5f9;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 90px;
}

/* Header */
.header-bar {
  background: linear-gradient(135deg, #00467a 0%, #006699 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.company-badge {
  background-color: #ffffff;
  color: #005a9c;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-subtitle {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Main Layout */
.main-content {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.step-num {
  background-color: var(--primary);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

.card-body.p-0 {
  padding: 0;
}

/* Forms */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.req {
  color: #dc2626;
}

input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.15);
}

.uppercase-input {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.readonly-input {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  cursor: not-allowed !important;
  font-weight: 600 !important;
  border-color: #cbd5e1 !important;
  user-select: none;
}


/* Presets Toolbar */
.items-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.presets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-preset {
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background-color: #e2e8f0;
  border-color: #94a3b8;
}

.btn-preset-clear {
  color: #ef4444;
}

.btn-preset-clear:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

/* Table */
.table-container {
  overflow-x: auto;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.checklist-table th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-light);
}

.checklist-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.item-row:hover {
  background-color: #f8fafc;
}

.col-num {
  width: 45px;
  text-align: center;
}

.col-desc {
  min-width: 280px;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.item-hint {
  font-size: 0.8rem;
  color: #0284c7;
  margin-top: 3px;
  background-color: #f0f9ff;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.col-choice {
  width: 80px;
}

.col-obs {
  width: 320px;
}

.obs-input {
  font-size: 0.85rem !important;
  padding: 6px 10px !important;
}

/* Radio buttons styled as segmented buttons */
.radio-label {
  display: inline-block;
  cursor: pointer;
  position: relative;
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: #ffffff;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.radio-sim input[type="radio"]:checked + .radio-btn {
  background-color: var(--sim-bg);
  border-color: var(--sim-color);
  color: var(--sim-color);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.radio-nao input[type="radio"]:checked + .radio-btn {
  background-color: var(--nao-bg);
  border-color: var(--nao-color);
  color: var(--nao-color);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.radio-na input[type="radio"]:checked + .radio-btn {
  background-color: var(--na-bg);
  border-color: var(--na-color);
  color: var(--na-color);
  box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.2);
}

/* Photos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: 1fr;
  }
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.photo-card-header {
  padding: 10px 14px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.tag-pending {
  background-color: #fef3c7;
  color: #b45309;
}

.tag-success {
  background-color: #dcfce7;
  color: #15803d;
}

.photo-dropzone {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: #fbfcfe;
  position: relative;
  transition: background-color 0.15s ease;
}

.photo-dropzone:hover {
  background-color: #f0f7ff;
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.dropzone-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-preview {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.file-hidden {
  display: none;
}

.photo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 14px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-light);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-danger {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Sticky Footer */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  padding: 12px 20px;
  z-index: 50;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-stat {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: #00875a;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #006644;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  background-color: #005a9c;
  color: white;
}

.btn-sm:hover {
  background-color: #00467a;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

/* ======================================================
   RESPONSIVIDADE AVANÇADA PARA CELULAR (SMARTPHONES)
   ====================================================== */
@media (max-width: 768px) {
  body {
    padding-bottom: 125px; /* Espaço para o rodapé fixo */
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand-info {
    gap: 12px;
  }

  .company-badge {
    font-size: 1.05rem;
    padding: 4px 10px;
  }

  .header-title {
    font-size: 1rem;
  }

  .header-subtitle {
    font-size: 0.75rem;
  }

  .header-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .main-content {
    margin: 14px auto;
    padding: 0 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }

  .card-header h2 {
    font-size: 1.05rem;
  }

  .presets-toolbar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .btn-preset {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .grid-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Transforma a tabela em cartões individuais para tela de celular */
  .checklist-table,
  .checklist-table thead,
  .checklist-table tbody,
  .checklist-table th,
  .checklist-table td,
  .checklist-table tr {
    display: block;
  }

  .checklist-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .checklist-table tbody {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .checklist-table tr.item-row {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .col-num {
    display: inline-block;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #1e293b;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    width: auto;
    text-align: left;
  }

  .col-num::before {
    content: "Item ";
  }

  .col-desc {
    min-width: unset;
    padding: 0 0 12px 0 !important;
    border: none !important;
  }

  .item-title {
    font-size: 0.95rem;
    font-weight: 600;
  }

  /* Botões SIM / NÃO / N/A em 3 colunas de toque fácil */
  .col-choice {
    display: inline-block;
    width: 31.5%;
    margin-right: 1.5%;
    padding: 0 !important;
    border: none !important;
    margin-bottom: 10px;
  }

  .col-choice:last-of-type {
    margin-right: 0;
  }

  .radio-label {
    width: 100%;
    display: block;
  }

  .radio-btn {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px; /* Altura ideal de toque no celular */
  }

  .col-obs {
    width: 100%;
    padding: 0 !important;
    border: none !important;
  }

  .obs-input {
    width: 100%;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
  }

  /* Fotos em 1 coluna */
  .photos-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .photo-dropzone {
    min-height: 180px;
  }

  .photo-preview {
    height: 200px;
  }

  /* Rodapé Fixo compacto com botão largo */
  .sticky-footer {
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .footer-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .footer-status {
    justify-content: space-between;
    font-size: 0.85rem;
  }

  .btn-lg {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
  }
}

