/* ─── Alertes Admin ──────────────────────────────────────────────────── */

/* ── Layout ── */
.aa-list-col {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}

.aa-form-col {
  width: 420px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--surface);
}
.aa-form-col.hidden { display: none; }

.aa-form-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 15px; color: var(--text-1);
}

.aa-form-body {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

.aa-form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 8px;
}

/* ── Cartes alerte ── */
.aa-card {
  background: var(--surface);
  border: 1px solid rgba(26,35,126,.10);
  border-radius: 4px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, border-color .15s;
  position: relative; overflow: hidden;
}
.aa-card::after {
  content: ''; position: absolute;
  bottom: -22px; right: -22px;
  width: 58px; height: 58px; border-radius: 50%;
  background: #e65100; opacity: .11; pointer-events: none;
}
.aa-card.resolue::after { background: #757575; }
.aa-card:hover { box-shadow: var(--shadow-sm); }

.aa-card.resolue  { opacity: .7; }

.aa-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.aa-card-icon { font-size: 20px; flex-shrink: 0; line-height: 1.2; }

.aa-card-titre {
  font-weight: 700; font-size: 15px; color: var(--text-1);
  flex: 1;
}
.aa-card.resolue .aa-card-titre { text-decoration: line-through; color: var(--text-3); }

.aa-card-desc {
  font-size: 13px; color: var(--text-2);
  white-space: pre-wrap;
}

/* ── Timer ── */
.aa-timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 3px;
  width: fit-content;
}
.aa-timer.urgente  { background: #ffebee; color: #c62828; }
.aa-timer.proche   { background: #fff3e0; color: #e65100; }
.aa-timer.normale  { background: #e8f5e9; color: #2e7d32; }
.aa-timer.resolue  { background: #f5f5f5; color: #757575; }

/* ── Destinataires ── */
.aa-card-destins {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.aa-destin-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: 3px; padding: 2px 10px;
  font-size: 12px; font-weight: 600;
}
.aa-destin-label {
  font-size: 12px; color: var(--text-3);
  font-style: italic;
}

/* ── Actions ── */
.aa-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.aa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; border: none;
  cursor: pointer; transition: background .15s, opacity .15s;
}
.aa-btn:hover { opacity: .85; }
.aa-btn-reporter { background: #e8f0fe; color: #1a237e; }
.aa-btn-resoudre { background: #e8f5e9; color: #2e7d32; }
.aa-btn-edit     { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.aa-btn-delete   { background: #ffebee; color: #c62828; }
.aa-btn-histo    { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); font-size: 11px; }

/* ── Partage dans le formulaire ── */
.aa-admins-list {
  border: 1px solid var(--border); border-radius: 8px;
  max-height: 132px; /* ~3 items de 44px chacun */
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.aa-admin-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.aa-admin-item:last-child { border-bottom: none; }
.aa-admin-item:hover { background: var(--surface-2); }
.aa-admin-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.aa-admin-item-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.aa-admin-item-role { font-size: 11px; color: var(--text-3); margin-left: auto; }
.aa-admins-loading { padding: 12px; font-size: 13px; color: var(--text-3); text-align: center; }
.aa-admins-hint    { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.aa-admins-empty   { padding: 12px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ── Toggle résolues ── */
.aa-toggle-resolues {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; user-select: none;
}
.aa-toggle-resolues input { cursor: pointer; }

/* ── Empty state ── */
.aa-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-3); font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.aa-empty.hidden { display: none; }
.aa-empty-icon { font-size: 48px; }

/* ── Séparateur de créateur ── */
.aa-card-meta {
  font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 8px;
}

/* ── Modal ── */
.aa-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.aa-modal-overlay.hidden { display: none; }

.aa-modal {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 420px; max-width: 95vw;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.aa-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 15px;
}
.aa-modal-body   { padding: 20px; }
.aa-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.aa-modal-alerte-titre {
  font-weight: 600; color: var(--text-1);
  padding: 8px 12px; background: var(--surface-2);
  border-radius: 8px; font-size: 14px;
}
.aa-modal-nouvelle-date {
  margin-top: 12px; font-size: 13px; color: var(--text-2);
}
.aa-modal-unit { font-size: 14px; color: var(--text-2); }

/* ── Historique reports ── */
.aa-histo-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 10px 0; }
.aa-histo-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.aa-histo-row:last-child { border-bottom: none; }
.aa-histo-arrow { color: var(--text-3); }
.aa-histo-dates { color: var(--text-1); font-weight: 600; }
.aa-histo-nbj   { color: var(--primary); font-size: 12px; }
.aa-histo-date  { color: var(--text-3); font-size: 11px; margin-left: auto; }

/* ── Badge header (agenda) ── */
.alerte-header-badge {
  position: relative;
  display: inline-flex;
}
#alertes-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e53935; color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; pointer-events: none;
  border: 2px solid var(--surface);
}

/* ── req ── */
.req { color: #e53935; }
