@font-face {
  font-family: "Sora";
  src: url("./assets/fonts/sora-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("./assets/fonts/sora-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("./assets/fonts/sora-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("./assets/fonts/sora-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("./assets/fonts/sora-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --rf-font: "Sora", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rf-line-subtle: color-mix(in srgb, var(--text) 8%, transparent);
  --rf-surface-soft: color-mix(in srgb, var(--panel) 72%, var(--bg));
  --rf-surface-raised: color-mix(in srgb, var(--panel2) 82%, var(--bg));
  --rf-radius-xs: 8px;
  --rf-radius-sm: 11px;
  --rf-radius-md: 15px;
  --rf-income: #32d583;
  --rf-services: #4d9cff;
  --rf-attendance: #a779ff;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--rf-font) !important;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* O relógio e os indicadores antigos continuam removidos; a saudação volta como barra útil. */
.main > #weekChart {
  display: none !important;
}

.main {
  padding-top: 18px !important;
}

.main > .top.rf-app-header {
  position: sticky !important;
  top: 0;
  z-index: 48;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 58px !important;
  margin: -4px 0 14px !important;
  padding: 7px 0 10px !important;
  border-bottom: 1px solid var(--rf-line-subtle) !important;
  background: color-mix(in srgb, var(--bg) 90%, transparent) !important;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.rf-app-header .hello {
  min-width: 0;
}

.rf-app-header .hello h2 {
  overflow: hidden;
  margin: 0 !important;
  color: var(--text) !important;
  font-family: var(--rf-font) !important;
  font-size: clamp(16px, 1.45vw, 21px) !important;
  font-weight: 800 !important;
  line-height: 1.16 !important;
  letter-spacing: -0.035em !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-app-header .hello p,
.rf-app-header .chips {
  display: none !important;
}

.rf-menu-toggle {
  position: relative;
  isolation: isolate;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent) !important;
  border-radius: 14px !important;
  color: var(--text) !important;
  background:
    radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--gold) 15%, transparent), transparent 48%),
    color-mix(in srgb, var(--panel2) 82%, var(--bg)) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.rf-menu-toggle:hover {
  border-color: color-mix(in srgb, var(--gold) 45%, transparent) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22), 0 0 0 3px color-mix(in srgb, var(--gold) 7%, transparent);
  transform: translateY(-1px);
}

.rf-menu-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 36%, transparent) !important;
  outline-offset: 2px;
}

.rf-menu-glyph {
  position: relative;
  width: 23px;
  height: 19px;
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  opacity: .94;
}

.rf-menu-rail {
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 5px;
  border-radius: 3px;
  background: var(--gold);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 42%, transparent);
  transition: width .22s ease, inset .22s ease;
}

.rf-menu-focus {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transition: transform .22s ease, opacity .2s ease;
}

.rf-menu-toggle.is-open {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent) !important;
  background: color-mix(in srgb, var(--gold) 12%, var(--panel2)) !important;
}

.rf-menu-toggle.is-open .rf-menu-rail {
  inset: 3px auto 3px 3px;
  width: 13px;
}

.rf-menu-toggle.is-open .rf-menu-focus {
  opacity: 0;
  transform: translateX(5px);
}

@media (max-width: 900px) {
  .main {
    padding-top: 12px !important;
  }

  .main > .top.rf-app-header {
    margin-top: -2px !important;
    padding-top: 5px !important;
    background: color-mix(in srgb, var(--bg) 94%, transparent) !important;
  }

  .rf-app-header .hello h2 {
    font-size: clamp(16px, 5vw, 19px) !important;
  }
}

/* Evita que o estado hidden do seletor seja sobrescrito por display:flex. */
.rf-customer-selected[hidden],
.rf-customer-search[hidden] {
  display: none !important;
}

.rf-customer-selector {
  gap: 6px !important;
}

.rf-customer-selected {
  min-height: 48px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-left: 3px solid var(--green) !important;
  border-radius: var(--rf-radius-sm) !important;
  background: color-mix(in srgb, var(--green) 8%, var(--panel)) !important;
}

.rf-customer-selected button {
  min-height: 32px !important;
  border-color: var(--rf-line-subtle) !important;
}

.rf-customer-status {
  min-height: 0 !important;
  margin-top: 4px;
  font-size: 10px !important;
}

.rf-customer-results:empty,
.rf-customer-error:empty {
  display: none;
}

.rf-customer-result {
  min-height: 48px !important;
  border-color: var(--rf-line-subtle) !important;
  background: transparent !important;
}

.rf-customer-result + .rf-customer-result {
  border-top: 0 !important;
}

/* Navegação: somente um grupo aberto e visual sem caixas pesadas. */
.rf-nav-group {
  border-bottom-color: var(--rf-line-subtle) !important;
}

.rf-nav-group > summary {
  border-radius: var(--rf-radius-xs);
}

.rf-nav-group > summary:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.nav button {
  border-color: transparent !important;
}

.nav button.active {
  border-color: transparent !important;
  border-radius: var(--rf-radius-xs) !important;
}

.nav button[data-view="clientes"] {
  gap: 0 !important;
}

.nav button[data-view="clientes"] .ico {
  display: none !important;
}

/* Dashboard high-end: informação e gráfico, sem coleção de cards. */
.rf-he-dashboard {
  display: grid;
  gap: 14px;
  max-width: 1480px;
  margin: 0 auto;
}

.rf-he-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rf-line-subtle);
}

.rf-he-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rf-he-toolbar h3 {
  margin: 0;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.rf-he-health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.rf-he-health::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.rf-he-health.warn {
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 10%, transparent);
}

.rf-he-health.bad {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

.rf-he-health.neutral {
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.rf-he-period {
  position: relative;
}

.rf-he-period > summary {
  list-style: none;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--rf-line-subtle);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.rf-he-period > summary::-webkit-details-marker {
  display: none;
}

.rf-he-period > summary::after {
  content: "⌄";
  color: var(--muted);
}

.rf-he-period-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  width: 190px;
  padding: 7px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--rf-line-subtle);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .26);
}

.rf-he-period-menu button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 10px;
}

.rf-he-period-menu button:hover,
.rf-he-period-menu button.active {
  color: var(--text);
  background: var(--surface);
}

.rf-he-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--rf-surface-soft);
  border-radius: var(--rf-radius-md);
  overflow: hidden;
}

.rf-he-kpi {
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  border-right: 1px solid var(--rf-line-subtle);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.rf-he-kpi:last-child {
  border-right: 0;
}

.rf-he-kpi span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rf-he-kpi strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: clamp(17px, 2vw, 25px);
  font-weight: 700;
  letter-spacing: -.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-he-kpi small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-he-analytics {
  padding: 16px 18px 13px;
  border: 0;
  border-radius: var(--rf-radius-md);
  background:
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--rf-attendance) 8%, transparent), transparent 28%),
    var(--rf-surface-raised);
  overflow: hidden;
}

.rf-he-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rf-he-section-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.rf-he-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.rf-triple-chart {
  display: grid;
  min-width: 0;
}

.rf-chart-floor {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: stretch;
  min-height: 92px;
  border-top: 1px solid var(--rf-line-subtle);
}

.rf-chart-floor:first-child {
  border-top: 0;
}

.rf-chart-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-right: 14px;
}

.rf-chart-label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.rf-chart-label strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.035em;
}

.rf-chart-floor svg {
  width: 100%;
  height: 92px;
  overflow: visible;
}

.rf-chart-grid {
  stroke: var(--rf-line-subtle);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.rf-chart-line {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 2.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--series-color) 22%, transparent));
  animation: rfChartReveal .7s ease both;
}

.rf-chart-area {
  fill: url("#rf-chart-gradient");
  opacity: .18;
}

.rf-chart-end {
  fill: var(--rf-surface-raised);
  stroke: var(--series-color);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.rf-chart-floor.income { --series-color: var(--rf-income); }
.rf-chart-floor.services { --series-color: var(--rf-services); }
.rf-chart-floor.attendance { --series-color: var(--rf-attendance); }

@keyframes rfChartReveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.rf-he-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 12px;
}

.rf-he-stream,
.rf-he-insight {
  min-width: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--rf-line-subtle);
}

.rf-he-stream h4,
.rf-he-insight h4 {
  margin: 0 0 8px;
  font-size: 12px;
}

.rf-he-agenda-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  border-top: 1px solid var(--rf-line-subtle);
  font-size: 10px;
}

.rf-he-agenda-row:first-of-type {
  border-top: 0;
}

.rf-he-agenda-row time {
  color: var(--rf-services);
  font-weight: 650;
}

.rf-he-agenda-row span {
  color: var(--muted);
  font-size: 9px;
}

.rf-he-insight {
  background: color-mix(in srgb, var(--green) 5%, transparent);
  border-top-color: color-mix(in srgb, var(--green) 18%, transparent);
  border-radius: 0 0 var(--rf-radius-md) var(--rf-radius-md);
}

.rf-he-insight strong {
  display: block;
  color: var(--green);
  font-size: 18px;
  letter-spacing: -.04em;
}

.rf-he-insight p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.rf-he-finance-chart {
  margin: 12px 0 14px;
}

/* Assinatura na cadeira: ação principal e cobrança somente dos extras. */
.flow-subscription-service-v2 {
  display: grid;
  gap: 10px;
}

.flow-included-service-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border-left: 3px solid var(--green);
  border-radius: var(--rf-radius-sm);
  background: color-mix(in srgb, var(--green) 8%, var(--panel));
}

.flow-included-service-v2 span small,
.flow-included-service-v2 span b {
  display: block;
}

.flow-included-service-v2 span small {
  color: var(--muted);
  font-size: 9px;
}

.flow-included-service-v2 span b {
  margin-top: 3px;
  font-size: 13px;
}

.flow-included-service-v2 > strong {
  color: var(--green);
  font-size: 10px;
}

.flow-sub-actions-v2 {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 8px;
}

.flow-sub-actions-v2 button {
  min-height: 44px;
}

.flow-extra-list-v2 {
  display: grid;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--rf-line-subtle);
}

.rf-prepaid-confirmation {
  display: grid;
  align-content: center;
  min-height: 160px;
  border: 0 !important;
  background: color-mix(in srgb, var(--green) 8%, var(--panel)) !important;
}

.rf-prepaid-confirmation strong {
  margin-top: 8px;
  color: var(--green);
  font-size: 20px;
}

/* Performance: um único estúdio, preview real 9:16 e controles funcionais. */
.rf-performance-studio {
  display: grid;
  grid-template-columns: minmax(290px, .78fr) minmax(360px, 1.22fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.rf-story-stage {
  position: sticky;
  top: 16px;
  display: grid;
  align-content: start;
  gap: 9px;
}

.rf-story-frame {
  width: min(100%, 390px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--rf-line-subtle);
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--rf-services) 10%, transparent), transparent),
    var(--rf-surface-raised);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .25);
}

.rf-story-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rf-story-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}

.rf-story-status {
  min-height: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.rf-performance-controls {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--rf-radius-md);
  background: var(--rf-surface-soft);
}

.rf-performance-controls section {
  display: grid;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--rf-line-subtle);
}

.rf-performance-controls section:first-child {
  padding-top: 0;
  border-top: 0;
}

.rf-performance-controls h4 {
  margin: 0;
  font-size: 13px;
}

.rf-performance-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.rf-performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rf-performance-file {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rf-line-subtle);
  border-radius: var(--rf-radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.rf-performance-file:hover {
  background: var(--surface);
}

.rf-range-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.rf-range-row input {
  accent-color: var(--rf-services);
}

.rf-performance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rf-performance-actions button {
  min-height: 42px;
}

.rf-canvas-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 10, .9);
  backdrop-filter: blur(16px);
}

.rf-canvas-preview-card {
  width: min(420px, 100%);
  max-height: calc(100dvh - 36px);
  display: grid;
  gap: 10px;
}

.rf-canvas-preview-card canvas {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 105px);
  margin: auto;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.rf-canvas-preview-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.rf-performance-error {
  color: var(--red) !important;
}

/* Superfícies mais leves nas demais áreas. */
.v5-page-head {
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--rf-line-subtle);
}

.v5-page-head h3 {
  letter-spacing: -.04em;
}

.v5-summary,
.v5-record,
.v5-setting-panel,
.rf-payment-breakdown,
.v5-table-wrap {
  border-color: var(--rf-line-subtle) !important;
  box-shadow: none !important;
}

.v5-table th,
.v5-table td,
.table th,
.table td {
  border-bottom-color: var(--rf-line-subtle) !important;
}

.modal {
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.modalCard {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .main {
    padding: 12px 12px 96px !important;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea,
  .input,
  .visualSelect {
    font-size: 16px !important;
  }

  .rf-he-toolbar {
    align-items: flex-start;
  }

  .rf-he-toolbar-left {
    display: grid;
    gap: 6px;
  }

  .rf-he-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rf-he-kpi:nth-child(2) {
    border-right: 0;
  }

  .rf-he-kpi:nth-child(-n+2) {
    border-bottom: 1px solid var(--rf-line-subtle);
  }

  .rf-chart-floor {
    grid-template-columns: 86px minmax(0, 1fr);
    min-height: 82px;
  }

  .rf-chart-floor svg {
    height: 82px;
  }

  .rf-chart-label {
    padding-right: 8px;
  }

  .rf-chart-label strong {
    font-size: 12px;
  }

  .rf-he-lower,
  .rf-performance-studio {
    grid-template-columns: 1fr;
  }

  .rf-story-stage {
    position: static;
  }

  .rf-story-frame {
    width: min(100%, 330px);
  }

  .flow-sub-actions-v2 {
    grid-template-columns: 1fr;
  }

  .rf-performance-controls,
  .rf-he-analytics {
    padding: 13px;
  }

  .modal.open {
    align-items: end;
  }

  .modalCard {
    width: 100% !important;
    max-height: min(88dvh, 760px);
    border-radius: 18px 18px 0 0 !important;
  }
}

@media (max-width: 520px) {
  .rf-he-health {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rf-chart-floor {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .rf-he-section-head p {
    display: none;
  }

  .rf-performance-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rf-chart-line {
    animation: none;
  }
}
