/**
 * Feira c3dashboard — compacto real: sobrescreve portal/assets/dashboard-modern.css (!important).
 * Escopo: html.dash-feira-c3-html + body.dash-feira-c3
 */

@keyframes dash-os-tempo-pulse {
  0%, 100% { background-color: #fff5f5; box-shadow: inset 0 0 0 2px #c82333; }
  50% { background-color: #ffc9c9; }
}

html.dash-feira-c3-html {
  font-size: 100%;
}

body.dash-feira-c3 {
  font-size: 11px !important;
  line-height: 1.3 !important;
}

body.dash-feira-c3 #right-panel {
  padding-left: 8px !important;
  padding-right: 8px !important;
  padding-bottom: 4px !important;
}

body.dash-feira-c3 #right-panel > [class*="col-"] {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

body.dash-feira-c3 .dash-feira-top-row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (min-width: 992px) {
  body.dash-feira-c3 .dash-feira-top-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
  }
  body.dash-feira-c3 .dash-feira-top-row > [class*="col-"] > .card {
    flex: 1 1 auto;
  }
}

/* Header */
body.dash-feira-c3 #right-panel header.header {
  padding: 0.4rem 0.75rem !important;
}

body.dash-feira-c3 .header-menu {
  padding: 0.25rem 0 !important;
  max-width: none !important;
}

body.dash-feira-c3 .header .navbar-brand img,
body.dash-feira-c3 #right-panel header .navbar-brand img {
  max-height: 34px !important;
  height: auto !important;
}

/* Cards dados */
body.dash-feira-c3 #right-panel .card:not(.text-white) {
  margin-bottom: 0.45rem !important;
  border-radius: 8px !important;
}

body.dash-feira-c3 #right-panel .card:not(.text-white) .card-header {
  padding: 0.3rem 0.5rem !important;
  font-size: 0.62rem !important;
  line-height: 1.2 !important;
}

body.dash-feira-c3 #right-panel .card:not(.text-white) .card-header .card-title {
  font-size: inherit !important;
}

body.dash-feira-c3 #right-panel .card:not(.text-white) .card-body,
body.dash-feira-c3 #right-panel .card .card-body {
  padding: 0.35rem 0.45rem !important;
}

body.dash-feira-c3 #right-panel .card-body.p-0 {
  padding: 0 !important;
}

body.dash-feira-c3 .card-header small.text-muted {
  font-size: 0.6rem !important;
}

body.dash-feira-c3 .mt-3 {
  margin-top: 0.4rem !important;
}

body.dash-feira-c3 .mt-2 {
  margin-top: 0.35rem !important;
}

/* Tabelas — ganha de dashboard-modern */
body.dash-feira-c3 #right-panel .table {
  font-size: 0.68rem !important;
  margin-bottom: 0 !important;
}

body.dash-feira-c3 #right-panel .table thead.thead-dark th {
  padding: 0.22rem 0.28rem !important;
  font-size: 0.58rem !important;
  font-weight: 600 !important;
  white-space: normal !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
}

body.dash-feira-c3 #right-panel .table thead th abbr {
  cursor: help;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.45);
}

body.dash-feira-c3 #right-panel .table tbody td {
  padding: 0.2rem 0.28rem !important;
  vertical-align: middle !important;
}

body.dash-feira-c3 #right-panel .table-sm thead th,
body.dash-feira-c3 #right-panel .table-sm tbody td {
  padding: 0.18rem 0.24rem !important;
}

body.dash-feira-c3 #right-panel .table-responsive {
  font-size: 0.68rem !important;
}

/* Chamados finalizados (coluna direita): títulos curtos + colunas estreitas */
body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados {
  table-layout: fixed !important;
  width: 100% !important;
}

body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados thead th {
  font-size: 0.5rem !important;
  padding: 0.1rem 0.12rem !important;
  white-space: normal !important;
  line-height: 1.1 !important;
}

body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados tbody td {
  font-size: 0.62rem !important;
  padding: 0.12rem 0.14rem !important;
}

body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados th:nth-child(1),
body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados td:nth-child(1) {
  width: 24% !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados th:nth-child(n + 2):not(:nth-child(9)),
body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados td:nth-child(n + 2):not(:nth-child(9)) {
  width: 8.6% !important;
  min-width: 1.4rem !important;
  text-align: center !important;
}

body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados th:nth-child(9),
body.dash-feira-c3 #right-panel #card-chamados-finalizados .table-dash-finalizados td:nth-child(9) {
  width: 8.8% !important;
  min-width: 1.4rem !important;
  font-weight: 700 !important;
  text-align: center !important;
}

/* Análise de tempo */
body.dash-feira-c3 #right-panel .table-dash-tempo-os {
  table-layout: fixed !important;
  width: 100% !important;
}

body.dash-feira-c3 #right-panel .table-dash-tempo-os thead th {
  font-size: 0.55rem !important;
}

body.dash-feira-c3 #right-panel #card-analise-tempo-os .table-responsive {
  font-size: 0.62rem !important;
}

body.dash-feira-c3 #right-panel .table-dash-tempo-os td.dash-cell-end,
body.dash-feira-c3 #right-panel .table-dash-tempo-os td.dash-cell-cli {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(1) { width: 5% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(2) { width: 14% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(3) { width: 5% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(4) { width: 28% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(5) { width: 12% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(6) { width: 12% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(7) { width: 20% !important; }
body.dash-feira-c3 #right-panel .table-dash-tempo-os td:nth-child(8) { width: 4% !important; }

/* Alertas DS/EX */
body.dash-feira-c3 tr.dash-os-alerta-ds,
body.dash-feira-c3 tr.dash-os-alerta-ex {
  animation: dash-os-tempo-pulse 1s ease-in-out infinite;
}

body.dash-feira-c3 tr.dash-os-alerta-ds td,
body.dash-feira-c3 tr.dash-os-alerta-ex td {
  font-weight: 600 !important;
  color: #721c24 !important;
}

body.dash-feira-c3 #tbody-analise-tempo-os .fa {
  font-size: 0.85rem !important;
  vertical-align: middle;
}

/* Métricas coloridas */
body.dash-feira-c3 #right-panel .card.text-white .card-body,
body.dash-feira-c3 #right-panel .card.bg-flat-color-1 .card-body,
body.dash-feira-c3 #right-panel .card.bg-flat-color-2 .card-body,
body.dash-feira-c3 #right-panel .card.bg-flat-color-4 .card-body,
body.dash-feira-c3 #right-panel .card.bg-flat-color-5 .card-body {
  padding: 0.4rem 0.55rem !important;
}

body.dash-feira-c3 #right-panel .card.text-white .count,
body.dash-feira-c3 #right-panel .card.bg-flat-color-1 .count,
body.dash-feira-c3 #right-panel .card.bg-flat-color-2 .count,
body.dash-feira-c3 #right-panel .card.bg-flat-color-4 .count,
body.dash-feira-c3 #right-panel .card.bg-flat-color-5 .count {
  font-size: 1.25rem !important;
  line-height: 1 !important;
}

body.dash-feira-c3 #right-panel .card.text-white p.text-light,
body.dash-feira-c3 #right-panel .card.bg-flat-color-1 p,
body.dash-feira-c3 #right-panel .card.bg-flat-color-2 p,
body.dash-feira-c3 #right-panel .card.bg-flat-color-4 p,
body.dash-feira-c3 #right-panel .card.bg-flat-color-5 p {
  font-size: 0.65rem !important;
  line-height: 1.2 !important;
  margin-bottom: 0 !important;
}

body.dash-feira-c3 #right-panel .chart-wrapper {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.dash-feira-c3 .text-center.py-3 {
  padding-top: 0.3rem !important;
  padding-bottom: 0.3rem !important;
}

/* Card: finalizados hoje por assunto (substitui “Chamados agendados”) */
body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-assunto-card-title {
  font-size: 0.48rem !important;
  line-height: 1.1 !important;
  margin-bottom: 0.15rem !important;
  opacity: 0.95 !important;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-por-assunto-mini {
  font-size: 0.42rem !important;
  line-height: 1.08 !important;
  width: 100%;
  table-layout: fixed;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-por-assunto-mini td {
  padding: 0.03rem 0.08rem !important;
  border: none !important;
  vertical-align: middle !important;
  color: #000 !important;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-por-assunto-mini td.fin-assunto-nome {
  width: 78%;
  word-break: break-word;
  hyphens: auto;
  padding-right: 0.2rem !important;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-por-assunto-mini td.text-right {
  width: 22%;
  white-space: nowrap;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .fin-assunto-total td {
  border-top: 1px solid rgba(255, 255, 255, 0.28) !important;
  padding-top: 0.14rem !important;
  margin-top: 0.1rem;
}

body.dash-feira-c3 #card-finalizados-por-assunto-dia .count {
  display: none !important;
}

/* Top vendas de planos — pilha: faixa do plano 100% + tabela 100% (evita coluna fina / texto vertical) */
body.dash-feira-c3 #card-top-vendas-planos-mes .card-body {
  padding: 0.35rem 0.45rem 0.5rem !important;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-block {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #aeb8c2;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-plan {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.62rem !important;
  line-height: 1.25 !important;
  padding: 0.28rem 0.5rem !important;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table-wrap {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table {
  width: 100% !important;
  max-width: none !important;
  table-layout: fixed;
  margin: 0 !important;
  font-size: 0.58rem !important;
  line-height: 1.2 !important;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table thead {
  display: table-header-group;
  width: 100%;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table thead th {
  padding: 0.14rem 0.35rem !important;
  font-size: 0.56rem !important;
  font-weight: 600;
  border: none !important;
  vertical-align: middle !important;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table tbody td {
  padding: 0.1rem 0.35rem !important;
  font-size: 0.58rem !important;
  vertical-align: middle !important;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table .c3-tp-col-rank {
  width: 2.25rem;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table .c3-tp-col-qtd {
  width: 2.75rem;
}

body.dash-feira-c3 #card-top-vendas-planos-mes .c3-top-planos-ranking-table tbody td:nth-child(2) {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
