/* ── Dashboard – visual alinhado com o site ──────────────────────────── */

body.dashboard-page {
  background: #ffffff;
}

.dashboard-page .container {
  max-width: 95em;
  overflow-x: hidden;
}

.dashboard-page main {
  flex: 1;
  height: auto;
  align-items: stretch;
  justify-content: flex-start;
}

.dashboard-main {
  width: min(1100px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 40px 0 60px;
  color: var(--gray);
}

/* ── Cabeçalho da página ─────────────────────────────────────────────── */

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--yellow);
  margin-bottom: 32px;
}

.intro-copy h1 {
  margin-top: 10px;
  color: var(--gray);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
}

.intro-copy p {
  margin-top: 16px;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.75;
  max-width: 700px;
}

.dashboard-eyebrow {
  display: inline-block;
  color: #7c7200;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-status {
  padding: 20px;
  border: 2px solid var(--yellow);
  border-radius: 0 1.25em 0 1.25em;
  background: #fffff8;
}

.status-label {
  display: inline-block;
  padding: 5px 10px;
  background: var(--yellow);
  color: var(--gray);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-status strong {
  display: block;
  margin: 14px 0 8px;
  color: var(--gray);
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.25;
}

.intro-status p {
  color: var(--dark-gray);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 4px;
}

/* ── Tabs de navegação ───────────────────────────────────────────────── */

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.dashboard-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 2px solid var(--gray);
  color: var(--gray);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 0 0.75em 0 0.75em;
  transition: 0.3s ease;
}

.dashboard-tabs a:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #3f3f3f;
}

/* ── Seções ──────────────────────────────────────────────────────────── */

.dashboard-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid #e8e8e0;
  scroll-margin-top: 80px;
}

.section-featured {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-top: 8px;
  color: var(--gray);
  font-size: clamp(1.4rem, 1rem + 1.5vw, 1.9rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
}

.section-heading p {
  margin-top: 10px;
  color: var(--dark-gray);
  font-size: 14px;
  line-height: 1.75;
  max-width: 820px;
}

/* ── Ledger mensal ───────────────────────────────────────────────────── */

.maintenance-ledger {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 28px;
}

.ledger-month {
  min-height: 80px;
  padding: 12px;
  border: 2px solid #d8d8d0;
  border-radius: 0 0.75em 0 0.75em;
}

.ledger-month strong {
  display: block;
  color: var(--gray);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.ledger-month span {
  display: block;
  margin-top: 6px;
  color: var(--dark-gray);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ledger-month.is-filled {
  border-color: var(--yellow);
  border-top-width: 4px;
}

/* ── Cards de métricas ───────────────────────────────────────────────── */

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

.metric-card {
  padding: 20px;
  border: 2px solid var(--gray);
  border-radius: 0 1.25em 0 1.25em;
  min-height: 150px;
  transition: 0.3s ease;
}

.metric-card:hover {
  border-color: var(--yellow);
}

.metric-wide {
  grid-column: span 2;
}

.metric-label {
  display: block;
  color: var(--dark-gray);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--gray);
  font-size: clamp(1.8rem, 1.2rem + 1.3vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  word-break: break-word;
}

.metric-card p {
  margin-top: 12px;
  color: var(--dark-gray);
  font-size: 13px;
  line-height: 1.65;
}

/* ── Gráficos ────────────────────────────────────────────────────────── */

.chart-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.chart-row-primary {
  grid-template-columns: 1fr;
}

.chart-card {
  padding: 20px;
  border: 2px solid #d8d8d0;
  border-radius: 0 1.25em 0 1.25em;
  min-width: 0;
}

.chart-head span {
  display: block;
  color: var(--dark-gray);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chart-head h3 {
  margin-top: 6px;
  color: var(--gray);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.3;
}

.chart-frame {
  height: 300px;
  margin-top: 12px;
}

.chart-row-primary .chart-frame {
  height: 320px;
}

.compact-ranking {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-left: 18px;
}

.compact-ranking li {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

/* ── Tabela de fechamentos ───────────────────────────────────────────── */

.data-table-panel {
  margin-top: 28px;
  padding: 24px;
  border: 2px solid #d8d8d0;
  border-radius: 0 1.25em 0 1.25em;
  min-width: 0;
}

.table-head {
  margin-bottom: 16px;
}

.table-head h3 {
  margin-top: 8px;
  color: var(--gray);
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.table-head p {
  margin-top: 8px;
  color: var(--dark-gray);
  font-size: 13px;
  line-height: 1.65;
}

.table-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.table-guide div {
  padding: 12px 14px;
  border-left: 4px solid var(--yellow);
  background: #fafaf4;
}

.table-guide strong {
  display: block;
  color: var(--gray);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-guide span {
  display: block;
  margin-top: 4px;
  color: var(--dark-gray);
  font-size: 12px;
  line-height: 1.55;
}

.table-wrapper {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e5dc;
  color: var(--gray);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.dashboard-table th {
  background: var(--yellow);
  color: var(--gray);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dashboard-table .table-group-row th {
  background: #3f3f3f;
  color: #ffffff;
  text-align: center;
}

.dashboard-table tbody tr:nth-child(even) td {
  background: #f9f9f4;
}

/* separação de grupos de colunas */
.dashboard-table .col-sep {
  border-left: 3px solid #c8c8b8;
}

.dashboard-table .col-group-fechamentos th,
.dashboard-table .col-group-fechamentos td {
  background-color: #fafaf4;
}

.dashboard-table .col-group-origem th,
.dashboard-table .col-group-origem td {
  background-color: #f5f5ee;
}

.dashboard-table tbody tr:nth-child(even) .col-group-fechamentos {
  background-color: #f2f2ea;
}

.dashboard-table tbody tr:nth-child(even) .col-group-origem {
  background-color: #edede6;
}

.dashboard-table .table-group-row .col-group-fechamentos,
.dashboard-table .table-group-row .col-group-origem {
  background: #3f3f3f;
  color: #ffffff;
}

/* ── Grids de zeros / obrigações ─────────────────────────────────────── */

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

.zero-grid article,
.obligation-grid article {
  padding: 20px;
  border: 2px solid var(--gray);
  border-radius: 0 1.25em 0 1.25em;
  min-height: 155px;
  transition: 0.3s ease;
}

.zero-grid article:hover,
.obligation-grid article:hover {
  border-color: var(--yellow);
}

.zero-grid span,
.obligation-grid span {
  display: block;
  color: var(--dark-gray);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zero-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--gray);
  font-size: clamp(1.8rem, 1.2rem + 1.3vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  word-break: break-word;
}

.zero-grid p,
.obligation-grid p {
  margin-top: 10px;
  color: var(--dark-gray);
  font-size: 13px;
  line-height: 1.65;
}

.obligation-grid .is-published {
  border-color: var(--yellow);
  border-top-width: 4px;
}

.obligation-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--gray);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.3;
}

/* ── Linha do tempo ──────────────────────────────────────────────────── */

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

.timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, var(--yellow), #d0d0c8);
}

.timeline-item {
  position: relative;
  padding: 60px 16px 16px;
  border: 2px solid #d8d8d0;
  border-radius: 0 1.25em 0 1.25em;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 16px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 4px solid #d0d0c8;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item.is-current {
  border-color: var(--yellow);
  border-top-width: 4px;
}

.timeline-item.is-current::before {
  border-color: var(--yellow);
}

.timeline-item span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: #827500;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-item h3 {
  margin-top: 6px;
  color: var(--gray);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-item p {
  margin-top: 8px;
  color: var(--dark-gray);
  font-size: 13px;
  line-height: 1.65;
}

/* ── Callout ─────────────────────────────────────────────────────────── */

.dashboard-callout {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-top: 40px;
  padding: 24px 0;
  border-top: 2px solid var(--yellow);
}

.dashboard-callout h2 {
  color: var(--gray);
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-callout p {
  margin-top: 8px;
  color: var(--dark-gray);
  font-size: 14px;
  line-height: 1.65;
  max-width: 700px;
}

.dashboard-callout a {
  flex: 0 0 auto;
  padding: 11px 18px;
  border: 2px solid var(--gray);
  color: var(--gray);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0 0.75em 0 0.75em;
  transition: 0.3s ease;
}

.dashboard-callout a:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #3f3f3f;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer-right img {
  width: 120px;
  opacity: 0.65;
}

/* ── Responsivo ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .dashboard-intro {
    grid-template-columns: 1fr;
  }

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

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

  .chart-row {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 24px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .timeline-item {
    padding: 18px 18px 18px 60px;
  }

  .timeline-item::before {
    left: 14px;
    top: 20px;
  }
}

@media (max-width: 760px) {
  .dashboard-main {
    width: calc(100vw - 28px);
    padding-top: 28px;
  }

  .dashboard-intro {
    padding-bottom: 20px;
  }

  .table-guide {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .zero-grid,
  .obligation-grid,
  .maintenance-ledger {
    grid-template-columns: 1fr;
  }

  .metric-wide {
    grid-column: auto;
  }

  .chart-frame,
  .chart-row-primary .chart-frame {
    height: 260px;
  }

  .dashboard-callout {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-callout a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .dashboard-tabs a {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 500px) {
  .dashboard-main {
    width: calc(100vw - 24px);
  }

  .intro-copy h1 {
    font-size: 1.7rem;
  }

  .section-heading h2 {
    font-size: 1.5rem;
  }
}
