/* ==========================================================================
   KADent Prime 4.0 — Design System Médico & Odontológico
   Fidelidade extrema ao Portal 4.0 com acabamento premium moderno
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Rampa Tipográfica Harmonizada */
  --text-2xs: 0.6875rem; /* 11px */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.75rem;   /* 28px */
  --text-4xl: 2.25rem;   /* 36px */

  /* Escala de Espaçamento Base-4/8px */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem;  /* 24px */
  --space-8: 2rem;    /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem;   /* 48px */

  /* Cores Médicas / Odontológicas */
  --bg-app: #f4f7fb;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-surface: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

  /* Marca KADent / Portal 4.0 */
  --brand-navy: #0f172a;
  --brand-blue: #0284c7;
  --brand-blue-hover: #0369a1;
  --brand-blue-subtle: #f0f9ff;
  --brand-blue-border: #bae6fd;
  --brand-cyan: #06b6d4;
  --brand-sky: #38bdf8;
  --brand-orange: #ea580c;
  --brand-orange-hover: #c2410c;
  --brand-orange-light: #fff7ed;
  --brand-gold: #f59e0b;
  --brand-gold-subtle: #fffbeb;
  --brand-gold-border: #fde68a;
  --brand-success: #10b981;
  --brand-success-contrast: #047857;
  --brand-success-deep: #065f46;
  --brand-success-subtle: #ecfdf5;
  --brand-success-border: #a7f3d0;
  --brand-danger: #ef4444;
  --brand-danger-subtle: #fef2f2;
  --brand-danger-border: #fecaca;
  --brand-teal: #0f766e;
  --brand-sky-subtle: #e0f2fe;
  --dark-surface-elevated: #1e293b;
  --dark-border-subtle: #334155;

  /* Texto */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Transições e Raios */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}



/* ==========================================================================
   Craft Floor: Superfícies do Navegador & Acessibilidade
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background-color: var(--brand-blue);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Custom Scrollbar Cirúrgica */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Tipografia Numérica Tabular Universal */
table, .metric-value, .stat-value, .code, .awb-pin, .card-dash-value-large, .gauge-center-val {
  font-variant-numeric: tabular-nums;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navbar Superior
   ========================================================================== */
.navbar-top {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-badge-symbol {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-hover));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  white-space: nowrap;
}

.brand-main-line {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
  line-height: 1;
  white-space: nowrap;
}

.brand-version-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.brand-subtitle {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-orange);
  line-height: 1;
  white-space: nowrap;
  margin-top: 1px;
}

/* Links do Navbar Principal */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-item {
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn span {
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn.active {
  color: var(--brand-blue-hover);
  background: var(--bg-card-subtle);
}

.nav-btn .badge-pill {
  font-size: var(--text-2xs);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  font-weight: 700;
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 260px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 100;
  animation: fadeInSlide 0.15s ease-out forwards;
}

.nav-dropdown.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-card-subtle);
  color: var(--brand-blue);
  transform: translateX(3px);
}

.dropdown-item .item-desc {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #047857;
  color: #ffffff;
  padding: 0.38rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-whatsapp span {
  white-space: nowrap;
}

.btn-whatsapp:hover {
  background: var(--brand-success-deep);
  transform: translateY(-1px);
}

/* Botões de Ícone da Navbar Superior (Home, Suporte) */
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  text-decoration: none;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}

.nav-icon-btn:hover {
  background: var(--color-brand-primary-light);
  border-color: var(--color-brand-primary-border);
  color: var(--color-brand-primary);
  transform: translateY(-1px);
}

.nav-icon-suporte {
  color: #047857;
}

.nav-icon-suporte:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  transform: translateY(-1px);
}

.status-dot-pulse {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 1.5px var(--bg-card);
}

/* Botão Utilitário da Navbar (Design System / Ferramentas) */
.nav-util-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-brand-primary);
  background: var(--color-brand-primary-subtle);
  border: 1px solid var(--color-brand-primary-border);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-util-btn:hover {
  background: var(--color-brand-primary-light);
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary-hover);
  transform: translateY(-1px);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}

.user-profile-badge:hover {
  background: var(--bg-card);
  border-color: var(--color-brand-primary-border);
}

/* Badge de Papel/Role do Usuário (CLÍNICA, EMPRESA, CONSULTOR, GESTOR) */
.badge-role {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2.5px 6.5px;
  border-radius: 4px;
  color: #ffffff !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  background: #0284c7;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
  max-width: 110px;
}

#user-display-name {
  font-size: 0.8rem;
  color: var(--color-text-primary);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

#user-display-cargo {
  display: none; /* Exibido com riqueza de detalhes no modal do perfil ao clicar */
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-blue-hover);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   Sub-Header com Banner e Seletor de Clínica — Fixo (Sticky) Universal
   ========================================================================== */
.sub-header-banner {
  background: rgba(240, 249, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 64px;
  z-index: 90;
  box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.sub-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.banner-title-group {
  flex: 1 1 320px;
  min-width: 0;
}

.banner-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-blue-hover);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Seletor de Clínica — Contenção Blindada & Acessibilidade WCAG */
.clinica-selector-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  padding: 0.35rem 0.65rem 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.clinica-selector-bar:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.clinica-selector-bar label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a; /* Alto contraste WCAG AA > 14:1 */
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  margin: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
}

/* Wrapper do Select com seta SVG integrada */
.clinica-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.clinica-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 34px;
  width: 250px;
  max-width: 280px;
  min-width: 180px;
  padding: 0 1.85rem 0 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition-fast);
}

.clinica-select:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: #ffffff;
}

.clinica-select:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-color: var(--brand-blue);
  background: #ffffff;
}

.clinica-select:disabled {
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.85;
}

.clinica-select-chevron {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.clinica-select-wrapper:focus-within .clinica-select-chevron {
  color: var(--brand-blue);
}

/* Badge de Isolamento / Perfil */
#badge-isolamento-clinica {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 26px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  letter-spacing: 0.015em;
  line-height: 1;
}

/* Responsividade do Header em viewports compactas */
@media (max-width: 1080px) {
  .sub-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .banner-title-group {
    width: 100%;
  }
  .clinica-selector-bar {
    width: fit-content;
    max-width: 100%;
    justify-content: flex-start;
  }
}

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

/* Título de Seção */
.section-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   Grid do Dashboard — Faixa de KPIs Puros & Widgets Analíticos (Padrão Impeccable)
   ========================================================================== */
.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

@media (max-width: 640px) {
  .dashboard-kpi-strip {
    grid-template-columns: 1fr;
  }
}

.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

.dashboard-widgets-grid > .ds-card {
  display: flex;
  flex-direction: column;
  min-height: 475px;
  height: 100%;
}

.dashboard-widgets-grid > .ds-card > .ds-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#dash-itens-list {
  min-height: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.4rem;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-alert-mini {
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3, 0.75rem);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}

.kpi-alert-mini:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.alert-danger-mini {
  background: var(--color-danger-bg, #fff1f2);
  border: 1px solid var(--color-danger-border, #fecdd3);
}

.alert-info-mini {
  background: var(--color-info-bg, #f0f9ff);
  border: 1px solid var(--color-info-border, #bae6fd);
}

.alert-success-mini {
  background: var(--color-success-bg, #ecfdf5);
  border: 1px solid var(--color-success-border, #a7f3d0);
}


.dashboard-grid,
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 992px) {
  .dashboard-grid,
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.card-dash,
.card-kpi-item {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 195px;
  overflow: hidden;
}

.card-kpi-item:hover,
.card-dash:hover {
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.03);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.card-kpi-item.card-clickable {
  cursor: pointer;
}

.card-kpi-item.card-clickable:active {
  transform: translateY(0);
}

.card-kpi-item.card-danger-accent {
  border-color: #fecdd3;
  background: linear-gradient(180deg, #ffffff 0%, #fff5f5 100%);
}

.card-kpi-item.card-danger-accent:hover {
  border-color: #fda4af;
  box-shadow: 0 10px 25px -4px rgba(225, 29, 72, 0.12);
}

/* Header dos Cards de KPI */
.card-kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card-kpi-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-kpi-icon-pill {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.card-kpi-item:hover .card-kpi-icon-pill {
  transform: scale(1.05);
}

.card-kpi-icon-pill.icon-blue { background: #eff6ff; color: #2563eb; }
.card-kpi-icon-pill.icon-indigo { background: #eef2ff; color: #4f46e5; }
.card-kpi-icon-pill.icon-amber { background: #fffbeb; color: #d97706; }
.card-kpi-icon-pill.icon-emerald { background: #ecfdf5; color: #059669; }
.card-kpi-icon-pill.icon-slate { background: #f1f5f9; color: #475569; }
.card-kpi-icon-pill.icon-danger { background: #ffe4e6; color: #e11d48; }
.card-kpi-icon-pill.icon-sky { background: #f0f9ff; color: #0284c7; }

.card-kpi-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}

.card-kpi-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

/* Badges Semânticas de Topo */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-status.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-status.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-status.badge-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-status.badge-info { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.badge-status.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d97706;
  display: inline-block;
  animation: pulseKpi 1.8s ease-in-out infinite;
}

.pulse-dot-red {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e11d48;
  display: inline-block;
  animation: pulseKpi 1.8s ease-in-out infinite;
}

@keyframes pulseKpi {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Corpo dos Cards */
.card-kpi-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0.4rem 0 0.85rem;
  flex: 1;
}

.card-kpi-body.align-center {
  align-items: center;
  text-align: center;
}

.card-kpi-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.card-kpi-stat-value .currency-prefix {
  font-size: 1.15rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 2px;
}

.card-kpi-stat-value.stat-danger {
  color: #be123c;
}

.card-kpi-stat-value.stat-sky {
  color: #0284c7;
}

.card-kpi-desc {
  font-size: 0.785rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  line-height: 1.35;
}

.stat-danger-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #be123c;
  margin-top: 0.25rem;
}

.stat-sky-label {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.25rem;
}

/* Alert Boxes Internas */
.kpi-alert-box {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.kpi-alert-box.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
}

.kpi-alert-headline {
  font-size: 0.875rem;
  font-weight: 700;
  color: #b45309;
}

.kpi-alert-sub {
  font-size: 0.75rem;
  color: #92400e;
  margin-top: 2px;
}

/* Empty States Compactos */
.kpi-empty-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
}

.kpi-empty-state .empty-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.kpi-empty-state .empty-icon.icon-check { background: #ecfdf5; color: #059669; }
.kpi-empty-state .empty-icon.icon-shield { background: #eff6ff; color: #2563eb; }
.kpi-empty-state .empty-icon.icon-tool { background: #f1f5f9; color: #475569; }

.kpi-empty-state .empty-text-wrap {
  display: flex;
  flex-direction: column;
}

.kpi-empty-state .empty-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: #334155;
}

.kpi-empty-state .empty-desc {
  font-size: 0.725rem;
  color: #64748b;
  margin-top: 1px;
}

/* Gauge Semicircular de Alta Precisão */
.gauge-card-body {
  position: relative;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
}

.gauge-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
}

.gauge-svg-container {
  width: 100%;
  max-width: 295px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg-val {
  font-size: 38px;
  font-weight: 800;
  fill: #0f172a;
  font-family: var(--font-sans);
}

.gauge-svg-sub {
  font-size: 10px;
  font-weight: 600;
  fill: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}

.gauge-svg-pct {
  font-size: 11.5px;
  font-weight: 700;
  fill: #0284c7;
  font-family: var(--font-sans);
}

.gauge-milestone-ticks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 280px;
  margin: 0.6rem auto 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.gauge-milestone-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.gauge-milestone-item.target-highlight {
  color: #0284c7;
  font-weight: 700;
}

/* Lista de Itens Acima do Estipulado */
.kpi-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-kpi-nav {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-kpi-nav:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

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

.kpi-page-indicator {
  font-size: 0.725rem;
  font-weight: 600;
  color: #64748b;
  padding: 0 4px;
  white-space: nowrap;
}

.kpi-itens-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kpi-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  transition: all 0.15s ease;
}

.kpi-item-placeholder {
  visibility: hidden !important;
  pointer-events: none !important;
  border-color: transparent !important;
  background: transparent !important;
}

.kpi-item-row:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.item-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.item-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: #0f172a;
}

.item-desc {
  font-size: 0.685rem;
  color: #64748b;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-tag-remove {
  font-size: 0.7rem;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Footer dos Cards */
.card-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
  font-size: 0.775rem;
}

.footer-meta {
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-target {
  font-size: 0.725rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 1px 7px;
  border-radius: 9999px;
}

.card-kpi-action-link {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.card-kpi-action-link:hover {
  color: #0369a1;
  text-decoration: underline;
}

.action-arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}

.card-kpi-item:hover .action-arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   Tabela de Planejamento Financeiro
   ========================================================================== */
.card-planejamento {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.planejamento-title {
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.table-planejamento {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: center;
}

.table-planejamento th, .table-planejamento td {
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.5rem;
}

.table-planejamento th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-secondary);
}

.table-planejamento td.col-header {
  font-weight: 700;
  text-align: left;
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  white-space: nowrap;
}

.table-planejamento .val-destaque {
  font-weight: 800;
  color: var(--brand-navy);
}

.table-planejamento .val-economia {
  font-weight: 800;
  color: var(--brand-success);
  background: var(--brand-success-subtle);
}

.table-planejamento .tooltip-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  background: var(--brand-sky);
  color: white;
  border-radius: 50%;
  font-size: var(--text-2xs);
  line-height: 13px;
  margin-left: 3px;
  cursor: help;
}

/* ==========================================================================
   Carrossel Institucional
   ========================================================================== */
.carrossel-banner {
  background: linear-gradient(135deg, var(--dark-surface-elevated) 0%, var(--brand-navy) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.carrossel-content h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.carrossel-content h2 span {
  color: var(--brand-gold);
}

.carrossel-badges {
  display: flex;
  gap: 1.25rem;
  margin-top: 1rem;
}

.carrossel-badge-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.carrossel-badge-item strong {
  font-size: var(--text-lg);
  color: var(--brand-sky);
  display: block;
}

/* ==========================================================================
   Componentes de Formulário, Filtros e Tabelas Genéricas
   ========================================================================== */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label,
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.form-control,
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 0.625rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.form-control:hover,
.form-input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

.form-control:focus,
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
  background-color: #ffffff;
}

.form-control::placeholder,
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  font-size: 0.825rem;
  font-weight: 400;
}

select.form-control,
select.form-input,
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
}

/* Grupos de Botões Toggle (Sim/Não, Ambas/Pendentes/Concluídas) */
.btn-toggle-group {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.btn-toggle {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card-subtle);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-toggle.active {
  background: var(--brand-orange);
  color: white;
}

/* ==========================================================================
   Botões de Ação Padronizados (Design System SSOT KeyPartners)
   ========================================================================== */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-success,
.btn-danger,
.ds-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--space-2) !important;
  height: 38px !important;
  box-sizing: border-box !important;
  padding: 0 var(--space-4) !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--font-size-sm) !important;
  font-weight: var(--font-weight-semibold) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  text-decoration: none !important;
  user-select: none !important;
  transition: all var(--transition-fast) !important;
  border: 1px solid transparent !important;
}

/* Tamanhos Rigorosamente Uniformes */
.btn-sm,
.ds-btn-sm {
  height: 32px !important;
  padding: 0 var(--space-3) !important;
  font-size: var(--font-size-xs) !important;
  border-radius: var(--radius-sm) !important;
}

.btn-lg,
.ds-btn-lg {
  height: 44px !important;
  padding: 0 var(--space-6) !important;
  font-size: var(--font-size-md) !important;
  border-radius: var(--radius-lg) !important;
}

/* Variantes Semânticas com Alto Contraste WCAG AA (>4.5:1) */
.btn-primary,
.ds-btn-primary {
  background-color: var(--color-brand-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-brand-primary) !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2) !important;
}
.btn-primary:hover,
.ds-btn-primary:hover {
  background-color: var(--color-brand-primary-hover) !important;
  border-color: var(--color-brand-primary-hover) !important;
  transform: translateY(-1px) !important;
}

.btn-secondary,
.ds-btn-secondary {
  background-color: var(--color-brand-dark) !important;
  color: #ffffff !important;
  border-color: var(--color-brand-dark) !important;
}
.btn-secondary:hover,
.ds-btn-secondary:hover {
  background-color: var(--color-brand-dark-hover) !important;
  border-color: var(--color-brand-dark-hover) !important;
  transform: translateY(-1px) !important;
}

.btn-outline,
.ds-btn-outline {
  background-color: var(--color-bg-surface) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-border) !important;
}
.btn-outline:hover,
.ds-btn-outline:hover {
  background-color: var(--color-bg-surface-subtle) !important;
  border-color: var(--color-border-hover) !important;
  color: var(--color-brand-primary) !important;
}

.btn-success,
.ds-btn-success {
  background-color: var(--color-success) !important;
  color: #ffffff !important;
  border-color: var(--color-success) !important;
}
.btn-success:hover,
.ds-btn-success:hover {
  background-color: var(--color-success-hover) !important;
  border-color: var(--color-success-hover) !important;
}

.btn-danger,
.ds-btn-danger {
  background-color: var(--color-danger) !important;
  color: #ffffff !important;
  border-color: var(--color-danger) !important;
}
.btn-danger:hover,
.ds-btn-danger:hover {
  background-color: var(--color-danger-hover) !important;
  border-color: var(--color-danger-hover) !important;
}

/* Tabelas de Resultados */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.results-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
}

.results-header h3 {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text-primary);
}

.table-data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table-data th {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-data td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table-data tr:hover td {
  background: var(--bg-card-subtle);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: var(--text-xs);
  font-weight: 600;
}

.btn-icon:not(:empty) {
  width: auto;
  min-width: 32px;
  padding: 0 0.65rem;
  white-space: nowrap;
}

.btn-icon:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--bg-card-subtle);
}

.btn-icon.danger:hover {
  border-color: var(--brand-danger);
  color: var(--brand-danger);
  background: var(--brand-danger-subtle);
}

.btn-dash-pag {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-dash-pag:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--bg-card-subtle);
}

/* ==========================================================================
   Modais Interativos
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-navy);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-card-subtle);
}

/* Abas do Modal */
.modal-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.modal-tab-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.modal-tab-btn.active {
  color: var(--brand-blue);
}

.modal-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-blue);
}

/* Scanner Barcode / DataMatrix */
.scanner-box {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: white;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scanner-input-row {
  display: flex;
  gap: 0.5rem;
}

.scanner-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.scanner-input:focus {
  border-color: var(--brand-sky);
  background: rgba(255, 255, 255, 0.15);
}

/* Animações & Acessibilidade */
@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsividade */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .navbar-top {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   MÓDULO 1: ESTILOS CIRÚRGICOS DE ONBOARDING, SIMULADOR & OPENSIGN
   ========================================================================== */

/* Hero Banner com Profundidade & Grid Sutil */
.hero-onboarding {
  background: linear-gradient(135deg, #090d16 0%, #111827 50%, #1e293b 100%);
  color: #ffffff;
  padding: 2.75rem 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.hero-onboarding::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* Indicador Pulsante */
.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(234, 88, 12, 0.18);
  color: #fb923c;
  border: 1px solid rgba(234, 88, 12, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ea580c;
  box-shadow: 0 0 8px #ea580c;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Strip de Métricas de Autoridade */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-item-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.metric-item-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Simulador de Consignação Interativo */
.simulador-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.simulador-slider-control {
  width: 100%;
  accent-color: var(--brand-orange);
  height: 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.simulador-metric-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

/* Stepper de Onboarding Multi-Step */
.stepper-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 1.5rem;
}

.stepper-nav::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 0 8px;
  cursor: pointer;
}

.step-node-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.step-node.active .step-node-circle {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.18);
}

.step-node.completed .step-node-circle {
  border-color: #059669;
  background: #059669;
  color: #ffffff;
}

.step-node-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.step-node.active .step-node-label {
  color: var(--brand-blue);
  font-weight: 700;
}

/* OpenSign Certificado Visual */
.opensign-certificate-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #334155;
  color: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ==========================================================================
   MÓDULO 2 — EXPEDIÇÃO INDUSTRIAL B2B, BIPAGEM GS1 & RADAR DE RASTREIO
   Padrão de Excelência Visual (Linear / Shopify Fulfillment / Uber Freight)
   ========================================================================== */

/* Colunas do Kanban Industrial */
.expedicao-kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.kanban-coluna {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.kanban-coluna-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.kanban-coluna-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-coluna-counter {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  color: var(--text-muted);
}

/* Card Kanban Elevado Neutro e Limpo (Zero Bordas Coloridas) */
.expedicao-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.expedicao-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-hover);
}

.expedicao-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.expedicao-card-code {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  letter-spacing: 0.3px;
  color: var(--color-brand-primary);
}

.expedicao-code-prefix {
  font-size: var(--font-size-xs);
  opacity: 0.85;
}

.expedicao-badge-remessa {
  font-size: var(--font-size-xs);
  background: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  color: var(--color-slate-500);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.expedicao-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.expedicao-clinica-nome {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expedicao-clinica-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.expedicao-meta-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expedicao-sap-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: var(--color-bg-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* Faixa de Carga e Custódia */
.expedicao-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px var(--space-2);
  font-size: var(--font-size-xs);
  gap: var(--space-2);
}

.expedicao-meta-cargo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.expedicao-meta-cargo i {
  color: var(--color-text-muted);
  font-size: 11px;
}

.expedicao-meta-sep {
  color: var(--color-text-subtle);
  font-size: 0.6875rem;
  margin: 0 1px;
}

.expedicao-meta-pin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.expedicao-meta-pin i {
  color: var(--color-brand-primary);
  font-size: 10px;
}

.expedicao-meta-pin strong {
  color: var(--color-text-primary);
}

/* Rodapé de Ações */
.expedicao-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  width: 100%;
}

.expedicao-btn-action {
  width: 100%;
  justify-content: center;
  height: 34px !important;
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-semibold) !important;
}

.expedicao-btn-subaction {
  flex: 0 0 88px;
  justify-content: center;
  height: 34px !important;
  font-size: var(--font-size-xs) !important;
}

.expedicao-btn-mainaction {
  flex: 1;
  justify-content: center;
  height: 34px !important;
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-semibold) !important;
}

/* Scanner Industrial GS1 DataMatrix (Honeywell / Zebra Style) */
.scanner-hardware-view {
  background: #090d16;
  border: 2px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.scanner-laser-target {
  height: 2px;
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
  box-shadow: 0 0 12px #ef4444;
  animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
  0% { transform: translateY(-8px); opacity: 0.4; }
  100% { transform: translateY(8px); opacity: 1; }
}

.scanner-display-lcd {
  background: #030712;
  border: 1px solid #1f2937;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* PIN de Custódia (Handshake de Entrega) */
.pin-handshake-pill {
  background: var(--bg-card-subtle);
  border: 1.5px dashed var(--brand-orange);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pin-handshake-num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--brand-orange);
}

/* Card de Aceite Tácito (Art. 206 CC) com Barra de Progresso Legal */
.tacito-legal-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}



.tacito-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
}

.tacito-progress-fill {
  height: 100%;
  background: #059669;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ==========================================================================
   MÓDULO 3 — ESTOQUE CONSIGNADO & REGISTRO INTRAOPERATÓRIO CIRÚRGICO
   Padrão Hospitalar & Odontológico (Epic / One Medical / KADent Prime 4.0)
   ========================================================================== */

/* KPIs do Centro Cirúrgico / Estoque Consignado */
.surgical-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.surgical-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.surgical-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.surgical-kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.surgical-kpi-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-color);
  font-family: var(--font-mono);
}

/* Scanner Cirúrgico Intraoperatório */
.surgical-scanner-box {
  background: linear-gradient(135deg, #090d16 0%, #111827 100%);
  border: 1.5px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.15);
}

.prontuario-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
}

/* Ações Fiscais e Financeiras (Anti-Sobreposição) */
.fiscal-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.fiscal-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  box-sizing: border-box;
  padding: 0 10px;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap !important;
  line-height: 1;
  transition: all 0.15s ease;
  background: var(--color-bg-surface, #ffffff);
  color: var(--color-text-primary, #0f172a);
  border: 1px solid var(--color-border, #e2e8f0);
}

.fiscal-action-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.fiscal-action-btn.primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.fiscal-action-btn.primary:hover {
  background: #0369a1;
}

.fiscal-action-btn.warning {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.fiscal-action-btn.warning:hover {
  background: #ffedd5;
}

.fiscal-action-btn.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.fiscal-action-btn.danger:hover {
  background: #fee2e2;
}

/* ==========================================================================
   Tabela de Tiers de Parceria Odontológica — Padrão AIDD-UIUX & Impeccable
   ========================================================================== */
.tier-comparison-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  margin-top: 1rem;
  overflow: hidden;
}

.tier-comparison-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.tier-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabela-tiers-prime {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

.tabela-tiers-prime thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.tabela-tiers-prime tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tabela-tiers-prime tbody tr:last-child {
  border-bottom: none;
}

.tabela-tiers-prime tbody tr:hover {
  background: rgba(2, 132, 199, 0.025);
}

.tabela-tiers-prime tbody td {
  padding: 16px 18px;
  vertical-align: middle;
}

/* Tier em Destaque — Gold Prime */
.tabela-tiers-prime tbody tr.tier-row-destaque {
  background: rgba(234, 88, 12, 0.035);
  position: relative;
}

.tabela-tiers-prime tbody tr.tier-row-destaque td:first-child {
  border-left: 3px solid var(--brand-orange, #ea580c);
}

.tabela-tiers-prime tbody tr.tier-row-destaque:hover {
  background: rgba(234, 88, 12, 0.06);
}

/* Badges e Identificadores de Tier */
.tier-identity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.tier-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tier-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tier-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.tier-subtitle-text {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
}

.tier-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}

/* Tipografia Numérica Instrumental */
.tier-metric-val {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tier-metric-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
}

/* Chips de Ativos em Comodato */
.comodato-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 440px;
}

.comodato-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 9px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.comodato-chip.destaque {
  background: #fff7ed;
  border-color: #ffedd5;
  color: #c2410c;
}

/* Botões de Ação por Tier */
.btn-tier-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 150ms ease;
  cursor: pointer;
}

.btn-tier-cta.gold {
  background: var(--brand-orange, #ea580c);
  color: #ffffff;
  border: 1px solid var(--brand-orange, #ea580c);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.btn-tier-cta.gold:hover {
  background: #c2410c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

.btn-tier-cta.secondary {
  background: #ffffff;
  color: #0284c7;
  border: 1px solid #cbd5e1;
}

.btn-tier-cta.secondary:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

/* ==========================================================================
   Grade de Cards de Tiers de Contrato (Padrão Impeccable Pricing Cards)
   ========================================================================== */
.tier-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.tier-cards-header-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.tier-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.tier-pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  position: relative;
  min-width: 0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tier-pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08);
}

.tier-pricing-card.destaque-gold {
  border: 2px solid var(--brand-orange);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.14);
}

.tier-pricing-card.destaque-gold:hover {
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.22);
}

.tier-card-badge-top {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--brand-orange);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
  white-space: nowrap;
}

.tier-card-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tier-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 4px 0 6px 0;
  color: var(--text-primary);
  line-height: 1.25;
}

.tier-card-volume {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tier-card-volume.destaque-orange {
  color: var(--brand-orange);
}

.tier-card-volume span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-primary);
}

.tier-card-metrics-box {
  background: var(--bg-card-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
  width: 100%;
}

.tier-card-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.78rem;
  width: 100%;
  box-sizing: border-box;
}

.tier-card-metric-row .metric-label {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  flex: 1 1 auto;
  min-width: 0;
}

.tier-card-metric-row .metric-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
}

.btn-card-tier-cta {
  width: 100%;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
}

.btn-card-tier-cta.primary {
  background: var(--brand-blue);
  color: #ffffff;
}

.btn-card-tier-cta.primary:hover {
  background: var(--brand-blue-hover);
  transform: translateY(-1px);
}

.btn-card-tier-cta.gold {
  background: var(--brand-orange);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.btn-card-tier-cta.gold:hover {
  background: var(--brand-orange-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   ESTEIRA DE EXPEDIÇÃO & RASTREABILIDADE B2B (Craft Floor Impeccable)
   ========================================================================== */

.expedicao-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  box-sizing: border-box;
}

/* Hero Banner Industrial com Botões Agrupados à Direita em Coluna */
.expedicao-hero-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-subtle) 100%);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  gap: var(--space-5);
  box-sizing: border-box;
  width: 100%;
}

.expedicao-hero-info {
  flex: 1;
  min-width: 280px;
}

.expedicao-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 290px;
  flex-shrink: 0;
}

.expedicao-hero-btn {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid transparent;
}

.expedicao-hero-btn.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-color);
}

.expedicao-hero-btn.btn-secondary:hover {
  background: var(--bg-card-subtle);
  border-color: #cbd5e1;
}

.expedicao-hero-btn.btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.expedicao-hero-btn.btn-primary:hover {
  background: #1e293b;
}

.expedicao-badge-industrial {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Stats Rail de Operações Rápidas */
.expedicao-stats-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  width: 100%;
}

@media (max-width: 1100px) {
  .expedicao-stats-rail {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .expedicao-stats-rail {
    grid-template-columns: 1fr;
  }
}

.expedicao-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-xs);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.expedicao-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.expedicao-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expedicao-stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.expedicao-stat-icon.emerald { background: #d1fae5; color: #059669; }
.expedicao-stat-icon.indigo { background: #e0e7ff; color: #4f46e5; }
.expedicao-stat-icon.orange { background: #ffedd5; color: #ea580c; }

.expedicao-stat-info {
  display: flex;
  flex-direction: column;
}

.expedicao-stat-val {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.expedicao-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Toolbar de Filtros da Esteira */
.expedicao-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  background: var(--bg-card);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.expedicao-search-wrap {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 440px;
}

.expedicao-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.expedicao-search-input,
.expedicao-search-wrap input.expedicao-search-input {
  width: 100%;
  padding-left: 48px !important;
  padding-right: 14px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-color);
  outline: none;
  box-sizing: border-box;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.expedicao-search-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.expedicao-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}

/* Container do Kanban com Tamanhos Fixos e Alinhamento Preciso */
.expedicao-kanban-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.expedicao-kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  width: 100%;
  min-width: 1100px;
}

@media (max-width: 1280px) {
  .expedicao-kanban-grid {
    grid-template-columns: repeat(4, 300px);
    min-width: 1260px;
  }
}

/* Coluna Kanban com Altura e Largura Fixas Idênticas (Zero Desalinhamento) */
.expedicao-col {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 740px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
}

/* Barra superior de 3px REMOVIDA sob solicitação */
.expedicao-col::before {
  display: none;
}

.expedicao-col-header {
  height: 52px;
  padding: 0 var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
  box-sizing: border-box;
}

.expedicao-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-color);
  white-space: nowrap;
}

.expedicao-col-badge {
  background: #64748b;
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.col-novos .expedicao-col-badge { background: #64748b; }
.col-picking .expedicao-col-badge { background: #0284c7; }
.col-pronto .expedicao-col-badge { background: #6366f1; }
.col-rota .expedicao-col-badge { background: #ea580c; }

.expedicao-col-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
}

/* Empty State Moderno para Todas as Colunas */
.expedicao-col-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  gap: var(--space-2);
  margin: auto 0;
}

.expedicao-col-empty svg {
  opacity: 0.45;
  margin-bottom: var(--space-1);
  color: var(--text-muted);
}

.expedicao-col-empty .empty-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-color);
}

.expedicao-col-empty .empty-desc {
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 220px;
}

.btn-clear-col-filter {
  margin-top: 8px;
  font-size: 0.75rem;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--brand-blue);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-col-filter:hover {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  transition: all var(--transition-fast);
}

.btn-clear-search:hover {
  background: var(--border-color);
  color: var(--text-color);
}

/* Barra de Progresso no Card */
.expedicao-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.expedicao-progress-bar-bg {
  height: 5px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.expedicao-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 300ms ease;
  background: linear-gradient(90deg, #0284c7 0%, #059669 100%);
}

.expedicao-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* Lista de Itens do Pedido */
.expedicao-items-box {
  background: var(--bg-card-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expedicao-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expedicao-item-code {
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expedicao-item-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.expedicao-item-pill.bipado {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.expedicao-item-pill.pendente {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* PIN de Entrega Seguro */
.expedicao-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  box-sizing: border-box;
  background: var(--color-bg-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Responsividade Geral */
@media (max-width: 992px) {
  .expedicao-hero-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .expedicao-hero-actions {
    width: 100%;
  }
}

/* ==========================================================================
   TERMINAL INDUSTRIAL DE BIPAGEM GS1 DATAMATRIX (ROTA DEDICADA)
   ========================================================================== */
.terminal-bipagem-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.terminal-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
  gap: 1rem;
}

.terminal-top-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.terminal-top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.terminal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.terminal-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.terminal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .terminal-grid {
    grid-template-columns: 1fr;
  }
}

.terminal-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.terminal-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.terminal-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.terminal-feed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-card-subtle);
  border-radius: 4px;
  border-left: 3px solid #059669;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.terminal-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.terminal-item-row.conferido {
  background: #f0fdf4;
  border-color: #86efac;
}

.terminal-item-row.pendente {
  background: #fffbeb;
  border-color: #fde68a;
}


