*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1854px;
    margin: 0 auto;
    padding: 1.5rem;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #222;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

table.dataTable thead th {
    background: #f0f0f0;
}

.alert-error {
    background: #fdecea;
    border-left: 4px solid #e53935;
    padding: .8rem 1rem;
    border-radius: 4px;
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-left: 4px solid #43a047;
    padding: .8rem 1rem;
    border-radius: 4px;
    color: #2e7d32;
}

.center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
/* ── Formulaire générique ──────────────────────────────────────── */
.generic-form {
  max-width: 560px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary, #555);
  text-transform: capitalize;
}

.form-input {
  padding: 0.6rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #222);
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: #534AB7;
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.12);
}

/* Select hérite du même style que les inputs */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  align-items: center;
}

.btn-submit {
  padding: 0.65rem 1.6rem;
  background: #534AB7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover { background: #3C3489; }

.btn-cancel {
  font-size: 0.9rem;
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}

.btn-cancel:hover { color: #534AB7; }

/* ── Health dashboard ──────────────────────────────────────────── */
.card-metric {
  background: var(--color-background-secondary, #f8f8f8);
  border: 1px solid var(--color-border-tertiary, #e5e5e5);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-value {
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a1a);
  line-height: 1.1;
  margin: 0.2rem 0;
}

.metric-unit {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text-secondary, #888);
}

.metric-sub {
  font-size: 0.82rem;
  color: var(--color-text-secondary, #666);
}

.metric-bar-wrap {
  height: 6px;
  background: var(--color-border-tertiary, #e5e5e5);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.6rem 0 0.2rem;
}

.metric-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  max-width: 100%;
}

.metric-hint {
  font-size: 0.78rem;
  color: var(--color-text-tertiary, #999);
}

/* ── Formulaire 2 colonnes ─────────────────────────────────────── */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.6rem;
  max-width: 860px;
}

/* Champs pleine largeur en mode 2 colonnes */
.form-2col .form-group-full {
  grid-column: 1 / -1;
}

/* En mode 1 colonne, on garde le flex original */
.generic-form:not(.form-2col) {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 560px;
}

/* Responsive : repasser en 1 colonne sur mobile */
@media (max-width: 640px) {
  .form-2col {
    grid-template-columns: 1fr;
  }
  .form-2col .form-group[data-fullwidth="true"],
  .form-2col .form-actions-fullwidth {
    grid-column: 1;
  }
}

