/* ============================================================
   ADMINISTRACION.CSS — Panel Enterprise Heavensy
   Variables del proyecto:
     Primary purple : #9961FF
     Blue           : #5a79d4
     Font           : DM Sans / system-ui
     Alerta rojo    : #ef4444
     Alerta naranja : #f59e0b
     Alerta verde   : #10b981
   ============================================================ */

/* ── Root / contenedor general ── */
.adm-root {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 54px);
  overflow: hidden;
  background: #f1f5f9;
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ══════════════════════════════════════════
   HEADER STATS — 4 tarjetas en fila
══════════════════════════════════════════ */
.adm-header-stats {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 0.5px solid #e5e7eb;
  flex-shrink: 0;
}

.adm-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.adm-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.adm-stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.adm-stat-label {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

/* ══════════════════════════════════════════
   CUERPO PRINCIPAL — grid 70/30
══════════════════════════════════════════ */
.adm-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ── Columna izquierda: equipo ── */
.adm-team-col {
  flex: 0 0 70%;
  max-width: 70%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px;
  gap: 12px;
}

.adm-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.adm-col-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.adm-btn-refresh {
  background: none;
  border: 0.5px solid #e5e7eb;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
}
.adm-btn-refresh:hover {
  background: #f3f4f6;
  color: #9961FF;
}

/* Grid de tarjetas */
.adm-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

/* ── Estado vacío ── */
.adm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9ca3af;
  font-size: 13px;
  padding: 48px 0;
  grid-column: 1 / -1;
}
.adm-empty-state i {
  font-size: 24px;
}

/* ══════════════════════════════════════════
   TARJETA DE INTEGRANTE
══════════════════════════════════════════ */
.adm-member-card {
  background: #ffffff;
  border: 0.5px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: box-shadow 0.15s;
}
.adm-member-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Cabecera de la tarjeta */
.adm-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Avatar circular con gradiente */
.adm-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8e84fa, #91c0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.adm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Indicador online/offline sobre el avatar */
.adm-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.adm-online-dot.online  { background: #10b981; }
.adm-online-dot.offline { background: #9ca3af; }

/* Info nombre y rol */
.adm-card-info {
  flex: 1;
  min-width: 0;
}
.adm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-card-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 2px;
}
/* Colores de rol */
.adm-role-admin       { background: #ede9fe; color: #7c3aed; }
.adm-role-profesional { background: #dbeafe; color: #1d4ed8; }
.adm-role-secretaria  { background: #d1fae5; color: #065f46; }
.adm-role-default     { background: #f3f4f6; color: #374151; }

/* Alertas en la tarjeta */
.adm-card-alerts {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.adm-alert-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.adm-alert-overload   { background: #fee2e2; color: #ef4444; }
.adm-alert-noresponse { background: #fef3c7; color: #d97706; }

/* Pills de carga laboral */
.adm-load-pills {
  display: flex;
  gap: 6px;
}
.adm-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 0.5px solid #e5e7eb;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  color: #374151;
  font-weight: 500;
}
.adm-pill i {
  color: #9961FF;
  font-size: 10px;
}

/* Barra de progreso de carga */
.adm-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adm-progress-label {
  font-size: 11px;
  color: #6b7280;
  flex-shrink: 0;
  white-space: nowrap;
}
.adm-progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.adm-progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}
.adm-progress-bar-fill.low    { background: #10b981; }
.adm-progress-bar-fill.medium { background: #f59e0b; }
.adm-progress-bar-fill.high   { background: #ef4444; }
.adm-progress-pct {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* Masivos del mes */
.adm-masivos-row {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 5px;
}
.adm-masivos-row i {
  color: #5a79d4;
}
.adm-masivos-row strong {
  color: #374151;
}

/* Botón asignar tarea */
.adm-btn-asignar {
  align-self: flex-end;
  background: none;
  border: 0.5px solid #9961FF;
  color: #9961FF;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.adm-btn-asignar:hover {
  background: #9961FF;
  color: #fff;
}

/* Sin datos */
.adm-no-data {
  font-size: 10px;
  color: #9ca3af;
  font-style: italic;
}

/* ══════════════════════════════════════════
   PANEL LATERAL DERECHO
══════════════════════════════════════════ */
.adm-side-panel {
  flex: 0 0 30%;
  max-width: 30%;
  background: #f8fafc;
  border-left: 0.5px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.adm-side-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-bottom: 0.5px solid #e5e7eb;
  min-height: 0;
}
.adm-side-section:last-child {
  border-bottom: none;
}

.adm-side-section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border-bottom: 0.5px solid #f1f5f9;
  flex-shrink: 0;
}

.adm-badge-count {
  margin-left: auto;
  background: #9961FF;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}
.adm-badge-count.zero {
  background: #e5e7eb;
  color: #9ca3af;
}

.adm-side-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-side-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 16px 0;
}

/* ── Items del panel lateral ── */
.adm-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 0.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.adm-side-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8e84fa, #91c0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.adm-side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.adm-side-info {
  flex: 1;
  min-width: 0;
}
.adm-side-name {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-side-sub {
  color: #6b7280;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-side-date-red {
  color: #ef4444;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.adm-side-badge-noai {
  background: #fee2e2;
  color: #ef4444;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Botón asignar en cola lateral */
.adm-btn-asignar-cola {
  background: #9961FF;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
  font-family: inherit;
}
.adm-btn-asignar-cola:hover {
  opacity: 0.85;
}

/* Tarea en cola */
.adm-task-cola {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.adm-task-cola-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}
.adm-task-title {
  font-weight: 600;
  color: #111827;
  font-size: 12px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-task-date {
  font-size: 10px;
  color: #9ca3af;
}

/* ══════════════════════════════════════════
   MODAL ASIGNAR TAREA
══════════════════════════════════════════ */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.adm-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: adm-modal-in 0.2s ease;
}

@keyframes adm-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.adm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 0.5px solid #e5e7eb;
}
.adm-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.adm-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.adm-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.adm-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adm-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.adm-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.adm-input,
.adm-select,
.adm-textarea {
  border: 0.5px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #111827;
  font-family: inherit;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  border-color: #9961FF;
  box-shadow: 0 0 0 3px rgba(153,97,255,0.12);
  background: #fff;
}

.adm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 0.5px solid #e5e7eb;
}

.adm-btn-primary {
  background: #9961FF;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: opacity 0.15s;
}
.adm-btn-primary:hover { opacity: 0.88; }

.adm-btn-secondary {
  background: none;
  color: #6b7280;
  border: 0.5px solid #d1d5db;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.adm-btn-secondary:hover { background: #f3f4f6; }

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile básico
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .adm-header-stats {
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
  }
  .adm-stat-card {
    min-width: 130px;
  }
  .adm-body {
    flex-direction: column;
    overflow-y: auto;
  }
  .adm-team-col,
  .adm-side-panel {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  .adm-team-col {
    overflow: visible;
  }
  .adm-team-grid {
    overflow: visible;
  }
  .adm-side-panel {
    border-left: none;
    border-top: 0.5px solid #e5e7eb;
  }
  .adm-side-section {
    flex: none;
    min-height: 200px;
    max-height: 260px;
  }
}
