/* Staff Portfolio MSF WaCA : identite visuelle (navy, rouge, teal, or, ardoise, vert). */
:root {
  --navy: #1F3864;
  --navy-dark: #152849;
  --red: #BE1622;
  --teal: #028090;
  --teal-light: #e3f3f5;
  --gold: #DFA126;
  --gold-light: #fbf1dc;
  --slate: #51627A;
  --green: #2E7D32;
  --green-light: #e6f2e7;
  --red-light: #f9e3e4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #d9dfe7;
  --text: #1f2a37;
  --muted: #5f6b7a;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--teal); }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0 0 0.4rem; font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }
h3.sub { font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--slate); }
code { font-family: Consolas, "Courier New", monospace; font-size: 0.9em; background: #eef1f5; padding: 0.05em 0.3em; border-radius: 3px; }
code.link-box { display: block; padding: 0.5rem; word-break: break-all; }
small, .muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: 0.4rem 0; }
.prose p { margin: 0 0 0.7rem; }
.help { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; }
.req { color: var(--red); }

/* Barre haute et navigation */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 0.5rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--font-head); font-size: 1.1rem; }
.brand small { color: #c9d4e6; font-size: 0.75rem; }
.main-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.main-nav a { color: #e6ecf5; text-decoration: none; padding: 0.45rem 0.7rem; border-radius: 4px; font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { background: var(--navy-dark); color: #fff; }
.main-nav a.active { background: #fff; color: var(--navy); }
.user-box { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.user-name { color: #fff; font-weight: 600; text-decoration: none; }
.user-role { color: #c9d4e6; }
.btn-link { background: none; border: 1px solid #7f93b6; color: #fff; padding: 0.3rem 0.6rem; border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.btn-link:hover { background: var(--red); border-color: var(--red); }
.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav a { display: inline-block; padding: 0.55rem 0.9rem; color: var(--slate); text-decoration: none; font-weight: 600; font-size: 0.92rem; border-bottom: 3px solid transparent; }
.subnav a.active { color: var(--navy); border-bottom-color: var(--red); }
.subnav a:hover { color: var(--navy); }

/* Conteneurs */
.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.container-wide { max-width: 1400px; }
.page-head { margin-bottom: 1rem; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.page-head .subtitle { margin: 0; color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.page-actions.right { justify-content: flex-end; margin-bottom: 0.5rem; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.crumbs .sep { margin: 0 0.3rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 1rem; border-top: 3px solid var(--navy); }
.card-warn { border-top-color: var(--gold); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 1rem 0.3rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.card-body { padding: 0.6rem 1rem 1rem; }
.section-list { list-style: none; padding: 0; margin: 0; }
.section-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid #edf0f4; }
.section-list li:last-child { border-bottom: none; }
.section-list a { font-weight: 600; text-decoration: none; }
.todo { margin: 0; padding-left: 1.2rem; }
.todo li { margin-bottom: 0.4rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; }
.dl dt { font-weight: 600; color: var(--slate); }
.dl dd { margin: 0; }
details { margin: 0.5rem 0; }
summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.footer { max-width: 1400px; margin: 1rem auto 2rem; padding: 0 1.25rem; font-size: 0.85rem; color: var(--muted); display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Profil */
.profile-identity { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.profile-identity .subtitle { margin: 0.1rem 0; color: var(--text); font-weight: 600; }
.profile-identity .meta { margin: 0; color: var(--muted); }
.profile-status { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.charter { max-height: 16rem; overflow: auto; border: 1px solid var(--line); padding: 0.6rem 0.9rem; border-radius: 4px; background: #fafbfc; margin-bottom: 0.6rem; }
fieldset.reserved { grid-column: 1 / -1; border: 1px dashed var(--gold); border-radius: 6px; padding: 0.5rem 1rem 0.8rem; background: var(--gold-light); }
fieldset.reserved legend { font-weight: 700; color: var(--slate); padding: 0 0.4rem; }

/* Formulaires */
form { margin: 0; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.6rem 1rem; align-items: start; }
.form-inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.3rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; color: var(--slate); }
.field-check label { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="month"], .field input[type="date"], .field select, .field textarea {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid #b8c2cf; border-radius: 4px; font: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.field input[type="file"] { font: inherit; }
.field textarea { resize: vertical; }
.check-row { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 0.6rem 0; }
textarea.emails { width: 100%; font: inherit; font-size: 0.85rem; border: 1px solid var(--line); border-radius: 4px; padding: 0.4rem; }

/* Boutons */
.btn { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #eef2f8; color: var(--navy); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; background: #eef2f8; color: var(--navy); padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--line); vertical-align: bottom; }
.table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #edf0f4; vertical-align: top; }
.table tr:hover td { background: #fafbfd; }
.table-matrix td, .table-matrix th { text-align: center; }
.table-matrix td:first-child, .table-matrix th:first-child { text-align: left; }
.heat { display: inline-block; min-width: 2.2rem; padding: 0.15rem 0.3rem; border-radius: 3px; font-weight: 600; }
.heat-0 { color: #c3cbd6; }
.heat-1 { background: #e3f3f5; color: var(--navy); }
.heat-2 { background: #b9e2e7; color: var(--navy); }
.heat-3 { background: #67bfc9; color: #fff; }
.heat-4 { background: var(--teal); color: #fff; }

/* Badges et alertes */
.badge { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--green-light); color: var(--green); }
.badge-warn { background: var(--gold-light); color: #8a5d05; }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-info { background: var(--teal-light); color: var(--teal); }
.badge-muted { background: #e9edf2; color: var(--slate); }
.badge-draft { background: #e9edf2; color: var(--slate); border: 1px dashed var(--slate); }
.lvl-1 { background: #e9edf2; color: var(--slate); }
.lvl-2 { background: var(--teal-light); color: var(--teal); }
.lvl-3 { background: #dde5f3; color: var(--navy); }
.lvl-4 { background: var(--gold-light); color: #8a5d05; }
.alert { padding: 0.6rem 0.9rem; border-radius: 4px; margin-bottom: 0.8rem; border: 1px solid transparent; }
.alert ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.alert-ok { background: var(--green-light); border-color: #b9dcbb; color: #1f5a22; }
.alert-error { background: var(--red-light); border-color: #efb9bd; color: #8a1118; }
.alert-warn { background: var(--gold-light); border-color: #f0d9a3; color: #6a4a07; }
.alert-info { background: var(--teal-light); border-color: #b3dfe4; color: #045a65; }

/* Indicateurs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 6px; padding: 0.7rem 0.9rem; }
.kpi-value { font-family: var(--font-head); font-size: 1.7rem; color: var(--navy); line-height: 1.1; }
.kpi-label { font-weight: 700; color: var(--slate); margin-top: 0.2rem; }
.kpi-hint { font-size: 0.8rem; color: var(--muted); }

/* Pages d'authentification */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-box { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 8px; padding: 1.5rem 1.75rem; width: 100%; max-width: 440px; }
.auth-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand strong { font-family: var(--font-head); color: var(--navy); font-size: 1.2rem; }
.auth-box h1 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.auth-box .field { margin-bottom: 0.7rem; }

@media (max-width: 700px) {
  .topbar-inner { gap: 0.6rem; }
  .user-role { display: none; }
  .container { padding: 0.8rem; }
  h1 { font-size: 1.4rem; }
}
@media print {
  .topbar, .subnav, .footer, .page-actions, form.inline, .btn { display: none !important; }
  .card { break-inside: avoid; }
}
