/* ══════════════════════════════════════════════════════════════
   CRUD SHARED STYLES — Revue IGA (Style E-SENAT)
   Utilisé par : edit_user, domaines, volumes, menus, parametres
══════════════════════════════════════════════════════════════ */

/* ── En-tête de page ──────────────────────────────────────── */
.crud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.crud-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a2a2a;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--iga-font-titre, 'Segoe UI');
}
.crud-title i { color: var(--iga-primary, #008080); }

/* ── Boutons header ───────────────────────────────────────── */
.crud-btn-new {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.2rem;
  border-radius: 8px;
  background: #dc3545;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220,53,69,.28);
  transition: filter .15s, transform .15s;
}
.crud-btn-new:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }

.crud-btn-liste {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.2rem;
  border-radius: 8px;
  background: #198754;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25,135,84,.28);
  transition: filter .15s;
}
.crud-btn-liste:hover { filter: brightness(1.1); color: #fff; }

/* ── Bandeau formulaire dégradé (style image 2) ───────────── */
.crud-form-banner {
  background: linear-gradient(90deg, #dc3545 0%, #6b3a2a 50%, #198754 100%);
  border-radius: 10px 10px 0 0;
  padding: .85rem 1.5rem;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.crud-form-banner.edit {
  background: linear-gradient(90deg, var(--iga-primary,#008080) 0%, #005f5f 50%, #003a3a 100%);
}

/* ── Wrapper formulaire ───────────────────────────────────── */
.crud-form-wrap {
  background: #fff;
  border: 1px solid #e2ecec;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}

/* ── Labels et champs ─────────────────────────────────────── */
.crud-field label {
  font-size: .8rem;
  font-weight: 600;
  color: #3a5050;
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.crud-field label i { color: var(--iga-primary, #008080); font-size: .85rem; }
.crud-field label .req { color: #dc3545; }

.crud-field .form-control,
.crud-field .form-select,
.crud-field textarea {
  border: 1px solid #dde8e8;
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .85rem;
  color: #1a2a2a;
  background: #fafefe;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.crud-field .form-control:focus,
.crud-field .form-select:focus,
.crud-field textarea:focus {
  border-color: var(--iga-primary, #008080);
  box-shadow: 0 0 0 3px rgba(0,128,128,.1);
  background: #fff;
  outline: none;
}
.crud-field .form-control::placeholder { color: #aabebe; }

/* ── Séparateur de section ────────────────────────────────── */
.crud-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8aabab;
  border-bottom: 1px solid #f0f5f5;
  padding-bottom: .5rem;
  margin-bottom: 1rem;
  margin-top: .25rem;
}

/* ── Checkboxes badge style ───────────────────────────────── */
.crud-check-item  { display: none; }
.crud-check-label {
  padding: .35rem .9rem;
  border-radius: 99px;
  border: 1.5px solid #dde8e8;
  font-size: .75rem;
  font-weight: 600;
  color: #6b8a8a;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  display: inline-block;
}
.crud-check-item:checked + .crud-check-label {
  background: var(--iga-primary, #008080);
  border-color: var(--iga-primary, #008080);
  color: #fff;
}
.crud-check-label:hover { border-color: var(--iga-primary,#008080); color: var(--iga-primary,#008080); }
.crud-check-item:checked + .crud-check-label:hover { color: #fff; }

/* ── Boutons submit ───────────────────────────────────────── */
.crud-submit {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  text-decoration: none;
}
.crud-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.crud-submit-primary {
  background: linear-gradient(135deg, var(--iga-primary,#008080), #00a89e);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0,128,128,.3);
}
.crud-submit-danger {
  background: linear-gradient(135deg, #dc3545, #c62835);
  color: #fff;
  box-shadow: 0 3px 12px rgba(220,53,69,.3);
}
.crud-submit-secondary {
  background: #f0f5f5;
  color: #3a5050;
}
.crud-submit-secondary:hover { background: #e2ecec; color: #1a2a2a; }

/* ── Tableau CRUD (liste) ─────────────────────────────────── */
.crud-table-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2ecec;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow: hidden;
}
.crud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.crud-table thead tr { background: #2a3535; color: #fff; }
.crud-table thead th {
  padding: .85rem 1rem;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .03em;
  border: none;
}
.crud-table thead th:first-child { padding-left: 1.5rem; }
.crud-table thead th:last-child  { text-align: center; padding-right: 1.5rem; }
.crud-table tbody tr { border-bottom: 1px solid #f0f5f5; transition: background .12s; }
.crud-table tbody tr:hover { background: #f5fbfb; }
.crud-table tbody tr:last-child { border-bottom: none; }
.crud-table tbody td { padding: .85rem 1rem; color: #2a3535; vertical-align: middle; }
.crud-table tbody td:first-child { padding-left: 1.5rem; }
.crud-table tbody td:last-child  { text-align: center; padding-right: 1.5rem; }

/* ── Boutons actions tableau ──────────────────────────────── */
.crud-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  text-decoration: none;
  transition: filter .15s, transform .15s;
}
.crud-action-btn:hover { filter: brightness(1.1); transform: scale(1.08); }
.crud-action-edit   { background: #198754; color: #fff; }
.crud-action-delete { background: #dc3545; color: #fff; }
.crud-action-toggle { background: #fd7e14; color: #fff; }
.crud-action-view   { background: #0d6efd; color: #fff; }

/* ── Modal CRUD ───────────────────────────────────────────── */
.crud-modal .modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  overflow: hidden;
}
.crud-modal .modal-header {
  background: linear-gradient(90deg, var(--iga-primary,#008080) 0%, #005f5f 100%);
  border: none;
  padding: 1rem 1.5rem;
}
.crud-modal .modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.crud-modal .btn-close { filter: invert(1); opacity: .8; }
.crud-modal .modal-body { padding: 1.5rem; }
.crud-modal .modal-footer {
  border-top: 1px solid #f0f5f5;
  padding: 1rem 1.5rem;
  background: #fafefe;
}

/* Badge statut */
.crud-badge-actif   { display:inline-flex;align-items:center;gap:.4rem;padding:.28rem .75rem;border-radius:99px;font-size:.72rem;font-weight:700;background:#19875418;color:#198754; }
.crud-badge-inactif { display:inline-flex;align-items:center;gap:.4rem;padding:.28rem .75rem;border-radius:99px;font-size:.72rem;font-weight:700;background:#fd7e1418;color:#dc6900; }
.crud-badge-ouvert  { display:inline-flex;align-items:center;gap:.4rem;padding:.28rem .75rem;border-radius:99px;font-size:.72rem;font-weight:700;background:#0d6efd18;color:#0d6efd; }
.crud-badge-clos    { display:inline-flex;align-items:center;gap:.4rem;padding:.28rem .75rem;border-radius:99px;font-size:.72rem;font-weight:700;background:#6c757d18;color:#6c757d; }
.crud-badge-dot { width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0; }
