:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f8fbfe;
  --ink: #1d2f45;
  --muted: #64748b;
  --line: #d8e2ef;
  --primary: #1f5b96;
  --primary-dark: #184973;
  --primary-soft: #e9f2fb;
  --accent: #8ab2e5;
  --warning: #ad7a14;
  --danger: #b33f3f;
  --success: #24704a;
  --shadow: 0 16px 40px rgba(27, 51, 84, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at top left, #f9fcff, var(--bg)); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, .button-link { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.page-shell { max-width: 1380px; margin: 0 auto; padding: 1.2rem clamp(1rem, 3vw, 2rem) 4rem; }
.hero-wrap { margin-bottom: 1rem; }
.hero-card { background: linear-gradient(180deg, #ffffff, #f7fbff); border: 1px solid var(--line); border-radius: 1.5rem; box-shadow: var(--shadow); overflow: hidden; }
.hero-banner { display: block; width: 100%; height: auto; }
.hero-status-row { display: flex; justify-content: flex-end; align-items: center; padding: .7rem 1rem .85rem; border-top: 1px solid var(--line); background: #fbfdff; }
.status-pill { border-radius: 999px; padding: .55rem .85rem; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.status-pill.ok { background: #e7f6ee; color: var(--success); }
.status-pill.warn { background: #fff4db; color: var(--warning); }
.status-pill.neutral { background: #edf3f8; color: var(--muted); }
.tabs { display: flex; gap: .45rem; margin-bottom: 1.5rem; padding: .5rem; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); position: sticky; top: .8rem; z-index: 10; backdrop-filter: blur(10px); }
.tab { border: 0; background: transparent; padding: .8rem 1rem; border-radius: .8rem; color: var(--muted); font-weight: 750; }
.tab.active { background: var(--primary-soft); color: var(--primary); }
main { padding: 0 .1rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.25rem; box-shadow: var(--shadow); }
.search-panel { padding: 1.5rem; }
.section-kicker, .eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 800; letter-spacing: .12em; color: var(--primary); text-transform: uppercase; }
.large-label { display: block; font-size: 1.14rem; font-weight: 800; margin-bottom: .55rem; }
textarea, input, select { width: 100%; border: 1px solid #c9d6e4; border-radius: .75rem; padding: .78rem .85rem; background: white; color: var(--ink); }
textarea:focus, input:focus, select:focus { outline: 3px solid rgba(31, 91, 150, .16); border-color: var(--primary); }
.filters, .form-grid.two, .data-grid { display: grid; gap: 1rem; }
.filters { grid-template-columns: repeat(5, minmax(140px, 1fr)); margin-top: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.actions-row, .stack-actions, .dialog-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.actions-row { margin-top: 1rem; }
button, .button-link { border: 1px solid transparent; border-radius: .8rem; padding: .78rem 1rem; font-weight: 700; transition: .15s ease; }
button:hover, .button-link:hover { transform: translateY(-1px); }
.primary { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: white; }
.secondary { background: #f8fbfe; border-color: var(--line); color: var(--ink); }
.danger { background: #fff1f1; border-color: #f1c8c8; color: var(--danger); }
.result-head, .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1.4rem 0 .9rem; }
h1, h2, h3, h4 { margin: 0; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.results, .manage-list { display: grid; gap: 1rem; }
.result-card, .manage-row { background: var(--surface); border: 1px solid var(--line); border-radius: 1.15rem; box-shadow: var(--shadow); }
.result-card { padding: 1.2rem; }
.result-card.warning-card { border-left: 6px solid #f0ca69; }
.manage-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1.15rem; align-items: flex-start; }
.card-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.badge { display: inline-flex; align-items: center; background: #f3f7fb; color: var(--primary-dark); border: 1px solid var(--line); padding: .28rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 750; }
.badge.type.warning { background: #fff7dd; color: #8d6710; }
.badge.valid { background: #e7f6ee; color: var(--success); }
.badge.archive { background: #f0f2f5; color: #5f6f81; }
.result-meta { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.score { min-width: 4rem; text-align: center; font-weight: 800; color: var(--primary); background: var(--primary-soft); border-radius: .9rem; padding: .55rem .7rem; }
.text-section { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.text-section h4 { margin-bottom: .35rem; color: var(--primary-dark); font-size: .95rem; }
.text-section p { margin: 0; white-space: pre-wrap; }
.card-actions, .manage-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1rem; }
.manage-actions { margin-top: 0; justify-content: flex-end; }
.compact-controls { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.compact-controls input[type="search"] { max-width: 680px; }
.check { display: inline-flex; align-items: center; gap: .5rem; }
.check input { width: auto; margin: 0; }
.data-grid { grid-template-columns: repeat(3, minmax(250px, 1fr)); }
.stack-actions { flex-direction: column; align-items: stretch; }
.empty { padding: 1.2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 1rem; background: rgba(255,255,255,.7); }
.error { color: var(--danger); }
dialog { width: min(920px, calc(100vw - 2rem)); border: 0; border-radius: 1.3rem; padding: 0; box-shadow: 0 30px 80px rgba(18, 33, 51, .22); }
dialog::backdrop { background: rgba(12, 24, 39, .45); backdrop-filter: blur(4px); }
#remarkForm, #historyDialog { padding: 1.2rem; background: white; }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.dialog-subtitle { margin: .35rem 0 0; color: var(--muted); }
.icon-button { background: #f5f8fb; border-color: var(--line); color: var(--primary-dark); font-size: 1.4rem; line-height: 1; width: 2.5rem; height: 2.5rem; padding: 0; }
fieldset { border: 1px solid var(--line); border-radius: 1rem; margin: 1rem 0; padding: .95rem 1rem 1rem; }
legend { padding: 0 .35rem; color: var(--primary-dark); font-weight: 700; }
label { display: grid; gap: .45rem; font-weight: 600; color: #334155; }
.code-preview { margin-bottom: 1rem; padding: .8rem .95rem; border-radius: .9rem; background: var(--surface-soft); border: 1px dashed #c7d6e6; color: var(--primary-dark); font-weight: 700; }
.history-item { border: 1px solid var(--line); border-radius: .9rem; padding: .8rem .95rem; margin-bottom: .75rem; }
.history-item summary { cursor: pointer; font-weight: 700; }
.history-preview { white-space: pre-wrap; overflow: auto; background: #f7fafc; border-radius: .8rem; padding: .85rem; }
#toast { position: fixed; right: 1rem; bottom: 1rem; background: #102c43; color: white; padding: .85rem 1rem; border-radius: .85rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; }
#toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 980px) {
  .filters, .data-grid, .form-grid.two { grid-template-columns: 1fr 1fr; }
  .hero-status-row, .section-head, .result-head, .manage-row, .compact-controls { flex-direction: column; align-items: stretch; }
  .manage-actions { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .page-shell { padding: .75rem .75rem 3rem; }
  .tabs { overflow: auto; }
  .filters, .data-grid, .form-grid.two { grid-template-columns: 1fr; }
}

/* Version 1.0 */
[hidden] { display: none !important; }
.field-help {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.4;
}
.suggestion-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin: .2rem 0 1rem;
}
.suggestion-row .field-help { flex: 1 1 260px; }

/* Version 1.1.0 — comptes personnels */
.hero-status-row {
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}
.account-identity {
  display: grid;
  gap: .08rem;
  padding-right: .35rem;
  text-align: right;
}
.account-identity span {
  color: var(--muted);
  font-size: .82rem;
}
.compact-button { padding: .55rem .75rem; font-size: .88rem; }
.audit-line {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .82rem;
}
.badge.warning { background: #fff4db; color: var(--warning); }
.inactive-user { opacity: .72; background: #f7f8fa; }
.user-active-check { align-self: end; min-height: 45px; }
.dialog-content { padding: 1.2rem; background: white; }
.small-dialog { width: min(560px, calc(100vw - 2rem)); }
.small-dialog label + label, .dialog-content label + label { margin-top: .9rem; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at top left, #f9fcff, var(--bg));
}
.auth-shell { width: min(760px, 100%); }
.auth-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: 0 24px 70px rgba(27, 51, 84, .14);
}
.auth-banner { display: block; width: 100%; height: auto; }
.auth-content { padding: clamp(1.2rem, 4vw, 2.1rem); }
.auth-content h1 { margin-bottom: .5rem; }
.auth-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.auth-form button { margin-top: .2rem; }
.auth-error { margin: 0; }
.compact-auth-card { max-width: 720px; margin: 0 auto; }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; }

@media (max-width: 980px) {
  .hero-status-row { align-items: stretch; }
  .account-bar { justify-content: flex-start; }
  .account-identity { text-align: left; width: 100%; }
}
