/* Identidade Haras Imperial: preto do logotipo, dourado como destaque discreto. */
:root {
  --hi-preto: #16181b;
  --hi-grafite: #2a2d32;
  --hi-dourado: #b08d3e;
  --hi-dourado-claro: #f4ecd9;
  --hi-fundo: #f6f5f2;
  --bs-body-bg: var(--hi-fundo);
  --bs-primary: #1f3a5f;
  --bs-primary-rgb: 31, 58, 95;
  --bs-link-color: #1f3a5f;
  --bs-link-color-rgb: 31, 58, 95;
  --bs-link-hover-color: #142740;
}
body { background: var(--hi-fundo); font-size: .95rem; }
.btn-primary { --bs-btn-bg: #1f3a5f; --bs-btn-border-color: #1f3a5f; --bs-btn-hover-bg: #142740; --bs-btn-hover-border-color: #142740; --bs-btn-active-bg: #142740; }
.btn-outline-primary { --bs-btn-color: #1f3a5f; --bs-btn-border-color: #1f3a5f; --bs-btn-hover-bg: #1f3a5f; --bs-btn-hover-border-color: #1f3a5f; }

.topo { background: var(--hi-preto); border-bottom: 3px solid var(--hi-dourado); }
.topo .marca img { height: 54px; }
.topo .nav-principal { flex-wrap: nowrap; }
.topo .nav-principal .nav-link { color: #cfd2d6; font-weight: 600; padding: .9rem .8rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.topo .nav-principal .nav-link:hover { color: #fff; }
@media (max-width: 1279.98px) { .topo .nav-principal .nav-link { padding: .9rem .45rem; font-size: .9rem; } }
.topo .nav-principal .nav-link.active { color: #fff; border-bottom-color: var(--hi-dourado); }
.topo .btn-topo { color: #cfd2d6; }
.topo .btn-topo:hover { color: #fff; }
.topo .busca input { background: var(--hi-grafite); border-color: #3a3e44; color: #fff; }
.topo .busca input::placeholder { color: #9aa0a6; }

.subnav { background: #fff; border-bottom: 1px solid #e3e1db; overflow-x: auto; white-space: nowrap; }
.subnav .nav { flex-wrap: nowrap; }
.subnav .nav-link { color: #4a4f55; padding: .6rem .9rem; font-size: .9rem; }
.subnav .nav-link.active { color: var(--hi-preto); font-weight: 600; box-shadow: inset 0 -2px 0 var(--hi-dourado); }

.faixa-demo { background: repeating-linear-gradient(45deg, #ffe08a, #ffe08a 12px, #ffd45c 12px, #ffd45c 24px); color: #3b2d00; font-weight: 700; text-align: center; padding: .35rem; letter-spacing: .03em; }

.card { border: 1px solid #e3e1db; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; font-weight: 600; }
.kpi { border-left: 4px solid var(--hi-dourado); }
.kpi .valor { font-size: 1.55rem; font-weight: 700; line-height: 1.15; }
.kpi .rotulo { color: #6c737a; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.kpi .formula { color: #6c737a; font-size: .78rem; }
.kpi-alerta { border-left-color: #dc3545; }
.kpi-ok { border-left-color: #198754; }

h1.titulo { font-size: 1.45rem; font-weight: 700; margin: 0; }
.subtitulo { color: #6c737a; }
.table > :not(caption) > * > * { padding: .55rem .6rem; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #6c737a; font-weight: 600; background: #fafaf8; }
.table-hover tbody tr { cursor: default; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vazio { text-align: center; padding: 2.5rem 1rem; color: #5c636a; }
.vazio .bi { font-size: 2.2rem; color: var(--hi-dourado); display: block; margin-bottom: .5rem; }

.linha-tempo { list-style: none; padding-left: 0; margin: 0; }
.linha-tempo li { position: relative; padding: 0 0 1rem 1.6rem; border-left: 2px solid #e3e1db; margin-left: .45rem; }
.linha-tempo li::before { content: ""; position: absolute; left: -7px; top: .25rem; width: 12px; height: 12px; border-radius: 50%; background: var(--hi-dourado); }
.linha-tempo li.parto::before { background: #0d6efd; }
.linha-tempo li.positivo::before { background: #198754; }
.linha-tempo li.negativo::before, .linha-tempo li.perda::before { background: #dc3545; }

.pedigree { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 3px; font-size: .8rem; overflow-x: auto; }
.pedigree .col { display: grid; gap: 3px; }
.pedigree .no { background: #fff; border: 1px solid #e3e1db; border-radius: 6px; padding: .1rem .4rem; display: flex; align-items: center; min-height: 22px; font-size: .76rem; }
.pedigree .no.m { border-left: 3px solid #1f3a5f; }
.pedigree .no.f { border-left: 3px solid #b0417a; }
.pedigree .no.vazio-ped { color: #a0a4a8; font-style: italic; border-style: dashed; }

.login-pagina { min-height: 100vh; background: var(--hi-preto); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-cartao { background: #fff; border-radius: 12px; max-width: 400px; width: 100%; padding: 2rem; border-top: 4px solid var(--hi-dourado); }

.nav-inferior { display: none; }
@media (max-width: 767.98px) {
  body { padding-bottom: 64px; }
  .topo .nav-principal { display: none !important; }
  .nav-inferior { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: var(--hi-preto); border-top: 2px solid var(--hi-dourado); }
  .nav-inferior a { flex: 1; text-align: center; color: #cfd2d6; padding: .45rem 0 .55rem; font-size: .75rem; text-decoration: none; }
  .nav-inferior a .bi { display: block; font-size: 1.3rem; }
  .nav-inferior a.active { color: #fff; }
  .tabela-cartoes thead { display: none; }
  .tabela-cartoes tr { display: block; background: #fff; border: 1px solid #e3e1db; border-radius: 8px; margin-bottom: .6rem; padding: .35rem .2rem; }
  .tabela-cartoes td { display: flex; justify-content: space-between; gap: 1rem; border: 0 !important; padding: .2rem .6rem !important; text-align: right; }
  .tabela-cartoes td::before { content: attr(data-rotulo); font-weight: 600; color: #6c737a; text-align: left; }
  .tabela-cartoes td.num { justify-content: space-between; }
  .btn { padding-top: .5rem; padding-bottom: .5rem; }
  h1.titulo { font-size: 1.2rem; }
}
@media print {
  .topo, .subnav, .nav-inferior, .nao-imprimir, .btn { display: none !important; }
}

/* Agenda e calendário */
.cal { table-layout: fixed; width: 100%; min-width: 640px; }
.cal th { text-align: center; font-size: .75rem; }
.cal td { width: 14.28%; height: 96px; vertical-align: top; padding: .25rem !important; font-size: .74rem; }
.cal td.fora { background: #f3f2ee; color: #a0a4a8; }
.cal td.hoje { box-shadow: inset 0 0 0 2px var(--hi-dourado); }
.cal .dia { font-weight: 700; font-size: .8rem; }
.evento { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; text-decoration: none; color: #222; border-left: 3px solid #999; background: #f1f1f1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.evento.sit-vencido { border-left-color: #dc3545; background: #fdecee; }
.evento.sit-proximo { border-left-color: #f0ad00; background: #fff6dc; }
.evento.sit-agendado { border-left-color: #1f3a5f; background: #eaf0f7; }
.evento.sit-realizado { border-left-color: #198754; background: #e8f5ee; }
.evento.sit-nao_realizado { border-left-color: #6c757d; background: #eeeeee; text-decoration: line-through; }
@media (max-width: 767.98px) { .cal td { height: 64px; font-size: .65rem; } .cal .evento { font-size: .6rem; } }

/* Financeiro: fluxo de caixa */
.fluxo td:first-child { white-space: nowrap; }
.fluxo { font-size: .85rem; }
.fluxo td, .fluxo th { padding: .22rem .5rem; }
.fluxo td:first-child, .fluxo th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 #dee2e6; }
.fluxo thead th { background: #fff; } .fluxo thead th:first-child { z-index: 3; }
.fluxo .fluxo-cod { display: inline-block; min-width: 2.6rem; color: #a6a6a6; font-size: .72rem; }
.fluxo .fluxo-item td:first-child { padding-left: 1.6rem; }
.fluxo .fluxo-grupo td { font-weight: 700; color: #1f3864; }
.fluxo .fluxo-grupo-rec td, .fluxo .fluxo-grupo-rec td:first-child { background: #d9d9d9; }
.fluxo .fluxo-total td { font-weight: 700; font-style: italic; border-top: 2px solid #333; border-bottom: 2px solid #333; }
.fluxo .fluxo-saldo td, .fluxo .fluxo-saldo td:first-child { font-weight: 700; background: #f3f1ec; border-top: 2px solid #333; border-bottom: 2px solid #333; }
.fluxo .fluxo-neutro td { font-style: italic; }
.fluxo .fluxo-espaco td { height: .8rem; padding: 0; border: none; }
.fluxo .fluxo-simulador td, .fluxo .fluxo-simulador td:first-child { background: #e2efda; font-size: .8rem; }

/* Ajuda: manual, assistente e tutorial */
.dica { background: #fff8e1; border-left: 4px solid var(--hi-dourado); padding: .5rem .75rem; border-radius: .25rem; margin: .5rem 0; }
.manual ol, .manual ul { padding-left: 1.3rem; } .manual p { margin-bottom: .5rem; }
.manual-indice a { text-decoration: none; } .manual-indice .topico-link a { color: #555; }
.chat { height: 55vh; overflow-y: auto; background: #faf8f4; }
.msg { display: flex; margin-bottom: .75rem; } .msg .balao { max-width: 85%; padding: .6rem .85rem; border-radius: .8rem; }
.msg-usuario { justify-content: flex-end; } .msg-usuario .balao { background: var(--hi-preto); color: #fff; }
.msg-assistente .balao { background: #fff; border: 1px solid #e6e1d6; } .msg-assistente .balao ol, .msg-assistente .balao ul { padding-left: 1.2rem; margin-bottom: .3rem; }
.htmx-indicator { display: none; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
@media print { .manual .topico { break-inside: avoid; border: none; } }
