/* =========================================================
   QUASARWEB — Thème / Design system (tokens + composants de base)
   Source : DESIGN.md (Partie A)
   ========================================================= */

:root {
  /* logo Quasarweb : « quasar » + symbole / « web » + curseur */
  --ast-global-color-0: #24323A;
  --ast-global-color-1: #257A9F;
  /* structure */
  --sidebar-bg: #257A9F;
  --sidebar-bg-deep: #065B80;
  --sidebar-bg-raised: #368BAD;
  --sidebar-text-muted: rgba(255,255,255,.6);
  --sidebar-line: rgba(255,255,255,.12);
  --bg-app: #F7F9F9;
  --surface: #FFFFFF;
  --surface-subtle: #F2F7F7;
  --border: #E6ECEC;
  --border-strong: #C6D2D4;

  /* texte */
  --text-strong: #3D3D3D;
  --text: #4A4A4A;
  --text-muted: #66737A;      /* AA : 4,6:1 sur blanc (était #8E9AA0) */
  --text-faint: #B7C0C4;
  --text-on-dark: #FFFFFF;

  /* marque & données */
  --teal: #70C0B3;
  --teal-strong: #2A7466;     /* AA : 5,5:1 sur blanc, 4,8:1 sur teal-soft (était #4FA897) */
  --teal-soft: #E3F3F0;
  --mint: #B3DBC0;
  --lime: #F1FFBD;
  --lime-chart: #DDEB8F;
  --lime-ink: #5E6A1E;        /* AA : 5,6:1 sur lime (était #8A9A3F) */
  --pink: #EB547D;
  --pink-strong: #CF3D66;     /* AA : texte blanc 4,7:1 (était #D63F69) */
  --pink-soft: #FBE1E8;
  --ocean: #207898;
  --tooltip: #4A4A4A;

  /* statuts */
  --status-info: #2E7090;
  --status-success: #80D0C0;
  --status-neutral-bg: #D6F3E2;

  /* forme */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --shadow-card: 0 1px 2px rgba(16,40,50,.04), 0 4px 16px rgba(16,40,50,.04);
  --shadow-hover: 0 2px 4px rgba(16,40,50,.06), 0 12px 28px rgba(16,40,50,.08);
  --shadow-pop: 0 8px 32px rgba(16,40,50,.14);

  /* espacements */
  --gap-grid: 16px;
  --pad-card: 20px;
  --pad-page: 24px;

  /* typo */
  --font-app: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font-app); /* police unique : Inter partout (le logo Quasarweb est en Montserrat, Inter le met en valeur) */

  /* mouvement */
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 600ms;
}
@media (min-width: 1440px) { :root {
  /* logo Quasarweb : « quasar » + symbole / « web » + curseur */
  --ast-global-color-0: #24323A;
  --ast-global-color-1: #257A9F; --gap-grid: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-family: var(--font-app); }
body {
  font-family: var(--font-app);
  font-size: 13px; line-height: 20px;
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-strong); text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, table td, .tabular { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* ---------- typographie utilitaire ---------- */
.t-page-title { font-size: 28px; line-height: 34px; font-weight: 800; color: var(--text-strong); margin: 0; }
.t-card-title { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--text-strong); margin: 0; }
.t-col { font-size: 10px; line-height: 12px; font-weight: 600; color: var(--text-muted); }
.t-meta { font-size: 11px; line-height: 16px; color: var(--text-muted); }
.t-overline { font-size: 9px; font-weight: 600; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.up { color: var(--teal-strong); }
.down { color: var(--pink); }

/* ---------- carte ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  min-width: 0;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card.clickable:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-head {
  height: 48px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.card-body { padding: var(--pad-card); flex: 1; min-height: 0; }
.card-foot { padding: 10px 20px 14px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13px; line-height: 16px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: filter var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast);
  background: transparent; color: var(--text);
}
.btn i { font-size: 16px; }
.btn:hover { filter: brightness(.92); }
.btn:active { filter: brightness(.86); transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal-soft); border-color: var(--teal); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--sidebar-bg); color: #fff; }
.btn-accent { background: var(--pink-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { filter: none; background: var(--surface-subtle); }
.btn-danger { background: var(--pink-soft); color: var(--pink-strong); }
.btn-dark { background: #24323A; color: #fff; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm);
  color: var(--text-muted); background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.btn-icon:hover { color: var(--text); background: var(--surface-subtle); }
.dots-btn { width: 24px; height: 24px; border: 0; background: none; color: var(--text-faint); cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.dots-btn:hover { color: var(--text); }
.circle-btn {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--text); color: var(--text); background: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; cursor: pointer; padding: 0;
}
.circle-btn:hover { background: var(--text); color: #fff; }

/* ---------- champs ---------- */
.input, .select {
  height: 36px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-strong); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder { color: var(--text-faint); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.input.error { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.input-sm, .select-sm { height: 28px; font-size: 12px; }
.select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234A4A4A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 600; color: var(--text-strong); }
.field .help { font-size: 11px; color: var(--text-muted); }
.field .help.err { color: var(--pink); }
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box .input { width: 100%; padding-right: 34px; }
.search-box i { position: absolute; right: 10px; color: var(--text-faint); font-size: 16px; pointer-events: none; }
.search-box.left .input { padding-left: 34px; padding-right: 12px; }
.search-box.left i { left: 11px; right: auto; }

.checkbox {
  appearance: none; width: 16px; height: 16px; margin: 0;
  border: 1px solid var(--border-strong); border-radius: 4px; background: #fff;
  cursor: pointer; position: relative; flex-shrink: 0; transition: background var(--dur-fast);
}
.checkbox:checked { background: var(--teal); border-color: var(--teal); }
.checkbox:checked::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.toggle { width: 28px; height: 14px; border-radius: 999px; background: rgba(255,255,255,.3); position: relative; border: 0; padding: 0; cursor: pointer; transition: background var(--dur-fast); flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform var(--dur-fast) var(--ease); }
.toggle.on { background: var(--teal); }
.toggle.on::after { transform: translateX(14px); }
.toggle.light { background: var(--border-strong); }
.toggle.light.on { background: var(--teal); }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: 20px; align-items: center; height: 100%; }
.tab { position: relative; font-size: 11px; font-weight: 500; color: var(--teal-strong); background: none; border: 0; padding: 0; cursor: pointer; height: 100%; }
.tab.active { color: var(--pink); }
.tab.active::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 6px; height: 2px; background: var(--pink); border-radius: 2px; }
.chips { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-subtle); border-radius: 999px; }
.chip { height: 28px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.chip.active { background: var(--surface); border-color: var(--border); color: var(--text-strong); }

/* ---------- pastilles / badges ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; height: 18px; padding: 0 10px; border-radius: var(--r-xs); font-size: 9px; line-height: 12px; font-weight: 700; }
.pill.r { border-radius: 999px; }
.pill-info { background: var(--status-info); color: #fff; }
.pill-success { background: #D9F2EC; color: #1E6B5C; }
.pill-neutral { background: var(--status-neutral-bg); color: #1E6B5C; }
.pill-warning { background: var(--lime); color: var(--lime-ink); }
.pill-danger { background: var(--pink-soft); color: var(--pink); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--teal); }
.badge.pink { background: var(--pink); }
.status-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid; }
.status-tag i { font-size: 13px; }
.status-tag.ok { color: var(--teal-strong); border-color: #CDEAE3; background: #F4FBF9; }
.status-tag.ko { color: var(--pink); border-color: #F7CAD7; background: #FEF5F8; }
.status-tag.wait { color: var(--lime-ink); border-color: #E3EDB4; background: #FBFFEC; }

/* ---------- avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-subtle); }
.avatar.s24 { width: 24px; height: 24px; }
.avatar.s28 { width: 28px; height: 28px; }
.avatar.s40 { width: 40px; height: 40px; }
.avatar.s48 { width: 48px; height: 48px; }
.avatar.s56 { width: 56px; height: 56px; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-muted); }
.avatar-stack { display: flex; }
.avatar-stack > * { border: 2px solid #fff; margin-left: -10px; }
.avatar-stack > *:first-child { margin-left: 0; }
.avatar-more { background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.presence { position: relative; display: inline-block; }
.presence::after { content: ""; position: absolute; right: 0; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }

/* ---------- tooltip ---------- */
.tip { background: var(--tooltip); color: #fff; border-radius: var(--r-xs); padding: 4px 10px; text-align: center; position: relative; font-size: 10px; line-height: 13px; white-space: nowrap; }
.tip b { display: block; font-size: 11px; }
.tip::after { content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); border: 4px solid transparent; border-bottom: 0; border-top-color: var(--tooltip); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { width: 360px; max-width: calc(100vw - 32px); background: var(--surface); box-shadow: var(--shadow-pop); border-radius: var(--r-md); padding: 14px 16px; border-left: 3px solid var(--teal); display: flex; gap: 10px; align-items: flex-start; animation: toast-in var(--dur) var(--ease); }
.toast.pink { border-left-color: var(--pink); }
.toast i { font-size: 18px; color: var(--teal-strong); }
.toast.pink i { color: var(--pink); }
.toast b { display: block; color: var(--text-strong); font-size: 13px; }
.toast span { font-size: 12px; color: var(--text-muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- squelette ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-subtle) 0%, #E9F1F1 50%, var(--surface-subtle) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* scrollbars fines */
.thin-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.thin-scroll::-webkit-scrollbar-thumb { background: var(--sidebar-bg); border-radius: 4px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

/* logo Quasarweb */
.qw-logo { display: block; height: 26px; width: auto; flex-shrink: 0; }
