:root {
  color-scheme: dark;
  --bg: #071322;
  --panel: #0e1e30;
  --line: #28415b;
  --accent: #70dcff;
  --ink: #f0f7ff;
  --muted: #a9bed1;
  font: 16px/1.5 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at 75% 0, #12293c 0, var(--bg) 42rem) }
header { background: #0a1626; border-bottom: 1px solid #2a435a }
.wrap { max-width: 77rem; margin: auto; padding-inline: clamp(14px, 4vw, 42px) }
.top { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; flex: none }
.brand strong { display: grid; line-height: 1.22; font-size: 1.04rem; letter-spacing: -.02em }
.brand small { color: var(--muted); font-weight: 500; font-size: .73rem; letter-spacing: 0; margin-top: 3px }
nav { display: flex; align-items: center; gap: 5px }
nav a { color: var(--muted); padding: 8px 13px; border-radius: 10px; text-decoration: none; font-size: .85rem; font-weight: 700 }
nav a:hover, nav .nav-active { background: #15354c; color: #a6ebff }
main { padding-block: 20px 44px }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.055em; overflow-wrap: anywhere }
h2 { font-size: 1.18rem; letter-spacing: -.02em }
h3 { font-size: 1rem; overflow-wrap: anywhere }
a { color: inherit }
.hero { position: relative; overflow: hidden; margin-bottom: 16px; padding: clamp(19px, 4vw, 38px); border-radius: 22px; border: 1px solid #3b6881; background: radial-gradient(ellipse at 86% 0, #1a485e, transparent 70%), linear-gradient(135deg,#102439,#0a1728) }
.hero > p, .headline p { margin-top: 7px; overflow-wrap: anywhere }
.headline, .actions, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.headline > div { min-width: 0 }
.actions { justify-content: flex-start }
.muted { color: var(--muted); font-size: .88rem }
.panel { padding: clamp(14px, 2.5vw, 24px); margin-block: 14px; min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: 0 12px 30px #03081733 }
.panel > p, .panel > form, .panel > label, .panel > .actions { margin-top: 11px }
.section-head { margin-bottom: 12px }
button, .button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 8px 13px; border: 1px solid #37536a; border-radius: 10px; background: #162a3e; color: var(--ink); font: inherit; font-size: .87rem; font-weight: 700; line-height: 1.28; text-decoration: none; text-align: center; cursor: pointer }
button:hover, .button:hover { border-color: #75c4e6 }
.primary { background: #80e2fb; border-color: #8ce8ff; color: #052137 }
.primary:hover { background: #a8edff }
.quiet { background: #102135 }
.warning { color: #ffc2c6; border-color: #995460; background: #351f31 }
button:disabled { opacity: .5; cursor: not-allowed }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.text-link { color: var(--accent) }
.crumb { margin: 0 0 12px; font-size: .9rem }
form { margin: 0 }
label { min-width: 0; display: grid; gap: 5px; font-weight: 650; font-size: .83rem }
label small { color: var(--muted); font-weight: 500 }
input:not([type=hidden]), select { min-width: 0; width: 100%; min-height: 43px; padding: 8px 11px; font: inherit; font-size: 16px; border: 1px solid #37536a; border-radius: 9px; color: var(--ink); background: #081728 }
input[readonly] { color: #a8e7ff }
.creation, .filters, .sign-in form { display: grid; align-items: end; gap: 10px }
.creation { grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)) }
.shop-creation { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px }
.shop-creation button { grid-column: 1/-1; justify-self: start }
.filters { grid-template-columns: 2fr 1.25fr 1.35fr auto; margin-bottom: 13px }
.filters > *, .creation > * { min-width: 0 }
.sign-in { max-width: 29rem; margin: clamp(22px,7vw,74px) auto }
.sign-in h1 { font-size: clamp(1.7rem,5vw,2.4rem) }
.sign-in form { margin-top: 18px; gap: 12px }
.sign-in a { display: inline-block; margin-top: 12px }
.error, .report-note { padding: 10px 12px; border: 1px solid #a3545d; border-radius: 10px; background: #401d27; color: #ffc1bc; font-size: .9rem }
.report-note { margin: 14px 0 0; background: #352b1e; color: #ffe4ab; border-color: #876443 }
.date-tools, .month-form, .month-arrows { display: flex; gap: 7px; align-items: center }
.date-tools { margin-top: 20px; flex-wrap: wrap }
.month-arrows { flex: none }
.month-form label { flex: 1 }
.month-arrows > a { min-width: 42px; font-size: 1.25rem }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px }
.metric { position: relative; min-width: 0; display: grid; align-content: start; gap: 4px; padding: clamp(12px,2.5vw,21px); border-radius: 14px; border: 1px solid #2d4960; background: #112238 }
.metric strong { line-height: 1.15; font-size: clamp(1.15rem, 3vw, 1.95rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.metric span, .metric small { color: var(--muted); font-size: .79rem }
.metric small { font-size: .72rem }
.metric-primary { background: linear-gradient(125deg,#183d56,#122538); border-color: #4a93ac }
.metric-primary strong { color: #8ee6ff }
.metric-green strong { color: #92efc7 }
.metric-amber strong { color: #ffdc98 }
.metrics.inline { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 12px }
.metrics.inline .metric { padding: 10px }
.shops, .receipts { list-style: none; padding: 0; margin: 0 }
.shops li, .receipts li { padding: 11px 0; border-bottom: 1px solid #2c435a }
.shops li:last-child, .receipts li:last-child { border-bottom: 0 }
.shops li { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) minmax(0,.95fr) max-content; gap: 12px; align-items: center }
.shop-name, .shop-stats, .shop-data, .receipts li { display: flex; gap: 9px; align-items: center; min-width: 0 }
.shop-name > div { min-width: 0 }
.shop-initial { flex: none; display: grid; place-items: center; width: 37px; height: 37px; color: #9fe8ff; background: #15394f; border: 1px solid #345b73; border-radius: 9px; font-weight: 750 }
.url { color: var(--muted); font-size: .73rem; overflow-wrap: anywhere }
.shop-stats { gap: clamp(9px,2vw,28px) }
.shop-stats span { display: grid; min-width: 0 }
.shop-stats small, .receipts li div span { color: var(--muted); font-size: .73rem }
.shop-stats strong { overflow-wrap: anywhere }
.shop-data { gap: 5px; flex-wrap: wrap }
.badge { display: inline-flex; align-items: center; gap: 5px; min-width: 0; border: 1px solid #37546c; background: #182b3c; border-radius: 99px; padding: 3px 8px; color: #c1d9eb; font-size: .71rem; white-space: nowrap }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.badge[data-tone=green] { background: #10392f; color: #a2f5cc; border-color: #35735e }
.badge[data-tone=amber] { background: #382f22; color: #ffdf97; border-color: #806541 }
.badge[data-tone=violet] { background: #302946; color: #e2c9ff; border-color: #6b5887 }
.receipts { margin-top: 12px }
.receipts li { justify-content: space-between }
.receipts li div { display: grid; min-width: 0; overflow-wrap: anywhere }
.receipts li button { font-size: .76rem; flex: none }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.detail-grid > .panel { margin: 0 }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr }
  .shops li { grid-template-columns: minmax(0,1fr) auto; gap: 7px 8px }
  .shops li > a { grid-column: 2; grid-row: 1 }
  .shop-stats { grid-column: 1; grid-row: 2 }
  .shop-data { grid-column: 2; grid-row: 2; justify-content: flex-end }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)) }
}
@media (max-width: 520px) {
  .top { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; padding-block: 12px }
  .top nav { grid-row: 2; grid-column: 1/-1; justify-content: space-between }
  main { padding-top: 14px }
  nav a { text-align: center; padding-inline: 8px }
  .headline .actions { width: 100% }
  .headline .actions .button { flex: 1 }
  .date-tools .month-form { flex: 1 1 170px; min-width: 0 }
  .month-form button { flex: none }
  .shop-data { max-width: 7.5rem }
  .shop-creation { grid-template-columns: 1fr }
  .shop-creation button { justify-self: stretch }
}

/* Gestion réseau */
body.network-authenticated { background: radial-gradient(ellipse at 38% -6%,#114365 0,transparent 28rem),#061523; padding-bottom: max(86px,calc(74px + env(safe-area-inset-bottom))) }
.network-header { position: relative; overflow: hidden; border-color: #1b3850; background: linear-gradient(105deg,#071523 30%,#08294a 76%,#071523) }
.network-header::before { content: ''; position: absolute; width: 52%; height: 85px; left: 30%; top: -25px; border-bottom: 1px solid #22a8e8; border-radius: 0 0 70% 76%; transform: rotate(-15deg); filter: drop-shadow(0 3px 8px #009ee4); opacity: .63; pointer-events: none }
.network-header .top { min-height: 65px; position: relative; display: flex; padding-block: 9px; padding-top: max(9px,env(safe-area-inset-top)) }
.network-header .brand img { display:block; object-fit:cover; width:39px; height:39px; border-radius:24%; box-shadow:0 0 14px #11b1dc66 }
.network-header .brand strong { font-size:clamp(1.09rem,4vw,1.42rem); font-weight:800 }
.network-header-actions { display:flex; gap:9px; align-items:center }
.dashboard-icon-button { display: inline-grid; place-items:center; min-width:35px; min-height:35px; border:1px solid #345975; border-radius:11px; background:#0f283e; color:#e7f7ff; text-decoration:none; flex:none }
.dashboard-icon-button:hover { border-color:#64dcf8; color:#90f3ff }
.account-link { border-radius:50% }
.network-nav { position:fixed; z-index:20; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,46rem); display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:6px clamp(5px,2vw,12px) max(6px,env(safe-area-inset-bottom)); border:1px solid #335873; border-radius:18px 18px 0 0; background:#0b1f31; box-shadow:0 -4px 20px #0005 }
.network-nav a { display:grid; min-width:0; place-items:center; gap:3px; padding:7px 3px; text-align:center; font-size:clamp(.65rem,2.4vw,.84rem); line-height:1.15; font-weight:660; border-radius:12px }
.network-nav a.nav-active { background:linear-gradient(145deg,#134b66,#0b304b); color:#95eeff; border:1px solid #2e9cc4; box-shadow:inset 0 0 12px #057da958 }
.network-nav a:not(.nav-active) { border:1px solid transparent }
.network-authenticated main { padding-top:12px }
.dashboard-month { display:flex; align-items:center; justify-self:end; gap:1px; min-width:0; width:max-content; max-width:100%; margin:0 0 10px auto; border:1px solid #315675; border-radius:10px; background:linear-gradient(150deg,#12344e,#102338) }
.dashboard-month label { display:flex; min-width:0; align-items:center; gap:8px; padding-inline-start:8px; color:#ecf8ff; flex:1 }
.dashboard-month input:not([type=hidden]) { color:#f0f8ff; min-height:34px; min-width:8rem; width:auto; padding:1px 3px; font-size:.8rem; font-weight:700; border:0; background:transparent }
.dashboard-month button, .chart-period button { min-height:34px; min-width:26px; padding:0 5px; background:transparent; border:0 solid transparent }
.network-kpis { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px }
.network-kpi { min-width:0; min-height:80px; display:grid; grid-template-columns:auto minmax(0,1fr); align-content:center; align-items:start; column-gap:9px; padding:clamp(8px,2.3vw,16px); border:1px solid #2d506a; border-radius:13px; background:radial-gradient(ellipse at 100% 0,#163751 0,transparent 80%),linear-gradient(130deg,#102b41,#0a1d2e); box-shadow:inset 0 0 12px #318cab1a }
.network-kpi[data-kpi=revenue] { border-color:#1cc7ee; background:radial-gradient(ellipse at 80% 130%,#0b6380,transparent 74%),linear-gradient(145deg,#144562,#0d2539); box-shadow:inset 0 0 15px #00bbef55,0 0 12px #08bbdc36 }
.kpi-icon { display:grid; place-items:center; width:clamp(30px,8.5vw,47px); height:clamp(30px,8.5vw,47px); border-radius:10px; background:#194564; color:#edf9ff }
[data-kpi=revenue] .kpi-icon { background:#10789a; color:#55f2ff }
[data-kpi=received] .kpi-icon { background:#11505c }
[data-kpi=remaining] .kpi-icon { background:#685532; color:#fff1cf }
.network-kpi h2 { font-size:clamp(.73rem,2.72vw,1rem); line-height:1.16; font-weight:650; letter-spacing:0 }
.network-kpi strong { display:block; font-size:clamp(1.23rem,5.25vw,1.88rem); line-height:1.12; margin:4px 0 3px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; letter-spacing:-.032em }
.network-kpi small { display:flex; flex-wrap:wrap; gap:1px 7px; color:var(--muted); font-size:clamp(.61rem,2.35vw,.78rem); align-items:center }
.trend { font-weight:750; white-space:nowrap; color:#bddef0 }
.trend[data-direction=up] { color:#7ff3ad }
.trend[data-direction=down] { color:#ffdd85 }
.trend-muted { color:#97aec4 }
.network-chart, .network-ranking, .network-share { padding:clamp(9px,2.7vw,18px); margin-block:10px; border-color:#31536d; border-radius:13px; background:radial-gradient(ellipse at 70% 0%,#12344d,transparent 90%),#0a1d2d; box-shadow:inset 0 0 11px #5494ba18 }
.dashboard-section-head { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:5px }
.dashboard-section-head h2, .network-share h2 { font-size:clamp(.94rem,3.55vw,1.18rem); line-height:1.2; font-weight:800 }
.dashboard-section-head h2 small { font-size:.76em; font-weight:500; color:#bdd5e6 }
.network-ranking h2 { display:flex; gap:6px; align-items:center; flex-wrap:wrap }
.network-ranking h2 svg { flex:none }
.chart-period { display:flex; align-items:center; flex:none; border:1px solid #345a77; border-radius:9px; background:#0c2438 }
.chart-period select { width:auto; min-width:0; padding:2px 3px 2px 6px; border:0; min-height:28px; font-size:clamp(.64rem,2.55vw,.85rem); background:transparent }
.chart-period button { min-height:28px; min-width:16px; padding:0 1px }
.network-chart { position:relative }
.sales-line { display:block; width:100%; height:auto; max-height:218px; overflow:visible }
.sales-line text { font-size:10px; fill:#c4d7e8; font-variant-numeric:tabular-nums }
.sales-grid { stroke:#28495f; stroke-width:1 }
.sales-area { fill:url(#sales-fill) }
.sales-stroke { fill:none; stroke:#30e5ff; stroke-width:2.5; filter: drop-shadow(0 0 3px #23c6e8) }
.sales-dot { fill:#e7fbff; stroke:#31ddf4; stroke-width:1; filter:drop-shadow(0 0 3px #17bce6) }
.sales-dot.is-last { stroke-width:1.5 }
.chart-current { display:flex; gap:8px; justify-content:flex-end; color:var(--muted); font-size:.72rem; margin-top:-1px!important }
.chart-current strong { color:#ecf8ff }
.network-analysis { display:grid; grid-template-columns:1fr 1fr; gap:10px }
.network-analysis>.panel { margin-block:0 10px; min-width:0 }
.network-ranking ol,.network-share ul { list-style:none; padding:0; margin:0; min-width:0 }
.network-ranking li + li,.network-share li + li { border-top:1px solid #28465c }
.network-ranking li a { display:grid; align-items:center; grid-template-columns:20px 29px minmax(0,1fr) max-content minmax(33px,max-content); gap:6px; color:#f1f8ff; text-decoration:none; font-size:.83rem; padding:6px 1px }
.network-ranking li a:hover strong { color:#8eeaff }
.network-ranking li strong,.network-share li span { overflow-wrap:anywhere }
.network-ranking li a > span:last-child { padding:1px 5px; border-radius:10px; background:#2b384633; text-align:center; font-size:.73rem }
.network-ranking .trend[data-direction=up] { background:#164735 }
.rank-number,.rank-avatar { display:grid; place-items:center; font-weight:760; line-height:1 }
.rank-number { border-radius:50%; aspect-ratio:1; color:#172d43; background:#d8eaf8 }
.rank-number[data-place="0"] { background:#ffe37b }
.rank-number[data-place="2"] { background:#ffc78a }
.rank-avatar { border-radius:6px; height:23px;background:#146080;color:#d9faff }
.rank-avatar[data-tone=blue] { background:#134664 }
.rank-avatar[data-tone=violet] { background:#3f376c }
.share-content { display:grid; grid-template-columns:minmax(88px, .75fr) minmax(0,1fr); align-items:center; gap:12px; margin-top:4px }
.share-wheel { position:relative; width:min(100%,160px); margin:auto; aspect-ratio:1; display:grid; place-items:center }
.share-wheel svg,.share-wheel>span { grid-area:1/1; width:100% }
.share-wheel>span { z-index:1; text-align:center; line-height:1.08; width:68%; display:grid; gap:4px }
.share-wheel strong { font-size:clamp(.86rem,4vw,1.42rem); overflow-wrap:anywhere }
.share-wheel small { color:#bfd5e6;font-size:.7rem }
.share-base,.share-arc { fill:none; stroke-width:15; stroke:#29475d }
.share-arc { transform:rotate(-90deg); transform-origin:50% 50%; stroke:var(--share-color) }
.share-content [data-tone=cyan] { --share-color:#24d9ed }
.share-content [data-tone=blue] { --share-color:#39a4f6 }
.share-content [data-tone=violet] { --share-color:#a48af5 }
.share-content [data-tone=steel] { --share-color:#8bb3d0 }
.network-share li { display:grid; grid-template-columns:8px minmax(0,1fr) max-content; gap:6px; align-items:center; padding:5px 0; font-size:.79rem }
.network-share li i { width:8px;height:8px;border-radius:50%;background:var(--share-color) }
.network-share li strong { font-size:.75rem; white-space:nowrap }
.dashboard-empty { color:var(--muted); font-size:.83rem; padding:12px 0; margin:0!important }
.network-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin:0 0 12px }
.network-counts article { display:grid; place-items:center; text-align:center; align-content:center; min-height:75px; padding:6px; gap:2px; min-width:0; background:linear-gradient(145deg,#14364f,#0a2133); border:1px solid #2b6380; border-radius:12px }
.network-counts svg { color:#54dbf8 }
.network-counts strong { font-size:clamp(1.11rem,5.2vw,1.75rem); line-height:1.02; overflow-wrap:anywhere; font-variant-numeric:tabular-nums }
.network-counts span { font-size:.75rem; line-height:1.19; color:#c7e0f0 }
@media (max-width:680px) {
  .network-analysis { display:block }
  .network-ranking li a { font-size:clamp(.73rem,3.2vw,.92rem) }
  .network-kpi { min-height:78px; padding:8px; column-gap:6px }
  .network-kpi h2 { font-size:clamp(.66rem,2.9vw,.77rem) }
  .network-kpi small { gap:3px; font-size:clamp(.56rem,2.3vw,.66rem) }
  .dashboard-section-head h2 { font-size:clamp(.86rem,3.35vw,1.04rem) }
  .chart-period select { font-size:clamp(.57rem,2.45vw,.75rem) }
  .network-chart .sales-line text { font-size:12px }
  .network-ranking li a { padding-block:4px }
  .share-wheel { width:min(100%,127px) }
}
@media (max-width:360px) {
  .network-kpi { column-gap:5px }
  .network-kpi small span:last-child { font-size:.60rem }
  .network-header .brand { gap:8px }
}
.network-notices{list-style:none;padding:0;margin:0 0 14px}
.network-notices li{display:flex;justify-content:space-between;align-items:start;gap:12px;padding:12px 0;border-bottom:1px solid #264755;overflow-wrap:anywhere}
.network-notices strong,.network-notices small{display:block}
.notice-time{flex:0 0 auto;text-align:right;font-size:.82rem}
@media(max-width:430px){.network-notices li{flex-wrap:wrap;gap:4px}.notice-time{text-align:left}}
