/* ==========================================================================
   ERP v4 - Design tokens e componentes (refer?ncia Legado; v4 criado do zero)
   ========================================================================== */

/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */

:root {
  --background: 0 0% 98%;
  --foreground: 215 25% 15%;
  --card: 0 0% 100%;
  --card-foreground: 215 25% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 215 25% 15%;
  --primary: 217 91% 60%;
  --primary-foreground: 0 0% 100%;
  --secondary: 214 32% 91%;
  --secondary-foreground: 215 25% 15%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 217 91% 60%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 71% 45%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 0 0% 100%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 217 91% 60%;
  --radius: 0.75rem;
  --shadow-sm: 2px 3px 4px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 4px 6px 12px -2px rgba(0, 0, 0, 0.12);
  --shadow-lg: 6px 10px 20px -4px rgba(0, 0, 0, 0.15);
  --scrollbar-width: 8px;
  --scrollbar-radius: 4px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: hsl(215 16% 47% / 0.35);
  --scrollbar-thumb-hover: hsl(215 16% 47% / 0.55);
  /* Scrollbar para janela principal (maior, mais vis?vel) */
  --scrollbar-window-width: 14px;
  --scrollbar-window-radius: 7px;
  /* Cores dos menus pai (header): Vendas=verde, Servi?o=azul, Compras=vermelho, Cadastro=laranja, Financeiro=roxo */
  --menu-vendas: 142 55% 42%;
  --menu-servico: 217 70% 45%;
  --menu-compras: 0 72% 51%;
  --menu-cadastros: 28 90% 48%;
  --menu-financeiro: 262 55% 48%;
  --menu-admin: 220 55% 40%;
}

.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 98%;
  --card: 217 33% 17%;
  --card-foreground: 210 40% 98%;
  --popover: 217 33% 17%;
  --popover-foreground: 210 40% 98%;
  --primary: 217 91% 60%;
  --primary-foreground: 0 0% 100%;
  --secondary: 217 33% 17%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217 28% 22%;
  --muted-foreground: 215 20% 65%;
  --border: 217 28% 28%;
  --input: 217 28% 28%;
  --ring: 217 91% 60%;
  --shadow-sm: 2px 3px 4px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 4px 6px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 6px 10px 20px -4px rgba(0, 0, 0, 0.45);
  --scrollbar-thumb: hsl(215 20% 65% / 0.4);
  --scrollbar-thumb-hover: hsl(215 20% 65% / 0.6);
  /* scrollbar janela: mesmas vari?veis, tamanho definido em .scrollbar-window */
  --menu-vendas: 142 50% 52%;
  --menu-servico: 217 75% 55%;
  --menu-compras: 0 70% 55%;
  --menu-cadastros: 28 85% 55%;
  --menu-financeiro: 262 55% 58%;
  --menu-admin: 220 60% 55%;
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */

.scrollbar-theme,
.modal,
.modal-content,
.custom-select-content,
.table-container,
.search-results-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-theme::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.custom-select-content::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.search-results-list::-webkit-scrollbar {
  width: var(--scrollbar-width);
  height: var(--scrollbar-width);
}
.scrollbar-theme::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.custom-select-content::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.search-results-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.scrollbar-theme::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.custom-select-content::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.search-results-list::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--scrollbar-radius);
}
.scrollbar-theme::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.custom-select-content::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.search-results-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

/* Scrollbar janela (main): mais largo para ?rea de conte?do */
.scrollbar-window {
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-window::-webkit-scrollbar {
  width: var(--scrollbar-window-width);
  height: var(--scrollbar-window-width);
}
.scrollbar-window::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.scrollbar-window::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--scrollbar-window-radius);
}
.scrollbar-window::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

/* Busca funcional: item destacado e hover (primary) */
.search-result-item {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.search-result-item:hover {
  background-color: hsl(var(--primary) / 0.15);
}
.search-result-item.highlighted {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-left: 3px solid hsl(var(--primary-foreground) / 0.3);
}
.search-result-item.highlighted:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: hsl(var(--border));
}

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-x: clip;
  width: 100%;
}

/* Contorno de foco ao usar Tab: cor primary */
*:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* ==========================================================================
   Typography (base)
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
p { margin: 0; }
a { color: inherit; text-decoration: inherit; }

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
  position: relative;
}
@media (min-width: 1400px) {
  .container { max-width: 1400px; }
}
@media (max-width: 767px) {
  .container { padding-left: 0.25rem; padding-right: 0.25rem; }
  .container .card { padding: 0.75rem; }
  .container .card-content { padding: 0.75rem; }
  .container .demo-section { margin-bottom: 1rem; }
  .container .demo-section:last-child { margin-bottom: 0; }
}

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.min-h-screen { min-height: 100vh; }
.h-full { height: 100%; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.border { border-width: 1px; border-color: hsl(var(--border)); }
.border-border { border-color: hsl(var(--border)); }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.shadow-lg { box-shadow: var(--shadow-lg); }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-success { color: hsl(var(--success)); }
.text-warning { color: hsl(var(--warning)); }
.text-destructive { color: hsl(var(--destructive)); }
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.transition { transition-property: color, background-color, border-color, box-shadow; transition-duration: 150ms; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ==========================================================================
   Form group & label
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.form-row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--foreground));
  padding-left: 0.75rem;
}
.label-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================================================
   Input
   ========================================================================== */

.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: hsl(var(--foreground));
  transition: border-color 150ms, box-shadow 150ms;
}
.input::placeholder {
  color: hsl(var(--muted-foreground));
}
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.input:focus-visible {
  outline: none;
}
.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-icon-left,
.input-icon-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  z-index: 1;
}
.input-icon-left { left: 0.75rem; }
.input-icon-right { right: 0.75rem; }
.input-with-icon-left { padding-left: 2.5rem; }
.input-with-icon-right { padding-right: 2.5rem; }

/* ==========================================================================
   Button
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 150ms, color 150ms, border-color 150ms;
  cursor: pointer;
  border: none;
}
.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--primary));
}
.btn-primary {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
}
.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9) !important;
}
.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}
.btn-outline {
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}
.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}
.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}
/* Bot?o Cancelar: outline/ghost com fundo destrutivo ao hover (design reference: modal footer) */
.btn.btn-hover-destructive:hover {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
/* Bot?o secund?rio com hover primary (ex.: Limpar filtros) */
.btn.btn-hover-primary:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
/* Bot?o com hover warning (ex.: Cancelar no modo registro) */
.btn.btn-hover-warning:hover {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
}
.btn-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
.btn-success:hover {
  background-color: hsl(var(--success) / 0.9);
}
.btn-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
}
.btn-warning:hover {
  background-color: hsl(var(--warning) / 0.9);
}
.btn-link {
  background-color: transparent;
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
}
.btn-md {
  height: 2.5rem;
  padding: 0.5rem 1rem;
}
.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
}

/* Dark: sem borda em inputs e bot?es */
.dark .input {
  border: none;
}
.dark .input:focus {
  border-color: transparent;
}
.dark .btn-outline {
  border: none;
}

/* Dark: sem cor de borda em divs e tabelas */
.dark .card,
.dark .card-header,
.dark .card-content,
.dark .card-footer,
.dark .border,
.dark .border-border,
.dark .table-header,
.dark .table-header th,
.dark .table-body tr,
.dark .table-footer,
.dark .table-grid-header,
.dark .table-grid-row {
  border-color: transparent;
}

/* Toggle Por parcela / Por lan?amento: borda expressiva e altura confort?vel */
.toggle-view-group {
  border: 0.75px solid hsl(var(--border));
}
.dark .toggle-view-group {
  border-color: hsl(var(--muted-foreground) / 0.55);
}
.toggle-view-group .toggle-view-btn {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  min-height: 0.3rem;
}
.toggle-view-group .toggle-view-btn.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.toggle-view-group .toggle-view-btn.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
}
/* T?tulo/subt?tulo na primeira linha; busca e bot?o na linha inferior (sempre em coluna) */
.card-header.flex {
  flex-direction: column;
}
.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  text-align: left;
}
.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: left;
}
.card-content {
  padding: 1.5rem;
  padding-top: 0;
}
.card:not(:has(.card-header)) .card-content {
  padding-top: 1.5rem;
}
.card-footer {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  padding-top: 0;
  border-top: 1px solid hsl(var(--border));
}

/* Dashboard Financeiro: cards KPI com cor (t?tulo e ?cone na cor do tema) */
#page-dash-finan .card.dash-finan-kpi-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
#page-dash-finan .card.dash-finan-kpi-primary .card-title,
#page-dash-finan .card.dash-finan-kpi-primary .card-content,
#page-dash-finan .card.dash-finan-kpi-primary .icon {
  color: hsl(var(--primary-foreground));
}
#page-dash-finan .card.dash-finan-kpi-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}
#page-dash-finan .card.dash-finan-kpi-destructive .card-title,
#page-dash-finan .card.dash-finan-kpi-destructive .card-content,
#page-dash-finan .card.dash-finan-kpi-destructive .icon {
  color: hsl(var(--destructive-foreground));
}
#page-dash-finan .card.dash-finan-kpi-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
  border-color: hsl(var(--warning));
}
#page-dash-finan .card.dash-finan-kpi-warning .card-title,
#page-dash-finan .card.dash-finan-kpi-warning .card-content,
#page-dash-finan .card.dash-finan-kpi-warning .icon,
#page-dash-finan .card.dash-finan-kpi-warning button {
  color: hsl(var(--warning-foreground));
}
#page-dash-finan .card.dash-finan-kpi-warning button:hover {
  background-color: hsl(0 0% 100% / 0.15);
}
#page-dash-finan .card.dash-finan-kpi-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
  border-color: hsl(var(--success));
}
#page-dash-finan .card.dash-finan-kpi-success .card-title,
#page-dash-finan .card.dash-finan-kpi-success .card-content,
#page-dash-finan .card.dash-finan-kpi-success .icon {
  color: hsl(var(--success-foreground));
}

/* Dashboard Financeiro: header do card com t?tulo e select na mesma linha */
#page-dash-finan .card-header-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
#page-dash-finan .card-header-row .card-title {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
}
/* Select n?o ocupa 100% da linha (evita quebra para baixo) */
#page-dash-finan .card-header-row .custom-select {
  width: auto;
  max-width: none;
  flex-shrink: 0;
}

/* Dashboard Financeiro: indicadores com resultado alinhado e espa?o entre t?tulo e valor */
#page-dash-finan .dash-finan-indicators-grid .card-content {
  padding-top: 0.75rem;
}

/* BI (index): cards de fonte de dados ? barra superior em gradiente e t?tulo mudando de cor no hover (id?ntico ao v2) */
#page-bi .bi-source-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
#page-bi .bi-source-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#page-bi .bi-source-card:hover {
  border-color: hsl(var(--primary) / 0.3);
}
#page-bi .bi-source-card:hover::before {
  opacity: 1;
}
#page-bi .bi-source-card-title {
  transition: color 0.2s ease;
}
#page-bi .bi-source-card--primary:hover .bi-source-card-title {
  color: hsl(var(--primary));
}
#page-bi .bi-source-card--success:hover .bi-source-card-title {
  color: hsl(var(--success));
}
#page-bi .bi-source-card--warning:hover .bi-source-card-title {
  color: hsl(var(--warning));
}
#page-bi .bi-source-card--info:hover .bi-source-card-title {
  color: hsl(var(--primary));
}
#page-bi .bi-source-card--secondary:hover .bi-source-card-title {
  color: hsl(var(--secondary));
}
#page-bi .bi-source-card-btn {
  transition: background-color 0.2s ease, color 0.2s ease;
}
#page-bi .bi-source-card--primary:hover .bi-source-card-btn {
  background-color: hsl(var(--primary) / 0.9);
}
#page-bi .bi-source-card--success:hover .bi-source-card-btn {
  background-color: hsl(var(--success) / 0.9);
}
#page-bi .bi-source-card--warning:hover .bi-source-card-btn {
  background-color: hsl(var(--warning) / 0.9);
}
#page-bi .bi-source-card--info:hover .bi-source-card-btn {
  background-color: hsl(var(--primary) / 0.9);
}
#page-bi .bi-source-card--secondary:hover .bi-source-card-btn {
  background-color: hsl(var(--secondary) / 0.9);
}

/* Modificadores de hover por card: barra superior, borda, t?tulo e bot?o */
#page-bi .bi-source-card.bi-source-card--hover-primary:hover {
  border-color: hsl(var(--primary) / 0.3);
}
#page-bi .bi-source-card.bi-source-card--hover-primary:hover::before {
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.3), transparent);
}
#page-bi .bi-source-card.bi-source-card--hover-primary:hover .bi-source-card-title {
  color: hsl(var(--primary));
}
#page-bi .bi-source-card.bi-source-card--hover-primary:hover .bi-source-card-btn {
  background-color: hsl(var(--primary) / 0.9);
  color: hsl(var(--primary-foreground));
}

#page-bi .bi-source-card.bi-source-card--hover-success:hover {
  border-color: hsl(var(--success) / 0.3);
}
#page-bi .bi-source-card.bi-source-card--hover-success:hover::before {
  background: linear-gradient(90deg, transparent, hsl(var(--success) / 0.3), transparent);
}
#page-bi .bi-source-card.bi-source-card--hover-success:hover .bi-source-card-title {
  color: hsl(var(--success));
}
#page-bi .bi-source-card.bi-source-card--hover-success:hover .bi-source-card-btn {
  background-color: hsl(var(--success) / 0.9);
  color: hsl(var(--success-foreground));
}

#page-bi .bi-source-card.bi-source-card--hover-warning:hover {
  border-color: hsl(var(--warning) / 0.3);
}
#page-bi .bi-source-card.bi-source-card--hover-warning:hover::before {
  background: linear-gradient(90deg, transparent, hsl(var(--warning) / 0.3), transparent);
}
#page-bi .bi-source-card.bi-source-card--hover-warning:hover .bi-source-card-title {
  color: hsl(var(--warning));
}
#page-bi .bi-source-card.bi-source-card--hover-warning:hover .bi-source-card-btn {
  background-color: hsl(var(--warning) / 0.9);
  color: hsl(var(--warning-foreground));
}

/* ==========================================================================
   BI BUILDER (page /bi/builder) ? padr?o v2: drag and drop
   ========================================================================== */
#page-bi-builder .bi-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  #page-bi-builder .bi-layout {
    grid-template-columns: 280px 1fr;
  }
}

#page-bi-builder .bi-fields-panel.sticky-top {
  position: sticky;
  top: calc(3.5rem + var(--sticky-offset, 1rem));
  max-height: calc(100vh - 3.5rem - 2rem - var(--sticky-offset, 1rem));
  overflow-y: auto;
}

#page-bi-builder .bi-field-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

#page-bi-builder .bi-field-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
}
#page-bi-builder .bi-field-item:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--primary) / 0.3);
  transform: translateX(2px);
}
#page-bi-builder .bi-field-item:active {
  cursor: grabbing;
  transform: scale(0.98);
}
#page-bi-builder .bi-field-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}
#page-bi-builder .bi-field-item.sortable-ghost {
  opacity: 0.4;
  background-color: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
}

#page-bi-builder .bi-drop-zone {
  min-height: 4rem;
  padding: 0.75rem;
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--muted) / 0.3);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}
#page-bi-builder .bi-drop-zone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  text-align: center;
  width: 100%;
}
#page-bi-builder .bi-drop-zone.has-items .bi-drop-zone-placeholder {
  display: none;
}
#page-bi-builder .bi-drop-zone.bi-drop-zone-placeholder-active {
  border-color: hsl(var(--primary));
  border-style: solid;
  background-color: hsl(var(--primary) / 0.08);
}
#page-bi-builder .bi-drop-zone:hover {
  border-color: hsl(var(--primary) / 0.5);
  background-color: hsl(var(--primary) / 0.05);
}
#page-bi-builder .bi-drop-slot {
  min-height: 0.5rem;
  min-width: 0.5rem;
  flex: 1 1 auto;
  border-radius: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
#page-bi-builder .bi-drop-zone .bi-drop-slot {
  min-height: 0.75rem;
  min-width: 2rem;
}
#page-bi-builder .bi-drop-slot.bi-drop-slot-active {
  background-color: hsl(var(--primary) / 0.12);
  border-left: 3px solid hsl(var(--primary));
}
#page-bi-builder .bi-drop-zone-filters .bi-drop-slot {
  min-height: 2rem;
  min-width: 0.5rem;
}
#page-bi-builder .bi-drop-zone-filters .bi-drop-slot.bi-drop-slot-active {
  border-left: none;
  border-top: 3px solid hsl(var(--primary));
}
#page-bi-builder .bi-dropped-item.returning {
  opacity: 0;
  transform: translateX(-20px) scale(0.96);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none;
}
#page-bi-builder .bi-field-item.just-returned {
  animation: bi-return-in 0.22s ease-out;
}
@keyframes bi-return-in {
  from {
    opacity: 0;
    transform: translateX(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
#page-bi-builder .bi-drop-zone-filters {
  min-height: 3rem;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
#page-bi-builder .bi-drop-zone-filters .bi-drop-zone-placeholder {
  flex-direction: row;
  padding: 0.5rem;
  width: auto;
}

#page-bi-builder .bi-dropped-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  min-width: 7rem;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
}
#page-bi-builder .bi-dropped-item:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.08);
}
#page-bi-builder .bi-dropped-item.dimension {
  border-left: 3px solid hsl(var(--primary));
}
#page-bi-builder .bi-dropped-item.metric {
  border-left: 3px solid hsl(var(--success));
}
#page-bi-builder .bi-dropped-item:active {
  cursor: grabbing;
}
#page-bi-builder .bi-dropped-item.filter-active {
  background-color: hsl(var(--card));
  border-color: hsl(var(--warning));
  box-shadow: 0 0 0 1px hsl(var(--warning) / 0.3);
}
#page-bi-builder .bi-dropped-item .remove-btn {
  margin-left: 0.25rem;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  cursor: pointer;
  padding: 0.125rem;
  border: none;
  background: none;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#page-bi-builder .bi-dropped-item:hover .remove-btn {
  opacity: 1;
}
#page-bi-builder .bi-dropped-item .remove-btn:hover {
  background-color: hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
}

#page-bi-builder .slider-wrapper-custom .slider-track {
  height: 0.5rem;
  background-color: hsl(var(--secondary));
  border-radius: 9999px;
}
.dark #page-bi-builder .slider-wrapper-custom .slider-track {
  background-color: hsl(var(--border));
}

/* Gr?ficos BI: fundo em degrad?, preparado para light e dark */
#page-bi-builder .bi-chart-wrapper {
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  min-height: 360px;
  background: linear-gradient(to bottom, hsl(var(--muted) / 0.45), hsl(var(--muted) / 0.12));
}
.dark #page-bi-builder .bi-chart-wrapper {
  background: linear-gradient(to bottom, hsl(var(--muted) / 0.35), hsl(var(--background) / 0.8));
}

/* /inventario: os cards Nova OS e OS Existente s?o os pr?prios bot?es (conforme v3) */
.inventario-choice-card {
  display: block;
  text-decoration: none;
  cursor: pointer;
  border-width: 2px;
  border-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.inventario-choice-card:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}
.inventario-choice-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/** Opção ativa (ex.: /form Orçamento × O.S. — mesmo visual de destaque que :hover). */
.inventario-choice-card.is-selected {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}

/* ==========================================================================
   Custom Select
   ========================================================================== */

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.custom-select-trigger {
  display: flex;
  height: 2.5rem;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
}
.custom-select-trigger:hover {
  border-color: hsl(var(--ring));
}
.custom-select-trigger:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.dark .custom-select-trigger {
  border-color: transparent;
}
.dark .custom-select-trigger:hover,
.dark .custom-select-trigger:focus {
  border-color: transparent;
}
.custom-select-value {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-value.placeholder {
  color: hsl(var(--muted-foreground));
}
.custom-select-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 200ms ease;
  color: hsl(var(--muted-foreground));
}
.custom-select.open .custom-select-icon {
  transform: rotate(180deg);
}
.custom-select-content {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 15rem;
  width: 100%;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  user-select: none;
}
.custom-select:not(.open) .custom-select-content {
  display: none !important;
}
.custom-select.open .custom-select-content {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-select-content-portal {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-select-content:focus {
  outline: none;
}
/** Dropdown sem altura m?xima: lista extravasa e a p?gina rola (ex.: busca OS em invent?rio). */
.custom-select-content-overflow-visible {
  max-height: none;
  overflow-y: visible;
}
.custom-select.dropdown-up .custom-select-content {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(8px);
}
.custom-select.dropdown-up.open .custom-select-content {
  transform: translateY(0);
}
.custom-select-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 150ms, color 150ms;
  user-select: none;
}
.custom-select-item:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.custom-select-item.selected {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.custom-select-item.highlighted {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.custom-select-item:focus {
  outline: none;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.custom-select-item[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}
.custom-select-separator {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 0.25rem 0;
}
.custom-select-label {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* SnippetSelect: thumbnail e valor no padr?o Design Reference */
.snippet-select-value-with-thumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.snippet-select-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snippet-select-thumb {
  flex-shrink: 0;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid hsl(var(--border));
}
.snippet-select-thumb-trigger {
  width: 1.5rem;
  height: 1.5rem;
}
.snippet-select-thumb-item {
  width: 2rem;
  height: 2rem;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
/** Overlay mais escuro (ex.: modal Medidas). Clicar no overlay fecha o modal. */
.modal-overlay-darker {
  background-color: rgba(0, 0, 0, 0.92);
}
/** Overlay de modal aninhado (acima do modal pai). */
.modal-overlay-elevated {
  z-index: 1010;
}
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1001;
  width: 90%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  visibility: hidden;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}
.modal.modal-lg {
  max-width: 56rem;
}
.modal.modal-sm {
  max-width: 24rem;
}
/* Modal Medidas: 30% mais largo que sm (24rem ? 1.3 ? 31.2rem) */
.modal.modal-medidas {
  max-width: 31.25rem;
}
/* Modal XL / 2XL / full */
.modal.modal-xl {
  width: min(92vw, 900px);
  max-width: min(92vw, 900px);
}
.modal.modal-2xl {
  width: min(96vw, 1200px);
  max-width: min(96vw, 1200px);
}
.modal.modal-full {
  width: 96vw;
  max-width: 96vw;
}
/* Modal DANFE: mesma largura da área de conteúdo */
.modal.modal-danfe {
  width: min(96vw, 1440px);
  max-width: min(96vw, 1440px);
  overflow-y: hidden;
}
.modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}
/** Dialog de modal aninhado (acima do modal pai). */
.modal-elevated {
  z-index: 1011;
}
.modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
}
.modal-title {
  font-size: 1.875rem !important;
  font-weight: 600;
}
.modal-title.text-center {
  text-align: center;
}
.modal-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.modal-description-extra {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground) / 0.9);
  margin-top: 0.375rem;
  line-height: 1.4;
}
.modal-content {
  padding: 1.5rem;
  min-width: 0;
  overflow-x: hidden;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1.5rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  background: transparent;
  border: none;
  color: hsl(var(--foreground));
}
.modal-close:hover {
  opacity: 1;
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 3.5rem;
  min-height: 3.5rem;
  max-height: 3.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-container,
.header-content {
  display: flex;
  height: 3.5rem;
  min-height: 3.5rem;
  max-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.header-logo-primary {
  color: hsl(var(--primary));
}
.header-logo-secondary {
  color: hsl(var(--muted-foreground));
}
.header-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 768px) {
  .header-nav { display: flex; }
}
.header-nav-link {
  position: relative;
  padding: 1rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  background: transparent;
  border-radius: 0;
  transition: color 150ms;
}
.header-nav-link:hover {
  color: hsl(var(--foreground));
}
.header-nav-link.active {
  color: hsl(var(--foreground));
}
.header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: hsl(var(--primary));
  border-radius: 9999px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.header-actions .relative {
  position: relative;
}
.header-notification-badge {
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  font-size: 0.75rem;
  font-weight: 500;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: clamp(0.25rem, 1vw, 1.5rem);
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: visible;
}
@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}
.nav-desktop .header-nav-link {
  padding: 0.75rem clamp(0.125rem, 0.5vw, 0.5rem);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
.nav-desktop .header-nav-link .btn-text {
  display: inline;
}
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-desktop .header-nav-link .btn-text {
    display: none;
  }
}
@media (min-width: 1024px) {
  .nav-desktop .header-nav-link .btn-text {
    display: inline;
  }
}

/* Utilit?rio: esconder em mobile/tablet; mostrar a partir de 1024px (alinhado ao v2: tema e notifica??es vis?veis em telas um pouco menores). */
.hidden-mobile {
  display: none !important;
}
@media (min-width: 1024px) {
  .hidden-mobile {
    display: flex !important;
  }
}
/* Mostrar em mobile/tablet; esconder a partir de 1024px. */
.visible-mobile-only {
  display: flex !important;
}
@media (min-width: 1024px) {
  .visible-mobile-only {
    display: none !important;
  }
}

/* Lista responsiva: tabela no desktop (1280px+), cards em mobile/tablet. */
.list-desktop-only {
  display: none;
}
@media (min-width: 1280px) {
  .list-desktop-only {
    display: block;
  }
}
.list-mobile-only {
  display: block;
}
@media (min-width: 1280px) {
  .list-mobile-only {
    display: none !important;
  }
}

/* Campo N?mero ao lado do Endere?o (modal cliente/fornecedor): largura fixa s? no desktop */
@media (min-width: 768px) {
  .endereco-numero-numero-field {
    width: 6rem;
    min-width: 6rem;
  }
}

/* Linha Endere?o + N?mero: mesma linha no desktop */
.endereco-numero-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .endereco-numero-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
  }
  .endereco-numero-row .form-group:first-child {
    flex: 1 1 0%;
    min-width: 0;
  }
  .endereco-numero-row .form-group:last-child {
    flex: 0 0 auto;
  }
}

/* Ocultar dados sens?veis (emba?ado); revelar no hover ou ao clicar (classe .revealed) */
.data-masked {
  filter: blur(4px);
  cursor: pointer;
  transition: filter 0.2s ease;
  user-select: none;
}
.data-masked:hover {
  filter: none;
}
.data-masked.revealed {
  filter: none;
}

/* Modais de visualiza??o (detalhes): se??es e auditoria */
.view-detail {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.view-detail-section {
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--border));
}
.view-detail-section:last-of-type {
  border-bottom: none;
}
.view-detail-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.view-detail-grid {
  display: grid;
  gap: 0.5rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.view-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.view-detail-row dt {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}
.view-detail-row dd {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.view-detail-audit {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Theme toggle icons (igual v3) */
.theme-icon-dark {
  display: none;
}
.dark .theme-icon-light {
  display: none;
}
.dark .theme-icon-dark {
  display: block;
}

/* Mobile menu (igual v3) */
.mobile-menu-trigger {
  display: flex;
  border: 1px solid hsl(var(--muted-foreground) / 0.5);
  border-radius: var(--radius);
}
@media (min-width: 768px) {
  .mobile-menu-trigger {
    display: none;
  }
}
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu-sheet {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  height: 100%;
  width: 75%;
  max-width: 20rem;
  background-color: hsl(var(--background));
  border-right: 1px solid hsl(var(--border));
  padding: 1.5rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.mobile-menu-sheet.open {
  transform: translateX(0);
}
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mobile-menu-link:hover,
.mobile-menu-link.active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  flex-shrink: 0;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  position: relative;
}
@media (min-width: 768px) {
  .footer-inner { padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 1400px) {
  .footer-inner { max-width: 1400px; }
}
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.footer-right {
  font-size: 0.875rem;
  line-height: 1.3;
  flex-direction: row;
  justify-content: center;
  width: 100%;
}
@media (min-width: 768px) {
  .footer-right {
    position: absolute;
    right: 2rem;
    width: auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
  }
  .footer-separator {
    display: none !important;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
  }
}
.footer-date,
.footer-time {
  white-space: nowrap;
}
.footer-separator {
  display: inline;
  margin: 0 0.25rem;
}

/* ==========================================================================
   FAB (Mobile/Tablet Only) ? 100% vinculado ao footer (acima do footer 2.5rem)
   ========================================================================== */
.fab-favorites {
  position: fixed;
  bottom: 3.5rem;
  right: 1rem;
  z-index: 99999;
  display: none;
}
@media (max-width: 1023px) {
  .fab-favorites {
    display: block;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .fab-favorites {
    bottom: 3.5rem;
  }
}
.fab-favorites-trigger {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.fab-favorites-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.fab-favorites-trigger .icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}
.fab-favorites.open .fab-favorites-trigger .icon {
  transform: rotate(45deg);
}
.fab-favorites.open .fab-favorites-trigger {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.fab-favorites-menu {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  min-width: 12rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1;
}
.fab-favorites.open .fab-favorites-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 100002;
}
.fab-favorites-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
}
.fab-favorites-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}
.fab-favorites-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  max-height: 16rem;
  overflow-y: auto;
}
.fab-favorites-list-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.fab-favorites-list-item .fab-favorites-item {
  flex: 1;
  min-width: 0;
}
.fab-favorites-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.fab-favorites-item-remove:hover {
  background-color: hsl(var(--muted) / 0.6);
  color: hsl(var(--destructive));
}
.fab-favorites-item-remove .icon {
  width: 0.875rem;
  height: 0.875rem;
}
.fab-favorites-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
}
.fab-favorites-item:hover {
  background-color: hsl(var(--muted) / 0.5);
}
button.fab-favorites-item {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  width: 100%;
  text-align: left;
}
.fab-favorites-toggle-wrap {
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}
.fab-favorites-remove {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.fab-favorites-remove:hover {
  background-color: hsl(var(--muted) / 0.4);
  color: hsl(var(--foreground));
}
.fab-favorites-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.fab-favorites-icon-wrap .icon,
.fab-favorites-icon-wrap svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.fab-favorites-remove .fab-favorites-icon-wrap {
  opacity: 0.8;
}
.fab-favorites-add .icon {
  color: hsl(45, 93%, 47%);
}
.fab-favorites-toggle.fab-favorites-item,
.fab-favorites-add {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.fab-favorites-add:hover {
  background-color: hsl(var(--muted) / 0.5);
}
.fab-favorites-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}
.fab-favorites-empty .icon {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.5rem;
  display: block;
  opacity: 0.5;
}
.fab-favorites-empty p {
  margin: 0;
}

/* ==========================================================================
   Table
   ========================================================================== */

.table-container {
  position: relative;
  width: 100%;
  overflow: auto;
}
.table {
  width: 100%;
  caption-side: bottom;
  font-size: 0.875rem;
  border-collapse: collapse;
}
.table-header {
  border-bottom: 1px solid hsl(var(--border));
}
.table-header th {
  height: 3rem;
  padding: 0 1rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.table-header th.text-center {
  text-align: center;
}
.table-header th.text-right {
  text-align: right;
}
.table-body td.text-center {
  text-align: center;
}
.table-body td.text-right {
  text-align: right;
}
.table-cell-actions {
  text-align: right !important;
  white-space: nowrap;
  vertical-align: middle;
}
.table th.table-cell-actions,
.table td.table-cell-actions {
  padding-left: 1rem;
  padding-right: 1rem;
}
.table td.table-cell-actions .btn + .btn {
  margin-left: 0.5rem;
}
.table-body tr {
  border-bottom: 1px solid hsl(var(--border));
  transition: background-color 150ms;
}
.table-body tr:last-child {
  border-bottom: none;
}
.table-body tr:hover {
  background-color: hsl(var(--muted) / 0.5);
}
.table-body td {
  padding: 1rem;
  vertical-align: middle;
}
/* Tabela por medida e marca/modelo (modal pe?as): pouco espa?amento vertical */
.table-measure-model.table .table-body td {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}
.table-measure-model.table .table-header th {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  height: auto;
}
.dark .table .table-header,
.dark .table .table-header th,
.dark .table .table-body tr {
  border-color: hsl(var(--border));
}
.table-footer {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.5);
  font-weight: 500;
}

/* ==========================================================================
   Table Grid (Design Reference ? padr?es 2 a 8 colunas; ?ltima coluna A??es)
   ========================================================================== */

.table-grid-header,
.table-grid-row {
  display: grid;
  width: 100%;
  align-items: stretch;
}
.table-grid-header {
  border-bottom: 1px solid hsl(var(--border));
}
.table-grid-header .table-header-cell {
  display: flex;
  align-items: center;
  height: 3rem;
  padding: 0 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  text-align: left;
}
.table-grid-row {
  border-bottom: 1px solid hsl(var(--border));
  transition: background-color 150ms;
}
.table-grid-row:last-child {
  border-bottom: none;
}
.table-grid-row:hover {
  background-color: hsl(var(--muted) / 0.5);
}
.dark .table-grid-row {
  border-bottom: 1px solid hsl(217 25% 26%);
}
.dark .table-grid-row:hover {
  background-color: hsl(217 33% 22%);
}
.table-grid-row .table-body-cell {
  display: flex;
  align-items: center;
  padding: 1rem;
  font-size: 0.875rem;
  text-align: left;
}
.table-grid-header .table-cell-actions,
.table-grid-row .table-cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.table-grid-header .table-header-cell.text-center,
.table-grid-row .table-body-cell.text-center {
  text-align: center;
}
.table-grid-header .table-header-cell.text-right,
.table-grid-row .table-body-cell.text-right {
  text-align: right;
}
.table-grid-2 { grid-template-columns: 1fr 10rem; }
/* Verificar respostas compras: coluna Transportadora (13rem +70% = 22.1rem sobre o anterior). */
.transportadora-por-fornecedor-grid .table-grid-2 {
  grid-template-columns: minmax(0, 1fr) 22.1rem;
}
/* Altura das linhas igual ? tabela de resumo: padding vertical reduzido para compensar altura do select. */
.transportadora-por-fornecedor-grid .table-grid-row .table-body-cell {
  padding: 0.625rem 1rem;
  min-height: auto;
  display: flex;
  align-items: center;
}
.transportadora-por-fornecedor-grid .table-grid-row .table-body-cell .custom-select-trigger {
  height: 2rem;
}
/* Variante sem scroll: pain?is estreitos (ex.: Verifica??o de Componentes no invent?rio). */
.table-grid-no-overflow .table-grid-2 {
  grid-template-columns: minmax(0, 1fr) 13rem !important;
}
.table-grid-no-overflow .table-grid-3 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 10rem !important;
}
/* Header coluna Quantidade: centralizar flex como no body para alinhar t?tulo ao InputStepper */
.table-grid-inventario-componentes .table-grid-header .table-header-cell:last-child {
  justify-content: center;
}
/* Variante invent?rio: linhas com mesma altura do header (3rem) e mesmo padding horizontal para t?tulos alinhados ao conte?do. */
.table-grid-inventario-componentes .table-grid-row .table-body-cell {
  height: 3rem !important;
  min-height: 3rem !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box;
}
/* C?lula Quantidade: centralizado para alinhar com o t?tulo "Quantidade" */
.table-grid-inventario-componentes .table-grid-row .table-body-cell:last-child {
  justify-content: center;
  min-width: 10.25rem;
}
.table-grid-3 { grid-template-columns: 1fr 1fr 10rem; }
.table-grid-4 { grid-template-columns: 1fr 1fr 1fr 10rem; }
.table-grid-5 { grid-template-columns: 1fr 1fr 1fr 12rem 10rem; }
.table-grid-6 { grid-template-columns: 1fr 1fr 1fr 1fr 12rem 10rem; }
/* Resumo Cota??o (verificar respostas compras): QTD 5% | PE?A 30% | FORNECEDOR 30% | CIDADE 15% | VALOR UNIT 10% | VALOR TOTAL 10% */
.resumo-cotacao-grid .table-grid-6 {
  grid-template-columns: minmax(0, 5fr) minmax(0, 30fr) minmax(0, 30fr) minmax(0, 15fr) minmax(0, 10fr) minmax(0, 10fr);
}
.table-grid-7 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 12rem 10rem; }
.table-grid-8 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 10rem; }
.table-grid-9 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 12rem 10rem; }
.table-grid-10 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 12rem 12rem 10rem; }

/* Lan?amentos financeiros: altura de linha igual ao v2 (menos espa?amento vertical) */
#page-lancamentos .table-grid-row .table-body-cell {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Bot?es de a??o em tamanho pequeno (compat?vel com linha compacta) */
#page-lancamentos .table-grid-row .table-cell-actions .btn.btn-icon-sm {
  height: 2rem;
  width: 2rem;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0;
}
#page-lancamentos .table-grid-row .table-cell-actions .btn.btn-icon-sm .icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

/* Linha de detalhes (parcelas) ao expandir lan?amento */
.table-grid-detail-row {
  width: 100%;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.2);
  padding: 1rem;
}
/* Mesma altura de linha da tabela de lan?amentos (padding vertical 0.5rem) */
#page-lancamentos .table-grid-detail-row .table-body td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.dark .table-grid-detail-row {
  border-bottom-color: hsl(217 25% 26%);
  background-color: hsl(217 33% 18%);
}

.table-action-warning {
  background-color: hsl(var(--warning)) !important;
  color: hsl(0 0% 0%) !important;
}
.table-action-warning:hover {
  background-color: hsl(var(--warning));
  filter: brightness(0.95);
}
.dark .table-action-warning {
  color: hsl(0 0% 100%) !important;
}
.table-action-destructive {
  background-color: hsl(var(--destructive)) !important;
  color: hsl(0 0% 0%) !important;
}
.table-action-destructive:hover {
  background-color: hsl(var(--destructive));
  filter: brightness(0.95);
}
.dark .table-action-destructive {
  color: hsl(0 0% 100%) !important;
}

/* ==========================================================================
   List Cards (mobile: alternativa ? tabela, sem scroll horizontal)
   ========================================================================== */

.list-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.list-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  width: 100%;
  min-width: 0;
}

.list-card-main {
  flex: 1;
  min-width: 0;
}

.list-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.list-card-title {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.list-card-badge {
  flex-shrink: 0;
}

.list-card-body {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-card-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  flex-shrink: 0;
}

.list-card-actions > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================================================
   Bot?o ?cone (tamanhos)
   ========================================================================== */

.btn-icon {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}
.btn-icon-sm {
  height: 2.25rem;
  width: 2.25rem;
  padding: 0;
}
.icon-sm {
  width: 1rem;
  height: 1rem;
}

/* ==========================================================================
   Demo / Design Reference
   ========================================================================== */

.demo-section { margin-bottom: 3rem; }
.demo-title {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.demo-box {
  padding: 1rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
}
.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.demo-grid { display: grid; gap: 1rem; }

/* ==========================================================================
   Campo (hint / erro)
   ========================================================================== */

.field-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
  padding-left: 0.75rem; /* alinha com o in?cio do conte?do do input/select (mesmo padding) */
}
.field-error {
  font-size: 0.75rem;
  color: hsl(var(--destructive));
  margin-top: 0.25rem;
}

/* ==========================================================================
   Login (layout refer?ncia v2/v3)
   ========================================================================== */

@keyframes login-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(180deg); }
}
@keyframes login-fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.3; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(var(--muted)) 100%);
  position: relative;
  overflow: hidden;
}
.login-container::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.1) 0%, transparent 70%);
  top: -250px;
  right: -250px;
  border-radius: 50%;
  animation: login-pulse 8s ease-in-out infinite;
  pointer-events: none;
}
.login-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.08) 0%, transparent 70%);
  bottom: -200px;
  left: -200px;
  border-radius: 50%;
  animation: login-pulse 10s ease-in-out infinite 2s;
  pointer-events: none;
}
.login-card {
  animation: login-fadeInUp 0.6s ease-out;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 10;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.login-logo-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.8) 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px hsl(var(--primary) / 0.3);
  animation: login-float 6s ease-in-out infinite;
}
.login-logo-icon .icon,
.login-logo-icon .icon-sm {
  color: hsl(var(--primary-foreground));
}
.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, hsl(var(--foreground)) 0%, hsl(var(--muted-foreground)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  text-align: center;
}
.login-form { display: flex; flex-direction: column; gap: 1.25rem; width: 100%; }
.login-form .form-group { width: 100%; }
.login-input-group { position: relative; width: 100%; }
.login-input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  z-index: 1;
}
.login-input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 2.75rem !important;
  height: 3rem;
  font-size: 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
}
.login-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}
.login-input:focus + .login-input-icon { color: hsl(var(--ring)); }
.dark .login-input {
  background-color: hsl(var(--background));
  border-color: transparent;
}
.dark .login-input:focus { border-color: hsl(var(--ring)); }
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  box-shadow: 0 4px 15px hsl(var(--primary) / 0.3);
  transition: all 0.2s ease;
  position: relative;
}
.login-btn .login-btn-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
}
.login-btn:hover {
  background-color: hsl(var(--primary) / 0.9);
  box-shadow: 0 6px 20px hsl(var(--primary) / 0.4);
}
.login-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
}
.login-footer-text { color: hsl(var(--muted-foreground)); font-size: 0.75rem; }
.login-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  animation: login-fadeInUp 0.4s ease-out;
}
.login-alert-error {
  background-color: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.3);
  color: hsl(var(--destructive));
}
.login-alert-error .icon-sm { color: hsl(var(--destructive)); flex-shrink: 0; }
.login-theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
}
.login-theme-toggle .theme-icon-dark { display: none; }
.login-container[data-theme="dark"] .login-theme-toggle .theme-icon-light { display: none !important; }
.login-container[data-theme="dark"] .login-theme-toggle .theme-icon-dark { display: block !important; }
.login-container .login-theme-toggle:hover {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
}
@media (max-width: 480px) {
  .login-card { margin: 1rem; padding: 1.5rem; }
}

/* ==========================================================================
   Badge
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 150ms, color 150ms;
}
.badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.badge-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.badge-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
.badge-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
}
.badge-outline {
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  background-color: transparent;
}

/* ==========================================================================
   Toast (refer?ncia v3: top right, ?cone, variantes)
   ========================================================================== */

@keyframes toastSlideIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
}
.toast-icon { flex-shrink: 0; }
.toast-content { flex: 1; min-width: 0; }
.toast-close {
  flex-shrink: 0;
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0.9;
}
.toast-close:hover { opacity: 1; }
.toast-message { font-size: 0.875rem; font-weight: 500; }
.toast-info {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.toast-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
.toast-error {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.toast-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
}
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast-container .toast { pointer-events: auto; }

/* ==========================================================================
   Checkbox e Radio
   ========================================================================== */

.checkbox {
  height: 1.125rem;
  width: 1.125rem;
  flex-shrink: 0;
  border-radius: 0.25rem;
  border: 2px solid hsl(var(--primary));
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: hsl(var(--background));
  position: relative;
}
.checkbox:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}
.checkbox:focus { outline: none; box-shadow: 0 0 0 3px hsl(var(--primary) / 0.25); }
.checkbox:disabled { cursor: not-allowed; opacity: 0.5; }
input[type="radio"].checkbox,
.radio {
  height: 1.125rem;
  width: 1.125rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 2px solid hsl(var(--primary));
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: hsl(var(--background));
  position: relative;
}
input[type="radio"].checkbox:checked,
.radio:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  border-width: 2px;
  background-image: none;
}
input[type="radio"].checkbox:focus,
.radio:focus { outline: none; box-shadow: 0 0 0 3px hsl(var(--primary) / 0.25); }
input[type="radio"].checkbox:disabled,
.radio:disabled { cursor: not-allowed; opacity: 0.5; }

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs-list {
  display: flex;
  width: 100%;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
  gap: 0.25rem;
}
.tabs-trigger {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
}
.tabs-trigger:hover { color: hsl(var(--foreground)); background-color: hsl(var(--background) / 0.5); }
.tabs-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--ring)); }
.tabs-trigger:disabled { pointer-events: none; opacity: 0.5; }
.tabs-trigger.active,
.tabs-trigger[data-state="active"] {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.tabs-content { margin-top: 0.75rem; }
.tabs-content.hidden { display: none; }

/* ==========================================================================
   Accordion
   ========================================================================== */

.accordion-item { border-bottom: 1px solid hsl(var(--border)); }
.accordion-trigger {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.card.accordion-item > .accordion-trigger { border-radius: var(--radius) var(--radius) 0 0; }
.card.accordion-item > .accordion-trigger[aria-expanded="false"] { border-radius: var(--radius); }
.accordion-trigger:hover { background-color: hsl(var(--muted)); color: hsl(var(--primary)); }
.accordion-title { font-size: 1.25rem; font-weight: 600; color: hsl(var(--foreground)); }
.accordion-icon { transition: transform 0.2s ease; flex-shrink: 0; color: hsl(var(--primary)); }
.accordion-trigger[aria-expanded="true"] .accordion-icon { transform: rotate(180deg); }
.accordion-item > .accordion-content {
  max-height: 0;
  overflow: hidden;
  font-size: 0.875rem;
  transition: max-height 0.4s ease;
}
.card.accordion-item > .accordion-content { border-radius: 0 0 var(--radius) var(--radius); }
.accordion-trigger[aria-expanded="true"] + .accordion-content { max-height: 50rem; }
.accordion-content-inner { padding: 0 1rem 1rem 1rem; color: hsl(var(--muted-foreground)); }

/* Abas responsivas: mobile mostra texto curto; desktop mostra texto completo */
.tab-text-mobile-only { display: inline; }
.tab-text-desktop-only { display: none; }
@media (min-width: 768px) {
  .tab-text-mobile-only { display: none; }
  .tab-text-desktop-only { display: inline; }
}

/* Dossi? de M?dia: abas com rolagem horizontal em telas pequenas */
.dossie-midia-tabs .tab-text { display: inline; }
@media (max-width: 1023px) {
  .dossie-midia-tabs .tabs-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    gap: 0.5rem;
  }
  .dossie-midia-tabs .tabs-list .tabs-trigger,
  .dossie-midia-tabs .tabs-list button[class*="tabs-trigger"] { flex-shrink: 0; }
}
/* Dossi?: desktop = abas; mobile = bot?es que abrem modais */
/* Alinhado ao FAB / PagePrimaryAction: abas a partir de 1024px; bot?es s? com viewport <1024px (onde o FAB aparece). */
.dossie-tabs-desktop { display: none; }
@media (min-width: 1024px) {
  .dossie-tabs-desktop { display: block; }
}
.dossie-tabs-mobile { display: block; }
@media (min-width: 1024px) {
  .dossie-tabs-mobile { display: none; }
}
.dossie-fotos-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ==========================================================================
   Progress
   ========================================================================== */

.progress {
  position: relative;
  height: 1rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
}
.progress-indicator,
.progress-bar {
  height: 100%;
  background-color: hsl(var(--primary));
  transition: width 150ms;
}

/* ==========================================================================
   Switch
   ========================================================================== */

.switch {
  position: relative;
  display: inline-flex;
  height: 1.5rem;
  width: 2.75rem;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  border: 2px solid hsl(var(--input));
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background-color: hsl(var(--background));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.switch:checked,
.switch.active { background-color: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.switch:checked::before,
.switch.active::before { transform: translateX(1.25rem); }
.switch:focus { outline: none; box-shadow: 0 0 0 3px hsl(var(--primary) / 0.25); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-container { display: flex; align-items: center; gap: 0.75rem; }

/* ==========================================================================
   Slider
   ========================================================================== */

.slider-track {
  position: relative;
  height: 0.5rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
}
.slider-wrapper-custom { min-height: 1.25rem; display: flex; align-items: center; }
.slider-wrapper-custom .slider-track {
  overflow: visible;
  background-color: hsl(var(--secondary));
  height: 0.5rem;
  border-radius: 9999px;
  position: relative;
}
.dark .slider-wrapper-custom .slider-track {
  background-color: hsl(var(--border));
}
.slider-wrapper-custom .slider-native {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 0.5rem;
  margin: 0;
}
.slider-wrapper-custom input[type="range"].slider-native::-webkit-slider-thumb {
  margin-top: -0.375rem;
}
.slider-range {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: hsl(var(--primary));
  border-radius: 9999px;
}
input[type="range"].slider-native {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.5rem;
  background: transparent;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}
input[type="range"].slider-native::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: transparent;
}
input[type="range"].slider-native::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: hsl(var(--background));
  border: 2px solid hsl(var(--primary));
  cursor: grab;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.15s ease;
  margin-top: -0.375rem;
}
input[type="range"].slider-native::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.2);
}
input[type="range"].slider-native::-moz-range-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: hsl(var(--secondary));
}
input[type="range"].slider-native::-moz-range-progress {
  height: 0.5rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
}
input[type="range"].slider-native::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: hsl(var(--background));
  border: 2px solid hsl(var(--primary));
  cursor: grab;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Form grid e utilit?rios
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.col-span-full { grid-column: 1 / -1; }
.field-success { font-size: 0.75rem; color: hsl(var(--success)); margin-top: 0.25rem; }

/* ==========================================================================
   Textarea
   ========================================================================== */

.textarea {
  width: 100%;
  min-height: 5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: hsl(var(--foreground));
}
.textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.textarea::placeholder { color: hsl(var(--muted-foreground)); }
.dark .textarea {
  border-color: transparent;
}
.dark .textarea:focus {
  border-color: transparent;
}

/* ==========================================================================
   Design Reference ? Skeleton, Dropdown, Disclosure, Kbd, Avatar, Alert, etc.
   ========================================================================== */

/* Dropdown (wrapper + content) */
.dropdown {
  position: relative;
}
.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 100;
  min-width: 8rem;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  padding: 0.25rem;
  color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow-md);
}
.dropdown-content.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dark .dropdown-content {
  border-color: transparent;
}
.dark .dropdown-separator {
  background-color: hsl(var(--border));
  opacity: 0.6;
}
.dropdown-content.left {
  right: auto;
  left: 0;
}
.nav-desktop .dropdown .chevron-icon {
  transition: transform 0.2s ease;
}
.nav-desktop .dropdown.open .chevron-icon {
  transform: rotate(180deg);
}
/* Cores dos menus pai (dropdown no header) */
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link .btn-text { color: hsl(var(--menu-cadastros)); }
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-cadastros)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link .btn-text { color: hsl(var(--menu-financeiro)); }
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-financeiro)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link .btn-text { color: hsl(var(--menu-vendas)); }
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-vendas)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link .btn-text { color: hsl(var(--menu-servico)); }
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-servico)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link .btn-text { color: hsl(var(--menu-compras)); }
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-compras)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link .btn-text { color: hsl(var(--menu-admin)); }
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-admin)); filter: brightness(1.1); }
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link .icon,
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link .btn-text { color: hsl(var(--menu-admin)); }
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link:hover .icon,
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link:hover .btn-text { color: hsl(var(--menu-admin)); filter: brightness(1.1); }
/* Ativo: manter cor do menu pai */
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="cadastros"] .header-nav-link.active .btn-text { color: hsl(var(--menu-cadastros)); }
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="financeiro"] .header-nav-link.active .btn-text { color: hsl(var(--menu-financeiro)); }
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="vendas"] .header-nav-link.active .btn-text { color: hsl(var(--menu-vendas)); }
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="servico"] .header-nav-link.active .btn-text { color: hsl(var(--menu-servico)); }
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="compras"] .header-nav-link.active .btn-text { color: hsl(var(--menu-compras)); }
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="admin"] .header-nav-link.active .btn-text { color: hsl(var(--menu-admin)); }
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link.active .icon,
.nav-desktop .dropdown[data-menu="adm-sistema"] .header-nav-link.active .btn-text { color: hsl(var(--menu-admin)); }
/* Cores dos menus pai no mobile (accordion) */
.mobile-menu-nav .accordion-item[data-menu="cadastros"] .accordion-trigger .icon { color: hsl(var(--menu-cadastros)); }
.mobile-menu-nav .accordion-item[data-menu="financeiro"] .accordion-trigger .icon { color: hsl(var(--menu-financeiro)); }
.mobile-menu-nav .accordion-item[data-menu="vendas"] .accordion-trigger .icon { color: hsl(var(--menu-vendas)); }
.mobile-menu-nav .accordion-item[data-menu="servico"] .accordion-trigger .icon { color: hsl(var(--menu-servico)); }
.mobile-menu-nav .accordion-item[data-menu="compras"] .accordion-trigger .icon { color: hsl(var(--menu-compras)); }
.mobile-menu-nav .accordion-item[data-menu="admin"] .accordion-trigger .icon { color: hsl(var(--menu-admin)); }
.mobile-menu-nav .accordion-item[data-menu="adm-sistema"] .accordion-trigger .icon { color: hsl(var(--menu-admin)); }
.dropdown-item {
  position: relative;
  display: flex;
  cursor: default;
  user-select: none;
  align-items: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: background-color 150ms, color 150ms;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  cursor: pointer;
}
.dropdown-item:disabled,
.dropdown-item.disabled {
  pointer-events: none;
  opacity: 0.5;
}
.dropdown-item.active {
  background-color: hsl(var(--accent) / 0.2);
  color: hsl(var(--accent-foreground));
}
.dropdown-label {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.dropdown-label .dropdown-perfil-link:hover {
  color: hsl(var(--primary));
}
.dropdown-separator {
  margin: 0.25rem -0.25rem;
  height: 1px;
  background-color: hsl(var(--border));
}

/* Avatar */
.avatar {
  position: relative;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9999px;
}
.avatar-sm { height: 2rem; width: 2rem; }
.avatar-lg { height: 3rem; width: 3rem; }
.avatar-image {
  aspect-ratio: 1 / 1;
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.avatar-fallback {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

/* Icon sizes (igual v3) */
.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-lg svg {
  width: 100%;
  height: 100%;
}

/* Page header pattern (igual v3) */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.page-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}
.page-header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Alert */
.alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
}
.alert-destructive {
  border-color: hsl(var(--destructive) / 0.5);
  color: hsl(var(--destructive));
}
.alert-title {
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1;
}
.alert-description { font-size: 0.875rem; }

/* Skeleton */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 25%,
    hsl(var(--muted) / 0.5) 50%,
    hsl(var(--muted)) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}
.skeleton-text:last-child { width: 60%; }
.skeleton-title {
  height: 1.5rem;
  width: 40%;
  margin-bottom: 0.75rem;
}
.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
}
.skeleton-card { height: 6rem; }
.skeleton-row { height: 2.5rem; }

/* Progressive Disclosure */
.disclosure {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.disclosure.open {
  max-height: 2000px;
  opacity: 1;
}
.disclosure-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--primary));
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  border: none;
  padding: 0;
}
.disclosure-trigger:hover { text-decoration: underline; }
.disclosure-trigger .icon { transition: transform 0.3s ease; }
.disclosure-trigger.open .icon { transform: rotate(180deg); }

/* Wizard / Stepper */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--muted));
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}
.wizard-step.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.wizard-step.completed {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
.wizard-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  font-weight: 600;
}
.wizard-step.active .wizard-step-number {
  background-color: hsl(var(--primary-foreground));
  color: hsl(var(--primary));
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.breadcrumb-item {
  color: hsl(var(--muted-foreground));
}
.breadcrumb-item.current {
  color: hsl(var(--foreground));
  font-weight: 500;
}
.breadcrumb-separator { color: hsl(var(--muted-foreground)); }
.breadcrumb-sep { color: hsl(var(--muted-foreground)); }

/* Adaptive Density */
:root { --density: 1; }
.density-compact {
  --density: 0.75;
  font-size: calc(0.875rem * var(--density));
}
.density-normal {
  --density: 1;
  font-size: calc(0.875rem * var(--density));
}
.density-comfortable {
  --density: 1.25;
  font-size: calc(0.875rem * var(--density));
}
.density-large {
  --density: 1.5;
  font-size: calc(0.875rem * var(--density));
}
.density-preview {
  padding: calc(0.5rem * var(--density));
  background: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
}
.density-selector {
  display: flex;
  gap: 0.25rem;
}
.density-option {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: hsl(var(--muted-foreground));
}
.density-option:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.density-option.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* Keyboard shortcut */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.375rem;
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-family: monospace;
  color: hsl(var(--muted-foreground));
}

/* Cognitive load / states */
.priority-high { font-weight: 600; color: hsl(var(--foreground)); }
.priority-medium { font-weight: 500; color: hsl(var(--muted-foreground)); }
.priority-low { font-weight: 400; color: hsl(var(--muted-foreground)); opacity: 0.7; }
.group-visual {
  padding: 1rem;
  background-color: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  border-left: 3px solid hsl(var(--primary));
}
.state-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: hsl(var(--muted-foreground));
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pagination-btn:hover:not(:disabled) {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--primary));
}
.pagination-btn.active {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination-prev,
.pagination-next {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pagination-prev:hover:not(:disabled),
.pagination-next:hover:not(:disabled) {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--primary));
}
.pagination-prev:disabled,
.pagination-next:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination-pages { display: flex; align-items: center; gap: 0.25rem; }
.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pagination-page:hover { background-color: hsl(var(--muted)); border-color: hsl(var(--primary)); }
.pagination-page.active {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.pagination-ellipsis { padding: 0 0.5rem; color: hsl(var(--muted-foreground)); }
.pagination-info { font-size: 0.875rem; color: hsl(var(--muted-foreground)); padding: 0 0.75rem; }

/* Selection Cards */
.selection-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.selection-cards-sm { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.selection-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background-color: hsl(var(--card));
  cursor: pointer;
  transition: all 0.2s ease;
}
.selection-card:hover {
  border-color: hsl(var(--primary) / 0.5);
}
.selection-card:has(input:checked),
.selection-card.selected {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}
.selection-card-content { flex: 1; }
.selection-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  color: hsl(var(--primary));
}
.selection-card-title { font-weight: 600; margin-bottom: 0.25rem; }
.selection-card-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.selection-card-check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid hsl(var(--border));
  background: hsl(var(--background));
}
.selection-card:has(input:checked) .selection-card-check,
.selection-card.selected .selection-card-check {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
/* ?cone e texto na mesma linha (ex.: Tipo de Registro no form OS) */
.selection-card-inline {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Modal Agendar Pr?ximo Contato (estilo v2) */
.schedule-option {
  padding: 1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  text-align: center;
}
.schedule-option:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}

/* FAB */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}
.fab:hover { transform: scale(1.1); }
/* Na p?gina de design, FAB n?o fica fixo na tela */
.demo-section .fab {
  position: relative;
  bottom: auto;
  right: auto;
}
.fab-extended {
  padding-left: 1.25rem;
  padding-right: 1.5rem;
  width: auto;
  min-width: 3.5rem;
  gap: 0.5rem;
}
.fab-label { font-size: 0.875rem; font-weight: 500; }
.fab-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
.fab-success:hover {
  background-color: hsl(var(--success) / 0.9);
}
.fab-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* FAB stack: container para FAB da a??o principal da p?gina (posi??o 2, acima do FAB favoritos) */
.fab-stack {
  position: fixed;
  bottom: 8.5rem;
  right: 1.0rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.fab-stack .fab {
  position: relative;
  bottom: auto;
  right: auto;
}
.fab-stack-2 {
  /* posi??o dentro do stack (2 = acima do favorito); mantido para sem?ntica/uso em seletores */
}

/* Status Items */
.status-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--card));
}
.status-preview {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-info { flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }
.status-name { font-weight: 500; font-size: 0.875rem; color: hsl(var(--foreground)); }
.status-description { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.status-actions { display: flex; gap: 0.25rem; }
.status-indicator {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: hsl(var(--muted-foreground));
}
.status-indicator-success { background-color: hsl(var(--success)); }
.status-indicator-warning { background-color: hsl(var(--warning)); }
.status-indicator-destructive { background-color: hsl(var(--destructive)); }
.status-indicator-pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* StatusDot: indicador universal (cor din?mica + anel pulsando). Usar componente StatusDot com --status-dot-color. */
@keyframes status-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 0.85; }
}
.status-dot-pulse-ring {
  position: relative;
  overflow: visible;
  background-color: var(--status-dot-color);
}
.status-dot-pulse-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: var(--status-dot-color);
  box-shadow: 0 0 8px 2px var(--status-dot-color);
  opacity: 0.8;
  animation: status-dot-pulse 1.5s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

/* Media: grava??o (pulse vermelho) e player de ?udio (conforme v3 inventario) */
.recording {
  animation: pulse-recording 1s infinite;
}
@keyframes pulse-recording {
  0%, 100% { background: hsl(var(--destructive) / 0.1); border-color: hsl(var(--destructive)); }
  50% { background: hsl(var(--destructive) / 0.3); border-color: hsl(var(--destructive)); }
}
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}
.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: transparent !important;
  background-image: none !important;
  color: hsl(var(--success));
  border: 2px solid hsl(var(--success));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.audio-play-btn:hover { background-color: transparent !important; background-image: none !important; }
.audio-progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: flex-end;
  padding-bottom: 2px;
}
.audio-progress-bar {
  width: 100%;
  height: 4px;
  background: hsl(var(--border));
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.audio-progress-fill {
  height: 100%;
  background: hsl(var(--primary));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s;
}
.audio-time {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-family: monospace;
}
.audio-player .audio-speed-btn.btn-primary {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border: none;
}
.audio-player .audio-speed-btn.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9) !important;
}
.audio-speed-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.audio-player .audio-delete-btn.btn-destructive {
  background-color: hsl(var(--destructive)) !important;
  color: hsl(var(--destructive-foreground)) !important;
  border: none;
}
.audio-player .audio-delete-btn.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9) !important;
}
.audio-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 2rem;
}
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: hsl(var(--border));
}
.activity-card {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
}
.activity-card:last-child { padding-bottom: 0; }
.activity-icon {
  position: absolute;
  left: -2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  z-index: 1;
}
.activity-icon.bg-success { background-color: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.activity-icon.bg-primary { background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.activity-icon.bg-warning { background-color: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }
.activity-content {
  flex: 1;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.activity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.activity-title { font-weight: 500; font-size: 0.875rem; }
.activity-time { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.activity-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }

/* File Upload */
.file-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius-lg);
  background-color: hsl(var(--muted) / 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.file-upload-zone:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}
.file-upload-zone.dragover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.1);
}
.file-upload-list { display: flex; flex-direction: column; gap: 0.5rem; }
.file-upload-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--card));
}
.file-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.file-upload-info { flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }
.file-upload-name { font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); }
.file-upload-size { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }

/* Metric Cards (BI) */
.metric-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.metric-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.metric-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.metric-title { font-size: 0.8125rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.metric-value { font-size: 1.5rem; font-weight: 700; color: hsl(var(--foreground)); }

/* Sheet / Drawer */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
  animation: sheet-overlay-in 0.2s ease-out;
}
@keyframes sheet-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.sheet-content {
  position: fixed;
  z-index: 51;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: hsl(var(--background));
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform 300ms ease-in-out;
}
.sheet-content-left {
  left: 0;
  inset-y: 0;
  height: 100%;
  width: 75%;
  max-width: 400px;
  border-right: 1px solid hsl(var(--border));
  transform: translateX(-100%);
}
.sheet-content-left.sheet-open {
  transform: translateX(0);
}
.sheet-content-right {
  right: 0;
  inset-y: 0;
  height: 100%;
  width: 75%;
  max-width: 400px;
  border-left: 1px solid hsl(var(--border));
  transform: translateX(100%);
}
.sheet-content-right.sheet-open {
  transform: translateX(0);
}
.sheet-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}
.sheet-title { font-size: 1.125rem; font-weight: 600; color: hsl(var(--foreground)); margin: 0; }

/* ==========================================================================
   Screen reader
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ==========================================================================
   Verificar Respostas Compras - C?lulas de cota??o
   ========================================================================== */

.cotacao-cell {
  transition: all 0.2s ease;
  border-color: hsl(var(--border) / 0.3);
}

.cotacao-cell-selectable {
  cursor: pointer;
  border-color: hsl(var(--border) / 0.3);
}

.cotacao-cell-selectable:hover {
  border-color: hsl(var(--primary) / 0.5) !important;
  box-shadow: inset 0 0 22px 6px hsl(var(--primary) / 0.28), inset 0 0 10px 2px hsl(var(--primary) / 0.12), 0 0 0 2px hsl(var(--primary) / 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: hsl(var(--muted) / 0.3);
}

.cotacao-cell-selected {
  border-color: hsl(var(--success)) !important;
  background-color: hsl(var(--success) / 0.1);
  box-shadow: inset 0 0 8px 2px hsl(var(--success) / 0.15);
}

.cotacao-cell-selected:hover {
  border-color: hsl(var(--success)) !important;
  box-shadow: inset 0 0 10px 3px hsl(var(--success) / 0.2), 0 0 0 2px hsl(var(--success) / 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  background-color: hsl(var(--success) / 0.15);
}

/* ==========================================================================
   Verificar Respostas Compras - Cards Somat?rio por Fornecedor
   ========================================================================== */

/* Cards do somat?rio: bordas vis?veis no modo dark (sobrescreve .dark .border-border transparent) */
.somatorio-fornecedor-card {
  border-color: hsl(var(--border));
}
.dark .somatorio-fornecedor-card {
  border-color: hsl(var(--border));
}

/* Cards do resumo geral: bordas vis�veis no modo dark (sobrescreve .dark .border-border transparent) */
.resumo-geral-card {
  border-color: hsl(var(--border));
}
.dark .resumo-geral-card {
  border-color: hsl(var(--border));
}
