/* MaiaClinical — Design System Profissional */
:root {
  --color-primary: #183F43;
  --color-primary-hover: #1f4f54;
  --color-primary-dark: #123033;
  --transition-fast: 0.15s ease;
  --color-sage: #4E827E;
  --color-sage-light: #649692;
  --color-soft-green: #E8F1EE;
  --color-soft-green-border: #d4e4df;
  --color-bg: #F7F8F6;
  --color-surface: #FFFFFF;
  --color-text-main: #25343A;
  --color-text-muted: #6a7c82;
  --color-border: #E5EBE8;
  --color-border-subtle: #edf2ef;
  
  --color-danger: #b33939;
  --color-danger-bg: #fdf0f0;
  --color-warning: #b78103;
  --color-warning-bg: #fef9e7;
  --color-success: #2e7d32;
  --color-success-bg: #e8f5e9;

  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-display: 'Manrope', 'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(24, 63, 67, 0.05);
  --shadow-md: 0 4px 14px rgba(24, 63, 67, 0.08);
  --shadow-lg: 0 12px 36px rgba(24, 63, 67, 0.12);
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Tipografia */
h1, h2, h3, .brand-text {
  font-family: var(--font-family-display);
  font-weight: 700;
  color: var(--color-primary);
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-sage);
}

.muted {
  color: var(--color-text-muted);
}

.small {
  font-size: 12px;
}

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

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

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

.btn-secondary {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-main);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-soft-green);
  border-color: var(--color-soft-green-border);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-sage);
  color: var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-soft-green);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

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

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--color-sage);
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--color-primary);
}

.btn-icon {
  background: none;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--color-soft-green);
  color: var(--color-primary);
}

.btn-action-icon {
  padding: 6px;
  background: var(--color-soft-green);
  border: 1px solid var(--color-soft-green-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  cursor: pointer;
}

.btn-action-icon:hover {
  background: var(--color-sage);
  color: #fff;
}

/* Formulários */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.hint-text {
  font-size: 11px;
  color: var(--color-text-muted);
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
}

input, select, textarea {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(78, 130, 126, 0.15);
}

/* Campo com Botão de Ação Rápida (+) - Regra Geral de UX/UI */
.input-action-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.input-action-group input,
.input-action-group select {
  flex: 1;
  min-width: 0;
}

.btn-quick-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
  background-color: var(--color-soft-green);
  border: 1px solid var(--color-sage);
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
}

.btn-quick-add:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-quick-add:active {
  transform: scale(0.95);
}

.btn-quick-add svg {
  pointer-events: none;
}

/* Alertas */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}

.alert-error {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid #f8d7da;
}

/* Tela de Autenticação */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 85% 15%, var(--color-soft-green) 0, transparent 40%), var(--color-bg);
}

.auth-card {
  width: min(100%, 460px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-sage);
}

.brand-text {
  font-size: 22px;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.brand-clinical {
  font-weight: 400;
  color: var(--color-sage);
}

.brand-tagline {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.auth-box h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-box p.muted {
  font-size: 13px;
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Shell Layout Principal */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}

/* Sidebar */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.btn-sidebar-toggle {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
  background: var(--color-soft-green);
  color: var(--color-primary);
  border-color: var(--color-soft-green-border);
}

.app-shell.sidebar-collapsed .btn-sidebar-toggle svg {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .clinic-selector-wrap,
.app-shell.sidebar-collapsed .nav-section-title,
.app-shell.sidebar-collapsed .nav-link span,
.app-shell.sidebar-collapsed .user-info,
.app-shell.sidebar-collapsed .user-profile-chevron {
  display: none !important;
}

.app-shell.sidebar-collapsed .brand-logo-row {
  justify-content: center !important;
}

.app-shell.sidebar-collapsed .sidebar-header {
  padding-bottom: 12px;
}

.app-shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
  position: relative;
}

/* Tooltip nativo em CSS no modo recolhido */
.app-shell.sidebar-collapsed .nav-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  background: #183F43;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1200;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.app-shell.sidebar-collapsed .nav-link[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(2px);
}

.user-profile-btn {
  background: transparent;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}

.user-profile-btn:hover {
  background: var(--color-soft-green);
}

.user-profile-chevron {
  margin-left: auto;
  color: var(--color-text-muted);
}

/* Popover Menu do Perfil do Usuário */
.user-profile-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(24, 63, 67, 0.15);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: var(--color-soft-green);
  color: var(--color-primary);
}

.user-dropdown-item svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.user-dropdown-item:hover svg {
  color: var(--color-primary);
}

.user-dropdown-logout:hover {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
}

.user-dropdown-logout:hover svg {
  color: #B91C1C !important;
}

.app-shell.sidebar-collapsed .user-profile-dropdown {
  left: calc(100% + 8px);
  bottom: 0;
  width: 220px;
}

.btn-mobile-menu {
  display: none;
}

@media (max-width: 900px) {
  .btn-mobile-menu {
    display: inline-flex;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 1100;
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1050;
  }
  .sidebar-backdrop.active {
    display: block;
  }
}

.sidebar-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.clinic-selector-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinic-switcher {
  width: 100%;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-primary);
  background-color: var(--color-soft-green);
  border: 1px solid var(--color-soft-green-border);
}

.badge-sub {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-trial {
  background-color: #fff3cd;
  color: #856404;
}

.badge-active {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.badge-suspended {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--color-text-muted);
  margin: 24px 8px 8px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}

.nav-link:hover:not(.disabled) {
  color: var(--color-primary);
  background-color: var(--color-soft-green);
}

.nav-link.active {
  color: var(--color-primary);
  background-color: var(--color-soft-green);
}

.nav-link.disabled {
  opacity: 0.5;
  cursor: default;
}

.tag-soon {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 6px;
  background-color: var(--color-bg);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background-color: var(--color-sage);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Conteúdo Principal */
.main-wrapper {
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.breadcrumb-separator {
  color: var(--color-border);
}

.breadcrumb-current {
  color: var(--color-primary);
  font-weight: 600;
}

.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background-color: var(--color-soft-green);
  border: 1px solid var(--color-soft-green-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-sage);
}

.page-view {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 36px;
}

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

.page-title {
  font-size: 28px;
  margin: 4px 0;
}

.page-desc {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Painel de Dados */
.data-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-toolbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--color-border);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  width: min(100%, 360px);
}

.search-box input {
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
}

.search-box input:focus {
  box-shadow: none;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--color-bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.tab-btn {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 4px;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Tabela de Dados */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: #fafbfa;
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: 0.8px;
  font-weight: 700;
  padding: 14px 24px;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #fafcfb;
}

.th-actions {
  text-align: right;
}

.client-name-cell {
  font-weight: 600;
  color: var(--color-primary);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.status-active {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.status-archived {
  background-color: #f1f3f4;
  color: #5f6368;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 48px;
  color: var(--color-text-muted);
}

/* Paginação */
.pagination-bar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafbfa;
  border-top: 1px solid var(--color-border);
}

.pagination-info {
  font-size: 12px;
  color: var(--color-text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-page:hover:not(:disabled) {
  background-color: var(--color-soft-green);
  border-color: var(--color-soft-green-border);
}

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

.page-indicator {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
}

/* Faturamento SaaS */
.billing-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.billing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.current-plan-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.plan-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.plan-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
}

.plan-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-sage);
}

.plan-status {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.usage-meter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.meter-track {
  height: 8px;
  background-color: var(--color-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background-color: var(--color-sage);
  border-radius: var(--radius-pill);
  transition: width 0.3s;
}

/* Diálogos / Modais */
.app-dialog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(94vw, 680px);
  margin: auto;
  box-shadow: var(--shadow-lg);
  background: var(--color-surface);
}

.app-dialog.modal-large {
  width: min(94vw, 840px);
}

.app-dialog.modal-small {
  width: min(92vw, 420px);
}

.app-dialog::backdrop {
  background-color: rgba(24, 63, 67, 0.45);
  backdrop-filter: blur(2px);
}

.dialog-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.dialog-header h2 {
  font-size: 20px;
  margin-top: 4px;
}

.btn-close {
  background: none;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-close:hover {
  background-color: var(--color-soft-green);
  color: var(--color-primary);
}

.dialog-body {
  padding: 24px 28px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Abas dentro de Modais Estruturados (Procedimentos) */
.modal-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 28px;
  background-color: var(--color-bg);
}

.modal-tab-btn {
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.modal-tab-btn:hover {
  color: var(--color-primary);
}

.modal-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background-color: var(--color-surface);
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

.badge-code {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--color-soft-green);
  color: var(--color-primary);
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.badge-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-size: 12px;
  font-weight: 500;
}

.checkboxes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-main);
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

.dialog-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--color-border);
  background-color: #fafbfa;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Detalhes do Cliente */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.detail-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.detail-notes {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.audit-section {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.audit-section h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.audit-item {
  padding: 10px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.audit-action {
  font-weight: 600;
  color: var(--color-primary);
}

.audit-meta {
  color: var(--color-text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--color-primary);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1000;
}

/* Responsividade */
/* Agenda Inteligente — Módulo 2 */
.agenda-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.agenda-date-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agenda-date-input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text-main);
  background: var(--color-bg);
}

.agenda-date-display {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 15px;
  margin-left: 6px;
}

.agenda-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agenda-timeline-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 480px;
}

.agenda-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-muted);
}

.agenda-empty-state svg {
  margin-bottom: 12px;
  color: var(--color-sage);
}

.agenda-slots-container {
  display: flex;
  flex-direction: column;
}

.agenda-slot-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-bottom: 1px solid var(--color-border-subtle);
  min-height: 72px;
  transition: background 0.15s ease;
}

.agenda-slot-row:hover {
  background: rgba(232, 241, 238, 0.3);
}

.agenda-time-label {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  background: #fafbf9;
}

.agenda-slot-content {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  min-height: 72px;
}

.appointment-card {
  flex: 1 1 280px;
  max-width: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-sage);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

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

.appointment-time-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.appointment-status-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-scheduled .appointment-status-chip {
  background: #eef3f7;
  color: #2b5b84;
}

.status-confirmed {
  border-left-color: #2e7d32;
}
.status-confirmed .appointment-status-chip {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-in_progress {
  border-left-color: #4E827E;
  background: #f7faf9;
}
.status-in_progress .appointment-status-chip {
  background: var(--color-soft-green);
  color: var(--color-primary);
  animation: pulse-soft 2s infinite ease-in-out;
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.status-completed {
  border-left-color: var(--color-primary);
  opacity: 0.9;
}
.status-completed .appointment-status-chip {
  background: #e0ecea;
  color: var(--color-primary);
}

.status-cancelled {
  border-left-color: #b33939;
  opacity: 0.65;
  background: #fcf9f9;
}
.status-cancelled .appointment-status-chip {
  background: #fde8e8;
  color: #b33939;
}

.status-no_show {
  border-left-color: #b78103;
  opacity: 0.7;
}
.status-no_show .appointment-status-chip {
  background: #fef9e7;
  color: #b78103;
}

.appointment-procedure-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 3px;
}

.appointment-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.badge-fit {
  background: #fff3cd;
  color: #856404;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
}

.agenda-block-card {
  flex: 1 1 260px;
  background: #f6f8f7;
  border: 1px dashed var(--color-border);
  border-left: 4px solid #b78103;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agenda-block-card strong {
  color: var(--color-text-main);
  display: block;
}

.btn-danger {
  background: #b33939;
  color: #ffffff;
  border: 1px solid #b33939;
}
.btn-danger:hover {
  background: #962828;
}

.workflow-actions-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.workflow-actions-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.workflow-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-cancel-reason {
  color: #b33939;
  background: #fdf0f0;
  border-left: 3px solid #b33939;
}

/* Sub-abas na View de Pacotes (Fase 4) */
.view-subtabs {
  display: flex;
  gap: 12px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 18px;
  padding-bottom: 0;
}

.view-subtab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-bottom: -2px;
}

.view-subtab-btn:hover {
  color: var(--color-primary);
}

.view-subtab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.subtab-pane {
  display: none;
}

.subtab-pane.active {
  display: block;
}

/* Card de Resumo de Preços e Valores */
.pricing-summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background-color: var(--color-soft-green);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-metric.highlight {
  border-left: 2px solid var(--color-primary);
  padding-left: 14px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-main);
}

.metric-val-large {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

/* Badges de Status de Pacotes e Sessões */
.badge-pkg-active {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.badge-pkg-completed {
  background-color: var(--color-soft-green);
  color: var(--color-primary);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.badge-pkg-expired {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.badge-pkg-cancelled {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.badge-sess-available {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.badge-sess-reserved {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.badge-sess-completed {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

/* Anamnese Inteligente & Documentos de Consentimento — Fase 5 */
.badge-alert-warning {
  background: #FFF8E1;
  color: #B78103;
  border: 1px solid #FFE082;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-alert-danger {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-submitted {
  background: #E0F2F1;
  color: #00695C;
}

.badge-status-reviewed {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-status-reassessment {
  background: #FFF3E0;
  color: #EF6C00;
}

.badge-status-revoked {
  background: #FFEBEE;
  color: #C62828;
}

.badge-status-accepted {
  background: #E8F5E9;
  color: #2E7D32;
}

.anamnesis-review-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 13px;
}

.anamnesis-review-alert-item.warning {
  background: #FFF8E1;
  border-left: 4px solid #FFA000;
  color: #5D4037;
}

.anamnesis-review-alert-item.danger {
  background: #FFEBEE;
  border-left: 4px solid #D32F2F;
  color: #B71C1C;
}

/* ==========================================================================
   Fase 6 — Prontuário Estético: Linha do Tempo, Fotos, Antes/Depois e Intercorrências
   ========================================================================== */

/* Linha do Tempo Longitudinal */
.clinical-timeline {
  position: relative;
  padding: 10px 0 20px 24px;
  border-left: 2px solid var(--color-surface-soft);
  margin-left: 12px;
}

.timeline-event-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timeline-event-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.timeline-event-dot {
  position: absolute;
  left: -33px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-event-dot.evolution { background: var(--color-primary); }
.timeline-event-dot.photo { background: #3b82f6; }
.timeline-event-dot.anamnesis { background: #8b5cf6; }
.timeline-event-dot.consent { background: #10b981; }
.timeline-event-dot.appointment { background: #64748b; }
.timeline-event-dot.complication { background: #ef4444; }

.timeline-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.timeline-event-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.timeline-event-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.timeline-event-summary {
  font-size: 0.88rem;
  color: var(--color-text-main);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Galeria de Fotos Clínicas */
.clinical-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.clinical-photo-card {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.clinical-photo-img-wrap {
  width: 100%;
  height: 200px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.clinical-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.clinical-photo-img:hover {
  transform: scale(1.03);
}

.clinical-photo-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.clinical-photo-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.clinical-photo-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Badges de Categoria de Foto */
.badge-cat-before { background: #e0f2fe; color: #0369a1; font-weight: 600; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }
.badge-cat-during { background: #fef3c7; color: #b45309; font-weight: 600; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }
.badge-cat-after { background: #dcfce7; color: #15803d; font-weight: 600; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }

.badge-marketing-restricted { background: #f1f5f9; color: #475569; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }
.badge-marketing-allowed { background: #ede9fe; color: #6d28d9; font-weight: 600; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }

/* Comparador Antes / Depois */
.compare-card {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.compare-header {
  padding: 10px 14px;
  background: var(--color-surface-soft);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.compare-img-wrap {
  min-height: 340px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-img-wrap img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.compare-placeholder {
  color: #94a3b8;
  font-size: 0.9rem;
}

.compare-footer {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--color-surface);
  border-top: 1px solid var(--border-color);
}

/* Badges de Status de Evolução e Intercorrência */
.badge-status-draft { background: #fef3c7; color: #b45309; }
.badge-status-finalized { background: #dcfce7; color: #15803d; }
.badge-status-rectified { background: #e0e7ff; color: #4338ca; }

.badge-severity-mild { background: #fef9c3; color: #854d0e; }
.badge-severity-moderate { background: #fed7aa; color: #9a3412; }
.badge-severity-severe { background: #fee2e2; color: #991b1b; }

.badge-resolution-open { background: #fee2e2; color: #991b1b; }
.badge-resolution-treatment { background: #ffedd5; color: #9a3412; }
.badge-resolution-resolved { background: #dcfce7; color: #166534; }

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: static;
  }
  .billing-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 20px;
  }
  .page-view {
    padding: 20px 16px;
  }
  .form-grid, .detail-grid {
    grid-template-columns: 1fr;
  }
  .panel-toolbar, .agenda-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
}

/* =========================================================================
   FASE 7: WHATSAPP COM INTELIGÊNCIA ARTIFICIAL E ATENDIMENTO AUTÔNOMO
   ========================================================================= */

.wa-chat-workspace {
  display: flex;
  height: 640px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wa-conversations-sidebar {
  width: 340px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background-color: #fafbf9;
}

.wa-search-box {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  background-color: #ffffff;
}

.wa-search-box input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
}

.wa-search-box input:focus {
  border-color: var(--color-primary);
}

.wa-filter-chips {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
}

.wa-filter-chip {
  padding: 3px 8px;
  font-size: 0.72rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background-color: #ffffff;
  color: var(--color-text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wa-filter-chip:hover {
  background-color: var(--color-soft-green);
}

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

.wa-conv-list {
  flex: 1;
  overflow-y: auto;
}

.wa-conv-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  gap: 10px;
  transition: background-color 0.15s ease;
  position: relative;
}

.wa-conv-item:hover {
  background-color: var(--color-bg-light);
}

.wa-conv-item.active {
  background-color: var(--color-soft-green);
  border-left: 4px solid var(--color-primary);
}

.wa-conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-secondary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.wa-conv-body {
  flex: 1;
  min-width: 0;
}

.wa-conv-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.wa-conv-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-conv-time {
  font-size: 0.7rem;
  color: #888;
}

.wa-conv-snippet {
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.wa-conv-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wa-unread-badge {
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Chat Window */
.wa-chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
}

.wa-chat-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fafbf9;
}

.wa-chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.wa-contact-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.wa-contact-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #666;
}

.wa-chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f7f9f8;
}

.wa-no-chat-selected {
  margin: auto;
  text-align: center;
  color: #888;
}

.wa-no-chat-selected svg {
  color: var(--color-secondary);
  margin-bottom: 12px;
}

.wa-no-chat-selected h4 {
  margin: 0 0 6px 0;
  color: var(--color-text-main);
}

.wa-no-chat-selected p {
  margin: 0;
  font-size: 0.85rem;
  max-width: 320px;
}

.wa-msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}

.wa-msg-inbound {
  align-self: flex-start;
  background-color: #ffffff;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 2px;
}

.wa-msg-outbound-ai {
  align-self: flex-end;
  background-color: var(--color-soft-green);
  color: var(--color-primary);
  border: 1px solid rgba(78, 130, 126, 0.35);
  border-bottom-right-radius: 2px;
}

.wa-msg-outbound-human {
  align-self: flex-end;
  background-color: var(--color-primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.wa-msg-sender-tag {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.85;
}

.wa-msg-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  margin-top: 4px;
  opacity: 0.75;
}

.wa-tool-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(78, 130, 126, 0.15);
  color: var(--color-primary);
  margin-top: 6px;
  font-family: monospace;
}

.wa-chat-input-bar {
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  background-color: #ffffff;
}

.wa-chat-input-bar textarea {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: none;
  height: 42px;
  font-family: inherit;
}

.wa-chat-input-bar textarea:focus {
  border-color: var(--color-primary);
}

.wa-empty-hint {
  padding: 2rem 1rem;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
}

/* =========================================================================
   Fase 8: Módulo Financeiro
   ========================================================================= */

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #F1F5F9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}

.btn-filter-period {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748B;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.3;
}

.btn-filter-period:hover {
  color: var(--color-primary-dark);
  background-color: rgba(255, 255, 255, 0.7);
}

.btn-filter-period.active {
  background-color: var(--color-primary-dark) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(24, 63, 67, 0.25);
}

.badge-fin-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-fin-status.pending {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-fin-status.partial {
  background-color: #E0E7FF;
  color: #3730A3;
}

.badge-fin-status.paid {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-fin-status.overdue {
  background-color: #FEE2E2;
  color: #991B1B;
}

.badge-fin-status.cancelled {
  background-color: #F3F4F6;
  color: #4B5563;
}

.badge-fin-status.refunded {
  background-color: #EDE9FE;
  color: #5B21B6;
}

.fin-pm-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fin-pm-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 63, 67, 0.06);
}

.fin-pm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fin-pm-title {
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
}

.fin-pm-tags {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Fase 9: Profissionais & Comissões
   ========================================================================== */

.badge-comm-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-comm-status.generated {
  background-color: #E0F2FE;
  color: #0369A1;
}

.badge-comm-status.under_review {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-comm-status.approved {
  background-color: #E0E7FF;
  color: #3730A3;
}

.badge-comm-status.partially_paid {
  background-color: #FEF9C3;
  color: #854D0E;
}

.badge-comm-status.paid {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-comm-status.reversed {
  background-color: #FEE2E2;
  color: #991B1B;
}

.btn-filter-comm-period {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-comm-period.active {
  background: var(--color-primary);
  color: #ffffff;
}

/* ==========================================================================
   Subtabs Bar & Navigation (Fases 8 e 9)
   ========================================================================== */

.subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background-color: #F1F5F9;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
}

.subtab-btn {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.subtab-btn:hover {
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--color-primary-dark);
}

.subtab-btn.active {
  background-color: #FFFFFF !important;
  color: var(--color-primary-dark) !important;
  border-color: #E2E8F0 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* ==========================================================================
   KPIs & Dashboard Financeiro / Comissões
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  padding: 1.25rem 1.4rem !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
}

.kpi-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.kpi-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.3rem 0;
  font-family: var(--font-family-display);
  line-height: 1.2;
}

.kpi-subtext {
  display: block;
  font-size: 0.76rem;
  color: #94A3B8;
  line-height: 1.3;
}

/* Status do Caixa & Dots */
#fin-cash-register-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
}

.status-dot.green {
  background-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.red {
  background-color: #EF4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-dot.yellow {
  background-color: #F59E0B;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Empty State Moderno */
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.empty-state-box svg {
  margin-bottom: 0.75rem;
  color: var(--color-sage);
}

.empty-state-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.empty-state-box p {
  font-size: 0.85rem;
  max-width: 440px;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Fase 10: CRM & Vendas (Kanban, Rotina, Leads, Propostas)
   ========================================================================== */

.crm-kanban-board {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  min-height: 560px;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 310px;
  background-color: #F8FAFA;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.kanban-col-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: #ffffff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.kanban-col-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count-badge {
  background-color: rgba(24, 63, 67, 0.08);
  color: var(--color-primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.kanban-col-value {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.kanban-cards-list {
  padding: 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 120px;
}

.kanban-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.95rem;
  box-shadow: 0 1px 4px rgba(24, 63, 67, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 63, 67, 0.08);
  border-color: #B8C7C5;
}

.kanban-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
  line-height: 1.3;
}

.kanban-card-proc {
  font-size: 0.8rem;
  color: #4E827E;
  font-weight: 600;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--color-border);
}

.kanban-card-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.kanban-card-actions {
  display: flex;
  gap: 4px;
}

.routine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.routine-column {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 1px 4px rgba(24, 63, 67, 0.04);
}

.routine-card {
  border-left: 3px solid #183F43;
  padding: 0.75rem 0.9rem;
  background: #F8FAFA;
  border-radius: 6px;
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routine-card.overdue {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

.routine-card.today {
  border-left-color: #10B981;
  background: #F0FDF4;
}

/* ==========================================================================
   Fase 11: Estoque & Materiais (FEFO, Insumos, Pedidos de Compra)
   ========================================================================== */

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.stock-pill-ok {
  background-color: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.stock-pill-low {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.stock-pill-empty {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.badge-batch-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-batch-status.active {
  background: #DCFCE7;
  color: #15803D;
}

.badge-batch-status.expired {
  background: #FEE2E2;
  color: #B91C1C;
}

.badge-batch-status.quarantine {
  background: #FEF3C7;
  color: #B45309;
}

.badge-batch-status.blocked {
  background: #F1F5F9;
  color: #475569;
}

.badge-batch-status.exhausted {
  background: #E2E8F0;
  color: #64748B;
}

.badge-mov-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-mov-type.entry {
  background: #DCFCE7;
  color: #166534;
}

.badge-mov-type.exit {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-mov-type.procedure_consumption {
  background: #E0E7FF;
  color: #3730A3;
}

.badge-mov-type.adjustment_positive {
  background: #CCFBF1;
  color: #115E59;
}

.badge-mov-type.adjustment_negative {
  background: #FFEDD5;
  color: #9A3412;
}

.badge-mov-type.loss,
.badge-mov-type.damage {
  background: #FEE2E2;
  color: #B91C1C;
}

.badge-po-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-po-status.draft {
  background: #F1F5F9;
  color: #475569;
}

.badge-po-status.approved {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-po-status.sent {
  background: #E0E7FF;
  color: #3730A3;
}

.badge-po-status.partially_received {
  background: #FEF3C7;
  color: #92400E;
}

.badge-po-status.received {
  background: #DCFCE7;
  color: #166534;
}

.badge-po-status.cancelled {
  background: #FEE2E2;
  color: #991B1B;
}

.fefo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.fefo-first {
  background: #183F43;
  color: #ffffff;
}

.fefo-next {
  background: #E6F4EA;
  color: #137333;
}

.fefo-warning {
  background: #FEF3C7;
  color: #B45309;
}

.fefo-danger {
  background: #FEE2E2;
  color: #B91C1C;
}

.item-editor-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: #F8FAFA;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   FASE 12 — MARKETING E FIDELIZAÇÃO
   ========================================================================== */

.badge-campaign-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-campaign-draft {
  background: #F1F5F9;
  color: #475569;
}

.badge-campaign-scheduled {
  background: #E0F2FE;
  color: #0369A1;
}

.badge-campaign-sending {
  background: #FEF3C7;
  color: #B45309;
}

.badge-campaign-sent {
  background: #DCFCE7;
  color: #15803D;
}

.badge-campaign-cancelled {
  background: #FEE2E2;
  color: #B91C1C;
}

.badge-coupon-active {
  background: #DCFCE7;
  color: #15803D;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-coupon-inactive {
  background: #F1F5F9;
  color: #64748B;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-coupon-expired {
  background: #FEE2E2;
  color: #B91C1C;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-referral-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-referral-registered {
  background: #FEF3C7;
  color: #B45309;
}

.badge-referral-appointment_scheduled {
  background: #E0F2FE;
  color: #0369A1;
}

.badge-referral-rewarded {
  background: #DCFCE7;
  color: #15803D;
}

.badge-referral-cancelled {
  background: #FEE2E2;
  color: #B91C1C;
}

.coupon-code-pill {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 8px;
  background: rgba(24, 63, 67, 0.08);
  color: #183F43;
  border: 1px dashed #183F43;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reward-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.reward-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(24, 63, 67, 0.08);
  border-color: #4E827E;
}

.reward-points-badge {
  background: #183F43;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Padronização Elegante de Headers e Botões de Ação
   ========================================================================== */

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 74px minmax(0, 1fr) !important;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 74px !important;
  padding: 20px 8px !important;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0 !important;
  overflow-x: hidden !important;
  max-width: 100% !important;
}

.page-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
  padding-bottom: 4px !important;
  flex-wrap: wrap !important;
}

.page-header > div:first-child {
  flex: 1 1 260px !important;
  min-width: 220px !important;
}

.page-header .page-desc {
  max-width: 650px !important;
  font-size: 0.88rem !important;
  line-height: 1.45 !important;
  color: #64748B !important;
  margin-top: 4px !important;
}

.header-actions,
.header-buttons,
.page-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  margin-left: auto !important;
}

.header-actions .btn,
.header-buttons .btn,
.page-actions .btn {
  height: 38px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  font-size: 0.83rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.header-actions .btn:hover,
.header-buttons .btn:hover,
.page-actions .btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08) !important;
}

.header-actions .btn:active,
.header-buttons .btn:active,
.page-actions .btn:active {
  transform: translateY(0) !important;
}

.header-actions .btn-primary,
.header-buttons .btn-primary,
.page-actions .btn-primary {
  background-color: #183F43 !important;
  color: #FFFFFF !important;
  border: 1px solid #183F43 !important;
}

.header-actions .btn-primary:hover,
.header-buttons .btn-primary:hover,
.page-actions .btn-primary:hover {
  background-color: #122F32 !important;
  border-color: #122F32 !important;
}

.header-actions .btn-secondary,
.header-buttons .btn-secondary,
.page-actions .btn-secondary {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #1E293B !important;
}

.header-actions .btn-secondary:hover,
.header-buttons .btn-secondary:hover,
.page-actions .btn-secondary:hover {
  background-color: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #183F43 !important;
}

.header-actions .btn svg,
.header-buttons .btn svg,
.page-actions .btn svg {
  flex-shrink: 0 !important;
}

/* Tag de Avaliação Prévia Obrigatória */
.badge-assessment-required {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin-left: 8px !important;
  padding: 3px 9px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #92400E !important;
  background-color: #FEF3C7 !important;
  border: 1px solid #FDE68A !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
}

.badge-assessment-required svg {
  flex-shrink: 0 !important;
}

/* ==========================================================================
   Menu Flutuante de Ações da Tabela (3 Pontinhos)
   ========================================================================== */

.table-responsive {
  min-height: 220px !important;
}

.td-actions {
  text-align: right !important;
  white-space: nowrap !important;
  width: 60px !important;
  position: relative !important;
}

.row-actions-menu {
  position: relative !important;
  display: inline-flex !important;
  justify-content: flex-end !important;
}

.btn-row-action {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #64748B !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
}

.btn-row-action:hover,
.btn-row-action.active {
  background: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
  color: #183F43 !important;
}

.actions-dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  right: 0 !important;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
  padding: 6px !important;
  z-index: 1000 !important;
  min-width: 195px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  animation: dropdownFadeIn 0.15s ease-out !important;
}

.actions-dropdown.open-upward {
  top: auto !important;
  bottom: calc(100% + 4px) !important;
}

.actions-dropdown[hidden] {
  display: none !important;
}

.actions-dropdown-item {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #334155 !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  text-align: left !important;
  width: 100% !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.actions-dropdown-item:hover {
  background: #F8FAFC !important;
  color: #183F43 !important;
}

.actions-dropdown-item svg {
  flex-shrink: 0 !important;
  color: #64748B !important;
  transition: color 0.15s ease !important;
}

.actions-dropdown-item:hover svg {
  color: #183F43 !important;
}

.actions-dropdown-item.danger {
  color: #DC2626 !important;
}

.actions-dropdown-item.danger svg {
  color: #DC2626 !important;
}

.actions-dropdown-item.danger:hover {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
}





