:root {
  --bv-bordo: #8b1117;
  --bv-rojo: #b3121b;
  --bv-oro: #f2c94c;
  --bv-azul: #0f141d;
  --bv-gris: #1a1f2a;
}

html,
body {
  height: 100%;
}

body {
  background: radial-gradient(1100px 600px at 15% 0%, rgba(179, 18, 27, 0.38) 0%, rgba(15, 20, 29, 0.95) 55%, rgba(10, 12, 18, 1) 100%);
  color: #e9eef8;
}

[data-bs-theme="dark"] body {
  background: radial-gradient(1100px 600px at 15% 0%, rgba(242, 201, 76, 0.12) 0%, rgba(15, 20, 29, 0.95) 55%, rgba(10, 12, 18, 1) 100%);
}

.app-bg {
  min-height: 100vh;
}

.shadow-soft {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(179, 18, 27, 0.9), rgba(139, 17, 23, 0.9));
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 201, 76, 0.25);
}

.brand-mark-sm {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.brand-mark-sm::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--bv-oro), rgba(242, 201, 76, 0.6));
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.18);
}

.app-shell {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  overflow: hidden;
  min-height: 72vh;
}

[data-bs-theme="dark"] .app-shell {
  background: rgba(18, 22, 31, 0.96);
}

.app-sidebar {
  background: linear-gradient(180deg, var(--bv-gris) 0%, var(--bv-azul) 100%);
  width: 280px;
  flex: 0 0 280px;
  min-height: 100%;
  display: none;
}

@media (min-width: 992px) {
  .app-shell {
    display: flex;
  }
  .app-sidebar {
    display: block;
  }
}

.app-sidebar-header {
  padding: 16px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav .nav-link {
  color: rgba(255, 255, 255, 0.86);
  padding: 12px 14px;
  text-align: left;
  border-radius: 10px;
  margin: 4px 10px;
  background: transparent;
  border: 0;
}

.app-nav .nav-link:hover {
  background: rgba(242, 201, 76, 0.08);
}

.app-nav .nav-link.active {
  background: rgba(242, 201, 76, 0.14);
  border: 1px solid rgba(242, 201, 76, 0.22);
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-topbar {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-bs-theme="dark"] .app-topbar {
  background: rgba(18, 22, 31, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-tile {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.6) 100%);
}

[data-bs-theme="dark"] .stat-tile {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.photo-preview {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  display: none;
}

.detail-photo {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}

.credential-card {
  width: 100%;
  max-width: 540px;
  aspect-ratio: 85.6 / 54;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #ffffff;
  color: #0f141d;
}

[data-bs-theme="dark"] .credential-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cred-band {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 34%;
  background: linear-gradient(135deg, var(--bv-rojo) 0%, #5f0d12 75%);
}

.cred-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 70px at 85% 20%, rgba(242, 201, 76, 0.35), transparent 65%);
}

.cred-watermark {
  position: absolute;
  right: -32px;
  top: -32px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid rgba(242, 201, 76, 0.25);
  background: rgba(242, 201, 76, 0.06);
}

.cred-content {
  position: relative;
  z-index: 2;
  padding: 14px 14px 12px 14px;
  height: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.cred-title {
  grid-column: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}

.cred-title .name {
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
  font-size: 0.98rem;
}

.cred-title .sub {
  opacity: 0.88;
  font-size: 0.72rem;
}

.cred-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.cred-photo {
  width: 100%;
  height: 100%;
  max-height: 220px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(242, 201, 76, 0.35);
  background: rgba(0, 0, 0, 0.06);
}

.cred-fields {
  display: grid;
  gap: 6px;
  align-content: start;
}

.cred-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  font-size: 0.78rem;
}

.cred-row .k {
  color: rgba(15, 20, 29, 0.65);
}

.cred-qr {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 86px;
  height: 86px;
  background: #fff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.cred-foot {
  grid-column: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  color: rgba(15, 20, 29, 0.65);
}

.cred-back {
  padding: 14px;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.cred-back-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cred-back-head .title {
  font-weight: 700;
}

.cred-back-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cred-note {
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  padding: 10px;
  font-size: 0.78rem;
  color: rgba(15, 20, 29, 0.7);
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5rem;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content {
  background-color: rgba(18, 22, 31, 0.98);
  color: #e9eef8;
}

[data-bs-theme="dark"] .table {
  color: #e9eef8;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  color: #e9eef8;
}
