:root {
  --fond: #f3efe9;
  --fond-deep: #ebe4db;
  --marron: #9b6e4d;
  --marron-clair: #d1a66e;
  --logo: #5c4f42;
  --green: #549e4d;
  --green-dark: #3f7a3a;
  --grey: #7a7e89;
  --grey-soft: #a39e97;
  --red: #c62828;
  --black: #1c1916;
  --card: #fffcf8;
  --line: rgba(92, 79, 66, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(28, 25, 22, 0.07);
  --shadow-soft: 0 2px 0 rgba(255, 255, 255, 0.55) inset, 0 10px 28px rgba(28, 25, 22, 0.05);
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--fond);
  color: var(--black);
  min-height: 100vh;
  line-height: 1.45;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(209, 166, 110, 0.38), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(84, 158, 77, 0.18), transparent 50%),
    linear-gradient(180deg, #f7f2eb 0%, var(--fond) 40%, var(--fond-deep) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35em;
  line-height: 1;
  min-width: 0;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--logo);
}

.brand-product {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--grey);
  text-transform: lowercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.75);
  border: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--logo);
  font-weight: 600;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(84, 158, 77, 0.28);
}
.btn-primary.is-busy {
  background: linear-gradient(135deg, var(--marron-clair), var(--marron));
  box-shadow: none;
}
.btn-ghost {
  background: rgba(255, 252, 248, 0.7);
  border-color: var(--line);
  color: var(--logo);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 28px 14px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 252, 248, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.period-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(92, 79, 66, 0.06);
}

.period-btn {
  border: 0;
  background: transparent;
  color: var(--grey);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.period-btn:hover { color: var(--logo); }
.period-btn.is-active {
  background: #fff;
  color: var(--logo);
  box-shadow: 0 4px 14px rgba(28, 25, 22, 0.08);
}
.period-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cache-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--grey);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(92, 79, 66, 0.05);
  max-width: min(420px, 100%);
  line-height: 1.35;
}
.cache-line strong {
  color: var(--logo);
  font-weight: 800;
  margin-right: 4px;
}
.cache-stale {
  color: var(--marron);
}

.sync-banner {
  margin: 0 28px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(155, 110, 77, 0.12), rgba(84, 158, 77, 0.1));
  border: 1px solid rgba(155, 110, 77, 0.22);
  overflow: hidden;
}
.sync-banner-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}
.sync-copy strong {
  display: block;
  color: var(--logo);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.sync-copy p {
  margin: 0;
  color: var(--grey);
  font-size: 0.86rem;
}
.sync-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.sync-pct {
  font-weight: 800;
  color: var(--logo);
  font-variant-numeric: tabular-nums;
  min-width: 3.2rem;
  text-align: right;
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--marron-clair), var(--green));
  transition: width .25s ease;
}
.progress-fill.is-running {
  background-size: 28px 28px;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.28) 0 8px,
    transparent 8px 16px
  );
  animation: progress-stripe .7s linear infinite;
}
.progress-fill.is-indeterminate {
  width: 40% !important;
  animation: progress-stripe .7s linear infinite, progress-slide 1.4s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { margin-left: 0; }
  50% { margin-left: 60%; }
  100% { margin-left: 0; }
}

.error-banner {
  margin: 0 28px 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: var(--red);
  border: 1px solid rgba(198, 40, 40, 0.2);
  font-weight: 600;
}

.section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 28px 8px;
}
.section-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--grey);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.section-tab.is-active {
  background: rgba(255, 252, 248, 0.9);
  border-color: var(--line);
  color: var(--logo);
  box-shadow: var(--shadow-soft);
}

.layout {
  padding: 12px 28px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.section-block[hidden] { display: none !important; }

.section-intro {
  margin: 0;
  color: var(--grey);
  font-size: 0.92rem;
  max-width: 62ch;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px 18px 16px 22px;
  overflow: hidden;
  min-height: 128px;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--marron-clair), var(--green));
}
.kpi-card .label {
  color: var(--grey);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.kpi-card .value {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 10px;
  color: var(--logo);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi-card .hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--grey-soft);
  line-height: 1.35;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.grid-2 > .panel {
  height: 100%;
}

.report-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-group-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--marron);
}
.report-group + .report-group {
  margin-top: 8px;
}
.section-block > .panel,
.report-group > .panel {
  width: 100%;
}
.group-hint {
  margin: -2px 0 4px;
  color: var(--grey);
  font-size: 0.86rem;
  line-height: 1.4;
  max-width: 70ch;
}
.section-note {
  margin: 4px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: rgba(92, 79, 66, 0.03);
  color: var(--grey-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
}
.panel-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(92, 79, 66, 0.03);
}
.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.18rem;
  color: var(--logo);
  letter-spacing: -0.02em;
}
.panel .def {
  margin: 8px 0 0;
  color: var(--grey);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 72ch;
}
.panel-meta {
  display: none;
}
.panel-body {
  padding: 16px 22px 18px;
  overflow-x: auto;
}
.panel-body .muted { margin: 4px 0 12px; }

.panel-highlight .panel-body {
  padding-top: 18px;
  padding-bottom: 20px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(92, 79, 66, 0.04);
  border: 1px solid var(--line);
}
.stat-card .stat-value {
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--logo);
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--grey);
  letter-spacing: 0.02em;
}
.stat-card .stat-hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--grey-soft);
}

.level-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.level-card {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius-sm);
  background: rgba(92, 79, 66, 0.04);
  border: 1px solid var(--line);
}
.level-card .lvl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey);
  font-weight: 700;
}
.level-card .n {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--logo);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid #efe7de;
  vertical-align: middle;
}
th {
  color: var(--grey);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(243, 239, 233, 0.55); }

.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sort:hover { color: var(--logo); }
.th-sort.is-sorted { color: var(--logo); }
.th-sort-label { margin-right: 6px; }
.th-sort-icon {
  display: inline-block;
  font-size: 0.7rem;
  opacity: 0.45;
  vertical-align: 1px;
}
.th-sort.is-sorted .th-sort-icon {
  opacity: 1;
  color: var(--marron);
}

.dt { display: flex; flex-direction: column; gap: 12px; }
.dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dt-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}
.dt-search-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dt-search {
  flex: 1;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--black);
}
.dt-search:focus {
  outline: 2px solid rgba(84, 158, 77, 0.35);
  outline-offset: 1px;
}
.dt-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--grey-soft);
  white-space: nowrap;
}
.dt-table-wrap { overflow-x: auto; }
.dt-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.dt-pager-info {
  font-size: 0.82rem;
  color: var(--grey);
  font-weight: 600;
}
.dt-pager-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dt-page-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--logo);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.dt-page-btn:hover:not(:disabled) {
  border-color: var(--marron-clair);
  background: rgba(255, 252, 248, 0.95);
}
.dt-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dt-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--grey);
  font-weight: 600;
}
.dt-page-input {
  width: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  color: var(--logo);
  background: #fff;
}
.dt-page-input:focus {
  outline: 2px solid rgba(84, 158, 77, 0.35);
  outline-offset: 1px;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #efe8e1;
  overflow: hidden;
  margin-top: 6px;
  min-width: 88px;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--marron-clair), var(--green));
}
.metric-with-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.muted { color: var(--grey); font-size: 0.85rem; }

.skeleton-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fade-in .2s ease;
}
.skeleton-label {
  margin: 0;
  font-weight: 700;
  color: var(--logo);
  font-size: 0.95rem;
}
.sk {
  background: linear-gradient(90deg, #ebe4db 0%, #f7f2eb 45%, #ebe4db 90%);
  background-size: 200% 100%;
  animation: shimmer 1.15s linear infinite;
  border-radius: 10px;
}
.sk-kpi {
  min-height: 128px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.sk-panel {
  min-height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.sk-line {
  height: 14px;
  width: 60%;
  margin-bottom: 10px;
}
.sk-line.short { width: 38%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes fade-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.empty-state {
  margin: 40px auto;
  max-width: 520px;
  text-align: center;
  padding: 36px 28px;
  border-radius: 24px;
  background: rgba(255, 252, 248, 0.85);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.empty-state h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  color: var(--logo);
}
.empty-state p {
  margin: 0 0 22px;
  color: var(--grey);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(209,166,110,0.35), transparent 40%),
    radial-gradient(circle at bottom right, rgba(84,158,77,0.2), transparent 35%),
    var(--fond);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.login-logo {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 0 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.login-card h1 { margin: 0 0 8px; color: var(--logo); font-family: var(--display); }
.login-brand {
  margin: 0 0 24px !important;
}
.login-brand .brand-name {
  font-size: 1.55rem;
}
.login-brand .brand-product {
  font-size: 1rem;
}
.login-google {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
}
.login-card p { color: var(--grey); margin: 0 0 24px; line-height: 1.45; }
#error {
  display: none;
  background: #fdecea;
  color: var(--red);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.btn-logout .btn-label-short { display: none; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sync-banner-inner { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .topbar {
    padding: 14px 14px 10px;
    gap: 10px;
    align-items: flex-start;
  }
  .brand { gap: 10px; min-width: 0; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand-name { font-size: 1.2rem; }
  .brand-product { font-size: 0.88rem; }

  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
  }
  .user-chip {
    display: none;
  }
  .btn-logout {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .btn-logout .btn-label-full { display: none; }
  .btn-logout .btn-label-short { display: inline; }

  .toolbar,
  .sync-banner,
  .error-banner {
    margin-left: 12px;
    margin-right: 12px;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
  }
  .period-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    border-radius: 14px;
  }
  .period-group::-webkit-scrollbar { display: none; }
  .period-btn {
    flex: 1 0 auto;
    padding: 10px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cache-pill {
    max-width: 100%;
    font-size: 0.76rem;
    padding: 10px 12px;
  }
  .toolbar-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .section-nav {
    padding: 0 12px 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .layout {
    margin-left: 12px;
    margin-right: 12px;
    padding: 8px 0 40px;
    gap: 18px;
  }

  .kpi-grid,
  .grid-2,
  .level-row,
  .stat-row {
    grid-template-columns: 1fr;
  }
  .kpi-card {
    min-height: 0;
    padding: 14px 14px 14px 18px;
  }
  .kpi-card .value { font-size: 1.65rem; }

  .panel-head,
  .panel-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .panel-head { padding-top: 14px; padding-bottom: 12px; }
  .panel h2 { font-size: 1.08rem; }
  .panel .def { font-size: 0.8rem; }

  .dt-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .dt-search-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    width: 100%;
  }
  .dt-search {
    max-width: none;
    width: 100%;
    font-size: 1rem; /* avoid iOS zoom */
    padding: 11px 12px;
  }
  .dt-count {
    align-self: flex-end;
  }

  /* Card list instead of cramped table */
  .dt-table-wrap {
    overflow: visible;
  }
  .dt-table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .dt-table-wrap thead {
    display: none;
  }
  .dt-table-wrap tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .dt-table-wrap tr {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(92, 79, 66, 0.025);
  }
  .dt-table-wrap tr:hover td {
    background: transparent;
  }
  .dt-table-wrap td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) 1fr;
    gap: 8px 12px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(92, 79, 66, 0.08);
    font-size: 0.9rem;
  }
  .dt-table-wrap td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .dt-table-wrap td:first-child {
    padding-top: 0;
  }
  .dt-table-wrap td[data-label="Contenu"],
  .dt-table-wrap td[data-label="Badge"] {
    display: block;
    font-weight: 800;
    color: var(--logo);
    font-size: 0.95rem;
    line-height: 1.3;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--line);
  }
  .dt-table-wrap td[data-label="Contenu"]::before,
  .dt-table-wrap td[data-label="Badge"]::before {
    display: none;
  }
  .dt-table-wrap td[colspan] {
    display: block;
  }
  .dt-table-wrap td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey);
    padding-top: 3px;
  }
  .dt-table-wrap td .bar {
    min-width: 0;
    width: 100%;
    margin-top: 4px;
  }

  .dt-pager {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dt-pager-nav {
    justify-content: space-between;
  }
  .level-card .n { font-size: 1.45rem; }
  .stat-card .stat-value { font-size: 1.55rem; }
}

@media (max-width: 420px) {
  .period-btn {
    padding: 9px 10px;
    font-size: 0.78rem;
  }
}
