:root {
  color-scheme: light;
  --blue: #2468e8;
  --blue-dark: #174fb8;
  --blue-soft: #eaf2ff;
  --cyan: #1ab6d0;
  --green: #18ad7a;
  --orange: #f4a51c;
  --red: #ef5562;
  --purple: #7657e8;
  --ink: #182033;
  --ink-soft: #526078;
  --muted: #7e8aa0;
  --line: #e5eaf2;
  --surface: #ffffff;
  --surface-soft: #f5f8fd;
  --page: #eef3fa;
  --shadow: 0 14px 36px rgba(39, 67, 116, .10);
  --shadow-soft: 0 7px 20px rgba(39, 67, 116, .08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 0; max-width: 100%; overflow-x: hidden; background: var(--page); }
body { width: 100%; min-width: 0; max-width: 100%; margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; color: var(--ink); background: var(--page); }
img, svg { max-width: 100%; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
[hidden] { display: none !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; }

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, #4f91ff, #1c5bd6);
  box-shadow: 0 10px 22px rgba(36, 104, 232, .28);
}

/* Connexion */
.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #edf4ff 0%, #f8faff 55%, #e9f8fb 100%);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .7; }
.login-orb-one { width: 380px; height: 380px; top: -190px; right: -90px; background: #a9caff; }
.login-orb-two { width: 300px; height: 300px; bottom: -150px; left: -110px; background: #abe8ee; }
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 38px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 30px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 28px 80px rgba(35, 66, 118, .16);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 34px; font-size: 20px; }
.login-kicker { color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1 { max-width: 390px; margin: 10px 0 12px; font-size: clamp(30px, 7vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.login-card > p { margin: 0 0 28px; color: var(--ink-soft); line-height: 1.6; }
.login-card form > label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.password-field { display: flex; align-items: center; overflow: hidden; border: 1px solid #d6dfed; border-radius: 15px; background: #f8faff; }
.password-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 104, 232, .11); }
.password-field input { min-width: 0; flex: 1; padding: 15px 16px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.password-field button { align-self: stretch; padding: 0 15px; border: 0; color: var(--blue); font-size: 12px; font-weight: 800; background: transparent; }
.primary-button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--blue), #428bf6);
  box-shadow: 0 10px 24px rgba(36, 104, 232, .22);
}
.primary-button:disabled { cursor: wait; opacity: .65; }
.login-submit { width: 100%; margin-top: 16px; }
.form-error { min-height: 20px; margin: 9px 0 0; color: #d93649; font-size: 13px; }
.secure-note { display: block; margin-top: 22px; color: var(--muted); text-align: center; }

/* Structure */
.app-shell { width: 100%; min-width: 0; min-height: 100vh; min-height: 100dvh; overflow-x: clip; }
.desktop-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 250px;
  padding: 24px 18px;
  flex-direction: column;
  color: #fff;
  background: #13213d;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 28px; border: 0; color: #fff; text-align: left; background: transparent; }
.brand > span:last-child { display: grid; gap: 3px; }
.brand strong { font-size: 18px; }
.brand small { color: #8fa3c9; font-size: 11px; }
.desktop-sidebar nav { display: grid; gap: 8px; }
.nav-item {
  display: flex;
  min-height: 48px;
  padding: 0 13px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  color: #aebddd;
  text-align: left;
  background: transparent;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(82, 139, 244, .19); }
.nav-item.active { box-shadow: inset 3px 0 0 #6ca2ff; }
.nav-item em { font-style: normal; font-weight: 700; }
.nav-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.07); }
.sidebar-status { display: flex; margin: auto 5px 15px; padding: 12px; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; color: #9fb0d0; font-size: 12px; }
.sidebar-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.sidebar-status.is-online i { background: #32d296; box-shadow: 0 0 0 4px rgba(50,210,150,.11); }
.sidebar-account { display: flex; padding: 14px 6px 0; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-account > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
.sidebar-account strong { font-size: 13px; }
.sidebar-account small { color: #8fa3c9; font-size: 11px; }
.sidebar-account button { border: 0; color: #8fa3c9; background: transparent; font-size: 19px; }
.avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; font-weight: 850; background: #2c7a39; }
.sidebar-account .desktop-account-settings { cursor: pointer; color: #fff; background: #2c7a39; font-size: 14px; }
.workspace { min-width: 0; min-height: 100vh; min-height: 100dvh; margin-left: 250px; padding: 0 34px 50px; }
.desktop-header { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 20px; }
.desktop-header p { margin: 0 0 5px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.desktop-header h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.desktop-actions { display: flex; align-items: center; gap: 14px; }
.last-sync { color: var(--muted); font-size: 12px; }
.sync-button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 13px; color: #fff; font-weight: 800; background: var(--blue); box-shadow: 0 8px 18px rgba(36,104,232,.2); }
.sync-button:disabled, .refresh-pill:disabled { cursor: wait; opacity: .68; }
.mobile-header, .mobile-nav { display: none; }

/* Filtres */
.filter-panel {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: 0 -8px 24px;
  padding: 14px 8px 12px;
  border-bottom: 1px solid rgba(223,229,239,.85);
  background: rgba(238,243,250,.91);
  backdrop-filter: blur(15px);
}
.filter-selects { display: flex; min-width: 0; gap: 12px; }
.filter-selects label { display: grid; min-width: 0; flex: 1 1 0; gap: 5px; }
.filter-selects label span { padding-left: 4px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.filter-selects select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  font-weight: 720;
  background: #fff;
}
.filter-selects select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,104,232,.09); }
.period-strip { display: flex; margin-top: 12px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.period-strip::-webkit-scrollbar, .dimension-tabs::-webkit-scrollbar, .sort-strip::-webkit-scrollbar { display: none; }
.period-chip, .sort-chip {
  min-height: 38px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 1px solid #dce3ee;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 780;
  background: #fff;
}
.period-chip.active, .sort-chip.active { border-color: var(--blue); color: #fff; background: var(--blue); box-shadow: 0 7px 15px rgba(36,104,232,.18); }

/* Contenu commun */
.view-root { width: min(100%, 1440px); min-width: 0; max-width: 100%; margin: 0 auto; }
.view-stack { display: grid; min-width: 0; gap: 22px; }
.section-card {
  padding: 24px;
  border: 1px solid rgba(219,226,238,.9);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.section-head { display: flex; margin-bottom: 20px; align-items: center; justify-content: space-between; gap: 14px; }
.section-head > div:first-child { min-width: 0; }
.section-head span { color: var(--muted); font-size: 11px; font-weight: 830; letter-spacing: .08em; text-transform: uppercase; }
.section-head h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.025em; }
.text-button { padding: 8px 4px; border: 0; color: var(--blue); font-size: 13px; font-weight: 850; background: transparent; }
.empty-state { display: grid; min-height: 210px; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.empty-state span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 16px; color: var(--blue); background: var(--blue-soft); font-size: 23px; }
.empty-state strong { color: var(--ink); }
.empty-state p { max-width: 420px; margin: 0; font-size: 13px; line-height: 1.55; }
.error-state { border-color: #f1cbd0; background: #fffafb; }
.loading-card { display: grid; min-height: 340px; place-items: center; align-content: center; gap: 16px; }
.spinner { width: 42px; height: 42px; border: 4px solid #dce8fb; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Résumé */
.summary-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr); gap: 22px; }
.summary-layout > * { min-width: 0; }
.earnings-card {
  position: relative;
  min-height: 260px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #fff;
  background: linear-gradient(135deg, #2565e7 0%, #3188ed 57%, #22a9c8 120%);
  box-shadow: 0 20px 44px rgba(36,104,232,.22);
}
.earnings-card::after { content: ""; position: absolute; width: 270px; height: 270px; right: -115px; top: -130px; border: 45px solid rgba(255,255,255,.09); border-radius: 50%; }
.earnings-top { position: relative; z-index: 1; display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 15px; }
.earnings-top span:first-child { font-weight: 820; }
.range-badge { min-width: 0; padding: 8px 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; color: #eaf5ff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; background: rgba(255,255,255,.1); }
.earnings-value { position: relative; z-index: 1; margin-top: 16px; font-size: clamp(38px, 5vw, 54px); font-weight: 850; letter-spacing: -.055em; line-height: 1; word-break: break-word; }
.earnings-base { position: relative; z-index: 1; display: block; margin-top: 7px; color: #d9eaff; font-size: 11px; }
.earnings-change { position: relative; z-index: 1; display: inline-flex; margin-top: 12px; padding: 6px 9px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 800; background: rgba(12,42,100,.2); }
.earnings-change.is-down { background: rgba(116,22,39,.28); }
.quick-title { position: relative; z-index: 1; display: block; margin-top: 18px; color: #cce1ff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quick-grid { position: relative; z-index: 1; display: grid; margin-top: 9px; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quick-grid div { min-width: 0; padding: 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: rgba(255,255,255,.09); }
.quick-grid span { display: block; margin-bottom: 5px; color: #d5e7ff; font-size: 9px; font-weight: 760; text-transform: uppercase; }
.quick-grid strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.earnings-source { position: relative; z-index: 1; display: block; margin-top: 10px; color: rgba(255,255,255,.67); font-size: 10px; text-align: right; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.kpi-card { position: relative; min-height: 92px; padding: 15px 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.kpi-card::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 4px; background: var(--accent, var(--blue)); }
.kpi-card span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 820; letter-spacing: .05em; text-transform: uppercase; }
.kpi-card span i { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 7px; color: var(--accent, var(--blue)); font-style: normal; background: color-mix(in srgb, var(--accent, var(--blue)) 11%, white); }
.kpi-card strong { display: block; margin-top: 8px; font-size: 23px; letter-spacing: -.03em; }
.kpi-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.accent-blue { --accent: #3f83ee; }
.accent-cyan { --accent: #14b4c8; }
.accent-red { --accent: #ed5963; }
.accent-purple { --accent: #815ee8; }
.accent-orange { --accent: #efa51d; }
.accent-green { --accent: #20b486; }

/* Dimensions et listes */
.performance-toolbar { display: flex; margin-bottom: 18px; align-items: center; justify-content: space-between; gap: 12px; }
.dimension-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.dimension-tab { display: flex; min-height: 43px; padding: 0 14px; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-soft); font-size: 12px; font-weight: 800; background: var(--surface-soft); }
.dimension-tab.active { border-color: var(--blue); color: #fff; background: var(--blue); box-shadow: 0 8px 17px rgba(36,104,232,.18); }
.mode-toggle, .chart-toggle { display: flex; padding: 4px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; background: #f1f4f8; }
.mode-toggle button, .chart-toggle button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 800; background: transparent; }
.mode-toggle button.active, .chart-toggle button.active { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(36,104,232,.19); }
.performance-list { display: grid; gap: 14px; }
.performance-card { position: relative; padding: 18px; border: 1px solid #dde6f3; border-radius: 22px; background: #fff; box-shadow: 0 8px 24px rgba(36,70,125,.075); }
.performance-main { display: flex; width: 100%; padding: 0; align-items: center; gap: 13px; border: 0; text-align: left; background: transparent; }
.entity-icon { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 14px; color: var(--blue); font-size: 18px; font-weight: 900; background: transparent !important; box-shadow: none; }
.entity-image { display: block; width: 48px; height: 48px; object-fit: contain; border-radius: 12px; background: #fff; mix-blend-mode: normal; }
.detail-hero .entity-image { width: 54px; height: 54px; }
.entity-icon.color-1 { color: #8d4e1e; background: #fff1e4; border-color: #f7dec9; }
.entity-icon.color-2 { color: #2c7a51; background: #e8f8ef; border-color: #cfeedd; }
.entity-icon.color-3 { color: #6541bb; background: #f0eafd; border-color: #e1d6fa; }
.entity-icon.color-1, .entity-icon.color-2, .entity-icon.color-3 { background: transparent !important; border-color: transparent; }
.entity-copy { min-width: 0; flex: 1; }
.entity-copy strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.entity-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.revenue-badge { max-width: 42%; padding: 9px 12px; overflow: hidden; border-radius: 12px 12px 4px 12px; color: #fff; font-size: 14px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; background: linear-gradient(135deg, var(--blue), #4b9af7); box-shadow: 0 8px 15px rgba(36,104,232,.2); }
.card-metrics { display: grid; margin-top: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-metrics div { min-width: 0; padding: 0 8px; text-align: center; border-right: 1px solid var(--line); }
.card-metrics div:first-child { padding-left: 0; }
.card-metrics div:last-child { padding-right: 0; border-right: 0; }
.card-metrics strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.card-metrics span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.expand-button { display: flex; margin: 13px auto -5px; padding: 5px 10px; align-items: center; gap: 5px; border: 0; color: var(--muted); font-size: 10px; font-weight: 780; background: transparent; }
.expanded-metrics { display: grid; margin: 10px -2px -2px; padding: 13px 2px 2px; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed #dce3ed; }
.expanded-metrics div { text-align: center; }
.expanded-metrics strong { display: block; font-size: 14px; }
.expanded-metrics span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.show-all-button { display: flex; width: 100%; min-height: 58px; margin-top: 14px; padding: 0 16px; align-items: center; justify-content: space-between; border: 1px solid #bcd1f6; border-radius: 17px; color: var(--blue); font-weight: 820; background: #edf4ff; }
.sort-area { margin: -2px 0 18px; }
.sort-area > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.sort-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }

/* Graphiques */
.distribution-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(240px, 1.2fr); min-height: 340px; align-items: center; gap: 24px; }
.donut-wrap { position: relative; width: min(100%, 300px); margin: auto; }
.donut-chart { display: block; width: 100%; height: auto; overflow: visible; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: #e8edf5; stroke-width: 28; }
.donut-segment { fill: none; stroke-width: 28; transition: opacity .2s; }
.donut-hole-copy { position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none; text-align: center; }
.donut-hole-copy strong { font-size: 25px; }
.donut-hole-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.segment-0 { stroke: #2468e8; }
.segment-1 { stroke: #18ad7a; }
.segment-2 { stroke: #f4a51c; }
.segment-3 { stroke: #ef5562; }
.segment-4 { stroke: #7657e8; }
.segment-5 { stroke: #1ab6d0; }
.segment-6 { stroke: #9aa7ba; }
.distribution-legend { display: grid; gap: 11px; }
.legend-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.color-0 { background: #2468e8; }
.color-1 { background: #18ad7a; }
.color-2 { background: #f4a51c; }
.color-3 { background: #ef5562; }
.color-4 { background: #7657e8; }
.color-5 { background: #1ab6d0; }
.color-6 { background: #9aa7ba; }
.legend-row span:nth-child(2) { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.legend-row strong { font-size: 12px; }
.trend-stats { display: grid; margin-bottom: 18px; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trend-stats div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.trend-stats span { display: block; color: var(--muted); font-size: 9px; font-weight: 760; text-transform: uppercase; }
.trend-stats strong { display: block; margin-top: 5px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.trend-chart { width: 100%; min-height: 250px; overflow: hidden; }
.trend-chart svg { display: block; width: 100%; height: auto; min-height: 250px; }
.chart-grid-line { stroke: #e8edf4; stroke-width: 1; }
.chart-axis-label { fill: #8793a7; font-size: 10px; }
.chart-area { fill: rgba(36,104,232,.08); }
.chart-line { fill: none; stroke: #2468e8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: #2468e8; stroke-width: 3; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-bar { fill: #80aaf1; rx: 4; }
.chart-bar.is-selected { fill: #2468e8; }
.chart-focus { display: flex; margin-top: 10px; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 12px; border-radius: 13px; color: var(--ink-soft); font-size: 12px; background: var(--blue-soft); }
.chart-focus strong { color: var(--blue-dark); }

/* Pages et réglages */
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-intro > div { min-width: 0; }
.page-intro span { color: var(--blue); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.page-intro h2 { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.035em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.back-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-weight: 800; background: #fff; }
.detail-hero { display: flex; padding: 22px; align-items: center; gap: 16px; border-radius: var(--radius-xl); color: #fff; background: linear-gradient(135deg, #235ed2, #3898ef); box-shadow: 0 15px 35px rgba(36,104,232,.2); }
.detail-hero .entity-icon { width: 60px; height: 60px; border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.15); }
.detail-hero > div:nth-child(2) { min-width: 0; flex: 1; }
.detail-hero h2 { margin: 0; overflow: hidden; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.detail-hero p { margin: 5px 0 0; color: #d9eaff; font-size: 12px; }
.detail-hero > strong { font-size: 24px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 22px; }
.profile-card { display: flex; padding: 22px; align-items: center; gap: 14px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #2565e7, #4b9cf5); box-shadow: 0 14px 32px rgba(36,104,232,.2); }
.profile-card .avatar { width: 54px; height: 54px; border: 4px solid rgba(255,255,255,.2); }
.profile-card strong { display: block; font-size: 18px; }
.profile-card span:last-child { display: block; margin-top: 3px; color: #dcecff; font-size: 12px; }
.profile-card > div { min-width: 0; flex: 1; }
.settings-home-button { min-height: 42px; padding: 0 15px; border: 1px solid rgba(255,255,255,.42); border-radius: 13px; color: #fff; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.12); }
.settings-home-button:hover { background: rgba(255,255,255,.2); }
.setting-block { margin-top: 18px; }
.setting-block > label, .setting-block > span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 790; }
.install-panel { padding: 14px; border: 1px solid #dce6f7; border-radius: 17px; background: #f7faff; }
.install-panel > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.install-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.platform-button { display: grid; min-width: 0; min-height: 92px; padding: 12px; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; border: 1px solid var(--line); border-radius: 14px; text-align: left; background: #fff; }
.platform-button:hover { border-color: #a8c3f3; background: #fafdff; }
.platform-button > span { display: grid; width: 38px; height: 38px; grid-row: 1 / 3; place-items: center; border-radius: 12px; color: #fff; font-size: 11px; font-weight: 900; background: linear-gradient(135deg, #2468e8, #4b9af7); }
.platform-button strong, .platform-button small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-button strong { align-self: end; font-size: 12px; }
.platform-button small { align-self: start; color: var(--muted); font-size: 9px; }
.install-ready { display: flex; padding: 14px; align-items: center; gap: 11px; border: 1px solid #ccebdc; border-radius: 16px; color: #247254; background: #eefaf4; }
.install-ready > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; font-weight: 900; background: #20ae78; }
.install-ready strong, .install-ready small { display: block; }
.install-ready strong { font-size: 12px; }
.install-ready small { margin-top: 3px; font-size: 10px; }
.currency-field { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 790; }
.currency-field select { width: 100%; min-height: 52px; padding: 0 42px 0 14px; border: 1px solid var(--line); border-radius: 14px; outline: 0; color: var(--ink); font-size: 13px; font-weight: 750; background: #fff; }
.currency-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,104,232,.08); }
.advanced-settings { min-width: 0; }
.advanced-settings > summary { list-style: none; }
.advanced-settings > summary::-webkit-details-marker { display: none; }
.advanced-settings-trigger { display: flex; min-height: 88px; align-items: center; gap: 12px; cursor: pointer; }
.advanced-settings-trigger:hover { border-color: #abc5f2; }
.advanced-settings-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--blue); background: var(--blue-soft); }
.advanced-settings-trigger > span:nth-child(2) { min-width: 0; flex: 1; }
.advanced-settings-trigger strong, .advanced-settings-trigger small { display: block; }
.advanced-settings-trigger strong { font-size: 14px; }
.advanced-settings-trigger small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.advanced-settings-trigger > i { color: var(--blue); font-size: 27px; font-style: normal; transition: transform .2s; }
.advanced-settings[open] .advanced-settings-trigger > i { transform: rotate(90deg); }
.advanced-settings-panel { margin-top: 12px; }
.toggle-row { display: flex; min-height: 70px; padding: 13px 14px; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.toggle-row strong { display: block; font-size: 13px; }
.toggle-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 50px; height: 29px; flex: 0 0 auto; border: 0; border-radius: 999px; background: #aab3c2; }
.switch::after { content: ""; position: absolute; width: 23px; height: 23px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .2s; }
.switch.active { background: var(--blue); }
.switch.active::after { transform: translateX(21px); }
.connection-status { display: flex; padding: 13px 14px; align-items: center; gap: 10px; border-radius: 14px; color: #287453; font-size: 12px; font-weight: 750; background: #eaf8f1; }
.connection-status i { width: 9px; height: 9px; border-radius: 50%; background: #20ae78; }
.connection-status.is-offline { color: #9d5b17; background: #fff5e8; }
.connection-status.is-offline i { background: var(--orange); }
.levelplay-form { display: grid; margin-top: 16px; gap: 12px; }
.levelplay-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 780; }
.levelplay-form input { min-height: 45px; padding: 0 13px; border: 1px solid #dce3ed; border-radius: 13px; outline: 0; color: var(--ink); background: #f9fbfe; }
.levelplay-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,104,232,.08); }
.form-actions { display: flex; gap: 9px; }
.form-actions .primary-button { flex: 1; }
.danger-button { min-height: 46px; padding: 0 15px; border: 1px solid #f0c5ca; border-radius: 13px; color: #d23d4c; font-weight: 800; background: #fff8f9; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.signout-button { width: 100%; min-height: 49px; margin-top: 16px; border: 0; border-radius: 14px; color: #fff; font-weight: 850; background: #ed3f43; }
.rate-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.rate-note a { color: var(--blue); }

/* Dialogue et notifications */
.range-dialog { width: min(calc(100% - 28px), 430px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 25px 90px rgba(17,35,67,.28); }
.range-dialog::backdrop { background: rgba(18,31,55,.55); backdrop-filter: blur(3px); }
.range-dialog form { display: grid; padding: 24px; gap: 14px; }
.dialog-head { display: flex; margin-bottom: 4px; align-items: start; justify-content: space-between; }
.dialog-head span { color: var(--blue); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.dialog-head h2 { margin: 5px 0 0; font-size: 22px; }
.dialog-head button { width: 35px; height: 35px; border: 0; border-radius: 10px; color: var(--ink-soft); background: var(--surface-soft); font-size: 22px; }
.range-dialog label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.range-dialog input { min-height: 46px; padding: 0 12px; border: 1px solid #dce3ed; border-radius: 13px; color: var(--ink); background: #f9fbfe; }
.install-dialog-body { display: grid; padding: 24px; gap: 15px; }
.install-dialog-content { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.install-dialog-content p { margin: 0; }
.install-dialog-content ol { display: grid; margin: 0; padding-left: 22px; gap: 8px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(390px, calc(100% - 32px)); padding: 13px 17px; border-radius: 13px; color: #fff; font-size: 12px; font-weight: 760; background: #18305d; box-shadow: 0 14px 40px rgba(17,35,67,.25); }
.toast.is-error { background: #bd3544; }

@media (max-width: 1050px) {
  .desktop-sidebar { width: 210px; }
  .workspace { margin-left: 210px; padding-inline: 24px; }
  .summary-layout, .settings-grid { grid-template-columns: 1fr; }
  .summary-layout .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(178px + env(safe-area-inset-top)); }
  body { overscroll-behavior-x: none; background: #f4f7fb; }
  .login-screen { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .login-card { padding: 26px 22px; border-radius: 24px; }
  .login-brand { margin-bottom: 25px; }
  .login-card h1 { font-size: clamp(27px, 9vw, 36px); }
  .desktop-sidebar, .desktop-header { display: none; }
  .app-shell { padding-bottom: env(safe-area-inset-bottom); }
  .workspace { width: 100%; max-width: 100%; margin-left: 0; padding: 0 12px 24px; overflow: visible; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    width: calc(100% + 24px);
    min-height: calc(72px + env(safe-area-inset-top));
    margin: 0 -12px;
    padding: calc(11px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 11px max(14px, env(safe-area-inset-left));
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, #215dcc, #2675ed);
  }
  .mobile-header > div { min-width: 0; }
  .mobile-header small, .mobile-header strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-header small { color: #cfe1ff; font-size: 10px; }
  .mobile-header strong { margin-top: 2px; font-size: 18px; }
  .refresh-pill { display: flex; min-height: 40px; padding: 0 11px; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,.48); border-radius: 999px; color: #fff; background: rgba(255,255,255,.09); }
  .refresh-pill span { font-size: 18px; }
  .refresh-pill em { font-size: 10px; font-style: normal; font-weight: 780; }
  .avatar-button { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.28); }
  .filter-panel { top: calc(72px + env(safe-area-inset-top)); width: calc(100% + 24px); margin: 0 -12px 16px; padding: 10px 12px 10px; background: rgba(244,247,251,.96); box-shadow: 0 8px 18px rgba(31,53,90,.05); }
  .filter-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-selects label { min-width: 0; gap: 4px; }
  .filter-selects label span { display: block; padding-left: 2px; font-size: 8px; }
  .filter-selects select { width: 100%; min-width: 0; min-height: 42px; padding: 0 32px 0 10px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
  .period-strip { margin: 9px -12px 0; padding: 0 12px 2px; gap: 7px; scroll-padding-inline: 12px; scroll-snap-type: x proximity; }
  .period-chip { min-height: 36px; padding-inline: 13px; font-size: 10px; scroll-snap-align: start; }
  .view-root, .view-stack, .summary-layout, .section-card, .performance-card, .detail-hero, .settings-grid { min-width: 0; max-width: 100%; }
  .view-stack { gap: 14px; }
  .section-card { padding: 15px; overflow: hidden; border-radius: 20px; }
  .section-head { flex-wrap: wrap; margin-bottom: 15px; }
  .section-head h2 { font-size: 17px; }
  .summary-layout { width: 100%; gap: 12px; }
  .earnings-card { width: 100%; min-width: 0; min-height: 0; padding: 16px; border-radius: 20px; }
  .earnings-top { align-items: flex-start; }
  .earnings-top > span:first-child { min-width: 0; }
  .range-badge { max-width: 46%; padding: 7px 9px; font-size: 10px; }
  .earnings-value { margin-top: 12px; font-size: clamp(30px, 9vw, 42px); overflow-wrap: anywhere; }
  .earnings-change { max-width: 100%; line-height: 1.3; }
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-grid div { padding: 9px 8px; }
  .quick-grid strong { font-size: 11px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .earnings-source { overflow-wrap: anywhere; text-align: left; }
  .summary-layout .kpi-grid, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { min-height: 88px; padding: 13px; border-radius: 16px; }
  .kpi-card strong { font-size: 20px; }
  .performance-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; margin-bottom: 14px; }
  .dimension-tabs { grid-column: 1 / -1; order: 2; margin: 0 -2px; }
  .dimension-tab { min-height: 40px; padding-inline: 12px; font-size: 10px; }
  .mode-toggle { order: 1; }
  .performance-card { padding: 15px; border-radius: 19px; }
  .performance-main { gap: 9px; }
  .entity-icon { width: 52px; height: 52px; border-radius: 14px; }
  .entity-image { width: 43px; height: 43px; }
  .revenue-badge { padding: 8px 9px; font-size: 12px; }
  .card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 13px; }
  .card-metrics div:nth-child(2) { border-right: 0; }
  .card-metrics strong { font-size: 13px; }
  .distribution-layout { grid-template-columns: 1fr; min-height: 0; }
  .donut-wrap { width: min(76vw, 270px); }
  .distribution-legend { grid-template-columns: 1fr; }
  .trend-stats div { padding: 10px; }
  .trend-stats strong { font-size: 12px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .trend-chart { min-height: 220px; width: 100%; margin: 0; }
  .trend-chart svg { min-height: 220px; }
  .page-intro { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .page-intro h2 { font-size: 21px; }
  .detail-hero { flex-wrap: wrap; padding: 16px; }
  .detail-hero > strong { width: 100%; padding-left: 68px; }
  .detail-hero > strong { font-size: 18px; }
  .settings-grid { gap: 16px; }
  .profile-card { flex-wrap: wrap; }
  .settings-home-button { width: 100%; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .primary-button, .danger-button { width: 100%; }
  .toast { right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 24px); }
}

@media (max-width: 390px) {
  .workspace { padding-inline: 10px; }
  .mobile-header { width: calc(100% + 20px); margin-inline: -10px; padding-inline: 12px; }
  .filter-panel { width: calc(100% + 20px); margin-inline: -10px; padding-inline: 10px; }
  .refresh-pill em { display: none; }
  .quick-grid { gap: 6px; }
  .quick-grid div { padding-inline: 7px; }
  .entity-icon { width: 46px; height: 46px; }
  .entity-image { width: 40px; height: 40px; }
  .revenue-badge { max-width: 38%; }
  .card-metrics strong { font-size: 12px; }
  .card-metrics span { font-size: 8px; }
  .install-platforms { grid-template-columns: 1fr; }
  .platform-button { min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
