/* Paleta amarelo + preto (accent-based) – ref. docs/DESIGN_PALETA_CORES_ERP.md */
:root {
  --apple-bg: #fafafa;
  --apple-card: #ffffff;
  --apple-accent: #eab308;
  --apple-accent-hover: #ca8a04;
  --apple-text: #0a0a0a;
  --apple-muted: #525252;
  --apple-radius: 10px;
  --apple-radius-lg: 14px;
  --apple-shadow: 0 1px 3px rgba(0,0,0,0.07);
  --apple-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
  --sidebar-bg: #0a0a0a;
  --sidebar-text: #fafafa;
  --sidebar-muted: #a3a3a3;
  --sidebar-accent: #eab308;
}
html.dark {
  --apple-bg: #0a0a0a;
  --apple-card: #171717;
  --apple-text: #fafafa;
  --apple-muted: #a3a3a3;
  --apple-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --apple-shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
  --sidebar-bg: #0a0a0a;
  --sidebar-text: #fafafa;
  --sidebar-muted: #a3a3a3;
  --sidebar-accent: #eab308;
}
html, body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--apple-bg);
  color: var(--apple-text);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars Profissionais - ref. R1 / Branding */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); border: 2px solid transparent; background-clip: content-box; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
html.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Acessibilidade: foco visível (teclado), movimento reduzido — ref. Sprint C.1 / ludus */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--apple-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (prefers-contrast: more) {
  .input-apple {
    border-width: 2px;
    border-color: var(--apple-text);
  }
  .btn-primary {
    outline: 2px solid currentColor;
  }
}
[data-panel].hidden { display: none; }
.sidebar-link { transition: background 0.2s ease, transform 0.15s ease; }
.sidebar-link:hover { background: rgba(234,179,8,0.12); color: var(--sidebar-accent); }
.sidebar-link.active { background: rgba(234,179,8,0.15); border-left: 3px solid var(--sidebar-accent); color: var(--sidebar-accent); }
.card-apple { background: var(--apple-card); border-radius: var(--apple-radius-lg); box-shadow: var(--apple-shadow); transition: box-shadow 0.25s ease; }
.card-apple:hover { box-shadow: var(--apple-shadow-hover); }
.input-apple { border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.input-apple:focus { outline: none; border-color: var(--apple-accent); box-shadow: 0 0 0 3px rgba(234,179,8,0.2); }
html.dark .input-apple { border-color: rgba(255,255,255,0.1); }
.btn-primary { background: var(--apple-accent); color: #0a0a0a; font-weight: 600; border-radius: 10px; transition: opacity 0.2s, transform 0.1s; }
.btn-primary:hover { opacity: 0.92; background: var(--apple-accent-hover, #ca8a04); }
.btn-primary:active { transform: scale(0.98); }
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { padding: 14px 18px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); animation: slideIn 0.35s cubic-bezier(0.16,1,0.3,1); font-size: 14px; }
.toast.error { background: #fff5f5; color: #c53030; }
.toast.warning { background: #fffbeb; color: #b45309; }
.toast.success { background: #f0fdf4; color: #166534; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.status-pill.ativo { background: #dcfce7; color: #166534; }
.status-pill.inativo { background: #fee2e2; color: #b91c1c; }
html.dark .status-pill.ativo { background: rgba(34,197,94,0.2); color: #4ade80; }
html.dark .status-pill.inativo { background: rgba(239,68,68,0.2); color: #f87171; }
.kebab-wrap { position: relative; display: inline-block; }
.kebab-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--apple-muted); font-size: 18px; }
.kebab-btn:hover { background: rgba(0,0,0,0.06); color: var(--apple-text); }
.kebab-dropdown { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; min-width: 160px; background: var(--apple-card); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); border: 1px solid rgba(0,0,0,0.06); z-index: 100; overflow: hidden; }
.kebab-dropdown.open { display: block; }
.kebab-dropdown button { width: 100%; text-align: left; padding: 10px 14px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--apple-text); }
.kebab-dropdown button:hover { background: rgba(0,0,0,0.04); }
.detail-panel { width: 360px; min-width: 360px; max-height: 100%; overflow-y: auto; background: var(--apple-card); border-left: 1px solid rgba(0,0,0,0.06); }
html.dark .detail-panel { border-left-color: rgba(255,255,255,0.08); }
@media (max-width: 768px) {
  aside { width: 100%; max-height: 50vh; overflow-y: auto; }
  main { flex-direction: column; }
  .detail-panel { width: 100%; min-width: 100%; border-left: none; border-top: 1px solid rgba(0,0,0,0.06); }
}
/* Setup Wizard */
.wizard-step-dot { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--apple-muted); background: rgba(0,0,0,0.03); transition: all 0.2s; }
.wizard-step-dot span { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,0.06); font-weight: 700; font-size: 11px; }
.wizard-step-dot.active { color: var(--apple-accent); background: rgba(234,179,8,0.1); }
.wizard-step-dot.active span { background: var(--apple-accent); color: #0a0a0a; }
.wizard-step-dot.done { color: #16a34a; }
.wizard-step-dot.done span { background: #16a34a; color: white; }
html.dark .wizard-step-dot { background: rgba(255,255,255,0.05); }
html.dark .wizard-step-dot.active { background: rgba(234,179,8,0.15); }
.wiz-label { display: block; font-size: 13px; font-weight: 500; color: var(--apple-text); margin-bottom: 4px; }

/* Layout Geral - Dashboard Fixo com Rolagem Interna */
#app-container { height: 100vh; width: 100vw; overflow: hidden; display: flex; flex-direction: row; }
#app-container main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#main-content-area { flex: 1; overflow-y: auto; padding: 2rem; position: relative; scroll-behavior: smooth; }
aside { overflow-y: auto; height: 100vh; }

/* Scrollbars Visíveis e Profissionais */
#main-content-area::-webkit-scrollbar { width: 10px; }
#main-content-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 5px; }
html.dark #main-content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* Correção de botões sobrepostos e contrastes */
.btn-primary { z-index: 10; position: relative; }
[data-panel] { min-height: 100%; padding-bottom: 6rem; } 

.visible-scrollbar { 
  scrollbar-width: thin; 
  scrollbar-color: rgba(0,0,0,0.3) transparent;
}
#login-screen {
  background-image: url('/img/login-bg.png');
  background-size: cover;
  background-position: center;
}
.visible-scrollbar::-webkit-scrollbar { width: 8px; }
.visible-scrollbar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 10px; }
html.dark .visible-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); }

#modal-termos-conteudo { text-align: justify; line-height: 1.6; }
#modal-termos-conteudo h1, #modal-termos-conteudo h2, #modal-termos-conteudo h3 { color: var(--apple-accent); margin-top: 1rem; margin-bottom: 0.5rem; }

