/* Scoped visual tokens and viewport shell for Unified History (Compras & Financeiro) */

:root {
  --hist-sidebar: #f8fafc;
  --hist-surface: #ffffff;
  --hist-border: #e2e8f0;
  --hist-brand: #1e293b;
  --hist-brand-hover: #0f172a;
}

/* Override portal CSS gradients and financeiro/js/layout.js !important background rules */
body[data-historico-sector] {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #1e293b;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.hist-btn-brand {
  background-color: var(--hist-brand);
  color: #ffffff;
}

.hist-btn-brand:hover {
  background-color: var(--hist-brand-hover);
}

.hist-btn-brand:disabled {
  background-color: #cbd5e1;
  color: #ffffff;
  cursor: not-allowed;
}

/* Thin discreet scrollbars */
.hist-scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.hist-scroll-thin::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.hist-scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}

.hist-scroll-thin::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.hist-scroll-thin::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Desktop full-viewport flex layout with pinned header/filters and scrollable workspace */
@media (min-width: 1024px) {
  body[data-historico-sector] #layout-wrapper {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body[data-historico-sector] #main-container {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body[data-historico-sector] main.hist-shell,
  body[data-historico-sector] #main-container > main.hist-shell {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

@media print {
  body[data-historico-sector] #layout-wrapper,
  body[data-historico-sector] #main-container,
  body[data-historico-sector] main.hist-shell,
  body[data-historico-sector] #hist-workspace-scroll {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
