﻿/* ——— Reset / Base ——————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; }

:root {
    /* ── IFS Food Panificacao Basic — Crust Brown palette ── */
    --color-primary:    #7A4A1E;   /* blue-700 */
    --color-primary-dk: #4A2210;   /* blue-800 */
    --color-accent:     #D4960F;   /* blue-400 */
    --color-bg:         #FDF6E8;   /* neutral-50 */
    --color-surface:    #FDF9F5;   /* white */
    --color-border:     #E8DDD5;   /* neutral-100 */
    --color-text:       #382518;   /* neutral-800 */
    --color-muted:      #8A6A52;   /* neutral-400 */
    --color-error:      #B71C1C;   /* sem-fail */
    --color-success:    #1B5E20;   /* sem-pass */

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Syne', var(--font-sans);
    --font-mono: 'DM Mono', monospace;

    --shadow-sm: 0 1px 4px rgba(47, 24, 8,.07);
    --shadow-md: 0 4px 16px rgba(47, 24, 8,.12);
}

html, body {
    margin: 0; padding: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.6;
}

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

/* ——— Layout ——————————————————————————————————— */
.ml-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ml-main {
    flex: 1;
    padding: 0;
}

/* ——— Nav ——————————————————————————————————————— */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: .5rem; }
.nav-brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }

.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link   { font-weight: 500; color: var(--color-text); }
.nav-link:hover { color: var(--color-primary); }

.nav-btn { padding: .45rem 1.1rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: .15s; }
.nav-btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.nav-btn-primary:hover { background: var(--color-primary-dk); }
.nav-btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.nav-btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ——— Buttons ——————————————————————————————————— */
.btn-primary, .btn-outline {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 600;
    cursor: pointer; border: 2px solid transparent;
    transition: .15s;
}
.btn-primary  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dk); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-sm  { padding: .3rem .8rem; font-size: .8rem; }
.btn-icon { background: none; border: none; cursor: pointer; padding: .25rem; font-size: 1rem; }

/* ——— Forms ——————————————————————————————————— */
.form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-control {
    padding: .55rem .85rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    background: var(--color-surface);
    transition: border-color .15s;
    width: 100%;
}
.form-control:focus { outline: none; border-color: var(--color-primary); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.form-error { color: var(--color-error); font-size: .85rem; }
.form-success { color: var(--color-success); font-size: .85rem; }
.input-pw-wrap { position: relative; }
.input-pw-wrap .form-control { padding-right: 2.5rem; }
.btn-pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; margin-bottom: .35rem; }
.validation-message { color: var(--color-error); font-size: .8rem; }

/* ——— Modal ——————————————————————————————————— */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
}
.modal-box {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%,-50%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    width: min(560px, 95vw);
    z-index: 201;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box--sm { width: min(380px, 95vw); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title  { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin: 0; }
.modal-close  { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--color-muted); padding: .25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }

/* ——— Home ——————————————————————————————————— */
.home-hero {
    min-height: 60vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
}
.home-eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.home-title   { font-family: var(--font-display); font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 800; margin: .5rem 0; }
.home-sub     { font-size: 1.1rem; max-width: 520px; margin: 0 auto; opacity: .9; }

/* ——— Homepage — secções genéricas ——————————————————————————— */
.section         { padding: 5rem 2rem; }
.section-dark    { background: #2F1808; color: #FDF6E8; }
.section-alt     { background: #FDF6E8; }
.section-inner   { max-width: 1100px; margin: 0 auto; }
.section-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent); margin-bottom: .5rem; }
.section-title   { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 1rem; letter-spacing: -.5px; }
.section-dark .section-title  { color: #FDF6E8; }
.section-dark .section-eyebrow { color: #D4960F; }

/* ——— Homepage — planos ——————————————————————————————————————— */
.planos-intro  { font-size: 1.05rem; color: var(--color-muted); margin-bottom: 2.5rem; max-width: 560px; }
.planos-grid   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
.plano-card    { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: 14px; padding: 2rem 1.75rem; display: flex; flex-direction: column; gap: 1.5rem; box-shadow: var(--shadow-sm); position: relative; }
.plano-card--destaque { border-color: var(--color-primary); box-shadow: 0 8px 32px rgba(122, 74, 30,.15); }
.plano-badge   { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--color-primary); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 14px; border-radius: 999px; white-space: nowrap; }
.plano-nome    { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--color-text); letter-spacing: -.3px; }
.plano-card--destaque .plano-nome { color: var(--color-primary); }
.plano-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.plano-features li { display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; color: var(--color-text); line-height: 1.5; }
.plano-check   { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: transparent; border: 1.5px solid #D4960F; }
.plano-check::after { content: ''; display: block; width: 5px; height: 9px; border: 2px solid #D4960F; border-top: none; border-left: none; transform: rotate(45deg) translate(-1px, -1px); }
.plano-check--consulta { background: var(--color-primary); border: none; }
.plano-check--consulta::after { border-color: #fff; }
.plano-features li:has(.plano-check--consulta) { color: var(--color-muted); font-style: italic; }
.plano-btn     { display: block; text-align: center; padding: .75rem 1.5rem; background: var(--color-primary); color: #fff; border: 2px solid var(--color-primary); border-radius: 5px; font-size: .9rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.plano-btn:hover { background: #A0622A; border-color: #A0622A; text-decoration: none; color: #fff; }
.plano-btn--outline { background: transparent; color: var(--color-primary); }
.plano-btn--outline:hover { background: var(--color-primary); color: #fff; }
@media (max-width: 860px) { .planos-grid { grid-template-columns: 1fr; max-width: 420px; } }

/* ——— Dashboard ——————————————————————————————— */
.db-wrapper  { padding: 2rem; max-width: 1100px; margin: 0 auto; }
.db-header   { margin-bottom: 1.5rem; }
.db-eyebrow  { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--color-muted); }
.db-title    { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin: .25rem 0 0; }
.db-badge    { display: inline-block; margin-top: .5rem; padding: .25rem .75rem; background: var(--color-primary); color: #fff; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.db-tabs     { display: flex; gap: .5rem; border-bottom: 2px solid var(--color-border); margin-bottom: 1.5rem; }
.db-tab      { padding: .6rem 1.2rem; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--color-muted); transition: .15s; }
.db-tab--active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.db-tab         { display: inline-flex; align-items: center; gap: 6px; }
.db-tab-count   { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--color-primary); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.db-loading  { padding: 3rem; text-align: center; color: var(--color-muted); }

/* ——— Card ——————————————————————————————————— */
.card        { background: var(--color-surface); border-radius: var(--radius-md); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border); }
.card-title  { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin: 0; }
.card-body   { padding: 1.25rem; }

/* ——— Table ——————————————————————————————————— */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-muted); padding: .5rem .75rem; border-bottom: 2px solid var(--color-border); }
.table td { padding: .6rem .75rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }

/* ——— Badges ——————————————————————————————————— */
.badge       { padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-green { background: #d4f4e0; color: #1a7a3c; }
.badge-red   { background: #fde8e8; color: #c0392b; }

/* ——— Empty state ——————————————————————————————— */
.empty-state { text-align: center; padding: 2rem; color: var(--color-muted); font-size: .9rem; }

/* ——— Error page ——————————————————————————————— */
.error-page { text-align: center; padding: 6rem 2rem; }
.error-page h1 { font-family: var(--font-display); font-size: 6rem; font-weight: 800; color: var(--color-primary); margin: 0; }

/* ——— Blazor reconnect ——————————————————————— */
#blazor-error-ui {
    background: #b32121;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    color: white; display: none;
    left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--color-error); }

/* ——— Dashboard user info ————————————————————— */
.db-user-info     { margin-top: .5rem; }
.db-badge--perfil { background: rgba(255,255,255,.15); color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.db-empty         { padding: 3rem; text-align: center; color: var(--color-muted); }

/* ——— Perfil views ——————————————————————————— */
.perfil-view        { }
.perfil-view-header { margin-bottom: 1.5rem; }
.perfil-view-header h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem; }
.perfil-view-sub    { color: var(--color-muted); margin: 0; font-size: .95rem; }

.perfil-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.module-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex; flex-direction: column; gap: .6rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, border-color .15s, transform .15s;
    text-align: left;
}
.module-card--soon      { opacity: .75; cursor: default; }
.module-card--active    { cursor: pointer; border-color: var(--color-primary); }
.module-card--active:hover { box-shadow: var(--shadow-md); border-color: var(--color-accent); transform: translateY(-2px); }
.module-svg             { width: 36px; height: 36px; color: var(--color-primary); flex-shrink: 0; }
.module-card h3         { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin: 0; color: var(--color-text); }
.module-card p          { font-size: .85rem; color: var(--color-muted); margin: 0; flex: 1; line-height: 1.5; }
.module-badge           { align-self: flex-start; font-family: var(--font-mono, monospace); font-size: .7rem; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.module-badge--soon     { background: #fff3e0; color: #e65100; }
.module-badge--go       { background: #d4f0df; color: #2F1808; }
.badge-orange           { background: #fff3e0; color: #e65100; }

/* ——— Páginas de erro (Error + NotFound) ————————————————————— */
.err-wrapper { min-height: calc(100vh - 52px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: #FDF9F5; }
.err-card    { max-width: 480px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.err-icon svg { width: 64px; height: 64px; }
.err-code    { font-family: var(--font-display); font-size: 96px; font-weight: 800; letter-spacing: -4px; line-height: 1; color: #DDE7E0; }
.err-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: #6A8570; margin-top: 4px; }
.err-title   { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: #0B2214; margin: 0; letter-spacing: -.3px; }
.err-sub     { font-size: 15px; font-weight: 300; color: #3D5543; line-height: 1.7; margin: 0; max-width: 380px; }
.err-request-id   { display: flex; align-items: center; gap: 10px; background: #FDF6E8; border: 1px solid #AADFC0; border-radius: 6px; padding: 8px 14px; margin-top: 4px; }
.err-request-lbl  { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #3A7055; white-space: nowrap; }
.err-request-code { font-family: var(--font-mono); font-size: 11px; color: #2F1808; word-break: break-all; }
.err-actions      { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.err-btn-primary  { display: inline-flex; align-items: center; padding: 10px 24px; background: #7A4A1E; color: #FDF9F5; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s; }
.err-btn-primary:hover { background: #3DB36D; text-decoration: none; }
.err-btn-secondary { display: inline-flex; align-items: center; padding: 10px 24px; background: transparent; color: #3A7055; border: 1.5px solid #C2D0C6; border-radius: 6px; font-size: 14px; font-weight: 400; cursor: pointer; transition: border-color .15s, color .15s; }
.err-btn-secondary:hover { border-color: #8BB5A0; color: #0B2214; }

/* ——— Auditoria — índice e capítulos ————————————————————————— */
.aud-wrapper  { max-width: 820px; margin: 0 auto; padding: 36px 48px 80px; }
.aud-back     { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-muted); text-decoration: none; margin-bottom: 20px; transition: color .15s; }
.aud-back svg { width: 14px; height: 14px; }
.aud-back:hover { color: var(--color-primary); }
.aud-eyebrow  { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--color-muted); display: block; margin-bottom: 4px; }
.aud-title    { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--color-text); margin: 0; letter-spacing: -.3px; }
.aud-header   { margin-bottom: 24px; }
.aud-intro p  { font-size: 14px; color: var(--color-muted); line-height: 1.7; margin-bottom: 28px; max-width: 560px; }
.aud-chapters { display: flex; flex-direction: column; gap: 8px; }
.aud-chapter-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 10px; text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.aud-chapter-card:hover { border-color: var(--color-primary); box-shadow: 0 4px 16px rgba(122, 74, 30,.08); transform: translateX(3px); text-decoration: none; }
.aud-chapter-num  { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--color-border); min-width: 36px; text-align: center; line-height: 1; }
.aud-chapter-card:hover .aud-chapter-num { color: var(--color-primary); }
.aud-chapter-info { flex: 1; }
.aud-chapter-title { font-size: 15px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.aud-chapter-sub   { font-size: 12px; color: var(--color-muted); }
.aud-chapter-arrow { width: 16px; height: 16px; color: var(--color-border); flex-shrink: 0; transition: color .15s; }
.aud-chapter-card:hover .aud-chapter-arrow { color: var(--color-primary); }
@media (max-width: 600px) { .aud-wrapper { padding: 24px 20px 60px; } }

/* ——— Relatórios — score por capítulo ————————————————————————— */
.rel-wrapper { max-width: 900px; margin: 0 auto; padding: 36px 48px 80px; }
.rel-header  { margin-bottom: 24px; }
.rel-eyebrow { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--color-muted); display: block; margin-bottom: 4px; }
.rel-title      { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--color-text); margin: 0; letter-spacing: -.3px; }
.rel-title-nome { font-size: 20px; font-weight: 400; color: var(--color-muted); letter-spacing: 0; }
.rel-loading, .rel-empty { padding: 48px; text-align: center; color: var(--color-muted); }
.rel-empty p { margin: 0 0 16px; }
.rel-btn-primary { display: inline-flex; align-items: center; padding: 10px 24px; background: #7A4A1E; color: #FDF9F5; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; }
.rel-btn-primary:hover { background: #3DB36D; text-decoration: none; }

/* Score hero */
.rel-score-hero { display: flex; align-items: center; gap: 28px; padding: 28px 32px; border-radius: 14px; margin-bottom: 28px; color: #FDF9F5; flex-wrap: wrap; }
.rel-nivel--higher     { background: linear-gradient(135deg, #2F1808, #7A4A1E); }
.rel-nivel--foundation { background: linear-gradient(135deg, #A0622A, #D4960F); }
.rel-nivel--fail       { background: linear-gradient(135deg, #7a1f1f, #b71c1c); }
.rel-score-num  { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.rel-score-num span { font-size: 28px; font-weight: 700; opacity: .8; margin-left: 2px; }
.rel-score-side { flex: 1; min-width: 220px; }
.rel-nivel-badge { display: inline-block; font-family: var(--font-display); font-size: 18px; font-weight: 700; padding: 4px 14px; background: rgba(255,255,255,.18); border-radius: 999px; margin-bottom: 8px; }
.rel-score-meta { font-size: 13px; opacity: .9; }
.rel-ko-flag    { font-weight: 600; }
.rel-incompleto { margin-top: 8px; font-size: 12px; background: rgba(255,255,255,.15); padding: 6px 10px; border-radius: 6px; display: inline-block; }

/* Tabela */
.rel-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 10px; }
.rel-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.rel-table thead th { background: var(--color-surface); color: var(--color-muted); font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 12px 10px; text-align: center; border-bottom: 1.5px solid var(--color-border); }
.rel-th-cap { text-align: left !important; }
.rel-th-res { text-align: right !important; min-width: 140px; }
.rel-table tbody td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.rel-table tbody tr:last-child td { border-bottom: none; }
.rel-row-vazio td { opacity: .5; }
.rel-td-cap { text-align: left !important; display: flex; flex-direction: column; gap: 2px; }
.rel-cap-num { font-family: var(--font-display); font-weight: 800; color: var(--color-primary); }
.rel-cap-titulo { font-size: 12px; color: var(--color-muted); }
.rel-c-a { color: #065f46; font-weight: 600; }
.rel-c-b { color: #1e40af; font-weight: 600; }
.rel-c-c { color: #92400e; font-weight: 600; }
.rel-c-d { color: #991b1b; font-weight: 600; }
.rel-c-na { color: var(--color-muted); }
.rel-c-ko { color: #991b1b; font-weight: 800; background: #fde8e8; border-radius: 4px; }
.rel-td-res { text-align: right !important; }
.rel-cap-bar { display: inline-block; width: 80px; height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.rel-cap-fill { height: 100%; background: #7A4A1E; border-radius: 3px; }
.rel-cap-pct { font-family: var(--font-mono, monospace); font-weight: 600; font-size: 12px; }
.rel-cap-na { color: var(--color-muted); }
.rel-note { font-size: 12px; color: var(--color-muted); line-height: 1.7; margin-top: 16px; }
@media (max-width: 600px) { .rel-wrapper { padding: 24px 20px 60px; } .rel-score-num { font-size: 48px; } }

/* ——— Não-Conformidades / Plano de Ações ————————————————————— */
.nc-wrapper { max-width: 900px; margin: 0 auto; padding: 36px 48px 80px; }
.nc-header  { margin-bottom: 24px; }
.nc-eyebrow { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--color-muted); display: block; margin-bottom: 4px; }
.nc-title   { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--color-text); margin: 0 0 6px; letter-spacing: -.3px; }
.nc-sub     { font-size: 14px; color: var(--color-muted); margin: 0; max-width: 560px; line-height: 1.6; }
.nc-loading, .nc-empty { padding: 48px; text-align: center; color: var(--color-muted); }
.nc-empty svg { width: 48px; height: 48px; margin-bottom: 12px; }
.nc-empty p { margin: 0 0 16px; }
.nc-btn-primary { display: inline-flex; align-items: center; padding: 10px 24px; background: #7A4A1E; color: #FDF9F5; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; }
.nc-btn-primary:hover { background: #3DB36D; text-decoration: none; }
.nc-summary { font-size: 14px; color: var(--color-text); margin-bottom: 18px; }
.nc-summary strong { color: #b71c1c; font-size: 18px; }
.nc-ko-count { color: #b71c1c; font-weight: 600; }

/* Card de NC */
.nc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 20px 22px; margin-bottom: 14px; }
.nc-card--ko { border-color: #fca5a5; box-shadow: 0 0 0 1px rgba(252,165,165,.4); }
.nc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.nc-id { display: flex; flex-direction: column; gap: 2px; }
.nc-codigo { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--color-primary); }
.nc-cap { font-size: 12px; color: var(--color-muted); }
.nc-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nc-class { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 700; width: 26px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; }
.nc-class--b { background: #dbeafe; color: #1e40af; }
.nc-class--c { background: #fef3c7; color: #92400e; }
.nc-class--d { background: #fde8e8; color: #991b1b; }
.nc-estado { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.nc-estado--pendente    { background: #f3f4f6; color: #6b7280; }
.nc-estado--em_curso    { background: #dbeafe; color: #1e40af; }
.nc-estado--implementada{ background: #d4f0df; color: #2F1808; }
.nc-estado--validada    { background: #2F1808; color: #fff; }
.nc-req { font-size: 14px; font-weight: 500; color: var(--color-text); line-height: 1.5; margin-bottom: 8px; }
.nc-obs { font-size: 13px; color: #3D5543; background: #FDF9F0; border-left: 3px solid #8BB5A0; border-radius: 0 6px 6px 0; padding: 8px 12px; margin-bottom: 14px; line-height: 1.5; }
.nc-obs strong { color: var(--color-muted); font-weight: 600; }

/* Formulário do plano */
.nc-form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.nc-field { display: flex; flex-direction: column; gap: 5px; }
.nc-field--full { grid-column: 1 / -1; }
.nc-field label { font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.nc-input { font-family: var(--font-sans); font-size: 13px; padding: 8px 11px; background: #FDF9F0; border: 1px solid #C2D0C6; border-radius: 6px; color: #0B2214; outline: none; width: 100%; transition: border-color .15s, background .15s; resize: vertical; }
.nc-input:focus { border-color: #7A4A1E; background: #fff; }
.nc-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.nc-saved-msg { font-size: 13px; color: #2F1808; font-weight: 600; }
.nc-btn-save { display: inline-flex; align-items: center; gap: 7px; padding: 9px 22px; background: #7A4A1E; color: #FDF9F5; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.nc-btn-save:hover:not(:disabled) { background: #A0622A; }
.nc-btn-save:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 700px) { .nc-wrapper { padding: 24px 20px 60px; } .nc-form-grid { grid-template-columns: 1fr; } }

/* ——— Checklist (Demo + ChecklistCap) ———————————————————————— */
.demo-wrapper { max-width: 860px; margin: 0 auto; padding: 40px 48px 80px; }
.demo-banner { display: flex; align-items: center; gap: 8px; background: rgba(122, 74, 30,.08); border: 1px solid rgba(122, 74, 30,.18); border-radius: 6px; padding: 9px 14px; font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .06em; color: #7A4A1E; margin-bottom: 28px; }
.demo-banner svg { width: 14px; height: 14px; flex-shrink: 0; }
.demo-hdr { padding-bottom: 20px; border-bottom: 1px solid #E8DDD5; margin-bottom: 20px; }
.demo-hdr-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.demo-hdr-sub { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #5A7A9A; margin-bottom: 4px; }
.demo-hdr-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #2F1808; letter-spacing: -.3px; margin: 0; }
.demo-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dbadge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 4px; letter-spacing: .02em; }
.dbadge-ko { background: #fde8e8; color: #991b1b; }
.dbadge-maj { background: #fef3c7; color: #92400e; }
.dbadge-std { background: #dbeafe; color: #1e40af; }
.dbadge-pescado { background: #dbeeff; color: #2F1808; }
.demo-prog-bar { height: 6px; background: #E8DDD5; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.demo-prog-fill { height: 100%; background: #7A4A1E; border-radius: 3px; transition: width .4s ease; }
.demo-prog-info { display: flex; justify-content: space-between; font-size: 12px; color: #5A7A9A; }
.demo-score-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.dsc { padding: 12px 10px; border-radius: 8px; text-align: center; border: 1px solid #E8DDD5; background: #FDF9F5; }
.dsc-lbl { font-size: 11px; color: #5A7A9A; margin-bottom: 4px; }
.dsc-val { font-size: 24px; font-weight: 700; font-family: var(--font-display); }
.dsc-a { color: #7A4A1E; } .dsc-b { color: #1e40af; } .dsc-c { color: #92400e; } .dsc-d { color: #991b1b; }
.demo-ko-alert { display: flex; align-items: center; gap: 10px; background: #fde8e8; border: 1px solid #fca5a5; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #991b1b; margin-bottom: 16px; }
.demo-ko-alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.demo-section-lbl { font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5A7A9A; border-bottom: 1px solid #E8DDD5; padding-bottom: 7px; margin: 24px 0 10px; }
.dreq { border: 1px solid #E8DDD5; border-radius: 10px; margin-bottom: 6px; overflow: hidden; background: #FDF9F5; transition: border-color .2s; }
.dreq--scored { border-color: #E8B84B; }
/* Fundo por classificação — itens já avaliados */
.dreq--sc-A  { background: #FDF6E8; border-color: #E8B84B; }
.dreq--sc-B  { background: #eff6ff; border-color: #93c5fd; }
.dreq--sc-C  { background: #fffbeb; border-color: #fcd34d; }
.dreq--sc-D  { background: #fff1f2; border-color: #fca5a5; }
.dreq--sc-NA { background: #f3f4f6; border-color: #d1d5db; }
/* Hover mantém a cor base */
.dreq--sc-A  .dreq-hdr:hover { background: #d0eaf8; }
.dreq--sc-B  .dreq-hdr:hover { background: #dbeafe; }
.dreq--sc-C  .dreq-hdr:hover { background: #fef3c7; }
.dreq--sc-D  .dreq-hdr:hover { background: #fee2e2; }
.dreq--sc-NA .dreq-hdr:hover { background: #e5e7eb; }
.dreq--open { border-color: #7A4A1E; }
.dreq-hdr { width: 100%; padding: 12px 16px; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; background: transparent; border: none; text-align: left; transition: background .15s; }
.dreq-hdr:hover { background: #FDF6E8; }
.dreq-code { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600; white-space: nowrap; min-width: 46px; color: #5A7A9A; padding-top: 1px; flex-shrink: 0; }
.dreq-title { flex: 1; font-size: 13px; line-height: 1.55; color: #2F1808; font-weight: 500; text-align: left; }
.dreq-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.dreq-chevron { width: 12px; height: 12px; color: #5A7A9A; transition: transform .2s; flex-shrink: 0; }
.dreq--open .dreq-chevron { transform: rotate(180deg); }
.dreq-score-ind { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; }
.score-a { color: #7A4A1E; } .score-b { color: #1e40af; } .score-c { color: #92400e; } .score-d { color: #991b1b; } .score-na { color: #5A7A9A; }
.dreq-body { padding: 0 16px 16px; border-top: 1px solid #E8DDD5; }
.dreq-desc { font-size: 13px; color: #5C3E2A; line-height: 1.7; margin: 14px 0 12px; }
.dreq-pescado { background: #FDF6E8; border-left: 3px solid #7A4A1E; border-radius: 0 6px 6px 0; padding: 8px 12px; font-size: 12px; color: #2F1808; margin-bottom: 14px; line-height: 1.6; }
.dreq-pescado strong { font-weight: 600; }
.dreq-score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.dreq-score-lbl { font-size: 12px; color: #5A7A9A; white-space: nowrap; }
.dreq-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.dsbtn { min-width: 42px; height: 32px; border: 1.5px solid #E4D0B8; border-radius: 6px; background: #FDF9F5; font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; color: #5C3E2A; padding: 0 8px; }
.dsbtn:hover { background: #fff; border-color: #7A4A1E; }
.dsbtn--sel-A { background: #FDF6E8; border-color: #7A4A1E; color: #2F1808; }
.dsbtn--sel-B { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }
.dsbtn--sel-C { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.dsbtn--sel-D { background: #fde8e8; border-color: #ef4444; color: #991b1b; }
.dsbtn--sel-NA { background: #f3f4f6; border-color: #9ca3af; color: #6b7280; }
.dsbtn--readonly { cursor: default; pointer-events: none; opacity: .75; }
.dreq-notes-lbl { font-size: 12px; color: #5A7A9A; margin-bottom: 5px; }
.dreq-textarea { width: 100%; min-height: 64px; resize: vertical; font-family: var(--font-sans); font-size: 13px; padding: 8px 12px; border: 1.5px solid #E4D0B8; border-radius: 6px; background: #FDF9F5; color: #2F1808; line-height: 1.6; transition: border-color .15s; outline: none; }
.dreq-textarea:focus { border-color: #7A4A1E; background: #fff; }
.demo-export-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 24px; padding: 11px; border: 1.5px solid #E4D0B8; border-radius: 8px; background: #FDF9F5; font-family: var(--font-sans); font-size: 13px; cursor: pointer; color: #5C3E2A; transition: all .15s; }
.demo-export-btn svg { width: 15px; height: 15px; }
.demo-export-btn:hover { background: #fff; border-color: #7A4A1E; color: #2F1808; }

/* Botão Guardar auditoria */
.aud-save-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 24px; padding: 13px; border: none; border-radius: 8px; background: #7A4A1E; color: #FDF9F5; font-family: var(--font-sans); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.aud-save-btn svg { width: 16px; height: 16px; }
.aud-save-btn:hover:not(:disabled) { background: #A0622A; }
.aud-save-btn:disabled { opacity: .6; cursor: not-allowed; }
.aud-saved { display: flex; align-items: center; gap: 10px; background: #FDF6E8; border: 1px solid #E8B84B; border-radius: 6px; padding: 14px 16px; font-size: 14px; font-weight: 500; color: #2F1808; }
.aud-saved svg { width: 18px; height: 18px; flex-shrink: 0; }
.aud-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* Bloco pós-gravação */
.aud-saved-block { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.aud-saved-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.aud-saved-actions .aud-save-btn { flex: 1; margin-top: 0; min-width: 160px; text-decoration: none; }
.aud-save-btn--outline { background: transparent; color: #7A4A1E; border: 1.5px solid #7A4A1E; }
.aud-save-btn--outline:hover:not(:disabled) { background: #FDF6E8; }
.demo-cta-box { margin-top: 40px; padding: 28px 32px; background: #2F1808; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.demo-cta-box p { font-size: 15px; color: #C8A870; margin: 0; font-weight: 300; }
.demo-cta-btn { display: inline-flex; align-items: center; padding: 10px 22px; background: #7A4A1E; color: #FDF9F5; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.demo-cta-btn:hover { background: #A0622A; text-decoration: none; }
.demo-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-cta-btn--outline { background: transparent; color: #D4960F; border: 1.5px solid #D4960F; }
.demo-cta-btn--outline:hover { background: rgba(212, 150, 15,.12); }

/* Títulos de secção da demo */
.demo-section-title { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #2F1808; letter-spacing: -.4px; margin: 48px 0 6px; padding-top: 28px; border-top: 1px solid #E8DDD5; }
.demo-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 32px; }
.demo-section-num { font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 600; color: #7A4A1E; }
.demo-section-intro { font-size: 14px; color: #5C3E2A; line-height: 1.7; margin: 0 0 20px; max-width: 620px; }

/* Plano de ações (estático, na demo) */
.demo-plano-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.demo-plano-cell { display: flex; flex-direction: column; gap: 3px; background: #FDF6E8; border: 1px solid #E8DDD5; border-radius: 6px; padding: 8px 11px; }
.demo-plano-cell--full { grid-column: 1 / -1; }
.demo-plano-lbl { font-family: var(--font-mono, monospace); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #5A7A9A; }
.demo-plano-val { font-size: 13px; color: #2F1808; line-height: 1.5; }

/* ── Demo — card Criar Auditoria ─────────────────────────────── */
.demo-criar-card         { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 20px 24px; margin-bottom: 8px; }
.demo-criar-row          { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.demo-criar-field        { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.demo-criar-field--sm    { flex: 0 0 160px; }
.demo-criar-lbl          { font-size: .78rem; font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: .05em; }
.demo-criar-input-fake           { padding: .5rem .75rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; font-size: .9rem; color: var(--color-text); }
.demo-criar-input-fake--select   { display: flex; align-items: center; cursor: default; }
.demo-criar-field--full          { flex: 1 1 100%; }
.demo-criar-tags                 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.demo-criar-indep        { background: #f0f6ff; border: 1px solid #c7ddf7; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.demo-criar-indep-title  { display: flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 700; color: #2F1808; margin-bottom: 6px; }
.demo-criar-iso          { font-size: .72rem; font-weight: 600; color: #7A4A1E; background: #dbeeff; padding: 2px 7px; border-radius: 999px; }
.demo-criar-opcional     { font-size: .75rem; font-weight: 400; color: var(--color-muted); }
.demo-criar-indep-desc   { font-size: .82rem; color: #3a5c7a; margin: 0 0 12px; line-height: 1.55; }
.demo-indep-users        { display: flex; flex-direction: column; gap: 8px; }
.demo-indep-user-row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-indep-user-nome    { font-size: .85rem; font-weight: 600; color: #2F1808; min-width: 110px; }
.demo-indep-caps         { display: flex; gap: 5px; flex-wrap: wrap; }
.demo-indep-cap          { padding: 3px 9px; border-radius: 5px; font-size: .75rem; font-weight: 600; background: #e8eef5; color: #5a7a95; border: 1px solid #c7ddf7; cursor: default; }
.demo-indep-cap--sel     { background: #7A4A1E; color: #fff; border-color: #7A4A1E; }
.demo-criar-footer       { display: flex; justify-content: flex-end; }
.demo-criar-btn-fake     { display: inline-flex; align-items: center; padding: .6rem 1.4rem; background: var(--color-primary); color: #fff; border-radius: 7px; font-size: .9rem; font-weight: 600; opacity: .85; cursor: default; }

/* Nota PDF (sob o relatório) */
.demo-pdf-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5C3E2A; margin: 12px 0 0; }
.demo-pdf-note svg { width: 16px; height: 16px; flex-shrink: 0; color: #7A4A1E; }
.demo-pdf-note strong { color: #2F1808; }

/* Nota de configuração */
.demo-config-note { display: flex; align-items: flex-start; gap: 10px; background: #FDF6E8; border: 1px solid #E8B84B; border-radius: 8px; padding: 14px 16px; font-size: 13px; color: #2F1808; line-height: 1.6; margin-top: 32px; }
.demo-config-note svg { width: 20px; height: 20px; flex-shrink: 0; color: #7A4A1E; margin-top: 1px; }

@media (max-width: 768px) {
    .demo-wrapper { padding: 24px 20px 60px; }
    .demo-score-summary { grid-template-columns: repeat(2,1fr); }
    .demo-hdr-top { flex-direction: column; }
    .demo-cta-box { flex-direction: column; text-align: center; }
    .demo-cta-actions { width: 100%; flex-direction: column; }
    .demo-cta-btn { width: 100%; justify-content: center; }
    .demo-plano-grid { grid-template-columns: 1fr; }
}

/* ── Homepage — Regulamentos ─────────────────────────────────── */
.reg-grupos       { display: flex; flex-direction: column; gap: 2.5rem; }
.reg-grupo        { }
.reg-grupo-titulo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: #2F1808; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 2px solid #7A4A1E; }
.reg-cards        { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.reg-card         { background: #fff; border: 1px solid #E8DDD5; border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s; }
.reg-card:hover   { box-shadow: 0 4px 16px rgba(122, 74, 30,.1); }
.reg-card-id      { font-family: var(--font-mono, monospace); font-size: .78rem; font-weight: 700; color: #7A4A1E; background: #FDF6E8; border: 1px solid #BFD9EE; border-radius: 4px; padding: 2px 8px; align-self: flex-start; letter-spacing: .03em; }
.reg-card-nome    { font-size: .88rem; font-weight: 600; color: #2F1808; line-height: 1.35; }
.reg-card-desc    { font-size: .82rem; color: #5C3E2A; line-height: 1.6; margin: 0; }
@media (max-width: 768px) { .reg-cards { grid-template-columns: 1fr; } }

/* ——— Autofill override (modais e hero card escuros) ——————————
   O CSS scoped do Blazor não consegue aplicar :-webkit-autofill
   correctamente, por isso este override fica aqui no CSS global. */
/* Modais com inputs claros (lm, rpm, epm) */
.lm-input:-webkit-autofill,
.lm-input:-webkit-autofill:hover,
.lm-input:-webkit-autofill:focus,
.lm-input:-webkit-autofill:active,
.rpm-input:-webkit-autofill,
.rpm-input:-webkit-autofill:hover,
.rpm-input:-webkit-autofill:focus,
.rpm-input:-webkit-autofill:active,
.epm-input:-webkit-autofill,
.epm-input:-webkit-autofill:hover,
.epm-input:-webkit-autofill:focus,
.epm-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #FDF9F0 inset !important;
    -webkit-text-fill-color: #2F1808 !important;
    caret-color: #2F1808 !important;
    transition: background-color 9999s ease-in-out 0s !important;
}
/* Hero card — inputs num painel escuro (override coberto pelo scoped CSS) */
.hlc-input:-webkit-autofill,
.hlc-input:-webkit-autofill:hover,
.hlc-input:-webkit-autofill:focus,
.hlc-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #3D2010 inset !important;
    -webkit-text-fill-color: #FDF9F5 !important;
    caret-color: #FDF9F5 !important;
    transition: background-color 9999s ease-in-out 0s !important;
}


/* ── Dashboard — Secções de Sessões ──────────────────────────── */
.db-section            { margin-bottom: 2.5rem; }
.db-section-title      { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--color-primary); margin-bottom: 1rem; border-bottom: 2px solid var(--color-border); padding-bottom: .5rem; }
.db-section-title svg  { width: 18px; height: 18px; }
.db-section-empty      { padding: 1.5rem; color: var(--color-muted); font-size: .9rem; background: var(--color-surface); border-radius: 8px; }

.db-alert              { padding: .75rem 1rem; border-radius: 6px; font-size: .9rem; margin-bottom: 1rem; }
.db-alert--erro        { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.db-alert--plano       { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; display: flex; align-items: flex-start; gap: .5rem; }

/* Nova Auditoria — formulário */
.db-nova-form   { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; background: var(--color-surface); padding: 1.25rem; border-radius: 10px; border: 1.5px solid var(--color-border); }
.db-nova-field  { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.db-nova-field label { font-size: .8rem; font-weight: 600; color: var(--color-muted); }
.db-nova-input  { padding: .55rem .8rem; border: 1.5px solid var(--color-border); border-radius: 6px; font-size: .9rem; background: #fff; color: var(--color-text); outline: none; }
.db-nova-input:focus { border-color: var(--color-primary); }
.db-nova-btn    { display: inline-flex; align-items: center; gap: 6px; padding: .6rem 1.4rem; background: var(--color-primary); color: #fff; border: none; border-radius: 6px; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.db-nova-btn:hover:not(:disabled) { background: var(--color-accent); }
.db-nova-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Sessão card */
.db-sessao-card        { background: #fff; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
.db-sessao-head        { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.db-sessao-nome        { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--color-text); }
.db-sessao-datas       { font-size: .8rem; color: var(--color-muted); margin-top: 2px; }
.db-sessao-estado      { padding: .25rem .8rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.db-sessao-estado--aberta  { background: #d4f0df; color: #2F1808; }
.db-sessao-estado--fechada { background: #e5e7eb; color: #374151; }

.db-sessao-modulos     { display: flex; gap: 1rem; flex-wrap: wrap; }
.module-card--sm       { padding: 1rem !important; min-width: 140px; max-width: 180px; }
.module-card--sm h3    { font-size: .9rem !important; }
.module-card--sm p     { font-size: .78rem !important; }

.db-sessao-footer      { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.db-fechar-confirm-msg { font-size: .85rem; color: #7c2d12; flex: 1; }
.db-btn-fechar         { padding: .45rem 1.1rem; border: 1.5px solid #dc2626; border-radius: 6px; background: #fff; color: #dc2626; font-size: .85rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.db-btn-fechar:hover:not(:disabled)          { background: #fef2f2; }
.db-btn-fechar--confirm                      { background: #dc2626; color: #fff; }
.db-btn-fechar--confirm:hover:not(:disabled) { background: #b91c1c; }
.db-btn-fechar:disabled                      { opacity: .6; cursor: not-allowed; }
.db-btn-secondary      { padding: .45rem 1rem; border: 1.5px solid var(--color-border); border-radius: 6px; background: #fff; color: var(--color-muted); font-size: .85rem; cursor: pointer; }
.db-btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
/* Botão Apagar — menos destaque que o Fechar */
.db-btn-apagar { padding: .4rem .9rem; border: 1.5px solid #d1d5db; border-radius: 6px; background: #fff; color: #6b7280; font-size: .82rem; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: border-color .15s, color .15s, background .15s; }
.db-btn-apagar:hover:not(:disabled) { border-color: #ef4444; color: #dc2626; background: #fff5f5; }
.db-btn-apagar--confirm { background: #ef4444; border-color: #ef4444; color: #fff; font-weight: 600; }
.db-btn-apagar--confirm:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; color: #fff; }
.db-btn-apagar:disabled { opacity: .55; cursor: not-allowed; }
/* Botão de independência ISO 19011 */
.db-btn-independencia { padding: .4rem .9rem; border: 1.5px solid #A0622A; border-radius: 6px; background: #fff; color: #A0622A; font-size: .82rem; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: border-color .15s, color .15s, background .15s; }
.db-btn-independencia:hover { background: #EAF4FF; }
/* Painel de Independência */
.db-independencia-panel { background: #F0F7FF; border: 1.5px solid #A8CBE8; border-radius: 10px; padding: 16px 18px; }
.db-indep-header { display: flex; align-items: center; gap: 8px; color: #7A4A1E; margin-bottom: 8px; }
.db-indep-desc { font-size: .82rem; color: var(--color-muted); margin: 0 0 14px; line-height: 1.5; }
.db-indep-users { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.db-indep-user-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid #D8C8B8; border-radius: 8px; padding: 8px 12px; }
.db-indep-user-nome { font-size: .85rem; font-weight: 600; color: #2F1808; min-width: 160px; flex-shrink: 0; }
.db-indep-caps { display: flex; flex-wrap: wrap; gap: 6px; }
.db-indep-cap { padding: .25rem .6rem; border: 1.5px solid #D8C8B8; border-radius: 5px; background: #FDF9F5; color: #4A6A8A; font-size: .78rem; font-weight: 500; cursor: pointer; transition: all .12s; }
.db-indep-cap:hover { border-color: #A0622A; color: #A0622A; }
.db-indep-cap--sel { background: #A0622A; border-color: #A0622A; color: #fff; }
.db-indep-cap--sel:hover { background: #7A4A1E; border-color: #7A4A1E; }
.db-indep-footer { display: flex; align-items: center; gap: 8px; }
/* Aviso de área restrita no ChecklistCap */
.iso-aviso { display: flex; align-items: flex-start; gap: 10px; background: #EFF6FF; border: 1.5px solid #93C5FD; border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; color: #1e40af; font-size: .85rem; line-height: 1.5; }
/* Capítulo bloqueado no AuditoriaIndex */
.aud-chapter-card--restrito { border-color: #93C5FD !important; background: #F0F7FF !important; }
.aud-chapter-restrito { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: .75rem; color: #A0622A; font-weight: 500; }
/* Bloco de confirmação de apagar */
.db-apagar-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: 8px; padding: 10px 14px; }
.db-apagar-confirm-msg { font-size: .84rem; color: #78350f; flex: 1; min-width: 180px; line-height: 1.5; }
/* Spinner pequeno para o botão */
.aud-spinner--sm { width: 12px; height: 12px; border-width: 2px; }

/* Painel de referência HACCP (Cap. 2) — dados vindos do HACCPlano, integração externa.
   Cor coral do brandbook HACCPlano só no cabeçalho, para assinalar visualmente que a
   informação vem de outra plataforma; o resto segue a paleta neutra desta app. */
.haccp-ref-panel { border: 1px solid #DDE4EC; border-radius: 10px; background: #F8FAFC; margin-bottom: 20px; overflow: hidden; }
.haccp-ref-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.haccp-ref-brand { display: flex; align-items: center; gap: 8px; }
.haccp-ref-logo { width: 22px; height: 22px; flex-shrink: 0; }
.haccp-ref-title { font-size: .85rem; font-weight: 600; color: #081F33; }
.haccp-ref-toggle { font-size: .75rem; color: #5A7A9A; white-space: nowrap; }
.haccp-ref-note { font-size: .75rem; color: #5A7A9A; padding: 0 16px 12px; margin: 0; }
.haccp-ref-body { padding: 0 16px 16px; font-size: .85rem; color: #0A2A42; border-top: 1px solid #DDE4EC; }
.haccp-ref-body p { margin: 12px 0 6px; }
.haccp-ref-body ul { margin: 4px 0 12px 1.2rem; padding: 0; }
.haccp-ref-body li { margin-bottom: 4px; }

/* Modal validação pré-fecho */
.db-fecho-modal      { width: 100%; margin-top: .5rem; display: flex; flex-direction: column; gap: .75rem; }
.db-fecho-bloco      { border-radius: 8px; padding: .85rem 1rem; font-size: .85rem; }
.db-fecho-bloco--erro  { background: #fef2f2; border: 1.5px solid #fecaca; color: #7f1d1d; }
.db-fecho-bloco--aviso { background: #fffbeb; border: 1.5px solid #fde68a; color: #78350f; }
.db-fecho-bloco--ok    { background: #f0fdf4; border: 1.5px solid #bbf7d0; color: #14532d; display: flex; align-items: center; gap: .5rem; }
.db-fecho-titulo     { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin-bottom: .5rem; }
.db-fecho-subtitulo  { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin: .5rem 0 .25rem; opacity: .75; }
.db-fecho-lista      { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.db-fecho-lista li   { line-height: 1.4; }
.db-fecho-codigo     { font-weight: 700; margin-right: .35rem; }
.db-fecho-acoes      { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding-top: .25rem; }

/* Arquivo */
.db-arquivo-lista  { display: flex; flex-direction: column; gap: .75rem; }
.db-arquivo-row    { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; background: #fff; border: 1.5px solid var(--color-border); border-radius: 10px; flex-wrap: wrap; }
.db-arquivo-info   { flex: 1; min-width: 200px; }
.db-arquivo-nome   { font-weight: 700; font-size: .95rem; color: var(--color-text); }
.db-arquivo-datas  { font-size: .8rem; color: var(--color-muted); margin-top: 2px; }
.db-arquivo-score  { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.db-arquivo-pct    { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.db-arquivo-nivel  { font-size: .7rem; text-align: center; }
.db-arquivo-score--higher    .db-arquivo-pct { color: #2F1808; }
.db-arquivo-score--foundation .db-arquivo-pct { color: #7A4A1E; }
.db-arquivo-score--fail      .db-arquivo-pct { color: #B71C1C; }
.db-arquivo-actions { display: flex; gap: .5rem; }
/* Arquivo — botões de ação: seguem Brandbook (primário #7A4A1E, outline #A0622A) */
.db-btn-rel  { padding: .4rem .9rem; background: transparent; border: 1.5px solid var(--color-border); border-radius: 5px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--color-text); display: inline-flex; align-items: center; gap: 5px; transition: border-color .15s, color .15s; }
.db-btn-rel:hover { border-color: var(--color-primary); color: var(--color-primary); }
.db-btn-pdf  { padding: .4rem .9rem; background: var(--color-primary); border: none; border-radius: 5px; font-size: .82rem; font-weight: 600; cursor: pointer; color: #fff; display: inline-flex; align-items: center; gap: 5px; transition: background .15s; }
.db-btn-pdf:hover:not(:disabled)  { background: #A0622A; }
.db-btn-pdf:disabled { opacity: .6; cursor: not-allowed; }
.db-btn-respostas { padding: .4rem .9rem; background: transparent; border: 1.5px solid var(--color-primary); border-radius: 5px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--color-primary); display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s; }
.db-btn-respostas:hover:not(:disabled) { background: var(--color-primary); color: #fff; }
.db-btn-respostas:disabled { opacity: .6; cursor: not-allowed; }
.db-btn-excel { padding: .4rem .9rem; background: transparent; border: 1.5px solid #A0622A; border-radius: 5px; font-size: .82rem; font-weight: 600; cursor: pointer; color: #A0622A; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s; }
.db-btn-excel:hover:not(:disabled) { background: #A0622A; color: #fff; }
.db-btn-excel:disabled { opacity: .6; cursor: not-allowed; }
.db-btn-excel--resp { border-color: #C47A0E; color: #C47A0E; }
.db-btn-excel--resp:hover:not(:disabled) { background: #C47A0E; color: #fff; }
/* Relatório — botões de exportação */
.rel-btn-excel { display: inline-flex; align-items: center; gap: 8px; padding: .65rem 1.2rem; background: transparent; color: #A0622A; border: 2px solid #A0622A; border-radius: 5px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.rel-btn-excel:hover:not(:disabled) { background: #A0622A; color: #fff; }
.rel-btn-excel:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 600px) {
  .db-nova-form  { flex-direction: column; }
  .db-arquivo-row { flex-direction: column; align-items: flex-start; }
  .db-sessao-modulos { flex-direction: column; }
  .module-card--sm { max-width: 100%; }
}

/* ── Relatório — botão PDF ───────────────────────────────────── */
.rel-pdf-bar  { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); flex-wrap: wrap; }
.rel-pdf-erro { font-size: .85rem; color: #dc2626; flex: 1; }
.rel-btn-pdf  { display: inline-flex; align-items: center; gap: 8px; padding: .65rem 1.4rem; background: var(--color-primary); color: #fff; border: none; border-radius: 5px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.rel-btn-pdf:hover:not(:disabled) { background: #A0622A; }
.rel-btn-pdf:disabled { opacity: .6; cursor: not-allowed; }
.rel-btn-respostas  { display: inline-flex; align-items: center; gap: 8px; padding: .65rem 1.4rem; background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); border-radius: 5px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.rel-btn-respostas:hover:not(:disabled) { background: var(--color-primary); color: #fff; }
.rel-btn-respostas:disabled { opacity: .6; cursor: not-allowed; }

/* ── Dashboard — Scope form ──────────────────────────────────── */
.db-nova-field--full  { grid-column: 1 / -1; }
.db-scope-opcional    { font-size: .78rem; font-weight: 400; color: var(--color-muted); margin-left: 4px; }
.db-scope-checks      { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.db-scope-check       { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--color-text); cursor: pointer; white-space: nowrap; }
.db-scope-check input { accent-color: var(--color-primary); width: 14px; height: 14px; cursor: pointer; }
.db-scope-check:hover { color: var(--color-primary); }

/* ── Dashboard — Scope tags nos cards ───────────────────────── */
.db-scope-tags    { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.db-scope-tag     { font-size: .72rem; font-weight: 500; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.db-scope-tag--cat { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.db-scope-tag--tec { background: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }
.db-scope-tag--amb { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

/* ── Dashboard — Dropdown multiselect ───────────────────────── */
.db-select-wrap       { position: relative; }
.db-select-trigger    { width: 100%; display: flex; align-items: center; justify-content: space-between;
                         gap: 8px; padding: .55rem .8rem; background: #fff;
                         border: 1.5px solid var(--color-border); border-radius: 6px;
                         font-size: .9rem; color: var(--color-text); cursor: pointer;
                         transition: border-color .15s, box-shadow .15s; text-align: left; }
.db-select-trigger:hover { border-color: var(--color-accent); }
.db-select-trigger:focus  { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(122, 74, 30,.12); }
.db-select-wrap--open .db-select-trigger { border-color: var(--color-primary); border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: 0 0 0 3px rgba(122, 74, 30,.12); background: #fff; }
.db-select-trigger-label  { flex: 1; min-width: 0; }
.db-select-trigger-count  { font-size: .75rem; font-weight: 600; background: var(--color-primary); color: #fff;
                              border-radius: 99px; padding: 1px 7px; flex-shrink: 0; }
.db-select-chevron        { flex-shrink: 0; transition: transform .2s; color: var(--color-muted); }
.db-select-wrap--open .db-select-chevron { transform: rotate(180deg); }

.db-select-panel      { position: absolute; left: 0; right: 0; top: 100%; z-index: 100;
                         background: var(--color-surface); border: 1.5px solid var(--color-primary);
                         border-top: none; border-radius: 0 0 8px 8px;
                         box-shadow: 0 8px 24px rgba(0,0,0,.10);
                         max-height: 260px; overflow-y: auto; }
.db-select-option     { display: flex; align-items: center; gap: 10px; padding: 9px 14px;
                         cursor: pointer; font-size: .875rem; color: var(--color-text);
                         transition: background .1s; user-select: none; }
.db-select-option:hover { background: #f0faf3; }
.db-select-option input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--color-primary); flex-shrink: 0; cursor: pointer; }
.db-select-option--selected { background: #f6fbf8; font-weight: 500; }

.db-select-backdrop   { position: fixed; inset: 0; z-index: 99; background: transparent; cursor: default; }

/* Tags selected — inline no form (com botão × para remover) */
.db-sel-tags          { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; min-height: 0; }
.db-sel-tag           { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem;
                         font-weight: 500; padding: 3px 8px 3px 9px; border-radius: 99px; line-height: 1; }
.db-sel-tag--cat      { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.db-sel-tag--tec      { background: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }
.db-sel-tag--amb      { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.db-sel-tag button    { background: none; border: none; padding: 0; cursor: pointer; font-size: .8rem;
                         line-height: 1; opacity: .55; display: flex; align-items: center; }
.db-sel-tag button:hover { opacity: 1; }

/* Preview sentence ──────────────────────────────────────────── */
.db-nova-preview      { margin-top: 4px; margin-bottom: 2px; padding: 11px 14px;
                         background: linear-gradient(135deg, #f0faf3 0%, #e8f5e9 100%);
                         border: 1px solid #c8e6c9; border-radius: 8px;
                         font-size: .855rem; line-height: 1.55; color: #2d5a3a;
                         animation: previewIn .25s ease; }
.db-nova-preview strong { color: var(--color-primary-dk); font-weight: 600; }
@keyframes previewIn   { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Checklist — itens fora do âmbito ───────────────────────── */
.dreq--fora-scope   { background: #f9fafb; border-color: #e5e7eb; }
.dreq-scope-na      { font-size: .72rem; font-weight: 500; color: #9ca3af; background: #f3f4f6;
                       border: 1px solid #e5e7eb; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
