:root {
  /* Color Palette - Light Theme (Padrão idêntico a oficios.barretosinteligente.com.br) */
  --bg-main: #f8fafc;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #10a37f;

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --accent-primary: #10a37f;        /* Emerald padrão */
  --accent-primary-hover: #0e8c6d;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;

  --badge-bg: #f1f5f9;
  --badge-text: #334155;

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.12);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Escuro (Dark Theme padrão idêntico a oficios.barretosinteligente.com.br) */
[data-theme="dark"] {
  --bg-main: #131418;
  --bg-primary: #131418;
  --bg-secondary: #1c1e24;
  --bg-card: #1c1e24;
  --bg-card-hover: #23262e;
  --bg-header: #18191f;
  --bg-input: #20222a;
  --bg-modal: #181a20;

  --border-color: #2e323b;
  --border-subtle: #242730;
  --border-focus: #10a37f;

  --text-main: #f3f4f6;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --badge-bg: #262933;
  --badge-text: #d1d5db;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip !important;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  overflow-x: clip !important;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Estrutura do Layout: 100% Fluida sem caixas gigantes em volta */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   Header Sticky Unificado (Barra de Título + Abas de Navegação Fixas)
   ========================================================================== */
.sticky-header-wrapper {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background-color: var(--bg-header);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease, box-shadow 0.2s ease, border-color 0.3s ease;
}

.sticky-header-wrapper.is-scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .sticky-header-wrapper {
  background-color: var(--bg-header);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .sticky-header-wrapper.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   Navbar Superior (100% Idêntica a oficios.barretosinteligente.com.br)
   ========================================================================== */
.navbar {
  height: 58px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: relative;
  z-index: 50;
  backdrop-filter: blur(8px);
  gap: 12px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: max-content;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  color: inherit !important;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo:hover {
  text-decoration: none !important;
  opacity: 0.92;
}

.brand-logo-img,
.header-logo {
  height: 30px;
  max-height: 30px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  transition: var(--transition);
  flex-shrink: 0;
}

[data-theme="dark"] .brand-logo-img {
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.brand-divider {
  width: 1px;
  height: 22px;
  background-color: var(--border-color);
  margin: 0 2px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.brand-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary) !important;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none !important;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted) !important;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none !important;
}

/* Botão Voltar ao HUB Central */
.btn-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--accent-primary, #10a37f);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back-hub svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.btn-back-hub:hover {
  background: var(--accent-primary, #10a37f);
  color: #ffffff !important;
  border-color: var(--accent-primary, #10a37f);
  transform: translateX(-2px);
  box-shadow: 0 3px 10px rgba(16, 163, 127, 0.35);
  text-decoration: none !important;
}

[data-theme="dark"] .btn-back-hub {
  background: var(--bg-card);
  color: #10a37f;
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-back-hub:hover {
  background: #10a37f;
  color: #ffffff !important;
}

/* Central Module Switcher (Pill Navigation) */
.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--badge-bg);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none !important;
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-pill svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.nav-pill:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
}

[data-theme="dark"] .nav-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-pill.active {
  background: var(--bg-card);
  color: var(--accent-primary, #10a37f);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-pill.active {
  color: #10a37f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1240px) {
  .nav-center {
    display: none !important;
  }
}

/* Stat Pill */
.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--badge-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

.stat-pill svg {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Botões da Navbar (Padrão Ofícios) */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 32px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn svg {
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.nav-btn.btn-import {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  font-weight: 600;
  padding: 0 12px;
}

.nav-btn.btn-import:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.nav-btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
}

/* ==========================================================================
   Subnav Bar (Chips de Navegação - Padrão Ofícios Executivo)
   ========================================================================== */
.subnav-bar {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 3px 1.25rem;
  position: relative;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.subnav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  white-space: nowrap;
}
.subnav-container::-webkit-scrollbar {
  display: none;
}

.subnav-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.subnav-chip svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

.subnav-chip:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.subnav-chip.active {
  background-color: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.subnav-chip.highlight-star {
  border-color: rgba(245, 158, 11, 0.35);
  background-color: rgba(245, 158, 11, 0.04);
}

.subnav-chip.highlight-star:hover {
  border-color: var(--warning);
  background-color: rgba(245, 158, 11, 0.09);
  color: var(--text-primary);
}

.subnav-chip.highlight-star.active {
  background-color: rgba(245, 158, 11, 0.14);
  border-color: var(--warning);
  color: #b45309;
  font-weight: 600;
}

[data-theme="dark"] .subnav-chip.highlight-star.active {
  color: #fbbf24;
}

.subnav-chip .chip-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

.subnav-chip .chip-badge.highlight {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}

.subnav-chip .chip-badge.alert {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.subnav-chip .chip-badge.star-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

[data-theme="dark"] .subnav-chip .chip-badge.star-badge {
  color: #fbbf24;
}

/* ==========================================================================
   Container Principal de Conteúdo
   ========================================================================== */
.main-container {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 2rem 4rem 2rem;
}

/* Dropdown de Filtro de Datas no Topbar */
.filter-dropdown-wrapper {
  position: relative;
}

.btn-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-filter-trigger:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.filter-btn-pill {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.chevron-icon {
  transition: transform 0.2s ease;
  color: var(--text-dim);
}

.filter-dropdown-wrapper.open .chevron-icon {
  transform: rotate(180deg);
}

.filter-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 350px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}

.filter-dropdown-wrapper.open .filter-popover {
  display: block;
}

.popover-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.popover-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

.popover-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.popover-close:hover {
  color: var(--text-main);
}

.popover-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popover-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.popover-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.popover-presets .preset-btn:last-child {
  grid-column: span 2;
}

.popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 0;
}

.popover-dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.popover-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popover-input-group label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.popover-input-group input {
  width: 100%;
}

.popover-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.popover-actions-row .btn-filter-apply {
  flex: 1;
}

.popover-summary {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.content-body {
  padding: 22px 26px;
  max-width: 1650px;
  margin: 0 auto;
  width: 100%;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite;
  display: inline-block;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-header.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-header.primary:hover {
  background: #2563eb;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--text-main);
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.tab-badge {
  font-size: 0.7rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Tab Panels */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.purple::before { background: var(--accent-purple); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.3;
}

.kpi-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kpi-tag-mes {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.kpi-tag-mes.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.22);
}

[data-theme="dark"] .kpi-tag-mes {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .kpi-tag-mes.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Badges MoM (Comparação Mês a Mês com Seta) */
.kpi-mom-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.25;
  transition: all 0.15s ease;
}

.kpi-mom-badge.up-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.kpi-mom-badge.down-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.kpi-mom-badge.up-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.kpi-mom-badge.down-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.kpi-mom-badge.down-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.kpi-mom-badge.neutral {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(148, 163, 184, 0.2);
}


.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 8px;
}

.kpi-value-row .kpi-value {
  margin-bottom: 0;
}

.kpi-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 3px;
}

.kpi-badge-secondary {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

[data-theme="light"] .kpi-badge-secondary {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  min-width: 0;
  width: 100%;
}

.kpi-footer > * {
  white-space: normal;
  word-break: normal;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-alert { color: var(--warning); }

/* Badges de Status tipo Pill */
.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.kpi-pill.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.kpi-pill.success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .kpi-pill.danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

[data-theme="light"] .kpi-pill.success {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pill-dot.red { background: #ef4444; }
.pill-dot.green { background: #10b981; }

/* Grid 2 Columns */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }

@media (max-width: 1024px) {
  .col-8, .col-7, .col-6, .col-5, .col-4 {
    grid-column: span 12;
  }
}

/* Chart Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-top: 2px;
}

/* ==========================================================================
   Controles de Drill-Down & Granularidade (Padrão Executivo Power BI)
   ========================================================================== */
.pbi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.drill-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background-color: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: fadeIn 0.25s ease;
}

[data-theme="dark"] .drill-badge {
  background-color: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

.drill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.pbi-drill-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drill-toggle-pills {
  display: flex;
  align-items: center;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.drill-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.drill-pill-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
}

.drill-pill-btn.active {
  background-color: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.drill-up-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary);
  border-radius: var(--radius-md);
  padding: 5px 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}

.drill-up-btn:hover {
  background-color: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  color: var(--primary-light);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-wrapper-tall {
  position: relative;
  width: 100%;
  height: 380px;
}

/* Layout Dividido para Distribuição por Bairros (Sem Scroll) */
.bairros-layout-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1080px) {
  .bairros-layout-grid {
    grid-template-columns: 1fr;
  }
}

.bairros-chart-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  min-height: 440px;
}

.bairros-chart-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 350px;
}

.bairros-side-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
}

.bairros-info-card {
  margin-bottom: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px;
}

/* Grid de SLA Individual por Equipe */
.equipes-sla-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .equipes-sla-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.equipe-sla-badge-item {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.eq-badge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.eq-badge-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.eq-badge-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.eq-badge-tag.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.eq-badge-tag.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

[data-theme="dark"] .eq-badge-tag.warning {
  color: #fbbf24;
}

.eq-badge-tag.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.eq-badge-sub {
  font-size: 0.69rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Simulator / Regression Hero */
.simulator-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.1);
  position: relative;
}

[data-theme="light"] .simulator-hero {
  background: linear-gradient(135deg, #f8fafc, #edf2f7);
  border-color: rgba(37, 99, 235, 0.3);
}

.sim-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-val-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #23314d;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.toggle-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

/* Projection Results Banner */
.projection-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.proj-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), var(--bg-card));
}

.proj-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.proj-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.proj-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Reverse Calculator Box */
.calculator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.calc-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  width: 90px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

/* Tables */
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Search Input */
.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 250px;
  outline: none;
}
.search-input:focus {
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   Resumo do Dia • Visão Marcela (Executive Daily Briefing)
   ========================================================================== */
.resumo-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-image: radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.08) 0px, transparent 60%);
}

.resumo-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .resumo-hero-badge {
  color: #fbbf24;
}

.resumo-hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.resumo-hero-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 840px;
  margin-bottom: 18px;
}

.resumo-status-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.resumo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.resumo-pill.status-green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}
[data-theme="dark"] .resumo-pill.status-green {
  color: #34d399;
}

.resumo-pill.status-blue {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}
[data-theme="dark"] .resumo-pill.status-blue {
  color: #60a5fa;
}

/* Grid dos 4 Pilares */
.resumo-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.resumo-pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.resumo-pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.35);
}

.resumo-pillar-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.resumo-pillar-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.resumo-pillar-icon.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.resumo-pillar-icon.red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.resumo-pillar-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.resumo-pillar-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.resumo-pillar-titles {
  flex: 1;
}

.resumo-pillar-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.resumo-pillar-tag.green { color: #059669; }
.resumo-pillar-tag.red { color: #dc2626; }
.resumo-pillar-tag.blue { color: #2563eb; }
.resumo-pillar-tag.purple { color: #7c3aed; }
[data-theme="dark"] .resumo-pillar-tag.green { color: #34d399; }
[data-theme="dark"] .resumo-pillar-tag.red { color: #f87171; }
[data-theme="dark"] .resumo-pillar-tag.blue { color: #60a5fa; }
[data-theme="dark"] .resumo-pillar-tag.purple { color: #c084fc; }

.resumo-pillar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.resumo-pillar-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.resumo-pillar-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Checklist de Decisões Estratégicas para Marcela */
.resumo-decisions-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.decision-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.decision-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.decision-content {
  flex: 1;
}

.decision-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.decision-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Insights Box */
.insight-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 20px;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.insight-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.insight-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Code Container */
.code-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  margin: 12px 0 20px;
}

.code-container pre {
  margin: 0;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  color: #93c5fd;
  overflow-x: auto;
  line-height: 1.5;
}

.btn-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--primary);
}

/* Modal Overlay & Upload */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 20px 0;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Print Stylesheet (Exportar PDF Executivo) */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .header-meta, .btn-header, .nav-tabs, .simulator-hero, .btn-refresh, .search-input, .modal-overlay {
    display: none !important;
  }
  .app-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .tab-content {
    display: block !important;
  }
  .card, .kpi-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    background: #fff !important;
  }
  .kpi-value, .kpi-title, .card-title {
    color: #000 !important;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .app-layout.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .content-body {
    padding: 14px;
  }
  .filter-popover {
    width: calc(100vw - 32px);
    right: -14px;
  }
}

.filter-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

.preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.filter-custom-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-field span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.date-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.date-input:focus {
  border-color: var(--primary);
}

.btn-filter-apply {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter-apply:hover {
  background: #2563eb;
}

.btn-filter-reset {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter-reset:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Notificação Toast Flutuante */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  pointer-events: none;
}

[data-theme="light"] .toast {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   TABELA ANALÍTICA & AUDITORIA DE INDICADORES (DRILL-DOWN)
   ========================================================= */

.analitico-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
}

[data-theme="light"] .analitico-notice-box {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
}

.analitico-notice-box .notice-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.analitico-notice-box .notice-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-main);
}

.analitico-notice-box .notice-text code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #38bdf8;
  font-family: monospace;
}

[data-theme="light"] .analitico-notice-box .notice-text code {
  background: #e2e8f0;
  color: #0284c7;
}

/* Strip de Mini KPIs Dinâmicos (Compacto & Elegante) */
.analitico-top-card {
  margin-bottom: 10px !important;
  padding: 12px 18px 14px 18px !important;
}

.analitico-top-card .card-header {
  padding: 0 0 10px 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: 10px !important;
}

.analitico-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 1100px) {
  .analitico-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .analitico-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.analitico-kpi-card {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.analitico-kpi-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.4);
}

.analitico-kpi-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.analitico-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
}

.analitico-kpi-val.highlight-blue {
  color: #38bdf8;
}

.analitico-kpi-val.highlight-green {
  color: #22c55e;
}

.analitico-kpi-val.highlight-red {
  color: #ef4444;
}

.analitico-kpi-val.highlight-gray {
  color: #94a3b8;
}

[data-theme="light"] .analitico-kpi-val.highlight-blue {
  color: #0284c7;
}

[data-theme="light"] .analitico-kpi-val.highlight-green {
  color: #16a34a;
}

[data-theme="light"] .analitico-kpi-val.highlight-red {
  color: #dc2626;
}

.analitico-kpi-sub {
  font-size: 0.67rem;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.1;
}

/* Barra de Filtros e Busca (Compacta) */
.analitico-filter-card {
  margin-bottom: 10px !important;
  padding: 8px 14px !important;
}

.analitico-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.analitico-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  min-width: 170px;
}

.analitico-search-box svg {
  position: absolute;
  left: 10px;
  color: var(--text-dim);
  pointer-events: none;
}

.analitico-search-box input {
  width: 100%;
  height: 32px;
  padding: 4px 28px 4px 30px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
  transition: all 0.2s ease;
}

.analitico-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.analitico-search-box .btn-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}

/* ==================== SELECTS EXECUTIVOS (PADRÃO PMO) ==================== */
.custom-select,
.select-executivo {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  width: 100%;
  height: 38px;
  padding: 8px 36px 8px 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .custom-select,
[data-theme="dark"] .select-executivo {
  background-color: #172033;
  border-color: #26354f;
  color: #f1f5f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .custom-select,
[data-theme="light"] .select-executivo {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.custom-select:hover,
.select-executivo:hover {
  border-color: var(--primary);
  background-color: var(--bg-hover, rgba(59, 130, 246, 0.06));
}

.custom-select:focus,
.select-executivo:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.custom-select option,
.select-executivo option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 10px 12px;
  font-weight: 500;
}

[data-theme="dark"] .custom-select option,
[data-theme="dark"] .select-executivo option {
  background-color: #131c31;
  color: #f1f5f9;
}

[data-theme="light"] .custom-select option,
[data-theme="light"] .select-executivo option {
  background-color: #ffffff;
  color: #0f172a;
}

.analitico-select-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.analitico-select-group .filter-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.analitico-select-group .custom-select {
  height: 32px;
  padding: 4px 26px 4px 8px;
  font-size: 0.76rem;
  border-radius: 6px;
  width: auto;
  min-width: 115px;
}

/* ==================== BOTÕES DE EXPORTAÇÃO EXCEL ==================== */
.btn-export-excel,
#btn-exportar-analitico {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

/* Modo Dark para o botão Excel */
[data-theme="dark"] #btn-exportar-analitico,
[data-theme="dark"] .btn-export-excel {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(5, 150, 105, 0.26) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #btn-exportar-analitico:hover,
[data-theme="dark"] .btn-export-excel:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] #btn-exportar-analitico:active,
[data-theme="dark"] .btn-export-excel:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

/* Modo Light para o botão Excel */
[data-theme="light"] #btn-exportar-analitico,
[data-theme="light"] .btn-export-excel {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
  color: #047857;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}

[data-theme="light"] #btn-exportar-analitico:hover,
[data-theme="light"] .btn-export-excel:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

/* Ícone SVG do Excel */
#btn-exportar-analitico svg,
.btn-export-excel svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

#btn-exportar-analitico:hover svg,
.btn-export-excel:hover svg {
  transform: translateY(1px) scale(1.08);
}

/* ==================== BOTÃO OUTLINE / RESET ==================== */
.btn-outline,
.btn-reset-analitico,
#btn-reset-analitico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-outline:hover,
.btn-reset-analitico:hover,
#btn-reset-analitico:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.analitico-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

.quick-chip {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.quick-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Tabela e Cabeçalhos com Ordenação */
.analitico-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.analitico-table th.sortable:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.analitico-table th.active-sort {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.analitico-table th .sort-icon {
  font-size: 0.7rem;
  margin-left: 4px;
  opacity: 0.6;
}

.analitico-table th.active-sort .sort-icon {
  opacity: 1;
  font-weight: bold;
}

.analitico-table td {
  padding: 8px 12px;
  font-size: 0.82rem;
  vertical-align: middle;
}

/* Badges de TMA (Tempo Médio de Atendimento) */
.tma-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tma-badge small {
  font-weight: 500;
  opacity: 0.85;
}

.tma-badge-quick {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tma-badge-ontime {
  background: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.tma-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tma-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .tma-badge-quick {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

[data-theme="light"] .tma-badge-ontime {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

[data-theme="light"] .tma-badge-warning {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

[data-theme="light"] .tma-badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Paginação */
.analitico-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 4px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-page {
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-current-pill {
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

/* =========================================================
   ESTILOS DE IMPRESSÃO / EXPORTAÇÃO EM PDF (@media print)
   ========================================================= */
.print-header {
  display: none !important;
}

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

  *, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  /* Reset dos Containers para evitar cortes e páginas em branco */
  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar elementos de navegação de tela e botões */
  .sticky-header-wrapper,
  .navbar,
  .subnav-bar,
  .subnav-container,
  .sidebar,
  .topbar,
  .btn-sidebar-collapse,
  .modal-overlay,
  .toast,
  .btn-copy,
  .filter-popover,
  .btn-filter-trigger,
  .filter-dropdown-wrapper {
    display: none !important;
  }

  /* Desbloquear containers flex e viewport */
  .app-layout,
  .main-content,
  .content-body,
  .main-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: static !important;
    background: transparent !important;
  }

  /* Exibir Cabeçalho Executivo de Impressão */
  .print-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .print-brand-left {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
  }

  .print-logo-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .print-header img,
  .print-logo-card img,
  .header-logo {
    height: 34px !important;
    max-height: 34px !important;
    width: auto !important;
    max-width: 160px !important;
    object-fit: contain !important;
    display: block !important;
  }

  .print-titles h2 {
    font-size: 13pt !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  .print-titles p {
    font-size: 8pt !important;
    color: #475569 !important;
    margin: 2px 0 0 0 !important;
  }

  .print-meta-right {
    text-align: right !important;
    font-size: 8pt !important;
    color: #475569 !important;
    line-height: 1.4 !important;
  }

  /* Abas: Apenas a ativa deve ser impressa */
  .tab-content {
    display: none !important;
  }

  .tab-content.active {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* Grid de KPIs no papel: 5 colunas nítidas */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .kpi-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 10px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    box-shadow: none !important;
  }

  .kpi-card::before {
    display: none !important;
  }

  .kpi-title {
    color: #475569 !important;
    font-size: 7pt !important;
  }

  .kpi-value {
    color: #0f172a !important;
    font-size: 15pt !important;
  }

  .kpi-unit {
    color: #64748b !important;
    font-size: 8.5pt !important;
  }

  .kpi-badge-secondary {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 7pt !important;
  }

  .kpi-footer {
    border-top: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    font-size: 7pt !important;
    padding-top: 6px !important;
  }

  .kpi-pill.danger {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
  }

  .kpi-pill.success {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0 !important;
  }

  /* Cards e Gráficos */
  .grid-2 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .col-7 { width: 58% !important; flex: 0 0 58% !important; }
  .col-5 { width: 40% !important; flex: 0 0 40% !important; }
  .col-8 { width: 65% !important; flex: 0 0 65% !important; }
  .col-4 { width: 33% !important; flex: 0 0 33% !important; }
  .col-6 { width: 49% !important; flex: 0 0 49% !important; }
  .col-12 { width: 100% !important; flex: 0 0 100% !important; }

  .card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 12px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 12px !important;
  }

  .card-header h2, .card-header h3 {
    color: #0f172a !important;
    font-size: 10pt !important;
  }

  .card-header p {
    color: #64748b !important;
    font-size: 7.5pt !important;
  }

  .chart-container {
    height: 240px !important;
    max-height: 240px !important;
    position: relative !important;
  }

  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Tabelas */
  .table-responsive {
    overflow: visible !important;
    width: 100% !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8pt !important;
  }

  th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 6px 8px !important;
  }

  td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    padding: 5px 8px !important;
  }

  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Simulador em Impressão */
  .simulator-hero {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .simulator-controls {
    display: none !important;
  }

  .table-filter-bar {
    display: none !important;
  }
}

/* ==========================================
   TIMELINE DE EVOLUÇÃO DO BACKLOG (TAB-BACKLOG)
   ========================================== */
.backlog-timeline-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.timeline-kpi-item {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tkpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
}

.tkpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
}

.tkpi-val.red { color: #f87171; }
.tkpi-val.amber { color: #fbbf24; }
.tkpi-val.blue { color: #60a5fa; }
.tkpi-val.green { color: #34d399; }

.tkpi-sub {
  font-size: 0.74rem;
  color: var(--text-dim, #64748b);
}

/* ==========================================
   MODAL DE UPLOAD COM SELEÇÃO DE CATEGORIA E PREVIEW
   ========================================== */
.upload-category-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.04));
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-chip input {
  display: none;
}

.category-chip:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--text-main, #f8fafc);
}

.category-chip.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.upload-preview-box {
  margin-top: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ufile-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ufile-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ufile-icon {
  font-size: 1.5rem;
}

.ufile-badge-target {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.ufile-badge-target.pendente {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ufile-badge-target.atendido {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-confirm-upload {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-upload:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.upload-loading-bar {
  margin-top: 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #34d399;
  font-weight: 600;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================
   AVISO DE ATUALIZAÇÃO DAS PLANILHAS (TOPBAR)
   ========================================== */
.topbar-sync-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-full, 20px);
  padding: 5px 12px;
  font-size: 0.76rem;
  color: var(--text-secondary, #94a3b8);
  cursor: default;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.topbar-sync-notice:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.sync-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.sync-notice-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sync-notice-label {
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.sync-notice-val {
  color: var(--text-main, #f8fafc);
  font-weight: 500;
}

.sync-notice-val strong {
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
}

.sync-notice-val span {
  font-weight: 700;
  color: #10b981;
}

@media (max-width: 960px) {
  .sync-notice-label {
    display: none;
  }
}

/* ==========================================================================
   RESPONSIVIDADE PREMIUM & LAYOUT FIXO MOBILE (PADRÃO OFÍCIOS / APP NATIVO)
   Bloqueia distorção, elimina arraste lateral (vácuo) e fixa o layout
   ========================================================================== */

/* Regras globais de proteção anti-vácuo */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
  overscroll-behavior-x: none !important;
  -webkit-overflow-scrolling: touch;
}

.app-layout,
.navbar,
.subnav-bar,
.main-container,
.tab-content,
.grid-12,
.card {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* Gráficos contidos sem estourar viewport */
canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* Telas Tablets e Médias (max-width: 1024px) */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 1.25rem;
  }
  .main-container {
    padding: 1.25rem 1.25rem 3.5rem 1.25rem;
  }
  .grid-12 {
    gap: 16px;
  }
  .col-8, .col-7, .col-6, .col-5, .col-4 {
    grid-column: span 12 !important;
  }
  .bairros-layout-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Telas Mobile Smartphones (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip !important;
    position: relative;
  }

  .app-layout {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip !important;
  }

  /* 1. Navbar Superior Compacta e Fixa */
  .navbar {
    height: 56px;
    padding: 0 0.85rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: visible;
  }

  .brand-logo {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .btn-back-hub {
    padding: 0 8px !important;
    height: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    justify-content: center !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .btn-back-hub span {
    display: none !important;
  }

  .brand-logo-img {
    height: 26px;
    max-width: 110px;
    flex-shrink: 0;
  }

  .brand-divider,
  .brand-subtitle,
  .stat-pill,
  .nav-center,
  .topbar-sync-notice {
    display: none !important;
  }

  .brand-title {
    font-size: 0.9rem;
    line-height: 1.1;
  }

  .nav-right {
    gap: 0.35rem;
  }

  .nav-btn {
    padding: 0 8px;
    height: 32px;
    min-height: 32px;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .nav-btn span:not(.filter-btn-pill) {
    display: none !important;
  }

  #btn-filter-trigger {
    padding: 0 8px;
    height: 32px;
  }

  #btn-filter-trigger span#filter-btn-label {
    display: none !important;
  }

  /* 2. Subnav Chips com Rolagem Horizontal Suave e Contida */
  .subnav-bar {
    padding: 0.3rem 0.65rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: visible;
  }

  .subnav-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    padding: 4px 2px;
    gap: 0.4rem;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }

  .subnav-container::-webkit-scrollbar {
    display: none;
  }

  .subnav-chip {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    min-height: 32px;
    white-space: nowrap;
  }

  /* 3. Container Principal */
  .main-container {
    width: 100%;
    max-width: 100vw;
    padding: 0.85rem 0.65rem 3rem 0.65rem;
    overflow-x: clip !important;
    box-sizing: border-box;
  }

  /* 4. Grid e Colunas 100% de largura */
  .grid-12 {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: span 12 !important;
    box-sizing: border-box;
  }

  /* 5. Cards & Gráficos */
  .card {
    padding: 14px 12px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .card-title {
    font-size: 0.95rem;
    word-break: break-word;
  }

  .card-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-input {
    width: 100% !important;
    max-width: 100% !important;
  }

  .chart-wrapper,
  .chart-wrapper-tall,
  .bairros-chart-wrapper {
    height: 260px !important;
    min-height: 260px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
  }

  /* 6. Grid de KPIs (2 colunas organizadas) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .kpi-card {
    padding: 12px 10px;
    min-width: 0 !important;
  }

  .kpi-title {
    font-size: 0.7rem;
  }

  .kpi-value {
    font-size: 1.35rem;
    word-break: break-word;
  }

  .kpi-sub {
    font-size: 0.68rem;
  }

  /* 7. Distribuição de Carros / Bairros */
  .bairros-layout-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100%;
  }

  .bairros-chart-card {
    min-height: auto;
  }

  .bairros-side-column {
    gap: 12px;
    width: 100%;
  }

  .bairros-info-card {
    padding: 14px 12px;
  }

  .equipes-sla-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
  }

  /* 8. Popover de Filtro Fixo na Tela (Sem estourar laterais) */
  .filter-popover {
    position: fixed !important;
    top: 60px !important;
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 500;
  }

  .popover-dates-grid {
    grid-template-columns: 1fr !important;
    gap: 6px;
  }

  .filter-presets {
    gap: 4px;
  }

  .preset-btn {
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  /* 9. Tabelas e Analítico */
  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    box-sizing: border-box;
  }

  .analitico-filters-bar {
    padding: 12px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .analitico-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .analitico-search-box {
    width: 100%;
    min-width: 0;
  }

  .analitico-select-group {
    width: 100%;
    min-width: 0;
  }

  .analitico-select-group select {
    width: 100%;
  }

  .analitico-quick-chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .analitico-quick-chips::-webkit-scrollbar {
    display: none;
  }

  .quick-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .analitico-pagination {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  /* 10. Modais Mobile */
  .modal-container,
  .upload-modal-container {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 90vh !important;
    margin: 10px auto;
    padding: 16px 12px;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }

  .drop-zone {
    padding: 1.5rem 1rem;
  }
}

/* Telas Muito Pequenas (max-width: 480px) */
@media (max-width: 480px) {
  .topbar-sync-notice {
    display: none !important;
  }

  .brand-logo-img {
    height: 24px;
    max-width: 105px;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }

  .kpi-card {
    padding: 10px 8px;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .chart-wrapper,
  .chart-wrapper-tall,
  .bairros-chart-wrapper {
    height: 240px !important;
    min-height: 240px !important;
  }

  .btn-filter-trigger {
    padding: 5px 8px;
  }

  .filter-btn-pill {
    display: none;
  }
}

/* ==========================================================================
   MODAL DE UPLOAD DE PLANILHAS & AUDITORIA DE COLUNAS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  border-radius: 8px;
  padding: 4px 8px;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.upload-category-selector {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-sub);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.category-chip input[type="radio"] {
  display: none;
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card-sub);
  transition: all 0.25s ease;
  user-select: none;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.upload-preview-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.ufile-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ufile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ufile-icon {
  font-size: 1.8rem;
}

.ufile-badge-target {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ufile-badge-target.pendente {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ufile-badge-target.atendido {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.column-audit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.audit-stat-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}

.audit-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.audit-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.audit-table-mini {
  width: 100%;
  font-size: 0.73rem;
  border-collapse: collapse;
  margin-top: 10px;
}

.audit-table-mini th {
  text-align: left;
  padding: 5px 8px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.audit-table-mini td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.btn-confirm-upload {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-upload:hover {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.upload-loading-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-card-sub);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   Banner Executivo de Alerta de Sobrescrita de Importação Diária
   ========================================================================== */
.upload-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  animation: fadeInWarning 0.25s ease-out;
}

@keyframes fadeInWarning {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.warning-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-icon {
  font-size: 1rem;
  line-height: 1;
}

.warning-content {
  flex: 1;
}

.warning-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .warning-title {
  color: #fbbf24;
}

.warning-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.warning-desc strong {
  color: var(--text-main);
  font-weight: 600;
}

.warning-desc em {
  color: #ef4444;
  font-style: normal;
  font-weight: 700;
}

.btn-confirm-upload.overwrite {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.btn-confirm-upload.overwrite:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.38);
}

/* ========================================================
   ACCORDION MINIMIZADO PARA INSIGHTS / DIAGNÓSTICOS TEXTUAIS
   (Foco Operacional: Gráficos e Indicadores Primeiro)
   ======================================================== */
.insight-accordion {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.insight-accordion[open] {
  box-shadow: var(--shadow-md);
  border-color: rgba(239, 68, 68, 0.45);
}

.insight-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: rgba(239, 68, 68, 0.04);
  transition: background 0.15s ease;
}

.insight-summary::-webkit-details-marker {
  display: none;
}

.insight-summary:hover {
  background: rgba(239, 68, 68, 0.08);
}

.insight-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.insight-summary-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.insight-summary-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.insight-summary-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.insight-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.insight-accordion[open] .insight-arrow {
  transform: rotate(180deg);
}

.insight-accordion-content {
  padding: 12px 18px 16px 18px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  background: var(--bg-card);
}

/* Variação Informativa / Primária para Explicações Padrão (Metodologia e Diretrizes) */
.insight-accordion.info,
.insight-accordion.primary {
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-left: 4px solid var(--primary);
}

.insight-accordion.info[open],
.insight-accordion.primary[open] {
  border-color: rgba(37, 99, 235, 0.45);
}

.insight-accordion.info .insight-summary,
.insight-accordion.primary .insight-summary {
  background: rgba(37, 99, 235, 0.04);
}

.insight-accordion.info .insight-summary:hover,
.insight-accordion.primary .insight-summary:hover {
  background: rgba(37, 99, 235, 0.08);
}

.insight-accordion.info .insight-summary-badge,
.insight-accordion.primary .insight-summary-badge {
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.insight-accordion.info .insight-accordion-content,
.insight-accordion.primary .insight-accordion-content {
  border-top: 1px solid rgba(37, 99, 235, 0.15);
}

/* ========================================================
   BANNER INTERATIVO: FILTRO POR CLIQUE NO GRÁFICO (BACKLOG)
   ======================================================== */
.grafico-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeInBanner 0.25s ease;
}

[data-theme="dark"] .grafico-filter-banner {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

@keyframes fadeInBanner {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.grafico-filter-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grafico-filter-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.grafico-filter-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.filter-mode-switch {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
}

.btn-micro-toggle {
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-dim);
  transition: all 0.15s ease;
}

.btn-micro-toggle.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-clear-filter {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-clear-filter:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}





