/* ==========================================================================
   PROC & AMIOFE — Estilos Clínicos Responsivos (Mobile-First iPhone & Desktop)
   Fontes Primárias:
   - PROC: Zorzi & Hage (2004) / Hage, Pereira & Zorzi (Rev. CEFAC, 2012)
   - AMIOFE / OMES: Felício & Ferreira (Int J Pediatr Otorhinolaryngol, 2008)
   ========================================================================== */

.pa-sync-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.pa-sync-bar.proc-theme {
  border-left: 5px solid #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.pa-sync-bar.amiofe-theme {
  border-left: 5px solid #db2777;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.pa-sync-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #334155;
}

.pa-sync-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pa-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pa-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.pa-btn-primary-proc {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
}
.pa-btn-primary-proc:hover {
  background: #b45309;
  color: #ffffff;
}

.pa-btn-primary-amiofe {
  background: #db2777;
  border-color: #be185d;
  color: #ffffff;
}
.pa-btn-primary-amiofe:hover {
  background: #be185d;
  color: #ffffff;
}

.pa-btn-soft {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.pa-btn-soft:hover {
  background: #dcfce7;
}

.pa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pa-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.pa-kpi-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.pa-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.pa-kpi-sub {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 4px;
}

.pa-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.pa-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.pa-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.pa-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.pa-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pa-badge-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.pa-badge-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.pa-badge-risk { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.pa-badge-neutral { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

.pa-item-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fcfcfd;
}

.pa-item-row.answered {
  border-color: #93c5fd;
  background: #f8fbff;
}

.pa-item-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
}

.pa-item-help {
  font-size: 0.79rem;
  color: #64748b;
}

.pa-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pa-pill {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  transition: all 0.14s ease;
}

.pa-pill:hover {
  border-color: #64748b;
  background: #f8fafc;
}

.pa-pill.active-proc {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

.pa-pill.active-amiofe-3 {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}
.pa-pill.active-amiofe-2 {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
}
.pa-pill.active-amiofe-1,
.pa-pill.active-amiofe-0 {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

.pa-pill-pts {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.75rem;
  font-weight: 800;
}

.pa-timer-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #fcd34d;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #92400e;
}

.pa-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.pa-input-num, .pa-select, .pa-textarea {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

.pa-textarea {
  min-height: 92px;
  resize: vertical;
  font-family: inherit;
}

.pa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.pa-table th, .pa-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
}

.pa-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}

.pa-toy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.pa-toy-chip {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #ffffff;
}

.pa-toy-chip.checked {
  background: #fffbeb;
  border-color: #f59e0b;
  font-weight: 600;
}

@media (max-width: 640px) {
  .pa-sync-bar {
    position: static;
    padding: 10px 12px;
  }
  .pa-sync-actions {
    width: 100%;
  }
  .pa-sync-actions .pa-btn {
    flex: 1 1 calc(50% - 8px);
  }
  .pa-pill {
    width: 100%;
    justify-content: space-between;
  }
}

.pa-print-only {
  display: none;
}

@media print {
  .pa-sync-bar, .pa-no-print, .pa-textarea, .pa-kpi-grid {
    display: none !important;
  }
  .pa-print-only {
    display: block !important;
  }
  .pa-card {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
    break-inside: avoid;
  }
  .pa-print-header {
    border-bottom: 2px solid #0f766e;
    padding-bottom: 10px;
    margin-bottom: 14px;
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
  }
  .pa-print-sig {
    margin-top: 36px;
    text-align: center;
    break-inside: avoid;
  }
  .pa-print-sig-line {
    width: 260px;
    border-top: 1px solid #0f172a;
    margin: 0 auto 6px;
  }
}
