/* Tableau de bord Etolys — mêmes jetons que le site vitrine (site/src/assets/styles.css) :
   fond papier, vert de marque, police système, boutons en pilule. Aucune ressource externe. */

:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --bg-alt: #eef3ec;
  --white: #ffffff;
  --ink: #17211b;
  --ink-soft: #33413a;
  --muted: #5b675f;
  --line: #dfe5df;
  --line-soft: #ebefea;
  --accent: #1f6b48;
  --accent-dark: #164f35;
  --accent-soft: #e3f0e8;
  --gold: #a86b12;
  --gold-bar: #d4a245;
  --danger: #a13a35;
  --danger-soft: #f9e9e7;
  --warn: #8a5a06;
  --warn-soft: #fff3d9;
  --radius: 18px;
  --radius-small: 10px;
  --shadow-small: 0 6px 18px rgba(28, 48, 35, 0.06);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 95px; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, summary, select { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: wait; opacity: 0.6; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 750; text-wrap: balance; }
h2 { font-size: 18px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.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; }
.skip-link { position: fixed; top: -70px; left: 16px; padding: 10px 16px; background: var(--ink); color: var(--white); border-radius: var(--radius-small); z-index: 20; }
.skip-link:focus { top: 12px; }
.icon { width: 19px; height: 19px; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Barre latérale */
.sidebar { width: 236px; height: 100vh; position: fixed; top: 0; left: 0; background: var(--white); border-right: 1px solid var(--line); padding: 26px 16px; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); font-weight: 750; font-size: 19px; }
.brand-mark { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--white); font-weight: 800; font-size: 17px; }
.workspace-label { font-size: 11px; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin: 40px 12px 12px; }
.nav-link { display: flex; gap: 12px; align-items: center; padding: 11px 12px; margin: 4px 0; border-radius: var(--radius-small); color: var(--ink-soft); font-size: 14px; font-weight: 550; min-height: 46px; }
.nav-link:hover { background: var(--bg); color: var(--accent); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 10px 0; font-size: 12px; font-weight: 600; }
.sidebar-bottom p { font-size: 12px; color: var(--muted); margin: 6px 0 14px; font-weight: 400; }
.source-dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-right: 6px; flex-shrink: 0; }

/* En-tête */
.shell { margin-left: 236px; }
.topbar { height: 72px; background: rgba(247, 248, 244, 0.94); backdrop-filter: saturate(1.4) blur(10px); display: flex; justify-content: space-between; align-items: center; padding: 0 34px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb span { margin: 0 10px; color: #b5bfb7; }
.breadcrumb strong { font-weight: 600; color: var(--ink); }
.user { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); border-radius: 50%; font-weight: 700; }
.user-info { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.link-button { border: none; background: transparent; color: var(--accent); font-weight: 600; padding: 12px 4px; min-height: 44px; }
.link-button:hover { color: var(--accent-dark); text-decoration: underline; }

main { max-width: 1680px; padding: 34px; margin: 0 auto; }
.eyebrow { display: block; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 8px; text-transform: uppercase; }
.page-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 18px; }
.page-heading p { color: var(--muted); margin-top: 8px; }

/* Boutons et champs */
.button { border: 2px solid var(--line); border-radius: 999px; min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 650; padding: 8px 18px; transition: background-color 0.15s ease, border-color 0.15s ease; }
.button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--white); min-height: 50px; padding: 10px 24px; font-size: 15px; }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }
select, input { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--white); color: var(--ink); padding: 9px 12px; font-size: 14px; min-width: 0; max-width: 100%; }
.filterbar { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.location-filter, .period-filter { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-small); color: var(--muted); }
.location-filter { min-width: 260px; max-width: 50%; }
.filterbar select { border: 0; background: transparent; padding-left: 0; }
.sync-info { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.text-link { font-size: 13px; color: var(--accent); font-weight: 600; }
.text-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* Indicateurs */
.business-strip { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.business-strip h2 { font-size: 21px; }
.business-strip p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; box-shadow: var(--shadow-small); }
.kpi.highlight { background: var(--accent-soft); border-color: #c6dfcf; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-label .icon { color: var(--accent); width: 18px; height: 18px; }
.kpi strong { display: block; font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.25; margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.kpi.highlight strong { color: var(--accent-dark); }
.kpi small { font-size: 12px; color: var(--muted); display: block; }
.kpi .stars { font-size: 14px; letter-spacing: 1px; color: var(--gold); margin-left: 10px; vertical-align: middle; }

/* Panneaux et graphiques */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: var(--shadow-small); }
.chart-grid, .reputation-grid, .details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-grid { grid-template-columns: 1.18fr 1fr; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tag { font-size: 10px; letter-spacing: 0.06em; color: var(--accent-dark); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
.panel-caption { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.footnote { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 14px; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: inherit; font-size: 11px; fill: var(--muted); }
.chart-tip { font-size: 12px; color: var(--muted); min-height: 20px; margin-top: 4px; }
.chart-tip.active { color: var(--ink); }
.data-table-toggle { margin-top: 4px; font-size: 12px; color: var(--muted); }
summary { min-height: 44px; display: list-item; align-content: center; font-size: 13px; font-weight: 600; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { max-height: 290px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius-small); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.action-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -2px 0 12px; }
.action-totals strong { font-size: 24px; display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.action-totals span { font-size: 12px; color: var(--muted); }
.action-totals > div + div { border-left: 1px solid var(--line); padding-left: 15px; }

/* Réputation */
.rating-body { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 20px; margin: 22px 0; }
.rating-overall { text-align: center; }
.rating-overall strong { font-size: 52px; line-height: 1.15; font-weight: 750; letter-spacing: -0.04em; display: block; }
.stars { color: var(--gold); letter-spacing: 2px; }
.rating-overall p { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rating-row { display: flex; align-items: center; gap: 9px; font-size: 12px; margin: 10px 0; }
.rating-label { width: 28px; white-space: nowrap; }
.rating-row .bar { height: 8px; flex: 1; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.rating-row .bar span { display: block; height: 100%; background: var(--gold-bar); border-radius: 4px; }
.rating-row .num { width: 30px; color: var(--muted); }
.reply-stats { border-top: 1px solid var(--line); padding-top: 14px; display: flex; gap: 20px; justify-content: space-between; font-size: 12px; color: var(--muted); }
.reply-stats strong { color: var(--ink); font-size: 16px; display: block; }
.number-badge { background: var(--accent-soft); color: var(--accent-dark); font-size: 24px; font-weight: 750; border-radius: 12px; padding: 4px 14px; font-variant-numeric: tabular-nums; }

/* Avis */
.reviews-panel { margin-bottom: 20px; }
.count-label { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 5px; }
.review-toolbar { display: flex; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-small); padding: 0 12px; flex: 1; color: var(--muted); background: var(--white); }
.search-field input { border: 0; flex: 1; padding-left: 0; }
.review-card { padding: 20px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.review-card:last-child { border-bottom: 0; }
.review-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-alt); display: grid; place-items: center; color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.review-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-top time { color: var(--muted); font-size: 12px; }
.review-stars { display: flex; align-items: center; gap: 10px; font-size: 13px; margin: 4px 0 10px; }
.reply-tag { font-size: 11px; color: var(--muted); background: var(--bg-alt); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.reply-tag.answered { color: var(--accent-dark); background: var(--accent-soft); }
.review-comment { font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-more { font-size: 13px; color: var(--muted); }
.review-reply { border-left: 3px solid var(--accent); padding: 8px 14px; margin-top: 14px; background: var(--bg); border-radius: 0 var(--radius-small) var(--radius-small) 0; }
.review-reply strong { font-size: 12px; display: block; margin-bottom: 4px; color: var(--accent-dark); }
.review-reply p { font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* Recherches et fiche */
.keyword-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.keyword-row:last-child { border: 0; }
.keyword-value { font-size: 13px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.keyword-row span:first-child { overflow-wrap: anywhere; }
.profile-row { display: flex; gap: 12px; padding: 10px 0; color: var(--muted); font-size: 13px; }
.profile-row .icon { color: var(--accent); }
.profile-row strong { font-weight: 600; color: var(--ink); display: block; font-size: 14px; }
.profile-row small { display: block; margin-top: 3px; font-size: 12px; }
.profile-row p { white-space: pre-wrap; overflow-wrap: anywhere; }
.hours { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-size: 13px; margin: 10px 0; }
.extra-metrics { border-top: 1px solid var(--line); margin-top: 14px; color: var(--muted); }
.extra-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; }

/* Diagnostic */
.diagnostics { padding: 12px 24px; margin: 28px 0 20px; background: var(--bg); box-shadow: none; }
.diagnostics > summary { font-size: 13px; }
.diagnostics > summary .icon { margin: 0 8px 0 4px; color: var(--accent); }
.health { display: inline-block; margin-left: 12px; font-size: 12px; font-weight: 600; color: var(--accent); }
.health.warning { color: var(--warn); }
.check { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.check .check-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.check.ok .check-dot { background: var(--accent); }
.check div { flex: 1; min-width: 0; }
.check strong { font-weight: 600; }
.check small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; margin-top: 2px; }
.status-code { font-size: 11px; color: var(--muted); white-space: nowrap; }
pre { max-height: 500px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--bg-alt); padding: 16px; border-radius: var(--radius-small); }

/* Messages, états vides, connexion */
.notice { padding: 14px 18px; background: var(--warn-soft); border: 1px solid #ecd8a8; border-radius: var(--radius-small); margin-bottom: 22px; color: var(--warn); font-size: 14px; }
.notice.error { color: var(--danger); background: var(--danger-soft); border-color: #efcdc9; }
.notice.info { color: var(--accent-dark); background: var(--accent-soft); border-color: #c6dfcf; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; background: var(--bg); border-radius: var(--radius-small); }
.empty .icon { display: block; margin: 0 auto 12px; width: 30px; height: 30px; color: var(--accent); }
.login-card { max-width: 760px; margin: 40px auto; background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 56px; box-shadow: 0 18px 50px rgba(28, 48, 35, 0.09); }
.login-card h1 { font-size: 42px; line-height: 1.15; margin: 14px 0 16px; }
.login-card > p { color: var(--ink-soft); font-size: 17px; max-width: 520px; line-height: 1.7; margin-bottom: 26px; }
.login-points { margin: 26px 0 0; padding: 0; list-style: none; color: var(--ink-soft); }
.login-points li { position: relative; padding: 8px 0 8px 28px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.login-points li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 5px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.login-legal { display: block; color: var(--muted); font-size: 13px; max-width: 520px; margin-top: 22px; line-height: 1.6; }
.login-legal a, .app-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
.loading-panel { text-align: center; padding: 100px 20px; color: var(--muted); }
.loading-panel h2 { color: var(--ink); margin: 22px 0 10px; }
.spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-footer { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; line-height: 1.7; margin: 10px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.app-footer span { max-width: 640px; }
.app-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* Responsive */
@media (min-width: 1600px) { main { padding: 40px 50px; } .topbar { padding: 0 50px; } .panel { padding: 26px; } .kpi { padding: 24px; } }
@media (max-width: 1150px) {
  .sidebar { width: 200px; padding: 24px 12px; } .shell { margin-left: 200px; } main { padding: 28px 22px; } .topbar { padding: 0 22px; }
  .nav-link { font-size: 13px; padding: 11px 10px; gap: 9px; } .chart-grid, .reputation-grid, .details-grid { gap: 15px; } .panel { padding: 18px; }
  .kpi-grid { gap: 12px; } .kpi { padding: 16px; } .kpi strong { font-size: 29px; } .user-info { max-width: 130px; }
  .rating-body { grid-template-columns: 110px 1fr; gap: 14px; } .filterbar { flex-wrap: wrap; } .sync-info { width: 100%; justify-content: flex-end; margin-top: -4px; }
}
@media (max-width: 850px) {
  .sidebar { width: 72px; padding: 22px 10px; } .brand { justify-content: center; padding: 0; } .brand-name, .workspace-label, .sidebar-bottom { display: none; }
  .sidebar nav { margin-top: 30px; } .nav-link { font-size: 0; justify-content: center; padding: 12px 0; } .nav-link .icon { width: 21px; height: 21px; }
  .shell { margin-left: 72px; } .chart-grid, .reputation-grid, .details-grid { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { height: 64px; } .user-info { display: none; } .business-strip { align-items: flex-start; } .filterbar .location-filter { max-width: 100%; min-width: 0; flex: 1; }
  .rating-body { grid-template-columns: 160px 1fr; } .page-heading h1 { font-size: 28px; } .app-footer { flex-direction: column; }
}
@media (max-width: 560px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); border-right: 0; }
  .brand-name { display: inline; } .sidebar nav { margin: 0; display: flex; gap: 2px; } .nav-link { margin: 0; padding: 10px; min-height: 44px; } .nav-link .icon { width: 19px; height: 19px; }
  .shell { margin-left: 0; } .topbar { position: static; height: 54px; padding: 0 16px; } .breadcrumb { font-size: 12px; } .breadcrumb span { margin: 0 5px; } .user .avatar { display: none; }
  main { padding: 22px 16px; } .page-heading { gap: 10px; align-items: flex-start; } .page-heading h1 { font-size: 26px; } .page-heading .button { font-size: 0; padding: 10px 12px; }
  .filterbar { gap: 8px; margin-bottom: 20px; } .location-filter { flex-basis: 100% !important; } .period-filter { flex: 1; } .sync-info { width: auto; flex: 1; font-size: 11px; white-space: normal; justify-content: flex-end; margin: 0; }
  .kpi-grid { gap: 10px; } .kpi { padding: 14px; } .kpi strong { font-size: 27px; } .kpi .stars { display: none; } .panel { padding: 16px; }
  .rating-body { grid-template-columns: 100px 1fr; gap: 16px; } .review-toolbar { flex-direction: column; gap: 9px; } .review-toolbar select, .review-toolbar > label { width: 100%; }
  .review-card { grid-template-columns: 30px 1fr; gap: 10px; } .review-avatar { width: 30px; height: 30px; font-size: 11px; } .review-top { align-items: flex-start; }
  .reply-stats { gap: 10px; } .diagnostics { padding: 12px 16px; } .health { margin-left: 0; display: block; }
  .login-card { margin: 16px 0; padding: 28px 22px; } .login-card h1 { font-size: 30px; } .button.primary { width: 100%; }
  input, select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
