/* Mesosistema — navegação principal (sidebar + topbar)
   Medidas de layout inspiradas no painel do representante Mercos (ver docs/design-mercos.md).
   Marca, cores e código 100% próprios Mesoestetic — nada copiado do Mercos. */

.meso-shell {
  position: relative;
  min-height: 100vh;
  background: #f3f3f3;
}

.meso-nav-toggle-input { display: none; }

/* Topbar */
.meso-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 200;
}
.meso-burger {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.meso-burger:hover { background: #f3f3f3; }
.meso-burger svg { width: 20px; height: 20px; color: #333333; }

.meso-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex-shrink: 0; }
.meso-brand .logo-mark { width: 30px; height: 30px; background: #4b2f7e; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #ffffff; font-weight: 700; font-size: 14px; }
.meso-brand .logo-text { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; color: #212121; }
.meso-brand .logo-text span { color: #4b2f7e; }
.meso-brand .logo-text small { display: block; font-size: 10.5px; font-weight: 500; color: #8f8f8f; letter-spacing: normal; white-space: nowrap; margin-top: -2px; }

.meso-quicksearch { flex: 1; max-width: 420px; display: flex; }
.meso-quicksearch input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 18px 0 0 18px;
  font-size: 13px;
  font-family: inherit;
  background: #f8f8f8;
  color: #333333;
}
.meso-quicksearch input:focus { outline: none; border-color: #4b2f7e; background: #ffffff; }
.meso-quicksearch button {
  border: 1px solid #e5e5e5;
  border-left: none;
  background: #f8f8f8;
  border-radius: 0 18px 18px 0;
  padding: 0 14px;
  cursor: pointer;
  display: flex; align-items: center;
}
.meso-quicksearch button svg { width: 15px; height: 15px; color: #8f8f8f; }

.meso-topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }
.meso-topbar-right .user-info { display: none; }
.meso-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e5e5e5;
  color: #4b2f7e;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

/* Sidebar */
.meso-sidebar {
  position: fixed;
  top: 56px; bottom: 0; left: 0;
  width: 170px;
  background: #f3f3f3;
  overflow-y: auto;
  z-index: 150;
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}
.meso-nav-list { list-style: none; padding: 0 10px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.meso-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #757575;
  text-decoration: none;
  cursor: pointer;
}
.meso-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: #8f8f8f; }
.meso-nav-item:hover { color: #212121; }
.meso-nav-item:hover svg { color: #212121; }
.meso-nav-item.active { color: #212121; }
.meso-nav-item.active svg { color: #212121; }
.meso-nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 6px; bottom: 6px;
  width: 3px;
  background: #4b2f7e;
  border-radius: 0 2px 2px 0;
}
.meso-nav-item.disabled { color: #a8a8a8; cursor: default; }
.meso-nav-item.disabled:hover { color: #a8a8a8; }
.meso-nav-item.disabled svg { color: #c4c4c4; }
.meso-nav-soon {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #e5e5e5;
  color: #8f8f8f;
  padding: 2px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}
.meso-nav-account {
  margin-top: auto;
  padding: 0 10px;
}
.meso-nav-account .meso-nav-item { font-size: 11.5px; }

.meso-nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 140; }

/* Content area */
.meso-content { padding-top: 56px; margin-left: 170px; min-height: 100vh; }

/* Mobile */
@media (max-width: 900px) {
  .meso-topbar { gap: 10px; padding: 0 12px; }
  .meso-burger { display: flex; }
  .meso-brand .logo-text small { display: none; }
  .meso-quicksearch { max-width: none; }

  .meso-sidebar {
    transform: translateX(-100%);
    width: 230px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    background: #f3f3f3;
  }
  .meso-nav-toggle-input:checked ~ .meso-sidebar { transform: translateX(0); }
  .meso-nav-toggle-input:checked ~ .meso-nav-backdrop { display: block; }

  .meso-content { margin-left: 0; }
}

@media (max-width: 560px) {
  .meso-quicksearch { order: 3; flex: 1 1 100%; max-width: none; }
  .meso-topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; row-gap: 8px; }
  .meso-content { padding-top: 96px; }
}
