﻿/* ===== Badge page ===== */
.badge-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.badge-page-header {
  margin-bottom: 1.75rem;
}

.badge-page-header h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1E2F82;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.5px;
}

.badge-page-header p {
  color: #5B6573;
  margin: 0;
  font-size: 0.98rem;
}

.badge-search-card {
  background: #FFFFFF;
  border: 1px solid #E9EDF2;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(30, 47, 130, 0.08);
}

.badge-search-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.badge-search-input {
  flex: 1;
  margin-bottom: 0;
}

.badge-search-btn {
  width: auto;
  padding: 13px 28px;
  white-space: nowrap;
}

/* ===== Autocomplete dropdown ===== */
.badge-autocomplete-wrapper {
  position: relative;
}

.badge-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E9EDF2;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(30, 47, 130, 0.18);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}

.badge-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.badge-autocomplete-item:hover,
.badge-autocomplete-item:focus {
  background: #EEF2FF;
}

.badge-autocomplete-iduser {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1E2F82;
  flex-shrink: 0;
}

.badge-autocomplete-codeuser {
  font-size: 0.78rem;
  color: #F5A623;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-autocomplete-fullname {
  font-size: 0.82rem;
  color: #404B5A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ===== Avatar picker (search form header) ===== */
.badge-avatar-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed #E9EDF2;
}

.badge-avatar-preview {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #F6F8FB;
  border: 3px solid #E9EDF2;
  box-shadow: 0 8px 22px rgba(30, 47, 130, 0.1);
  position: relative;
}

.badge-avatar-preview img,
.badge-avatar-preview .badge-avatar-placeholder-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-avatar-placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #F6F8FB 0%, #E9EDF2 100%);
}

.badge-avatar-placeholder-icon svg {
  width: 52%;
  height: 52%;
}

.badge-avatar-picker {
  flex: 1;
  min-width: 0;
}

.badge-avatar-file-input {
  display: none;
}

.btn-outline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1.5px solid #2E4DA7;
  background: #FFFFFF;
  color: #1E2F82;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-badge:hover {
  background: #EEF2FF;
}

.badge-avatar-hint {
  margin: 10px 0 0 0;
  font-size: 0.8rem;
  color: #8A93A3;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .badge-avatar-section {
    flex-direction: column;
    align-items: flex-start;
  }
}

.badge-preview-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.badge-preview-fields .form-group {
  margin-bottom: 0;
}

.badge-preview-fields input:disabled {
  background: #F6F8FB;
  color: #404B5A;
  cursor: default;
}

.badge-generate-actions {
  margin-top: 1.75rem;
}

.badge-generate-actions .btn-primary {
  width: auto;
  padding: 15px 36px;
}

@media (max-width: 640px) {
  .badge-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .badge-search-btn {
    width: 100%;
  }

  .badge-preview-fields {
    grid-template-columns: 1fr;
  }
}

/* ===== Badge dialog overlay ===== */
.badge-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 45, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
  animation: fadeIn 0.35s ease-out;
}

.badge-dialog {
  background: #F6F8FB;
  border-radius: 24px;
  max-width: 780px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  animation: authEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.badge-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #E9EDF2;
}

.badge-dialog-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1E2F82;
}

.badge-dialog-close {
  color: #5B6573;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.badge-dialog-close:hover {
  background: #EEF2FF;
  color: #1E2F82;
}

.badge-dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-dialog-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #1E2F82 0%, #2E4DA7 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 18px rgba(30, 47, 130, 0.3);
}

.badge-dialog-download:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(30, 47, 130, 0.4);
}

.badge-dialog-download:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.badge-dialog-body {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  padding: 2.5rem 2rem;
}

/* ===== Badge card shared ===== */
.badge-card {
  width: 300px;
  height: 486px;
  border-radius: 0px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 60px rgba(14, 27, 66, 0.35), 0 0 0 1px rgba(30, 47, 130, 0.06);
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  flex-shrink: 0;
}

/* ===== Front face: white top area + square-cornered navy middle container ===== */
.badge-front-header {
  height: 270px;
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  flex-shrink: 0;
}

.badge-nav-middle {
  position: absolute;
  top: 150px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #2E4DA7 0%, #1E2F82 55%, #0E1B42 100%);
  border-radius: 0;
  padding: 58px 20px 16px;
  text-align: center;
  box-sizing: border-box;
}

.badge-photo-ring {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2E4DA7 0%, #1E2F82 55%, #0E1B42 100%);
  padding: 15px;
  box-shadow: 0 10px 26px rgba(14, 27, 66, 0.4);
  z-index: 2;
  box-sizing: border-box;
}

.badge-photo-ring-gold {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #F5A623;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.badge-photo-inner-white {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.badge-photo-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.badge-photo-placeholder svg {
  width: 62%;
  height: 62%;
}

.badge-photo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.badge-name {
  color: #F5A623;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-designation {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}

.badge-info {
  padding: 16px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.badge-info-row {
  display: flex;
  font-size: 0.78rem;
  gap: 8px;
}

.badge-info-label {
  color: #8A93A3;
  font-weight: 600;
  width: 84px;
  flex-shrink: 0;
}

.badge-info-label::after {
  content: ' :';
}

.badge-info-value {
  color: #202B38;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.badge-barcode {
  margin: 6px 12px 20px;
  padding: 10px 10px 8px;
  text-align: center;
  flex-shrink: 0;
  border: 1.5px solid #E9EDF2;
  border-radius: 10px;
  background: #FFFFFF;
}

.badge-barcode img {
  width: 100%;
  height: auto;
  display: block;
}

.badge-barcode-code {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1E2F82;
  text-align: center;
  white-space: nowrap;
}

/* ===== Back face ===== */
.badge-back {
  background: linear-gradient(160deg, #1E2F82 0%, #14205E 55%, #0A0D2D 100%);
  color: #FFFFFF;
  align-items: center;
  text-align: center;
}

.badge-back-top {
  min-height: 160px;
  padding: 26px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
}

.badge-back-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 50%;
  background: #FFFFFF;
  padding: 10px;
  box-sizing: border-box;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  margin-bottom: 10px;
}

.badge-back-company {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-back-slogan {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
}

.badge-back-address {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 250px;
  margin-top: 16px;
}

.badge-back-address span {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.62rem;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-back-address strong {
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.68rem;
  text-align: right;
  line-height: 1.35;
}

.badge-back-stripe {
  width: 100%;
  height: 34px;
  background: linear-gradient(90deg, #D62E1F 0%, #FF5A48 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-back-stripe-dot {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #FFFFFF;
  padding: 9px;
  box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-back-stripe-dot-navy {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1E2F82;
}

.badge-back-terms {
  padding: 22px 26px 0;
  flex: 1;
}

.badge-back-terms-title {
  color: #FF6B5A;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.badge-back-terms p {
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 18px 0;
}

.badge-back-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.74rem;
}

.badge-back-dates div {
  display: flex;
  justify-content: space-between;
}

.badge-back-dates span {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.badge-back-dates strong {
  color: #FFFFFF;
  font-weight: 700;
}

.badge-back-footer {
  padding: 16px 20px 22px;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .badge-dialog-body {
    padding: 1.75rem 1rem;
    gap: 1.75rem;
  }

  .badge-card {
    width: 100%;
    max-width: 300px;
  }
}

/* ===== Edit user form ===== */
.badge-edit-toggle {
  width: auto;
  padding: 15px 24px;
  white-space: nowrap;
}

.badge-generate-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-generate-actions .btn-primary {
  width: auto;
  padding: 15px 24px;
}

.badge-edit-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #E9EDF2;
}

.badge-edit-section h3 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1E2F82;
}

.badge-edit-hint {
  margin: 0 0 1rem 0;
  font-size: 0.82rem;
  color: #8A93A3;
}

.badge-edit-checkboxes {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.badge-edit-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #404B5A;
  font-weight: 500;
  cursor: pointer;
}

.badge-edit-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #1E2F82;
}
