/* ========================================================================
   Manual TalentScore — folha de estilos
   Visual neutro/profissional, com suporte a tema claro/escuro.
   ======================================================================== */

/* -------- Tokens -------- */
:root {
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-elev: #ffffff;
    --bg-code: #f1f5f9;
    --text: #0f172a;
    --text-muted: #475569;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: #dbeafe;

    --admin-bg: #fef3c7;
    --admin-text: #92400e;
    --admin-border: #fbbf24;

    --info-bg: #eff6ff;
    --info-border: #93c5fd;
    --info-text: #1e3a8a;

    --tip-bg: #ecfdf5;
    --tip-border: #6ee7b7;
    --tip-text: #065f46;

    --warn-bg: #fef2f2;
    --warn-border: #fca5a5;
    --warn-text: #991b1b;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);

    --sidebar-width: 300px;
    --content-max: 820px;
    --header-h: 56px;
    --radius: 8px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-elev: #1e293b;
    --bg-code: #0b1220;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --border: #334155;
    --border-strong: #475569;

    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.15);

    --admin-bg: #78350f;
    --admin-text: #fde68a;
    --admin-border: #b45309;

    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: #3b82f6;
    --info-text: #bfdbfe;

    --tip-bg: rgba(16, 185, 129, 0.12);
    --tip-border: #10b981;
    --tip-text: #a7f3d0;

    --warn-bg: rgba(220, 38, 38, 0.14);
    --warn-border: #ef4444;
    --warn-text: #fecaca;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* -------- Reset / base -------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-code);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text);
}

pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.55;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.92rem;
}
th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--text);
}

ul, ol { padding-left: 1.4em; }
li { margin: 4px 0; }

/* -------- Layout -------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--border);
    background: var(--bg-alt);
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 16px 24px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}
.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.sidebar-title small {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-soft);
    margin-top: 2px;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.search {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
}
.search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.toc {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.86rem;
}
.toc > li { margin: 0; }
.toc-group {
    display: block;
    font-weight: 600;
    color: var(--text);
    padding: 8px 8px 4px;
    margin-top: 4px;
    text-decoration: none;
    border-radius: 4px;
}
.toc-group:hover { background: var(--accent-soft); color: var(--accent-hover); text-decoration: none; }
.toc-group.active { color: var(--accent); }

.toc-sub {
    list-style: none;
    padding: 0 0 4px 14px;
    margin: 0 0 4px;
    border-left: 1px solid var(--border);
}
.toc-sub li { margin: 0; }
.toc-sub a {
    display: block;
    padding: 4px 8px;
    color: var(--text-muted);
    border-radius: 4px;
    line-height: 1.3;
}
.toc-sub a:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
    text-decoration: none;
}
.toc-sub a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

.toc .badge-admin { margin-left: 6px; vertical-align: middle; }

.content-wrap {
    padding: 32px 48px 80px;
    overflow-x: hidden;
}
.content {
    max-width: var(--content-max);
    margin: 0 auto;
}

/* -------- Mobile / sidebar drawer -------- */
.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 30;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 18;
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 20;
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.18s ease-out;
        box-shadow: var(--shadow-md);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .backdrop { display: block; }
    .content-wrap { padding: 60px 20px 60px; }
}

/* -------- Tipografia -------- */
.content h1,
.content h2,
.content h3,
.content h4 {
    color: var(--text);
    line-height: 1.25;
    margin-top: 1.6em;
    margin-bottom: 0.5em;
    font-weight: 700;
    scroll-margin-top: 24px;
}
.content h1 {
    font-size: 2rem;
    margin-top: 0.2em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}
.content h2 {
    font-size: 1.45rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.content h3 { font-size: 1.15rem; }
.content h4 { font-size: 1rem; color: var(--text-muted); }

.content p { margin: 0.6em 0 0.9em; }
.content > section { margin-bottom: 32px; }

.lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 0 1.4em;
}

/* -------- Componentes -------- */

/* Selo Admin */
.badge-admin {
    display: inline-block;
    background: var(--admin-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Callouts */
.callout {
    border-left: 4px solid var(--info-border);
    background: var(--info-bg);
    color: var(--info-text);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
}
.callout p { margin: 0.3em 0; }
.callout strong { color: inherit; }
.callout.dica {
    border-left-color: var(--tip-border);
    background: var(--tip-bg);
    color: var(--tip-text);
}
.callout.alerta {
    border-left-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn-text);
}
.callout-title {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

/* Steps numerados */
.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}
.steps > li {
    position: relative;
    padding: 8px 0 8px 44px;
    counter-increment: step;
    margin: 6px 0;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Field label */
.field {
    font-weight: 600;
    color: var(--text);
    background: var(--bg-alt);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.93em;
}

/* Permission table */
.perm-table td:first-child { font-weight: 500; }
.perm-table .yes { color: #16a34a; font-weight: 700; }
.perm-table .no { color: #dc2626; font-weight: 700; }
[data-theme="dark"] .perm-table .yes { color: #4ade80; }
[data-theme="dark"] .perm-table .no { color: #f87171; }

/* -------- Mockups esquemáticos -------- */
.mockup {
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-alt);
    padding: 14px;
    margin: 22px 0;
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
}
.mockup-caption {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}
.mock-window {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.mock-titlebar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.mock-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #cbd5e1;
}
.mock-url {
    margin-left: 12px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-soft);
}
.mock-body { padding: 14px; }
.mock-row { display: flex; gap: 12px; align-items: stretch; }
.mock-col { flex: 1; min-width: 0; }
.mock-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--bg);
    margin-bottom: 8px;
}
.mock-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-soft); letter-spacing: 0.05em; margin-bottom: 4px; }
.mock-h { font-weight: 700; font-size: 0.95rem; }
.mock-sub { color: var(--text-muted); font-size: 0.82rem; }
.mock-score { font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; display: inline-block; }
.mock-score.green { background: #dcfce7; color: #166534; }
.mock-score.amber { background: #fef3c7; color: #92400e; }
.mock-score.red { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .mock-score.green { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .mock-score.amber { background: #78350f; color: #fde68a; }
[data-theme="dark"] .mock-score.red { background: #7f1d1d; color: #fecaca; }
.mock-btn {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-right: 4px;
}
.mock-btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.mock-input {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    background: var(--bg-alt);
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 6px;
    display: block;
    width: 100%;
}
.mock-textarea {
    min-height: 50px;
}
.mock-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.72rem;
    margin-right: 4px;
    margin-bottom: 4px;
}
.mock-pill.muted { background: var(--bg-alt); color: var(--text-soft); border: 1px solid var(--border); }

/* -------- Hide TOC items during search -------- */
.toc .hidden { display: none; }
.toc-group.empty { display: none; }

/* -------- Print -------- */
@media print {
    .sidebar, .menu-toggle, .backdrop, .theme-toggle { display: none !important; }
    .app { grid-template-columns: 1fr; }
    .content-wrap { padding: 0; }
    a { color: inherit; text-decoration: none; }
    .content > section { page-break-inside: avoid; }
}
