/* ══════════════════════════════════════════════════════════════
   LEADERSHIP ASSIGNMENT MANAGEMENT MODAL STYLES
   For Division, Department, and Section Responsible Persons
   ══════════════════════════════════════════════════════════════ */

.lm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: lmFadeIn 0.18s ease-out;
}

@keyframes lmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lm-dialog,
.lm-dialog *,
#lm-container,
#lm-container * {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif !important;
  font-style: normal !important;
}

.lm-dialog {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif !important;
  color: #000000;
  position: relative;
}

.lm-dialog :is(h1, h2, h3, h4, p, span, div, label, input, select, textarea, td, th, a, strong, .lm-title, .lm-subtitle, .lm-meta-label, .lm-meta-value) {
  color: #000000;
}

.lm-btn-primary,
.lm-btn-danger,
.lm-timeline-bullet.completed {
  color: #ffffff !important;
}

.lm-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #fafafa;
}

.lm-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lm-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.lm-subtitle {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.lm-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}

.lm-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.lm-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Alert Box */
.lm-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}
.lm-alert.success {
  display: flex;
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.25);
}
.lm-alert.error {
  display: flex;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Auth Card */
.lm-auth-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lm-auth-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}
.lm-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}
.lm-auth-row {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}
.lm-auth-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
}
.lm-auth-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.lm-auth-btn {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.lm-auth-btn:hover {
  background: #1d4ed8;
}

.lm-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #334155;
}
.lm-logout-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
}
.lm-logout-btn:hover {
  color: #b91c1c;
}

/* Form Grid */
.lm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .lm-form-grid {
    grid-template-columns: 1fr;
  }
}

.lm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lm-field.full-width {
  grid-column: 1 / -1;
}

.lm-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lm-select, .lm-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
}
.lm-select:focus, .lm-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Person Search & Typeahead */
.lm-person-search-wrap {
  position: relative;
  width: 100%;
  display: block;
}
.lm-results-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  z-index: 100;
  display: none;
}
.lm-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lm-result-item:last-child {
  border-bottom: none;
}
.lm-result-item:hover, .lm-result-item.highlighted {
  background: #eff6ff;
}
.lm-result-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}
.lm-result-meta {
  font-size: 11.5px;
  color: #64748b;
}

.lm-selected-person-box {
  margin-top: 6px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: space-between;
}
.lm-selected-person-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1d4ed8;
}
.lm-clear-person-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.lm-clear-person-btn:hover {
  background: #fee2e2;
}

/* Action Bar */
.lm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
.lm-btn-secondary {
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.lm-btn-secondary:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.lm-btn-primary {
  padding: 9px 20px;
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lm-btn-primary:hover {
  background: #1d4ed8;
}
.lm-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* History Section */
.lm-history-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
  margin-top: 8px;
}
.lm-history-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lm-history-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}
.lm-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.lm-history-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.lm-history-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.lm-history-table tr:last-child td {
  border-bottom: none;
}
.lm-history-table tr:hover td {
  background: #fafafa;
}

.lm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}
.lm-badge.active {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}
.lm-badge.ended {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}
.lm-badge.vacant {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.lm-badge.interim {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.25);
}

/* ══════════════════════════════════════════════════════════════
   ADMINISTRATIVE MODE & CENTRAL CONTROLS
   ══════════════════════════════════════════════════════════════ */

/* Contextual edit controls hidden in public view by default; revealed only in authenticated admin mode */
body:not(.admin-mode-active) .lm-trigger-btn,
body:not(.admin-mode-active) .lm-contextual-btn {
  display: none !important;
}
body.admin-mode-active .lm-trigger-btn,
body.admin-mode-active .lm-contextual-btn {
  display: inline-flex !important;
}

/* Central Header Button */
.manage-leadership-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  white-space: nowrap;
}
.manage-leadership-topbar-btn:hover {
  background: #1e293b;
  border-color: #64748b;
  transform: translateY(-1px);
}
body.admin-mode-active .manage-leadership-topbar-btn {
  background: #166534;
  border-color: #22c55e;
  color: #ffffff;
}

/* Current Holder Card */
.lm-current-card {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lm-current-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lm-current-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748b;
}
.lm-current-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.lm-current-meta {
  font-size: 11.5px;
  color: #64748b;
}

/* Vacate / Danger Button */
.lm-btn-danger {
  padding: 9px 16px;
  border: 1px solid #fecaca;
  background: #ffffff;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.lm-btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

/* ══════════════════════════════════════════════════════════════
   POST & SEAT STAFFING MANAGEMENT STYLES
   ══════════════════════════════════════════════════════════════ */

.lm-workflow-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.lm-tab-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lm-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.lm-tab-btn.active {
  color: #005030;
  background: #e6f4ea;
  font-weight: 700;
  border: 1px solid #a7f3d0;
}

/* Sub-Panels (Modal drawers inside workflow) */
.lm-subpanel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  overflow: visible;
  margin-bottom: 14px;
  animation: lmFadeIn 0.15s ease-out;
}
.lm-subpanel-header {
  padding: 12px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lm-subpanel-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.lm-subpanel-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.lm-subpanel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Seat Cards */
.lm-seat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}
.lm-seat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06);
}
.lm-seat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}
.lm-seat-num {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lm-seat-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: flex-start;
}
@media (max-width: 640px) {
  .lm-seat-body {
    grid-template-columns: 1fr;
  }
}
.lm-seat-holder-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lm-seat-vacant-box {
  background: #fff8f8;
  border: 1px dashed #fca5a5;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lm-seat-cov-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lm-cov-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.lm-cov-pill.secondary {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Bulk Clinic Location Coverage Management */
.lm-cov-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
  transition: all 0.15s ease;
  user-select: none;
}
.lm-cov-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.lm-cov-item.is-active-baseline {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.lm-cov-item.is-adding {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
}
.lm-cov-item.is-removing {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
.lm-cov-tag {
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.lm-cov-tag.tag-active {
  background: #e0f2fe;
  color: #0369a1;
}
.lm-cov-tag.tag-adding {
  background: #dcfce7;
  color: #15803d;
}
.lm-cov-tag.tag-removing {
  background: #fee2e2;
  color: #b91c1c;
}
.lm-seat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  justify-content: flex-end;
}
.lm-seat-action-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lm-seat-action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.lm-seat-action-btn.primary {
  background: #005030;
  color: #ffffff;
  border-color: #003820;
}
.lm-seat-action-btn.primary:hover {
  background: #003820;
}
.lm-seat-action-btn.danger {
  color: #dc2626;
  border-color: #fecaca;
}
.lm-seat-action-btn.danger:hover {
  background: #fee2e2;
}


