:root {
  /* Design system corporativo */
  --brand-primary: #20262b;
  --brand-primary-dark: #12191e;
  --brand-accent: #f2901e;
  --brand-hydro: #59636d;
  --brand-gps: #103c58;
  --surface-page: #f4f5f6;
  --surface-card: #ffffff;
  --text-primary: #20262b;
  --text-secondary: #687179;
  --border-color: #dfe3e6;
  --status-success: #2b8a66;
  --status-warning: #e38a18;
  --status-danger: #c94e4e;
  --status-info: #2e7196;
  /* Neutros — extraídos do cinza-grafite das marcas In-Haus Industrial e Hydro */
  --ink: #20262b;
  --ink-2: #454e56;
  --navy: #1c2b33;
  --navy-deep: #12191e;
  --teal: #2d6b74;
  /* Acento — laranja da marca In-Haus */
  --orange: #f2901e;
  --orange-dark: #d9740a;
  --orange-light: #fdecd3;
  /* Institucional — tom grafite-azulado do símbolo da Hydro, uso discreto (badge "Cliente") */
  --hydro: #4a5560;
  --hydro-light: #eceff1;
  --blue: #2e7196;
  --green: #2b8a66;
  --red: #c94e4e;
  --canvas: var(--surface-page);
  --line: var(--border-color);
  --muted: var(--text-secondary);
  --white: #fff;
  --shadow: 0 14px 36px rgb(18 25 30 / 8%);
  --shadow-soft: 0 5px 18px rgb(18 25 30 / 6%);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif; font-size: .92rem; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--orange-dark); }
h1, h2, h3 { letter-spacing: -.035em; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 3vw, 2.65rem); font-weight: 750; margin: .15rem 0 .35rem; }
h2 { font-size: 1.25rem; font-weight: 750; margin: 0; }
h3 { font-size: 1.05rem; font-weight: 750; }
p { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 1.1rem .8rem .85rem; color: #dce9ec; background: linear-gradient(180deg, #20282e 0%, var(--navy-deep) 100%); border-right: 1px solid rgb(255 255 255 / 5%); z-index: 1040; }
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: .7rem; color: white; min-height: 62px; padding: .35rem .45rem 1.05rem; }
.brand:hover { color: white; }
.brand-logo-wrap { display: grid; place-items: center; width: 58px; height: 44px; flex: 0 0 58px; overflow: hidden; border-radius: 9px; background: #fff; }
.brand-logo { width: 54px; height: 38px; object-fit: contain; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { color: #fff; font-size: .83rem; line-height: 1.2; }
.brand-copy small { color: #91a4ad; font-size: .62rem; margin-top: .2rem; }
.sidebar-nav { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; gap: .28rem; overflow-x: hidden; overflow-y: auto; padding-right: .25rem; scrollbar-color: rgb(159 180 188 / 55%) transparent; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { border-radius: 99px; background: rgb(159 180 188 / 45%); }
.nav-item { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 43px; color: #c8d2d7; border-radius: 9px; padding: .64rem .72rem; font-size: .84rem; transition: color .16s ease, background-color .16s ease, transform .16s ease; }
.nav-item:hover { color: white; background: rgb(255 255 255 / 7%); }
.nav-item.active { color: #182027; background: var(--orange); font-weight: 800; box-shadow: 0 7px 18px rgb(0 0 0 / 16%); }
.nav-item.active span { transform: scale(1.06); }
.nav-item span { width: 1.2rem; flex: 0 0 1.2rem; font-size: .96rem; text-align: center; }
.nav-group { display: grid; gap: .18rem; }
.nav-group-toggle { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 43px; border: 0; border-radius: 9px; padding: .64rem .72rem; color: #c8d2d7; background: transparent; font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.nav-group-toggle:hover, .nav-group-toggle:focus-visible { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-group-toggle > span { width: 1.2rem; flex: 0 0 1.2rem; font-size: .96rem; text-align: center; }
.nav-group-toggle > b { flex: 1; font-weight: 700; }
.nav-group-toggle > i { font-style: normal; transition: transform .16s ease; }
.nav-group.is-open > .nav-group-toggle > i { transform: rotate(180deg); }
.nav-group-items { display: grid; gap: .15rem; border-left: 1px solid rgb(255 255 255 / 13%); padding-left: .42rem; margin-left: 1.3rem; }
.nav-group-items .nav-item { min-height: 35px; padding: .45rem .62rem; font-size: .76rem; }
.nav-disabled { cursor: not-allowed; opacity: .55; }
.nav-disabled:hover { color: #c8d2d7; background: transparent; }
.nav-disabled-label { width: auto !important; min-width: 0; flex: 1 1 auto !important; overflow: hidden; font-size: .78rem !important; text-align: left !important; text-overflow: ellipsis; white-space: nowrap; }
.nav-dev-badge { flex: 0 0 auto; border: 1px solid rgb(255 255 255 / 16%); border-radius: 99px; padding: .14rem .32rem; color: #adc0c7; font-size: .49rem; font-weight: 750; white-space: nowrap; }
.nav-primary { color: #ffe0b3; border: 1px solid rgb(245 155 35 / 38%); background: rgb(245 155 35 / 9%); font-weight: 700; margin: .2rem 0 .55rem; }
.nav-primary:hover { color: white; background: rgb(245 155 35 / 17%); }
.nav-primary.active { color: #172f38; background: var(--orange); }
.nav-label { color: #70848d; font-size: .61rem; font-weight: 850; letter-spacing: .16em; padding: 1rem .72rem .3rem; text-transform: uppercase; }
.nav-badge { margin-left: auto; min-width: 20px; padding: .08rem .32rem; border-radius: 99px; color: #16313b; background: var(--orange); text-align: center; font-size: .7rem; }
.sidebar-institutional { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: .5rem; min-height: 42px; border-top: 1px solid rgb(255 255 255 / 9%); padding: .7rem .45rem .35rem; margin-top: .55rem; }
.sidebar-institutional span { color: #6f858f; font-size: .57rem; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-institutional img { width: 73px; height: 28px; border-radius: 6px; object-fit: contain; background: #fff; }
.sidebar-user { display: flex; flex: 0 0 auto; align-items: center; gap: .65rem; padding: .55rem .4rem .1rem; color: inherit; }
.sidebar-user:hover { color: inherit; }
.sidebar-user strong, .sidebar-user small { display: block; max-width: 165px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { color: white; font-size: .82rem; }
.sidebar-user small { color: #90a8b0; font-size: .63rem; margin-top: .16rem; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--teal), #205266); font-weight: 800; }
.avatar-large { width: 70px; height: 70px; font-size: 1.6rem; }
.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1025; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 3vw, 2.25rem); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 94%); backdrop-filter: blur(16px); }
.topbar-context strong, .topbar-context small { display: block; }
.topbar-context strong { color: var(--ink); font-size: .82rem; }
.topbar-context small { color: var(--muted); font-size: .65rem; margin-top: .1rem; }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.topbar-actions form { margin: 0; }
.topbar-link { color: var(--ink); font-weight: 650; font-size: .82rem; }
.topbar-notifications { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); background: #fff; }
.topbar-notifications b { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; color: #182027; background: var(--orange); font-size: .56rem; }
.topbar-account { display: flex; align-items: center; gap: .5rem; max-width: 210px; border-left: 1px solid var(--line); padding-left: .75rem; color: var(--ink); }
.topbar-account .avatar { width: 34px; height: 34px; flex-basis: 34px; }
.topbar-account strong, .topbar-account small { display: block; max-width: 130px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-account strong { font-size: .72rem; }
.topbar-account small { color: var(--muted); font-size: .58rem; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 1.4rem; }
.content { width: min(1540px, 100%); padding: 1.65rem clamp(1rem, 3vw, 2.25rem) 4rem; margin-inline: auto; }
.public-shell { min-height: 100vh; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.page-header p { margin: 0; }
.eyebrow { display: block; color: var(--orange-dark); font-size: .67rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.back-link { display: block; width: fit-content; color: var(--muted); font-size: .8rem; margin-bottom: .9rem; }
.btn { border-radius: 9px; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-brand { color: #172f38; border-color: var(--orange); background: var(--orange); }
.btn-brand:hover, .btn-brand:focus { color: #102630; border-color: var(--orange-dark); background: #f9a533; box-shadow: 0 7px 16px rgb(242 144 30 / 22%); }
.form-control, .form-select { border-color: #cfd5d9; border-radius: 9px; color: var(--ink); min-height: 43px; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--orange-dark); box-shadow: 0 0 0 .2rem rgb(242 144 30 / 13%); }
.form-label, label { color: var(--ink-2); font-size: .78rem; font-weight: 700; }
.form-text { color: var(--muted); }
.flash-stack { position: fixed; top: 1rem; right: 1rem; width: min(440px, calc(100vw - 2rem)); z-index: 2000; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
