:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #e5f5ff;
  color: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #88d4ff 0%, #8b5cf6 40%, #0f172a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.page-shell {
  max-width: 1100px;
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 28px;
  padding: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.5);
}

.branding {
  color: #e0f2ff;
  align-self: center;
}

.branding .eyebrow {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 1.5rem;
}

.branding h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.branding .subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(224, 242, 255, 0.9);
}

.login-card {
  background: #f8fafc;
  border-radius: 18px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.login-card h2 {
  font-size: 1.75rem;
  color: #0f172a;
}

.logo {
  width: 120px;
  align-self: center;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

.aventura-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form label {
  font-size: 0.9rem;
  color: #475569;
}

.login-form input {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
  background: #fff;
}

.login-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.primary {
  margin-top: 0.5rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(99, 102, 241, 0.4);
}

a.primary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.signature-preview {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #475569;
}

.signature-preview img {
  width: 100%;
  border: 1px dashed #cbd5f5;
  border-radius: 10px;
  min-height: 80px;
  object-fit: contain;
}

.signature-empty {
  font-style: italic;
  color: #94a3b8;
}

.signature-error {
  color: #b91c1c;
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 18px;
  width: min(420px, 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-content header button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content canvas {
  width: 100%;
  max-height: 220px;
  border: 1px solid #cbd5f5;
  border-radius: 12px;
  background: #fefefe;
  touch-action: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.secondary {
  margin-top: 0.5rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.5);
  background: #fff;
  color: #4c1d95;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.secondary:hover {
  border-color: #4c1d95;
  background: #f1f5ff;
}

.login-helpers {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.secondary {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

.secondary:hover {
  text-decoration: underline;
}

.status {
  min-height: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  transition: color 0.2s ease;
}

.status-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.status-alert.hidden {
  display: none;
}

.status[data-state='error'] {
  color: #dc2626;
}

.status[data-state='success'] {
  color: #16a34a;
}

.status[data-state='info'] {
  color: #0ea5e9;
}

.field-error {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #dc2626;
  line-height: 1.2;
}

.required-mark {
  color: #dc2626;
  font-weight: 700;
  font-size: 0.82em;
}

/* Marca visual para campos obrigatórios dos formulários */
.form-card label:has(> input[required]:not([type="radio"]):not([type="checkbox"])),
.form-card label:has(> select[required]),
.form-card label:has(> textarea[required]),
.aventura-form label:has(> input[required]:not([type="radio"]):not([type="checkbox"])),
.aventura-form label:has(> select[required]),
.aventura-form label:has(> textarea[required]) {
  position: relative;
}

.form-card label:has(> input[required]:not([type="radio"]):not([type="checkbox"]))::after,
.form-card label:has(> select[required])::after,
.form-card label:has(> textarea[required])::after,
.aventura-form label:has(> input[required]:not([type="radio"]):not([type="checkbox"]))::after,
.aventura-form label:has(> select[required])::after,
.aventura-form label:has(> textarea[required])::after {
  content: " *";
  color: #dc2626;
  font-weight: 700;
}
.input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.register-card {
  text-align: center;
  gap: 1rem;
}

.register-card h2 {
  margin-top: 0;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
}

.option-card {
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.option-card strong {
  font-size: 1rem;
}

.option-card span {
  font-size: 0.9rem;
  color: #475569;
}

.option-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
}

.summary-card--photo {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.summary-card-content {
  flex: 1;
}

.documentos-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1.5rem;
}

.documentos-col h3 {
  margin-bottom: 0.75rem;
}

.documentos-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.documentos-lista li a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #0f172a;
}

.documentos-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.documentos-link {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #0f172a;
}

.documentos-delete-form {
  margin: 0;
}

.danger {
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
}

.danger:hover {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.6);
}

.documentos-lista li.active a {
  border-color: #6366f1;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.documentos-editor {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 1rem;
}

.documentos-campos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}

.doc-field-group {
  padding: 0.5rem 0.25rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.doc-field-group-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem 0.15rem;
}

.doc-field-pill {
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  border: 1px dashed #94a3b8;
  font-size: 0.85rem;
  background: #f8fafc;
  cursor: grab;
  margin-bottom: 0.4rem;
}

.documentos-canvas-wrap {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  background: #fff;
  overflow: auto;
}

.documentos-canvas {
  position: relative;
  display: inline-block;
}

.documentos-canvas img {
  display: block;
  max-width: 100%;
  height: auto;
}

.doc-field {
  position: absolute;
  padding: 0.2rem 0.35rem;
  border: 1px solid rgba(79, 70, 229, 0.5);
  background: rgba(99, 102, 241, 0.12);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #1f2937;
  cursor: move;
  user-select: none;
  min-width: 40px;
  min-height: 20px;
  white-space: nowrap;
}

.doc-field-selected {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
}

.doc-field-image {
  min-width: 120px;
  min-height: 80px;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
}

.documentos-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.documentos-floating-controls {
  position: absolute;
  z-index: 10;
  width: 260px;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.15);
  display: none;
}

.documentos-floating-controls.show {
  display: block;
}

.documentos-floating-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.documentos-floating-header button {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

.documentos-floating-controls input {
  width: 100%;
}

.documentos-gerar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.doc-select {
  width: 100%;
  margin-bottom: 0.5rem;
}

.small-link {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

.small-link.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.form-compact input,
.form-compact select {
  margin-bottom: 0.6rem;
}

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

  .documentos-editor {
    grid-template-columns: 1fr;
  }
}

.confirmation-photo {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.field-section {
  background: #f8fafc;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.6rem;
}

.field-section h2 {
  margin-bottom: 0.15rem;
}

.section-block {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 1.25rem;
  display: grid;
  gap: 0.8rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.section-header span {
  font-weight: 700;
  color: #6366f1;
}

.section-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.form-row label {
  font-size: 0.95rem;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row input {
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: 0.95rem;
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.checkbox-grid.extensive {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.checkbox-grid.dois-colunas {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.question-grid {
  display: grid;
  gap: 0.6rem;
}

.question-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.follow-up-row {
  display: flex;
  flex-direction: column;
}

.panel-note {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.photo-upload {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.photo-upload input[type="file"] {
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  padding: 0.75rem;
  font-size: 0.95rem;
  background: #fff;
}

.photo-preview {
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
}

.photo-preview img {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

#photo-preview-img {
  display: none;
}

.photo-preview-label {
  font-weight: 600;
  color: #0f172a;
}

.photo-note {
  font-size: 0.8rem;
  color: #475569;
}

.checkbox-full {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
}

.checkbox-full input {
  width: 1rem;
  height: 1rem;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.field-section label {
  font-size: 0.95rem;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-section input {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
  background: #fff;
}

.row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  width: 100%;
}

.inline-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.inline-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) repeat(4, minmax(110px, 1fr));
  gap: 0.4rem;
  align-items: center;
}

.inline-space {
  grid-column: span 3;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.checkbox-grid.extensive {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.checkbox-grid.dois-colunas {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.radio-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-weight: 500;
}

.question-grid {
  display: grid;
  gap: 0.6rem;
}

.question-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #1f2937;
}

.question-row span {
  min-width: 220px;
}

.follow-up-row {
  flex-direction: column;
  align-items: flex-start;
}

.panel-note {
  margin: 0;
  color: #475569;
  font-size: 0.85rem;
}

.panel-note--tight {
  font-size: 0.8rem;
  line-height: 1.4;
  margin-top: -0.25rem;
}

.checkbox-full {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
  color: #0f172a;
}

.checkbox-full input {
  width: 1rem;
  height: 1rem;
}


.registration-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group,
.common-fields {
  display: grid;
  gap: 0.65rem;
}

.story {
  min-height: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.signature-preview {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #475569;
}

.signature-preview img {
  width: 100%;
  max-width: 320px;
  border: 1px dashed #cbd5f5;
  border-radius: 10px;
  min-height: 80px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .page-shell {
    padding: 2rem;
  }

  .login-card {
    padding: 1.75rem;
  }

  .login-helpers {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Painel inicial */
.painel-page {
  margin: 0;
  min-height: 100vh;
  background: #eef2ff;
  color: #0f172a;
  display: block;
  padding: 0;
}

.painel-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem 1.25rem;
  border-right: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

.painel-sidebar .logo {
  width: 72px;
  margin: 0;
}

.painel-sidebar-brand h1 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.painel-sidebar-toggle {
  display: none;
}

.painel-logo-wrap {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

.painel-profile-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.35rem;
}

.painel-profile-value {
  position: relative;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f8fafc;
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.22), rgba(14, 165, 233, 0.06)),
    rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(147, 197, 253, 0.38);
  border-left: 4px solid #38bdf8;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  line-height: 1.35;
  margin-bottom: 1rem;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.2),
    0 10px 20px rgba(2, 6, 23, 0.35);
  text-transform: none;
  word-break: break-word;
}

.painel-profile-switch {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.painel-profile-switch label {
  font-size: 0.78rem;
  color: #bfdbfe;
}

.painel-profile-switch select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.35);
  background: #0b1226;
  color: #f8fafc;
  padding: 0.45rem 0.55rem;
}

.painel-profile-all {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.painel-menu-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-bottom: 0.75rem;
}

.painel-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
}

.painel-menu ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.painel-menu li span {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.painel-menu li a {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  text-decoration: none;
}

.painel-menu li a:hover {
  background: rgba(51, 65, 85, 0.95);
}

.painel-content {
  margin-left: 280px;
  min-height: 100vh;
  padding: 2rem;
  background: #ffffff;
}

.painel-header h2 {
  margin: 0.25rem 0 0.6rem;
  font-size: 2rem;
}

.painel-header p {
  color: #334155;
}

.painel-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.painel-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.painel-card h3 {
  margin-bottom: 0.5rem;
}

.avatar-list {
  display: grid;
  gap: 0.75rem;
}

.avatar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #0f172a;
}

.avatar-item img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.6rem;
}

.users-table input[type="text"] {
  width: 100%;
  min-width: 160px;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.wa-contact {
  display: grid;
  gap: 0.15rem;
}

.wa-username {
  font-weight: 800;
  color: #0f172a;
}

.wa-name {
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.2;
}

.wa-phone-cell input[type="text"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.message-template-wrap {
  display: grid;
  gap: 0.8rem;
}

.message-template-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.message-template-card {
  display: grid;
  gap: 0.45rem;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 0.75rem;
}

.message-template-title {
  font-weight: 700;
  color: #0f172a;
}

.message-template-card textarea {
  width: 100%;
  min-height: 135px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  padding: 0.7rem;
  font-size: 0.92rem;
  line-height: 1.4;
  resize: vertical;
}

@media (max-width: 640px) {
  /* Tabela WhatsApp vira cards para celular */
  .whatsapp-table thead {
    display: none;
  }

  .whatsapp-table tr {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.65rem;
    background: #ffffff;
  }

  .whatsapp-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: none;
    padding: 0.45rem 0;
  }

  .whatsapp-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #0f172a;
    min-width: 92px;
  }

  .whatsapp-table td[data-label="Contato"] {
    align-items: flex-start;
  }

  .wa-contact {
    gap: 0.1rem;
  }

  .whatsapp-table input[type="text"] {
    min-width: 0;
  }

  .whatsapp-table td[data-label="Telefone"] input[type="text"] {
    width: min(220px, 100%);
  }

  .whatsapp-table td[data-label="Cadastro"],
  .whatsapp-table td[data-label="Teste"] {
    align-items: center;
  }

  .whatsapp-table td[data-label="Cadastro"] input[type="checkbox"],
  .whatsapp-table td[data-label="Teste"] input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
  }
}

@media (max-width: 1100px) {
  .painel-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    overflow: visible;
    padding: 0.9rem 1rem;
  }

  .painel-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    grid-area: toggle;
    border: 1px solid rgba(147, 197, 253, 0.55);
    border-radius: 12px;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #eff6ff;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0.58rem 0.92rem;
    min-height: 46px;
    min-width: 102px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.35);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  }

  .painel-sidebar-toggle:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 22px rgba(30, 64, 175, 0.4);
  }

  .painel-sidebar-toggle:active {
    transform: translateY(1px);
  }

  .painel-sidebar-toggle:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
  }

  .painel-sidebar .painel-menu,
  .painel-sidebar .painel-profile-title,
  .painel-sidebar .painel-profile-value,
  .painel-sidebar .painel-profile-switch,
  .painel-sidebar .painel-profile-all {
    display: none;
  }

  .painel-sidebar.is-open .painel-menu {
    display: block;
  }

  .painel-sidebar.is-open .painel-profile-title {
    display: inline-flex;
  }

  .painel-sidebar.is-open .painel-profile-value {
    display: block;
  }

  .painel-sidebar.is-open .painel-profile-switch {
    display: grid;
  }

  .painel-sidebar.is-open .painel-profile-all {
    display: block;
  }

  .painel-content {
    margin-left: 0;
    padding: 1.25rem;
  }

  .painel-sidebar-brand {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo title toggle";
    column-gap: 0.85rem;
    align-items: center;
  }

  .painel-sidebar.is-open .painel-sidebar-brand {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logo title toggle"
      "logo profiletitle profiletitle"
      "logo profilevalue profilevalue";
  }

  .painel-logo-wrap {
    grid-area: logo;
    width: 70px;
    height: 70px;
    margin: 0;
  }

  .painel-sidebar-brand h1 {
    grid-area: title;
    margin: 0;
  }

  .painel-profile-title {
    grid-area: profiletitle;
    margin: 0;
  }

  .painel-profile-value {
    grid-area: profilevalue;
    margin: 0;
  }

  .painel-profile-switch {
    grid-column: 1 / -1;
    margin-top: 0.6rem;
    margin-bottom: 0.5rem;
  }

  .painel-profile-all {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .painel-menu {
    overflow: visible;
    min-height: auto;
    padding-right: 0;
  }
}

/* Melhorias extras de responsividade para formularios em celular */
.form-row select,
.form-row textarea,
.field-section select,
.field-section textarea,
.login-form select,
.login-form textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: 0.95rem;
}

.form-row textarea,
.field-section textarea,
.login-form textarea {
  min-height: 96px;
  resize: vertical;
}

@media (max-width: 768px) {
  body {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .page-shell {
    padding: 1rem;
    border-radius: 18px;
    gap: 1rem;
    grid-template-columns: 1fr;
  }

  .branding {
    text-align: center;
  }

  .login-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .section-block,
  .field-section {
    padding: 0.9rem;
    border-radius: 14px;
  }

  .form-row,
  .row-grid,
  .checkbox-grid,
  .checkbox-grid.extensive,
  .checkbox-grid.dois-colunas {
    grid-template-columns: 1fr;
  }

  .inline-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .inline-space {
    grid-column: span 1;
  }

  .question-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-row span {
    min-width: 0;
  }

  .radio-row,
  .radio-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .action-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .action-row .primary,
  .action-row .secondary,
  .action-row button,
  .action-row a {
    width: 100%;
    text-align: center;
  }

  .photo-preview img {
    width: 110px;
    height: 140px;
  }

  .users-table {
    min-width: 680px;
  }

  .painel-card {
    overflow-x: auto;
  }
}
