/* Agent profile page */

.agent-profile-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.agent-profile-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(2, 29, 98, 0.08);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.agent-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.agent-profile-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.agent-profile-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #021D62 0%, #003BCA 100%);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(2, 29, 98, 0.18);
}

.agent-profile-title {
  margin: 0 0 4px;
  color: #021D62;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.agent-profile-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

.agent-profile-btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px !important;
  border-radius: 10px !important;
  background: #FF5F20 !important;
  border: none !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.agent-profile-btn-edit:hover,
.agent-profile-btn-edit:focus {
  background: #e5551c !important;
  color: #fff !important;
  text-decoration: none !important;
  transform: none !important;
}

.agent-profile-body {
  padding: 24px;
}

.agent-profile-page .tab-content {
  float: none;
}

.agent-profile-page .tab-pane {
  float: none;
}

/* View profile */
.agent-profile-view {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.agent-profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 4px solid #eef4ff;
  box-shadow: 0 8px 24px rgba(2, 29, 98, 0.12);
}

.agent-profile-main {
  min-width: 0;
}

.agent-profile-name {
  margin: 0 0 20px;
  color: #021D62;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.agent-profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-profile-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-width: 0;
}

.agent-profile-field-wide {
  grid-column: 1 / -1;
}

.agent-profile-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #021D62 0%, #003BCA 100%);
  color: #fff;
  font-size: 14px;
}

.agent-profile-field-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.agent-profile-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.agent-profile-field-value {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  line-height: 1.45;
  word-break: break-word;
}

/* Edit profile form */
.agent-profile-edit-form {
  margin: 0;
}

.agent-profile-form-errors {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

.agent-profile-page .agent-profile-edit-grid.paspertedit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 24px;
  margin: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.agent-profile-section-title {
  grid-column: 1 / -1;
  margin: 8px 0 4px;
  padding: 0 0 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #021D62;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.agent-profile-section-title:first-child {
  margin-top: 0;
}

.agent-profile-page .agent-profile-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  float: none !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

.agent-profile-page .agent-profile-edit-field-wide {
  grid-column: 1 / -1;
}

.agent-profile-page #pan_data.agent-profile-edit-field {
  min-width: 0;
}

.agent-profile-edit-label,
.agent-profile-page .paspolbl {
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.agent-profile-page .clainput.form-control,
.agent-profile-page select.clainput.form-control,
.agent-profile-page textarea.clainput.form-control {
  width: 100% !important;
  min-height: 44px;
  padding: 10px 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  background: #fff !important;
  box-shadow: none !important;
  transform: none !important;
  box-sizing: border-box;
}

.agent-profile-page textarea.clainput.form-control {
  min-height: 110px;
  resize: vertical;
}

.agent-profile-page .clainput.form-control:focus,
.agent-profile-page select.clainput.form-control:focus,
.agent-profile-page textarea.clainput.form-control:focus {
  border-color: #003BCA !important;
  box-shadow: 0 0 0 3px rgba(0, 59, 202, 0.12) !important;
  outline: none !important;
  transform: none !important;
}

.agent-profile-page .agent-profile-edit-file {
  align-self: stretch;
}

.agent-profile-page input.agent-profile-file[type="file"],
.agent-profile-page input.agent-profile-file[type="file"].form-control {
  width: 100% !important;
  min-height: 88px !important;
  height: auto !important;
  padding: 16px 14px !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #64748b !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.agent-profile-page input.agent-profile-file[type="file"]:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.agent-profile-page input.agent-profile-file[type="file"]:focus {
  border-color: #003BCA !important;
  box-shadow: 0 0 0 3px rgba(0, 59, 202, 0.12) !important;
  outline: none !important;
}

.agent-profile-page input.agent-profile-file[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #021D62 0%, #003BCA 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.agent-profile-page input.agent-profile-file[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #021D62 0%, #003BCA 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.agent-profile-upload-preview {
  margin-top: 10px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: inline-block;
}

.agent-profile-upload-preview img {
  display: block;
  max-width: 120px;
  height: auto;
  border-radius: 6px;
}

.agent-profile-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

/* Override legacy agent.css edit-form styles inside profile page */
.agent-profile-page .margpas,
.agent-profile-page .col-xs-4 {
  float: none !important;
  width: auto !important;
  padding: 0 !important;
}

.agent-profile-page .paspertedit .tnlepasport_b2b,
.agent-profile-page .paspertedit .lablmain {
  float: none;
  width: 100%;
}

.agent-profile-page .agent-profile-btn-save.savepspot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px !important;
  border: none !important;
  border-radius: 10px !important;
  background: #FF5F20 !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none !important;
  transform: none !important;
  grid-column: auto;
  justify-self: auto;
}

.agent-profile-page .agent-profile-btn-save.savepspot:hover {
  background: #e5551c !important;
  transform: none !important;
  box-shadow: none !important;
}

.agent-profile-page .agent-profile-btn-cancel.cancelll {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #475569 !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: none !important;
  transform: none !important;
  grid-column: auto;
  justify-self: auto;
}

.agent-profile-page .agent-profile-btn-cancel.cancelll:hover {
  background: #f8fafc !important;
  color: #334155 !important;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 991px) {
  .agent-profile-view {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .agent-profile-avatar {
    display: flex;
    justify-content: center;
  }

  .agent-profile-fields {
    grid-template-columns: 1fr;
  }

  .agent-profile-page .agent-profile-edit-grid.paspertedit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .agent-profile-header,
  .agent-profile-body {
    padding: 16px;
  }

  .agent-profile-header {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-profile-btn-edit {
    width: 100%;
  }

  .agent-profile-page .agent-profile-edit-grid.paspertedit {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .agent-profile-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-profile-page .agent-profile-btn-save.savepspot,
  .agent-profile-page .agent-profile-btn-cancel.cancelll {
    width: 100%;
  }
}
