/* ========================================================
   Sistema UBSF Jardim das Neves - Estilos Globais
   Modo Ultra Profissional
   ======================================================== */

:root {
    --cor-primaria: #0f766e;
    --cor-primaria-clara: #14b8a6;
    --cor-fundo-suave: #f4faf9;
    --sombra-suave: 0 8px 30px rgba(15, 23, 42, 0.08);
    --sombra-forte: 0 20px 50px rgba(15, 23, 42, 0.18);
    --raio: 1.25rem;
}

body {
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Transição suave de entrada em toda página */
.conteudo { animation: entradaPagina 0.5s ease both; }
@keyframes entradaPagina {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Cartão de vidro premium ---------- */
.card-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 118, 110, 0.08);
    box-shadow: var(--sombra-suave);
    border-radius: var(--raio);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card-glass:hover { box-shadow: var(--sombra-forte); }

/* ---------- Botões premium reutilizáveis ---------- */
.btn-premium {
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.btn-premium:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-premium:active { transform: translateY(0); }

/* ---------- Barra de navegação superior (topbar) ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: var(--raio);
    box-shadow: var(--sombra-suave);
}
.topbar-link {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.75rem;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.topbar-link.ativo { color: #fff; }

/* ---------- Cards de estatística (dashboard) ---------- */
.stat-card {
    border-radius: var(--raio);
    box-shadow: var(--sombra-suave);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-forte); }
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.25), transparent 60%);
    pointer-events: none;
}

/* ---------- Barras do gráfico simples (CSS puro) ---------- */
.grafico-barras {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    height: 160px;
}
.grafico-coluna {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}
.grafico-barra {
    width: 100%;
    max-width: 32px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--cor-primaria-clara), var(--cor-primaria));
    transition: height 0.6s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 4px 10px rgba(15,118,110,0.25);
}

/* ---------- Tabela premium ---------- */
.tabela-premium th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #f1f5f9;
}
.tabela-premium td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.tabela-premium tr:hover td { background: #f8fafc; }

/* Skeleton de carregamento */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
    background-size: 400% 100%;
    animation: skeletonPulse 1.4s ease infinite;
    border-radius: 0.5rem;
}
@keyframes skeletonPulse {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Ícones flutuantes de fundo ---------- */
.bg-icons {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.bg-icon {
    position: absolute;
    color: #0d9488;
    opacity: 0.08;
    animation-name: floatIcon;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}
@keyframes floatIcon {
    0%   { transform: translateY(0) rotate(0deg); }
    50%  { transform: translateY(-30px) rotate(var(--rot)); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Conteúdo sempre acima dos ícones de fundo */
.conteudo {
    position: relative;
    z-index: 10;
}

/* ---------- Card do paciente (TV) ---------- */
.card-paciente {
    background: linear-gradient(-45deg, #f472b6, #ec4899, #db2777, #be185d);
    background-size: 400% 400%;
    animation: gradienteAnimado 6s ease infinite, pulsar 2s ease-in-out infinite;
}
@keyframes gradienteAnimado {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes pulsar {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}
.nome-paciente-tv {
    color: #000000;
    text-shadow: 0 2px 10px rgba(255,255,255,0.5);
}

/* ---------- Toasts / Alertas flutuantes ---------- */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: min(280px, calc(100vw - 2rem));
    max-width: min(380px, calc(100vw - 2rem));
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastIn 0.35s cubic-bezier(.34,1.56,.64,1) forwards;
}
.toast.saindo { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(60px) scale(0.9); }
}
.toast-sucesso { background: linear-gradient(135deg, #10b981, #059669); }
.toast-erro    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info    { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.toast-aviso   { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ---------- Overlay de aviso na TV ---------- */
#aviso-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}
.aviso-caixa {
    animation: apareceAviso 0.4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes apareceAviso {
    from { opacity: 0; transform: scale(0.7) translateY(40px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Barra de força da senha ---------- */
.forca-senha-barra {
    height: 6px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

/* ---------- Piscar contagem footer TV ---------- */
.contagem-pulsa {
    animation: pulsarLeve 1.6s ease-in-out infinite;
}
@keyframes pulsarLeve {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Scrollbar discreta */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 999px; }
