/* BI Grupo Mourão — identidade configurável da aplicação bi_ugestor.
 * O seletor raiz impede que o tema alcance o BI central ou outro White Label.
 */
html[data-bi-brand="white-label"] {
  --bi-mourao-espresso: #1d110c;
  --bi-mourao-walnut: #3b2a21;
  --bi-mourao-stone: #8a6a4a;
  --bi-mourao-copper: #a8784e;
  --bi-mourao-sand: #c8b79a;
  --bi-mourao-cream: #f7f3ec;
  --bi-mourao-ivory: #fffdf9;
  --bi-mourao-ink: #241a15;
  --bi-mourao-muted: #74665c;
  --bi-mourao-border: rgba(92, 67, 49, 0.18);
  --bi-mourao-focus: #d49a63;
  --bi-color-primary: var(--bi-mourao-walnut);
  --bi-color-accent: var(--bi-mourao-stone);
  --bi-color-surface: var(--bi-mourao-ivory);
  --bi-color-background: var(--bi-mourao-cream);
}

html[data-bi-brand="white-label"] body {
  color: var(--bi-mourao-ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(200, 183, 154, 0.2), transparent 27rem),
    linear-gradient(145deg, #f5efe6 0%, #fffdf9 48%, #f0e7dc 100%);
}

html[data-bi-brand="white-label"] a {
  color: #6f4d35;
}

html[data-bi-brand="white-label"] a:hover {
  color: var(--bi-mourao-espresso);
}

html[data-bi-brand="white-label"] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bi-mourao-focus) 62%, transparent);
  outline-offset: 3px;
}

html[data-bi-brand="white-label"] .bi-login-page {
  background: var(--bi-mourao-cream);
}

html[data-bi-brand="white-label"] .bi-login-hero {
  background: var(--bi-mourao-espresso);
}

html[data-bi-brand="white-label"] .bi-login-hero::before {
  background:
    linear-gradient(100deg, rgba(16, 9, 6, 0.97) 0%, rgba(29, 17, 12, 0.91) 49%, rgba(29, 17, 12, 0.66) 100%),
    linear-gradient(180deg, rgba(10, 6, 4, 0.08), rgba(10, 6, 4, 0.58));
}

html[data-bi-brand="white-label"] .bi-login-hero__visual img {
  filter: saturate(0.88) contrast(1.08);
}

html[data-bi-brand="white-label"] .bi-login-brand--hero img {
  width: min(250px, 52vw);
  height: auto;
  max-height: 74px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

html[data-bi-brand="white-label"] .bi-login-brand--hero span {
  color: #fffaf2;
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

html[data-bi-brand="white-label"] .bi-login-eyebrow {
  color: #f0d5b7;
}

html[data-bi-brand="white-label"] .bi-login-eyebrow::before {
  background: linear-gradient(90deg, var(--bi-mourao-copper), #e0b784);
}

html[data-bi-brand="white-label"] .bi-login-hero__copy > p,
html[data-bi-brand="white-label"] .bi-login-hero__signature {
  color: rgba(255, 250, 242, 0.9);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.58);
}

html[data-bi-brand="white-label"] .bi-login-capabilities li {
  border-color: rgba(232, 215, 187, 0.48);
  background: rgba(29, 17, 12, 0.72);
  color: #fffaf2;
}

html[data-bi-brand="white-label"] .bi-login-access {
  background:
    radial-gradient(circle at 76% 16%, rgba(200, 183, 154, 0.26), transparent 34%),
    linear-gradient(145deg, var(--bi-mourao-cream), var(--bi-mourao-ivory));
}

html[data-bi-brand="white-label"] .bi-login-card {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--bi-mourao-border);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 30px 80px rgba(59, 42, 33, 0.14);
}

html[data-bi-brand="white-label"] .bi-login-brand--access {
  color: var(--bi-mourao-espresso);
}

html[data-bi-brand="white-label"] .bi-login-brand--access img {
  width: min(190px, 48vw);
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

html[data-bi-brand="white-label"] .bi-login-card__header h2,
html[data-bi-brand="white-label"] .bi-login-label-row .form-label,
html[data-bi-brand="white-label"] .bi-login-field > .form-label {
  color: var(--bi-mourao-espresso);
}

html[data-bi-brand="white-label"] .bi-login-card__header p,
html[data-bi-brand="white-label"] .bi-login-label-row span,
html[data-bi-brand="white-label"] .bi-login-remember-copy small {
  color: var(--bi-mourao-muted);
}

html[data-bi-brand="white-label"] .bi-login-control {
  border-color: rgba(138, 106, 74, 0.35);
  background: #fff;
}

html[data-bi-brand="white-label"] .bi-login-control:focus-within {
  border-color: var(--bi-mourao-stone);
  box-shadow: 0 0 0 4px rgba(168, 120, 78, 0.14);
}

html[data-bi-brand="white-label"] .bi-login-submit {
  border-color: transparent;
  background: linear-gradient(115deg, var(--bi-mourao-espresso), #5f4532 58%, var(--bi-mourao-stone));
  color: #fff;
  box-shadow: 0 14px 32px rgba(59, 42, 33, 0.22);
}

html[data-bi-brand="white-label"] .bi-login-submit:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(59, 42, 33, 0.28);
}

html[data-bi-brand="white-label"] .bi-app-splash {
  background: linear-gradient(145deg, #140b07, var(--bi-mourao-walnut) 58%, var(--bi-mourao-stone));
}

html[data-bi-brand="white-label"] .bi-app-splash__mark {
  border-color: rgba(247, 243, 236, 0.34);
  background: rgba(255, 253, 249, 0.94);
}

html[data-bi-brand="white-label"] .bi-global-shell,
html[data-bi-brand="white-label"] .header-navbar {
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 12px 32px rgba(45, 31, 23, 0.1);
  backdrop-filter: blur(16px);
}

html[data-bi-brand="white-label"] .header-navbar .navbar-header,
html[data-bi-brand="white-label"] .header-navbar .navbar-container {
  background: transparent;
}

html[data-bi-brand="white-label"] .header-navbar .navbar-brand img,
html[data-bi-brand="white-label"] .bi-mobile-brand img,
html[data-bi-brand="white-label"] .horizontal-menu-wrapper .navbar-brand img {
  width: auto;
  height: 36px;
  max-width: 190px;
  object-fit: contain;
}

html[data-bi-brand="white-label"] .header-navbar .brand-text,
html[data-bi-brand="white-label"] .bi-mobile-brand__name {
  color: var(--bi-mourao-espresso);
  font-weight: 700;
}

html[data-bi-brand="white-label"] .horizontal-menu-wrapper {
  border: 0;
  background: linear-gradient(100deg, #160c08 0%, var(--bi-mourao-walnut) 68%, #684d39 100%);
  box-shadow: 0 12px 30px rgba(29, 17, 12, 0.2);
}

html[data-bi-brand="white-label"] .horizontal-menu-wrapper .nav-link,
html[data-bi-brand="white-label"] .horizontal-menu-wrapper .navbar-brand,
html[data-bi-brand="white-label"] .horizontal-menu-wrapper .dropdown-toggle {
  color: rgba(255, 250, 242, 0.9);
}

html[data-bi-brand="white-label"] .horizontal-menu-wrapper .nav-item.active > .nav-link,
html[data-bi-brand="white-label"] .horizontal-menu-wrapper .nav-link:hover {
  color: #fff;
  background: rgba(200, 183, 154, 0.16);
}

html[data-bi-brand="white-label"] .horizontal-menu-wrapper .nav-item.active > .nav-link::after {
  background: linear-gradient(90deg, var(--bi-mourao-copper), #e0b784);
}

/* Header desktop Mourão: logo, navegação e contexto formam uma única faixa.
 * O shell legado sobrepõe dois navs na mesma coordenada; estes seletores
 * escopados reservam áreas explícitas e impedem o menu de cobrir a conta. */
@media (min-width: 1200px) {
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell {
    height: 76px !important;
    min-height: 76px !important;
    border-bottom: 1px solid var(--bi-mourao-border) !important;
    background: linear-gradient(90deg, #fffdf9 0%, #fff 55%, #f8f1e8 100%) !important;
    box-shadow: 0 8px 26px rgba(45, 31, 23, 0.1) !important;
    backdrop-filter: none !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell::before {
    content: "";
    position: absolute;
    z-index: 12;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, var(--bi-mourao-espresso), var(--bi-mourao-copper));
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar,
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-container {
    height: 76px !important;
    min-height: 76px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar {
    z-index: 8 !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-container {
    padding: 0 28px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-header {
    left: 28px !important;
    top: 50% !important;
    z-index: 10 !important;
    width: 176px !important;
    transform: translateY(-50%) !important;
    pointer-events: auto !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-brand {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-brand img {
    width: 148px !important;
    height: auto !important;
    max-width: 148px !important;
    max-height: 42px !important;
    object-fit: contain;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-container > ul.navbar-nav {
    position: relative;
    z-index: 10;
    gap: 8px;
    pointer-events: auto !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper {
    top: 0 !important;
    right: 380px !important;
    left: 218px !important;
    z-index: 7 !important;
    width: auto !important;
    height: 76px !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper > .header-navbar {
    top: 0 !important;
    left: 0 !important;
    position: relative !important;
    width: 100% !important;
    height: 76px !important;
    min-height: 76px !important;
    max-width: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper .main-menu-content,
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation {
    height: 76px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper .main-menu-content {
    padding: 0 !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation {
    gap: 6px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li {
    height: auto !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li > a {
    height: 42px !important;
    padding: 0 14px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    color: #5f493a !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 650 !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li:not(.active) > a:hover {
    border-color: rgba(138, 106, 74, 0.2) !important;
    color: var(--bi-mourao-espresso) !important;
    background: #f4ede4 !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li.active > a {
    border-color: var(--bi-mourao-walnut) !important;
    color: #fffaf2 !important;
    background: linear-gradient(120deg, var(--bi-mourao-espresso), #5b412f) !important;
    box-shadow: 0 8px 18px rgba(45, 31, 23, 0.2) !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li.active > a * {
    color: #fffaf2 !important;
    stroke: currentColor !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell #bi-desktop-theme-context .nav-link {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0 !important;
    border: 1px solid var(--bi-mourao-border);
    border-radius: 12px;
    color: var(--bi-mourao-walnut);
    background: #fffdf9;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-user-context {
    min-height: 48px !important;
    gap: 10px !important;
    padding: 5px 8px 5px 10px !important;
    border: 1px solid rgba(92, 67, 49, 0.14);
    border-radius: 14px;
    background: rgba(255, 253, 249, 0.9);
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-entity-selector + .select2-container,
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-entity-selector {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-user-context .select2-selection--single {
    height: 38px !important;
    border: 0 !important;
    background: #f4ede4 !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-user-context .select2-selection__rendered {
    color: var(--bi-mourao-walnut) !important;
    font-size: 12px !important;
    line-height: 38px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell + .app-content {
    padding-top: 18px !important;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-header {
    left: 20px !important;
    width: 132px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell > .header-navbar .navbar-brand img {
    width: 124px !important;
    max-width: 124px !important;
    max-height: 36px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper {
    right: 280px !important;
    left: 168px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation {
    gap: 2px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .horizontal-menu-wrapper ul#main-menu-navigation > li > a {
    height: 40px !important;
    padding: 0 9px !important;
    font-size: 12px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-entity-selector + .select2-container,
  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-entity-selector {
    width: 174px !important;
    min-width: 174px !important;
    max-width: 174px !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-user-identity {
    display: none !important;
  }

  html[data-bi-brand="white-label"] body.horizontal-layout.navbar-floating .bi-global-shell .bi-header-user-context {
    gap: 6px !important;
    padding-left: 7px !important;
  }
}

html[data-bi-brand="white-label"] .dropdown-menu {
  border: 1px solid var(--bi-mourao-border);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 42px rgba(45, 31, 23, 0.16);
}

html[data-bi-brand="white-label"] .dropdown-item:hover,
html[data-bi-brand="white-label"] .dropdown-item:focus,
html[data-bi-brand="white-label"] .dropdown-item.active {
  color: var(--bi-mourao-espresso);
  background: rgba(200, 183, 154, 0.24);
}

html[data-bi-brand="white-label"] .app-content,
html[data-bi-brand="white-label"] .content-wrapper,
html[data-bi-brand="white-label"] .content-body {
  background-color: transparent;
}

html[data-bi-brand="white-label"] :is(.card, .content-card, .e-grid, .modal-content, .offcanvas, .bi-page-surface) {
  border-color: var(--bi-mourao-border);
  background-color: rgba(255, 253, 249, 0.97);
  box-shadow: 0 16px 38px rgba(45, 31, 23, 0.08);
}

html[data-bi-brand="white-label"] :is(.card-header, .modal-header, .offcanvas-header, .e-gridheader) {
  border-color: var(--bi-mourao-border);
  background: linear-gradient(180deg, #fffdf9, #f8f2ea);
}

html[data-bi-brand="white-label"] :is(h1, h2, h3, h4, h5, h6, .card-title, .content-header-title) {
  color: var(--bi-mourao-espresso);
}

/* O título do hero precisa vencer a regra tipográfica global acima em todas as
 * larguras. Sem esta fronteira, o mobile herdava o tom escuro sobre a foto. */
html[data-bi-brand="white-label"] .bi-login-hero__copy h1 {
  color: #fffaf2;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.72);
}

html[data-bi-brand="white-label"] :is(.btn-primary, .e-primary, .page-item.active .page-link) {
  border-color: var(--bi-mourao-walnut) !important;
  background: linear-gradient(115deg, var(--bi-mourao-espresso), var(--bi-mourao-stone)) !important;
  color: #fff !important;
}

html[data-bi-brand="white-label"] :is(.btn-outline-primary, .page-link) {
  border-color: rgba(138, 106, 74, 0.4);
  color: #6f4d35;
}

html[data-bi-brand="white-label"] :is(.form-control, .form-select, .select2-selection, .e-input-group) {
  border-color: rgba(138, 106, 74, 0.3) !important;
  background-color: #fffdf9;
}

html[data-bi-brand="white-label"] :is(.form-control, .form-select, .select2-selection, .e-input-group):focus,
html[data-bi-brand="white-label"] .e-input-group.e-input-focus {
  border-color: var(--bi-mourao-stone) !important;
  box-shadow: 0 0 0 3px rgba(168, 120, 78, 0.14) !important;
}

html[data-bi-brand="white-label"] :is(.table, .e-grid) thead th,
html[data-bi-brand="white-label"] .e-headercell {
  color: var(--bi-mourao-espresso);
  background: #f1e8dc !important;
}

html[data-bi-brand="white-label"] :is(.table, .e-grid) tbody tr:hover,
html[data-bi-brand="white-label"] .e-row:hover .e-rowcell {
  background: rgba(200, 183, 154, 0.17) !important;
}

html[data-bi-brand="white-label"] .progress-bar {
  background: linear-gradient(90deg, var(--bi-mourao-copper), var(--bi-mourao-stone));
}

html[data-bi-brand="white-label"] .bi-responsive-navigation {
  background: linear-gradient(160deg, #160c08, var(--bi-mourao-walnut));
}

html[data-bi-brand="white-label"] .bi-responsive-navigation :is(a, button, span) {
  color: #fffaf2;
}

html[data-bi-brand="white-label"] footer,
html[data-bi-brand="white-label"] .footer {
  color: var(--bi-mourao-muted);
  background: transparent;
}

@media (max-width: 991.98px) {
  html[data-bi-brand="white-label"] .bi-login-card {
    padding: 28px 22px;
    border-radius: 18px;
  }

  html[data-bi-brand="white-label"] .bi-login-access {
    padding: 22px 16px;
  }

  html[data-bi-brand="white-label"] .header-navbar .navbar-container {
    min-height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-bi-brand="white-label"] *,
  html[data-bi-brand="white-label"] *::before,
  html[data-bi-brand="white-label"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  html[data-bi-brand="white-label"] body {
    color: #000;
    background: #fff;
  }

  html[data-bi-brand="white-label"] :is(.header-navbar, .horizontal-menu-wrapper, .bi-responsive-navigation) {
    display: none !important;
  }

  html[data-bi-brand="white-label"] :is(.card, .e-grid) {
    border-color: #aaa;
    box-shadow: none;
  }
}
