/* ===== MENU PRINCIPAL — Sidebar & Layout ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout principal ── */
.menu-wrapper {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 48px);
}

/* Menu usa o mesmo padrão da chamados-sidebar do layout.css */

/* ── Sidebar ── */
.menu-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0.75rem;
  gap: 0.3rem;
  position: sticky;
  top: 48px;
  height: calc(100vh - 48px);
}

.sidebar-section-label {
  font-size: 0.6rem;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.5rem 0.75rem 0.3rem;
  margin-top: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
  box-sizing: border-box;
}

/* Nome do módulo — overflow controlado só no texto */
.sidebar-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sidebar-item:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--accent);
}

.sidebar-item.active {
  background: var(--surface2);
  color: var(--accent);
  font-weight: 700;
}

.sidebar-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.sidebar-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Badge Em breve */
.sidebar-soon {
  font-size: 0.5rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface3);
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Divisor */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.75rem;
}

/* Rodapé da sidebar */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--surface2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 0.65rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-logout:hover {
  background: #fee2e2;
  color: var(--accent);
}

body.dark-mode .sidebar-logout:hover {
  background: #2a0808;
  color: var(--accent);
}

/* Botão configurações no rodapé — menor e discreto */
.sidebar-config-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--muted);
  cursor: not-allowed;
  border: 1px solid var(--border2);
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  opacity: 0.7;
}

.sidebar-config-btn:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.sidebar-config-btn:not(:disabled):hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}

/* ── Área central ── */
.menu-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  overflow-y: auto;
}

/* Coluna esquerda — saudação + comunicados */
.menu-col-left {
  flex: 1.5;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Coluna direita — alertas + widgets futuros */
.menu-col-right {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.menu-greeting {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.menu-greeting-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.menu-greeting-sub {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}

/* ── Dark mode ── */
body.dark-mode .menu-sidebar {
  background: var(--surface);
  border-color: var(--border2);
}

/* ── Alertas de Estoque ── */
.alertas-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

#alertas-estoque-section {
  width: 100%;
}

#alertas-estoque-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.alerta-estoque-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}

.alerta-estoque-item:hover {
  border-color: var(--accent);
}

.alerta-estoque-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alerta-estoque-info {
  flex: 1;
  min-width: 0;
}

.alerta-estoque-nome {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.alerta-estoque-detalhe {
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.alerta-estoque-badge {
  font-size: 0.6rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  border: 1px solid;
  flex-shrink: 0;
}

/* Badge pulsante de alertas extras */
.alertas-mais-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #f59e0b;
}

.alertas-mais-badge.urgente {
  color: #ef4444;
}

.alertas-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  animation: alertaPulse 1.4s ease-in-out infinite;
}

.alertas-pulse.urgente {
  background: #ef4444;
  animation: alertaPulse 0.6s ease-in-out infinite;
}

@keyframes alertaPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.3;
    transform: scale(0.65);
  }
}

/* Botão de atalho "→" no header dos alertas */
.alertas-ver-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s;
  flex-shrink: 0;
}

.alertas-ver-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}