/* Studio Yannis Hub — composants primitifs
 * Source : STUDIO_YANNIS_ULTIMATE.md § T.4 (composants documentés).
 * Toutes les valeurs proviennent de tokens.css (§T.1/T.3). Aucune identité inventée.
 */

/* ---------- Typographie de rôle (§T.2 — rem/clamp, jamais imposée au DOM global) ---------- */
.syh-page-title    { font-size: clamp(32px, 4vw, 48px); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 600; }
.syh-section-title { font-size: clamp(22px, 2.5vw, 28px); line-height: 1.2;  margin: 0 0 12px; font-weight: 600; }
.syh-card-title    { font-size: clamp(18px, 1.4vw, 20px); line-height: 1.3;  margin: 0 0 8px;  font-weight: 600; }
.syh-body          { font-size: 18px; line-height: 28px; }
.syh-control       { font-size: 16px; line-height: 1.3; }
.syh-meta          { font-size: 14px; line-height: 1.4; color: var(--text-secondary); }
.syh-kpi           { font-size: clamp(32px, 4.5vw, 52px); line-height: 1; letter-spacing: -0.02em; font-weight: 700; }
@media (max-width: 767.98px) {
  .syh-body { font-size: 18px; line-height: 28px; }
  .syh-control { font-size: 16px; }
}

/* ---------- Layout ---------- */
.syh-app       { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.syh-topbar    { height: var(--height-topbar); display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-1); position: sticky; top: 0; z-index: var(--z-sticky); }
.syh-topbar h1 { font-size: 18px; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.005em; }
.syh-topbar .syh-meta { margin-left: auto; }
.syh-main      { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.syh-footer    { padding: 16px 24px; border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 14px; text-align: center; }

.syh-grid      { display: grid; gap: 16px; }
.syh-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.syh-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.syh-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023.98px) { .syh-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .syh-grid.cols-2, .syh-grid.cols-3, .syh-grid.cols-4 { grid-template-columns: 1fr; }
  .syh-main { padding: 16px; padding-bottom: calc(16px + var(--height-mobile-dock)); }
  .syh-topbar { padding: 0 16px; }
}

/* ---------- Carte / panneau ---------- */
.syh-card    { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 20px; }
.syh-panel   { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-popover); }
.syh-card p:last-child, .syh-panel p:last-child { margin-bottom: 0; }

/* ---------- Bouton ---------- */
.syh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 16px; font-weight: 500;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.syh-btn:active { transform: scale(0.99); }
.syh-btn[disabled], .syh-btn[aria-disabled="true"] { opacity: var(--disabled-opacity); pointer-events: none; }
.syh-btn.primary   { background: var(--accent-violet); color: #0b0b12; }
.syh-btn.primary:hover   { background: color-mix(in oklab, var(--accent-violet) 88%, white); }
.syh-btn.secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border-subtle); }
.syh-btn.secondary:hover { background: var(--surface-hover); }
.syh-btn.discreet  { background: transparent; color: var(--text-primary); }
.syh-btn.discreet:hover  { background: var(--surface-hover); }
.syh-btn.danger    { background: var(--danger); color: #170606; }
.syh-btn.danger:hover    { background: color-mix(in oklab, var(--danger) 88%, white); }

/* ---------- Champ / textarea / select ---------- */
.syh-field { display: flex; flex-direction: column; gap: 6px; }
.syh-field > label { font-size: 15px; color: var(--text-secondary); }
.syh-field > .help { font-size: 13px; color: var(--text-secondary); }
.syh-field > .error { font-size: 13px; color: var(--danger); }
.syh-input, .syh-textarea, .syh-select {
  min-height: var(--height-input); padding: 12px 14px;
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: 12px;
  font-size: 16px; line-height: 1.4;
}
.syh-input:focus, .syh-textarea:focus, .syh-select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 32%, transparent); }
.syh-textarea { min-height: 96px; resize: vertical; }

/* ---------- Segmented control ---------- */
.syh-segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 4px; gap: 4px; }
.syh-segmented > button { min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text-secondary); font-size: 15px; }
.syh-segmented > button[aria-pressed="true"] { background: var(--surface-hover); color: var(--text-primary); }

/* ---------- Tabs ---------- */
.syh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
.syh-tabs > button { min-height: 44px; padding: 0 14px; color: var(--text-secondary); border-bottom: 2px solid transparent; font-size: 15px; }
.syh-tabs > button[aria-selected="true"] { color: var(--text-primary); border-color: var(--accent-violet); }

/* ---------- KPI ---------- */
.syh-kpi-card { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 20px; }
.syh-kpi-card .label { color: var(--text-secondary); font-size: 14px; }

/* ---------- Badge / badge de source ---------- */
.syh-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.syh-badge.violet  { color: var(--accent-violet); border-color: color-mix(in oklab, var(--accent-violet) 40%, transparent); background: color-mix(in oklab, var(--accent-violet) 14%, transparent); }
.syh-badge.orange  { color: var(--accent-orange); border-color: color-mix(in oklab, var(--accent-orange) 40%, transparent); background: color-mix(in oklab, var(--accent-orange) 14%, transparent); }
.syh-badge.success { color: var(--success);       border-color: color-mix(in oklab, var(--success) 40%, transparent);       background: color-mix(in oklab, var(--success) 14%, transparent); }
.syh-badge.warning { color: var(--warning);       border-color: color-mix(in oklab, var(--warning) 40%, transparent);       background: color-mix(in oklab, var(--warning) 14%, transparent); }
.syh-badge.danger  { color: var(--danger);        border-color: color-mix(in oklab, var(--danger) 40%, transparent);        background: color-mix(in oklab, var(--danger) 14%, transparent); }

/* ---------- Tableau ---------- */
.syh-table { width: 100%; border-collapse: collapse; }
.syh-table th, .syh-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 15px; }
.syh-table th { color: var(--text-secondary); font-weight: 500; }

/* ---------- Timeline ---------- */
.syh-timeline { list-style: none; padding: 0; margin: 0; }
.syh-timeline li { position: relative; padding: 8px 0 12px 20px; border-left: 1px solid var(--border-subtle); }
.syh-timeline li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 9px; height: 9px; border-radius: 999px; background: var(--accent-violet); }

/* ---------- Toast ---------- */
.syh-toast { display: inline-flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: var(--shadow-popover); }

/* ---------- Dialog (léger) ---------- */
.syh-dialog { border: 1px solid var(--border-subtle); border-radius: 16px; background: var(--surface-1); color: var(--text-primary); padding: 20px; box-shadow: var(--shadow-floating); max-width: min(560px, 92vw); }
.syh-dialog::backdrop { background: rgba(0, 0, 0, 0.54); }

/* ---------- Skeleton ---------- */
.syh-skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: syh-skel 1400ms ease infinite; border-radius: 8px; height: 14px; }
@keyframes syh-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- État vide / erreur ---------- */
.syh-empty { text-align: center; padding: 32px 16px; color: var(--text-secondary); border: 1px dashed var(--border-subtle); border-radius: 16px; }
.syh-error { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: color-mix(in oklab, var(--danger) 12%, transparent); border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent); border-radius: 12px; color: var(--text-primary); }

/* ---------- Dock mobile ---------- */
.syh-dock { display: none; }
@media (max-width: 767.98px) {
  .syh-dock {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--height-mobile-dock) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface-1); border-top: 1px solid var(--border-subtle);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  }
  .syh-dock > a { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--text-secondary); font-size: 14px; text-decoration: none; }
  .syh-dock > a[aria-current="page"] { color: var(--text-primary); }
}

/* ---------- Approval summary ---------- */
.syh-approval { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 16px; background: var(--surface-2); }
.syh-approval .row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.syh-approval .row .label { color: var(--text-secondary); }
