/* Ajuste de layout compacto e melhorado */

/* Container das tabs com fundo e borda */
.tab-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 20px;
  min-height: 200px;
}

/* Tabs mais integradas */
#tabs {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 8px 8px 0 8px;
}

/* Reduzir espaço entre KPIs e tabs */
.row.g-4.mb-4 {
  margin-bottom: 16px !important;
}

/* Tabela dentro da tab */
.tab-content .table-responsive {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
}

.tab-content .card {
  border: none;
  box-shadow: none;
  margin-top: 0 !important;
}

.tab-content .card-body {
  padding: 0;
}

/* Accordion mais compacto */
.accordion {
  margin-bottom: 0 !important;
}

@media (max-width: 991px) {
  .tab-content {
    padding: 12px;
    border-radius: 0 0 8px 8px;
  }
  #tabs {
    border-radius: 8px 8px 0 0;
    padding: 4px 4px 0 4px;
  }
}
/* Styles extracted from monitoramento_unidade template - Aurora-inspired refinements */
/* Chart card helpers */
.chart-card .card-subtitle { font-size: 0.875rem; color: #64748b; }
.chart-card .card-body { padding: 18px; min-height: 340px; display: flex; align-items: center; justify-content: flex-start; }
.chart-legend-small { font-size: 0.82rem; color: #64748b; }

/* Header institucional */
.header-institucional { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: white; border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.header-institucional { background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(99,102,241,0.06) 100%); color: #0f172a; border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; border:1px solid #eef2ff }

/* Full-bleed hero background with centered white card */
.header-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: linear-gradient(135deg, #2b2bd6 0%, #6b46ff 40%, #3b82f6 100%);
  padding: 48px 0;
  box-shadow: inset 0 -48px 80px rgba(11,9,49,0.12);
}
.header-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 12px 40px rgba(2,6,23,0.08);
  border: 1px solid rgba(236,239,255,0.6);
}
.header-hero .text-primary { color: #1e3a8a !important; }
.header-hero .opacity-75 { color: rgba(17,24,39,0.6) !important; }
.header-hero h4 { color: #07104a; }
.header-hero .badge { background: #fff; color: #075985; }
.header-hero { margin-bottom: 20px; }

/* Filtros */
.filter-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }

/* Rankings */
.card-ranking { border: none; border-radius: 16px; }
.list-group-item { border-left: none; border-right: none; padding: 12px 16px; }
.list-group-item:first-child { border-top: none; }

/* Botões */
.btn-export { background: linear-gradient(135deg, #059669 0%, #10B981 100%); border: none; color: white; padding: 10px 20px; border-radius: 8px; font-weight: 600; }
.btn-export:hover { background: linear-gradient(135deg, #047857 0%, #059669 100%); color: white; }

/* Tabs personalizadas */
.nav-tabs { padding-left: 8px; }
.nav-tabs .nav-link { border: none; color: #64748b; font-weight: 600; padding: 10px 16px; border-radius: 8px 8px 0 0; background: transparent; }
.nav-tabs .nav-link.active { color: #075985; background: white; box-shadow: 0 4px 18px rgba(2,6,23,0.04); border-bottom: 0; }
.nav-tabs .nav-link:hover:not(.active) { color: #075985; background: #f8fafc; }

/* Tabela */
.table thead th { background: #f8fafc; font-weight: 600; color: #374151; border-bottom: 2px solid #e2e8f0; padding: 12px 16px; }
.table tbody td { padding: 12px 16px; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }

/* Monitor table: layout fixo com truncamento de texto para caber na largura */
.table-monitor {
  width: 100%;
  font-family: var(--poppins-font);
  font-weight: 300;
}
.table-monitor thead th, .table-monitor tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* evitar quebra vertical que desalinha colunas */
}
.table-monitor tbody td { font-weight: 300; font-size: 0.85rem; }
.table-monitor .col-profissional, .table-monitor .col-unidade { text-transform: capitalize; }
.table-monitor .badge { font-family: var(--poppins-font); font-weight: 300; font-size: 0.8rem; }

/* Responsividade: em telas pequenas permitir quebra vertical */
@media (max-width: 991px) {
  .table-monitor thead th, .table-monitor tbody td { white-space: normal; }
}

/* Barra de rolagem sincronizada (visível logo abaixo da tabela) */
.sync-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px; /* altura para mostrar a barra */
  margin-top: 6px;
}
.sync-scrollbar > div {
  height: 1px; /* filler para provocar o scrollbar horizontal */
}
.sync-scrollbar.fixed {
  position: fixed;
  bottom: 12px;
  z-index: 1200;
  height: 14px;
  background: transparent;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.sync-scrollbar::-webkit-scrollbar { height: 10px; }
.sync-scrollbar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 8px; }
.sync-scrollbar::-webkit-scrollbar-track { background: transparent; }

/* Em temas onde a barra é muito discreta, garantir contraste */
@media (prefers-color-scheme: dark) {
  .sync-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
}

/* KPI card */
.kpi-card { border-radius: 12px; border: 1px solid #eef2ff; background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); }
.kpi-value { font-size: 28px; font-weight: 700; color: #0f172a }
.kpi-label { font-size: 12px; color: #64748b; }
.kpi-icon { width: 52px; height: 52px; border-radius: 12px; display:flex; align-items:center; justify-content:center; font-size:20px; box-shadow: 0 6px 18px rgba(2,6,23,0.06); }
.kpi-card .kpi-icon i { font-size:20px }

/* Aurora-like KPI accent circle */
.kpi-icon.bg-primary { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,165,233,0.06)); color:#075985 }
.kpi-icon.bg-success { background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.06)); color:#065f46 }
.kpi-icon.bg-info { background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(59,130,246,0.04)); color:#075985 }
.kpi-icon.bg-warning { background: linear-gradient(135deg, rgba(250,204,21,0.08), rgba(245,158,11,0.04)); color:#92400e }

/* CBO summary card (melhor alinhamento e espaçamento) */
.cbo-card { border-radius: 14px; border: 1px solid #eef2ff; }
.cbo-card .card-body { padding: 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: center; }
.cbo-title { font-size: 0.85rem; color: #374151; font-weight:600; margin-bottom:8px; }
.cbo-row { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.cbo-label { font-size: 0.78rem; color: #64748b; }
.cbo-value { font-size: 1.05rem; font-weight:700; color: #0f172a; }
.cbo-value.primary { color: #1e40af; }
.cbo-value.emph { color: #0f172a; font-weight:800; }
.cbo-pair { margin-top:6px; }

@media (max-width: 767.98px){
  .cbo-card .card-body { min-height: auto; }
  .cbo-row { gap:8px; }
}

/* Grid responsivo para os cards de CBO (melhor uso do espaço) */
.cbo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}
.cbo-grid > .col-12 { grid-column: 1 / -1; }
.cbo-item { display: block; }
.cbo-card { width: 100%; background: white; border-radius:14px; }
.cbo-card .card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px;
  min-height: 96px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,255,0.6));
}
.cbo-title { font-size: 0.92rem; white-space: normal; line-height:1.15; margin-bottom:6px; font-weight:600; color:#063852; display:block; max-height:2.6em; overflow:hidden; }
.cbo-metrics { display:flex; gap:12px; align-items:center; width:100%; }
.cbo-metric { display:flex; flex-direction:column; align-items:flex-end; gap:4px; min-width:86px; }
.cbo-metric .label { font-size:0.75rem; color:#64748b; }
.cbo-metric .value { font-size:1rem; font-weight:700; color:#0f172a; }
.cbo-metric .value.primary { color:#075985; }
.cbo-metric .value.emph { color:#0f172a; }
.cbo-icon-wrapper{ width:36px; height:36px; display:flex; align-items:center; justify-content:center; border-radius:8px; background: rgba(99,102,241,0.06); flex-shrink:0 }
.cbo-icon{ width:28px; height:28px; object-fit:contain }
.cbo-icon-placeholder{ font-size:20px; color:#075985 }
.cbo-badge{ padding:6px 10px; border-radius:10px; font-weight:700; display:inline-block; transition: transform 140ms ease, box-shadow 140ms ease; }
.cbo-badge-primary{ background: #075985; color: #ffffff; }
.cbo-badge-info{ background: #0ea5e9; color: #ffffff; }
.cbo-badge:hover{ transform: translateY(-2px); box-shadow: 0 8px 20px rgba(2,6,23,0.08); }

/* Reduce card padding slightly for denser grid */
.kpi-card .card-body { padding: 14px; }

@media (max-width: 576px) {
  .cbo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cbo-card .card-body { flex-direction: column; align-items: flex-start; }
  .cbo-metrics, .cbo-values { align-items:flex-start; min-width:0; }
}

/* Force exactly 3 columns on large desktop */
@media (min-width: 1200px) {
  .cbo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Typography / scale tweaks to better match Aurora */
body { font-size: 15px; }
.kpi-value { font-size: 32px; }
.cbo-title { font-size: 0.98rem; }
.kpi-label { font-size: 12px; color: #64748b; }

/* Subtle shadow and hover for cards to mirror Aurora style */
.card:hover { transform: translateY(-4px); transition: transform 180ms ease; box-shadow: 0 10px 30px rgba(2,6,23,0.06); }
.card { transition: transform 180ms ease, box-shadow 180ms ease; }

/* Typography refinements */
h4, .card-title { font-weight: 700; color: #0f172a }
.small.text-muted { color: #64748b }

/* Chart card visual polish */
.chart-card .card-body { padding: 18px; }
.chart-card canvas { border-radius: 8px; }

/* Usuário / Turno table: profissional em MAIÚSCULAS e ajustado espaçamento */
#kpi-usuario-turno table thead th { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.2px; }
#kpi-usuario-turno table tbody td:first-child { text-transform: uppercase; font-weight: 600; color: #0f172a; }
#kpi-usuario-turno .table-sm td, #kpi-usuario-turno .table-sm th { padding: 10px 12px; }
#kpi-usuario-turno .small.text-muted { margin-left: 8px }

/* Aurora-like refinements */
.kpi-card .card-body { display:flex; align-items:center; justify-content:space-between; padding:18px; }
.kpi-card .kpi-left { display:flex; flex-direction:column; }
.kpi-trend { font-size:12px; color:#10B981; font-weight:600 }
.card.chart-card { border-radius:14px; border:1px solid #eef2ff; }
.card.chart-card .card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:none; background:transparent }
.card.chart-card .card-title { margin:0; font-size:16px; font-weight:700 }
.card.chart-card .card-subtitle { color:#94a3b8 }
.chart-legend-small { color:#94a3b8 }

/* small screens: stack KPI values and center */
@media (max-width:767.98px){
  .kpi-card .card-body{flex-direction:row;gap:12px}
  .kpi-card .kpi-left{text-align:left}
}

/* Misc */
.btn-excel { background: #fff; border: 1px solid #e6edf7; color: #0f172a; padding: 8px 12px; border-radius:8px }
.btn-pdf { background: #fff; border: 1px solid #e6edf7; color:#0f172a;padding:8px 12px;border-radius:8px }

/* ========================================
   TABELA LISTAGEM - ESTILOS ARCO-ÍRIS PROFISSIONAL
   ======================================== */
/* Cores distintas por linha rotativas para a coluna profissional */
.table-monitor tbody tr:nth-child(12n+1) .col-profissional { color: #3b82f6; font-weight:500; }  /* azul */
.table-monitor tbody tr:nth-child(12n+2) .col-profissional { color: #22c55e; font-weight:500; }  /* verde */
.table-monitor tbody tr:nth-child(12n+3) .col-profissional { color: #f59e0b; font-weight:500; }  /* laranja */
.table-monitor tbody tr:nth-child(12n+4) .col-profissional { color: #ef4444; font-weight:500; }  /* vermelho */
.table-monitor tbody tr:nth-child(12n+5) .col-profissional { color: #8b5cf6; font-weight:500; }  /* roxo */
.table-monitor tbody tr:nth-child(12n+6) .col-profissional { color: #06b6d4; font-weight:500; }  /* ciano */
.table-monitor tbody tr:nth-child(12n+7) .col-profissional { color: #ec4899; font-weight:500; }  /* rosa */
.table-monitor tbody tr:nth-child(12n+8) .col-profissional { color: #14b8a6; font-weight:500; }  /* teal */
.table-monitor tbody tr:nth-child(12n+9) .col-profissional { color: #f97316; font-weight:500; }  /* laranja escuro */
.table-monitor tbody tr:nth-child(12n+10) .col-profissional { color: #6366f1; font-weight:500; } /* indigo */
.table-monitor tbody tr:nth-child(12n+11) .col-profissional { color: #84cc16; font-weight:500; } /* lima */
.table-monitor tbody tr:nth-child(12n+12) .col-profissional { color: #0ea5e9; font-weight:500; } /* sky */

/* Layout melhorado da tabela - larguras fixas balanceadas */
.table-monitor { table-layout: fixed; width: 100%; }
.table-monitor .col-data { width: 10%; min-width: 90px; }
.table-monitor .col-tipo { width: 16%; min-width: 140px; }
.table-monitor .col-profissional { width: 22%; min-width: 180px; font-size: 0.88rem; }
.table-monitor .col-cbo { width: 10%; min-width: 95px; }
.table-monitor .col-tempo { width: 8%; min-width: 70px; text-align: center; }
.table-monitor .col-unidade { width: 18%; min-width: 160px; }
.table-monitor .col-equipe { width: 10%; min-width: 100px; }
.table-monitor .col-status { width: 10%; min-width: 100px; text-align: center; }

/* Ajuste de cabeçalho - mais destaque */
.table-monitor thead th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  padding: 14px 12px;
  white-space: nowrap;
}

/* Linhas zebradas sutis */
.table-monitor tbody tr:nth-child(even) { background: #fafbfc; }
.table-monitor tbody tr:hover { background: #f0f9ff; }

/* Dashboard grid refinements */
.dashboard-container { padding: 20px 12px; max-width: 1600px; margin: 0 auto; }

/* Print helpers kept as in-template rules */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  html { zoom: 1 !important; transform: scale(1) !important; transform-origin: top left !important; }
  body { width:100% !important; margin:0 !important; padding:0 !important; background:white !important; }
  a[href]:after { content: none !important; }
  .no-print, .loading-overlay, .filter-card, .btn-export, .btn-outline-secondary, .nav-tabs, #listagem { display:none !important }
  .dashboard-container { padding:0 8px !important; max-width:100% !important }
}
