  .form-header {
    background: linear-gradient(135deg, rgba(15, 76, 138, 0.10) 0%, rgba(63, 184, 232, 0.10) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(63, 184, 232, 0.20);
    backdrop-filter: blur(10px);
    animation: slideInDown 0.5s ease;
  }

  @keyframes slideInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #79dcff 0%, #1f7fba 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
  }

  .form-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .form-card .card-body {
    padding: 2rem;
  }

  .form-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .form-label::before {
    content: '';
    width: 3px;
    height: 16px;
    background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
    border-radius: 2px;
  }

  .form-control, .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(63, 184, 232, 0.20);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-size: 0.95rem;
  }

  .form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3fb8e8;
    box-shadow: 0 0 0 0.25rem rgba(63, 184, 232, 0.20), 0 4px 12px rgba(31, 127, 186, 0.18);
    transform: translateY(-2px);
  }

  .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
  }

  .form-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(63, 184, 232, 0.30);
  }

  .text-danger {
    color: #ef4444 !important;
    font-weight: 600;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    margin-top: 0.5rem;
    display: inline-block;
    animation: shake 0.5s ease;
  }

  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
  }

/* ===== Permissões (grid & cards) ===== */
.user-perms .perm-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
.user-perms .perm-item:hover {
  background: rgba(63, 184, 232, 0.05);
  border-color: rgba(63, 184, 232, 0.20);
}

/* mantém o switch DENTRO do card (anula margin-left negativo do BS) */
.user-perms .form-switch .form-check-input {
  margin-left: 5 !important;
}

/* visual do switch */
.user-perms .form-check-input {
  width: 3rem;
  height: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(63, 184, 232, 0.30);
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: inset 0 0 0 8px transparent;
}
.user-perms .form-check-input:checked {
  background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.25rem rgba(63, 184, 232, 0.20);
}

/* label e foco */
.user-perms .form-check-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
}
.user-perms .form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(63, 184, 232, 0.20);
}

  .card-footer {
    background: linear-gradient(135deg, rgba(15, 76, 138, 0.05) 0%, rgba(63, 184, 232, 0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
  }

  .btn {
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .btn:hover::before {
    width: 300px;
    height: 300px;
  }

  .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  .btn-primary {
    background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(31, 127, 186, 0.40);
  }

  .btn-primary:hover {
    box-shadow: 0 6px 25px rgba(63, 184, 232, 0.35);
  }

  .btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
  }

  .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
  }

  .alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    animation: slideInRight 0.5s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(50px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  }

  .alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  }

  .alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  }

  .alert-info {
    background: linear-gradient(135deg, #0f4c8a 0%, #1f7fba 100%);
  }

  .input-group {
    position: relative;
  }

  .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
    pointer-events: none;
  }

  .has-icon .form-control,
  .has-icon .form-select {
    padding-left: 3rem;
  }

  .section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(63, 184, 232, 0.5), transparent);
    margin: 2rem 0;
    position: relative;
  }

  .section-divider::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.9);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
  }

  /* controle do select */
  select, .form-select {
    background: #3a4b5c;
    color: #e8eaf0;
    border: 1px solid #4d6f90;
    border-radius: .6rem;
  }
  select:focus, .form-select:focus {
    border-color: #79dcff;
    box-shadow: 0 0 0 .25rem rgba(121,220,255,.25);
  }

  /* opções no dropdown (funciona bem em Chrome/Edge; no macOS/iOS é limitado) */
  select option { background: #3a4b5c; color: #e8eaf0; }
  select option:hover { background: #3a4b5c; color: #fff; }
  select option:checked { background: #1f7fba !important; color: #fff; }

/* ===== ANIMÇÃO CAMPOS ===== */

    /* Reaproveita seu fadeInUp do home */
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(30px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    /* Saída suave para baixo */
    @keyframes fadeOutDown {
      from { opacity: 1; transform: translateY(0); }
      to   { opacity: 0; transform: translateY(20px); }
    }

    /* Contêiner animável */
    .anim-field {
      will-change: transform, opacity;
    }

    /* Estados de animação controlados via JS */
    .anim-enter {
      animation: fadeInUp .35s ease-out both;
    }
    .anim-exit {
      animation: fadeOutDown .25s ease-in both;
    }

    /* Se quiser bloquear clique durante saída */
    .anim-exit,
    .anim-hidden {
      pointer-events: none;
    }

    /* Estado oculto sem usar d-none (pra animação rodar antes) */
    .anim-hidden {
      opacity: 0;
      transform: translateY(20px);
      height: 0;
      margin: 0 !important;
      overflow: hidden;
    }

    /* Respeita usuários com “reduzir animações” */
    @media (prefers-reduced-motion: reduce) {
      .anim-enter, .anim-exit { animation: none !important; }
      .anim-hidden { transition: none !important; }
    }

/* ===== Dropdown dark legível para <select class="form-select"> ===== */
/* Grupo (rótulo do optgroup) */
.form-select optgroup {
  background-color: #35495f;
  color: #b7d7e6;
  font-weight: 600;
}

/* Fonte resultados processamento */
/* tamanho bem visível para campos calculados */
.input-xl {
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* mantém contraste em readonly/disabled */
.input-xl[readonly],
.input-xl:disabled {
  background-color: var(--bs-body-bg, #fff) !important;
  opacity: 1 !important;
}

/* opcional: um destaque suave pros resultados */
.calc-result {
  background: rgba(13,110,253,0.06) !important;
  border-color: rgba(13,110,253,0.35) !important;
}

/* centraliza o texto dos resultados */
.centered-result {
  text-align: center !important;
}

/* se quiser remover as setinhas do input number */
.centered-result::-webkit-outer-spin-button,
.centered-result::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.centered-result { -moz-appearance: textfield; }

/* se aparentar descentrado verticalmente, ajuste o padding: */
.centered-result {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* ==========================================
   FORMS.CSS — TEMA CLARO (override)
   Ativo quando: <html data-bs-theme="light">
   ========================================== */

/* Header */
:root[data-bs-theme="light"] .form-header {
  background: linear-gradient(135deg, rgba(15,76,138,0.10) 0%, rgba(63,184,232,0.10) 100%);
  border: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
}

/* Card base */
:root[data-bs-theme="light"] .form-card {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
:root[data-bs-theme="light"] .form-card .card-body { color: #101622; }

/* Labels */
:root[data-bs-theme="light"] .form-label {
  color: #1b2130;
}
:root[data-bs-theme="light"] .form-label::before {
  background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
}

/* Inputs & selects */
:root[data-bs-theme="light"] .form-control,
:root[data-bs-theme="light"] .form-select {
  background: rgba(0,0,0,0.03);
  border: 2px solid rgba(13,110,253,0.22);
  color: #101622;
}
:root[data-bs-theme="light"] .form-control:focus,
:root[data-bs-theme="light"] .form-select:focus {
  background: rgba(0,0,0,0.04);
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.20), 0 4px 12px rgba(13,110,253,0.18);
  transform: translateY(-2px);
}
:root[data-bs-theme="light"] .form-control::placeholder {
  color: rgba(0,0,0,0.45);
}

/* Help text */
:root[data-bs-theme="light"] .form-text {
  color: rgba(0,0,0,0.70);
  border-left: 2px solid rgba(13,110,253,0.25);
}

/* Erros (mantém cor, ajusta contraste do fundo) */
:root[data-bs-theme="light"] .text-danger {
  background: rgba(239,68,68,0.08);
  color: #b91c1c !important;
}

/* Permissões (cards + switches) */
:root[data-bs-theme="light"] .user-perms .perm-item {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.08);
}
:root[data-bs-theme="light"] .user-perms .perm-item:hover {
  background: rgba(13,110,253,0.06);
  border-color: rgba(13,110,253,0.22);
}
:root[data-bs-theme="light"] .user-perms .form-check-input {
  background: rgba(0,0,0,0.06);
  border: 2px solid rgba(13,110,253,0.26);
  box-shadow: inset 0 0 0 8px transparent;
}
:root[data-bs-theme="light"] .user-perms .form-check-input:checked {
  background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.20);
}
:root[data-bs-theme="light"] .user-perms .form-check-label { color: #101622; }

/* Rodapé do card */
:root[data-bs-theme="light"] .card-footer {
  background: linear-gradient(135deg, rgba(15,76,138,0.06) 0%, rgba(63,184,232,0.06) 100%);
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* Botões */
:root[data-bs-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
  box-shadow: 0 6px 20px rgba(13,110,253,0.25);
}
:root[data-bs-theme="light"] .btn-primary:hover {
  box-shadow: 0 10px 28px rgba(13,110,253,0.32);
}
:root[data-bs-theme="light"] .btn-outline-secondary {
  border: 2px solid rgba(0,0,0,0.25);
  color: #1b2130;
}
:root[data-bs-theme="light"] .btn-outline-secondary:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.38);
  color: #101622;
}

/* Alerts */
:root[data-bs-theme="light"] .alert {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
:root[data-bs-theme="light"] .alert-success {
}
:root[data-bs-theme="light"] .alert-danger { }
:root[data-bs-theme="light"] .alert-warning { }
:root[data-bs-theme="light"] .alert-info { }

/* Input com ícone à esquerda */
:root[data-bs-theme="light"] .input-icon {
  color: rgba(0,0,0,0.45);
}

/* Divisor de seção */
:root[data-bs-theme="light"] .section-divider::after {
  background: rgba(255,255,255,0.90);
  color: #1b2130;
  border: 1px solid rgba(0,0,0,0.06);
}

/* Selects (corpo e opções) */
:root[data-bs-theme="light"] select,
:root[data-bs-theme="light"] .form-select {
  background: #f3f6ff;
  color: #101622;
  border: 1px solid #c6d2f5;
}
:root[data-bs-theme="light"] select:focus,
:root[data-bs-theme="light"] .form-select:focus {
  border-color: #3fb8e8;
  box-shadow: 0 0 0 .25rem rgba(63,184,232,.20);
}
:root[data-bs-theme="light"] select option,
:root[data-bs-theme="light"] .form-select option {
  background: #f3f6ff;
  color: #101622;
}

/* Optgroup legível no claro */
:root[data-bs-theme="light"] .form-select optgroup {
  background-color: #eaf4ff;
  color: #27304a;
}

/* Campos “XL” de resultado */
:root[data-bs-theme="light"] .calc-result {
  background: rgba(13,110,253,0.06) !important;
  border-color: rgba(13,110,253,0.35) !important;
}
:root[data-bs-theme="light"] .centered-result { color: #101622; }

/* =========================
   MODAIS ESPECIAIS (QR/Unlock)
   ========================= */

/* BOTAO COLETOR DE DADOS */

.btn-sense-inteligente {
  position: relative;
  background: linear-gradient(135deg, #0f4c8a 0%, #3fb8e8 100%);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(31, 127, 186, 0.40);
}

.btn-sense-inteligente:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(63, 184, 232, 0.35);
}

.btn-sense-inteligente:active {
  transform: translateY(0);
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.btn-content svg {
  animation: rotate 3s linear infinite;
}

.star {
  position: absolute;
  font-size: 14px;
  animation: sparkle 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.star-1 {
  top: -8px;
  left: 15%;
  animation-delay: 0s;
}

.star-2 {
  top: 50%;
  left: -10px;
  animation-delay: 0.5s;
}

.star-3 {
  bottom: -8px;
  left: 40%;
  animation-delay: 1s;
}

.star-4 {
  top: 15%;
  right: -10px;
  animation-delay: 1.5s;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5) translateY(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) translateY(-8px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== TABELA DE ITENS DO PEDIDO (baseada em list.css .table-soft) ===== */

/* Header da tabela - igual list.css */
.itens-table-container .table-soft thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg,
              rgba(255, 255, 255, 0.22) 0%,
              rgba(255, 255, 255, 0.10) 100%);
  color: #f5f8ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  padding: 0.9rem 1rem;
}

/* Alinhamento do header para colunas específicas */
.itens-table-container .table-soft thead th.text-end {
  text-align: right;
}

.itens-table-container .table-soft thead th.text-center {
  text-align: center;
}

/* Barra de realce ao passar o mouse no th */
.itens-table-container .table-soft thead th::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  margin-top: 0.4rem;
  background: linear-gradient(135deg, #0f4c8a, #3fb8e8);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.itens-table-container .table-soft thead th:hover::after {
  width: 36%;
}

/* Células do corpo - igual list.css */
.itens-table-container .table-soft tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #dee6fb;
}

/* Listras suaves para leitura */
.itens-table-container .table-soft tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.055);
}

/* Hover: eleva e clareia a linha */
.itens-table-container .table-soft tbody tr {
  transition: transform 0.18s ease, background 0.18s ease;
}

.itens-table-container .table-soft tbody tr:hover td {
  background: rgba(255, 255, 255, 0.12);
}

.itens-table-container .table-soft tbody tr:hover {
  transform: translateY(-1px);
}

/* Primeira e última coluna com cantos arredondados */
.itens-table-container .table-soft thead th:first-child,
.itens-table-container .table-soft tbody tr td:first-child {
  border-left: 0;
}

.itens-table-container .table-soft thead th:last-child,
.itens-table-container .table-soft tbody tr td:last-child {
  border-right: 0;
}

.itens-table-container .table-soft thead tr:first-child th:first-child {
  border-top-left-radius: 14px;
}

.itens-table-container .table-soft thead tr:first-child th:last-child {
  border-top-right-radius: 14px;
}

.itens-table-container .table-soft tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.itens-table-container .table-soft tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

/* Textarea de observações */
.itens-table-container .table-soft textarea.form-control {
  min-height: 45px;
  resize: vertical;
}

/* Checkbox de DELETE */
.itens-table-container .table-soft input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  accent-color: #ef4444;
  transition: all 0.2s ease;
}

.itens-table-container .table-soft input[type="checkbox"]:hover {
  transform: scale(1.1);
}

/* Erros dentro da tabela */
.itens-table-container .table-soft .text-danger,
.itens-table-container .table-soft .errorlist {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  margin-top: 0.3rem;
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  color: #ef4444 !important;
}

/* Estado vazio (se não houver itens) */
.itens-table-container .empty-state {
  background: rgba(255, 255, 255, 0.04);
  color: #cfd8ff;
  text-align: center;
  padding: 2rem 1rem !important;
}

.itens-table-container .empty-state i {
  font-size: 1.7rem;
  display: block;
  margin-bottom: 0.25rem;
  opacity: 0.9;
}

/* Responsividade */
@media (max-width: 768px) {
  .itens-table-container .table-soft thead th,
  .itens-table-container .table-soft tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .itens-table-container .table-soft .form-control,
  .itens-table-container .table-soft .form-select {
    min-width: 120px;
    font-size: 0.85rem;
  }
}

/* ===== TEMA CLARO - TABELA DE ITENS ===== */

:root[data-bs-theme="light"] .itens-header {
  background: linear-gradient(135deg, rgba(15, 76, 138, 0.10) 0%, rgba(63, 184, 232, 0.10) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

:root[data-bs-theme="light"] .itens-header h2 {
  color: #1b2130;
}

:root[data-bs-theme="light"] .itens-header p {
  color: rgba(0, 0, 0, 0.65);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft {
  background: rgba(255, 255, 255, 0.86);
  color: #1b2130;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft thead th {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.02) 100%);
  color: #101622;
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft thead th::after {
  background: linear-gradient(135deg, #0f4c8a, #3fb8e8);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft tbody td {
  background: rgba(0, 0, 0, 0.02);
  color: #1b2130;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.035);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft tbody tr:hover td {
  background: rgba(13, 110, 253, 0.08);
}

:root[data-bs-theme="light"] .itens-table-container .table-soft .form-control,
:root[data-bs-theme="light"] .itens-table-container .table-soft .form-select {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(13, 110, 253, 0.26);
  color: #101622;
}

:root[data-bs-theme="light"] .itens-table-container .table-soft .form-control:focus,
:root[data-bs-theme="light"] .itens-table-container .table-soft .form-select:focus {
  background: rgba(0, 0, 0, 0.06);
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.20);
}

:root[data-bs-theme="light"] .itens-table-container .empty-state {
  background: rgba(0, 0, 0, 0.03);
  color: #33415c;
}

/* ===== ITENS DA VENDA - TEMA ESCURO ===== */
/* ===== ITENS DA VENDA - TEMA ESCURO (mesma paleta da tabela) ===== */

#itensContainer {
  margin-top: 0.75rem;
}

/* Card de cada item de venda */
#itensContainer .item-venda-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color: #f5f8ff;
}

#itensContainer .item-venda-card .card-body {
  padding: 1rem 1.1rem 1.1rem;
}

/* Inputs dentro do card do item */
#itensContainer .item-venda-card .form-control,
#itensContainer .item-venda-card .form-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #dee6fb;
}

#itensContainer .item-venda-card .form-control::placeholder {
  color: rgba(245, 248, 255, 0.6);
}

#itensContainer .item-venda-card .form-control:focus,
#itensContainer .item-venda-card .form-select:focus {
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.15rem rgba(63, 184, 232, 0.30);
}

/* Botão de lixeira */
#itensContainer .item-venda-card .btn-outline-danger {
  border-radius: 999px;
  border-width: 1px;
}

/* ===== BLOCO "DOSES DISPONÍVEIS" - TEMA ESCURO ===== */

.doses-selection-container {
  margin-top: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 0.75rem 0.9rem 0.9rem;
}

/* Cabeçalho interno do bloco de doses */
.doses-selection-container .doses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.doses-selection-container .doses-header strong {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f5f8ff;
}

.doses-selection-container .doses-header .doses-count {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #cfd8ff;
  opacity: 0.9;
}

/* Contêiner onde as doses (checkboxes) são renderizadas via JS */
.doses-selection-container .doses-container {
  margin-top: 0.55rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

/* Cada "linha" de dose */
.doses-selection-container .dose-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fbdede;
  font-size: 0.8rem;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* ===== TEXTO DAS DOSES (CÓDIGO + DETALHES) ===== */

/* layout interno */
.doses-selection-container .dose-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Tema escuro */
.doses-selection-container .dose-codigo {
  font-weight: 600;
  color: #f5f8ff;
}

.doses-selection-container .dose-detalhes {
  font-size: 0.78rem;
  color: #cfd8ff;
  opacity: 0.95;
}

/* Tema claro */
:root[data-bs-theme="light"] .doses-selection-container .dose-codigo {
  font-weight: 600;
  color: #101622;
}

:root[data-bs-theme="light"] .doses-selection-container .dose-detalhes {
  font-size: 0.78rem;
  color: #4b5563;
}

.doses-selection-container .dose-checkbox:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Checkbox das doses */
.doses-selection-container input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #1f7fba;
  cursor: pointer;
}

/* Botões "Todas / Nenhuma / Auto" */
.doses-selection-container .btn-group .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Tonalidades combinando com a tabela */
.doses-selection-container .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  color: #e5e7ff;
}

.doses-selection-container .btn-outline-secondary:hover,
.doses-selection-container .btn-outline-secondary:focus {
  background: linear-gradient(
    135deg,
    rgba(15, 76, 138, 0.18),
    rgba(63, 184, 232, 0.22)
  );
  color: #f5f8ff;
}

.doses-selection-container .btn-outline-primary {
  border-color: #3fb8e8;
  color: #f5f8ff;
  background: linear-gradient(
    135deg,
    rgba(15, 76, 138, 0.28),
    rgba(63, 184, 232, 0.32)
  );
}

.doses-selection-container .btn-outline-primary:hover,
.doses-selection-container .btn-outline-primary:focus {
  background: linear-gradient(135deg, #0f4c8a, #3fb8e8);
  border-color: #3fb8e8;
  color: #ffffff;
}

/* Mensagens de erro dentro do card do item */
#itensContainer .item-venda-card .text-danger,
#itensContainer .item-venda-card .errorlist {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  margin-top: 0.3rem;
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  color: #ef4444 !important;
}

/* ===== TEMA CLARO - ITENS DA VENDA E DOSES (mesma paleta da tabela) ===== */

:root[data-bs-theme="light"] #itensContainer .item-venda-card {
  background: linear-gradient(
    135deg,
    rgba(15, 76, 138, 0.10) 0%,
    rgba(63, 184, 232, 0.10) 100%
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  color: #1b2130;
}

:root[data-bs-theme="light"] #itensContainer .item-venda-card .form-label {
  color: #1b2130;
}

:root[data-bs-theme="light"] #itensContainer .item-venda-card .form-control,
:root[data-bs-theme="light"] #itensContainer .item-venda-card .form-select {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(13, 110, 253, 0.26);
  color: #101622;
}

:root[data-bs-theme="light"] #itensContainer .item-venda-card .form-control:focus,
:root[data-bs-theme="light"] #itensContainer .item-venda-card .form-select:focus {
  background: rgba(0, 0, 0, 0.06);
  border-color: #3fb8e8;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.20);
}

/* Bloco de doses no tema claro */
:root[data-bs-theme="light"] .doses-selection-container {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

:root[data-bs-theme="light"] .doses-selection-container .doses-header {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

:root[data-bs-theme="light"] .doses-selection-container .doses-header strong {
  color: #1b2130;
}

:root[data-bs-theme="light"] .doses-selection-container .doses-header .doses-count {
  color: rgba(0, 0, 0, 0.6);
}

:root[data-bs-theme="light"] .doses-selection-container .doses-container {
  background: rgba(0, 0, 0, 0.02);
}

:root[data-bs-theme="light"] .doses-selection-container .dose-checkbox {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1b2130;
}

:root[data-bs-theme="light"] .doses-selection-container .dose-checkbox:hover {
  background: rgba(13, 110, 253, 0.08);
}

/* Botões no tema claro */
:root[data-bs-theme="light"] .doses-selection-container .btn-outline-secondary {
  border-color: rgba(13, 110, 253, 0.4);
  color: #1b2130;
}

:root[data-bs-theme="light"] .doses-selection-container .btn-outline-secondary:hover,
:root[data-bs-theme="light"] .doses-selection-container .btn-outline-secondary:focus {
  background: rgba(13, 110, 253, 0.08);
  color: #0b1630;
}

:root[data-bs-theme="light"] .doses-selection-container .btn-outline-primary {
  border-color: #3fb8e8;
  background: linear-gradient(
    135deg,
    rgba(15, 76, 138, 0.14),
    rgba(63, 184, 232, 0.16)
  );
  color: #101622;
}

:root[data-bs-theme="light"] .doses-selection-container .btn-outline-primary:hover,
:root[data-bs-theme="light"] .doses-selection-container .btn-outline-primary:focus {
  background: linear-gradient(135deg, #0f4c8a, #3fb8e8);
  border-color: #3fb8e8;
  color: #ffffff;
}

    /* Campos preenchidos automaticamente pelo sensor – não editáveis e não selecionáveis */
    .campo-sensor-ambiental {
      pointer-events: none;
      user-select: none;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      caret-color: transparent;
      background-color: #ffffff00;
      cursor: default;
      font-weight: bold;
    }


    .upload-box {
      border: 1px dashed rgba(255,255,255,.18);
      border-radius: 14px;
      padding: 1rem;
      background: rgba(255,255,255,.02);
      height: 100%;
    }

    .upload-box .form-text {
      opacity: .9;
    }

    .doc-list {
      margin-top: .75rem;
      padding-left: 0;
      list-style: none;
    }

    .doc-list li + li {
      margin-top: .5rem;
    }

    .doc-row {
      display: flex;
      align-items: center;
      gap: .6rem;
      flex-wrap: wrap;
      padding: .7rem .8rem;
      border-radius: 12px;
      background: rgba(255,255,255,.03);
      border: 1px solid rgba(255,255,255,.06);
    }

    .doc-link {
      font-weight: 500;
      text-decoration: none;
      word-break: break-word;
    }

    .doc-link:hover {
      text-decoration: underline;
    }

    .doc-badge {
      display: inline-block;
      font-size: .72rem;
      padding: .18rem .45rem;
      border-radius: 999px;
      background: rgba(13,110,253,.12);
      color: var(--bs-primary);
    }

    .doc-user {
      font-size: .82rem;
      color: var(--bs-secondary-color);
    }

    .doc-accordion {
      display: flex;
      flex-direction: column;
      gap: .85rem;
      margin-top: 1rem;
    }

    .doc-accordion-item {
      border: 1px solid rgba(255,255,255,.10);
      border-radius: 16px;
      background: rgba(255,255,255,.025);
      overflow: hidden;
    }

    .doc-accordion-header {
      margin: 0;
    }

    .doc-accordion-button {
      width: 100%;
      border: 0;
      background: transparent;
      color: inherit;
      text-align: left;
      padding: 1rem 1.1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      font-weight: 700;
      font-size: .98rem;
      transition: background .2s ease, color .2s ease;
    }

    .doc-accordion-button:hover {
      background: rgba(255,255,255,.04);
    }

    .doc-accordion-button .left {
      display: flex;
      align-items: center;
      gap: .75rem;
      min-width: 0;
    }

    .doc-accordion-button .left i {
      font-size: 1rem;
      opacity: .9;
    }

    .doc-step {
      width: 28px;
      height: 28px;
      min-width: 28px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: .78rem;
      font-weight: 700;
      background: rgba(13,110,253,.14);
      color: var(--bs-primary);
      border: 1px solid rgba(13,110,253,.22);
    }

    .doc-accordion-button .right {
      display: flex;
      align-items: center;
      gap: .75rem;
      flex-shrink: 0;
    }

    .doc-count {
      font-size: .74rem;
      padding: .2rem .5rem;
      border-radius: 999px;
      background: rgba(13,110,253,.12);
      color: var(--bs-primary);
      font-weight: 600;
    }

    .doc-chevron {
      transition: transform .25s ease;
      font-size: .95rem;
    }

    .doc-accordion-button[aria-expanded="true"] .doc-chevron {
      transform: rotate(180deg);
    }

    .doc-accordion-collapse {
      display: none;
      border-top: 1px solid rgba(255,255,255,.08);
    }

    .doc-accordion-collapse.is-open {
      display: block;
    }

    .doc-accordion-body {
      padding: 1rem 1.1rem 1.1rem;
    }

/* =======================================================
   PEDIGREE PREVIEW
   ======================================================= */

.pedigree-wrapper {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  overflow-x: auto;
  overflow-y: hidden;
}

.pedigree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pedigree-header h6 {
  margin: 0;
  font-weight: 700;
}

.pedigree-helper {
  font-size: .85rem;
  color: var(--bs-secondary-color);
  margin: 0;
}

/*
  Estrutura correta:
  7 colunas:
  1 card reprodutor
  2 conexão
  3 pai/mãe
  4 conexão
  5 avós
  6 conexão
  7 bisavós

  8 linhas:
  uma linha para cada bisavô/bisavó.
*/
.pedigree-chart {
  --pedigree-line-color: rgba(255,255,255,.16);
  --pedigree-line-size: 1px;
  --pedigree-connector-w: 2.2rem;

  position: relative;
  display: grid;
  grid-template-columns:
    minmax(280px, 1.25fr)
    var(--pedigree-connector-w)
    minmax(240px, 1fr)
    var(--pedigree-connector-w)
    minmax(240px, 1fr)
    var(--pedigree-connector-w)
    minmax(240px, 1fr);
  grid-template-rows: repeat(8, minmax(86px, auto));
  column-gap: 0;
  row-gap: .85rem;
  align-items: stretch;
  min-width: 1120px;
}

/* Compatibilidade caso ainda exista algum wrapper antigo */
.pedigree-column,
.pedigree-column.column-main {
  display: contents;
}

/* =======================================================
   LINHAS REAIS DO PEDIGREE
   ======================================================= */

/*
  Faz os spans dentro de .pedigree-lines virarem itens diretos do grid.
  Isso é o que corrige o alinhamento.
*/
.pedigree-lines {
  display: contents;
  pointer-events: none;
}

.pedigree-line {
  position: relative;
  z-index: 1;
  display: block;
  pointer-events: none;
  background: var(--pedigree-line-color);
  border-radius: 999px;
}

.pedigree-line.h {
  display: none;
}

.pedigree-line.v {
  width: var(--pedigree-line-size);
  justify-self: center;
  align-self: center;
}

/* Tronco entre Reprodutor e Pai/Mãe */
.line-parents-vertical {
  grid-column: 2;
  grid-row: 1 / 9;
  height: 50%;
}

/* Tronco separado entre Pai e seus pais */
.line-grandparents-paternal {
  grid-column: 4;
  grid-row: 1 / 5;
  height: 50%;
}

/* Tronco separado entre Mãe e seus pais */
.line-grandparents-maternal {
  grid-column: 4;
  grid-row: 5 / 9;
  height: 50%;
}

/* Troncos dos pares de Bisavós */
.line-great-pair-1 {
  grid-column: 6;
  grid-row: 1 / 3;
  height: 50%;
}

.line-great-pair-2 {
  grid-column: 6;
  grid-row: 3 / 5;
  height: 50%;
}

.line-great-pair-3 {
  grid-column: 6;
  grid-row: 5 / 7;
  height: 50%;
}

.line-great-pair-4 {
  grid-column: 6;
  grid-row: 7 / 9;
  height: 50%;
}

/* =======================================================
   CARDS DO PEDIGREE
   ======================================================= */

.pedigree-node {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: .9rem 1rem;
  background: rgba(255,255,255,.03);
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  transition:
    border-color .2s ease,
    transform .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

.pedigree-node:hover {
  transform: translateY(-1px);
  border-color: rgba(13,110,253,.28);
  background: rgba(13,110,253,.04);
}

.pedigree-node-main {
  min-height: 110px;
  border-color: rgba(13,110,253,.28);
  background: rgba(13,110,253,.08);
  box-shadow: 0 10px 30px rgba(13,110,253,.08);
}

.pedigree-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bs-secondary-color);
  margin-bottom: .4rem;
  font-weight: 700;
  line-height: 1.15;
}

.pedigree-name {
  font-weight: 700;
  line-height: 1.22;
  word-break: break-word;
}

.pedigree-rgd {
  margin-top: .18rem;
  font-size: .84rem;
  color: var(--bs-secondary-color);
  word-break: break-word;
}

.pedigree-empty .pedigree-name {
  opacity: .55;
  font-style: italic;
  font-weight: 600;
}

.pedigree-empty .pedigree-rgd {
  opacity: .45;
}

/* Masculino */
.pedigree-node-male {
  border-color: rgba(31, 127, 186, .35);
  background: rgba(31, 127, 186, .10);
  box-shadow: 0 8px 24px rgba(31, 127, 186, .10);
}

.pedigree-node-male:hover {
  border-color: rgba(66, 189, 231, .42);
  background: rgba(31, 127, 186, .14);
}

/* Feminino */
.pedigree-node-female {
  border-color: rgba(226, 119, 146, .35);
  background: rgba(226, 119, 146, .10);
  box-shadow: 0 8px 24px rgba(226, 119, 146, .10);
}

.pedigree-node-female:hover {
  border-color: rgba(244, 160, 181, .42);
  background: rgba(226, 119, 146, .14);
}

/* =======================================================
   POSICIONAMENTO DOS CARDS
   ======================================================= */

/* Coluna 1 — Reprodutor */
.pedigree-principal {
  grid-column: 1;
  grid-row: 1 / 9;
}

/* Coluna 3 — Pai e Mãe */
.pedigree-pai {
  grid-column: 3;
  grid-row: 1 / 5;
}

.pedigree-mae {
  grid-column: 3;
  grid-row: 5 / 9;
}

/* Coluna 5 — Avós */
.pedigree-avo-paterno {
  grid-column: 5;
  grid-row: 1 / 3;
}

.pedigree-avo-paterna {
  grid-column: 5;
  grid-row: 3 / 5;
}

.pedigree-avo-materno {
  grid-column: 5;
  grid-row: 5 / 7;
}

.pedigree-avo-materna {
  grid-column: 5;
  grid-row: 7 / 9;
}

/* Coluna 7 — Bisavós */
.pedigree-bisavo-1 {
  grid-column: 7;
  grid-row: 1;
}

.pedigree-bisavo-2 {
  grid-column: 7;
  grid-row: 2;
}

.pedigree-bisavo-3 {
  grid-column: 7;
  grid-row: 3;
}

.pedigree-bisavo-4 {
  grid-column: 7;
  grid-row: 4;
}

.pedigree-bisavo-5 {
  grid-column: 7;
  grid-row: 5;
}

.pedigree-bisavo-6 {
  grid-column: 7;
  grid-row: 6;
}

.pedigree-bisavo-7 {
  grid-column: 7;
  grid-row: 7;
}

.pedigree-bisavo-8 {
  grid-column: 7;
  grid-row: 8;
}

/* =======================================================
   CONECTORES HORIZONTAIS DOS CARDS
   ======================================================= */

.pedigree-node::before,
.pedigree-node::after {
  content: "";
  position: absolute;
  pointer-events: none;
  height: var(--pedigree-line-size);
  background: var(--pedigree-line-color);
  top: 50%;
  transform: translateY(-50%);
}

/* Saídas para a direita */
.pedigree-principal::after,
.pedigree-pai::after,
.pedigree-mae::after,
.pedigree-avo-paterno::after,
.pedigree-avo-paterna::after,
.pedigree-avo-materno::after,
.pedigree-avo-materna::after {
  left: 100%;
  width: calc(var(--pedigree-connector-w) / 2);
}

/* Entradas pela esquerda */
.pedigree-pai::before,
.pedigree-mae::before,
.pedigree-avo-paterno::before,
.pedigree-avo-paterna::before,
.pedigree-avo-materno::before,
.pedigree-avo-materna::before,
.pedigree-bisavo-1::before,
.pedigree-bisavo-2::before,
.pedigree-bisavo-3::before,
.pedigree-bisavo-4::before,
.pedigree-bisavo-5::before,
.pedigree-bisavo-6::before,
.pedigree-bisavo-7::before,
.pedigree-bisavo-8::before {
  right: 100%;
  width: calc(var(--pedigree-connector-w) / 2);
}

/* Reprodutor não recebe linha pela esquerda */
.pedigree-principal::before {
  display: none;
}

/* Bisavós não têm saída */
.pedigree-bisavo-1::after,
.pedigree-bisavo-2::after,
.pedigree-bisavo-3::after,
.pedigree-bisavo-4::after,
.pedigree-bisavo-5::after,
.pedigree-bisavo-6::after,
.pedigree-bisavo-7::after,
.pedigree-bisavo-8::after {
  display: none;
}

/* =======================================================
   RESPONSIVO
   ======================================================= */

@media (max-width: 1200px) {
  .pedigree-chart {
    min-width: 1040px;
    grid-template-columns:
      minmax(250px, 1.15fr)
      var(--pedigree-connector-w)
      minmax(220px, 1fr)
      var(--pedigree-connector-w)
      minmax(220px, 1fr)
      var(--pedigree-connector-w)
      minmax(220px, 1fr);
  }
}

@media (max-width: 768px) {
  .pedigree-wrapper {
    padding: 1rem;
    margin-inline: -0.25rem;
  }

  .pedigree-chart {
    --pedigree-connector-w: 1.8rem;

    min-width: 960px;
    grid-template-columns:
      230px
      var(--pedigree-connector-w)
      210px
      var(--pedigree-connector-w)
      210px
      var(--pedigree-connector-w)
      210px;
    grid-template-rows: repeat(8, minmax(82px, auto));
    row-gap: .75rem;
  }

  .pedigree-node {
    min-height: 78px;
    padding: .75rem .85rem;
  }

  .pedigree-node-main {
    min-height: 96px;
  }

  .pedigree-label {
    font-size: .64rem;
  }

  .pedigree-name {
    font-size: .9rem;
  }

  .pedigree-rgd {
    font-size: .78rem;
  }
}

/* =======================================================
   ROOT LIGHT — DOCUMENTAÇÃO + PEDIGREE
   ======================================================= */

:root[data-bs-theme="light"] .upload-box,
[data-bs-theme="light"] .upload-box {
  border-color: rgba(7, 20, 34, .14);
  background: rgba(255, 255, 255, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

:root[data-bs-theme="light"] .upload-box .form-text,
[data-bs-theme="light"] .upload-box .form-text {
  color: #5f6b7a;
  opacity: 1;
}

:root[data-bs-theme="light"] .doc-list,
[data-bs-theme="light"] .doc-list {
  color: #071422;
}

:root[data-bs-theme="light"] .doc-row,
[data-bs-theme="light"] .doc-row {
  background: rgba(7, 20, 34, .035);
  border-color: rgba(7, 20, 34, .08);
}

:root[data-bs-theme="light"] .doc-row + .doc-row,
[data-bs-theme="light"] .doc-row + .doc-row {
  border-top-color: rgba(7, 20, 34, .10);
}

:root[data-bs-theme="light"] .doc-link,
[data-bs-theme="light"] .doc-link {
  color: #0f4c8a;
}

:root[data-bs-theme="light"] .doc-link:hover,
[data-bs-theme="light"] .doc-link:hover {
  color: #133961;
}

:root[data-bs-theme="light"] .doc-badge,
[data-bs-theme="light"] .doc-badge {
  background: rgba(13, 110, 253, .10);
  color: #0d6efd;
}

:root[data-bs-theme="light"] .doc-user,
[data-bs-theme="light"] .doc-user {
  color: #5f6b7a;
}

:root[data-bs-theme="light"] .doc-accordion-item,
[data-bs-theme="light"] .doc-accordion-item {
  border-color: rgba(7, 20, 34, .10);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

:root[data-bs-theme="light"] .doc-accordion-button,
[data-bs-theme="light"] .doc-accordion-button {
  color: #071422;
}

:root[data-bs-theme="light"] .doc-accordion-button:hover,
[data-bs-theme="light"] .doc-accordion-button:hover {
  background: rgba(7, 20, 34, .04);
}

:root[data-bs-theme="light"] .doc-accordion-button .left i,
[data-bs-theme="light"] .doc-accordion-button .left i {
  color: #0f4c8a;
  opacity: .95;
}

:root[data-bs-theme="light"] .doc-step,
[data-bs-theme="light"] .doc-step {
  background: rgba(13, 110, 253, .10);
  color: #0d6efd;
  border-color: rgba(13, 110, 253, .18);
}

:root[data-bs-theme="light"] .doc-count,
[data-bs-theme="light"] .doc-count {
  background: rgba(13, 110, 253, .10);
  color: #0d6efd;
}

:root[data-bs-theme="light"] .doc-chevron,
[data-bs-theme="light"] .doc-chevron {
  color: #5f6b7a;
}

:root[data-bs-theme="light"] .doc-accordion-collapse,
[data-bs-theme="light"] .doc-accordion-collapse {
  border-top-color: rgba(7, 20, 34, .08);
}

:root[data-bs-theme="light"] .doc-accordion-body,
[data-bs-theme="light"] .doc-accordion-body {
  background: rgba(255, 255, 255, .52);
}

/* =======================================================
   ROOT LIGHT — PEDIGREE
   ======================================================= */

:root[data-bs-theme="light"] .pedigree-wrapper,
[data-bs-theme="light"] .pedigree-wrapper {
  border-color: rgba(7, 20, 34, .10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 12px 28px rgba(15, 23, 42, .04);
}

:root[data-bs-theme="light"] .pedigree-helper,
[data-bs-theme="light"] .pedigree-helper {
  color: #5f6b7a;
}

:root[data-bs-theme="light"] .pedigree-chart,
[data-bs-theme="light"] .pedigree-chart {
  --pedigree-line-color: rgba(7, 20, 34, .18);
}

:root[data-bs-theme="light"] .pedigree-line,
[data-bs-theme="light"] .pedigree-line {
  background: var(--pedigree-line-color);
}

:root[data-bs-theme="light"] .pedigree-node,
[data-bs-theme="light"] .pedigree-node {
  border-color: rgba(7, 20, 34, .10);
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

:root[data-bs-theme="light"] .pedigree-node:hover,
[data-bs-theme="light"] .pedigree-node:hover {
  border-color: rgba(13, 110, 253, .24);
  background: rgba(13, 110, 253, .035);
}

:root[data-bs-theme="light"] .pedigree-node-main,
[data-bs-theme="light"] .pedigree-node-main {
  border-color: rgba(13, 110, 253, .22);
  background: rgba(13, 110, 253, .07);
  box-shadow: 0 10px 24px rgba(13, 110, 253, .08);
}

:root[data-bs-theme="light"] .pedigree-label,
[data-bs-theme="light"] .pedigree-label {
  color: #5f6b7a;
}

:root[data-bs-theme="light"] .pedigree-name,
[data-bs-theme="light"] .pedigree-name {
  color: #071422;
}

:root[data-bs-theme="light"] .pedigree-rgd,
[data-bs-theme="light"] .pedigree-rgd {
  color: #5f6b7a;
}

:root[data-bs-theme="light"] .pedigree-empty .pedigree-name,
[data-bs-theme="light"] .pedigree-empty .pedigree-name {
  opacity: .62;
}

:root[data-bs-theme="light"] .pedigree-empty .pedigree-rgd,
[data-bs-theme="light"] .pedigree-empty .pedigree-rgd {
  opacity: .55;
}

/* Masculino no light */
:root[data-bs-theme="light"] .pedigree-node-male,
[data-bs-theme="light"] .pedigree-node-male {
  border-color: rgba(31, 127, 186, .28);
  background: rgba(31, 127, 186, .09);
  box-shadow: 0 8px 20px rgba(31, 127, 186, .08);
}

:root[data-bs-theme="light"] .pedigree-node-male:hover,
[data-bs-theme="light"] .pedigree-node-male:hover {
  border-color: rgba(66, 189, 231, .34);
  background: rgba(31, 127, 186, .13);
}

/* Feminino no light */
:root[data-bs-theme="light"] .pedigree-node-female,
[data-bs-theme="light"] .pedigree-node-female {
  border-color: rgba(226, 119, 146, .28);
  background: rgba(226, 119, 146, .09);
  box-shadow: 0 8px 20px rgba(226, 119, 146, .08);
}

:root[data-bs-theme="light"] .pedigree-node-female:hover,
[data-bs-theme="light"] .pedigree-node-female:hover {
  border-color: rgba(244, 160, 181, .34);
  background: rgba(226, 119, 146, .13);
}

/* Linhas horizontais dos cards no light */
:root[data-bs-theme="light"] .pedigree-principal::after,
[data-bs-theme="light"] .pedigree-principal::after,
:root[data-bs-theme="light"] .pedigree-pai::before,
[data-bs-theme="light"] .pedigree-pai::before,
:root[data-bs-theme="light"] .pedigree-pai::after,
[data-bs-theme="light"] .pedigree-pai::after,
:root[data-bs-theme="light"] .pedigree-mae::before,
[data-bs-theme="light"] .pedigree-mae::before,
:root[data-bs-theme="light"] .pedigree-mae::after,
[data-bs-theme="light"] .pedigree-mae::after,
:root[data-bs-theme="light"] .pedigree-avo-paterno::before,
[data-bs-theme="light"] .pedigree-avo-paterno::before,
:root[data-bs-theme="light"] .pedigree-avo-paterno::after,
[data-bs-theme="light"] .pedigree-avo-paterno::after,
:root[data-bs-theme="light"] .pedigree-avo-paterna::before,
[data-bs-theme="light"] .pedigree-avo-paterna::before,
:root[data-bs-theme="light"] .pedigree-avo-paterna::after,
[data-bs-theme="light"] .pedigree-avo-paterna::after,
:root[data-bs-theme="light"] .pedigree-avo-materno::before,
[data-bs-theme="light"] .pedigree-avo-materno::before,
:root[data-bs-theme="light"] .pedigree-avo-materno::after,
[data-bs-theme="light"] .pedigree-avo-materno::after,
:root[data-bs-theme="light"] .pedigree-avo-materna::before,
[data-bs-theme="light"] .pedigree-avo-materna::before,
:root[data-bs-theme="light"] .pedigree-avo-materna::after,
[data-bs-theme="light"] .pedigree-avo-materna::after,
:root[data-bs-theme="light"] .pedigree-bisavo-1::before,
[data-bs-theme="light"] .pedigree-bisavo-1::before,
:root[data-bs-theme="light"] .pedigree-bisavo-2::before,
[data-bs-theme="light"] .pedigree-bisavo-2::before,
:root[data-bs-theme="light"] .pedigree-bisavo-3::before,
[data-bs-theme="light"] .pedigree-bisavo-3::before,
:root[data-bs-theme="light"] .pedigree-bisavo-4::before,
[data-bs-theme="light"] .pedigree-bisavo-4::before,
:root[data-bs-theme="light"] .pedigree-bisavo-5::before,
[data-bs-theme="light"] .pedigree-bisavo-5::before,
:root[data-bs-theme="light"] .pedigree-bisavo-6::before,
[data-bs-theme="light"] .pedigree-bisavo-6::before,
:root[data-bs-theme="light"] .pedigree-bisavo-7::before,
[data-bs-theme="light"] .pedigree-bisavo-7::before,
:root[data-bs-theme="light"] .pedigree-bisavo-8::before,
[data-bs-theme="light"] .pedigree-bisavo-8::before {
  background: var(--pedigree-line-color);
}

.doc-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.doc-row-main {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.doc-delete-btn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #ffd6d6;
  border-color: rgba(255, 107, 107, .52);
  background:
    linear-gradient(
      135deg,
      rgba(122, 32, 32, .72),
      rgba(210, 74, 74, .42)
    );
  box-shadow:
    0 10px 24px rgba(122, 32, 32, .24),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.doc-delete-btn:hover,
.doc-delete-btn:focus {
  color: #ffffff;
  border-color: rgba(255, 107, 107, .9);
  background:
    linear-gradient(
      135deg,
      rgba(150, 38, 38, .94),
      rgba(226, 83, 83, .68)
    );
  box-shadow:
    0 14px 30px rgba(122, 32, 32, .34),
    0 0 0 1px rgba(255, 107, 107, .18),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  transform: translateY(-1px);
}

.doc-delete-btn:active {
  transform: translateY(0);
}

/* =======================================================
   LIGHT MODE — BOTÃO EXCLUIR DOCUMENTO
   ======================================================= */

:root.light .doc-delete-btn,
[data-bs-theme="light"] .doc-delete-btn,
body.light .doc-delete-btn {
  color: #9f2424;
  border-color: rgba(190, 55, 55, .28);
  background:
    linear-gradient(
      135deg,
      rgba(255, 245, 245, .96),
      rgba(255, 229, 229, .9)
    );
  box-shadow:
    0 10px 22px rgba(190, 55, 55, .12),
    inset 0 1px 0 rgba(255, 255, 255, .82);
}

:root.light .doc-delete-btn:hover,
:root.light .doc-delete-btn:focus,
[data-bs-theme="light"] .doc-delete-btn:hover,
[data-bs-theme="light"] .doc-delete-btn:focus,
body.light .doc-delete-btn:hover,
body.light .doc-delete-btn:focus {
  color: #ffffff;
  border-color: rgba(190, 55, 55, .72);
  background:
    linear-gradient(
      135deg,
      #8f2d2d,
      #d24a4a
    );
  box-shadow:
    0 14px 28px rgba(190, 55, 55, .22),
    0 0 0 1px rgba(190, 55, 55, .12),
    inset 0 1px 0 rgba(255, 255, 255, .18);
}

@media (max-width: 575.98px) {
  .doc-row {
    align-items: flex-start;
  }

  .doc-row-main {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
  }

  .doc-delete-btn {
    margin-left: auto;
  }
}

.doc-delete-btn.is-marked-for-removal {
  color: #fff3cd;
  border-color: rgba(255, 193, 7, .65);
  background:
    linear-gradient(
      135deg,
      rgba(122, 87, 20, .78),
      rgba(255, 193, 7, .48)
    );
  box-shadow:
    0 10px 24px rgba(122, 87, 20, .24),
    inset 0 1px 0 rgba(255, 255, 255, .1);
}

.doc-delete-btn.is-marked-for-removal:hover,
.doc-delete-btn.is-marked-for-removal:focus {
  color: #ffffff;
  border-color: rgba(255, 193, 7, .9);
  background:
    linear-gradient(
      135deg,
      rgba(150, 104, 22, .94),
      rgba(255, 193, 7, .66)
    );
}

:root.light .doc-delete-btn.is-marked-for-removal,
[data-bs-theme="light"] .doc-delete-btn.is-marked-for-removal,
body.light .doc-delete-btn.is-marked-for-removal {
  color: #7a5310;
  border-color: rgba(180, 125, 20, .34);
  background:
    linear-gradient(
      135deg,
      rgba(255, 250, 235, .96),
      rgba(255, 239, 190, .92)
    );
}

:root.light .doc-delete-btn.is-marked-for-removal:hover,
:root.light .doc-delete-btn.is-marked-for-removal:focus,
[data-bs-theme="light"] .doc-delete-btn.is-marked-for-removal:hover,
[data-bs-theme="light"] .doc-delete-btn.is-marked-for-removal:focus,
body.light .doc-delete-btn.is-marked-for-removal:hover,
body.light .doc-delete-btn.is-marked-for-removal:focus {
  color: #ffffff;
  border-color: rgba(180, 125, 20, .72);
  background:
    linear-gradient(
      135deg,
      #8a641d,
      #d9a21d
    );
}