/* Happy Pedidos — camada visual. Bootstrap 3 / AdminLTE 2. */
:root { --happy-text:#202c3e; --happy-muted:#59677a; --happy-primary:#345e94; --happy-primary-hover:#254973; --happy-bg:#f3f5f9; --happy-border:#d8e0eb; --happy-focus:rgba(52,94,148,.18); }
html, body { min-height:100%; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; color:var(--happy-text); background:var(--happy-bg); }
/* Uma unica wrapper. O footer participa da altura, sem min-height calculado pelo AdminLTE. */
body > .happy-shell.happy-app { display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; height:auto; overflow:visible; background:var(--happy-bg); }
.happy-app::before,.happy-app::after { display:none; }
.happy-app > .main-header { flex:none; }
.happy-app > .happy-workspace { display:flex; flex:1 0 auto; flex-direction:column; min-width:0; }
.happy-app .happy-workspace > .content-wrapper { flex:1 0 auto; min-height:0!important; padding-top:0; background:transparent; }
.happy-app .happy-workspace > .main-footer { flex:none; background:rgba(255,255,255,.92); border-top:1px solid #e0e6ef; color:#526075; padding:16px 22px; font-size:12px; }
body.fixed .happy-app { padding-top:var(--happy-header-height,50px); }
body.fixed .happy-app .content-wrapper { padding-top:0!important; }
.happy-app > .main-sidebar { position:fixed; top:var(--happy-header-height,50px); bottom:0; padding-top:0!important; min-height:0!important; height:auto!important; background:#f9fbff!important; border-right:1px solid #dce4ef; box-shadow:4px 0 20px rgba(35,52,78,.035); }
.happy-app .main-sidebar > .sidebar { height:100%!important; overflow-y:auto!important; overflow-x:hidden; padding-bottom:16px; }
.happy-app .main-sidebar .slimScrollDiv { height:100%!important; }
.happy-app .main-sidebar .slimScrollDiv > .sidebar { height:100%!important; }
.happy-app .main-header .navbar,.happy-app .main-header .logo { background:#fff!important; color:#26364b!important; border-bottom:1px solid #e0e6ef; box-shadow:0 2px 12px rgba(35,52,78,.04); }
.happy-app .main-header .logo { font-family:inherit; letter-spacing:-.5px; }
.happy-app .main-header .sidebar-toggle,.happy-app .main-header .btnTelaCheia a { color:#345e94!important; }
.happy-app .main-header .sidebar-toggle:hover { background:#edf2f9!important; }
.happy-app .user-panel { padding:18px 12px; }
.happy-app .user-panel > .info,.happy-app .user-panel > .info > a { color:#34445a!important; }
.happy-app .user-panel .image img { border:2px solid #fff; box-shadow:0 3px 12px #25364d20; }
.happy-app .menu-usr { padding-bottom:12px; }
.happy-app .nav-conf-usr { color:#435671; }
.happy-app .sidebar-menu { margin:0; padding:0 8px; white-space:normal; }
.happy-app .sidebar-menu > .header { background:transparent!important; color:#65748a!important; font-size:10px; font-weight:700; letter-spacing:1px; padding:16px 12px 10px; }
/* 5 px por ul: nivel 2 = 5 px, nivel 3 = 10 px, nivel 4 = 15 px. */
.happy-app .sidebar-menu .treeview-menu { margin:0!important; padding:0 0 0 5px!important; background:transparent!important; width:auto; }
.happy-app .sidebar-menu li > a { position:relative; display:block; margin:2px 0!important; padding:10px 25px 10px 10px!important; border:0!important; border-radius:10px; line-height:20px; font-size:13px; color:#40516b!important; white-space:normal!important; overflow-wrap:break-word; transform:none!important; translate:none!important; top:auto!important; transition:background-color .15s,color .15s!important; box-shadow:none!important; text-shadow:none; }
.happy-app .sidebar-menu li:hover > a,.happy-app .sidebar-menu li > a:focus { background:#e9eff8!important; color:#213f68!important; transform:none!important; }
.happy-app .sidebar-menu li.active > a { background:#e0eaf8!important; color:#234e85!important; font-weight:600; }
.happy-app .sidebar-menu li > a > .fa { width:19px; }
.happy-app .sidebar-menu .pull-right-container { position:absolute; right:9px; top:50%; margin-top:-10px; }
.happy-app .sidebar-menu a:focus-visible,.happy-shell button:focus-visible { outline:2px solid #345e94; outline-offset:2px; }
.happy-app .content-header { padding:22px 22px 4px; }
.happy-app .content-header h1 { color:#24354b; font-size:25px; font-weight:650; letter-spacing:-.6px; text-shadow:0 1px 2px #24354b12; }
.happy-app .content { padding:18px 22px; min-height:0; }
.happy-shell .box,.happy-shell .nav-tabs-custom,.happy-shell .modal-content { border-radius:18px; box-shadow:0 6px 24px rgba(35,52,78,.08),0 1px 3px rgba(35,52,78,.04); }
.happy-shell .box { border-left:1px solid #e3e8f0; border-right:1px solid #e3e8f0; border-bottom:1px solid #e3e8f0; }
.happy-shell .box-header { border-radius:16px 16px 0 0; }
.happy-shell .box-header.with-border { border-bottom-color:#e7ecf3; }
.happy-shell .box-title { font-weight:600; text-shadow:0 1px 1px #2030490c; }
.happy-shell .box-footer { border-radius:0 0 17px 17px; border-top-color:#e7ecf3; }
.happy-shell .form-control,.happy-shell input.inputpag { border-radius:11px!important; border-color:#cdd7e4; background-color:#fff; color:#202c3e; box-shadow:inset 0 1px 2px #24364d06; transition:border-color .15s,box-shadow .15s; }
.happy-shell .form-control:focus { border-color:#345e94!important; box-shadow:0 0 0 3px #345e9426!important; }
.happy-shell .form-control[disabled],.happy-shell .form-control[readonly] { background-color:#edf1f6; color:#58657a; }
.happy-shell .has-error .form-control { border-color:#b73434; }
.happy-shell .has-success .form-control { border-color:#288252; }
.happy-shell label { font-weight:600; }
.happy-shell .input-group-addon { border-color:#cdd7e4; background:#f0f4fa; color:#41536c; }
.happy-shell .input-group .form-control:not(:first-child):not(:last-child) { border-radius:0!important; }
.happy-shell .input-group .form-control:first-child,.happy-shell .input-group-addon:first-child { border-radius:11px 0 0 11px!important; }
.happy-shell .input-group .form-control:last-child,.happy-shell .input-group-addon:last-child { border-radius:0 11px 11px 0!important; }
.happy-shell .btn { border-radius:9px; transition:background-color .15s,box-shadow .15s; }
.happy-shell .btn-default { background:#f7f9fc; color:#34465f; border-color:#d4ddea; }
.happy-shell .btn-default:hover { background:#e9eff7; }
.happy-shell .btn-primary { background:#345e94; border-color:#345e94; color:#fff; }
.happy-shell .btn-primary:hover { background:#254973; }
.happy-shell .btn-group > .btn:not(:first-child):not(:last-child) { border-radius:0; }
.happy-shell .btn-group > .btn:first-child:not(:last-child) { border-radius:9px 0 0 9px; }
.happy-shell .btn-group > .btn:last-child:not(:first-child) { border-radius:0 9px 9px 0; }
.happy-shell .table > thead > tr > th { background:#f1f5fa; color:#40516b; border-bottom:1px solid #dce4ee; }
.happy-shell .table > tbody > tr > td { border-top-color:#e8edf4; }
.happy-shell .table-hover > tbody > tr:hover { background:#f2f6fc; }
.happy-shell .select2-container .select2-selection { border-radius:11px!important; border-color:#cdd7e4; min-height:34px; }
.happy-shell .select2-container--default .select2-selection--single .select2-selection__rendered { color:#202c3e; }
.happy-shell .select2-container--focus .select2-selection { border-color:#345e94; }
.happy-shell .file-upload { color:#52627a; }
.happy-shell .happy-orders { font-family:inherit; }
.happy-shell .happy-orders .ho-input .form-control { border-radius:12px!important; }
.happy-shell .happy-orders .ho-intro,.happy-shell .happy-orders .ho-footer { color:#59677a; }
/* Sidebar-mini: o primeiro painel flutua; os niveis seguintes continuam internos. */
@media(min-width:768px) {
 body.sidebar-collapse .happy-app .main-sidebar > .sidebar { overflow:visible!important; }
 body.sidebar-collapse .happy-app .sidebar-menu { padding:0; }
 body.sidebar-collapse .happy-app .sidebar-menu > li:hover > .treeview-menu { width:230px!important; padding:5px!important; background:#f9fbff!important; border-radius:0 0 12px 0; box-shadow:8px 12px 24px #25364d20; max-height:65vh; overflow-y:auto; }
 body.sidebar-collapse .happy-app .sidebar-menu .treeview-menu .treeview-menu { position:static!important; left:auto!important; top:auto!important; width:auto!important; }
 body.layout-boxed .happy-app > .main-sidebar { left:auto; }
}
@media(max-width:767px) {
 .happy-app .content-header { padding:18px 12px 4px; }
 .happy-app .content { padding:12px; }
 .happy-app .main-footer { padding:14px!important; }
 .happy-app .content-wrapper,.happy-app .main-footer { margin-left:0; }
 body.fixed .happy-app { padding-top:var(--happy-header-height,100px); }
}
/* Revisao 2: neutraliza tambem altura explicita e geometria herdada dos pais.
   Nao limita a altura de tabelas nem esconde overflow do conteudo. */
body > .wrapper.happy-shell.happy-app {
 box-sizing:border-box!important; height:auto!important; max-height:none!important;
 min-height:100vh!important; min-height:100dvh!important;
}
body .happy-app > .happy-workspace {
 height:auto!important; min-height:0!important; max-height:none!important;
 margin-top:0!important; margin-bottom:0!important; padding-top:0!important;
 padding-bottom:0!important; flex:1 0 auto!important;
}
body .happy-app > .happy-workspace > .content-wrapper {
 height:auto!important; min-height:0!important; max-height:none!important;
 margin-top:0!important; margin-bottom:0!important; padding-bottom:0!important;
 flex:1 0 auto!important;
}
body .happy-app > .happy-workspace > .main-footer {
 position:static!important; height:auto!important; min-height:0!important;
 margin-top:0!important; margin-bottom:0!important; transform:none!important;
 clear:both; flex:0 0 auto!important;
}
body .happy-app .content-wrapper > .content {
 height:auto!important; min-height:0!important; max-height:none!important;
}
body .happy-app .content-wrapper .dataTables_wrapper {
 height:auto!important; min-height:0!important; max-height:none!important;
 padding-bottom:0!important; margin-bottom:0!important;
}
/* O transform no LI move todos os descendentes, mesmo se o A tiver transform:none. */
body #happy-navigation .sidebar,
body #happy-navigation .sidebar-menu,
body #happy-navigation .sidebar-menu ul,
body #happy-navigation .sidebar-menu li,
body #happy-navigation .sidebar-menu li > a,
body #happy-navigation .nav-conf-usr {
 transform:none!important; translate:none!important; scale:none!important;
 animation:none!important;
 transition-property:color,background-color,border-color,box-shadow!important;
}
body #happy-navigation .sidebar-menu li,
body #happy-navigation .sidebar-menu li:hover,
body #happy-navigation .sidebar-menu li:focus-within {
 position:relative!important; inset:auto!important; float:none!important;
 margin:0!important; padding:0!important; border:0!important;
 width:auto!important; min-width:0!important; max-width:100%!important;
}
body #happy-navigation .sidebar-menu li > a,
body #happy-navigation .sidebar-menu li:hover > a,
body #happy-navigation .sidebar-menu li > a:focus {
 position:relative!important; inset:auto!important; float:none!important;
 margin:2px 0!important; padding:10px 25px 10px 10px!important;
 border:0!important; line-height:20px!important; font-size:13px!important;
 width:auto!important; min-width:0!important; max-width:100%!important;
 white-space:normal!important; box-sizing:border-box!important;
}
body #happy-navigation .sidebar-menu .treeview-menu,
body #happy-navigation .sidebar-menu li:hover > .treeview-menu {
 position:static!important; inset:auto!important; float:none!important;
 margin:0!important; padding:0 0 0 5px!important; border:0!important;
 width:auto!important; min-width:0!important; max-width:100%!important;
 box-sizing:border-box!important;
}
@media(min-width:768px) {
 /* So o painel de nivel 2 flutua quando a barra inteira esta recolhida. */
 body.sidebar-collapse #happy-navigation .sidebar-menu > li:hover > .treeview-menu {
  position:absolute!important; left:50px!important; top:100%!important;
  right:auto!important; bottom:auto!important; width:230px!important;
  max-width:none!important; padding:0 0 0 5px!important;
 }
}
@media print {
 body.fixed .happy-app { padding-top:0; }
 .happy-app > .main-sidebar,.happy-app > .main-header,.happy-app .main-footer { display:none!important; }
 .happy-app .content-wrapper { margin:0!important; }
 .happy-shell .box { box-shadow:none; }
}

/* Revisao 3: Bootstrap modal e backdrop compartilham a camada do body.
   Nao ocultar nem desativar o backdrop: ele bloqueia o fundo intencionalmente. */
body > .modal.happy-modal-portal {
 position:fixed!important;
 z-index:1050!important;
}
body > .modal-backdrop { z-index:1040!important; }
