/* =============================================================================
   Central de Ajuda Brist · paleta verde da marca (espelha brist-ui.css do ERP)
   ============================================================================= */
:root {
    --brist-50:  #e8f5e9;
    --brist-100: #c8e6c9;
    --brist-200: #a5d6a7;
    --brist-300: #81c784;
    --brist-400: #66bb6a;
    --brist-500: #4caf50;
    --brist-600: #43a047;
    --brist-700: #388e3c;
    --brist-800: #2e7d32;
    --brist-900: #1b5e20;
    --ink:       #1f2d24;
    --ink-soft:  #6c7a85;
    --bg:        #f4f7f5;
    --card:      #ffffff;
    --line:      #e3eae5;
    --radius:    .7rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 2px 8px rgba(16, 40, 22, .06), 0 1px 2px rgba(16, 40, 22, .04);
    --shadow-md: 0 6px 18px rgba(16, 40, 22, .08), 0 2px 6px rgba(16, 40, 22, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--brist-700); text-decoration: none; }
a:hover { color: var(--brist-800); }
img { max-width: 100%; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }

/* ------------------------------------------------------------------ topbar */
.topbar {
    background: linear-gradient(120deg, var(--brist-900) 0%, var(--brist-700) 55%, var(--brist-500) 100%);
    color: #fff;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover, .brand:hover .brand-title { color: #fff; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-divider { width: 1px; height: 24px; background: rgba(255, 255, 255, .35); }
.brand-title { font-size: 1.05rem; font-weight: 500; opacity: .95; }
.topbar-nav { display: flex; align-items: center; gap: 10px; }
.topbar-user { font-size: .85rem; opacity: .9; margin-right: 4px; white-space: nowrap; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: .5rem;
    border: 0;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: .15s ease;
    white-space: nowrap;
}
.btn-light { background: rgba(255, 255, 255, .92); color: var(--brist-800); }
.btn-light:hover { background: #fff; color: var(--brist-900); }
.btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.btn-primary { background: var(--brist-600); color: #fff; }
.btn-primary:hover { background: var(--brist-700); color: #fff; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------- hero */
.hero { text-align: center; padding: 34px 20px 58px; }
.hero h1 { margin: 0 0 22px; font-size: 1.7rem; font-weight: 700; }
.searchbox {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
    margin: 0 auto;
    background: #fff;
    border-radius: .6rem;
    padding: 4px 16px;
    box-shadow: var(--shadow-md);
    color: var(--ink-soft);
}
.searchbox input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px 0;
    font-size: 1rem;
    background: transparent;
    color: var(--ink);
}
.searchbox-inline { margin: 18px 0 26px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- seções */
.main { padding: 40px 20px 60px; flex: 1; width: 100%; }
.section { margin-bottom: 42px; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.section-title .star { color: var(--brist-500); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: .15s ease;
    display: flex;
    color: var(--ink);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--ink); }

.card-row { align-items: center; justify-content: space-between; padding: 18px 20px; gap: 14px; }
.card-row-title { font-weight: 600; }
.chevron { color: var(--brist-500); font-size: 1.3rem; line-height: 1; }

.card-category { padding: 20px; gap: 16px; align-items: flex-start; }
.cat-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--brist-50);
    border-radius: .8rem;
}
.cat-icon-lg { width: 64px; height: 64px; font-size: 2rem; }
.cat-body { display: flex; flex-direction: column; gap: 6px; }
.cat-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); line-height: 1.3; }
.card-category:hover .cat-title { color: var(--brist-800); }
.cat-desc { color: var(--ink-soft); font-size: .875rem; }
.cat-count { color: var(--brist-700); font-size: .78rem; font-weight: 600; }

/* -------------------------------------------------------------- categoria */
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin-bottom: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.category-head { display: flex; gap: 18px; align-items: center; margin-bottom: 26px; }
.category-head h1 { margin: 0; font-size: 1.5rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card-article { align-items: center; justify-content: space-between; padding: 16px 20px; gap: 14px; }
.card-article-title { font-weight: 600; display: block; }
.card-article-summary { color: var(--ink-soft); font-size: .85rem; display: block; margin-top: 2px; }
.badge-draft {
    background: #fff4dc;
    color: #9a6b00;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    vertical-align: middle;
}

/* ----------------------------------------------------------------- artigo */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .article-wrap { grid-template-columns: 1fr; } .article-aside { order: 2; } }
.card-flat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.article { padding: 34px 38px 40px; }
@media (max-width: 600px) { .article { padding: 24px 20px; } }
.article h1 { margin: 0 0 8px; font-size: 1.55rem; }
.article-summary { color: var(--ink-soft); margin: 0 0 6px; }
.article-meta { font-size: .78rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.article-body h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.article-body h3 { font-size: 1rem; margin: 22px 0 8px; }
.article-body p { margin: 10px 0; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body code { background: var(--brist-50); border-radius: 4px; padding: 1px 6px; font-size: .85em; }
.article-body .dica {
    background: var(--brist-50);
    border-left: 4px solid var(--brist-500);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 12px 16px;
    margin: 16px 0;
}
.article-body .atencao {
    background: #fff8e6;
    border-left: 4px solid #f0b400;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 12px 16px;
    margin: 16px 0;
}

.article-aside { position: sticky; top: 20px; }
.aside-title { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 10px; }
.aside-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.aside-list a { display: block; padding: 7px 10px; border-radius: .45rem; font-size: .875rem; color: var(--ink); }
.aside-list a:hover { background: var(--brist-50); }
.aside-list .active a { background: var(--brist-50); color: var(--brist-800); font-weight: 600; }

/* ------------------------------------------------------- prints do manual */
figure.print { margin: 20px 0; }
figure.print img {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: block;
}
figure.print figcaption { font-size: .78rem; color: var(--ink-soft); text-align: center; margin-top: 8px; }
.print-pending-box {
    border: 2px dashed var(--brist-300);
    background: repeating-linear-gradient(45deg, #fbfdfb, #fbfdfb 12px, #f2f8f3 12px, #f2f8f3 24px);
    border-radius: var(--radius);
    padding: 34px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    color: var(--ink-soft);
}
.print-pending-tag {
    background: var(--brist-500);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 3px 10px;
    border-radius: 99px;
}
.print-pending-box code { background: #fff; border: 1px solid var(--line); }

/* ------------------------------------------------------------------ login */
.login-wrap { display: flex; justify-content: center; padding: 30px 0 60px; }
.login-card { width: 100%; max-width: 420px; padding: 36px; text-align: center; }
.login-logo { height: 40px; margin-bottom: 14px; }
.login-card h1 { font-size: 1.25rem; margin: 0 0 6px; }
.login-card form { text-align: left; margin-top: 18px; }
.login-card label { display: block; font-size: .8rem; font-weight: 600; margin: 14px 0 4px; }
.login-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: .5rem;
    font-size: .95rem;
    outline: 0;
}
.login-card input:focus { border-color: var(--brist-400); box-shadow: 0 0 0 3px rgba(76, 175, 80, .18); }
.login-card .btn-block { margin-top: 20px; }
.alert {
    background: #fdecec;
    color: #b02a2a;
    border-radius: .5rem;
    padding: 10px 14px;
    font-size: .85rem;
    margin-top: 14px;
}

/* ----------------------------------------------------------------- status */
.status-summary { padding: 22px 26px; margin-bottom: 30px; }
.status-kpis { display: flex; gap: 34px; flex-wrap: wrap; margin-bottom: 14px; }
.status-kpis div { display: flex; flex-direction: column; }
.status-kpis strong { font-size: 1.4rem; color: var(--brist-800); }
.status-kpis span { font-size: .78rem; color: var(--ink-soft); }
.progress { height: 8px; background: var(--brist-50); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brist-500), var(--brist-700)); }
.status-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .875rem; }
.status-table th, .status-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.status-table th { background: var(--brist-50); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--brist-900); }
.status-table tr:last-child td { border-bottom: 0; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill-ok { background: var(--brist-50); color: var(--brist-800); }
.pill-draft { background: #eef1f4; color: #5a6b78; }
.pill-warn { background: #fff4dc; color: #9a6b00; }

/* ------------------------------------------------------------------ vazio */
.empty {
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 34px;
    text-align: center;
    color: var(--ink-soft);
}

/* ----------------------------------------------------------------- rodapé */
.footer {
    margin-top: auto;
    background: linear-gradient(120deg, #12281a 0%, var(--brist-900) 60%, #1e5424 100%);
    color: rgba(255, 255, 255, .78);
}
.footer a { color: rgba(255, 255, 255, .85); }
.footer a:hover { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 48px; padding: 40px 20px 30px; flex-wrap: wrap; }
.footer-brand { max-width: 460px; }
.footer-brand p { margin: 14px 0 0; font-size: .85rem; line-height: 1.7; }
.footer-logo { height: 28px; display: block; }
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: .875rem; min-width: 200px; }
.footer-links-title {
    text-transform: uppercase;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 3px;
}
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); }
.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    gap: 8px 20px;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: .78rem;
    color: rgba(255, 255, 255, .55);
}
