/* =====================================================================
   YVETECH health — Design System Oficial
   Fontes: Inter (Hub/Login/Portal) e Roboto 300–900 (Telas Operacionais)
   ===================================================================== */

:root {
  /* ---------- Telas Operacionais ---------- */
  --color-primary: #24547b;          /* ActionBar, cabeçalho AG Grid, breadcrumb, modal header */
  --color-secondary: #11bf9f;        /* Destaque, hover, ação positiva, botão Novo */
  --color-danger: #c94848;           /* Sair, Cancelar, Excluir, saídas financeiras */
  --color-disabled: #aabcca;         /* Botões desabilitados até selecionar registro */
  --color-danger-disabled: #e8bbb9;  /* Botão perigo desabilitado */
  --color-table-border: #17a2b8;     /* Borda da área de grade (AG Grid) */
  --color-sidebar: #00152d;          /* Barra lateral fixa de 60px */
  --color-surface: #ffffff;
  --color-surface-muted: rgba(0, 0, 0, .03);
  --color-border: #dfdfdf;
  --color-border-strong: rgba(0, 0, 0, .10);
  --color-text: #000000;
  --color-summary-header: #808080;   /* Cabeçalho Entradas/Saídas/Saldo */
  --color-success-soft: #7aa874;     /* Total recebido / entradas / encerrado */
  --color-status-wait: #e0a800;      /* Pill AGUARDANDO (âmbar) */
  --color-status-progress: #1d7fd1;  /* Pill EM ATENDIMENTO / EM CONSULTA */
  --color-alert-bg: #fff8db;         /* Painel de avisos da agenda */
  --color-alert-border: #e5c54a;

  /* Toasts */
  --toast-info: #3498db;
  --toast-success: #07bc0c;
  --toast-warning: #f1c40f;
  --toast-error: #e74c3c;

  /* ---------- Hub / Login Moderno ---------- */
  --brand: #0bb9a7;
  --brand-dark: #00547b;
  --brand-deep: #0e4a68;
  --ink: #173d49;
  --muted: #7c949b;
  --line: #e4ecef;
  --bg: #f8fbfc;
  --soft: #eef8f8;
  --toolbar: #2d5f8e;
  --shadow-hub: 0 24px 60px rgba(0, 84, 123, .10);
  --gradient-primary: linear-gradient(135deg, #0bb9a7, #0aa28f);

  /* ---------- Cores de Acento por Módulo ---------- */
  --mod-estoque: #34c98d;
  --mod-bi: #8c61f7;
  --mod-laboratorio: #f19a4a;
  --mod-atendimento: #e76d6d;
  --mod-financeiro: #e5b437;
  --mod-exame: #7e5ce7;
  --mod-faturamento: #4296ea;
  --mod-consultorio: #28b8b1;

  /* ---------- Temas Sazonais / Campanhas ---------- */
  --campaign-primary: #c94867;
  --campaign-bg-image: none;

  /* ---------- Tipografia ---------- */
  --font-hub: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-app: 'Roboto', -apple-system, system-ui, "Segoe UI", Oxygen, Ubuntu, Cantarell, sans-serif;
  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-breadcrumb: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-greeting: 26px;
  --fs-title-hub: 30px;

  /* ---------- Dimensões e Espaçamento ---------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 13px;
  --radius-pill: 999px;
  --btn-height: 32px;
  --btn-padding: 4.8px 16px;
  --sidebar-width: 60px;
  --shadow-sidebar: 8px 0 7px -2px rgba(0, 0, 0, .10);
  --shadow-dock: 0 10px 30px rgba(0, 84, 123, .10), 0 1px 2px rgba(0, 84, 123, .04);
}

/* ---------- Classes Utilitárias Operacionais ---------- */
body {
  font-family: var(--font-app);
  background: var(--color-surface);
  color: var(--color-text);
  margin: 0;
  padding: 0;
}

.yv-breadcrumb {
  font: 600 var(--fs-breadcrumb)/1 var(--font-app);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.yv-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.yv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-height);
  padding: var(--btn-padding);
  font: 500 var(--fs-md) var(--font-app);
  color: #ffffff;
  background: var(--color-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.yv-btn:hover:not(:disabled) { filter: brightness(1.08); }
.yv-btn:disabled { background: var(--color-disabled); cursor: not-allowed; }
.yv-btn--danger { background: var(--color-danger); }
.yv-btn--danger:disabled { background: var(--color-danger-disabled); }
.yv-btn--success { background: var(--color-secondary); }

.yv-grid-wrapper {
  border: 1px solid var(--color-table-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ag-theme-alpine {
  --ag-header-background-color: var(--color-primary);
  --ag-header-foreground-color: #ffffff;
  --ag-font-size: 12px;
  --ag-font-family: var(--font-app);
}

.yv-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font: 700 10px var(--font-app);
  color: #ffffff;
  text-transform: uppercase;
}
.yv-pill--wait { background: var(--color-status-wait); }
.yv-pill--progress { background: var(--color-status-progress); }
.yv-pill--done { background: var(--color-success-soft); }
.yv-pill--cancel { background: var(--color-danger); }

.yv-shortcut-footer {
  font: 500 var(--fs-sm) var(--font-app);
  color: #333333;
  text-align: center;
  padding: 6px 12px;
  border-top: 1px solid var(--color-border);
  background: #fafafa;
}
.yv-shortcut-footer span + span::before {
  content: " | ";
  color: #aaaaaa;
  margin: 0 4px;
}

/* Animação ECG do Hub de Entrada */
@keyframes ecgDraw {
  0%   { stroke-dasharray: 0, 1000; stroke-dashoffset: 0; opacity: .15; }
  7%   { opacity: .95; }
  45%  { stroke-dasharray: 900, 1000; stroke-dashoffset: 0; opacity: .75; }
  55%  { stroke-dasharray: 850, 1000; stroke-dashoffset: -150; opacity: .75; }
  100% { stroke-dasharray: 0, 1000; stroke-dashoffset: -1000; opacity: .75; }
}
.yv-ecg-active {
  fill: none;
  stroke: rgba(11, 185, 167, .65);
  stroke-width: 2.8;
  stroke-linecap: round;
  animation: ecgDraw 2.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .yv-ecg-active { animation: none; }
}
