/* ------------------------------------------------------------------
   Thème B-Next Group - Styles globaux & responsive
------------------------------------------------------------------- */
:root {
  --bg-body: #f3f5f8;
  --bg-card: #ffffff;
  --bg-header: #003a5d;       /* bleu profond type B-Next */
  --bg-header-light: #005680;
  --border-soft: #dde3ec;
  --border-strong: #c2cada;
  --accent: #003a5d;
  --accent-soft: #e3edf7;
  --accent-secondary: #e6a400; /* accent chaud léger (facultatif) */
  --text-main: #111111;
  --text-muted: #6b7280;
  --danger: #c0392b;
  --danger-soft: #fde2e1;
  --success: #1e7e34;
  --success-soft: #e0f6e9;
  --info-soft: #e2ecfb;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ------------------------------------------------------------------
   Layout principal
------------------------------------------------------------------- */

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

/* ------------------------------------------------------------------
   Header / barre supérieure (avec logo B-Next)
------------------------------------------------------------------- */

header.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-header);
  border-radius: 12px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

header.row .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand-text h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

.brand-subtitle {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.75rem;
  color: #d6e5f3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

header.row .muted {
  color: #d8e5f3;
  font-size: 0.9rem;
}

header.row a.link,
header.row a {
  color: #f6faff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

header.row a.link:hover,
header.row a:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ------------------------------------------------------------------
   Textes généraux, liens, cartes
------------------------------------------------------------------- */

a.link,
a {
  color: var(--accent);
  text-decoration: none;
}

a.link:hover,
a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

/* Grille responsive (cards admin, home, etc.) */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

/* ------------------------------------------------------------------
   Tableaux (cap table, listes admin)
------------------------------------------------------------------- */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  background: #ffffff;
}

th,
td {
  border: 1px solid #e3e7f0;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
}

th {
  background: #f2f4fb;
  text-align: left;
  font-weight: 600;
}

td.num,
th.num {
  text-align: right;
}

/* Petits écrans : tables plus compactes */
@media (max-width: 600px) {
  th,
  td {
    padding: 0.35rem 0.4rem;
    font-size: 0.85rem;
  }
}

/* ------------------------------------------------------------------
   Formulaires
------------------------------------------------------------------- */

.field {
  margin-bottom: 0.75rem;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  max-width: 320px;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 58, 93, 0.18);
}

/* ------------------------------------------------------------------
   Boutons
------------------------------------------------------------------- */

button {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

button:hover {
  background: var(--bg-header-light);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Boutons dans les tableaux admin (plus compacts) */
table form button {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

/* ------------------------------------------------------------------
   Badges / "pills"
------------------------------------------------------------------- */

.pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* ------------------------------------------------------------------
   Messages flash (success / error / info)
------------------------------------------------------------------- */

.flash-container {
  margin-bottom: 0.8rem;
}

.flash {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.flash-success {
  background: var(--success-soft);
  border: 1px solid var(--success);
}

.flash-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}

.flash-info {
  background: var(--info-soft);
  border: 1px solid #8aa7f0;
}

/* ------------------------------------------------------------------
   Mobile / Responsiveness
------------------------------------------------------------------- */

@media (max-width: 768px) {
  .container {
    margin-top: 1rem;
    padding: 0 0.65rem;
  }

  header.row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    border-radius: 0;
    margin-left: -0.65rem;
    margin-right: -0.65rem;
  }

  .brand {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-logo {
    height: 28px;
  }

  .brand-text h2 {
    font-size: 1.05rem;
  }

  header.row a.link,
  header.row a {
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
  }

  .card {
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  header.row {
    padding: 0.5rem 0.7rem;
  }

  .card {
    padding: 0.8rem 0.8rem;
  }
}
