:root {
    --ink: #19160f;
    --ink-soft: #685e4d;
    --paper: #f7f3e9;
    --card: #fffdf8;
    --line: #ded4c1;
    --gold: #a87519;
    --gold-dark: #825b12;
    --gold-light: #d3a53f;
    --night: #17140e;
    --green: #246b44;
    --red: #96362c;
    --amber: #876317;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(60, 43, 15, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.content { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.quality-grid { background-image: linear-gradient(rgba(168,117,25,.06) 1px, transparent 1px), linear-gradient(90deg,rgba(168,117,25,.06) 1px,transparent 1px); background-size: 28px 28px; }
.eyebrow { margin: 0; color: #cfa64d; font-size: 12px; font-weight: 800; letter-spacing: .19em; }
.eyebrow.gold { color: #9a6b16; }
.button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; transition: .2s ease; }
.button.primary { background: var(--gold); color: #fff; box-shadow: 0 10px 30px rgba(151,101,12,.2); }
.button.primary:hover { background: #8f6214; transform: translateY(-1px); }
.button.outline { border: 1px solid #d2c5ae; background: #fff; color: #594a31; box-shadow: none; }
.button.outline:hover { border-color: #b9872f; background: #f7f0e2; }
.button.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.button.large { min-height: 50px; font-size: 15px; }
.button.full { width: 100%; }
.public-header { border-bottom: 1px solid #dacfb9; background: rgba(255,253,248,.95); }
.public-header-inner { width: min(1160px, calc(100% - 40px)); min-height: 82px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand img { width: 118px; height: 68px; object-fit: contain; }
.brand-divider { width: 1px; height: 32px; background: rgba(199,154,61,.38); }
.brand-label { color: #77694e; font-size: 11px; font-weight: 750; line-height: 1.45; letter-spacing: .17em; text-transform: uppercase; }
.public-header nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 700; }
.store-link { color: #5d523f; }
.store-link:hover { color: var(--gold); }
.admin-link { padding: 10px 16px; border: 1px solid #d7c8aa; border-radius: 999px; color: #5d4a28; }
.admin-link:hover { border-color: #b9872f; background: #f3ead8; }
.hero { overflow: hidden; border-bottom: 1px solid #ddd0b7; }
.hero-grid { min-height: 570px; padding-block: 70px; display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 64px; }
.trust-badge { display: inline-flex; padding: 8px 13px; border: 1px solid rgba(199,164,92,.45); border-radius: 999px; color: #8a6015; background: #fffaf0; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.hero-copy h1 { max-width: 570px; margin: 22px 0 20px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 68px); line-height: 1.04; letter-spacing: -.04em; }
.hero-copy h1 em { font-style: normal; background: linear-gradient(115deg,#825b12 0%,#d3a53f 45%,#8a6015 100%); background-clip: text; color: transparent; }
.hero-copy > p { max-width: 520px; margin: 0; color: var(--ink-soft); font-size: 18px; line-height: 1.75; }
.search-panel { padding: 36px; border: 1px solid rgba(196,148,51,.35); border-radius: 30px; color: #fff; background: var(--night); box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.panel-title span { display: flex; flex-direction: column; gap: 8px; }
.panel-title small { color: #cfa64d; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.panel-title strong { font-family: Georgia, "Times New Roman", serif; font-size: 30px; }
.panel-title > b { width: 50px; height: 50px; border: 1px solid #6b5733; border-radius: 15px; display: grid; place-items: center; color: #d8ae52; background: #251f14; font-size: 25px; }
.search-form { margin-top: 28px; }
.search-form > label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 750; }
.search-form > div { display: flex; gap: 10px; }
.search-form input { width: 100%; height: 56px; padding: 0 16px; border: 1px solid #d1c09f; border-radius: 12px; outline: 0; font-weight: 700; letter-spacing: .03em; background: #fff; }
.search-form input:focus { border-color: #b8872e; box-shadow: 0 0 0 3px rgba(184,135,46,.2); }
.search-form.dark label { color: #ead9b7; }
.search-form.dark input { border-color: #5d4e32; color: #fff; background: #211d15; }
.search-form.dark input::placeholder { color: #8f8168; }
.search-form.dark > small { display: block; margin-top: 9px; color: #a99d87; }
.panel-foot { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid #3b3325; color: #bcb09b; font-size: 14px; }
.steps { padding-block: 76px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 64px; }
.steps-intro h2 { margin: 12px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 42px; }
.steps-intro > p:last-child { color: #6c6251; line-height: 1.7; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps-grid article { padding: 22px; border: 1px solid #ded3bf; border-radius: 18px; background: var(--card); }
.steps-grid span { color: var(--gold); font: 700 28px Georgia,serif; }
.steps-grid h3 { margin: 24px 0 8px; font-size: 16px; }
.steps-grid p { margin: 0; color: #746a58; font-size: 14px; line-height: 1.6; }
.benefits { border-block: 1px solid #ded3bf; background: #eee5d4; }
.benefits .content { padding-block: 30px; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.benefits article { display: flex; align-items: flex-start; gap: 14px; }
.benefits article > b { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; color: var(--gold); background: #fffaf0; }
.benefits span { display: flex; flex-direction: column; gap: 5px; }
.benefits small { color: #716654; font-size: 13px; }
.public-footer { padding: 30px 20px; color: #f8f1e2; background: var(--night); }
.public-footer > div { width: min(1160px,100%); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.public-footer span { display: flex; flex-direction: column; gap: 5px; }
.public-footer small { color: #bfb39d; }
.footer-links { flex-direction: row !important; gap: 22px !important; color: #d7cbb6; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.result-page { min-height: calc(100vh - 82px); padding-block: 44px 60px; }
.result-wrap { width: min(1000px,calc(100% - 40px)); }
.back-link { display: inline-block; margin-bottom: 22px; color: #6f6148; font-size: 14px; font-weight: 750; }
.result-card { overflow: hidden; border: 1px solid rgba(196,148,51,.35); border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.result-card-header { padding: 30px 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; background: var(--night); }
.result-card-header h1 { margin: 8px 0; font: 700 clamp(28px,4vw,42px) Georgia,serif; }
.lot-code { color: #c7baa4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .04em; }
.status-pill { padding: 10px 15px; border: 1px solid; border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 800; }
.status-pill.approved { border-color: #b9d9c5; color: var(--green); background: #eaf6ee; }
.status-pill.attention { border-color: #e4d09a; color: var(--amber); background: #fbf2d8; }
.status-pill.rejected { border-color: #e2bdb8; color: var(--red); background: #f9e9e7; }
.result-layout { display: grid; grid-template-columns: 1fr; }
.result-main { padding: 34px 36px; }
.result-main h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 26px Georgia,serif; }
.gold-symbol { color: var(--gold); font-size: 19px; }
.metrics-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.metric-card { padding: 20px; border: 1px solid #dfd3bd; border-radius: 17px; background: #fbf7ee; }
.metric-card > div { display: flex; justify-content: space-between; gap: 12px; color: #625743; font-size: 14px; font-weight: 700; }
.metric-card b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; }
.metric-card b.ok { background: #2f8156; }
.metric-card b.not-ok { background: #b34a3e; }
.metric-card > strong { margin-top: 12px; display: block; font-size: 28px; }
.metric-card > strong small { margin-left: 6px; color: #746650; font-size: 16px; }
.metric-card p { margin: 7px 0 0; color: #827663; font-size: 12px; }
.conclusion { margin-top: 20px; padding: 18px; border-left: 4px solid #b7801f; border-radius: 12px; background: #f2e7d2; }
.conclusion b { color: #8d641a; font-size: 11px; letter-spacing: .14em; }
.conclusion p { margin: 8px 0 0; color: #554936; line-height: 1.7; }
.lot-details { padding: 32px; background: #f2eadb; }
.lot-details h2 { margin: 0; color: #78684d; font-size: 13px; letter-spacing: .14em; }
.lot-details dl { margin: 20px 0 24px; }
.lot-details dl > div { padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid #ded1b9; }
.lot-details dt { color: #857760; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.lot-details dd { margin: 5px 0 0; color: #342b1e; font-size: 14px; font-weight: 700; line-height: 1.5; }
.report-empty { padding: 14px; border: 1px solid #d8c8aa; border-radius: 11px; color: #6e6047; background: #fffaf0; font-size: 13px; line-height: 1.5; }
.result-disclaimer { max-width: 650px; margin: 22px auto 0; color: #827763; text-align: center; font-size: 12px; line-height: 1.6; }
.not-found-card { max-width: 700px; margin: 20px auto; padding: 38px; border: 1px solid #d9c9aa; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.not-found-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; color: var(--gold); background: #f0e4ce; font-size: 28px; }
.not-found-card h1 { margin: 22px 0 10px; font: 700 39px Georgia,serif; }
.not-found-card > p { color: #6d6250; line-height: 1.7; }
.search-form.light { margin-top: 25px; }
.sac-note { margin-top: 25px !important; padding-top: 18px; border-top: 1px solid #dfd4c1; font-size: 13px; }
.sac-note a { color: #966715; font-weight: 750; text-decoration: underline; }

/* Administration */
.admin-body { min-height: 100vh; background: #eee9df; }
.admin-header { border-bottom: 1px solid #3c3324; color: #fff; background: var(--night); }
.admin-header-inner { width: min(1500px,calc(100% - 40px)); min-height: 78px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand-icon { width: 42px; height: 42px; border: 1px solid #604f30; border-radius: 12px; display: grid; place-items: center; color: #d2a64e; background: #292218; }
.admin-brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.admin-brand small { color: #cda44d; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.admin-brand strong { font-size: 15px; }
.admin-nav { display: flex; align-items: center; gap: 16px; color: #c6baa6; font-size: 13px; }
.admin-nav a { padding: 8px 12px; border: 1px solid #4a402e; border-radius: 8px; color: #fff; font-weight: 700; }
.admin-nav form { margin: 0; }
.link-button { padding: 8px; border: 0; color: #c6baa6; background: transparent; }
.admin-main { width: min(1500px,calc(100% - 40px)); margin: auto; padding-block: 28px 50px; }
.stats-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.stats-grid article { min-height: 86px; padding: 17px 20px; border: 1px solid #d7cdbc; border-radius: 15px; display: flex; align-items: center; gap: 14px; background: var(--card); }
.stat-icon { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; color: #9e6d16; background: #f0e5d1; }
.stats-grid article div { display: flex; flex-direction: column; }
.stats-grid small { color: #716755; }
.stats-grid strong { font-size: 24px; }
.admin-layout { display: grid; grid-template-columns: minmax(0,1fr) 470px; align-items: start; gap: 20px; }
.admin-card { border: 1px solid #d7cdbc; border-radius: 17px; background: var(--card); box-shadow: 0 3px 14px rgba(50,38,17,.05); }
.card-header { min-height: 82px; padding: 18px 20px; border-bottom: 1px solid #e1d8c9; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.card-header h1,.card-header h2 { margin: 0; font-size: 18px; }
.card-header p { margin: 5px 0 0; color: #746a59; font-size: 13px; }
.admin-tools { display: flex; gap: 9px; }
.table-search { height: 40px; padding: 0 12px; border: 1px solid #d8cbb4; border-radius: 10px; display: flex; align-items: center; gap: 8px; color: #8d826f; background: #fff; }
.table-search input { width: 190px; border: 0; outline: 0; background: transparent; }
.table-wrap { overflow-x: auto; }
.lots-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lots-table th { padding: 13px 14px; color: #615641; text-align: left; font-weight: 750; white-space: nowrap; }
.lots-table td { padding: 14px; border-top: 1px solid #ece4d7; vertical-align: middle; }
.lots-table td > strong { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lots-table td > small { display: block; margin-top: 5px; color: #8a7d68; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-mini { padding: 5px 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-mini.approved { border-color: #b8d8c3; color: #276b45; background: #eaf6ee; }
.status-mini.attention { border-color: #e4d19d; color: #856317; background: #fbf2d8; }
.status-mini.rejected { border-color: #e5beb8; color: #99382d; background: #fae9e6; }
.toggle-form { display: flex; align-items: center; gap: 8px; }
.toggle { width: 34px; height: 20px; padding: 2px; border: 0; border-radius: 999px; background: #c8c0b3; }
.toggle i { width: 16px; height: 16px; border-radius: 50%; display: block; background: #fff; transition: .2s; }
.toggle.on { background: var(--gold); }
.toggle.on i { transform: translateX(14px); }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.icon-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; display: inline-grid; place-items: center; color: #5e533f; background: transparent; font-size: 17px; }
.icon-button:hover { background: #f0e7d7; }
.empty-state,.empty-filter { padding: 60px 20px; color: #7b705e; text-align: center; }
.empty-state > span { font-size: 34px; color: #b6a991; }
.empty-state h2 { margin: 12px 0 5px; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 0; font-size: 13px; }
.editor-card { position: sticky; top: 16px; overflow: hidden; }
.editor-plus { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #9e6d16; background: #f0e5d1; font-size: 22px; }
.lot-form { max-height: calc(100vh - 118px); padding: 20px; overflow-y: auto; }
.lot-form > label,.field-grid label,.auth-form label,.password-panel label { display: flex; flex-direction: column; gap: 7px; color: #4d422f; font-size: 13px; font-weight: 750; }
.lot-form > label,.lot-form > div,.lot-form > section { margin-bottom: 17px; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: repeat(3,1fr); }
input,select,textarea { width: 100%; border: 1px solid #d8cbb4; border-radius: 9px; outline: 0; color: var(--ink); background: #fff; }
input,select { height: 42px; padding: 0 11px; }
textarea { padding: 11px; resize: vertical; line-height: 1.5; }
input:focus,select:focus,textarea:focus { border-color: #b8872e; box-shadow: 0 0 0 3px rgba(184,135,46,.16); }
input[type="file"] { height: auto; padding: 9px; font-size: 12px; }
label > small { color: #817560; font-size: 11px; font-weight: 500; }
.metrics-editor { padding: 14px; border: 1px solid #ded3bf; border-radius: 13px; background: #f8f3e9; }
.metrics-editor > header { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metrics-editor header > span { display: flex; flex-direction: column; gap: 4px; }
.metrics-editor header strong { font-size: 13px; }
.metrics-editor header small { color: #7b705d; font-size: 11px; }
.metric-row { padding: 11px; border: 1px solid #ded3bf; border-radius: 11px; background: #fff; }
.metric-row + .metric-row { margin-top: 9px; }
.metric-fields { display: grid; grid-template-columns: 1fr .7fr .4fr 34px; gap: 7px; }
.metric-row > input { margin-top: 7px; }
.check-label { margin-top: 9px; display: flex; flex-direction: row !important; align-items: center; gap: 7px !important; color: #675c49 !important; font-size: 11px !important; }
.check-label input { width: 16px; height: 16px; accent-color: var(--gold); }
.publish-box { padding: 14px; border: 1px solid #ded3bf; border-radius: 12px; flex-direction: row !important; align-items: center; justify-content: space-between; background: #f8f3e9; }
.publish-box > span { display: flex; flex-direction: column; gap: 4px; }
.publish-box small { font-weight: 500; }
.publish-box input { width: 20px; height: 20px; accent-color: var(--gold); }
.password-panel { margin: 0 20px 20px; border-top: 1px solid #e1d8c9; }
.password-panel summary { padding: 18px 0 10px; color: #665a45; cursor: pointer; font-size: 13px; font-weight: 750; }
.password-panel form { display: grid; gap: 12px; padding-bottom: 5px; }
.toast { position: fixed; z-index: 50; top: 18px; right: 20px; max-width: 380px; padding: 14px 18px; border: 1px solid; border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,.16); font-size: 14px; font-weight: 700; animation: toast-in .25s ease; }
.toast.success { border-color: #a7d4b7; color: #225d3c; background: #eef9f2; }
.toast.error { border-color: #e3b4ae; color: #8f3027; background: #fff1ef; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.auth-screen { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; color: #f8f2e7; background: var(--night); }
.auth-card { width: min(440px,100%); padding: 34px; border: 1px solid #4b402d; border-radius: 25px; background: #211d15; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.auth-icon { width: 56px; height: 56px; margin-bottom: 24px; border: 1px solid #67542f; border-radius: 16px; display: grid; place-items: center; color: #d0a44c; background: #2d2619; font-size: 24px; }
.auth-card h1 { margin: 8px 0 13px; font: 700 34px Georgia,serif; }
.auth-intro { margin: 0 0 22px; color: #bdb19d; font-size: 14px; line-height: 1.65; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { color: #eadfc9; }
.auth-form input { color: #fff; border-color: #5b4d32; background: #17140e; }
.auth-links { margin-top: 20px; display: flex; justify-content: space-between; gap: 16px; color: #bdb19d; font-size: 13px; }
.auth-links a:hover { color: #fff; }
.alert { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert.error { border-color: #744038; color: #ffc4bc; background: #3b211e; }
.alert.warning { border-color: #76633a; color: #f0d28f; background: #352d1d; }
.alert.success { border-color: #376a4b; color: #bce8c9; background: #1e3929; }

@media (max-width: 1180px) {
    .admin-layout { grid-template-columns: 1fr; }
    .editor-card { position: static; }
    .lot-form { max-height: none; }
}
@media (max-width: 900px) {
    .hero-grid,.steps { grid-template-columns: 1fr; }
    .hero-grid { padding-block: 50px; gap: 42px; }
    .steps { gap: 30px; }
    .result-layout { grid-template-columns: 1fr; }
    .lot-details { border-top: 1px solid #e0d5c2; border-left: 0; }
}
@media (max-width: 720px) {
    .public-header-inner { min-height: 74px; }
    .brand img { width: 96px; height: 58px; }
    .brand-divider,.brand-label,.store-link { display: none; }
    .admin-link { padding: 9px 12px; font-size: 12px; }
    .hero-grid { min-height: auto; }
    .hero-copy h1 { font-size: 43px; }
    .search-panel { padding: 24px; border-radius: 23px; }
    .search-form > div { flex-direction: column; }
    .steps-grid,.benefits .content,.stats-grid { grid-template-columns: 1fr; }
    .steps { padding-block: 55px; }
    .result-card-header { padding: 25px; align-items: flex-start; flex-direction: column; }
    .result-main,.lot-details { padding: 25px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .not-found-card { padding: 26px; }
    .public-footer > div { align-items: flex-start; flex-direction: column; }
    .admin-header-inner { min-height: auto; padding-block: 15px; align-items: flex-start; flex-direction: column; }
    .admin-nav { width: 100%; flex-wrap: wrap; }
    .admin-nav > span { width: 100%; }
    .admin-main { width: min(100% - 24px,1500px); padding-top: 16px; }
    .card-header { align-items: flex-start; flex-direction: column; }
    .admin-tools { width: 100%; flex-direction: column; }
    .table-search input { width: 100%; }
    .field-grid.two,.field-grid.three { grid-template-columns: 1fr; }
    .metric-fields { grid-template-columns: 1fr 1fr 75px 34px; }
    .auth-card { padding: 26px; }
}

/* Botão do laudo imediatamente visível acima dos detalhes, em todas as telas */
.lot-details a.report-first { display: flex; align-items: center; justify-content: center; width: 100%; margin: 0 0 24px; text-align: center; line-height: 1.4; }
.lot-details .report-empty.report-first { display: block; margin: 0 0 24px; text-align: center; }
