/* JurisVision – identidade visual (azul-marinho + dourado). Complementa o Bootstrap 5.3 */
:root {
  --jv-navy-950: #071324;
  --jv-navy-900: #0B1F3A;
  --jv-navy-800: #12305A;
  --jv-gold: #C9A24B;
  --jv-gold-soft: #E3C77A;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --jv-font-titulo: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
[data-bs-theme="light"] {
  --bs-body-bg: #F4F6FA;
  --bs-body-color: #1B2638;
  --bs-primary: #12305A;
  --bs-primary-rgb: 18, 48, 90;
  --bs-link-color: #12305A;
  --bs-link-color-rgb: 18, 48, 90;
  --bs-link-hover-color: #0B1F3A;
  --bs-link-hover-color-rgb: 11, 31, 58;
  --bs-border-color: #DCE2EC;
}
[data-bs-theme="dark"] {
  --bs-body-bg: #0A1628;
  --bs-body-color: #DDE5F1;
  --bs-secondary-bg: #11233F;
  --bs-tertiary-bg: #0E1D35;
  --bs-primary: #5B8DD6;
  --bs-primary-rgb: 91, 141, 214;
  --bs-link-color: #8DB4EC;
  --bs-link-color-rgb: 141, 180, 236;
  --bs-link-hover-color: #C9A24B;
  --bs-link-hover-color-rgb: 201, 162, 75;
  --bs-border-color: #1F3557;
  --bs-card-bg: #11233F;
}
body { font-family: var(--bs-font-sans-serif); }
h1, h2, .jv-titulo { font-family: var(--jv-font-titulo); font-weight: 700; }

/* Botão principal: azul-marinho no claro, dourado discreto no escuro */
.btn-jv { --bs-btn-color:#fff; --bs-btn-bg:#12305A; --bs-btn-border-color:#12305A;
  --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#0B1F3A; --bs-btn-hover-border-color:#0B1F3A;
  --bs-btn-active-bg:#071324; --bs-btn-focus-shadow-rgb:201,162,75; }
[data-bs-theme="dark"] .btn-jv { --bs-btn-color:#0A1628; --bs-btn-bg:#C9A24B; --bs-btn-border-color:#C9A24B;
  --bs-btn-hover-color:#0A1628; --bs-btn-hover-bg:#E3C77A; --bs-btn-hover-border-color:#E3C77A; }

/* Barra lateral (sempre escura, nos dois temas) */
.jv-sidebar { background: linear-gradient(180deg, var(--jv-navy-900), var(--jv-navy-950)); color:#C9D4E6; }
.jv-sidebar .nav-link { color:#B7C4DB; border-radius:.5rem; padding:.55rem .85rem; display:flex; align-items:center; gap:.6rem; }
.jv-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color:#fff; }
.jv-sidebar .nav-link.active { background: rgba(201,162,75,.16); color: var(--jv-gold-soft); box-shadow: inset 3px 0 0 var(--jv-gold); }
.jv-sidebar .nav-link.disabled { opacity:.45; }
.jv-sidebar .jv-secao { font-size:.68rem; letter-spacing:.12em; text-transform:uppercase; color:#7F91AE; padding:1rem .85rem .35rem; }


.jv-topo { background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); }
.card { border-color: var(--bs-border-color); box-shadow: 0 1px 2px rgba(11,31,58,.06); }
.jv-card-destaque { border-top: 3px solid var(--jv-gold); }
.jv-marca-texto { font-family: var(--jv-font-titulo); font-weight:700; font-size:1.35rem; color:#fff; }
.jv-marca-texto span { color: var(--jv-gold); }
.table > :not(caption) > * > * { vertical-align: middle; }
.jv-logo-empresa { max-height: 44px; max-width: 100%; object-fit: contain; }

/* Tela de login */
.jv-login-bg { min-height:100vh; background: radial-gradient(circle at 20% 10%, #1B4177 0%, transparent 45%), linear-gradient(160deg, var(--jv-navy-900), var(--jv-navy-950)); }
.jv-login-card { max-width: 24rem; width: 100%; }

/* ===== Escala compacta (menos zoom: fonte, ícones e espaçamentos menores) ===== */
html { font-size: 14px; }
@media (min-width: 1700px) { html { font-size: 15px; } }
h1, .h1 { font-size: 1.6rem; } h2, .h2 { font-size: 1.35rem; }
h3, .h3 { font-size: 1.25rem; } h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 1rem; }    h6, .h6 { font-size: .8rem; }
.display-6 { font-size: 1.75rem; }
.btn { --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .8rem; --bs-btn-font-size: .9rem; }
.btn-sm { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .8rem; }
.form-control, .form-select { padding: .38rem .7rem; font-size: .9rem; }
.form-label { font-size: .85rem; margin-bottom: .25rem; font-weight: 500; }
.card-body { padding: 1rem 1.15rem; }
.table { font-size: .88rem; --bs-table-cell-padding-y: .5rem; }
.table > :not(caption) > * > * { padding: .5rem .75rem; }
.badge { font-size: .72rem; }
.jv-topo { padding-top: .45rem !important; padding-bottom: .45rem !important; }
main { max-width: 125rem; }
.bi { line-height: 1; }

/* ===== Menu lateral retrátil ===== */
.jv-sidebar .nav-link { font-size: .9rem; padding: .5rem .75rem; }
.jv-sidebar .nav-link .bi { font-size: 1.05rem; width: 1.25rem; text-align: center; flex: 0 0 auto; }
.jv-logo-mini { display: none; }
@media (min-width: 992px) {
  /* Logo no topo do menu também no desktop (o Bootstrap esconde o cabeçalho do offcanvas em telas largas) */
  .jv-sidebar .offcanvas-header { display: flex !important; padding-bottom: .25rem; }
  .jv-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
                flex: 0 0 15rem; width: 15rem; transition: flex-basis .2s ease, width .2s ease; }
  html.jv-recolhido .jv-sidebar { flex-basis: 4.25rem; width: 4.25rem; }
  html.jv-recolhido .jv-sidebar .jv-rot,
  html.jv-recolhido .jv-sidebar .jv-secao,
  html.jv-recolhido .jv-sidebar .jv-rodape-menu,
  html.jv-recolhido .jv-sidebar .jv-logo-full { display: none !important; }
  html.jv-recolhido .jv-sidebar .jv-logo-mini { display: inline-block; }
  html.jv-recolhido .jv-sidebar .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
  html.jv-recolhido .jv-sidebar .offcanvas-header { justify-content: center; padding-left: .5rem !important; padding-right: .5rem !important; }
  html.jv-recolhido .jv-sidebar .offcanvas-body { padding-left: .5rem !important; padding-right: .5rem !important; }
  html.jv-recolhido .jv-sidebar .nav-link.active { box-shadow: inset 3px 0 0 var(--jv-gold); }
}


/* ---- Ajustes de contraste dos temas (claro/escuro) ---- */
[data-bs-theme="light"] .text-warning { color: #8A5A00 !important; }
[data-bs-theme="light"] .text-info { color: #0A6C84 !important; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color:#B4C2D9; --bs-btn-border-color:#3A5073; --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#27416A; --bs-btn-hover-border-color:#4A6592;
  --bs-btn-active-bg:#27416A; --bs-btn-active-color:#fff; --bs-btn-disabled-color:#7F91AE; --bs-btn-disabled-border-color:#2A3F5E; }
[data-bs-theme="dark"] .text-bg-primary, [data-bs-theme="dark"] .btn-primary { background-color:#2F5FA8 !important; border-color:#2F5FA8; color:#fff !important; }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--bs-tertiary-bg) !important; color: var(--bs-body-color) !important; }
[data-bs-theme="dark"] .btn-light { --bs-btn-color:var(--bs-body-color); --bs-btn-bg:var(--bs-tertiary-bg); --bs-btn-border-color:#2A4166;
  --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#1B3358; --bs-btn-hover-border-color:#3A5073; --bs-btn-active-bg:#1B3358; --bs-btn-active-color:#fff; }
[data-bs-theme="dark"] .table-light { --bs-table-bg:#162B4D; --bs-table-color:var(--bs-body-color); --bs-table-border-color:#1F3557; --bs-table-striped-bg:#162B4D; --bs-table-hover-bg:#1B3358; }
[data-bs-theme="dark"] .bg-light { background-color: var(--bs-tertiary-bg) !important; color: var(--bs-body-color); }

/* Papel de documento: sempre claro, também no tema escuro */
.jv-papel { background:#fff; color:#111; border-color:#ccd3df !important; }

/* Listas ao lado de um formulário (cadastros, tipos, pendências, documentos): a rolagem fica na lista e o formulário continua à vista. */
@media (min-width: 992px) {
  .jv-lista-rolavel { position: relative; max-height: calc(100vh - 15rem); min-height: 16rem; overflow-y: auto; } /* position: relative contém os textos .visually-hidden dentro da rolagem */
  .jv-lista-rolavel thead th { position: sticky; top: 0; z-index: 2; background: var(--bs-body-bg); box-shadow: inset 0 -1px 0 var(--bs-border-color); }
}

/* Menu lateral: grupos recolhíveis */
.jv-sidebar .jv-secao-botao { -webkit-appearance: none; appearance: none; display: flex; width: 100%; align-items: center; justify-content: space-between; background: transparent; border: 0; border-radius: .4rem; font-family: inherit; text-align: left; cursor: pointer; }
.jv-sidebar .jv-secao-botao:focus-visible { outline: 2px solid var(--jv-gold); outline-offset: -2px; }
.jv-sidebar .jv-secao-botao:hover { color: #fff; }
.jv-sidebar .jv-secao-botao .bi { font-size: .7rem; transition: transform .15s; }
.jv-sidebar .jv-secao-botao[aria-expanded="false"] .bi { transform: rotate(-90deg); }
.jv-sidebar .jv-grupo { display: flex; flex-direction: column; }
.jv-sidebar .jv-grupo.jv-fechado { display: none; }
@media (min-width: 992px) {
  html.jv-recolhido .jv-sidebar .jv-grupo.jv-fechado { display: flex; } /* menu compacto: sempre mostra os ícones */
}

/* ===== Escala responsiva: notebooks de 14" até monitores grandes ===== */
@media (max-width: 1600px) { html { font-size: 13.5px; } }
@media (max-width: 1366px) { html { font-size: 13px; } }
@media (min-width: 1920px) { html { font-size: 16px; } }
@media (min-width: 2400px) { html { font-size: 17.5px; } }
@media (min-width: 992px) and (max-width: 1600px) {
  .jv-sidebar { flex-basis: 14rem; width: 14rem; }
  html.jv-recolhido .jv-sidebar { flex-basis: 4.25rem; width: 4.25rem; }
  main.p-lg-4 { padding: 1rem 1.25rem !important; }
}
@media (min-width: 2200px) { main.p-lg-4 { padding: 1.75rem 2.5rem !important; } }

/* Painéis em duas colunas: a lateral tem largura própria e a principal ocupa o resto */
.rc-split { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side"; align-items: start; }
.rc-split.lado-primeiro { grid-template-areas: "side" "main"; }
.rc-main { grid-area: main; min-width: 0; }
.rc-side { grid-area: side; min-width: 0; }
@media (min-width: 1200px) {
  .rc-split, .rc-split.lado-primeiro { grid-template-columns: minmax(0, 1fr) clamp(19rem, 26vw, 30rem); grid-template-areas: "main side"; }
}
/* Cartões de indicadores: preenchem a largura e quebram sozinhos conforme o espaço */
.rc-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); }
.rc-kpis .rc-kpi .rot { line-height: 1.2; }
.form-select { padding-right: 2.25rem; }
