/* ============================================================
   EMPREINTE LÉONARD — base d'interface commune aux projets Léonard
   Extraite de HR_CONNECT (pwa/css/style.css) le 30/09/2026.

   Ce fichier ne contient RIEN de propre à un projet : ni couleur de
   marque, ni composant métier. Un projet le charge tel quel, puis
   redéfinit les jetons de `:root` dans son propre `style.css`.

   Préfixe de classe : `ln-` (Léonard). HR_CONNECT utilise `hc-` ;
   le renommage est le seul changement de fond, pour que le fichier
   puisse servir à plusieurs projets.

   Documentation : docs/execution/empreinte-leonard.md
   ============================================================ */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------
   1. Jetons — un projet redéfinit ces valeurs, et rien d'autre
   ------------------------------------------------------------ */
:root {
  --accent:        #2563eb;
  --accent-dark:   #1d4ed8;
  --accent-light:  #eff6ff;
  --accent-border: #c7d7fe;

  --good:       #16a34a;
  --good-light: #dcfce7;
  --good-text:  #166534;
  --warn:       #d97706;
  --warn-light: #fef3c7;
  --warn-text:  #92400e;
  --bad:        #b91c1c;
  --bad-light:  #fee2e2;
  --bad-border: #fecaca;

  --bg:             #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;
  --border:         #e5e7eb;
  --text:           #111827;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;

  --radius:    14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Largeur de la coquille mobile : l'application « terrain » reste une
     colonne étroite, même sur grand écran. */
  --shell-width: 480px;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ------------------------------------------------------------
   2. Coquilles
   ------------------------------------------------------------ */
#app {
  max-width: var(--shell-width);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 76px;          /* place pour la navigation basse */
}
/* Mode administration : pleine largeur, barre latérale. */
body.ln-admin-mode #app { max-width: none; padding-bottom: 0; }

.ln-header {
  background: var(--accent);
  color: #fff;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
}
.ln-header-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ln-header-title { font-size: 15px; font-weight: 700; }
.ln-header-subtitle { font-size: 12px; opacity: .85; margin-top: 1px; }
.ln-header-back { cursor: pointer; display: flex; align-items: center; margin-right: 2px; }

.ln-content { flex: 1; padding: 18px 18px 24px; }

.ln-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.ln-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px 2px;
}

/* ------------------------------------------------------------
   3. Boutons
   ------------------------------------------------------------ */
.ln-btn {
  border: none; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600;
  padding: 0 18px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.ln-btn-primary   { background: var(--accent); color: #fff; }
.ln-btn-primary:active { background: var(--accent-dark); }
.ln-btn-success   { background: var(--good); color: #fff; }
.ln-btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.ln-btn-danger    { background: var(--surface); color: var(--bad); border: 1.5px solid var(--bad-border); }
.ln-btn-block     { width: 100%; }
.ln-btn-sm        { height: 36px; padding: 0 12px; font-size: 13px; }
.ln-btn:disabled  { opacity: .5; cursor: not-allowed; }

.ln-link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: 13.5px; font-weight: 600; cursor: pointer;
}

/* ------------------------------------------------------------
   4. Champs
   ------------------------------------------------------------ */
.ln-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ln-label { font-size: 13px; font-weight: 600; color: #374151; }
.ln-input {
  height: 46px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 100%;
}
textarea.ln-input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; }
.ln-input-mini { width: 74px; height: 38px; padding: 0 8px; text-align: center; font-weight: 700; }
.ln-help  { font-size: 11.5px; color: var(--text-muted); }
.ln-error {
  background: var(--bad-light); border: 1px solid var(--bad-border); color: var(--bad);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; margin-bottom: 14px;
}
.ln-notice {
  background: var(--good-light); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent);
  color: var(--good-text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; margin-bottom: 14px;
}
.ln-confirm {
  background: #fef2f2; border: 1px solid var(--bad-border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-top: 12px;
}
.ln-search-input {
  height: 38px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 13.5px; width: 230px; max-width: 100%;
}

/* ------------------------------------------------------------
   5. Pastilles de choix, étiquettes
   ------------------------------------------------------------ */
.ln-pill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.ln-pill {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  padding: 12px 14px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
}
.ln-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ln-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ln-chip {
  border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface);
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.ln-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.ln-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ln-badge-good { background: var(--good-light); color: var(--good-text); }
.ln-badge-warn { background: var(--warn-light); color: var(--warn-text); }
.ln-badge-bad  { background: var(--bad-light);  color: var(--bad); }
.ln-badge-neutral { background: var(--surface-2); color: var(--text-secondary); }

.ln-empty { text-align: center; color: var(--text-muted); font-size: 13.5px; padding: 26px 10px; }

/* ------------------------------------------------------------
   6. Onglets horizontaux
   ------------------------------------------------------------ */
.ln-tabs {
  display: flex; gap: 4px; background: var(--surface-2);
  border-radius: 10px; padding: 4px; margin-bottom: 18px;
}
.ln-tab {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; user-select: none; background: none; border: none;
}
.ln-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ------------------------------------------------------------
   7. Navigation basse (mobile)
   ------------------------------------------------------------ */
.ln-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--shell-width);
  background: var(--accent); display: flex; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.ln-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 0 12px; color: rgba(255,255,255,.7); cursor: pointer;
}
.ln-nav-item.active { color: #fff; }
.ln-nav-label { font-size: 10.5px; font-weight: 600; }

/* ------------------------------------------------------------
   8. Connexion, écran « pas de connexion »
   ------------------------------------------------------------ */
.ln-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.ln-login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(15,23,42,.06);
}

/* ------------------------------------------------------------
   9. Coquille d'administration (ordinateur)
   ------------------------------------------------------------ */
.ln-admin-shell { display: flex; min-height: 100vh; background: var(--bg); }

.ln-admin-sidebar {
  width: 218px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.ln-admin-logo { display: flex; flex-direction: column; gap: 2px; padding: 2px 10px 20px; }
.ln-admin-logo-text { font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--text-secondary); }
.ln-admin-logo-sub  { font-size: 11.5px; color: var(--text-muted); }
.ln-admin-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
}
.ln-admin-sidebar-item:hover  { background: var(--surface-2); }
.ln-admin-sidebar-item.active { background: var(--accent-light); color: var(--accent-dark); }
.ln-admin-sidebar-spacer { flex: 1; }

.ln-admin-main { flex: 1; min-width: 0; padding: 26px 30px 60px; overflow-x: auto; }
.ln-admin-topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.ln-admin-title    { font-size: 21px; font-weight: 800; margin: 0; }
.ln-admin-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.ln-admin-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.ln-admin-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}

.ln-stat-tile-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ln-stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; min-width: 120px; flex: 1;
}
.ln-stat-tile-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.ln-stat-tile-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.ln-table-wrap { overflow-x: auto; }
.ln-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ln-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ln-table td { padding: 9px 10px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.ln-cell-sub { color: var(--text-muted); font-size: 12px; }

.ln-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ln-modal {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(15,23,42,.3);
  max-height: calc(100vh - 40px); overflow-y: auto;
}

/* ------------------------------------------------------------
   10. Barre latérale repliée sur téléphone
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .ln-admin-shell { flex-direction: column; }
  .ln-admin-sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; overflow-x: auto; gap: 6px;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }
  .ln-admin-logo { display: none; }
  .ln-admin-sidebar-spacer { display: none; }
  .ln-admin-sidebar-item { width: auto; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .ln-admin-main { padding: 18px 16px 48px; }
  .ln-admin-title { font-size: 18px; }
}
