.newapp-carteirinha-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 2mm;
  gap: 2mm;
  overflow-x: auto;
}

.newapp-carteirinha-toolbar {
  width: 86mm;
  max-width: 100%;
}

.newapp-carteirinha-card,
.newapp-carteirinha-cover-card {
  box-sizing: border-box;
  position: relative;
  flex: 0 0 86mm;
  width: 86mm;
  min-width: 86mm;
  max-width: 86mm;
  height: 54mm;
  min-height: 54mm;
  max-height: 54mm;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 2mm;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.newapp-carteirinha-card {
  display: grid;
  grid-template-rows: 13mm 8mm minmax(0, 15mm) minmax(0, 7mm) minmax(0, 1fr);
  white-space: normal;
}

.newapp-carteirinha-cover {
  position: relative;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--phsa-primary-dark, #244b85), var(--phsa-primary, #4d78bd));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.newapp-carteirinha-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 25, 48, 0.14), rgba(12, 25, 48, 0.82));
}

.newapp-carteirinha-cover-badge {
  position: absolute;
  top: 1.7mm;
  left: 2.5mm;
  z-index: 2;
  display: flex;
  align-items: center;
  max-width: 50mm;
  height: 3mm;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 1.1mm;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--phsa-primary-dark, #244b85);
  font-size: 1.45mm;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.newapp-carteirinha-identity {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0.8mm 2.5mm 0.8mm 20mm;
  background: #fff;
}

.newapp-carteirinha-avatar {
  position: absolute;
  top: -7mm;
  left: 3mm;
  width: 15mm;
  height: 15mm;
  border: 0.9mm solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.newapp-carteirinha-identity-copy,
.newapp-carteirinha-title,
.newapp-carteirinha-document,
.newapp-carteirinha-label,
.newapp-carteirinha-value,
.newapp-carteirinha-church-name,
.newapp-carteirinha-church-address,
.newapp-carteirinha-church-contact {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.newapp-carteirinha-title {
  margin: 0 0 0.4mm;
  color: #1f2937;
  font-size: 2.65mm;
  font-weight: 800;
  line-height: 1;
}

.newapp-carteirinha-document {
  color: #496053;
  font-size: 1.8mm;
  font-weight: 700;
  line-height: 1;
}

.newapp-carteirinha-data {
  display: flex;
  flex-direction: column;
  grid-row: 3;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0.9mm 2.5mm;
  gap: 0.8mm;
  background: #fff;
}

.newapp-carteirinha-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 1.2mm;
}

.newapp-carteirinha-data-row-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newapp-carteirinha-data-row-tertiary {
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.newapp-carteirinha-data-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.3mm;
  padding: 0.45mm 0.7mm;
  border-radius: 1mm;
  background: #f4f4f4;
  overflow: hidden;
}

.newapp-carteirinha-label {
  color: #5e7187;
  font-size: 1mm;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.newapp-carteirinha-value {
  color: #263d61;
  font-size: 1.4mm;
  font-weight: 700;
  line-height: 1.3;
}

.newapp-carteirinha-verse {
  display: flex;
  flex-direction: column;
  grid-row: 4;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0.3mm 3mm;
  gap: 0.5mm;
  background: #fff;
  color: #535353;
  font-size: 1.1mm;
  font-style: italic;
  line-height: 1.18;
  text-align: center;
}

.newapp-carteirinha-verse-text,
.newapp-carteirinha-verse-reference {
  max-width: 100%;
  overflow: visible;
}

.newapp-carteirinha-verse-text {
  white-space: normal;
}

.newapp-carteirinha-verse-reference {
  color: var(--phsa-primary-dark, #244b85);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.newapp-carteirinha-footer {
  display: grid;
  grid-row: 5;
  grid-template-columns: 18% minmax(0, 52%) minmax(0, 30%);
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 1.2mm 2.5mm 1.3mm;
  gap: 1mm;
  background: #fff;
}

.newapp-carteirinha-footer-logo,
.newapp-carteirinha-footer-church,
.newapp-carteirinha-signature {
  min-width: 0;
  overflow: hidden;
}

.newapp-carteirinha-footer-logo-img {
  display: block;
  width: 8mm;
  max-width: 100%;
  height: auto;
  max-height: 8mm;
  object-fit: contain;
}

.newapp-carteirinha-footer-church {
  text-align: center;
}

.newapp-carteirinha-church-name {
  color: #2f3438;
  font-size: 1.25mm;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.newapp-carteirinha-church-address,
.newapp-carteirinha-church-contact {
  color: #6c757d;
  font-size: 1.15mm;
  line-height: 1.25;
  text-transform: uppercase;
}

.newapp-carteirinha-signature {
  display: flex;
  justify-content: flex-end;
}

.newapp-carteirinha-signature-img {
  display: block;
  margin-left: auto;
  width: 24mm;
  max-width: 100%;
  height: auto;
  max-height: 8mm;
  object-fit: contain;
  object-position: right center;
  background: #fff;
}

.newapp-carteirinha-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.newapp-carteirinha-cover-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 3.5mm 4mm;
  background: linear-gradient(180deg, rgba(7, 18, 34, 0.08), rgba(7, 18, 34, 0.72));
  color: #fff;
  text-align: left;
}

.newapp-carteirinha-cover-logo {
  display: block;
  width: 14mm;
  height: 12mm;
  object-fit: contain;
}

.newapp-carteirinha-cover-copy {
  width: 100%;
  min-width: 0;
}

.newapp-carteirinha-cover-name,
.newapp-carteirinha-cover-motto {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.newapp-carteirinha-cover-name {
  font-size: 2.35mm;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: uppercase;
}

.newapp-carteirinha-cover-motto {
  margin-top: 1mm;
  font-size: 1.5mm;
  font-style: italic;
  line-height: 1.15;
}

.newapp-carteirinha-modal-actions,
.newapp-carteirinha-modal-scope {
  display: grid;
  gap: 8px;
}

.newapp-carteirinha-modal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newapp-carteirinha-modal-scope {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.newapp-carteirinha-modal-label {
  margin-bottom: 8px;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  font-weight: 600;
}

.newapp-carteirinha-modal-scope .bto,
.newapp-carteirinha-modal-actions .bto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.newapp-carteirinha-modal-scope .bto {
  min-height: 48px;
  padding: 8px;
  text-align: center;
}

.newapp-carteirinha-modal-actions .is-hidden {
  display: none;
}

@media (max-width: 575.98px) {
  .newapp-carteirinha-modal-scope,
  .newapp-carteirinha-modal-actions {
    grid-template-columns: 1fr;
  }
}
