:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;

    --text: #1f2937;
    --text-soft: #64748b;

    --border: #e2e8f0;

    --primary: #2563eb;
    --primary-soft: #eff6ff;

    --warning-bg: #fff7ed;
    --warning-border: #fdba74;

    --sidebar-width: 260px;
    --toc-width: 220px;
    --topbar-height: 68px;

    --radius: 10px;

    --shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.04);
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}


a {
    color: var(--primary);
    text-decoration: none;
}


a:hover {
    text-decoration: underline;
}


/* ==========================================================
   LAYOUT
========================================================== */

.manual-layout {
    display: grid;

    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr)
        var(--toc-width);

    grid-template-rows:
        var(--topbar-height)
        1fr;

    min-height: 100vh;
}


/* ==========================================================
   TOPO
========================================================== */

.topbar {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    gap: 30px;

    height: var(--topbar-height);

    padding: 0 28px;

    border-bottom: 1px solid var(--border);

    background: rgba(255, 255, 255, 0.97);

    position: sticky;
    top: 0;

    z-index: 100;
}


.brand {
    width: calc(var(--sidebar-width) - 28px);
}


.brand-link {
    display: flex;
    flex-direction: column;

    color: var(--text);
    text-decoration: none;
}


.brand-title {
    font-size: 18px;
    font-weight: 700;
}


.brand-subtitle {
    font-size: 12px;
    color: var(--text-soft);
}


.topbar-search {
    flex: 1;

    max-width: 620px;
}


.topbar-search input {
    width: 100%;

    padding: 11px 14px;

    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: 14px;

    background: var(--bg-soft);
}


.topbar-search input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;

    background: #fff;
}


.topbar-actions {
    margin-left: auto;
}


/* ==========================================================
   SIDEBAR
========================================================== */

.sidebar {
    grid-column: 1;
    grid-row: 2;

    height: calc(100vh - var(--topbar-height));

    overflow-y: auto;

    padding: 26px 20px;

    border-right: 1px solid var(--border);

    position: sticky;
    top: var(--topbar-height);
}


.menu-group {
    margin-bottom: 28px;
}


.menu-title {
    margin: 0 0 8px;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;

    color: var(--text-soft);
}


.menu-group ul {
    margin: 0;
    padding: 0;

    list-style: none;
}


.menu-group li {
    margin: 3px 0;
}


.menu-group a {
    display: block;

    padding: 8px 10px;

    border-radius: 7px;

    color: #334155;

    font-size: 14px;
}


.menu-group a:hover {
    background: var(--bg-soft);

    text-decoration: none;
}


.menu-group a.active {
    background: var(--primary-soft);

    color: var(--primary);

    font-weight: 600;
}


.status-badge {
    margin-left: 6px;

    font-size: 10px;

    color: var(--text-soft);
}


/* ==========================================================
   CONTEÚDO
========================================================== */

.content {
    grid-column: 2;
    grid-row: 2;

    width: 100%;
    max-width: 960px;

    margin: 0 auto;

    padding: 36px 50px 80px;
}


.breadcrumb {
    display: flex;
    gap: 8px;

    margin-bottom: 32px;

    font-size: 13px;
    color: var(--text-soft);
}


.page-header {
    padding-bottom: 34px;

    border-bottom: 1px solid var(--border);
}


.page-eyebrow,
.section-label {
    margin: 0 0 6px;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.08em;

    color: var(--primary);
}


.page-header h1 {
    margin: 0 0 14px;

    font-size: 38px;
    line-height: 1.2;
}


.page-description {
    max-width: 720px;

    margin: 0;

    font-size: 18px;

    color: var(--text-soft);
}


.doc-section {
    padding: 42px 0;

    border-bottom: 1px solid var(--border);
}


.doc-section h2 {
    margin-top: 0;

    font-size: 27px;
}


.doc-section h3 {
    font-size: 18px;
}


.doc-section p {
    max-width: 780px;
}


/* ==========================================================
   CARDS
========================================================== */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;

    margin-top: 24px;
}


.card {
    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: #fff;

    box-shadow: var(--shadow);
}


.card h3 {
    margin: 8px 0;
}


.card p {
    color: var(--text-soft);
}


.card-icon {
    font-size: 12px;
    font-weight: 700;

    color: var(--primary);
}


.card-featured {
    border-color: #bfdbfe;
}


.card-disabled {
    background: var(--bg-soft);
}


.card-tag {
    display: inline-block;

    padding: 3px 8px;

    border-radius: 999px;

    font-size: 11px;

    background: var(--primary-soft);
    color: var(--primary);
}


/* ==========================================================
   DESTAQUES
========================================================== */

.callout {
    margin-top: 24px;

    padding: 18px 20px;

    border-left: 4px solid;

    border-radius: 6px;
}


.callout-info {
    background: var(--primary-soft);
    border-color: var(--primary);
}


.callout-title {
    margin-bottom: 4px;

    font-weight: 700;
}


/* ==========================================================
   FUNCIONALIDADES
========================================================== */

.feature-list {
    margin-top: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    overflow: hidden;
}


.feature-item {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);

    color: var(--text);
}


.feature-item:last-child {
    border-bottom: 0;
}


.feature-item:hover {
    background: var(--bg-soft);

    text-decoration: none;
}


.feature-item h3 {
    margin: 0 0 3px;
}


.feature-item p {
    margin: 0;

    font-size: 14px;

    color: var(--text-soft);
}


/* ==========================================================
   TAREFAS
========================================================== */

.task-list {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 20px;
}


.task-list a {
    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--bg-soft);

    color: var(--text);
}


.task-list a:hover {
    border-color: #bfdbfe;

    background: var(--primary-soft);

    text-decoration: none;
}


/* ==========================================================
   GLOSSÁRIO
========================================================== */

.glossary-preview > div {
    padding: 15px 0;

    border-bottom: 1px solid var(--border);
}


.glossary-preview dt {
    font-weight: 700;
}


.glossary-preview dd {
    margin: 5px 0 0;

    color: var(--text-soft);
}


.validation {
    display: inline-block;

    margin-left: 5px;

    font-size: 12px;

    color: #92400e;
}


/* ==========================================================
   AJUDA
========================================================== */

.help-box {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 30px;

    padding: 28px;

    border-radius: var(--radius);

    background: var(--bg-soft);
}


.help-actions {
    display: flex;
    flex-direction: column;

    gap: 10px;

    min-width: 190px;
}


.button-primary,
.button-secondary,
.button-link {
    display: inline-block;

    padding: 10px 14px;

    border-radius: 7px;

    font-weight: 600;
}


.button-primary,
.button-link {
    background: var(--primary);

    color: #fff;
}


.button-secondary {
    border: 1px solid var(--border);

    background: #fff;

    color: var(--text);
}


.button-primary:hover,
.button-link:hover,
.button-secondary:hover {
    text-decoration: none;
}


/* ==========================================================
   ÍNDICE LATERAL
========================================================== */

.toc {
    grid-column: 3;
    grid-row: 2;

    height: calc(100vh - var(--topbar-height));

    padding: 36px 24px;

    position: sticky;
    top: var(--topbar-height);
}


.toc-title {
    margin: 0 0 10px;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;

    color: var(--text-soft);
}


.toc ul {
    margin: 0;
    padding: 0;

    list-style: none;
}


.toc li {
    margin-bottom: 8px;
}


.toc a {
    font-size: 13px;

    color: var(--text-soft);
}


.toc a:hover {
    color: var(--primary);

    text-decoration: none;
}


/* ==========================================================
   NAVEGAÇÃO INFERIOR
========================================================== */

.page-navigation {
    display: flex;

    justify-content: space-between;

    padding-top: 32px;
}


.next-page {
    display: flex;
    flex-direction: column;

    text-align: right;
}


.next-page span {
    font-size: 12px;
    color: var(--text-soft);
}


/* ==========================================================
   ACESSIBILIDADE
========================================================== */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}


/* ==========================================================
   RESPONSIVIDADE
========================================================== */

@media (max-width: 1100px) {

    .manual-layout {
        grid-template-columns:
            var(--sidebar-width)
            minmax(0, 1fr);
    }

    .toc {
        display: none;
    }

}


@media (max-width: 760px) {

    .manual-layout {
        display: block;
    }

    .topbar {
        position: relative;

        height: auto;

        flex-wrap: wrap;

        padding: 18px;
    }

    .brand {
        width: auto;
    }

    .topbar-search {
        order: 3;

        width: 100%;
        max-width: none;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 28px 20px 60px;
    }

    .page-header h1 {
        font-size: 31px;
    }

    .help-box {
        flex-direction: column;
        align-items: stretch;
    }

}

/* ==========================================================
   TABELAS
========================================================== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;

    margin-top: 22px;
    margin-bottom: 24px;

    border: 1px solid var(--border);
    border-radius: var(--radius);
}


table {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}


thead {
    background: var(--bg-soft);
}


th,
td {
    padding: 13px 16px;

    text-align: left;
    vertical-align: top;

    border-bottom: 1px solid var(--border);
}


th {
    font-weight: 700;
    color: #334155;
}


tbody tr:last-child td {
    border-bottom: 0;
}


tbody tr:hover {
    background: #f8fafc;
}


/* ==========================================================
   TASK LIST COM TEXTO
========================================================== */

.task-list span {
    display: inline-block;

    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--bg-soft);

    color: var(--text);

    font-size: 14px;
}


/* ==========================================================
   LINKS DA NAVEGAÇÃO INFERIOR
========================================================== */

.page-navigation > a {
    display: flex;
    flex-direction: column;

    color: var(--text);
}


.page-navigation > a:hover {
    text-decoration: none;
}


.page-navigation > a span {
    font-size: 12px;

    color: var(--text-soft);
}