:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .07);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --separator: rgba(60, 60, 67, .14);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, .12);

  --green: #248a3d;   --green-soft: rgba(52, 199, 89, .14);   --green-dot: #34c759;
  --orange: #c93400;  --orange-soft: rgba(255, 149, 0, .16);  --orange-dot: #ff9500;
  --red: #d70015;     --red-soft: rgba(255, 59, 48, .12);     --red-dot: #ff3b30;
  --blue-soft: rgba(0, 122, 255, .12);
  --gray-soft: rgba(142, 142, 147, .16);  --gray-dot: #8e8e93;

  --sidebar: rgba(242, 242, 245, .72);
  --thumb: linear-gradient(180deg, #fdfdfe 0%, #ececf0 100%);
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 2px 6px rgba(0, 0, 0, .03), 0 12px 32px rgba(0, 0, 0, .04);
  --shadow-hover: 0 0 0 .5px rgba(0, 0, 0, .05), 0 4px 12px rgba(0, 0, 0, .05), 0 20px 48px rgba(0, 0, 0, .07);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .22), 0 6px 20px rgba(0, 0, 0, .08);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
}

:root[data-mode="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --fill: rgba(120, 120, 128, .26);
    --fill-2: rgba(120, 120, 128, .14);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --separator: rgba(255, 255, 255, .1);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, .2);
    --green: #30d158;   --green-soft: rgba(48, 209, 88, .18);  --green-dot: #30d158;
    --orange: #ff9f0a;  --orange-soft: rgba(255, 159, 10, .18); --orange-dot: #ff9f0a;
    --red: #ff453a;     --red-soft: rgba(255, 69, 58, .18);    --red-dot: #ff453a;
    --blue-soft: rgba(10, 132, 255, .2);
    --gray-soft: rgba(142, 142, 147, .24);
    --sidebar: rgba(28, 28, 30, .72);
    --thumb: linear-gradient(180deg, #3a3a3c 0%, #2c2c2e 100%);
    --shadow: 0 0 0 .5px rgba(255, 255, 255, .08);
    --shadow-hover: 0 0 0 .5px rgba(255, 255, 255, .14), 0 12px 32px rgba(0, 0, 0, .4);
}

/* ---------- Couleurs d'accentuation ---------- */
[data-accent="indigo"]   { --accent: #3634a3; --accent-hover: #4240b8; --accent-soft: rgba(54, 52, 163, .12); }
[data-accent="purple"]   { --accent: #8944ab; --accent-hover: #9a55bd; --accent-soft: rgba(137, 68, 171, .12); }
[data-accent="pink"]     { --accent: #d30f45; --accent-hover: #e0275a; --accent-soft: rgba(211, 15, 69, .1); }
[data-accent="teal"]     { --accent: #00799e; --accent-hover: #0a87ad; --accent-soft: rgba(0, 121, 158, .12); }
[data-accent="graphite"] { --accent: #48484a; --accent-hover: #5a5a5c; --accent-soft: rgba(72, 72, 74, .12); }
[data-mode="dark"][data-accent="indigo"]   { --accent: #5e5ce6; --accent-hover: #7d7bf0; --accent-soft: rgba(94, 92, 230, .24); }
[data-mode="dark"][data-accent="purple"]   { --accent: #a94fd6; --accent-hover: #bf5af2; --accent-soft: rgba(191, 90, 242, .22); }
[data-mode="dark"][data-accent="pink"]     { --accent: #e8335a; --accent-hover: #ff375f; --accent-soft: rgba(255, 55, 95, .22); }
[data-mode="dark"][data-accent="teal"]     { --accent: #0e8fab; --accent-hover: #17a2bf; --accent-soft: rgba(64, 200, 224, .2); }
[data-mode="dark"][data-accent="graphite"] { --accent: #636366; --accent-hover: #7c7c80; --accent-soft: rgba(152, 152, 157, .24); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.47 var(--font);
  letter-spacing: -.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; box-shadow: 0 0 0 1px var(--accent); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.sans { font-family: var(--font); }
.faint { color: var(--text-3); }
.text-red { color: var(--red) !important; }
.text-orange { color: var(--orange) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 18px;
  border: 0; border-radius: 980px;
  font: 500 14px/1 var(--font); letter-spacing: -.01em;
  cursor: pointer; text-decoration: none !important;
  transition: background-color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:hover { background: var(--fill-2); box-shadow: inset 0 0 0 .5px var(--separator); }
.btn-lg { min-height: 46px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2);
  cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

/* ---------- Coque ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 12px 14px;
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-right: .5px solid var(--separator);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); text-decoration: none !important; }
.brand-text strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.brand-text span { display: block; font-size: 12px; color: var(--text-2); }
.logo {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 62%, #fff) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 78%, #000) 100%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.logo .icon { width: 19px; height: 19px; stroke-width: 1.9; }
.logo-xl { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 20px; }
.logo-xl .icon { width: 40px; height: 40px; stroke-width: 1.6; }
.logo-img { overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--separator); }
.logo-img img { display: block; width: 100%; height: 100%; object-fit: contain; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: transparent;
  font: 400 14px/1 var(--font); color: var(--text); text-align: left; text-decoration: none !important;
  cursor: pointer; transition: background-color .15s var(--ease);
}
.nav-item .icon { width: 18px; height: 18px; color: var(--accent); }
.nav-item:hover { background: var(--fill-2); }
.nav-item.is-active { background: var(--fill); font-weight: 500; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font: 600 12px/20px var(--font); text-align: center;
}

/* ---------- Demandes d'enrôlement ---------- */
.requests { margin-bottom: 28px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 1.5px var(--accent-soft), var(--shadow); overflow: hidden; }
.requests-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: var(--blue-soft); }
.requests-title { margin: 0; font: 600 17px/1.3 var(--font-display); letter-spacing: -.02em; }
.requests-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.requests-list { list-style: none; margin: 0; padding: 0; }
.request-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: .5px solid var(--separator); }
.request-info { flex: 1; min-width: 0; }
.request-time { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.request-actions { display: flex; gap: 8px; }
.request-actions form { margin: 0; }

.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 12px 6px 0; border-top: .5px solid var(--separator); }
.sidebar-footer .footer-form { margin: 0; }
.who { flex: 1; min-width: 0; margin-left: 4px; }
.nav-label + .nav-item { margin-top: 0; }
.sidebar-nav .nav-label:not(:first-child) { margin-top: 14px; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(160deg, #b8b8bd, #7c7c82); color: #fff; font-size: 13px; font-weight: 600;
}
.who strong { display: block; font-size: 13px; font-weight: 500; }
.who span { display: block; font-size: 11px; color: var(--text-2); }

.content { padding: 44px 40px 72px; max-width: 1520px; width: 100%; animation: fade-up .45s var(--spring) both; }

/* ---------- En-tête ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.large-title { margin: 0; font: 700 34px/1.12 var(--font-display); letter-spacing: -.028em; }
.page-sub { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }

/* ---------- Indicateurs ---------- */
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.metric {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 16px 18px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease);
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.metric.is-active { box-shadow: 0 0 0 2px var(--accent), var(--shadow-hover); }
.metric-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.metric-icon .icon { width: 21px; height: 21px; stroke-width: 1.9; }
.metric-value { font: 600 26px/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 13px; color: var(--text-2); }
.tint-blue   { background: var(--blue-soft);   color: var(--accent); }
.tint-green  { background: var(--green-soft);  color: var(--green); }
.tint-orange { background: var(--orange-soft); color: var(--orange); }
.tint-gray   { background: var(--gray-soft);   color: var(--text-2); }
.tint-red    { background: var(--red-soft);    color: var(--red); }
.tint-purple { background: color-mix(in srgb, #af52de 16%, transparent); color: #8944ab; }
[data-mode="dark"] .tint-purple { color: #bf5af2; }

/* ---------- Barre d'outils ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search { position: relative; flex: 0 1 380px; }
.search .icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; stroke-width: 2; }
.search input {
  width: 100%; height: 38px; padding: 0 36px 0 34px;
  border: 0; border-radius: 10px; background: var(--fill); color: var(--text);
  font: 15px var(--font); letter-spacing: -.01em; outline: none;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { background: var(--surface); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  padding: 1px 7px; border-radius: 5px; border: .5px solid var(--separator); background: var(--surface);
  font: 500 11px/18px var(--font); color: var(--text-3);
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { opacity: 0; }
.result-count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Liste ---------- */
.list-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.device-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.device-table th {
  position: sticky; top: 0; padding: 11px 14px; text-align: left; white-space: nowrap;
  background: var(--surface-2); border-bottom: .5px solid var(--separator);
  font-size: 12px; font-weight: 500; color: var(--text-3);
}
.th-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
th[aria-sort] .th-btn { color: var(--text); }
th[aria-sort="ascending"] .th-btn::after { content: "↑"; }
th[aria-sort="descending"] .th-btn::after { content: "↓"; }
.device-table td { padding: 12px 14px; border-bottom: .5px solid var(--separator); vertical-align: middle; white-space: nowrap; }
.device-table tbody tr { cursor: pointer; transition: background-color .15s var(--ease); }
.device-table tbody tr:hover { background: var(--fill-2); }
.device-table tbody tr:last-child td { border-bottom: 0; }
.secondary { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }
.device-cell { display: flex; align-items: center; gap: 12px; }
.device-thumb {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: var(--thumb); color: var(--text); box-shadow: inset 0 0 0 .5px var(--separator);
}
.device-thumb .icon { width: 22px; height: 22px; stroke-width: 1.5; }
.device-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.device-thumb:has(.device-img) { width: 48px; height: 44px; background: none; box-shadow: none; }
.hero-thumb:has(.device-img) { width: 140px; height: 120px; background: none; box-shadow: none; }
.hero-thumb .device-img { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .14)); }
.device-name { color: var(--text); font-weight: 500; }
.device-text { display: block; min-width: 0; max-width: 230px; }
.device-line { display: flex; align-items: center; min-width: 0; }
.device-line .device-name, .device-text > .secondary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-text > .secondary { display: block; }
.note-flag { display: inline-flex; flex: none; margin-left: 6px; color: var(--text-3); }
.note-flag .icon { width: 15px; height: 15px; }
.col-chev { width: 32px; padding-left: 0 !important; color: var(--text-3); }
.col-chev .icon { width: 16px; height: 16px; stroke-width: 2; transition: transform .2s var(--ease); }
.device-table tbody tr:hover .col-chev .icon { transform: translateX(2px); color: var(--text-2); }

.sw { display: flex; align-items: baseline; gap: 6px; }
.sw + .sw { margin-top: 2px; }
.sw-tag { min-width: 22px; font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--text-3); }
.version { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--fill-2); font: 500 12px/1.5 var(--mono); color: var(--text-2); }
.version.is-outdated { background: var(--orange-soft); color: var(--orange); }
.version.is-outdated::after { content: " ↑"; }
.meter { width: 96px; height: 6px; margin-top: 3px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter span, .storage-bar span {
  display: block; height: 100%; width: var(--used); border-radius: inherit;
  background: linear-gradient(90deg, #5ac8fa, #007aff);
}
.meter span.is-low, .storage-bar span.is-low { background: linear-gradient(90deg, #ff9f0a, #ff3b30); }

/* ---------- Pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
  border-radius: 980px; font-size: 12px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-green  { background: var(--green-soft);  color: var(--green); }
.pill-green i { background: var(--green-dot); box-shadow: 0 0 0 0 var(--green-dot); animation: pulse 2.4s var(--ease) infinite; }
.pill-orange { background: var(--orange-soft); color: var(--orange); }
.pill-orange i { background: var(--orange-dot); }
.pill-blue   { background: var(--blue-soft);   color: var(--accent); }
.pill-gray   { background: var(--gray-soft);   color: var(--text-2); }
.pill-gray i { background: var(--gray-dot); }

/* ---------- États vides ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 24px; }
.empty-sm { padding: 40px 24px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 18px; background: var(--thumb); color: var(--text-2); box-shadow: inset 0 0 0 .5px var(--separator); }
.empty-icon .icon { width: 32px; height: 32px; stroke-width: 1.4; }
.empty-title { margin: 0; font: 600 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.empty-text { max-width: 420px; margin: 6px 0 20px; color: var(--text-2); }
.empty-sm .empty-text { margin-bottom: 0; }

/* ---------- Fiche Mac ---------- */
.breadcrumb { margin-bottom: 18px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; margin-left: -6px; }
.breadcrumb .icon { width: 18px; height: 18px; stroke-width: 2.2; }

.hero {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 28px 32px; margin-bottom: 24px;
  border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow);
}
.hero-thumb {
  display: grid; place-items: center; width: 104px; height: 104px; border-radius: 26px; flex: none;
  background: var(--thumb); color: var(--text); box-shadow: inset 0 0 0 .5px var(--separator), 0 8px 24px rgba(0, 0, 0, .06);
}
.hero-thumb .icon { width: 58px; height: 58px; stroke-width: 1.15; }
.hero-text { min-width: 0; }
.hero-text h1 { margin: 10px 0 4px; font: 700 32px/1.1 var(--font-display); letter-spacing: -.028em; }
.hero-meta { margin: 0; color: var(--text-2); font-size: 15px; }
.hero-stats { display: flex; gap: 0; margin: 0 0 0 auto; }
.hero-stats > div { padding: 4px 24px; border-left: .5px solid var(--separator); }
.hero-stats dt { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.hero-stats dd { margin: 0; font: 600 28px/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stats dd small { margin-left: 2px; font-size: 15px; font-weight: 500; color: var(--text-2); }
.hero-stats .dd-sm { font-size: 17px; letter-spacing: -.015em; padding-top: 6px; }

.notice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; margin-bottom: 24px;
  border-radius: var(--r); background: var(--blue-soft); color: var(--text);
}
.notice-orange { background: var(--orange-soft); }
.notice-icon { color: var(--accent); padding-top: 1px; }
.notice-orange .notice-icon { color: var(--orange); }
.notice-title { margin: 0; font-weight: 600; }
.notice-text { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }

.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 28px 24px; align-items: start; }
.group-title { margin: 0 0 8px 4px; font: 600 15px/1.3 var(--font-display); letter-spacing: -.015em; }
.group-body { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.group-body > * + *::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--separator); }
.group-body > * { position: relative; }
.group-body form { margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 11px 16px; }
.row-label { color: var(--text); }
.row-value { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-align: right; word-break: break-word; }
.copy-btn {
  display: grid; place-items: center; width: 26px; height: 26px; margin: -4px -6px -4px 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer;
  opacity: 0; transition: opacity .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.copy-btn .icon { width: 15px; height: 15px; }
.row:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: var(--fill); color: var(--text); }
.copy-btn.is-copied { opacity: 1; color: var(--green); }

.storage { padding: 18px 16px 16px; }
.storage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.storage-head strong { font: 600 22px/1.1 var(--font-display); letter-spacing: -.025em; }
.storage-bar { height: 14px; border-radius: 7px; background: var(--fill); overflow: hidden; }
.storage-bar span { border-radius: 7px 0 0 7px; }
.storage-legend { display: flex; gap: 20px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.storage-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 3px; vertical-align: 0; }
.dot-used { background: #007aff; }
.dot-used.is-low { background: #ff3b30; }
.dot-free { background: var(--fill); box-shadow: inset 0 0 0 .5px var(--separator); }

.action-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 16px;
  border: 0; background: transparent; color: var(--accent); font: 400 15px var(--font); letter-spacing: -.01em;
  text-align: left; cursor: pointer; transition: background-color .15s var(--ease);
}
.action-row .icon { width: 18px; height: 18px; }
.action-row:hover { background: var(--fill-2); }
.action-danger { color: var(--red); }

.group-wide { grid-column: 1 / -1; }
.details-form { margin: 0; }
.inline-input {
  flex: 1; max-width: 420px; height: 30px; padding: 0; border: 0; background: transparent;
  color: var(--text-2); font: 15px var(--font); letter-spacing: -.01em; text-align: right; outline: none;
}
.inline-input:focus { color: var(--text); }
.inline-input::placeholder { color: var(--text-3); }
.notes-wrap { padding: 12px 16px 14px; }
.notes-input {
  min-height: 96px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); border-color: transparent;
  font: 15px/1.5 var(--font); letter-spacing: -.01em;
}
.notes-input::placeholder { color: var(--text-3); }
.notes-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- Feuille modale ---------- */
dialog.sheet {
  width: min(540px, calc(100vw - 32px)); padding: 32px; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.sheet[open] { animation: sheet-in .4s var(--spring); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .3s var(--ease); }
.sheet-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 14px; background: var(--blue-soft); color: var(--accent); }
.sheet-icon .icon { width: 24px; height: 24px; stroke-width: 2; }
dialog.sheet h2 { margin: 0; font: 700 24px/1.2 var(--font-display); letter-spacing: -.025em; }
.sheet-text { margin: 8px 0 22px; color: var(--text-2); }
.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
textarea {
  width: 100%; min-height: 168px; padding: 12px 14px; resize: vertical;
  border: .5px solid var(--separator); border-radius: 12px; background: var(--surface-2); color: var(--text);
  font: 14px/1.6 var(--mono); outline: none; transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-help { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translateX(-50%);
  padding: 12px 22px; border-radius: 16px; max-width: min(560px, calc(100vw - 32px)); text-align: center;
  background: rgba(29, 29, 31, .86); color: #fff; font-size: 14px; font-weight: 500;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-lg); animation: toast-in .5s var(--spring);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-hidden { opacity: 0; transform: translate(-50%, 14px); pointer-events: none; }
[data-mode="dark"] .toast { background: rgba(58, 58, 60, .9); }

/* ---------- Connexion ---------- */
body.auth {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(0, 113, 227, .16), transparent 62%),
    radial-gradient(900px 560px at 112% 8%, rgba(175, 82, 222, .14), transparent 62%),
    radial-gradient(900px 640px at 50% 120%, rgba(52, 199, 89, .10), transparent 62%),
    var(--bg);
}
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; animation: fade-up .6s var(--spring) both; }
.auth-card {
  width: min(400px, 100%); padding: 44px 36px 36px; text-align: center;
  border-radius: 28px; background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-lg), inset 0 0 0 .5px rgba(255, 255, 255, .5);
}
.auth-card h1 { margin: 0; font: 700 30px/1.15 var(--font-display); letter-spacing: -.028em; }
.auth-sub { margin: 6px 0 28px; color: var(--text-2); }
.auth-error { margin: -12px 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 14px; }
.input-stack { margin-bottom: 18px; border-radius: 12px; border: .5px solid var(--separator); background: var(--surface); overflow: hidden; text-align: left; }
.input-stack input {
  display: block; width: 100%; height: 50px; padding: 0 16px;
  border: 0; background: transparent; color: var(--text); font: 17px var(--font); letter-spacing: -.02em; outline: none;
}
.input-stack input + label + input { border-top: .5px solid var(--separator); }
.input-stack input:focus { background: var(--accent-soft); }
.input-stack input::placeholder { color: var(--text-3); }
.auth-foot { margin-top: 24px; font-size: 12px; color: var(--text-3); }
.auth-alt { margin: 18px 0 0; font-size: 14px; }
.auth-card-wide { width: min(440px, 100%); }
.logo-shield { background: linear-gradient(160deg, #5ee08a 0%, #28b463 55%, #1e8e4e 100%); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 10px rgba(30, 142, 78, .35); }
.otp-input {
  display: block; width: 100%; height: 60px; margin-bottom: 18px; padding: 0 16px;
  border: .5px solid var(--separator); border-radius: 14px; background: var(--surface); color: var(--text);
  font: 600 28px/1 var(--mono); letter-spacing: .35em; text-align: center; outline: none;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.otp-input::placeholder { color: var(--fill); }
.otp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.setup-steps { margin: 0 0 16px; padding-left: 20px; text-align: left; color: var(--text-2); font-size: 14px; }
.setup-steps li + li { margin-top: 6px; }
.setup-steps strong { color: var(--text); font-weight: 600; }
.qr-box {
  display: grid; place-items: center; width: 242px; height: 242px; margin: 0 auto 12px; padding: 16px;
  border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
}
.qr-box img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.secret-details { margin: 0 0 22px; font-size: 13px; color: var(--text-2); }
.secret-details summary { cursor: pointer; color: var(--accent); list-style: none; }
.secret-details summary::-webkit-details-marker { display: none; }
.secret-key { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); color: var(--text); font-size: 14px; letter-spacing: .08em; word-break: break-all; user-select: all; }

/* ---------- Déploiement ---------- */
.deploy { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; max-width: 1200px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.step { display: flex; gap: 18px; min-width: 0; padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.step-num {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 600 15px/1 var(--font-display);
}
.step-body { flex: 1; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; font: 600 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.step-tag { padding: 2px 9px; border-radius: 980px; background: var(--fill-2); color: var(--text-2); font: 500 12px/1.6 var(--font); letter-spacing: 0; }
.step-text { margin: 0 0 14px; color: var(--text-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-sm { min-height: 30px; padding: 0 12px; font-size: 13px; }
.option { margin-top: 12px; padding: 16px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--separator); }
.disclosure { margin-top: 14px; }
.disclosure summary {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  color: var(--accent); font-size: 14px; cursor: pointer; list-style: none; border-radius: 6px;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary .icon { width: 15px; height: 15px; stroke-width: 2.2; transition: transform .2s var(--ease); }
.disclosure[open] summary .icon { transform: rotate(90deg); }
.disclosure-body { margin-top: 10px; padding: 16px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--separator); }
.disclosure-body .btn-row { margin-bottom: 12px; }

.deploy-side { display: grid; gap: 16px; position: sticky; top: 24px; }
.side-card { min-width: 0; padding: 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.side-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; }
.side-icon .icon { width: 19px; height: 19px; }
.side-title { margin: 0 0 4px; font: 600 15px/1.3 var(--font-display); letter-spacing: -.015em; }
.side-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.side-card .code-block { margin-top: 12px; }
.option-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.option-collapsible .option-head { margin-bottom: 0; cursor: pointer; list-style: none; }
.option-collapsible .option-head::-webkit-details-marker { display: none; }
.option-collapsible[open] .option-head { margin-bottom: 12px; }
.option-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; }
.option-icon .icon { width: 19px; height: 19px; }
.option-title { margin: 0; font-weight: 600; }
.option-text { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }
.code-block {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  border-radius: 12px; background: #1d1d1f; color: #f5f5f7;
}
.code-block code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
.code-block .btn-secondary { flex: none; align-self: flex-start; background: rgba(255, 255, 255, .14); color: #fff; }
.code-block .btn-secondary:hover { background: rgba(255, 255, 255, .22); }
.code-block .btn-secondary.is-copied { background: var(--green-dot); }
.code-block-flat { border-radius: 0; }
.group-spaced { margin-top: 32px; max-width: 920px; }
.notice-inline { margin: 0 0 16px; }
[data-mode="dark"] .code-block { background: #0b0b0c; box-shadow: inset 0 0 0 .5px var(--separator); }

/* ---------- Réglages ---------- */
.settings { display: grid; gap: 28px; max-width: 760px; padding-bottom: 72px; }
.settings-body > .setting { padding: 18px 16px; }
.setting-head { min-width: 0; }
.setting-title { margin: 0; font-weight: 500; }
.setting-help { margin: 2px 0 14px; font-size: 13px; color: var(--text-2); }
.row-help { display: block; margin-top: 1px; font-size: 12px; color: var(--text-3); }
.row-help code { font-size: 11px; }

.theme-picker { display: flex; gap: 18px; flex-wrap: wrap; }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.theme-option input, .accent-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview {
  display: flex; width: 116px; height: 74px; padding: 6px; gap: 5px; border-radius: 12px;
  box-shadow: 0 0 0 1px var(--separator), 0 2px 8px rgba(0, 0, 0, .06);
  transition: box-shadow .2s var(--ease), transform .2s var(--spring);
}
.tp-side { width: 26%; border-radius: 6px; }
.tp-main { flex: 1; display: grid; gap: 5px; align-content: start; padding-top: 4px; }
.tp-card { height: 14px; border-radius: 4px; }
.tp-card:first-child { width: 70%; height: 8px; background: var(--accent) !important; opacity: .9; }
.theme-preview-light { background: #f5f5f7; }
.theme-preview-light .tp-side { background: #e8e8ed; }
.theme-preview-light .tp-card { background: #fff; }
.theme-preview-dark { background: #000; }
.theme-preview-dark .tp-side { background: #1c1c1e; }
.theme-preview-dark .tp-card { background: #2c2c2e; }
.theme-preview-auto { background: linear-gradient(135deg, #f5f5f7 50%, #000 50%); }
.theme-preview-auto .tp-side { background: #e8e8ed; }
.theme-preview-auto .tp-card { background: linear-gradient(135deg, #fff 50%, #2c2c2e 50%); }
.theme-label { font-size: 13px; color: var(--text-2); }
.theme-option:hover .theme-preview { transform: translateY(-1px); }
.theme-option input:checked + .theme-preview { box-shadow: 0 0 0 2.5px var(--accent), 0 4px 14px rgba(0, 0, 0, .1); }
.theme-option input:checked ~ .theme-label { color: var(--text); font-weight: 600; }
.theme-option input:focus-visible + .theme-preview { outline: 3px solid var(--accent-soft); outline-offset: 4px; }

.accent-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-option { cursor: pointer; }
.accent-swatch {
  display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--swatch);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); transition: transform .2s var(--spring), box-shadow .2s var(--ease);
}
.accent-option:hover .accent-swatch { transform: scale(1.08); }
.accent-option input:checked + .accent-swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch); }
.accent-option input:focus-visible + .accent-swatch { outline: 3px solid var(--accent-soft); outline-offset: 5px; }

.setting-logo { display: flex; gap: 20px; align-items: flex-start; }
.logo-preview .logo-xl { margin: 0; }
.setting-logo .btn-row form { margin: 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn-danger-text { color: var(--red); }

.input-unit { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.num-input {
  width: 76px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--fill-2);
  color: var(--text); text-align: right; font-variant-numeric: tabular-nums;
}
.num-input:focus { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }

.save-bar {
  position: sticky; bottom: 20px; z-index: 15; display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  max-width: 760px; margin-top: -56px; padding: 10px 10px 10px 20px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-hover), 0 0 0 .5px var(--separator);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--spring);
}
.save-bar.is-dirty { opacity: 1; transform: none; pointer-events: auto; }
.save-hint { margin-right: auto; font-size: 13px; font-weight: 500; color: var(--text-2); }

/* ---------- Animations ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.96); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .55); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Champs ---------- */
.select, .text-input {
  width: 100%; height: 38px; padding: 0 12px; border: .5px solid var(--separator); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: 15px var(--font); letter-spacing: -.01em; outline: none;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.select:focus, .text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select-sm { width: auto; height: 30px; font-size: 13px; border-radius: 8px; padding-left: 10px; }
.select-inline { width: auto; min-width: 200px; max-width: 320px; height: 32px; font-size: 14px; }
.field-spaced { margin-top: 16px; }
.pw-field { display: flex; gap: 8px; }
.pw-field .text-input { font-family: var(--mono); font-size: 14px; }
.group-foot { margin: 8px 4px 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.group-foot code { font-size: 11px; }
.backup-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.backup-name .icon { width: 16px; height: 16px; color: var(--text-3); }
.row-value .btn-sm { margin-left: 10px; }
.approve-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.notes-read { padding: 12px 16px 14px; white-space: pre-wrap; color: var(--text-2); }
.pill .icon { width: 13px; height: 13px; margin-left: -2px; }

/* ---------- Recherche universelle ---------- */
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; margin: 0 0 6px; padding: 0 8px 0 10px;
  border: .5px solid var(--separator); border-radius: 9px; background: var(--fill-2); color: var(--text-3);
  font: 14px var(--font); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.search-trigger:hover { background: var(--fill); color: var(--text-2); }
.search-trigger .icon { width: 16px; height: 16px; stroke-width: 2; }
.search-trigger kbd, .palette kbd {
  margin-left: auto; padding: 1px 6px; border-radius: 5px; border: .5px solid var(--separator);
  background: var(--surface); color: var(--text-3); font: 500 11px/18px var(--font);
}
dialog.palette {
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, 80vh); margin: 12vh auto auto; padding: 0;
  border: 0; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-lg), 0 0 0 .5px var(--separator);
}
dialog.palette:not([open]) { display: none; }
dialog.palette[open] { animation: sheet-in .3s var(--spring); }
dialog.palette::backdrop { background: rgba(0, 0, 0, .18); }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: .5px solid var(--separator); }
.palette-search .icon { width: 22px; height: 22px; color: var(--text-3); stroke-width: 2; }
.palette-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 400 20px var(--font-display); letter-spacing: -.02em; outline: none; }
.palette-search input::placeholder { color: var(--text-3); }
.palette-search input:focus-visible { outline: none; box-shadow: none; }
.palette-search kbd { margin-left: 0; }
.palette-results { flex: 1; list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.palette-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer; min-height: 44px;
}
.palette-item[aria-selected="true"] { background: var(--accent); color: #fff; }
.palette-item[aria-selected="true"] .pi-sub { color: rgba(255, 255, 255, .8); }
.palette-item[aria-selected="true"] .pi-icon { background: rgba(255, 255, 255, .2); color: #fff; }
.pi-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--fill-2); color: var(--accent); }
.pi-icon .icon { width: 17px; height: 17px; }
.pi-icon img { width: 30px; height: 30px; object-fit: contain; }
.pi-icon:has(img) { background: none; }
.pi-text { min-width: 0; }
.pi-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-sub { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 28px 12px; text-align: center; color: var(--text-3); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: .5px solid var(--separator); font-size: 12px; color: var(--text-3); }
.palette-foot kbd { margin: 0 2px 0 0; }

/* ---------- Filtres client ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 980px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-size: 14px; text-decoration: none !important;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover { background: var(--fill-2); }
.chip.is-active { background: var(--text); color: var(--bg); }
.chip-count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--fill); font-size: 12px; font-weight: 600; text-align: center; }
.chip.is-active .chip-count { background: color-mix(in srgb, var(--bg) 22%, transparent); }

/* ---------- Historique ---------- */
.history { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.history-chart, .timeline-card { padding: 18px 18px 16px; }
.history-chart > * + *::before, .timeline-card > * + *::before { display: none; }
.history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.history-title { margin: 0; font: 600 15px/1.3 var(--font-display); letter-spacing: -.015em; }
.history-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.forecast {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--fill-2); color: var(--text-2);
}
.forecast small { font-weight: 400; opacity: .8; }
.forecast .icon { width: 15px; height: 15px; }
.forecast.is-ok { background: var(--green-soft); color: var(--green); }
.forecast.is-warn { background: var(--orange-soft); color: var(--orange); }
.forecast.is-danger { background: var(--red-soft); color: var(--red); }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--separator); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-label { fill: var(--text-3); font: 11px var(--font); }
.chart-stop-top { stop-color: var(--accent); stop-opacity: .28; }
.chart-stop-bottom { stop-color: var(--accent); stop-opacity: 0; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-hit:hover { fill: var(--accent); fill-opacity: .25; }
.history-empty { display: flex; gap: 10px; align-items: center; margin: 18px 0; padding: 18px; border-radius: 12px; background: var(--fill-2); color: var(--text-2); font-size: 14px; }
.history-empty .icon { flex: none; color: var(--text-3); }
.history-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--separator); }
.kpi-value { display: block; font: 600 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.kpi-value small { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-label { font-size: 12px; color: var(--text-3); }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; max-height: 360px; overflow-y: auto; }
.tl-item { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.tl-item:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1.5px; background: var(--separator);
}
.tl-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; }
.tl-icon .icon { width: 15px; height: 15px; stroke-width: 2; }
.tint-gray .icon { color: var(--text-2); }
.tl-body { min-width: 0; padding-top: 3px; }
.tl-text { display: block; font-size: 14px; font-weight: 500; }
.tl-time, .tl-detail { display: block; font-size: 12px; color: var(--text-3); }

/* ---------- Clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .25s var(--spring), box-shadow .25s var(--ease);
}
.client-card:not(.client-new):hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.client-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.client-head { display: flex; align-items: center; gap: 14px; }
.client-avatar {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; color: #fff;
  font: 600 17px/1 var(--font-display); letter-spacing: .02em;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 60%, #fff), var(--accent) 60%, color-mix(in srgb, var(--accent) 75%, #000));
}
.client-avatar-new { background: var(--fill); color: var(--accent); }
.client-title { flex: 1; min-width: 0; }
.client-title h2 { margin: 0; font: 600 18px/1.25 var(--font-display); letter-spacing: -.02em; }
.client-title p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.client-chevron { color: var(--text-3); }
.client-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.cs { display: inline-flex; align-items: center; gap: 6px; }
.cs-warn { color: var(--orange); font-weight: 600; }
.cs-danger { color: var(--red); font-weight: 600; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: var(--green-dot); }
.dot-orange { background: var(--orange-dot); }
.dot-red { background: var(--red-dot); }
.client-manage { position: relative; z-index: 2; margin-top: auto; padding-top: 12px; border-top: .5px solid var(--separator); }
.client-manage summary { width: max-content; color: var(--accent); font-size: 13px; cursor: pointer; list-style: none; }
.client-manage summary::-webkit-details-marker { display: none; }
.client-manage form { margin: 10px 0 0; }
.inline-form { display: flex; gap: 8px; }
.client-new form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; height: 100%; }
.client-new { box-shadow: inset 0 0 0 1.5px var(--separator); background: transparent; }
.client-new-title { font: 600 18px/1.25 var(--font-display); letter-spacing: -.02em; }
.client-new .btn { margin-top: auto; }
.client-footnote { display: flex; align-items: center; gap: 8px; margin: 20px 4px 0; font-size: 14px; color: var(--text-2); }
.client-footnote .icon { width: 17px; height: 17px; color: var(--text-3); }

/* ---------- Équipe ---------- */
.team-list { max-width: 900px; overflow: visible; }
.member { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.member.is-disabled { opacity: .55; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-viewer { background: linear-gradient(160deg, #c7c7cc, #8e8e93); }
.member-main { flex: 1; min-width: 0; }
.member-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-weight: 600; }
.member-meta { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.member-menu { position: relative; }
.member-menu summary { list-style: none; }
.member-menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; padding: 6px;
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg), 0 0 0 .5px var(--separator);
  animation: sheet-in .25s var(--spring);
}
.menu-section { display: grid; gap: 8px; margin: 0; padding: 10px; }
.menu-section + .menu-section { border-top: .5px solid var(--separator); }
.menu-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.menu-actions { padding: 4px 0; gap: 0; }
.menu-actions form { margin: 0; }
.menu-actions .action-row { min-height: 38px; font-size: 14px; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .col-lg { display: none; }
}
@media (max-width: 1200px) {
  .col-md { display: none; }
  .content { padding-left: 28px; padding-right: 28px; }
  .metrics { gap: 10px; }
  .metric { padding: 14px; column-gap: 10px; }
  .metric-icon { width: 34px; height: 34px; border-radius: 10px; }
  .metric-icon .icon { width: 18px; height: 18px; }
  .metric-value { font-size: 22px; }
  .metric-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .deploy { grid-template-columns: minmax(0, 1fr); }
  .deploy-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 1100px) {
  .hero-stats { margin-left: 0; width: 100%; }
  .hero-stats > div:first-child { padding-left: 0; border-left: 0; }
}
@media (max-width: 900px) {
  .search-trigger { width: 44px; height: 44px; margin: 0 0 0 auto; justify-content: center; padding: 0; }
  .search-trigger kbd { display: none; }
  .history { grid-template-columns: minmax(0, 1fr); }
  .member { flex-wrap: wrap; }
  .menu-panel { right: -8px; width: min(300px, calc(100vw - 32px)); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { flex-direction: row; align-items: center; height: auto; padding: 8px 12px; border-right: 0; border-bottom: .5px solid var(--separator); }
  .brand { padding: 0 4px; }
  .brand-text, .nav-label, .nav-text, .who, .avatar { display: none; }
  .nav-item { position: relative; }
  .nav-badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; padding: 0 4px; }
  .request-row { flex-wrap: wrap; }
  .request-time { display: none; }
  .sidebar-nav { flex-direction: row; margin-left: auto; }
  .nav-item { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .sidebar-footer { margin: 0; padding: 0; border: 0; }
  .icon-btn { width: 44px; height: 44px; }
  .content { padding: 24px 16px 56px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .metric { padding: 14px; }
  .large-title { font-size: 28px; }
  .col-opt { display: none; }
  .groups { grid-template-columns: 1fr; }
  .hero { padding: 22px; gap: 18px; }
  .hero-thumb { width: 80px; height: 80px; border-radius: 20px; }
  .hero-thumb .icon { width: 44px; height: 44px; }
  .hero-text h1 { font-size: 26px; }
  .search { flex: 1; }
  .search input { font-size: 16px; }
  .search kbd { display: none; }
}
