:root {
    --bg: #0f172a; /* slate-900 */
    --bg-elev: #111827; /* gray-900 */
    --text: #212529; /* site dark */
    --muted: #6c757d; /* site gray */
    --card: #ffffff; /* site card light */
    --border: #eeeeee; /* site light border */
    --accent: #d4af37; /* site secondary */

    --usuarios: #10b981; /* emerald */
    --clientes: #f59e0b; /* amber */
    --processos: #ef4444; /* red */
    --documentos: #3b82f6; /* blue */
    --ia: #8b5cf6; /* violet */
    --financeiro: #22c55e; /* green */
    --configuracoes: #f97316; /* orange */
}

/* Theme base scoped to manual section */
.manual-scope { color: var(--text); }

/* Header (scoped; retains styles only if manual-specific toolbar is present) */
.manual-scope header { position: sticky; top: 0; z-index: 50; background: #ffffff; border-bottom: 1px solid var(--border); }
.manual-scope .header-container { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.manual-scope .header-left { display: flex; align-items: center; gap: 12px; }
.manual-scope .header-left .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.manual-scope .header-left .logo i { color: var(--accent); }
.manual-scope .mobile-menu-btn { background: transparent; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 8px; display: none; }

.manual-scope .header-actions { display: flex; align-items: center; gap: 12px; }
.manual-scope .search-box { position: relative; width: 320px; }
.manual-scope .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.manual-scope .search-input { width: 100%; padding: 10px 12px 10px 36px; background: #ffffff; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.manual-scope .theme-toggle, .manual-scope .print-btn { background: #ffffff; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 8px; }

/* Shell */
.main-container { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 24px 0; }

/* Sidebar */
.sidebar { position: sticky; top: 76px; height: calc(100vh - 100px); overflow: hidden auto; background: #ffffff; border: 1px solid var(--border); border-radius: 14px; }
.sidebar-menu { list-style: none; padding: 14px; }
.menu-category { font-size: .8rem; color: var(--muted); padding: 10px 12px; text-transform: uppercase; letter-spacing: .08em; }
.menu-item a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 4px 0; color: var(--text); text-decoration: none; border-radius: 10px; border: 1px solid transparent; }
.menu-item a:hover { background: rgba(255,255,255,.03); border-color: var(--border); }
.menu-item a.active { background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.3); }

/* Main */
.main-content { background: #ffffff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.breadcrumb { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.breadcrumb a { color: var(--text); text-decoration: none; }
.page-title { display: flex; align-items: center; gap: 12px; padding: 14px; background: #ffffff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.page-title i { color: var(--accent); }
.page-title h1 { margin: 0; font-size: 1.4rem; }
.page-title p { color: var(--muted); margin-top: 2px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.filter-btn { background: #0b1222; color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 999px; font-size: .9rem; cursor: pointer; }
.filter-btn.active { background: rgba(96,165,250,.15); border-color: rgba(96,165,250,.35); }

/* Cards */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.feature-card { background: #ffffff; border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); width: 100%; }
.feature-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.feature-title { display: flex; align-items: center; gap: 10px; }
.feature-icon { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: white; border-radius: 8px; }
.feature-body { color: var(--muted); font-size: .95rem; }
.feature-description { color: var(--text); margin-bottom: 8px; }
.feature-details { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 8px; }
.detail-item { display: flex; gap: 6px; align-items: center; }
.detail-label { color: var(--muted); font-weight: 600; }
.tables-list { margin: 0 0 0 16px; padding: 0; }
.tables-list li { margin-left: 16px; }
.steps-list, .fields-list, .tips-list { margin-left: 16px; }
.example-box { background: #f8f9fa; border: 1px dashed var(--border); padding: 10px; border-radius: 10px; color: var(--text); margin-bottom: 8px; }

.mark-read { background: transparent; border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.feature-card.read .mark-read { border-color: #22c55e; color: #22c55e; }

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1024px) {
    .main-container { grid-template-columns: 1fr; }
    .manual-scope .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar { position: fixed; left: 16px; right: 16px; top: 70px; height: auto; max-height: 70vh; display: none; }
    .sidebar.active { display: block; }
    .manual-scope .search-box { width: 100%; max-width: 240px; }
}

/* Accordion refinement to match site look */
.manual-scope .accordion-item { background: #ffffff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.manual-scope .accordion-button { background: #ffffff; color: var(--text); font-weight: 600; }
.manual-scope .accordion-button:focus { box-shadow: none; }
.manual-scope .accordion-button:not(.collapsed) { color: var(--text); background: #fff7e0; /* subtle highlight near site secondary */ }
.manual-scope .accordion-body { background: #ffffff; }
