/* ==============================================
   PEDIDOLINK - LAYOUT (Shell, Sidebar, Topbar)
   ============================================== */

/* ── Shell ── */
#shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: width var(--transition-slow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-dim);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo svg {
  flex-shrink: 0;
}

.sidebar-logo-text {
  overflow: hidden;
}

.sidebar-logo-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-1);
  white-space: nowrap;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
}

.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-4);
  padding: 14px 10px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-item.active {
  background: var(--brand-glow);
  color: var(--brand-light);
  border-color: var(--brand-border);
}

.nav-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
  opacity: 1;
}

.nav-item.active .nav-item-icon {
  background: var(--brand-glow);
}

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.sidebar-sign-out {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-sign-out:hover {
  color: var(--danger, #f43f5e);
  border-color: var(--danger, #f43f5e);
  background: var(--bg-hover);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-block:hover {
  background: var(--bg-hover);
}

button.user-block--nav {
  width: 100%;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.user-block--nav.is-active-route {
  background: var(--bg-hover);
  box-shadow: inset 0 0 0 1px var(--border-mid);
}

.usuario-signout-panel {
  border-color: var(--border-dim);
}

.usuario-sign-out-btn {
  color: var(--danger, #f43f5e);
}

.usuario-sign-out-btn:hover {
  background: rgba(244, 63, 94, 0.08);
}

.user-block-text {
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

.user-plan {
  font-size: 10px;
  color: var(--brand-light);
  white-space: nowrap;
}

/* ── Main ── */
#main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
#topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.topbar-titles-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-1);
}

.topbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-mid);
  margin: 0 var(--space-2);
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Content Area ── */
.content-area {
  flex: 1;
  padding: var(--space-6);
  max-width: var(--content-max-width);
  width: 100%;
}

/* ── Views (SPA routing) ── */
.view {
  display: none;
}

.view.active {
  display: block;
}
