/* =========================================================
   JBE NOVA GESTÃO · acabamento final de produção
   - Mantém o layout existente
   - Uniformiza cabeçalhos, botões e responsividade
   ========================================================= */
:root{
    --jbe-prod-navy:#071b3a;
    --jbe-prod-navy-2:#092a61;
    --jbe-prod-blue:#2563eb;
    --jbe-prod-cyan:#1494b3;
    --jbe-prod-header:linear-gradient(135deg,#102f73 0%,#2563eb 56%,#1494b3 100%);
    --jbe-prod-sidebar:linear-gradient(180deg,#071b3a 0%,#092a61 62%,#063f73 100%);
    --jbe-prod-border:#dbe7f5;
    --jbe-prod-muted:#64748b;
    --jbe-prod-shadow:0 10px 24px rgba(15,23,42,.055);
}

html,body{max-width:100%;overflow-x:hidden;}
img,svg,canvas,video{max-width:100%;height:auto;}
button,a,input,select,textarea{font-family:inherit;}

/* Cabeçalhos no padrão do menu principal / Resumo Comercial */
.page-head,
.page-header,
.topbar-clean,
.topbar,
.hero,
.jbe-hero,
.sigef-hero,
.module-head,
.header-panel{
    background:var(--jbe-prod-header)!important;
    color:#fff!important;
    border-color:rgba(255,255,255,.10)!important;
}
.page-head h1,.page-header h1,.topbar h1,.topbar-clean h1,.hero h1,.jbe-hero h1,.sigef-hero h1,
.page-head .title,.page-title,.hero-title{color:#fff!important;}
.page-head .sub,.page-head .small,.page-head p,.page-header .sub,.hero p,.hero .sub,.hero-sub,.topbar .sub,
.topbar-clean .sub{color:rgba(255,255,255,.84)!important;}

/* Botões dos cabeçalhos com o mesmo comportamento do Resumo Comercial */
.page-head .btn,
.page-head .btn-main,
.page-head .btn-soft,
.page-head .btn-light,
.page-head .btn-white,
.page-head .btn-outline-light,
.page-head .hero-btn,
.hero .btn,
.hero .btn-main,
.hero .btn-soft,
.hero .btn-light,
.hero .btn-white,
.hero .btn-outline-light,
.hero .hero-btn,
.topbar .btn,
.topbar .btn-main,
.topbar .btn-soft,
.topbar .btn-light,
.topbar-clean .btn,
.topbar-clean .btn-main,
.topbar-clean .btn-soft,
.btn-head{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    min-height:32px!important;
    padding:0 11px!important;
    border-radius:10px!important;
    text-decoration:none!important;
    border:1px solid rgba(255,255,255,.18)!important;
    background:rgba(255,255,255,.10)!important;
    color:#fff!important;
    font-size:11px!important;
    font-weight:500!important;
    line-height:1.1!important;
    box-shadow:none!important;
}
.page-head .btn:hover,.page-head .btn-main:hover,.page-head .btn-soft:hover,.page-head .btn-light:hover,.page-head .btn-white:hover,.page-head .hero-btn:hover,
.hero .btn:hover,.hero .btn-main:hover,.hero .btn-soft:hover,.hero .btn-light:hover,.hero .btn-white:hover,.hero .hero-btn:hover,
.topbar .btn:hover,.topbar .btn-main:hover,.topbar .btn-soft:hover,.topbar .btn-light:hover,.topbar-clean .btn:hover,.topbar-clean .btn-main:hover,.topbar-clean .btn-soft:hover,
.btn-head:hover{background:rgba(255,255,255,.18)!important;color:#fff!important;}

/* Botões gerais sem agressividade visual */
.btn-primary,.btn-navy,.btn-main:not(.page-head .btn-main):not(.hero .btn-main){background:#2563eb!important;border-color:#2563eb!important;color:#fff!important;}
.btn-success{background:#0f766e!important;border-color:#0f766e!important;color:#fff!important;}
.btn-danger{background:#b91c1c!important;border-color:#b91c1c!important;color:#fff!important;}
.btn-primary:hover,.btn-navy:hover,.btn-success:hover,.btn-danger:hover{filter:brightness(.96);}

/* Ícones mais coerentes e proporcionais */
i.bi{line-height:1;vertical-align:-.08em;}
.focus-card i.bi,.quick-card i.bi,.module i.bi,.nav-link i.bi,.side-sub-link i.bi{font-size:1em;}

/* Grelhas responsivas: telemóvel, portátil, desktop e projector */
.focus-grid,.cards-grid,.quick-grid,.modules-grid,.dashboard-grid,.kpi-grid,.stats-grid,.resumo-grid{
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}
.focus-card,.quick-card,.module-card,.cardx,.card,.box,.panel{min-width:0;}
.table-responsive,.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
table{max-width:100%;}

@media (min-width:1600px){
    .wrap,.container,.container-fluid{max-width:1560px!important;}
    .focus-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
    .content-panel{padding:24px!important;}
}
@media (max-width:1180px){
    .app{grid-template-columns:240px minmax(0,1fr)!important;}
    .focus-grid,.quick-grid,.cards-grid,.modules,.shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .focus-card{min-height:160px!important;padding:18px!important;}
    .focus-illustration{width:78px!important;height:78px!important;font-size:42px!important;}
}
@media (max-width:900px){
    .app{display:block!important;height:auto!important;min-height:100vh!important;overflow:visible!important;}
    .sidebar{position:relative!important;height:auto!important;max-height:none!important;width:100%!important;overflow:visible!important;border-radius:0!important;}
    .main{height:auto!important;overflow:visible!important;padding:10px!important;}
    .workspace{border-radius:16px!important;}
    .topbar,.page-head,.hero{border-radius:14px!important;align-items:flex-start!important;flex-direction:column!important;}
    .top-left,.top-actions,.hero-actions,.page-head .d-flex,.user{width:100%;}
    .search{min-width:100%!important;width:100%!important;}
    .account summary{min-width:0!important;width:100%;}
    .focus-grid,.quick-grid,.cards-grid,.modules,.shortcuts{grid-template-columns:1fr!important;}
    .focus-card,.module{min-height:auto!important;}
    .focus-content{max-width:calc(100% - 56px)!important;}
    .page-title,.hero h1,.page-head h1{white-space:normal!important;}
}
@media (max-width:560px){
    html,body{font-size:12px!important;}
    .container,.wrap,.page{padding-left:10px!important;padding-right:10px!important;}
    .content-panel{padding:12px!important;}
    .hero-actions,.top-actions,.page-head .d-flex{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
    .hero-actions a,.hero-actions button,.top-actions a,.top-actions button,.page-head .btn,.page-head .btn-main,.page-head .btn-soft{width:100%!important;}
    .focus-card{padding:15px!important;}
    .focus-title{font-size:16px!important;}
    .focus-sub{font-size:12px!important;}
    th,td{white-space:nowrap;}
}
@media print{
    .sidebar,.top-actions,.hero-actions,.btn,.btn-main,.btn-soft,.no-print{display:none!important;}
    body{background:#fff!important;color:#000!important;}
    .workspace,.card,.cardx,.box,.panel{box-shadow:none!important;border-color:#bbb!important;}
}
