/* ===================== REVENUE PAGE — Prestataires de ménage =====================
   Inspiré du dashboard "Espace propriétaire" mais adapté aux agents de ménage.
   Mobile-first, dark mode, fullscreen overlay (z-index 1500). */

.revenue-overlay {
  /* Tokens locaux — palette sage/terracotta/crème (cohérence Owner portal) */
  --sage-50: #f4f6f1;
  --sage-100: #e6ebde;
  --sage-200: #ccd6bd;
  --sage-300: #a8b88f;
  --sage-400: #8a9d6e;
  --sage-500: #6d8255;
  --sage-600: #556843;
  --sage-700: #435236;
  --sage-800: #36422c;

  --terra-50: #fbf2ec;
  --terra-100: #f5e0d2;
  --terra-200: #ecc1a6;
  --terra-300: #e09b75;
  --terra-400: #d4794d;
  --terra-500: #c25e34;
  --terra-600: #a44a26;
  --terra-700: #82391c;

  --cream: #faf7f2;
  --paper: #fffdf9;
  --ink-900: #1f1d1a;
  --ink-700: #3d3a35;
  --ink-500: #6b665e;
  --ink-400: #918b80;
  --ink-300: #b8b2a6;
  --ink-200: #e3ddd1;
  --ink-100: #efeae0;

  --rev-airbnb: #ff5a5f;
  --rev-booking: #003580;
  --rev-direct: #6d8255;

  --rev-shadow-sm: 0 1px 2px rgba(31,29,26,0.04), 0 1px 1px rgba(31,29,26,0.03);
  --rev-shadow-md: 0 4px 16px rgba(31,29,26,0.06), 0 2px 4px rgba(31,29,26,0.04);
  --rev-shadow-lg: 0 12px 40px rgba(31,29,26,0.10), 0 4px 12px rgba(31,29,26,0.05);
  --rev-shadow-xl: 0 24px 64px rgba(31,29,26,0.16), 0 8px 24px rgba(31,29,26,0.08);

  --rev-radius-sm: 6px;
  --rev-radius-md: 10px;
  --rev-radius-lg: 16px;
  --rev-radius-xl: 24px;

  --rev-font-display: "Fraunces", "Source Serif Pro", Georgia, serif;
  --rev-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Police dédiée aux nombres : Inter avec chasse fixe (chiffres tabular).
     Les "1, 2, 3, €" sont lisibles et alignés verticalement entre les lignes. */
  --rev-font-numeric: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--cream);
  color: var(--ink-900);
  font-family: var(--rev-font-body);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  animation: revFadeIn .25s ease;
}
@keyframes revFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.revenue-overlay.closing { animation: revFadeOut .25s ease forwards; }
@keyframes revFadeOut {
  to { opacity: 0; transform: translateY(8px); }
}

.revenue-overlay * { box-sizing: border-box; }
.revenue-overlay button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.revenue-overlay select { font-family: inherit; }

/* ───────── Topbar ───────── */
.rev-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--ink-100);
  padding: max(env(safe-area-inset-top, 12px), 12px) 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.rev-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rev-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--sage-600), var(--sage-500));
  display: grid;
  place-items: center;
  color: var(--cream);
  font-family: var(--rev-font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.rev-brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25), transparent 50%);
}
.rev-brand-name {
  font-family: var(--rev-font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.rev-brand-sub {
  font-size: 10px;
  color: var(--ink-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rev-agent-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: var(--cream);
  border: 1px solid var(--ink-100);
  border-radius: 999px;
}
.rev-agent-chip-text { display: none; }
.rev-refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--ink-100);
  color: var(--ink-700);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.rev-refresh-btn:hover { background: var(--sage-50); color: var(--sage-700); border-color: var(--sage-300); }
.rev-refresh-btn:active { transform: scale(.94); }
.rev-refresh-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.6s ease; }
.rev-refresh-btn.spinning svg { transform: rotate(360deg); }
.rev-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terra-300), var(--terra-500));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
}

.rev-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(17, 24, 39, .75);
  color: #fff;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.rev-close-btn:hover { background: rgba(0, 0, 0, .85); }
.rev-close-btn:active { transform: scale(.94); }
.rev-close-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Main ───────── */
.rev-main {
  padding: 18px 14px 56px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  flex: 1;
}

.rev-page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}
.rev-page-title {
  font-family: var(--rev-font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  line-height: 1.1;
}
.rev-page-title em {
  font-style: italic;
  color: var(--terra-500);
  font-weight: 400;
}
.rev-page-sub {
  color: var(--ink-500);
  font-size: 13px;
}

/* Filtre logement */
.rev-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-select {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  padding: 9px 36px 9px 14px;
  border-radius: var(--rev-radius-md);
  font-size: 13px;
  color: var(--ink-900);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b665e' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  min-width: 0;
}
.rev-select:hover { border-color: var(--ink-200); }
.rev-select:focus { outline: none; border-color: var(--sage-500); box-shadow: 0 0 0 3px var(--sage-100); }

/* ───────── KPIs ───────── */
.rev-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.rev-kpi {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.rev-kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--rev-shadow-md);
  border-color: var(--ink-200);
}
.rev-kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, var(--sage-400), transparent);
  opacity: 0.6;
}
.rev-kpi:nth-child(3)::before {
  background: linear-gradient(90deg, var(--terra-400), transparent);
}
.rev-kpi-label {
  font-size: 10.5px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 6px 8px;
}
.rev-kpi-label > span:not(.rev-kpi-icon) {
  min-width: 0;
  line-height: 1.25;
  word-break: normal;
  align-self: center;
}
/* Sur les KPIs cliquables, le titre utilise toute la 2e colonne sous l'icône
   pour éviter d'être tronqué par la chevron, qui flotte en absolu top-right. */
.rev-kpi-clickable .rev-kpi-label > span:not(.rev-kpi-icon) {
  padding-right: 22px;
}
.rev-kpi-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--sage-100);
  color: var(--sage-700);
  flex-shrink: 0;
}
@media (max-width: 599px) {
  .rev-kpi-icon { width: 20px; height: 20px; border-radius: 6px; }
  .rev-kpi-icon svg { width: 12px; height: 12px; }
  .rev-kpi-label { font-size: 10px; gap: 6px; }
  .rev-kpi-clickable .rev-kpi-label { padding-right: 22px; }
  .rev-kpi-chev { width: 18px; height: 18px; top: 10px; right: 10px; }
  .rev-kpi-chev svg { width: 11px; height: 11px; }
}
.rev-kpi-icon.terra { background: var(--terra-100); color: var(--terra-600); }
.rev-kpi-icon.ink { background: var(--ink-100); color: var(--ink-700); }
.rev-kpi-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.rev-kpi-value {
  font-family: var(--rev-font-numeric);
  font-size: 24px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.025em;
  margin-top: 12px;
  line-height: 1;
}
.rev-kpi-value.money { font-size: 22px; }
.rev-kpi-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-500);
  line-height: 1.45;
}
.rev-kpi-compare {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--ink-400);
  font-style: italic;
}

/* KPI cliquable (Rémunération du jour) */
.rev-kpi-clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rev-kpi-clickable:hover {
  border-color: var(--sage-300);
  transform: translateY(-2px);
  box-shadow: var(--rev-shadow-md);
}
.rev-kpi-clickable:focus-visible {
  outline: 2px solid var(--sage-500);
  outline-offset: 2px;
}
.rev-kpi-chev {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink-300);
  background: var(--cream);
  border-radius: 50%;
  transition: transform 0.18s, color 0.15s, background 0.15s;
}
.rev-kpi-chev svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rev-kpi-clickable:hover .rev-kpi-chev {
  transform: translateX(2px);
  color: var(--sage-700);
}

/* "Rémunération du jour" modal centré */
.rev-today-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31,29,26,0.42);
  backdrop-filter: blur(2px);
  z-index: 1700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.rev-today-overlay.open { opacity: 1; pointer-events: auto; }

.rev-today-modal {
  position: fixed;
  z-index: 1701;
  background: var(--paper);
  border-radius: var(--rev-radius-lg);
  box-shadow: var(--rev-shadow-xl);
  display: flex;
  flex-direction: column;
  /* Mobile : full-width feuille du bas */
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 88vh;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(.32,.72,.16,1), opacity 0.22s;
  overflow: hidden;
}
.rev-today-modal.open { transform: translateY(0); opacity: 1; }

.rev-today-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rev-today-head-text { min-width: 0; }
.rev-today-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  font-weight: 500;
}
.rev-today-title {
  font-family: var(--rev-font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 4px 0 8px;
  line-height: 1.1;
}
.rev-today-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.rev-today-amount {
  font-family: var(--rev-font-numeric);
  font-size: 26px;
  font-weight: 700;
  color: var(--sage-700);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.02em;
}
.rev-today-count {
  font-size: 12px;
  color: var(--ink-500);
}
.rev-today-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.rev-today-close:hover { background: var(--ink-100); color: var(--ink-900); }
.rev-today-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rev-today-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  -webkit-overflow-scrolling: touch;
}
.rev-today-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rev-today-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-md);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rev-today-row:hover {
  border-color: var(--sage-300);
  transform: translateY(-1px);
  box-shadow: var(--rev-shadow-sm);
}
.rev-today-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--sage-100);
  color: var(--sage-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rev-today-row-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Badge date affiché sur les lignes du modal mois (showDate=true) */
.rev-today-row-date {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.rev-today-row-date-day {
  font-family: var(--rev-font-numeric);
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  color: var(--ink-900);
}
.rev-today-row-date-month {
  font-size: 8px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.rev-today-row-text { min-width: 0; }
.rev-today-row-room {
  font-family: var(--rev-font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-today-row-guest {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-today-row-amount {
  font-family: var(--rev-font-numeric);
  font-size: 15px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  color: var(--sage-700);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Tablet+ : modal centré largeur fixe */
@media (min-width: 600px) {
  .rev-today-modal {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, calc(-50% + 16px));
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
  }
  .rev-today-modal.open {
    transform: translate(-50%, -50%);
  }
  .rev-today-row { grid-template-columns: 44px 1fr auto auto; }
}

/* Variation badge (vs N-1 ou mois précédent à la même date) */
.rev-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 8px;
  vertical-align: 4px;
  font-family: var(--rev-font-numeric);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0;
}
.rev-trend.up { background: var(--sage-100); color: var(--sage-700); }
.rev-trend.down { background: var(--terra-100); color: var(--terra-600); }
.rev-trend svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── Forecast strip ───────── */
.rev-forecast-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.rev-forecast-title {
  font-family: var(--rev-font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
.rev-forecast-sub {
  font-size: 11px;
  color: var(--ink-500);
}
.rev-forecast-wrap {
  margin-bottom: 24px;
}
.rev-forecast {
  display: grid;
  grid-template-columns: repeat(6, 80%);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -14px 8px;
  padding: 4px 14px 12px;
  -webkit-overflow-scrolling: touch;
  /* Cache la scrollbar par défaut sur mobile pour un visuel propre */
  scrollbar-width: thin;
}
.rev-forecast::-webkit-scrollbar { height: 4px; }
.rev-forecast::-webkit-scrollbar-track { background: transparent; }
.rev-forecast::-webkit-scrollbar-thumb { background: var(--ink-100); border-radius: 4px; }
.rev-forecast > * { scroll-snap-align: start; }
.rev-forecast-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
}
.rev-forecast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-200);
  transition: background 0.18s, transform 0.18s, width 0.18s;
  cursor: pointer;
}
.rev-forecast-dot:hover { background: var(--ink-300); }
.rev-forecast-dot.active {
  background: var(--sage-500);
  width: 18px;
  border-radius: 999px;
}
.rev-forecast-month {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-md);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rev-forecast-month.best:not(.current) {
  border-color: var(--terra-300);
  background: linear-gradient(180deg, var(--terra-50), var(--paper));
}
.rev-forecast-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--terra-500);
  color: var(--paper);
  border-radius: 999px;
  z-index: 1;
}
.rev-forecast-badge.current {
  background: var(--sage-600);
}
.rev-forecast-month:hover {
  transform: translateY(-2px);
  box-shadow: var(--rev-shadow-md);
  border-color: var(--sage-300);
}
.rev-forecast-month:focus-visible {
  outline: 2px solid var(--sage-500);
  outline-offset: 2px;
}
.rev-forecast-month:active {
  transform: translateY(0);
}
.rev-forecast-month.current {
  border-color: var(--sage-300);
  background: linear-gradient(180deg, var(--sage-50), var(--paper));
}
.rev-forecast-month-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  font-weight: 500;
}
.rev-forecast-month-num {
  font-family: var(--rev-font-numeric);
  font-size: 22px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.rev-forecast-month-meta {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.rev-forecast-vs {
  font-size: 10px;
  color: var(--ink-400);
  font-style: italic;
  margin-top: 2px;
}
.rev-forecast-bar {
  height: 4px;
  background: var(--ink-100);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.rev-forecast-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-400), var(--sage-600));
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ───────── Year chart ───────── */
.rev-yearchart {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}
.rev-yearchart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.rev-yearchart-title-wrap { min-width: 0; flex: 1; }
.rev-yearchart-title {
  font-family: var(--rev-font-display);
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.rev-yearchart-totals {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-500);
  flex-wrap: wrap;
}
.rev-yearchart-totals strong {
  font-family: var(--rev-font-numeric);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rev-yearchart-totals-cy { color: var(--terra-600); }
.rev-yearchart-totals-cy strong { color: var(--terra-700); }
.rev-yearchart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-500);
  flex-shrink: 0;
}
.rev-yearchart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rev-yearchart-stage {
  display: flex;
  gap: 8px;
  position: relative;
}
.rev-yearchart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 38px;
  flex-shrink: 0;
  font-size: 9px;
  color: var(--ink-400);
  font-family: var(--rev-font-numeric);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  text-align: right;
  padding: 4px 0;
}
.rev-yearchart-ytick {
  line-height: 1;
}
.rev-yearchart-canvas {
  flex: 1;
  position: relative;
  min-width: 0;
}
.rev-yearchart-svg {
  width: 100%;
  height: 100px;
  display: block;
  overflow: visible;
}
.rev-yearchart-pt {
  cursor: pointer;
  transition: r 0.15s, opacity 0.15s;
}
.rev-yearchart-pt:hover { r: 5; }
.rev-yearchart-todaylabel {
  position: absolute;
  top: -6px;
  font-size: 9px;
  font-weight: 600;
  color: var(--sage-700);
  background: var(--sage-50);
  padding: 1px 6px;
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
  letter-spacing: 0.04em;
  border: 1px solid var(--sage-200);
}
.rev-yearchart-tooltip {
  position: absolute;
  bottom: 100%;
  transform: translate(-50%, -8px);
  background: var(--ink-900);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: var(--rev-font-numeric);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  line-height: 1.5;
}
.rev-yearchart-tooltip[hidden] { display: none; }
.rev-yearchart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink-900);
}
.rev-yearchart-tooltip-month {
  font-family: var(--rev-font-display);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: capitalize;
}
.rev-yearchart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rev-yearchart-tooltip-row strong {
  font-weight: 700;
  color: white;
}
.rev-yearchart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rev-yearchart-tooltip-dot.cy { background: var(--terra-400); }
.rev-yearchart-tooltip-dot.py {
  background: transparent;
  border: 1.5px dashed var(--ink-300);
  width: 7px;
  height: 7px;
}
.rev-yearchart-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 9px;
  color: var(--ink-400);
  margin-top: 6px;
  margin-left: 46px;
  text-transform: capitalize;
  letter-spacing: 0.04em;
}
.rev-yearchart-months > div {
  text-align: center;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.rev-yearchart-months > div:hover { color: var(--ink-700); }
.rev-yearchart-months .current {
  font-weight: 600;
  color: var(--sage-700);
}

/* ───────── Section + toggle ───────── */
.rev-section {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}
.rev-section-toolbar {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ink-100);
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rev-toggle-group {
  display: inline-flex;
  background: var(--cream);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-md);
  padding: 3px;
  gap: 2px;
}
.rev-toggle-btn {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rev-toggle-btn:hover { color: var(--ink-900); }
.rev-toggle-btn.active {
  background: var(--paper);
  color: var(--ink-900);
  box-shadow: var(--rev-shadow-sm);
}
.rev-toggle-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-section-count {
  font-size: 12px;
  color: var(--ink-500);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.rev-section-count strong {
  font-family: var(--rev-font-numeric);
  font-weight: 700;
  color: var(--sage-700);
  letter-spacing: -0.01em;
}
.rev-section-header-stack {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ink-100);
  gap: 10px;
}
.rev-section-title {
  font-family: var(--rev-font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-section-title svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-section-sub {
  color: var(--ink-500);
  font-size: 12px;
  margin-top: 2px;
}
.rev-section-body { padding: 14px; }

/* ───────── List scope toggle (current+next month / all) ───────── */
.rev-list-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--ink-100);
  flex-wrap: wrap;
}
.rev-list-scope-text {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.rev-list-scope-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rev-list-scope-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--sage-700);
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-md);
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rev-list-scope-btn:hover { background: var(--sage-50); border-color: var(--sage-300); }
.rev-list-scope-btn.rev-list-scope-today {
  background: var(--sage-600);
  color: var(--paper);
  border-color: var(--sage-600);
}
.rev-list-scope-btn.rev-list-scope-today:hover { background: var(--sage-700); border-color: var(--sage-700); }

/* ───────── List view ───────── */
.rev-list {
  display: flex;
  flex-direction: column;
}
.rev-list-month {
  background: var(--cream);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  border-bottom: 1px solid var(--ink-100);
  border-top: 1px solid var(--ink-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rev-list-month-stats {
  font-family: var(--rev-font-numeric);
  font-weight: 600;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-700);
  font-size: 12px;
}
.rev-list-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
  transition: background 0.15s;
}
.rev-list-row:hover { background: var(--cream); }
.rev-list-row:last-child { border-bottom: none; }
.rev-list-row.past { opacity: 0.7; }

/* Bouton "jour" qui se déplie pour montrer les ménages individuels */
.rev-list-day-row {
  display: grid;
  grid-template-columns: 48px 1fr auto 22px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  color: inherit;
}
.rev-list-day-row:hover { background: var(--cream); }
.rev-list-day-row.past { opacity: 0.7; }
.rev-list-day-row.today {
  background: linear-gradient(90deg, var(--sage-50), var(--paper) 80%);
  box-shadow: inset 3px 0 0 var(--sage-500);
  position: relative;
}
.rev-list-day-row.today .rev-list-day-count::after {
  content: "AUJOURD'HUI";
  display: inline-block;
  margin-left: 8px;
  font-size: 9px;
  font-weight: 700;
  color: var(--sage-700);
  background: var(--sage-100);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  vertical-align: 2px;
}
.rev-list-day-row.flash {
  animation: revRowFlash 1.5s ease;
}
@keyframes revRowFlash {
  0% { background: var(--sage-100); box-shadow: inset 3px 0 0 var(--sage-500), 0 0 0 0 var(--sage-300); }
  50% { background: var(--sage-100); box-shadow: inset 3px 0 0 var(--sage-500), 0 0 0 4px rgba(85, 104, 67, 0.18); }
  100% { background: var(--sage-50); box-shadow: inset 3px 0 0 var(--sage-500); }
}
.rev-list-day-text { min-width: 0; }
.rev-list-day-count {
  font-family: var(--rev-font-numeric);
  font-weight: 600;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-size: 14px;
  color: var(--ink-900);
}
.rev-list-day-sub {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}
.rev-list-day-amount { text-align: right; }
.rev-list-day-chev {
  display: grid;
  place-items: center;
  color: var(--ink-400);
  transition: transform 0.2s ease;
}
.rev-list-day-chev svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rev-list-day-row.expanded .rev-list-day-chev { transform: rotate(90deg); }
.rev-list-day-row.expanded { background: var(--cream); }

/* Sous-liste des ménages d'un jour donné (animée à l'ouverture) */
.rev-list-day-items {
  display: none;
  background: var(--cream);
  border-bottom: 1px solid var(--ink-100);
  padding: 4px 14px 10px;
  animation: revDayItemsIn 0.18s ease;
}
.rev-list-day-items.open { display: block; }
@keyframes revDayItemsIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.rev-list-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-md);
  margin-top: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.rev-list-item-row:hover {
  border-color: var(--sage-300);
  transform: translateY(-1px);
}
.rev-list-item-text { min-width: 0; }
.rev-list-item-amount {
  font-family: var(--rev-font-numeric);
  font-size: 15px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  color: var(--sage-700);
  letter-spacing: -0.01em;
}

.rev-list-date {
  text-align: center;
}
.rev-list-date-day {
  font-family: var(--rev-font-numeric);
  font-size: 22px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  line-height: 1;
  letter-spacing: -0.02em;
}
.rev-list-date-month {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  margin-top: 2px;
}
.rev-list-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-list-meta {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-list-amount {
  font-family: var(--rev-font-numeric);
  font-size: 16px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  text-align: right;
  color: var(--sage-700);
  letter-spacing: -0.01em;
}
.rev-list-amount-label {
  font-size: 10px;
  color: var(--ink-500);
  text-align: right;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ───────── Calendar (mois) ───────── */
.rev-cal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-700);
  transition: background 0.15s;
}
.rev-icon-btn:hover { background: var(--ink-100); }
.rev-icon-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-cal-month-label {
  font-family: var(--rev-font-display);
  font-size: 14px;
  font-weight: 500;
  min-width: 130px;
  text-align: center;
  text-transform: capitalize;
}
.rev-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink-100);
  border-left: 1px solid var(--ink-100);
  width: 100%;
}
.rev-cal-dow {
  padding: 6px 2px;
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--cream);
  border-right: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  text-align: center;
}
.rev-cal-cell {
  min-height: 56px;
  padding: 3px;
  border-right: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  position: relative;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rev-cal-cell.muted { background: var(--cream); }
.rev-cal-cell.muted .rev-cal-day-num { color: var(--ink-300); }
.rev-cal-cell.today {
  background: var(--sage-50);
  box-shadow: inset 0 0 0 2px var(--sage-500);
  z-index: 1;
}
.rev-cal-cell.today .rev-cal-day-num {
  background: var(--sage-600);
  color: var(--paper);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
  box-shadow: 0 1px 4px rgba(85, 104, 67, 0.35);
}
.rev-cal-day-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-700);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rev-cal-event {
  background: var(--sage-100);
  color: var(--sage-700);
  font-size: 9px;
  font-weight: 500;
  padding: 1px 3px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 2px;
  line-height: 1.4;
  transition: filter 0.15s;
  min-width: 0;
}
.rev-cal-event > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev-cal-event:hover { filter: brightness(0.95); }
.rev-cal-event-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}
.rev-cal-event.airbnb { background: #ffe1e3; color: #d10b1f; }
.rev-cal-event.booking { background: #dde7f6; color: #003580; }
.rev-cal-event.direct { background: var(--sage-100); color: var(--sage-700); }
.rev-cal-more {
  font-size: 9px;
  color: var(--ink-500);
  font-weight: 500;
  padding: 0 4px;
}

/* ───────── Side panel (détail ménage) ───────── */
.rev-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31,29,26,0.32);
  backdrop-filter: blur(2px);
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.rev-panel-overlay.open { opacity: 1; pointer-events: auto; }
.rev-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--paper);
  z-index: 1601;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.32,.72,.16,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--rev-shadow-xl);
}
.rev-panel.open { transform: translateX(0); }
.rev-panel-header {
  padding: max(env(safe-area-inset-top, 16px), 16px) 18px 14px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rev-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  transition: background 0.15s;
  flex-shrink: 0;
}
.rev-panel-close:hover { background: var(--ink-100); color: var(--ink-900); }
.rev-panel-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}
.rev-panel-pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rev-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.rev-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.rev-pill.airbnb { background: #ffece0; color: #a8390e; }
.rev-pill.airbnb .rev-pill-dot { background: var(--rev-airbnb); }
.rev-pill.booking { background: #e0e9f7; color: #0a3a82; }
.rev-pill.booking .rev-pill-dot { background: var(--rev-booking); }
.rev-pill.direct { background: var(--sage-100); color: var(--sage-700); }
.rev-pill.direct .rev-pill-dot { background: var(--rev-direct); }
.rev-pill-bookid {
  font-size: 11px;
  color: var(--ink-500);
  margin-left: auto;
  font-family: ui-monospace, "SF Mono", monospace;
}
.rev-panel-guest {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.rev-panel-guest-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terra-200), var(--terra-400));
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--rev-font-display);
  font-weight: 500;
  font-size: 18px;
  flex-shrink: 0;
}
.rev-panel-guest-name {
  font-family: var(--rev-font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
  line-height: 1.2;
}
.rev-panel-guest-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-500);
  flex-wrap: wrap;
}
.rev-panel-stay {
  background: var(--cream);
  border-radius: var(--rev-radius-lg);
  padding: 14px 16px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.rev-panel-stay-side { text-align: center; }
.rev-panel-stay-side.left { text-align: left; }
.rev-panel-stay-side.right { text-align: right; }
.rev-panel-stay-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  font-weight: 500;
}
.rev-panel-stay-date {
  font-family: var(--rev-font-numeric);
  font-size: 15px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.rev-panel-stay-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--sage-600);
  font-size: 10px;
  font-weight: 500;
}
.rev-panel-stay-arrow-line {
  height: 1px;
  width: 40px;
  background: var(--sage-300);
  margin: 4px 0;
  position: relative;
}
.rev-panel-stay-arrow-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--sage-500);
  border-top: 1px solid var(--sage-500);
  transform: rotate(45deg);
}
.rev-panel-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  font-weight: 500;
  margin: 20px 0 10px;
}
.rev-panel-room {
  background: var(--cream);
  border-radius: var(--rev-radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rev-panel-room-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--sage-100);
  color: var(--sage-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rev-panel-room-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-panel-room-name {
  font-family: var(--rev-font-display);
  font-size: 16px;
  font-weight: 500;
}
.rev-panel-room-id {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
  font-family: ui-monospace, "SF Mono", monospace;
}
.rev-panel-finance {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--rev-radius-lg);
  padding: 16px 18px;
}
.rev-panel-finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.rev-panel-finance-row + .rev-panel-finance-row {
  border-top: 1px solid var(--ink-100);
}
.rev-panel-finance-key { color: var(--ink-500); }
.rev-panel-finance-val {
  font-family: var(--rev-font-numeric);
  font-weight: 600;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  text-align: right;
  letter-spacing: -0.005em;
}
.rev-panel-finance-net {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--ink-100);
}
.rev-panel-finance-net-label {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.rev-panel-finance-net-val {
  font-family: var(--rev-font-numeric);
  font-size: 28px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  color: var(--sage-700);
  letter-spacing: -0.025em;
}

/* ───────── Skeleton + error + empty ───────── */
@keyframes revShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.rev-sk {
  background: linear-gradient(90deg, var(--ink-100) 0%, var(--ink-200) 50%, var(--ink-100) 100%);
  background-size: 800px 100%;
  animation: revShimmer 1.4s infinite linear;
  border-radius: 6px;
}
.rev-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-500);
}
.rev-empty-illu {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--cream);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sage-500);
}
.rev-empty-illu svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-empty-title {
  font-family: var(--rev-font-display);
  font-size: 17px;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.rev-error-card {
  background: var(--terra-50);
  border: 1px solid var(--terra-200);
  border-radius: var(--rev-radius-lg);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.rev-error-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--terra-100);
  color: var(--terra-600);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rev-error-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rev-error-title {
  font-family: var(--rev-font-display);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}
.rev-error-msg { font-size: 12px; color: var(--ink-700); }
.rev-error-detail {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-500);
  font-family: ui-monospace, "SF Mono", monospace;
  background: rgba(255,255,255,0.6);
  padding: 6px 8px;
  border-radius: 6px;
  word-break: break-all;
}
.rev-btn {
  padding: 9px 16px;
  border-radius: var(--rev-radius-md);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rev-btn-primary {
  background: var(--sage-600);
  color: var(--paper);
}
.rev-btn-primary:hover { background: var(--sage-700); }
.rev-btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border: 1px solid var(--ink-100);
}
.rev-btn-ghost:hover { background: var(--cream); }
.rev-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Tablet & desktop bumps ───────── */
@media (min-width: 600px) {
  .revenue-overlay { font-size: 14px; }
  .rev-main { padding: 24px 22px 56px; }
  .rev-page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
  }
  .rev-page-title { font-size: 32px; }
  .rev-agent-chip { padding: 6px 6px 6px 14px; }
  .rev-agent-chip-text { display: block; }
  .rev-agent-chip-name { font-weight: 500; font-size: 13px; line-height: 1.2; }
  .rev-agent-chip-sub { font-size: 11px; color: var(--ink-500); }
  .rev-brand-sub { font-size: 11px; }
  .rev-brand-name { font-size: 17px; }

  .rev-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 26px;
  }
  .rev-kpi { padding: 18px 20px; }
  .rev-kpi-label { font-size: 12px; }
  .rev-kpi-value { font-size: 30px; }
  .rev-kpi-value.money { font-size: 26px; }
  .rev-kpi-meta { font-size: 12px; }

  .rev-forecast {
    grid-template-columns: repeat(6, 1fr);
    overflow-x: visible;
    margin: 0 0 28px;
    padding: 0;
  }
  .rev-cal-cell { min-height: 88px; padding: 6px; }
  .rev-cal-day-num { font-size: 12px; }
  .rev-cal-event { font-size: 10px; padding: 2px 5px; }

  .rev-yearchart-svg { height: 110px; }

  .rev-list-row {
    grid-template-columns: 56px 1.2fr 1fr 90px 110px;
    gap: 14px;
    padding: 14px 18px;
  }
  .rev-list-row .rev-list-room-cell { display: block; font-size: 13px; }
  .rev-list-row .rev-list-pill-cell { display: flex; }
  .rev-list-row .rev-list-amount-cell { display: block; }
}
@media (min-width: 600px) {
  .rev-list-room-cell,
  .rev-list-pill-cell,
  .rev-list-amount-cell { display: none; }
}
@media (max-width: 599px) {
  .rev-list-room-cell,
  .rev-list-pill-cell,
  .rev-list-amount-cell { display: none !important; }
}

/* ───────── Dark mode ───────── */
@media (prefers-color-scheme: dark) {
  .revenue-overlay {
    --cream: #15171c;
    --paper: #1c1f25;
    --ink-900: #f4f3ee;
    --ink-700: #d6d3cc;
    --ink-500: #9a958a;
    --ink-400: #7a756a;
    --ink-300: #4d4a44;
    --ink-200: #2c2e34;
    --ink-100: #24262c;
    --sage-50: #1f2620;
    --sage-100: #29332a;
    --sage-300: #6d8255;
    --terra-50: #2a1f1a;
    --terra-100: #3a2a22;
    --terra-200: #623a26;

    background: var(--cream);
    color: var(--ink-900);
  }
  .revenue-overlay .rev-topbar { background: var(--paper); }
  .revenue-overlay .rev-kpi,
  .revenue-overlay .rev-yearchart,
  .revenue-overlay .rev-section,
  .revenue-overlay .rev-forecast-month,
  .revenue-overlay .rev-panel,
  .revenue-overlay .rev-panel-finance { background: var(--paper); }
  .revenue-overlay .rev-cal-cell { background: var(--paper); }
  .revenue-overlay .rev-cal-cell.muted { background: var(--cream); }
  .revenue-overlay .rev-cal-cell.today { background: rgba(85, 104, 67, 0.18); }
  .revenue-overlay .rev-cal-event.direct { background: rgba(85, 104, 67, 0.30); color: #cad8b4; }
  .revenue-overlay .rev-cal-event.airbnb { background: rgba(255, 90, 95, 0.18); color: #ff9da0; }
  .revenue-overlay .rev-cal-event.booking { background: rgba(0, 53, 128, 0.30); color: #9bb6e0; }
  .revenue-overlay .rev-list-month,
  .revenue-overlay .rev-panel-stay,
  .revenue-overlay .rev-panel-room { background: rgba(255,255,255,0.03); }
  .revenue-overlay .rev-trend.up { background: rgba(85, 104, 67, 0.30); color: #cad8b4; }
  .revenue-overlay .rev-trend.down { background: rgba(196, 94, 52, 0.20); color: #f0a382; }
  .revenue-overlay .rev-today-modal { background: var(--paper); }
  .revenue-overlay .rev-today-row { background: rgba(255,255,255,0.03); }
  .revenue-overlay .rev-today-amount,
  .revenue-overlay .rev-today-row-amount { color: #b6c997; }
  .revenue-overlay .rev-pill.direct { background: rgba(85, 104, 67, 0.30); color: #cad8b4; }
  .revenue-overlay .rev-pill.airbnb { background: rgba(255, 90, 95, 0.18); color: #ff9da0; }
  .revenue-overlay .rev-pill.booking { background: rgba(0, 53, 128, 0.30); color: #9bb6e0; }
  .revenue-overlay .rev-error-card { background: rgba(196, 94, 52, 0.10); border-color: rgba(196, 94, 52, 0.30); }
  .revenue-overlay .rev-panel-finance-net-val,
  .revenue-overlay .rev-list-amount { color: #b6c997; }
  .revenue-overlay .rev-cal-dow { background: var(--cream); }
}
