/* ========= BASE ========= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f6f7fb;
  color: #111;
}
a { color: inherit; text-decoration: none; }

:root {
  --brand: #04442C;
  --brand-2: rgba(255,255,255,.10);
  --brand-3: rgba(255,255,255,.16);
  --white: #fff;
  --stroke: #e6e8ef;
}

/* ========= LAYOUT ========= */
.layout {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ========= OVERLAY (mobile) ========= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.40);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
  z-index: 50;
}
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ========= SIDEBAR ========= */
.sidebar {
  width: 280px;
  background: var(--brand);
  color: var(--white);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.sidebar-client-logo {
  height: 46px;
  max-width: 190px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
}

.sidebar-close {
  display: none; /* aparece no mobile */
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
}

.sidebar-brand {
  padding: 10px 0 6px 0;
}

.brand-title {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .4px;
}

.brand-sub {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: .85;
  margin-top: 4px;
}

/* ========= NAV ========= */
.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 800;
  background: transparent;
  transition: .16s ease;
}

.nav-link:hover {
  background: var(--brand-2);
}

.nav-link.active {
  background: var(--brand-3);
  box-shadow: inset 3px 0 0 rgba(255,255,255,.55);
}

.nav-section { display: flex; flex-direction: column; gap: 8px; }

/* Botão de grupo (accordion) */
.nav-group {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: .16s ease;
}

.nav-group:hover {
  background: var(--brand-2);
}

.nav-group.open {
  background: rgba(255,255,255,.08);
}

.nav-chev {
  display: inline-block;
  transition: transform .16s ease;
  opacity: .95;
  font-weight: 900;
}

.nav-group.open .nav-chev {
  transform: rotate(180deg);
}

.nav-text { line-height: 1; }

/* Submenu */
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-2px);
  transition: max-height .20s ease, opacity .16s ease, transform .16s ease;
  border-left: 2px solid rgba(255,255,255,.18);
  margin-left: 10px;
  padding-left: 10px;
}

.nav-submenu.open {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
}

.nav-sublink {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  font-weight: 800;
  opacity: .96;
  margin: 6px 0;
  transition: .16s ease;
}

.nav-sublink:hover {
  background: var(--brand-2);
}

.nav-sublink.active {
  background: var(--brand-3);
  box-shadow: inset 3px 0 0 rgba(255,255,255,.55);
}

/* ========= TOPBAR ========= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  height: 40px;
  max-width: 200px;
  object-fit: contain;
}

.menu-btn {
  display: none; /* aparece no mobile */
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

/* ========= CONTEÚDO ========= */
.container {
  padding: 22px;
  flex: 1;
}

.card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* ========= FORM ========= */
label {
  font-weight: 800;
  display: block;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

input, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d9dce6;
  border-radius: 12px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: rgba(4, 68, 44, .55);
  box-shadow: 0 0 0 3px rgba(4, 68, 44, .14);
}

button.primary {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 900;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
}
.ok { background:#e8fff1; border:1px solid #b7f0cc; }
.err { background:#fff0f0; border:1px solid #f2b8b8; }

/* Caixa alta visual */
.uppercase { text-transform: uppercase; }

/* ========= FOOTER ========= */
.footer {
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,.14);
}

.footer-content { opacity: .92; }

/* ========= RESPONSIVO ========= */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .sidebar-close { display: inline-block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: .18s ease;
    z-index: 60;
    width: 290px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .layout { display: block; }
  .container { padding: 16px; }
}