/* ============================================================
   SUZANNE — UI (charte ITERA CLAUDE, dominante VERT #2E9E86).
   Base : charte-itera-claude.css (tokens + composants DS).
   Polices auto-hébergées : charte-itera.css (@font-face).
   Ici : layout + restyle des classes propres à l'app via tokens DS
   + langage organique (soulignés ondulés, arcs sonar) en CSS pur.
   data-app="suzanne" est posé par le serveur (_page) sur <html>.
   ============================================================ */
@import url('./charte-itera-claude.css');
@import url('./charte-itera.css');

:root {
  --maxw: 1120px;

  /* Alias rétro-compatibilité → tokens du design system
     (permet de ne pas toucher au HTML/JS existant). */
  --app-primary:    var(--primary);
  --app-primary-d:  var(--primary-strong);
  --app-primary-dd: var(--primary-strong);
  --white:          var(--surface);

  /* Sémantique de risque → tokens DS */
  --risk-low:    var(--sem-success);
  --risk-medium: var(--sem-warning);
  --risk-high:   var(--sem-danger);
  --risk-crit:   var(--sem-crit);

  /* Compat charte-itera (spots résiduels éventuels) */
  --itera-yellow: var(--c-yellow);
  --itera-pale:   var(--surface-2);

  /* Décor organique (data-URI SVG, aucun asset externe) */
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2,8 C14,2 22,2 34,7 C46,12 55,12 67,7 C79,2 88,2 100,7 C110,11 115,10 118,8.5' fill='none' stroke='%23E8BA29' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --sonar-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.14' stroke-width='6' stroke-linecap='round'%3E%3Cpath d='M18,90 A72,72 0 0 1 90,18'/%3E%3Cpath d='M34,92 A58,58 0 0 1 92,34'/%3E%3Cpath d='M50,94 A44,44 0 0 1 94,50'/%3E%3C/g%3E%3Ccircle cx='92' cy='92' r='7' fill='%23ffffff' fill-opacity='0.14'/%3E%3C/svg%3E");
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400; letter-spacing: 0.5px; line-height: 1.05; color: var(--ink);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-soft); }

/* ─── Topbar / Nav ─────────────────────────────────────────── */
/* Bandeau : 2 rangées — brand centré / nav en dessous. Arcs sonar en filigrane. */
.topbar {
  background: var(--primary);
  background-image: var(--sonar-white);
  background-repeat: no-repeat;
  background-position: right -14px top -30px;
  background-size: 190px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(18,37,42,.14);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; align-items: center; padding: 10px 24px 0; gap: 6px; position: relative; }
/* Rangée 1 : lockup SUZANNE by ITERA centré */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo { height: 36px; width: auto; display: block; background: #fff; border-radius: 9px; padding: 3px; }
.brand .name { font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; color: #fff; line-height: 1; }
.brand .sep { width: 1px; height: 22px; background: rgba(255,255,255,.42); margin: 0 3px; }
.brand .by-itera { display: inline-flex; align-items: baseline; gap: 6px; }
.brand .by { color: rgba(255,255,255,.82); font-size: 12px; font-style: italic; }
.brand .itera-txt { font-family: var(--font-body); font-weight: 800; font-size: 16px; letter-spacing: 2px; color: #fff; }
/* Rangée 2 : nav horizontale */
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: center; padding-bottom: 8px; }
.nav a { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.94); }
.nav a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.nav a.active { background: #fff; color: var(--primary-strong); box-shadow: inset 0 -3px 0 var(--c-yellow); }
.nav .who { font-size: 12px; color: rgba(255,255,255,.9); }
@media (max-width: 600px) {
  .topbar-inner { padding: 8px 16px 0; }
  .nav a { padding: 5px 9px; font-size: 12.5px; }
  .nav .who { display: none; }
  .brand .sep, .brand .by-itera { display: none; }
}

/* ─── Layout / Cards ───────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 60px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; position: relative; }
.card h2 { font-size: 26px; margin-bottom: 4px; position: relative; padding-bottom: 13px; }
/* Souligné ondulé jaune (langage organique ITERA) */
.card h2::after { content: ''; position: absolute; left: 0; bottom: 2px; width: 62px; height: 9px;
  background: var(--squiggle) no-repeat left center; background-size: 100% 100%; }
.card .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 16px; }
.card h3 { font-size: 15px; font-weight: 700; color: var(--primary-strong); margin: 4px 0 8px; font-family: var(--font-body); }

/* ─── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  background-image: var(--sonar-white), linear-gradient(135deg, var(--primary), var(--primary-strong));
  background-repeat: no-repeat, no-repeat;
  background-position: right -10px top -18px, center;
  background-size: 240px, cover;
  color: #fff; border-radius: var(--radius); padding: 32px 30px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 48px; display: inline-block; position: relative; padding-bottom: 16px; }
.hero h1::after { content: ''; position: absolute; left: 0; bottom: 2px; width: 92px; height: 12px;
  background: var(--squiggle) no-repeat left center; background-size: 100% 100%; }
.hero p { max-width: 640px; opacity: 0.96; margin-top: 10px; font-size: 15px; }
.hero .pill { display: inline-block; margin-top: 16px; padding: 6px 14px; background: rgba(255,255,255,0.18); border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; font-family: var(--font-body); text-transform: none; color: #fff; }

/* ─── Champs / Boutons ─────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-size: 14.5px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 170px; }

.btn { display: inline-block; padding: 11px 20px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; background: var(--primary); color: var(--on-primary); font-family: var(--font-body); font-weight: 700; font-size: 14px; transition: .18s; }
.btn:hover { background: var(--primary-strong); }
.btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-yellow { background: var(--c-yellow); color: #3a2d00; }
.btn-yellow:hover { background: #d8ab1e; }
.btn-light { padding: 7px 12px; border: 1px solid var(--border-p); border-radius: 8px; cursor: pointer; background: var(--surface); color: var(--link); font-family: var(--font-body); font-weight: 600; font-size: 12.5px; transition: .18s; }
.btn-light:hover { background: var(--tint); }
.err { color: var(--sem-crit); font-size: 13px; min-height: 18px; margin-top: 6px; }
.ok  { color: var(--primary-strong); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* ─── Champs multiligne + utilitaires partagés ─── */
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 14px; background: var(--surface); color: var(--ink);
  resize: vertical; min-height: 64px; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.btn, .btn-light, .btn-yellow { text-decoration: none; }
.addbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.saveind { font-size: 12px; color: var(--primary-strong); font-weight: 600; }
.skill-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.skill-row .nm { flex: 1; }
/* Inputs fichier à la charte */
input[type=file] { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); }
input[type=file]::file-selector-button { padding: 8px 14px; margin-right: 10px; border: none; border-radius: 8px;
  background: var(--primary); color: var(--on-primary); font-family: var(--font-body); font-weight: 700; font-size: 13px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--primary-strong); }

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.users-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.users-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.users-table tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.pill-tag { display: inline-block; background: var(--tint); color: var(--link); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; }

/* ─── KPIs / barres ────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid var(--c-yellow); border-radius: 12px; padding: 14px 16px; text-align: center; }
.kpi-v { font-size: 26px; font-weight: 800; color: var(--primary-strong); line-height: 1.1; }
.kpi-l { font-size: 12px; color: var(--ink-soft); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ─── Notices / boxes (encart crème ITERA) ─────────────────── */
.notice { background: var(--cream); border: 1px solid color-mix(in srgb, var(--c-yellow) 30%, var(--line)); border-left: 4px solid var(--c-yellow); padding: 11px 15px; border-radius: 0 8px 8px 0; font-size: 13px; margin-top: 10px; }
.tempbox { background: var(--surface-2); border: 1px dashed var(--primary); border-radius: 10px; padding: 12px; margin-top: 12px; font-family: var(--font-mono); font-size: 14px; word-break: break-all; }

/* ─── Auth (login / change password) ───────────────────────── */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 390px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; text-align: center; position: relative; }
.auth-card .logo { height: 66px; }
.auth-card h1 { font-size: 32px; color: var(--primary-strong); margin: 10px 0 2px; position: relative; display: inline-block; padding-bottom: 14px; }
.auth-card h1::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px; width: 70px; height: 10px;
  background: var(--squiggle) no-repeat center; background-size: 100% 100%; }
.auth-card .accent { display: none; }
.auth-card .left { text-align: left; }
.auth-card .btn { width: 100%; margin-top: 18px; }

/* ─── Footer ───────────────────────────────────────────────── */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px 40px; color: var(--ink-soft); font-size: 12px; border-top: 1px solid var(--line); }
