:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fbfc;
  --line: #d8e2e8;
  --line-strong: #a9bac6;
  --text: #172531;
  --muted: #647684;
  --brand: #005f8f;
  --brand-2: #00a7bd;
  --teal: #047d86;
  --extra: #c84a32;
  --ok: #147a4d;
  --warn: #b76600;
  --danger: #b00020;
  --shadow: 0 16px 34px rgba(23, 37, 49, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 980px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover {
  background: #004f76;
  border-color: #004f76;
}

button.secondary {
  background: #fff;
  color: var(--brand);
}

button.secondary:hover {
  background: #eaf5fb;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: linear-gradient(90deg, #ffffff 0%, #f9fcfd 58%, #edf7f9 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(23, 37, 49, 0.05);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 520px;
}

.brand-logo {
  width: 184px;
  height: 66px;
  object-fit: contain;
  background: #fff;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #edf4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.nav-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.nav-tabs a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(21, 32, 43, 0.08);
}

main {
  padding: 20px 28px 34px;
}

.filters,
.dashboard-filters {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(23, 37, 49, 0.04);
}

.filters {
  grid-template-columns: 150px 150px 150px 150px minmax(210px, 1fr) minmax(210px, 1fr) 140px 178px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 160, 200, 0.25);
  border-color: var(--brand-2);
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.text-button {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font-weight: 700;
}

.text-button:hover {
  background: transparent;
  color: #00537f;
}

.quick-filter {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(23, 37, 49, 0.04);
}

.quick-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-filter-head h2 {
  font-size: 14px;
}

.consultorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.consultoria-card {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consultoria-card:hover {
  background: #eef8fb;
  border-color: var(--brand-2);
  color: var(--brand);
}

.consultoria-card.active {
  background: #dff3f8;
  border-color: var(--brand);
  color: #064b6c;
}

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

.summary div {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 15px 16px 15px 18px;
  box-shadow: 0 8px 20px rgba(23, 37, 49, 0.04);
  overflow: hidden;
}

.summary div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.summary div:nth-child(2)::before {
  background: var(--teal);
}

.summary div:nth-child(3)::before {
  background: var(--ok);
}

.summary div:nth-child(4)::before {
  background: var(--warn);
}

.summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.report {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-filters {
  grid-template-columns: 110px 220px 150px minmax(220px, 1fr) minmax(220px, 1fr) 140px 100px;
}

.dashboard-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-area {
  padding: 20px 18px 12px;
  background:
    linear-gradient(#edf3f6 1px, transparent 1px) 0 62px / 100% 76px no-repeat,
    #fff;
}

.dashboard-chart-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-logo {
  width: 156px;
  height: 58px;
  object-fit: contain;
  background: #fff;
}

.chart-side-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 430px;
}

.chart-side-info p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-blue {
  background: var(--brand);
}

.legend-orange {
  background: #f59f22;
}

.legend-teal {
  background: var(--teal);
}

.legend-red {
  background: var(--extra);
}

.legend-gray {
  background: #c9d9e5;
  border: 1px solid #b7cbd9;
}

.legend-green {
  background: #168a55;
}

#barChart {
  display: block;
  width: 100%;
  height: 420px;
}

.bar {
  fill: var(--brand);
}

.bar.current {
  fill: #f59f22;
}

.bar.future {
  fill: #c9d9e5;
}

.bar.hours {
  fill: var(--teal);
  opacity: 0.72;
  stroke: rgba(4, 125, 134, 0.45);
  stroke-width: 1.5;
}

.bar.hours.future {
  stroke: #9eb8ca;
}

.bar.hours.current {
  opacity: 0.68;
  stroke: #b86100;
}

.bar.hours-extra {
  fill: var(--extra);
  opacity: 0.84;
  stroke: rgba(132, 36, 22, 0.45);
  stroke-width: 1.5;
}

.bar.hours-extra.future {
  fill: #d9afa7;
  stroke: #c58f84;
}

.bar.hours-extra.current {
  fill: #e46c3a;
  stroke: #aa421f;
}

.summary-bar {
  fill: var(--ok);
}

.goal-card-bg {
  fill: var(--panel-soft);
  stroke: #d9e1e8;
  stroke-width: 1.5;
}

.goal-card-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.goal-card-value {
  fill: var(--brand);
  font-size: 17px;
  font-weight: 700;
}

.goal-card-percent {
  fill: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

.divider {
  stroke: #c9d6df;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.axis {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scale-label,
.bar-label,
.summary-title {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.summary-title {
  fill: var(--ok);
}

.bar-label-secondary {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bar-label-extra {
  fill: var(--extra);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-table-panel {
  margin-top: 14px;
}

.dashboard-table-wrap {
  max-height: none;
}

.report-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-logo {
  display: none;
  width: 136px;
  height: 50px;
  object-fit: contain;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.report-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

#statusMensagem {
  align-self: center;
  min-width: 180px;
  text-align: right;
}

.table-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid #ecf0f3;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf4f7;
  color: #23313f;
  font-size: 12px;
  font-weight: 700;
}

th:nth-child(1),
td:nth-child(1) {
  width: 78px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 240px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 230px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 110px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 95px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 120px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 105px;
}

th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9),
th:nth-child(10),
td:nth-child(10),
th:nth-child(11),
td:nth-child(11) {
  width: 118px;
}

.tipo-agenda {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(4, 125, 134, 0.28);
  border-radius: 4px;
  background: #e8f6f7;
  color: #075c63;
  font-size: 12px;
  font-weight: 700;
}

.tipo-agenda.extra {
  border-color: rgba(200, 74, 50, 0.32);
  background: #fff0ec;
  color: #9e351f;
}

.extra-value {
  color: var(--extra);
}

.subtotal td.extra-value,
.total-row td.extra-value {
  color: var(--extra);
}

tr:nth-child(even):not(.subtotal):not(.group-row):not(.total-row) {
  background: #fafbfc;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.group-row td {
  background: #dcecf6;
  color: #0d4664;
  font-weight: 700;
  border-top: 1px solid var(--line-strong);
}

.subtotal td {
  background: #f1f7fb;
  color: #0d4664;
  font-weight: 700;
}

.total-row td {
  background: #e7f7f5;
  color: #0b5f55;
  font-weight: 700;
  border-top: 2px solid var(--brand-2);
}

.empty td {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    min-width: 0;
    background: #fff;
    font-size: 9px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .topbar,
  .filters,
  .quick-filter,
  .dashboard-filters,
  .summary,
  #statusMensagem {
    display: none;
  }

  main {
    padding: 0;
  }

  .report {
    border: 0;
    box-shadow: none;
    width: 100%;
  }

  .dashboard-panel,
  .dashboard-table-panel {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .report-title {
    padding: 0 0 8px;
    background: #fff;
  }

  .report-logo {
    display: block;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }

  table {
    width: 100%;
    table-layout: fixed;
    font-size: 8.6px;
  }

  th {
    position: static;
  }

  th,
  td {
    padding: 5px 6px;
    text-overflow: clip;
  }

  .chart-area {
    padding: 8px 0 0;
    background: #fff;
  }

  #barChart {
    height: 330px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 7%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 17%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 21%;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 10%;
  }

  th:nth-child(5),
  td:nth-child(5) {
    width: 8%;
  }

  th:nth-child(6),
  td:nth-child(6) {
    width: 10%;
  }

  th:nth-child(7),
  td:nth-child(7) {
    width: 9%;
  }

  th:nth-child(8),
  td:nth-child(8) {
    width: 10%;
  }

  th:nth-child(9),
  td:nth-child(9) {
    width: 10%;
  }

  th:nth-child(10),
  td:nth-child(10) {
    width: 10%;
  }

  th:nth-child(11),
  td:nth-child(11) {
    width: 13%;
  }
}
