:root {
  --meca-global-header-height: 56px;
  --meca-subnav-height: 46px;
  --meca-global-navy: #0c142e;
  --meca-nav-orange: #f28c28;
  --meca-nav-blue: #2775d7;
  --meca-nav-green: #25865a;
  --meca-nav-teal: #168a92;
  --meca-nav-purple: #7651b5;
  --meca-nav-gray: #667085;
}

html { scroll-padding-top: calc(var(--meca-global-header-height) + var(--meca-subnav-height) + 12px); }
html.meca-mobile-nav-open { overflow: hidden; }

body.meca-body--global-tools {
  min-width: 0;
  overflow-x: clip;
}

body.meca-body--global-tools .meca-shell {
  display: block !important;
  min-width: 0;
  min-height: 100vh;
}

body.meca-body--global-tools .meca-main {
  width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.meca-global-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: var(--meca-global-header-height);
  color: #fff;
  background: var(--meca-global-navy);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.meca-global-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 0 24px;
}

.meca-global-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: 104px;
  border-radius: 6px;
}

.meca-global-brand img {
  display: block;
  width: auto;
  height: 30px;
}

.meca-module-nav {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.meca-module-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #dce3f0;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.meca-module-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.meca-module-nav a.is-active { color: #fff; background: rgba(255, 255, 255, 0.15); }
.meca-module-nav a.is-active::after {
  position: absolute;
  right: 12px;
  bottom: 1px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--meca-nav-gray);
  content: "";
}
.meca-module-nav a[data-module="inicio"].is-active::after,
.meca-module-nav a[data-module="operacoes"].is-active::after { background: var(--meca-nav-orange); }
.meca-module-nav a[data-module="ponto"].is-active::after { background: var(--meca-nav-blue); }
.meca-module-nav a[data-module="comercial"].is-active::after { background: var(--meca-nav-green); }
.meca-module-nav a[data-module="financeiro"].is-active::after { background: var(--meca-nav-teal); }
.meca-module-nav a[data-module="comissoes"].is-active::after { background: var(--meca-nav-purple); }

.meca-global-tools {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 230px;
  margin-left: auto;
}

.meca-global-tools .meca-ops-searchbox {
  position: relative;
  display: block !important;
  flex: 1 1 260px;
  max-width: 420px;
  min-width: 214px;
}

.meca-global-tools .meca-ops-topbar__search {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-width: 214px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #43506b;
  border-radius: 9px;
  color: #b7c1d5;
  background: #17213d;
}

.meca-global-tools .meca-ops-topbar__search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.meca-global-tools .meca-ops-topbar__search input::placeholder { color: #abb6c9; }
.meca-global-tools .meca-ops-topbar__search kbd {
  padding: 1px 6px;
  border: 1px solid #52607b;
  border-radius: 4px;
  color: #c8d0df;
  background: #202b49;
  font: 600 0.72rem/1.3 inherit;
}

.meca-global-tools .meca-ops-searchpanel {
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: min(520px, calc(100vw - 32px));
}

.meca-global-tools .meca-ops-search-open {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #e8edf6;
  background: transparent;
}

.meca-global-tools .meca-bell,
.meca-global-tools .meca-topbar__profile {
  color: #e8edf6;
}

.meca-global-tools .meca-bell {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.meca-global-tools .meca-bell:hover,
.meca-global-tools .meca-ops-search-open:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.meca-global-tools .meca-topbar__profilemenu { position: relative; flex: 0 0 auto; }
.meca-global-tools .meca-topbar__profile {
  display: inline-flex !important;
  min-height: 38px;
  border-color: transparent;
  background: transparent;
}
.meca-global-tools .meca-topbar__profile:hover { background: rgba(255, 255, 255, 0.1); }
.meca-global-tools .meca-topbar__profilepanel {
  top: calc(100% + 9px);
  right: 0;
  z-index: 1200;
}

.meca-profile-section-title {
  margin: 8px 14px 4px;
  color: #667085;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meca-profile-divider { height: 1px; margin: 7px 10px; background: #e6e9ef; }

.meca-subnav {
  position: sticky;
  z-index: 900;
  top: var(--meca-global-header-height);
  height: var(--meca-subnav-height);
  border-bottom: 1px solid #d9dee8;
  background: #fff;
  box-shadow: 0 2px 6px rgba(12, 20, 46, 0.05);
}

.meca-subnav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  height: 100%;
  padding: 0 24px;
}

.meca-page-tabs {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  white-space: nowrap;
}

.meca-page-tabs a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  color: #475467;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.meca-page-tabs a:hover { color: #14213d; background: #f7f8fb; }
.meca-page-tabs a.is-active { color: #163b75; }
.meca-page-tabs a.is-active::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--meca-nav-blue);
  content: "";
}

.meca-subnav__account {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding-left: 14px;
  border-left: 1px solid #e4e7ec;
}
.meca-subnav__environment {
  max-width: 170px;
  overflow: hidden;
  color: #667085;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meca-subnav__logout { color: #344054; font-size: 0.78rem; font-weight: 800; text-decoration: none; }
.meca-subnav__logout:hover { color: #b42318; }

body.meca-body--global-tools .meca-container {
  width: min(1160px, calc(100% - 40px));
  max-width: 1160px;
  margin: 0 auto;
}
body.meca-body--global-tools .meca-container.meca-container--wide,
body.meca-body--global-tools .meca-container--wide,
body.meca-body--global-tools .meca-container--operacoes {
  width: min(1560px, calc(100% - 40px));
  max-width: 1560px;
}

.meca-mobile-menu-button,
.meca-mobile-panel,
.meca-mobile-scrim { display: none; }

.meca-global-header :is(a, button, input, [role="button"]):focus-visible,
.meca-subnav :is(a, button):focus-visible,
.meca-mobile-panel :is(a, [role="button"]):focus-visible {
  outline: 3px solid #ffba68;
  outline-offset: 2px;
}

@media (max-width: 1239px) {
  .meca-global-header__inner { gap: 10px; padding-inline: 16px; }
  .meca-module-nav a { padding-inline: 8px; font-size: 0.73rem; }
  .meca-global-brand { min-width: 92px; }
  .meca-global-brand img { height: 27px; }
  .meca-global-tools .meca-topbar__profile span,
  .meca-global-tools .meca-topbar__profile svg { display: none; }
}

@media (max-width: 1023px) {
  .meca-global-header__inner { padding-inline: 14px; }
  .meca-global-brand { min-width: 78px; }
  .meca-module-nav { overflow-x: auto; scrollbar-width: none; }
  .meca-module-nav::-webkit-scrollbar { display: none; }
  .meca-global-tools { flex: 0 0 auto; min-width: auto; }
  .meca-global-tools .meca-ops-searchbox {
    position: fixed;
    z-index: 1300;
    top: 62px;
    right: 16px;
    display: none !important;
    width: min(520px, calc(100vw - 32px));
    max-width: none;
  }
  .meca-global-tools .meca-ops-searchbox.is-shortcut-open { display: block !important; }
  .meca-global-tools .meca-ops-search-open { display: inline-flex; }
  .meca-global-tools .meca-ops-topbar__search { min-width: 0; border-color: #9aa4b7; background: #fff; box-shadow: 0 14px 34px rgba(12, 20, 46, 0.2); }
  .meca-global-tools .meca-ops-topbar__search input { color: #101828; }
  .meca-global-tools .meca-ops-topbar__search input::placeholder { color: #667085; }
  .meca-subnav__inner { padding-inline: 14px; }
  .meca-subnav__environment { display: none; }
}

@media (max-width: 767px) {
  :root { --meca-subnav-height: 0px; }
  .meca-global-header__inner { justify-content: space-between; }
  .meca-global-brand { min-width: 0; }
  .meca-global-brand img { height: 29px; }
  .meca-module-nav,
  .meca-subnav { display: none !important; }
  .meca-global-tools {
    display: flex !important;
    flex: 0 0 auto;
    gap: 4px;
    min-width: 0;
    margin-left: 0;
  }
  .meca-global-tools .meca-bell { display: none !important; }
  .meca-global-tools .meca-ops-search-open { display: inline-flex; }
  .meca-mobile-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #49546c;
    border-radius: 8px;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
  }
  .meca-mobile-scrim {
    position: fixed;
    z-index: 1390;
    inset: 0;
    background: rgba(5, 10, 25, 0.62);
    opacity: 0;
    transition: opacity 180ms ease;
  }
  .meca-mobile-panel {
    position: fixed;
    z-index: 1400;
    inset: 0;
    display: flex;
    width: 100vw;
    transform: translateX(102%);
    flex-direction: column;
    color: #101828;
    background: #fff;
    box-shadow: -16px 0 45px rgba(5, 10, 25, 0.3);
    transition: transform 200ms ease;
  }
  .meca-nav-toggle:checked ~ .meca-mobile-scrim { display: block; opacity: 1; }
  .meca-nav-toggle:checked ~ .meca-mobile-panel { transform: translateX(0); }
  .meca-mobile-panel__head {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    color: #fff;
    background: var(--meca-global-navy);
  }
  .meca-mobile-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
  }
  .meca-mobile-panel__nav {
    flex: 1 1 auto;
    padding: 10px 14px 28px;
    overflow-y: auto;
  }
  .meca-mobile-panel__nav section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
    padding: 8px 0 12px;
    border-bottom: 1px solid #eaecf0;
  }
  .meca-mobile-panel__nav a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #475467;
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
  }
  .meca-mobile-panel__nav a:hover { color: #163b75; background: #f2f5fa; }
  .meca-mobile-panel__nav .meca-mobile-panel__module {
    grid-column: 1 / -1;
    color: #14213d;
    font-size: 0.93rem;
    font-weight: 850;
  }
  body.meca-body--global-tools .meca-container,
  body.meca-body--global-tools .meca-container.meca-container--wide,
  body.meca-body--global-tools .meca-container--wide,
  body.meca-body--global-tools .meca-container--operacoes {
    width: min(100% - 24px, 1560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .meca-mobile-panel,
  .meca-mobile-scrim,
  .meca-module-nav a { transition: none; }
}
