@font-face { font-family: Inter; src: url(/fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f2f3f6; --card: #fff; --ink: #14161c; --ink2: #3a3f4b; --muted: #6b7180; --line: #e3e5ea; --line2: #eef0f3;
  --rail: #14161c; --rail2: #262a34;
  --green: #15803d; --green-s: #e3f5e9; --green-b: #22a35a;
  --red: #c81e1e; --red-s: #fde8e8; --red-b: #e04444;
  --blue: #1d5fd6; --blue-s: #e3edfd; --blue-b: #3b7ded;
  --violet: #6d3fd8; --violet-s: #efe9fd; --violet-b: #8b62ea;
  --amber: #a15c00; --amber-s: #fff3dc;
  --rad: 10px; --railw: 92px; --toph: 64px;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.tile .val, .kpi b, .num, .fun .n, .pay b, .infos dd, .tabs b, .badge, .chart svg text, input, .who { font-feature-settings: 'tnum' 1; }
.boot { padding: 40px; color: var(--muted); }

/* boutons / champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); text-align: center; }
.btn:hover { border-color: #c9cdd6; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2b2f3a; }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.red-o { color: var(--red); border-color: #f1b8b8; }
.btn.red-o:hover { background: var(--red-s); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.big { min-height: 48px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px 12px; min-height: 42px; font-size: 16px; width: 100%; }
textarea { min-height: 70px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-b); outline-offset: -1px; border-color: transparent; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.form-err { color: var(--red); background: var(--red-s); border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 14px; }
.form-ok { color: var(--green); font-size: 14px; font-weight: 600; margin: 0; }

/* connexion */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; display: grid; gap: 18px; box-shadow: 0 12px 40px rgba(20, 22, 28, .06); }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.brand b { display: block; font-size: 20px; }
.brand small { display: block; color: var(--muted); font-size: 13px; }
.logo, .rail-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; flex: none; }

/* rail */
.rail { position: fixed; z-index: 30; left: 12px; top: 12px; bottom: 12px; width: calc(var(--railw) - 20px); background: var(--rail); border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; }
.rail-logo { background: #fff; color: var(--ink); width: 40px; height: 40px; margin-bottom: 14px; }
.rail a { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: 10px; color: #aeb3bf; text-decoration: none; font-size: 11.5px; font-weight: 600; text-align: center; }
.rail a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { color: #fff; }
.rail a.on { background: var(--rail2); color: #fff; }
.rail a.on::before { content: ''; position: absolute; left: -6px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: #fff; }
.badge { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-b); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* en-tête */
.main { margin-left: var(--railw); min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.topbar { height: var(--toph); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; max-width: 1340px; margin: 0 auto; }
.topbar h1 { font-size: 22px; font-weight: 750; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 14px; }
.demo-strip { max-width: 1276px; margin: 0 auto 8px; background: var(--amber-s); color: var(--amber); border: 1px solid #f3dcae; border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600; width: calc(100% - 64px); }
.view { max-width: 1340px; margin: 0 auto; padding: 8px 32px 48px; }

/* blocs communs */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); }
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.sec-h h2 { font-size: 17px; font-weight: 700; }
.sec-h p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.muted { color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; line-height: 18px; white-space: nowrap; background: var(--line2); color: var(--ink2); }
.tag.test { background: #ececec; color: #555; border: 1px dashed #9a9a9a; letter-spacing: .03em; }
.tag.trial { background: var(--violet-s); color: var(--violet); }
.tag.abo { background: var(--violet); color: #fff; }
.tag.cancel { background: var(--red-s); color: var(--red); }
.tag.off { background: #ececef; color: #555a66; }
.tag.new { background: var(--red-s); color: var(--red); }
.tag.open { background: var(--blue-s); color: var(--blue); }
.tag.done { background: var(--green-s); color: var(--green); }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-blue { color: var(--blue); } .c-violet { color: var(--violet); }

/* période */
.period { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.period select { width: auto; min-width: 200px; font-weight: 600; }

/* tuiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 18px 15px; position: relative; overflow: hidden; min-width: 0; }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--ink2)); }
.tile .lb { font-size: 13px; font-weight: 650; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.tile .lb i { width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--ink2)); flex: none; }
.tile .val { font-size: 32px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; color: var(--kt, var(--ink)); }
.tile .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile .lb .tag { font-size: 11px; line-height: 14px; padding: 1px 6px; }
.tile.green { --k: var(--green-b); --kt: var(--green); }
.tile.red { --k: var(--red-b); --kt: var(--red); }
.tile.blue { --k: var(--blue-b); --kt: var(--blue); }
.tile.violet { --k: var(--violet-b); --kt: var(--violet); }
.tile.gray { --k: #9aa0ab; --kt: #4b505c; background: repeating-linear-gradient(135deg, #fff 0 10px, #f7f7f8 10px 20px); }
.tile.alert { --k: var(--red-b); }
.note { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

/* graphiques */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart.wide { grid-column: 1 / -1; }
.chart .legend i.testsw { background: #b3b8c2; }
.chart { padding: 16px 18px 12px; min-width: 0; }
.chart h3 { font-size: 15px; font-weight: 700; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink2); margin: 6px 0 8px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart .svgbox { width: 100%; height: 190px; }
.chart svg text { font-size: 11.5px; fill: var(--muted); font-family: Inter, sans-serif; }

/* cartes sites */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.site { padding: 16px 18px 18px; min-width: 0; }
.site-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.site-h h3 { font-size: 16px; font-weight: 700; }
.site-h a { font-size: 13px; text-decoration: none; }
.site-h a:hover { text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin: 14px 0 14px; }
.kpi b { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.funnel { display: grid; gap: 7px; border-top: 1px solid var(--line2); padding-top: 12px; }
.funnel-t { font-size: 13px; font-weight: 650; color: var(--ink2); }
.fun { display: grid; grid-template-columns: 82px minmax(0, 1fr) 96px; align-items: center; gap: 10px; font-size: 13px; }
.fun .bar { height: 10px; background: var(--line2); border-radius: 5px; overflow: hidden; }
.fun .bar i { display: block; height: 100%; border-radius: 5px; }
.fun .n { text-align: right; color: var(--ink2); font-weight: 600; }
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* filtres */
.filters { display: grid; grid-template-columns: 220px 200px minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink2); min-height: 42px; cursor: pointer; white-space: nowrap; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; min-height: 0; height: 24px; padding: 0; border-radius: 12px; background: #c9cdd6; border: 0; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--violet); }
.switch input:checked::after { transform: translateX(18px); }

/* liste comptes */
.list { overflow: hidden; }
.lrow { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 70px 80px minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 12px; align-items: center; padding: 12px 18px; border: 0; border-top: 1px solid var(--line2); background: #fff; width: 100%; text-align: left; font-size: 14px; cursor: pointer; }
.lrow:hover { background: #f8f9fb; }
.lrow.head { cursor: default; border-top: 0; background: #fafbfc; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.lrow .em { font-weight: 600; word-break: break-all; }
.lrow .num { text-align: right; }
.lrow .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lrow [data-l]::before { display: none; }
.count { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }

/* onglets internes */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tabs button b { font-size: 12px; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: var(--line2); color: var(--ink2); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs button.on b { background: rgba(255, 255, 255, .18); color: #fff; }

/* prix */
.warn { background: var(--amber-s); border: 1px solid #f3dcae; color: #7a4600; border-radius: 8px; padding: 12px 16px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.pcard { padding: 18px 20px; margin-bottom: 14px; }
.pcard.all { border: 2px solid var(--ink); }
.pcard-h { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; }
.pcard-h h3 { font-size: 16px; font-weight: 700; }
.pgroups { display: grid; grid-template-columns: 3fr 2fr 2fr; gap: 14px; }
.pgroup { border: 1px solid var(--line2); border-radius: 8px; padding: 12px 14px; background: #fbfbfc; min-width: 0; }
.pgroup h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .04em; }
.pfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.pfoot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; }
.psum { font-size: 13.5px; color: var(--ink2); }
.pact { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* support */
.ticket { padding: 16px 18px; margin-bottom: 12px; display: grid; gap: 10px; }
.ticket-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; }
.ticket-h .em { font-weight: 650; word-break: break-all; }
.ticket-h .date { color: var(--muted); margin-left: auto; }
.ticket .subj { font-weight: 700; }
.ticket .msg { white-space: pre-wrap; background: #f8f9fb; border-radius: 8px; padding: 12px 14px; border: 1px solid var(--line2); }
.ticket-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ticket-a .sp { flex: 1; }

/* réglages */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.set { padding: 18px 20px; }
.set h3 { font-size: 16px; margin-bottom: 4px; }
.set > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.opt .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c3c7d0; margin-top: 3px; }
.opt.on { border-color: var(--ink); background: #fafbfc; }
.opt.on .dot { border: 4px solid var(--ink); }
.opt b { display: block; font-size: 14.5px; }
.opt small { color: var(--muted); font-size: 13px; }
.slist { display: grid; gap: 0; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
.srow:first-child { border-top: 0; }
.srow a { font-size: 13.5px; }

/* fiche compte */
.drawer-bg { position: fixed; inset: 0; background: rgba(20, 22, 28, .38); z-index: 40; }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); overflow-y: auto; overscroll-behavior: contain; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); }
.dr-h { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.dr-h h2 { font-size: 18px; overflow-wrap: anywhere; }
.dr-h .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; grid-column: 1 / -1; }
.dr-h .sitn { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.dr-b { padding: 16px 20px 40px; display: grid; gap: 14px; }
.dr-sec { padding: 14px 16px; }
.dr-sec h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.infos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.infos div { min-width: 0; }
.infos dt { font-size: 12.5px; color: var(--muted); }
.infos dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.cred { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acts .wide { grid-column: 1 / -1; }
.pays, .mini-t { display: grid; }
.pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line2); font-size: 14px; }
.pay:first-child { border-top: 0; }
.pay b { font-weight: 700; }
.mt { padding: 8px 0; border-top: 1px solid var(--line2); font-size: 14px; }
.mt:first-child { border-top: 0; }
.mt p { margin: 4px 0 0; white-space: pre-wrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.th { display: grid; gap: 4px; font-size: 12.5px; min-width: 0; }
.th a.im { display: block; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #dfe2e8; border: 1px solid var(--line); }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .ph { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; padding: 6px; text-align: center; }

/* modal / toast */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(20, 22, 28, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 420px; }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { margin: 0 0 18px; color: var(--ink2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
.toast.err { background: var(--red); }

/* écrans moyens */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .lrow { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 60px 70px minmax(0, 1fr); }
  .lrow .c-seen { display: none; }
  .pgroups { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .charts, .set-grid { grid-template-columns: 1fr; }
}

/* mobile : barre en bas */
@media (max-width: 760px) {
  :root { --toph: 56px; }
  body { font-size: 15px; }
  .rail { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: calc(64px + env(safe-area-inset-bottom)); border-radius: 0; flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); gap: 0; }
  .rail-logo { display: none; }
  .rail a { flex: 1; padding: 8px 0 6px; font-size: 10.5px; gap: 3px; border-radius: 8px; min-width: 0; }
  .rail a.on::before { left: 22%; right: 22%; top: -4px; bottom: auto; width: auto; height: 3px; }
  .badge { right: 8px; top: 2px; }
  .main { margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 16px; }
  .topbar h1 { font-size: 19px; }
  .who { display: none; }
  .demo-strip { width: calc(100% - 32px); font-size: 13px; padding: 7px 12px; }
  .view { padding: 6px 16px 32px; }
  .tiles { gap: 10px; }
  .tile { padding: 12px 12px 12px 14px; }
  .tile .val { font-size: 23px; }
  .tile .lb { font-size: 12.5px; }
  .tile .sub { font-size: 12px; }
  .period { flex-wrap: wrap; }
  .period select { min-width: 0; flex: 1; }
  .sites { grid-template-columns: 1fr; }
  .site { padding: 14px; }
  .kpi b { font-size: 18px; }
  .fun { grid-template-columns: 70px minmax(0, 1fr) 84px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters label:nth-child(3), .filters .switch { grid-column: 1 / -1; }
  .list { background: transparent; border: 0; display: grid; gap: 8px; }
  .lrow.head { display: none; }
  .lrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; border: 1px solid var(--line); border-radius: var(--rad); padding: 12px 14px; }
  .lrow .em { grid-column: 1 / -1; }
  .lrow .num { text-align: left; }
  .lrow [data-l]::before { display: inline; content: attr(data-l) ' : '; color: var(--muted); font-weight: 400; }
  .lrow .c-seen { display: block; }
  .pcard { padding: 14px; }
  .ticket { padding: 14px; }
  .ticket-h .date { margin-left: 0; width: 100%; }
  .acts { grid-template-columns: 1fr; }
  .infos { grid-template-columns: 1fr 1fr; }
  .dr-h { padding: 14px 16px; }
  .dr-b { padding: 14px 16px 40px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
