.talonario-card {
  border: 1px solid #dbe7d7;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

.talonario-card .card-header {
  border-bottom: 1px solid #e5eee2;
  background: linear-gradient(135deg, #f6fbf5, #ffffff);
  border-radius: 14px 14px 0 0;
}

.talonario-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #14351b;
  font-weight: 800;
}

.talonario-title i {
  color: #2e7d32;
}

.talonario-doc-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .8rem;
  border: 1px solid #e4eaf0;
  border-radius: 12px;
  background: #fff;
  margin-bottom: .65rem;
}

.talonario-doc-item strong {
  display: block;
  color: #101828;
}

.talonario-doc-item small {
  display: block;
  color: #667085;
  margin-top: .15rem;
}

.talonario-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}

.talonario-fundamentos-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: .65rem;
  background: #f8fafc;
}

.talonario-fundamento-item {
  display: block;
  border: 1px solid #e4eaf0;
  border-radius: 10px;
  padding: .65rem .75rem;
  background: #fff;
  margin-bottom: .5rem;
  cursor: pointer;
}

.talonario-fundamento-item:hover {
  border-color: #b7d7b1;
}

.talonario-fundamento-item input {
  margin-right: .45rem;
}

.talonario-fundamento-item strong {
  display: inline;
  color: #101828;
}

.talonario-fundamento-item span {
  display: block;
  color: #475467;
  font-size: .82rem;
  margin-top: .25rem;
}

.talonario-fundamento-item em {
  display: inline-block;
  margin-top: .35rem;
  color: #b42318;
  font-size: .76rem;
  font-style: normal;
}

.talonario-empty {
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  text-align: center;
}

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

  .talonario-doc-actions {
    justify-content: flex-start;
  }
}

/* Ajuste de usabilidade do modal do Talonário */
#talonarioEmitirModal .modal-dialog,
#talonarioEntregaModal .modal-dialog {
  height: calc(100vh - 2rem);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

#talonarioEmitirModal .modal-content,
#talonarioEntregaModal .modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#talonarioEmitirModal .modal-body,
#talonarioEntregaModal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 13rem);
  padding-bottom: 1.5rem;
}

#talonarioEmitirModal .modal-footer,
#talonarioEntregaModal .modal-footer {
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

#talonarioEmitirModal .talonario-fundamentos-list {
  max-height: 170px;
  overflow-y: auto;
}

#talonarioEmitirModal textarea[name="descricao_fato"] {
  min-height: 84px;
}

#talonarioEmitirModal textarea[name="providencia_exigida"] {
  min-height: 74px;
}

@media (max-height: 760px) {
  #talonarioEmitirModal .modal-body {
    max-height: calc(100vh - 11rem);
  }

  #talonarioEmitirModal .talonario-fundamentos-list {
    max-height: 130px;
  }

  #talonarioEmitirModal .form-label {
    margin-bottom: .25rem;
  }

  #talonarioEmitirModal .row.g-3 {
    --bs-gutter-y: .75rem;
  }
}

.talonario-signature-card {
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 12px;
  background: #f9fafb;
}

.talonario-signature-canvas {
  display: block;
  width: 100%;
  height: 150px;
  border: 1px dashed #98a2b3;
  border-radius: 10px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

@media (max-width: 576px) {
  .talonario-signature-canvas {
    height: 140px;
  }
}

.talonario-admin-panel {
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.talonario-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 4px;
}

.talonario-admin-fundamento {
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.talonario-admin-fundamento.is-inactive {
  opacity: 0.68;
  background: #f9fafb;
}

.talonario-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .talonario-admin-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
}

/* ===== AJUSTE BARRA DE AÇÕES DO TALONÁRIO ===== */
.talonario-card .card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.talonario-card .card-header .talonario-title {
  margin-right: auto;
}

.talonario-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.talonario-actions-bar .btn {
  margin: 0 !important;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .talonario-actions-bar {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .talonario-actions-bar .btn {
    flex: 1 1 auto;
  }
}
/* ===== FIM AJUSTE BARRA DE AÇÕES DO TALONÁRIO ===== */

