@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");

:root {
  --bg: #f4efe6;
  --bg-strong: #e8dccb;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-solid: #fcfaf6;
  --panel-border: rgba(24, 48, 77, 0.12);
  --line: rgba(24, 48, 77, 0.1);
  --line-strong: rgba(24, 48, 77, 0.18);
  --ink: #17324e;
  --muted: #617488;
  --accent: #18304d;
  --accent-strong: #102a43;
  --accent-soft: rgba(24, 48, 77, 0.12);
  --navy: #18304d;
  --danger: #c35d50;
  --positive: #18304d;
  --warning: #c18a29;
  --shadow: 0 24px 70px rgba(24, 48, 77, 0.12);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shell-max: 1720px;
  --page-padding: 14px;
  --section-gap: 16px;
  --font-ui: "Cairo", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(24, 48, 77, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(195, 93, 80, 0.14), transparent 24%),
    linear-gradient(135deg, #faf7f1 0%, var(--bg) 50%, #ece3d3 100%);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

canvas {
  width: 100% !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(24, 48, 77, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  outline: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(11, 119, 191, 0.42);
  box-shadow: 0 0 0 4px rgba(11, 119, 191, 0.12);
  background: #fff;
}

textarea {
  resize: vertical;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: var(--page-padding);
}

.bg-shape,
.bg-grid {
  pointer-events: none;
  position: absolute;
}

.bg-shape {
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.62;
}

.bg-shape-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -90px;
  background: linear-gradient(135deg, rgba(24, 48, 77, 0.26), rgba(49, 91, 133, 0.10));
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  left: -90px;
  bottom: 120px;
  background: linear-gradient(135deg, rgba(217, 179, 108, 0.22), rgba(195, 93, 80, 0.08));
}

.bg-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 48, 77, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 48, 77, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.22), transparent 78%);
}

.hero,
.dashboard {
  position: relative;
  z-index: 1;
  width: min(100%, var(--shell-max));
  margin: 0 auto;
}

.hero {
  display: grid;
  gap: var(--section-gap);
  margin-bottom: var(--section-gap);
}

.hero-top,
.hero-card,
.panel,
.kpi-card,
.filter-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.hero-tools {
  order: -1;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-tools .meta-logo {
  order: 0;
}

.hero-tools .filter-card {
  order: 2;
  width: 100%;
  margin: 0 auto;
}

.hero-tools .brand-logo-mobile {
  order: 1;
}

.dashboard-nav {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.dashboard-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(24, 48, 77, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dashboard-nav a:hover,
.dashboard-nav a[aria-current="page"] {
  border-color: rgba(24, 48, 77, 0.4);
  background: var(--accent);
  color: #fff;
}

.meta-logo {
  width: 156px;
  height: auto;
  object-fit: contain;
}

.brand-logo-mobile {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  align-self: flex-start;
}

.filter-card {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border-radius: 18px;
  box-shadow: none;
}

.filter-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.brand-lockup {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: none;
  width: 220px;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  max-width: 100%;
  width: 100%;
  text-align: center;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: 1.08;
  color: #0070b8;
}

.brand-copy p {
  margin: 10px 0 0;
  max-width: 62ch;
  line-height: 1.6;
  color: var(--muted);
}

.hero-card {
  padding: 18px;
  border-radius: var(--radius-xl);
}

.hero-card-label,
.panel-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(24, 48, 77, 0.08);
  background: rgba(255, 255, 255, 0.56);
}

.hero-stat i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-stat span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 1.08rem;
  line-height: 1.15;
  color: var(--ink);
}

.hero-card .hero-card-label {
  color: #18304d;
}

.hero-card .hero-stat i {
  background: rgba(24, 48, 77, 0.12);
  color: #18304d;
}

.dashboard,
.content-grid,
.table-grid,
.ai-section,
.dispatch-section,
.analytics-section,
.expense-panels,
.cashflow-overview {
  display: grid;
  gap: var(--section-gap);
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  bottom: -46px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(24, 48, 77, 0.12), transparent 68%);
}

.kpi-card span,
.cashflow-stat-card span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong,
.cashflow-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.55rem, 6vw, 2.05rem);
  line-height: 1.06;
  color: #21395d;
}

.kpi-card strong {
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.kpi-card p,
.cashflow-stat-card p,
.panel-head p,
.analytics-meta,
.ai-status,
.dispatch-info,
.ai-answer,
.brand-copy p {
  color: var(--muted);
}

.kpi-card p,
.cashflow-stat-card p {
  margin: 10px 0 0;
  line-height: 1.55;
}

.panel {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head > div:first-child {
  width: 100%;
  min-width: 0;
}

.panel-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.panel h2 {
  margin: 6px 0 0;
  font-size: clamp(1.08rem, 4.9vw, 1.45rem);
  line-height: 1.2;
  color: var(--ink);
}

.info-tooltip {
  position: relative;
  flex: 0 0 auto;
}

.info-trigger {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 119, 191, 0.12);
  color: var(--accent-strong);
}

.tooltip-box {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(280px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 48, 77, 0.12);
  background: rgba(23, 50, 78, 0.96);
  box-shadow: 0 20px 40px rgba(17, 32, 50, 0.24);
  color: #f7f8fa;
  font-size: 0.86rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.info-tooltip:hover .tooltip-box,
.info-tooltip:focus-within .tooltip-box {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.table-wrap,
.expense-legend,
.ai-form,
.ai-answer-card,
.dispatch-form,
.dispatch-info-card,
.cashflow-stat-card {
  border: 1px solid rgba(24, 48, 77, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.table-wrap,
.expense-legend {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 18px;
}

.chart-scroll-wrap,
.performance-chart-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.performance-chart-wrap,
.chart-scroll-wrap {
  padding: 12px;
}

.performance-chart-inner,
.cashflow-chart-inner,
.cashflow-detail-chart-inner,
.extra-revenue-chart-inner,
.pareto-chart-inner {
  min-width: 100%;
}

.performance-chart-inner {
  width: max(100%, 760px);
  min-height: 320px;
}

.pareto-chart-inner {
  width: max(100%, 1180px);
  min-height: 320px;
}

.cashflow-chart-inner {
  width: max(100%, 760px);
  min-height: 320px;
}

.cashflow-detail-chart-inner {
  width: max(100%, 860px);
  min-height: 220px;
}

.extra-revenue-chart-inner {
  width: max(100%, 860px);
  min-height: 240px;
}

.expense-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.expense-chart-inner {
  width: min(100%, 520px);
  min-width: 280px;
  margin: 0 auto;
}

#performanceChart,
#paretoChart,
#cashflowChart {
  height: 320px !important;
}

#cashflowDetailChart {
  height: 220px !important;
}

#extraRevenueChart {
  height: 240px !important;
}

#expenseChart {
  height: auto !important;
  aspect-ratio: 1 / 1;
}

.vendor-filter,
.analytics-filter {
  display: grid;
  gap: 6px;
}

.vendor-filter label,
.analytics-filter span,
.ai-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.expense-panels {
  grid-template-columns: 1fr;
}

.panel-expense-chart,
.panel-expense-list {
  height: 100%;
}

.expense-legend {
  padding: 0;
}

.expense-legend-table {
  min-width: 680px;
}

.expense-legend-head,
.expense-legend-row {
  display: grid;
  grid-template-columns: 72px minmax(240px, 1.6fr) max-content 72px;
  gap: 12px;
  align-items: center;
  min-width: 100%;
  padding: 5px 8px;
}

.expense-legend-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f4ee;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.expense-legend-row + .expense-legend-row {
  border-top: 1px solid var(--line);
}

.expense-legend-row strong {
  min-width: 0;
  font-size: 0.94rem;
  color: var(--ink);
}

.expense-legend-row span:nth-child(3),
.expense-legend-row span:nth-child(4),
.expense-legend-head span:nth-child(3),
.expense-legend-head span:nth-child(4) {
  text-align: right;
}

.expense-legend-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table th,
table td {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

table th:last-child,
table td:last-child {
  border-right: 0;
}

table thead th {
  background: #f7f4ee;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

table tbody tr:last-child td,
table tfoot tr:last-child td {
  border-bottom: 0;
}

#dreTableHead th:first-child,
#dreTableBody td:first-child,
.expense-groups-table th:first-child,
.expense-groups-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fcfaf6;
}

#dreTableHead tr:first-child th:first-child,
.expense-groups-table thead th:first-child {
  z-index: 3;
}

#dreTableHead th:first-child,
#dreTableBody td:first-child {
  min-width: 240px;
  white-space: normal;
}

.expense-groups-table th:first-child,
.expense-groups-table td:first-child {
  min-width: 280px;
  white-space: normal;
}

.dre-month-start {
  border-left: 1px solid var(--line-strong);
}

.dre-positive,
.analytics-positive {
  color: var(--positive);
  font-weight: 700;
}

.dre-negative,
.analytics-negative {
  color: var(--danger);
  font-weight: 700;
}

.total-row td,
.expense-groups-total-row td {
  background: rgba(11, 119, 191, 0.08);
  font-weight: 700;
}

.emphasis-row td {
  font-weight: 700;
}

.expense-groups-total {
  font-weight: 700;
}

.projection-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(11, 119, 191, 0.12);
  color: var(--accent-strong);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.expense-group-main-cell {
  min-width: 280px;
}

.expense-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.expense-group-toggle-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid rgba(24, 48, 77, 0.16);
  background: #fff;
  color: var(--accent);
}

.expense-group-row.is-open .expense-group-toggle-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.expense-group-label {
  min-width: 0;
}

.expense-group-detail-row > td {
  padding: 0;
  background: #fbf9f5;
}

.expense-group-detail-label {
  padding: 14px 16px 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.expense-group-detail-wrap {
  width: 100%;
  overflow: auto;
  padding: 12px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.expense-group-detail-table {
  width: max-content;
  min-width: 100%;
  min-width: 820px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}

.expense-group-detail-table th,
.expense-group-detail-table td {
  background: rgba(255, 255, 255, 0.86);
}

.expense-group-detail-table td:first-child,
.expense-group-detail-table th:first-child {
  min-width: 280px;
  white-space: normal;
}

.cashflow-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.extra-revenue-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.extra-revenue-summary-card {
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(217, 179, 108, 0.16), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(217, 179, 108, 0.28);
}

.extra-revenue-summary {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.65;
}

.extra-revenue-summary strong {
  color: #18304d;
}

.extra-revenue-analytics-block {
  display: grid;
  gap: 12px;
}

.extra-revenue-filters {
  display: grid;
  gap: 12px;
}

.extra-revenue-analytics-meta-row {
  margin-bottom: 0;
}

.extra-revenue-analytics-pagination {
  width: 100%;
}

.extra-revenue-filter {
  width: 100%;
}

.extra-revenue-filter select,
.extra-revenue-filter input {
  width: 100%;
  border: 1px solid rgba(24, 48, 77, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
}

.extra-revenue-filter select {
  min-height: 132px;
}

.extra-revenue-filter select:not([multiple]) {
  min-height: 48px;
}

.extra-revenue-filter-search input {
  min-height: 48px;
}

.cashflow-stat-card,
.ai-form,
.ai-answer-card,
.dispatch-form,
.dispatch-info-card {
  border-radius: 20px;
  padding: 18px;
}

.ai-grid,
.dispatch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#financeAiQuestion {
  min-height: 170px;
}

.ai-actions,
.dispatch-actions,
.analytics-pagination {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ai-actions,
.dispatch-actions {
  margin-top: 14px;
}

.ai-submit,
.dispatch-secondary,
.analytics-page-button {
  appearance: none;
  border-radius: 999px;
  padding: 14px 18px;
  text-align: center;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ai-submit {
  border: 0;
  background: linear-gradient(135deg, #14a2c7, #0b77bf);
  color: #fff;
  box-shadow: 0 16px 28px rgba(11, 119, 191, 0.22);
}

.dispatch-secondary,
.analytics-page-button {
  border: 1px solid rgba(24, 48, 77, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.ai-submit:hover,
.dispatch-secondary:hover,
.analytics-page-button:hover {
  transform: translateY(-1px);
}

.analytics-page-button:disabled,
.dispatch-secondary:disabled,
.ai-submit:disabled {
  cursor: default;
  opacity: 0.56;
  transform: none;
}

.ai-status {
  display: block;
  min-height: 1.3em;
  margin-top: 10px;
  font-size: 0.92rem;
}

.ai-answer,
.dispatch-info {
  min-height: 120px;
  line-height: 1.7;
}

.ai-answer p {
  margin: 0 0 10px;
}

.ai-answer ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.ai-answer li + li {
  margin-top: 4px;
}

.ai-answer strong {
  color: var(--ink);
}

.ai-answer-table-wrap {
  margin: 12px 0;
  overflow-x: auto;
  border: 1px solid rgba(24, 48, 77, 0.12);
  border-radius: 10px;
}

.ai-answer-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ai-answer-table th,
.ai-answer-table td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(24, 48, 77, 0.1);
  text-align: right;
  white-space: nowrap;
}

.ai-answer-table th:first-child,
.ai-answer-table td:first-child {
  text-align: left;
}

.ai-answer-table th {
  background: rgba(24, 48, 77, 0.07);
  color: var(--ink);
  font-weight: 700;
}

.ai-answer-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Cabeçalho com as marcas em posições fixas. */
.hero-top {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
  align-items: center;
}

.header-meta-slot {
  justify-self: start;
}

.hero-top .meta-logo {
  display: block;
  width: 156px;
}

.header-life-logo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  justify-self: center;
}

.header-life-brand {
  width: 220px;
  max-width: 100%;
  justify-self: center;
  text-align: center;
}

.header-life-brand .header-life-logo {
  width: 100%;
}

.header-life-caption {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-top .hero-tools {
  order: initial;
  width: auto;
  justify-self: end;
  align-items: flex-end;
  flex-direction: column;
  flex-wrap: nowrap;
}

.hero-top .hero-tools .filter-card {
  width: auto;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero-card .filter-card {
  width: auto;
  max-width: none;
  padding: 8px 10px;
  border-radius: 12px;
}

.hero-card .filter-card label {
  margin-bottom: 3px;
  font-size: 0.62rem;
}

.hero-card .filter-card select {
  min-width: 88px;
}

.year-select-wrap select {
  min-width: 88px;
  padding: 8px 30px 8px 10px;
  border: 1px solid rgba(24, 48, 77, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.hero-top .dashboard-nav {
  width: auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.dashboard-nav .dashboard-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(24, 48, 77, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dashboard-nav .dashboard-nav-button i {
  font-size: 1rem;
}

.dashboard-nav .pdf-action-button {
  position: relative;
  border-color: rgba(207, 107, 91, 0.34);
  color: #b54e40;
}

.dashboard-nav .pdf-action-button:hover {
  border-color: #cf6b5b;
  background: #cf6b5b;
  color: #fff;
}

.dashboard-nav .dashboard-nav-button:hover,
.dashboard-nav .dashboard-nav-button[aria-current="page"] {
  border-color: rgba(24, 48, 77, 0.4);
  background: var(--accent);
  color: #fff;
}

.dashboard-nav .pdf-action-button:hover {
  border-color: #cf6b5b;
  background: #cf6b5b;
}

.dashboard-nav .pdf-action-button,
.dashboard-nav .pdf-action-button:hover {
  border-color: #cf6b5b;
  background: #cf6b5b;
  color: #fff;
}

.dashboard-nav a[href="reserva.html"],
.dashboard-nav a[href="reserva.html"]:hover {
  border-color: #18304d;
  background: #18304d;
  color: #fff;
}

.pdf-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 680px) {
  .hero-top {
    grid-template-columns: minmax(70px, 1fr) minmax(100px, auto) minmax(70px, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .hero-top .meta-logo {
    width: 92px;
  }

  .header-life-logo {
    width: 130px;
  }

  .header-life-brand {
    width: 130px;
  }

  .header-life-caption {
    margin-top: 2px;
    font-size: 0.6rem;
  }

  .hero-top .hero-tools {
    gap: 6px;
  }

  .hero-top .hero-tools .filter-card {
    max-width: 92px;
    padding: 8px;
  }

  .hero-card-header {
    align-items: flex-start;
  }

  .hero-top .dashboard-nav {
    display: flex;
    gap: 4px;
  }

  .dashboard-nav .dashboard-nav-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .dashboard-nav .dashboard-nav-button i {
    font-size: 0.75rem;
  }
}

.analytics-meta-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-meta {
  font-size: 0.94rem;
}

.analytics-table th,
.analytics-table td {
  font-size: 0.88rem;
}

.analytics-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.analytics-status-chip.is-projected {
  background: rgba(11, 119, 191, 0.12);
  color: var(--accent-strong);
}

.analytics-status-chip.is-realized {
  background: rgba(24, 48, 77, 0.12);
  color: var(--positive);
}

.analytics-empty {
  padding: 28px 16px !important;
  text-align: center;
  color: var(--muted);
}

.reveal {
  opacity: 1;
  transform: none;
}

@media (min-width: 640px) {
  :root {
    --page-padding: 20px;
    --section-gap: 18px;
  }

  .hero-top,
  .hero-card,
  .panel,
  .kpi-card {
    padding: 22px;
  }

  .hero-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cashflow-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-actions {
    grid-template-columns: max-content 1fr;
    align-items: center;
  }

  .dispatch-actions,
  .analytics-pagination {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  :root {
    --page-padding: 22px;
    --section-gap: 20px;
  }

  .hero-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
  }

  .hero-tools {
    order: 0;
    width: auto;
    align-items: flex-end;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .dashboard-nav {
    order: 1;
    width: auto;
    justify-content: flex-end;
  }

  .hero-tools .filter-card {
    margin: 0;
  }

  .brand-lockup {
    flex-direction: row;
    align-items: center;
    gap: 22px;
  }

  .brand-logo {
    display: block;
  }

  .brand-logo-mobile {
    display: none;
  }

  .meta-logo {
    width: 180px;
  }

  .hero-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kpi-card strong {
    font-size: clamp(1.1rem, 1.4vw, 1.45rem);
  }

  .panel-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .panel-head > div:first-child {
    flex: 1 1 auto;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .expense-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .table-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .cashflow-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-grid,
  .dispatch-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
  }

  .extra-revenue-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .analytics-meta-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .analytics-pagination {
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .analytics-page-button {
    min-width: 150px;
  }

  .analytics-filter {
    width: min(360px, 100%);
  }

  .performance-chart-inner,
  .cashflow-chart-inner,
  .cashflow-detail-chart-inner,
  .extra-revenue-chart-inner {
    width: 100%;
  }

  .expense-chart-inner {
    width: min(100%, 620px);
  }
}
