/* ================= MODAL OVERLAY ================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.modal-active {
  display: flex;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* ================= MODAL BOX ================= */
.modal-box {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= MODAL HEADER ================= */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

/* ================= MODAL BODY ================= */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* ================= MODAL SECTIONS ================= */
.modal-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-section h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}

/* ================= MODAL TABLE ================= */
.modal-table {
  width: 100%;
  border-collapse: collapse;
}

.modal-table tr td {
  padding: 6px 0;
  font-size: 14px;
  vertical-align: top;
}

.modal-label {
  color: #888;
  width: 140px;
  font-weight: 500;
  padding-right: 12px;
}

/* ================= MODAL LIST ================= */
.modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-list li {
  font-size: 14px;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 4px;
  color: #2c3e50;
}

/* ================= MODAL STATES ================= */
.modal-loading {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 14px;
}

.modal-error {
  text-align: center;
  padding: 40px;
  color: #e74c3c;
  font-size: 14px;
}

.modal-bio {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* ================= MODAL HEADER ACTIONS ================= */
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-modal-edit {
  background: #2980b9;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.btn-modal-edit:hover {
  background: #1f6699;
}

/* ================= MODAL WARNING ================= */
.modal-warning {
  background: #fff8e1;
  border: 1px solid #f0c040;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: #7a5c00;
  line-height: 1.5;
}

/* ================= MODAL FORM ================= */
.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.modal-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.modal-input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  color: #333;
}

.modal-input:focus {
  outline: none;
  border-color: #3498db;
}

.modal-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Highlight sensitive fields */
.sensitive-field {
  border-color: #f0c040;
  background: #fffdf0;
}

.sensitive-field:focus {
  border-color: #e6a817;
}

/* ================= SAVE BUTTONS ================= */
.btn-save-sensitive {
  background: #e67e22;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 6px;
}

.btn-save-sensitive:hover {
  background: #ca6f1e;
}

.btn-save-sensitive:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-save-basic {
  background: #27ae60;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 6px;
}

.btn-save-basic:hover {
  background: #1e8449;
}

.btn-save-basic:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ================= MODAL MESSAGES ================= */
.modal-success-msg {
  color: #1e8449;
  background: #eafaf1;
  border: 1px solid #a9dfbf;
  border-radius: 6px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-message-center {
  text-align: center;
  margin: 40px 20px;
}
