/* Sistema Cena — paridade visual com Locações | 24/08/2026 */
:root{
  --cena-shell-navy:#031827;
  --cena-shell-blue:#082f4b;
  --cena-linen:#f4eee4;
  --cena-cotton:#fbf8f2;
  --cena-gold:#c8944f;
  --cena-ink:#0b2b45;
  --cena-shadow:0 23px 50px -38px rgba(0,28,46,.58);
}

/* Base compartilhada pelos sistemas internos */
html:not(.dark) #sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"]){
  background:
    radial-gradient(140% 80% at -20% 0%,rgba(44,125,169,.25),transparent 48%),
    radial-gradient(100% 70% at 110% 95%,rgba(28,104,149,.18),transparent 60%),
    linear-gradient(180deg,#06263d 0%,#031a2b 55%,#021521 100%)!important;
  border-right:1px solid rgba(212,176,116,.48)!important;
  box-shadow:18px 0 55px -38px rgba(0,13,23,.95),inset -1px 0 rgba(255,255,255,.05)!important;
}
html:not(.dark) #sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"]) .navitem{
  min-height:47px!important;margin:6px 8px!important;padding:0 13px!important;
  border:1px solid rgba(173,206,224,.1)!important;border-radius:14px!important;
  color:#edf5f8!important;background:linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.008))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.035)!important;transition:.2s ease!important;
}
html:not(.dark) #sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"]) .navitem:hover{
  transform:translateX(2px)!important;border-color:rgba(118,178,210,.28)!important;
}
html:not(.dark) #sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"]) .navitem.active{
  border-color:rgba(229,195,140,.82)!important;
  background:radial-gradient(130% 170% at 98% 50%,rgba(73,142,227,.48),transparent 49%),linear-gradient(125deg,rgba(30,88,120,.88),rgba(5,42,68,.96))!important;
  box-shadow:0 13px 32px -23px rgba(43,128,230,.9),inset 0 1px rgba(255,255,255,.14)!important;
}

/* Proteção estrutural: nenhum painel pode ultrapassar a área útil */
html:not(.dark) .app.on:not(.hubview):has(#sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"])) .main,
html:not(.dark) .app.on:not(.hubview):has(#sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"])) #content{
  min-width:0!important;max-width:100%!important;box-sizing:border-box!important;overflow-x:clip!important;
}
html:not(.dark) .app.on:not(.hubview):has(#sidebar:is([data-system="juris"],[data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"])) #content > *{
  min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
}

/* Jurídico: mesma composição e proporções aprovadas em Locações */
html:not(.dark) #content.jl-dashboard-page{
  padding:0 18px 30px!important;
  background:linear-gradient(145deg,#f6f0e7,#eadfce 56%,#f8f4ed)!important;
}
html:not(.dark) #content.jl-dashboard-page .ju-hero{
  display:block!important;position:relative!important;isolation:isolate!important;
  width:auto!important;max-width:none!important;height:205px!important;min-height:205px!important;
  margin:0 -18px!important;border-radius:0 0 27px 27px!important;overflow:hidden!important;
  background:
    linear-gradient(90deg,rgba(248,243,234,.99) 0 39%,rgba(248,243,234,.88) 47%,rgba(4,30,48,.05) 70%),
    url('juris-justice-approved.webp') 83% 12%/auto 142% no-repeat!important;
  border:0!important;border-bottom:1px solid rgba(212,176,116,.2)!important;
  box-shadow:0 28px 70px -42px rgba(3,27,43,.52)!important;
}
html:not(.dark) #content.jl-dashboard-page .ju-hero:before{
  left:-7%!important;top:-62%!important;width:57%!important;height:165%!important;
  border-radius:50%!important;transform:rotate(-7deg)!important;
  background:linear-gradient(135deg,#f7f2e9,#e9ddcd)!important;
}
html:not(.dark) #content.jl-dashboard-page .ju-hero-copy{
  left:30px!important;top:30px!important;max-width:430px!important;
}
html:not(.dark) #content.jl-dashboard-page .ju-hero-note{
  right:28px!important;top:auto!important;bottom:22px!important;
}
html:not(.dark) #content.jl-dashboard-page > .kpis{
  position:relative!important;z-index:5!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;margin:-30px 24px 14px!important;padding:0!important;
}
html:not(.dark) #content.jl-dashboard-page > .kpis .kpi{
  min-width:0!important;min-height:116px!important;height:auto!important;padding:15px 16px 14px!important;
  border-radius:17px!important;
  background:radial-gradient(180px 95px at 100% 0%,rgba(76,144,181,.08),transparent 70%),linear-gradient(150deg,rgba(255,253,249,.97),rgba(238,228,214,.94))!important;
  border:1px solid rgba(51,78,94,.1)!important;
  box-shadow:0 20px 44px -32px rgba(0,32,52,.52),inset 0 1px rgba(255,255,255,.96)!important;
}
html:not(.dark) #content.jl-dashboard-page .grid2{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;margin:0 0 14px!important;max-width:100%!important;
}
html:not(.dark) #content.jl-dashboard-page .panel{
  min-width:0!important;min-height:300px!important;height:auto!important;padding:18px 20px!important;
  border-radius:19px!important;overflow:hidden!important;
  background:linear-gradient(145deg,rgba(255,253,248,.95),rgba(240,231,218,.90))!important;
  border:1px solid rgba(45,71,88,.1)!important;box-shadow:var(--cena-shadow),inset 0 1px #fff!important;
}
html:not(.dark) #content.jl-dashboard-page .grid2 .panel .chart-svg{
  display:block!important;width:100%!important;max-width:100%!important;height:205px!important;max-height:205px!important;
}
html:not(.dark) #content.jl-dashboard-page .grid2 .panel:first-child .chart-svg{
  width:170px!important;height:170px!important;margin:8px auto 0!important;
}
html:not(.dark) #content.jl-dashboard-page .legend{
  display:flex!important;flex-wrap:wrap!important;gap:8px 14px!important;margin-top:5px!important;
}
html:not(.dark) #content.jl-dashboard-page [data-report-section="juris-operacao"] > .panel{
  min-height:0!important;padding-bottom:16px!important;
}
html:not(.dark) #content.jl-dashboard-page .tablewrap{
  max-width:100%!important;overflow:auto!important;border-radius:15px!important;
}

/* Mesma linguagem para painéis e cabeçalhos internos dos demais ambientes */
html:not(.dark) .app.on:not(.hubview):has(#sidebar:is([data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"])) :is(.panel,.kpi,.card,.adm-card,.patr-card){
  border-radius:18px!important;
  border-color:rgba(45,71,88,.1)!important;
  background:linear-gradient(145deg,rgba(255,253,248,.95),rgba(240,231,218,.90))!important;
  box-shadow:var(--cena-shadow),inset 0 1px #fff!important;
}
html:not(.dark) .app.on:not(.hubview):has(#sidebar:is([data-system="adm"],[data-system="patrimonial"],[data-system="incorpora"],[data-system="comercial"])) :is(.btn,.button,button){
  border-radius:12px;
}

@media(max-width:1250px){
  html:not(.dark) #content.jl-dashboard-page > .kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:980px){
  html:not(.dark) #content.jl-dashboard-page .grid2{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:760px){
  html:not(.dark) #content.jl-dashboard-page .ju-hero{height:190px!important;min-height:190px!important}
  html:not(.dark) #content.jl-dashboard-page .ju-hero-copy{left:20px!important;top:24px!important}
  html:not(.dark) #content.jl-dashboard-page .ju-hero-note{display:none!important}
  html:not(.dark) #content.jl-dashboard-page > .kpis{grid-template-columns:minmax(0,1fr)!important;margin:-20px 12px 12px!important}
}

/* Hero estável: não depende das três injeções antigas do Jurídico */
html:not(.dark) #content.jl-dashboard-page > .ju-hero{display:none!important}
html:not(.dark) #content.jl-dashboard-page > .cena-juris-hero{
  display:block!important;position:relative!important;isolation:isolate!important;
  width:auto!important;max-width:none!important;height:220px!important;min-height:220px!important;
  margin:0 -18px!important;border-radius:0 0 27px 27px!important;overflow:hidden!important;
  background:
    linear-gradient(90deg,rgba(248,243,234,.99) 0 38%,rgba(248,243,234,.90) 47%,rgba(4,30,48,.07) 70%,rgba(2,21,35,.20)),
    url('https://upload.wikimedia.org/wikipedia/commons/0/02/Ponte_Herc%C3%ADlio_Luz_-_Florian%C3%B3polis_-_20220911165825.jpg') center 48%/cover no-repeat!important;
  border:0!important;border-bottom:1px solid rgba(212,176,116,.22)!important;
  box-shadow:0 28px 70px -42px rgba(3,27,43,.52)!important;
}
html:not(.dark) #content.jl-dashboard-page > .cena-juris-hero:before{
  content:"";position:absolute;z-index:1;left:-7%;top:-62%;width:57%;height:165%;
  border-radius:50%;transform:rotate(-7deg);
  background:linear-gradient(135deg,#faf7f1,#e9ddcd);
  box-shadow:22px 0 55px -45px rgba(2,30,49,.45);
}
html:not(.dark) #content.jl-dashboard-page > .cena-juris-hero:after{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(105deg,transparent 0 48%,rgba(4,31,49,.08) 70%,rgba(3,23,38,.16));
}
.cena-juris-hero-copy{position:absolute;z-index:3;left:30px;top:38px;max-width:430px}
.cena-juris-hero-copy small{display:block;color:#1e4f6c;font:700 9px/1.2 Inter,sans-serif;letter-spacing:.28em}
.cena-juris-hero-copy h1{margin:10px 0 5px;color:#0b2b45;font:500 clamp(30px,3vw,45px)/1.02 Georgia,'Times New Roman',serif;letter-spacing:-.035em}
.cena-juris-hero-copy p{margin:0;color:#536d7d;font-size:12px}
.cena-juris-hero-note{position:absolute;z-index:3;right:28px;bottom:22px;color:#fff;text-align:right;font:italic 11px/1.4 Georgia,'Times New Roman',serif;text-shadow:0 2px 13px rgba(0,20,33,.82)}
.cena-juris-hero-note b{display:block;margin-bottom:7px;color:#e8c78f;font:700 8px/1.2 Inter,sans-serif;letter-spacing:.17em}
html:not(.dark) #content.jl-dashboard-page > .cena-juris-hero ~ .kpis{
  margin-top:-30px!important;
}
@media(max-width:760px){
  html:not(.dark) #content.jl-dashboard-page > .cena-juris-hero{height:190px!important;min-height:190px!important}
  .cena-juris-hero-copy{left:20px;top:28px}
  .cena-juris-hero-note{display:none}
}