/**
 * TEMA GLOBAL (peça global de aparência): visual aprovado pelo Anderson em 20/10/2026 ("Mesclada"):
 * um azul só, menu claro, cartões planos com linha fina, botões azuis, selos retangulares, ícones de traço fino.
 * Carregado pelo layout.php DEPOIS do estilo base e ANTES do CSS de cada página. Para mudar a cara do sistema, mude aqui.
 * Não escrever cor, sombra ou canto arredondado à mão numa tela: usar as variáveis abaixo ou as classes .btn, .card, .table, .badge, .form-control.
 */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4fc4;
    --primary-light: #e6eefc;
    --primary-dark: #1d4fc4;
    --primary-anel: #bcd0f7;
    --primary-borda: #9db9f2;

    --secondary: #5c6679;
    --secondary-hover: #18202f;
    --secondary-light: #f0f3f9;

    --success: #1f7a4a;
    --success-hover: #17703f;
    --success-light: #dbf1e4;
    --danger: #c0352b;
    --danger-hover: #a42a21;
    --danger-light: #fbe4e1;
    --warning: #92560a;
    --warning-hover: #7a460a;
    --warning-light: #fcefd2;

    --tema-bg: #f4f6fa;
    --tema-card: #ffffff;
    --tema-texto: #18202f;
    --tema-muda: #5c6679;
    --tema-linha: #e0e5ee;
    --tema-linha-forte: #c4cddc;
    --tema-cabecalho: #f0f3f9;
    --tema-menu: #fbfcfe;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --shadow-sm: none;
    --shadow-md: 0 1px 2px rgba(15, 27, 45, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 27, 45, 0.12);
}

body { background: var(--tema-bg); color: var(--tema-texto); font-size: 14px; line-height: 1.5; }

/* ===== Menu lateral (claro, item ativo azul suave) ===== */
.sidebar { background: var(--tema-menu); border-right: 1px solid var(--tema-linha); }
.logo { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--tema-linha); color: var(--tema-texto); font-weight: 700; font-size: 1rem; }
.logo .ic-wrap, .logo i { color: var(--primary); }
.nav { padding: 0.5rem 0; }
.nav-item { padding: 0.55rem 1.25rem; color: #2d3a50; font-size: 0.875rem; gap: 0.65rem; }
.nav-item:hover { background: var(--tema-cabecalho); color: var(--primary-dark); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); border-left: 0; font-weight: 600; }
.nav-item.active .ic-wrap { color: var(--primary); }
.nav-section { color: #7a869b; padding: 1rem 1.25rem 0.25rem; }

/* ===== Cabeçalho e títulos ===== */
.header { background: var(--tema-menu); box-shadow: none; border-bottom: 1px solid var(--tema-linha); padding: 0.85rem 1.5rem; }
.header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; color: var(--tema-texto); }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { font-size: 0.9375rem; }
.content { padding: 1.25rem 1.5rem; }
/* A área principal nunca fica mais larga que a tela por causa do que tem dentro (tabela larga, gráfico): o conteúdo largo rola para o lado dentro do próprio quadro */
.main { min-width: 0; }
/* Celular e tablet: o tema acima trocava o espaço que o layout.php reserva para o topo fixo e o topo passava POR CIMA do começo da tela (achado em 24/10/2026, Dashboard no celular).
   Agora o topo fica "colado" no alto mas ocupa o seu próprio lugar (sticky): nunca cobre o conteúdo, qualquer que seja a altura dele (título longo, texto do celular aumentado). */
@media (max-width: 1024px) {
    .header { position: sticky; top: 0; left: auto; right: auto; }
}
@media (max-width: 768px) {
    .header { padding: 0.75rem 1rem; }
    .content { padding: 1rem; }
    /* Campos com 16 px no celular: abaixo disso o navegador amplia a tela ao tocar no campo e a janela parece "estourar" (foto do cadastro de cliente, 24/10/2026) */
    input, select, textarea, .form-control { font-size: 16px; }
}

/* ===== Botões (azul cheio e contorno fino azul) ===== */
.btn { border-radius: var(--radius-md); font-weight: 600; min-height: 36px; padding: 0.5rem 0.9rem; gap: 0.45rem; line-height: 1.2; box-shadow: none; }
.btn:hover { transform: none; }
.btn:focus, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-anel); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: none; transform: none; }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary-borda); box-shadow: none; }
.btn-secondary:hover { background: var(--primary-light); color: var(--primary-dark); box-shadow: none; transform: none; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary-borda); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; box-shadow: none; }
.btn-success:hover { background: var(--success-hover); box-shadow: none; transform: none; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: var(--danger-hover); box-shadow: none; transform: none; }
.btn-sm { min-height: 30px; padding: 0.35rem 0.7rem; font-size: 0.8125rem; }
.btn-lg { min-height: 42px; padding: 0.6rem 1.1rem; font-size: 0.9375rem; }

/* ===== Cartões planos com linha fina ===== */
.card { background: var(--tema-card); border: 1px solid var(--tema-linha); border-radius: var(--radius-lg); box-shadow: none; margin-bottom: 1.1rem; }
.card:hover { box-shadow: none; }
.card-header { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--tema-linha); background: var(--tema-card); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.1rem; }
.card-footer { border-top: 1px solid var(--tema-linha); background: var(--tema-card); }
.cliente-card { box-shadow: none; border: 1px solid var(--tema-linha); border-radius: var(--radius-lg); }
.cliente-card:hover { box-shadow: var(--shadow-md); }

/* ===== Formulários ===== */
.form-label { font-weight: 600; font-size: 0.85rem; color: var(--tema-texto); }
.form-control { border: 1px solid var(--tema-linha-forte); border-radius: var(--radius-md); min-height: 38px; padding: 0.5rem 0.75rem; font-size: 0.875rem; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-anel); }
/* Campo de busca com a lupa à direita: o texto digitado (e o aviso do campo vazio) não passa por baixo do ícone */
.busca-hibrida-input.form-control { padding-right: 3rem; }
.section-title { font-size: 0.95rem; font-weight: 600; color: var(--tema-texto); }

/* ===== Tabelas ===== */
.table th { background: var(--tema-cabecalho); color: var(--tema-muda); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--tema-linha); }
.table td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--tema-linha); border-bottom: 0; }

/* ===== Avisos em faixa e selos ===== */
.alert { border-radius: var(--radius-md); border-width: 1px; box-shadow: none; }
.alert-success { background: #dbf1e4; border-color: #9fd4b6; color: #17703f; }
.alert-danger { background: #fbe4e1; border-color: #eaaaa4; color: #b4281f; }
.alert-warning { background: #fcefd2; border-color: #ebcf8e; color: #92560a; }
.alert-info { background: #e3ebfb; border-color: #b6c8f5; color: #1e4fb5; }
.badge { border-radius: var(--radius-sm); font-weight: 700; }
.badge-primary { background: #e3ebfb; color: #1e4fb5; }
.badge-success { background: #dbf1e4; color: #17703f; }
.badge-danger { background: #fbe4e1; color: #b4281f; }
.badge-warning { background: #fcefd2; color: #92560a; }
/* Selo de status (retangular): a cor vem das classes de Agendamento::classeStatus() / ModernUI.statusClasse(); tela nova usa class="selo ..." */
.selo { display: inline-flex; align-items: center; padding: 2px 8px; border-width: 1px; border-style: solid; border-radius: var(--radius-sm); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.4; }
/* Etiqueta neutra em azul suave (procedimentos, porte...): uma só cor, quem tem cor própria é o selo de status */
.etiqueta { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary-dark); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.4; }
/* Cartão de número (Total, Concluídos...): <div class="tile-numero"><span class="tile-icone"><i class="fas fa-..."></i></span><div><p class="tile-rotulo">..</p><p class="tile-valor">0</p></div></div>; variantes de ícone: .verde e .ambar */
.tile-numero { display: flex; align-items: center; gap: 0.9rem; background: var(--tema-card); border: 1px solid var(--tema-linha); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
/* Quadradinho de ícone: dentro do cartão de número e também sozinho (cabeçalho de quadro). Variantes: .verde .ambar .vermelho */
.tile-icone { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--primary-light); color: var(--primary); font-size: 1.1rem; }
.tile-icone.verde { background: var(--success-light); color: var(--success); }
.tile-icone.ambar { background: var(--warning-light); color: var(--warning); }
.tile-icone.vermelho { background: var(--danger-light); color: var(--danger); }
.tile-numero .tile-rotulo { margin: 0; font-size: 0.8125rem; color: var(--tema-muda); }
.tile-numero .tile-valor { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: var(--tema-texto); }
/* Grade de cartões de número: quantos couberem na largura (celular 2, computador 5 ou mais), sem depender de classes do Tailwind */
.tile-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
/* Cartão de número CLICÁVEL (Utils::cartaoNumero com href): borda azul ao passar o mouse e setinha; .tile-ativo = a lista abaixo está filtrada por ele; .tile-compacto = sem ícone, menor */
a.tile-link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
a.tile-link:hover { border-color: var(--primary-borda); background: var(--primary-light); }
a.tile-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-anel); }
.tile-seta { margin-left: auto; color: var(--tema-muda); font-size: 0.9rem; opacity: 0.6; }
a.tile-link:hover .tile-seta { color: var(--primary); opacity: 1; }
.tile-numero.tile-ativo { border-color: var(--primary); background: var(--primary-light); }
.tile-numero.tile-compacto { padding: 0.65rem 0.9rem; }
.tile-numero.tile-compacto .tile-valor { font-size: 1.35rem; }
/* Barra de abas (Utils::abas): cada aba é um link; a aba aberta fica azul com linha por baixo; no celular rola para o lado dentro da barra */
.abas { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--tema-linha); margin-bottom: 1.25rem; overflow-x: auto; overflow-y: hidden; }
.abas .aba { padding: 0.6rem 1rem; font-size: 0.875rem; font-weight: 600; color: var(--tema-muda); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas .aba:hover { color: var(--primary); }
.abas .aba.aba-ativa { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== Janelas (modais) ===== */
.modal-content { border-radius: 10px; border: 1px solid var(--tema-linha); box-shadow: 0 16px 40px rgba(15, 27, 45, 0.18); }
.modal-header { border-bottom: 1px solid var(--tema-linha); }
.modal-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-footer { border-top: 1px solid var(--tema-linha); }

/* ===== Lista suspensa da busca ===== */
.search-dropdown { border: 1px solid var(--tema-linha-forte); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.search-dropdown-item { padding: 0.6rem 0.9rem; }
.search-dropdown-item:hover { background: var(--tema-cabecalho); }
.search-dropdown-item.active { background: var(--primary-light); border-left-color: var(--primary); }
.search-dropdown-item .item-icon { background: var(--primary-light); color: var(--primary); }
.search-dropdown-item.item-pet .item-icon { background-color: var(--primary-light); color: var(--primary); }

/* ===== Cores do Tailwind: um azul só ===== */
.bg-indigo-500, .bg-indigo-600, .bg-purple-500, .bg-purple-600, .bg-blue-500, .bg-blue-600 { background-color: var(--primary); }
.hover\:bg-indigo-600:hover, .hover\:bg-indigo-700:hover, .hover\:bg-purple-700:hover, .hover\:bg-blue-600:hover, .hover\:bg-blue-700:hover { background-color: var(--primary-hover); }
.text-indigo-500, .text-indigo-600, .text-purple-500, .text-purple-600, .text-blue-500, .text-blue-600 { color: var(--primary); }
.text-indigo-700, .text-purple-700, .text-blue-700 { color: var(--primary-dark); }
.border-indigo-500, .border-indigo-600, .border-purple-500, .border-blue-500, .border-blue-600 { border-color: var(--primary); }
.bg-indigo-50, .bg-indigo-100, .bg-purple-50, .bg-purple-100, .bg-blue-50, .bg-blue-100 { background-color: var(--primary-light); }
.shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl { box-shadow: var(--shadow-md); }
.rounded-xl, .rounded-2xl { border-radius: 10px; }

/* ===== Ícones de traço fino (assets/js/icons.js) ===== */
.ic-wrap { display: inline-flex; align-items: center; justify-content: center; line-height: 1; vertical-align: -0.125em; flex: none; font-style: normal; }
.ic-wrap svg { width: 1em; height: 1em; flex: none; }
.ic-wrap.fa-fw { width: 1.25em; }
.ic-wrap.fa-lg { font-size: 1.25em; }
.ic-wrap.fa-2x { font-size: 2em; }
.ic-wrap.fa-3x { font-size: 3em; }
.ic-wrap.fa-xs { font-size: 0.75em; }
.ic-wrap.fa-sm { font-size: 0.875em; }
.ic-wrap.fa-spin { animation: ic-giro 1s linear infinite; }
@keyframes ic-giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ic-wrap.fa-spin { animation-duration: 3s; } }
