:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-hover: #1e293b;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent: #c084fc;
  --rosa-logo: #ec4899;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #1f2937;
  --sidebar-width: 72px;
  --sidebar-expanded: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; }

.app-container { display: flex; width: 100vw; height: 100vh; }

/* Menu Lateral Retraído com Transição Suave */
.sidebar { width: var(--sidebar-width); background: var(--bg-surface); transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; border-right: 1px solid var(--border-color); z-index: 10; overflow: hidden; box-shadow: 4px 0 15px rgba(0,0,0,0.2); }
.sidebar:hover { width: var(--sidebar-expanded); }
.sidebar-header { padding: 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; border-bottom: 1px solid var(--border-color); white-space: nowrap; background: rgba(255,255,255,0.02); }
.logo-img-sidebar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.sidebar-header h2 { font-size: 16px; color: var(--text-main); opacity: 0; transition: opacity 0.2s ease; font-weight: 700; }
.sidebar:hover .sidebar-header h2 { opacity: 1; }

.sidebar-menu { list-style: none; overflow-y: auto; flex: 1; padding-top: 8px; }
.menu-item { display: flex; align-items: center; padding: 14px 20px; color: var(--text-muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; border-left: 3px solid transparent; }
.menu-item:hover { background: var(--bg-surface-hover); color: var(--text-main); border-left-color: var(--primary); }
.menu-icon { font-size: 20px; min-width: 32px; text-align: center; }
.menu-text { margin-left: 10px; opacity: 0; transition: opacity 0.2s ease; font-size: 14px; font-weight: 500; }
.sidebar:hover .menu-text { opacity: 1; }
.sidebar:hover .submenu-indicator { opacity: 1; }
.submenu-indicator { opacity: 0; transition: opacity 0.2s; font-size: 11px; color: var(--text-muted); }

.submenu { padding-left: 24px; background: #080c14; display: none; list-style: none; }
.submenu.open { display: block; animation: fadeIn 0.2s ease; }
.submenu li a { display: block; padding: 10px 15px; color: var(--text-muted); text-decoration: none; font-size: 13px; transition: all 0.2s; border-radius: 6px; margin: 2px 0; }
.submenu li a:hover { color: var(--accent); background: rgba(139,92,246,0.08); }

/* Conteúdo Principal & Top Bar */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; background-color: var(--bg-main); }
.top-bar { height: 70px; background: var(--bg-surface); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; padding: 0 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
#client-brand { font-size: 16px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
#user-greeting { font-size: 14px; color: var(--text-main); background: rgba(139, 92, 246, 0.12); padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(139, 92, 246, 0.3); font-weight: 500; }

.view-container { padding: 40px; flex: 1; max-width: 1250px; width: 100%; margin: 0 auto; animation: fadeIn 0.3s ease; }

/* Rodapé Obrigatório WS Code */
footer { height: 50px; background: var(--bg-surface); border-top: 1px solid var(--border-color); display: flex; justify-content: center; align-items: center; font-size: 12px; color: var(--text-muted); letter-spacing: 0.8px; font-weight: 500; }

/* Overlay de Carregamento com Engrenagem Animada */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(11, 15, 25, 0.88); backdrop-filter: blur(6px); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 9999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.loading-overlay.active { opacity: 1; visibility: visible; }
.gear-spinner { font-size: 58px; animation: spin 1.5s linear infinite; display: inline-block; filter: drop-shadow(0 0 10px rgba(139,92,246,0.5)); }
.loading-text { margin-top: 18px; color: var(--text-main); font-size: 16px; font-weight: 500; letter-spacing: 0.5px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Botões com Transições Suaves */
button, .btn-acao, .btn-novo, .btn-primary { transition: all 0.2s ease-in-out; }
button:hover, .btn-acao:hover, .btn-novo:hover { transform: translateY(-1px); filter: brightness(1.1); }