/* ============================================================
   Sistema Psicossocial NR-1 — Clean SaaS Design
   Hospital/Financial Institutional Aesthetic
   Font: Inter (Avenir Next alternative)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --teal:      #1A6B5A;
  --teal-lt:   #E8F5F1;
  --teal-hover:#145745;
  --blue:      #2563EB;
  --blue-lt:   #EFF6FF;
  --green:     #10B981;
  --green-lt:  #ECFDF5;
  --amber:     #F59E0B;
  --amber-lt:  #FFFBEB;
  --red:       #EF4444;
  --red-lt:    #FEF2F2;
  --gray-50:   #F9FAFB;
  --gray-100:  #F3F4F6;
  --gray-200:  #E5E7EB;
  --gray-300:  #D1D5DB;
  --gray-400:  #9CA3AF;
  --gray-500:  #6B7280;
  --gray-600:  #4B5563;
  --gray-700:  #374151;
  --gray-800:  #1F2937;
  --text:      #4A4A4A;
  --text-dark: #1F2937;
  --text-muted:#6B7280;
  --border:    #E5E7EB;
  --surface:   #F5F7FA;
  --card:      #FFFFFF;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow:    0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.6; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); padding: 1.25rem 0; }
.header-top { display: flex; flex-direction: column; gap: 4px; }
.site-header h1 { font-size: 20px; font-weight: 500; color: var(--text-dark); }
.header-sub { font-size: 13px; color: var(--text-muted); }
.badge-nr1 { display: inline-block; background: var(--teal-lt);
  color: var(--teal); font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; letter-spacing: 0.05em; margin-bottom: 4px; width: fit-content; }

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; box-shadow: var(--shadow-sm); }
.card-header { background: var(--gray-50); border-bottom: 1px solid var(--border); padding: 0.75rem 1.25rem; font-weight: 500; font-size: 14px; }
.card-body { padding: 1.25rem; }
.section-card .section-title, .section-title {
  font-size: 13px; font-weight: 600; color: var(--teal); text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--gray-50); }
.section-card > *:not(.section-title) { padding: 1.25rem; }
.chart-card .chart-wrap { padding: 1rem 1.25rem 1.25rem; }
.chart-card .section-title { border-bottom: 1px solid var(--border); }

/* Alerts */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: 14px; }
.alert-info { background: var(--blue-lt); color: #185fa5; border: 1px solid #bfdbfe; }
.alert-danger { background: var(--red-lt); color: var(--red); border: 1px solid #fecaca; }

/* Progress */
.progress-wrap { margin-bottom: 1rem; }
.progress-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.progress-bar { height: 5px; background: var(--gray-200); border-radius: 3px; }
.progress-fill { height: 5px; background: var(--teal); border-radius: 3px; transition: width .3s; }

/* Dimensões */
.dim-card .dim-header {
  background: var(--gray-50); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem; font-weight: 500; font-size: 14px;
  color: var(--teal); display: flex; align-items: center; gap: 8px; }
.dim-icon { font-size: 16px; }

/* Perguntas */
.question-block { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.question-block:last-child { border-bottom: none; padding-bottom: 0; }
.question-num { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.question-text { font-size: 14px; color: var(--text-dark); margin-bottom: 0.75rem; line-height: 1.5; }
.scale-wrap { display: flex; align-items: center; gap: 8px; }
.scale-label-left, .scale-label-right { font-size: 11px; color: var(--text-muted); line-height: 1.3;
  width: 90px; flex-shrink: 0; }
.scale-label-right { text-align: right; }
.scale-options { display: flex; gap: 5px; flex: 1; }
.scale-opt { flex: 1; }
.scale-opt input { display: none; }
.scale-btn { display: block; text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; background: var(--gray-50); user-select: none; }
.scale-opt input:checked + .scale-btn { background: var(--teal); color: #fff; border-color: var(--teal); }
.scale-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-lt); }

/* Demographics grid */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-group input, .form-group select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); background: var(--card); }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,107,90,.1); }

/* Submit */
.submit-wrap { text-align: center; margin: 2rem 0 1rem; }

/* Buttons */
.btn { display: inline-block; padding: 9px 20px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: all .15s; }
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-hover); }
.btn-lg { padding: 12px 32px; font-size: 15px; border-radius: var(--radius); }
.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal-lt); }

/* Metrics */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.metric-val { font-size: 26px; font-weight: 500; color: var(--text-dark); margin-bottom: 4px; }
.metric-unit { font-size: 14px; font-weight: 400; }
.metric-sub { font-size: 12px; color: var(--text-muted); }

/* Risk badge */
.risk-badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 4px; }
.risk-badge.small { font-size: 11px; padding: 2px 8px; }

/* Dim bars */
.dim-bars { padding: 1rem 1.25rem; }
.dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-name { width: 190px; font-size: 13px; color: var(--text); flex-shrink: 0; }
.dim-bar-bg { flex: 1; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.dim-bar-fill { height: 8px; border-radius: 4px; transition: width .5s; }
.dim-score { width: 38px; text-align: right; font-size: 12px; color: var(--text-muted); }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.chart-wrap { position: relative; }

/* Laudo */
.laudo-body { padding: 1.25rem; font-size: 14px; line-height: 1.75; }
.laudo-body h3 { font-size: 14px; font-weight: 600; color: var(--teal); margin: 1.25rem 0 0.4rem; }
.laudo-body h3:first-child { margin-top: 0; }
.laudo-body p { margin-bottom: 0.75rem; }

/* Recomendações */
.recs-list { padding: 1rem 1.25rem; }
.rec-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin-bottom: 8px;
  background: var(--gray-50); border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; }
.rec-num { width: 20px; height: 20px; min-width: 20px; border-radius: 50%; background: var(--teal);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; margin-top: 1px; }

/* Filter bar */
.filter-bar .filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 1rem 1.25rem; }
.filter-bar .form-group { min-width: 160px; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 10px; font-weight: 500; font-size: 12px;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--gray-50); }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }

/* Action bar */
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.5rem; padding-bottom: 2rem; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--border);
  padding: 1rem 0; font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 2rem; }

/* Print header (hidden on screen) */
.print-header { display: none; }
.print-meta { font-size: 12px; width: 100%; margin: 0.5rem 0; }
.print-meta td { padding: 3px 8px 3px 0; }

/* Responsive */
@media (max-width: 640px) {
  .charts-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dim-name { width: 120px; font-size: 12px; }
  .scale-label-left, .scale-label-right { display: none; }
  .demo-grid { grid-template-columns: 1fr 1fr; }
}

/* Print */
@media print {
  body { background: #fff; font-size: 12px; }
  .site-header, .action-bar, .no-print-hide, .site-footer { display: none !important; }
  .print-header { display: block; margin-bottom: 1rem; }
  .container { max-width: 100%; padding: 0; }
  .card { border: 1px solid #ccc; break-inside: avoid; margin-bottom: 0.75rem; box-shadow: none; }
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 200px !important; }
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
  a { color: inherit; text-decoration: none; }
}