:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --text: #15231d;
  --muted: #63716b;
  --line: #dfe6e2;
  --primary: #176b4a;
  --primary-dark: #105139;
  --primary-soft: #e7f4ed;
  --danger: #b42318;
  --shadow: 0 8px 30px rgba(21, 35, 29, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
main:focus { outline: none; }
.sidebar :focus-visible, .mobile-topbar :focus-visible { outline-color: #7ed7ad; }
.skip-link { position: absolute; top: -64px; left: 12px; z-index: 100; padding: 10px 16px; border-radius: 8px; color: white; background: var(--primary); font-weight: 750; text-decoration: none; }
.skip-link:focus { top: 12px; }
.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.app-main { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; color: #d9e7e0; background: #102d22; border-right: 1px solid #24483a; }
.sidebar-header { position: relative; padding: 27px 22px 22px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand { color: inherit; font-size: 23px; font-weight: 850; letter-spacing: -.05em; text-decoration: none; }
.sidebar-header .brand { color: white; }
.sidebar-header .brand::after { content: "."; color: #5cc795; }
.sidebar-header small { display: block; overflow: hidden; margin-top: 7px; color: #9db8ab; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; padding: 20px 14px; }
.sidebar-label { margin: 0 10px 8px; color: #779789; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.sidebar-label-spaced { margin-top: 24px; }
.sidebar-group { margin-bottom: 5px; }
.sidebar-group summary, .sidebar-link { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 10px 11px; border-radius: 9px; color: #c6d8cf; font-weight: 700; text-decoration: none; cursor: pointer; list-style: none; }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary:hover, .sidebar-link:hover { color: white; background: rgba(255, 255, 255, .07); }
.sidebar-group summary.active, .sidebar-link.active { color: white; background: rgba(79, 190, 137, .14); }
.nav-icon { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-chevron { width: 18px; height: 18px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
.sidebar-group[open] .sidebar-chevron { transform: rotate(180deg); }
.sidebar-submenu { position: relative; display: grid; gap: 2px; margin: 3px 0 9px 20px; padding-left: 24px; }
.sidebar-submenu::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 0; width: 1px; background: #355346; }
.sidebar-submenu a { padding: 8px 10px; border-radius: 7px; color: #9fb8ac; font-size: 13px; font-weight: 650; text-decoration: none; }
.sidebar-submenu a:hover { color: white; background: rgba(255, 255, 255, .06); }
.sidebar-submenu a.active { color: #7ed7ad; background: rgba(79, 190, 137, .1); }
.sidebar-account { display: flex; align-items: center; gap: 8px; padding: 15px 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-account > a { min-width: 0; display: flex; flex: 1; align-items: center; gap: 10px; color: white; text-decoration: none; }
.sidebar-account > a > span:last-child { min-width: 0; display: grid; }
.sidebar-account strong, .sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 13px; }
.sidebar-account small { margin-top: 2px; color: #91aa9e; font-size: 12px; }
.account-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; color: #102d22; background: #7ed7ad; font-weight: 850; }
.sidebar-account .nav-logout { color: #9fb8ac; }
.sidebar-account .nav-logout:hover { color: white; }
.mobile-topbar, .sidebar-close, .sidebar-backdrop { display: none; }
.page { padding-block: 48px 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-heading.compact { align-items: start; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 7px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.04em; margin-bottom: 8px; }
h2 { font-size: 19px; letter-spacing: -.02em; }
.muted, .section-heading p { color: var(--muted); margin-bottom: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.button { border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--primary); border-color: #b8d6c8; background: var(--primary-soft); }
.button-secondary:hover { background: #d9ede3; }
.button-ghost { border-color: var(--line); background: var(--surface); }
.button-ghost:hover { border-color: #b7c8bf; background: #f8fbf9; }
.button-outline { color: var(--primary); border-color: #b8d6c8; background: var(--surface); }
.button-outline:hover { background: var(--primary-soft); }
.button-small { min-height: 34px; padding: 6px 11px; border-radius: 8px; font-size: 13px; }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover { background: #8f1d14; }
.button-danger-ghost { color: var(--danger); border-color: #efc2be; background: #fff7f6; }
.button-danger-ghost:hover { background: #ffe8e5; }
.button-group { display: flex; gap: 10px; flex-wrap: wrap; }
.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.filters { display: grid; grid-template-columns: 1fr 220px; gap: 16px; padding: 18px; margin-bottom: 18px; }
label > span, .item-labels { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid #cbd6d0; border-radius: 8px; background: white; color: var(--text); padding: 9px 11px; font: inherit; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--primary); }
.choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-field > legend { display: block; margin-bottom: 7px; padding: 0; font-size: 13px; font-weight: 700; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23, 107, 74, .14); }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafbfa; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:hover { background: #fbfdfc; }
.number { text-align: right; }
.money { font-weight: 750; font-variant-numeric: tabular-nums; }
.table-link { color: var(--primary); font-weight: 800; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; }
.badge-entrada { color: #176b4a; background: #e4f4eb; }
.badge-saida { color: #9f3a12; background: #fff0e8; }
.category-tag { display: inline-flex; padding: 5px 9px; border-radius: 7px; color: #355e4b; background: #edf5f1; font-size: 12px; font-weight: 750; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-state p { color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 17px; }
.pagination a { color: var(--primary); font-weight: 750; }
.pagination span { color: var(--muted); font-size: 14px; }
.back-link { color: var(--primary); display: inline-block; margin-bottom: 16px; font-weight: 700; text-decoration: none; }
.stack { display: grid; gap: 20px; }
.location-results { min-width: 0; }
.page-section { margin-top: 32px; }
.form-section { padding: 26px; }
.section-heading, .heading-with-step { display: flex; gap: 14px; align-items: flex-start; }
.section-heading { margin-bottom: 24px; }
.section-heading h2, .section-heading p { margin-bottom: 3px; }
.step { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 19px; }
.full-width { grid-column: 1 / -1; }
.items-heading { justify-content: space-between; align-items: center; }
.item-labels, .item-row { display: grid; grid-template-columns: minmax(220px, 1fr) 190px 140px 170px 44px; gap: 12px; }
.item-labels { color: var(--muted); padding-inline: 2px; }
.item-forms { display: grid; gap: 10px; }
.item-row { align-items: start; padding: 12px; background: #fafcfa; border: 1px solid var(--line); border-radius: 10px; }
.item-row label > span.mobile-label { display: none; }
.delete-field { display: none; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--danger); font-size: 25px; cursor: pointer; }
.icon-button:hover { background: #fff0ef; }
.field-error, .form-error { display: block; color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-error { padding: 11px; background: #fff0ef; border-radius: 8px; margin-bottom: 14px; }
.form-error ul { margin-block: 0; }
.item-error { grid-column: 1 / -1; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.alert { padding: 13px 16px; border-radius: 9px; margin-bottom: 20px; }
.alert-success { color: #12563b; background: #def3e7; border: 1px solid #b9dfc9; }
.alert-warning { color: #73510d; background: #fff7d6; border: 1px solid #ead58a; }
.alert-error { color: #8f241b; background: #fff0ef; border: 1px solid #efc2be; }
.alert-error span { display: block; margin-top: 4px; }
.source-ok { color: #12563b; font-weight: 700; }
.source-error { color: #8f241b; font-size: .875rem; }
.source-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.source-card { border: 1px solid var(--line); padding: 20px; }
.source-card-ok { border-color: #b9dfc9; }
.source-card-pending { border-color: #d9dfe0; }
.source-card-error { border: 2px solid #d73a2f; background: #fff7f6; }
.source-fixed-card { margin-bottom: 18px; }
.source-fixed-description { margin-top: 16px; }
.source-card-header, .source-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.source-card-header h2 { margin: 4px 0 0; font-size: 1.2rem; }
.source-status { border-radius: 999px; background: #edf2f0; padding: 5px 10px; font-size: .78rem; font-weight: 700; }
.source-card-error .source-status { color: #8f241b; background: #ffdeda; }
.source-card-ok .source-status { color: #12563b; background: #def3e7; }
.source-details { margin: 18px 0; display: grid; gap: 8px; }
.source-details div { display: flex; justify-content: space-between; gap: 16px; }
.source-details dt { color: var(--muted); }
.source-details dd { margin: 0; text-align: right; font-weight: 600; }
.source-error-message { margin: 14px 0; border-radius: 8px; color: #8f241b; background: #ffe8e5; padding: 12px; font-size: .875rem; overflow-wrap: anywhere; }
.item-filters { display: grid; grid-template-columns: 2fr repeat(2, minmax(145px, .8fr)) 1fr; gap: 16px; align-items: end; padding: 18px; margin-bottom: 18px; }
.filter-q { grid-column: span 2; }
.filter-actions { display: flex; align-items: end; }
.results-summary { display: flex; align-items: baseline; gap: 7px; margin: 0 2px 10px; color: var(--muted); font-size: 14px; }
.results-summary strong { color: var(--text); font-size: 20px; }
.items-table .item-description { min-width: 260px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.quote-toolbar { display: flex; align-items: end; gap: 14px; margin-bottom: 18px; }
.quote-search { flex: 1; grid-template-columns: 1fr; margin-bottom: 0; }
.market-heading { margin-bottom: 20px; }
.action-menu { position: relative; flex: 0 0 auto; z-index: 12; }
.action-menu summary { list-style: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu-toggle { width: 46px; min-width: 46px; padding: 0; }
.action-menu[open] .action-menu-toggle { color: white; border-color: var(--primary); background: var(--primary); }
.action-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; display: grid; width: 250px; padding: 7px; box-shadow: 0 16px 42px rgba(21, 35, 29, .16); }
.action-menu-panel a { padding: 11px 12px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.action-menu-panel a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.action-menu-panel .action-menu-primary { margin-top: 4px; color: white; background: var(--primary); }
.action-menu-panel .action-menu-primary:hover { color: white; background: var(--primary-dark); }
.source-strip { display: flex; align-items: center; gap: 20px; padding: 14px 16px; margin-bottom: 16px; box-shadow: none; }
.source-strip-title { display: flex; align-items: center; gap: 10px; }
.source-strip-title > div { display: grid; gap: 1px; }
.source-strip-title small, .source-note { color: var(--muted); }
.source-pulse { width: 9px; height: 9px; border-radius: 50%; background: #28a46d; box-shadow: 0 0 0 5px #e2f4ea; }
.source-list { display: flex; gap: 7px; flex-wrap: wrap; }
.source-badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 750; text-decoration: none; }
.source-badge-ok { color: #12563b; background: #def3e7; border-color: #b9dfc9; }
.source-badge-pending { color: #73510d; background: #fff7d6; border-color: #ead58a; }
.source-badge-error { color: #8f241b; background: #ffdeda; border-color: #e69b94; }
.source-badge:hover { color: inherit; filter: brightness(.97); }
.quote-row-warning td { background: #fffdf3; }
.quote-row-warning td:first-child { box-shadow: inset 3px 0 #d9a928; }
.quote-row-error td { background: #fff7f6; }
.quote-row-error td:first-child { box-shadow: inset 3px 0 #d73a2f; }
.source-note { margin-left: auto; text-align: right; }
.quote-update-form { position: relative; }
.quote-update-button { width: 48px; min-width: 48px; padding: 0; }
.quote-update-button .default-label { line-height: 0; }
.loading-label { display: none; align-items: center; gap: 8px; }
.mini-spinner { width: 16px; height: 16px; border: 2px solid #a8cfbd; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.quote-update-form.htmx-request .default-label { display: none; }
.quote-update-form.htmx-request .loading-label { display: inline-flex; }
.quote-update-form button:disabled { cursor: wait; opacity: .78; }
.quote-loading { display: none; position: absolute; z-index: 10; top: calc(100% + 9px); right: 0; width: min(390px, calc(100vw - 24px)); align-items: center; gap: 12px; padding: 14px; border: 1px solid #b8d6c8; border-radius: 11px; color: #17583f; background: var(--surface); box-shadow: 0 14px 36px rgba(21, 35, 29, .14); }
.quote-loading > span:last-child { display: grid; gap: 2px; }
.quote-loading small { color: var(--muted); line-height: 1.35; }
.quote-update-form.htmx-request .quote-loading { display: flex; }
.quote-section-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 38px 2px 12px; }
.quote-section-title.first { padding-top: 8px; }
.quote-section-title h2, .quote-section-title p { margin-bottom: 0; }
.table-secondary { display: block; margin-top: 4px; color: var(--muted); }
.scope-tag { display: block; width: fit-content; margin: 4px 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.quote-row-actions, .fuel-price-action { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.quote-row-actions { justify-content: flex-start; }
.quote-manual-link { flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid #b8d6c8; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 20px; font-weight: 500; line-height: 1; text-decoration: none; }
.quote-manual-link:hover { color: white; background: var(--primary); }
.compact-form { width: min(620px, 100%); padding: 26px; }
.title-line { display: flex; align-items: center; gap: 12px; }
.title-line h1 { margin-bottom: 0; }
.summary-grid { display: grid; grid-template-columns: 1.5fr .7fr 1fr; gap: 16px; margin-bottom: 20px; }
.summary-card { padding: 20px; display: grid; gap: 8px; }
.summary-card span { color: var(--muted); font-size: 13px; }
.summary-card strong { font-size: 19px; }
.summary-card.accent { background: var(--primary); color: white; border-color: var(--primary); }
.summary-card.accent span { color: #cce8db; }
.section-title { padding: 20px 18px 0; }
.detail-table { margin-bottom: 20px; }
tfoot td { background: #fafbfa; font-weight: 800; border-bottom: 0; }
.note { padding: 22px; }
.note h2 { margin-bottom: 10px; }
.note p { margin-bottom: 0; color: var(--muted); }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 20px; align-items: start; }
.import-card, .help-card { padding: 26px; }
.movement-field { border: 0; padding: 0; margin: 0; }
.movement-field legend { font-size: 13px; font-weight: 750; margin-bottom: 8px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { position: relative; display: block; margin: 0; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card > span { display: grid; gap: 3px; min-height: 72px; padding: 14px; border: 1px solid #cbd6d0; border-radius: 10px; }
.radio-card small, .help-text, .file-drop small { color: var(--muted); font-weight: 450; }
.radio-card input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.radio-card input:checked + span { border-color: var(--primary); outline: 3px solid rgba(23, 107, 74, .12); background: var(--primary-soft); }
.help-text { display: block; margin-top: 8px; }
.file-drop { display: grid; gap: 8px; padding: 22px; border: 1px dashed #9eb5aa; border-radius: 12px; background: #fafcfa; }
.file-drop > span { margin: 0; }
.file-drop input { padding: 8px; background: var(--surface); }
.privacy-note { margin: -5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-error { display: grid; gap: 5px; margin: 0; }
.processing-hint { display: none; align-items: center; gap: 12px; padding: 13px; border-radius: 9px; color: #17583f; background: var(--primary-soft); }
.processing-hint span:last-child { display: grid; gap: 2px; }
.processing-hint small { color: var(--muted); }
.htmx-request .processing-hint { display: flex; }
.spinner { width: 24px; height: 24px; border: 3px solid #b5d9c7; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.help-card { background: #f0f7f3; }
.help-card ul { color: var(--muted); padding-left: 20px; line-height: 1.8; }
.help-card p { color: var(--muted); font-size: 14px; }
.ai-note { padding-top: 13px; border-top: 1px solid #cfe1d7; }
.htmx-indicator { display: none; }
.htmx-request .default-label { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.import-actions { margin-top: 4px; }
.format-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.import-error[hidden], .file-drop [hidden], .foto-botao[hidden] { display: none; }
.foto-botao { gap: 8px; width: 100%; min-height: 52px; font-size: 16px; }
.foto-status { color: var(--primary-dark); font-weight: 650; overflow-wrap: anywhere; }
[data-importar-nota][data-formato="foto"] .file-drop { padding: 12px 16px; border-style: solid; }
[data-importar-nota][data-formato="foto"] .file-drop input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.import-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; background: transparent; box-shadow: 0 24px 80px rgba(10, 30, 21, .24); }
.import-dialog[open] { display: block; position: fixed; inset: 16px 0 auto; margin: auto; z-index: 20; }
.import-dialog::backdrop { background: rgba(12, 24, 18, .58); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; background: var(--surface); border-radius: 16px; overflow-y: auto; max-height: calc(100vh - 32px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 26px; margin-bottom: 5px; }
.dialog-heading p:last-child { color: var(--muted); margin-bottom: 0; }
.dialog-close { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef2f0; color: var(--text); font-size: 25px; cursor: pointer; }
.format-cards .radio-card > span { min-height: 82px; }
.confirm-heading { align-items: center; }
.extracted-total { flex: 0 0 auto; min-width: 210px; padding: 15px 18px; border-radius: 12px; background: var(--primary); color: white; display: grid; gap: 4px; }
.extracted-total span { color: #cce8db; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.extracted-total strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.review-notice { display: grid; gap: 3px; margin-bottom: 20px; padding: 14px 17px; border: 1px solid #e7ce8a; border-radius: 10px; color: #694c08; background: #fff8df; }
.review-notice span { font-size: 14px; }
.confirm-actions { position: sticky; bottom: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow); backdrop-filter: blur(8px); }

.project-reference-card { margin-bottom: 20px; padding: 24px; }
.project-section-heading { margin-bottom: 20px; }
.project-section-heading h2, .project-step-heading h2 { margin-bottom: 4px; }
.project-reference-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.project-reference-form .button { white-space: nowrap; }
.project-workflow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 20px; }
.project-step-card { min-width: 0; padding: 24px; }
.project-step-heading { display: flex; gap: 13px; min-height: 62px; margin-bottom: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.project-step-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.project-step-number { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 13px; font-weight: 850; }
.project-field { display: block; min-width: 0; }
.project-field select { text-overflow: ellipsis; }
.project-step-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.project-step-actions .button { min-width: 180px; }
.project-checkbox-list > div { display: grid; gap: 9px; }
.project-checkbox-list > div > div > label { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfa; cursor: pointer; font-size: 14px; font-weight: 700; }
.project-checkbox-list > div > div > label:hover { border-color: #b8d6c8; background: var(--primary-soft); }
.project-checkbox-list input[type="checkbox"], .project-checkbox-list input[type="radio"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--primary); }
.project-create-link { display: inline-flex; margin-top: 15px; color: var(--primary); font-size: 14px; font-weight: 750; text-decoration: none; }
.project-create-link:hover { text-decoration: underline; }
.project-auto-association { display: grid; gap: 15px; padding: 18px; border: 1px solid #b8d6c8; border-radius: 11px; background: var(--primary-soft); }
.project-auto-association p { margin: 0; color: #355e4b; font-size: 14px; line-height: 1.5; }
.project-auto-association .button { width: 100%; }
.project-review { margin-top: 16px; }
.project-review summary { color: var(--primary); font-size: 14px; font-weight: 750; cursor: pointer; }
.project-review[open] summary { margin-bottom: 16px; }
.association-status { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.selected-row td { background: #f2f9f5; }
.selected-row td:first-child { box-shadow: inset 3px 0 var(--primary); }

.ai-integrations-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.ai-connect-card, .ai-help-card, .ai-connection-success { padding: 26px; }
.ai-choice-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ai-choice-fieldset > legend { margin-bottom: 10px; font-size: 13px; font-weight: 750; }
.ai-provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ai-provider-card, .ai-access-card { position: relative; display: flex; align-items: center; gap: 11px; margin: 0; cursor: pointer; }
.ai-provider-card { min-height: 82px; padding: 12px; border: 1px solid #cbd6d0; border-radius: 11px; }
.ai-provider-card input, .ai-access-card input { position: absolute; opacity: 0; pointer-events: none; }
.ai-provider-card:has(input:focus-visible), .ai-access-card:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.ai-provider-card:has(input:checked), .ai-access-card:has(input:checked) { border-color: var(--primary); outline: 3px solid rgba(23, 107, 74, .12); background: var(--primary-soft); }
.ai-provider-mark { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: white; background: #173c2e; font-size: 12px; font-weight: 850; }
.ai-provider-card > span:last-child, .ai-access-card > span:last-child, .ai-copy-field > div, .ai-config-heading > div { min-width: 0; display: grid; gap: 3px; }
.ai-provider-card small, .ai-access-card small, .ai-copy-field small, .ai-config-heading small, .ai-steps small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.ai-access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-access-card { min-height: 70px; padding: 13px 14px; border: 1px solid #cbd6d0; border-radius: 10px; }
.ai-help-card { background: #f0f7f3; }
.ai-help-card h2 { margin-bottom: 22px; }
.ai-steps { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.ai-steps li { display: flex; align-items: center; gap: 12px; }
.ai-steps li > span { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--primary); background: white; border: 1px solid #c9ded3; font-size: 12px; font-weight: 850; }
.ai-steps li > div { display: grid; gap: 2px; }
.ai-confirmation-note { margin-top: 24px; padding: 16px; border-radius: 10px; color: #17583f; background: white; border: 1px solid #c9ded3; }
.ai-confirmation-note p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ai-connection-success { margin-bottom: 20px; border-color: #9fd1b7; }
.ai-success-heading { display: flex; gap: 15px; margin-bottom: 22px; }
.ai-success-heading h2, .ai-success-heading p { margin-bottom: 4px; }
.ai-success-heading p:last-child { color: var(--muted); }
.ai-success-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-size: 22px; font-weight: 850; }
.ai-copy-field { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.ai-copy-field code { overflow: hidden; padding: 10px 12px; border-radius: 8px; background: #f3f6f4; text-overflow: ellipsis; white-space: nowrap; }
.ai-config-block { margin-top: 13px; padding: 16px; border-radius: 11px; color: #e6f4ed; background: #102d22; }
.ai-config-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 13px; }
.ai-config-heading small { color: #9db8ab; }
.ai-config-block pre { overflow-x: auto; margin: 0; padding: 15px; border-radius: 8px; background: #0a2118; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-security-note { margin: 16px 0 0; color: #73510d; font-size: 13px; line-height: 1.5; }
.ai-connections-section { margin-top: 34px; }

/* Componente de Gráfico de Linhas Histórico */
.chart-card { margin-bottom: 24px; padding: 24px 24px 18px; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.chart-eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 4px; }
.chart-title { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.03em; }
.chart-trend { display: flex; align-items: center; }
.trend-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 750; }
.trend-up { color: #12563b; background: #def3e7; border: 1px solid #b9dfc9; }
.trend-down { color: #8f241b; background: #fff0ef; border: 1px solid #efc2be; }
.trend-neutral { color: #4b6358; background: #edf5f0; border: 1px solid #d3e2da; }
.text-up { color: #12563b; }
.text-down { color: #8f241b; }
.text-neutral { color: #4b6358; }
.chart-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.chart-kpi { padding: 14px 16px; border-radius: 10px; background: #fafcfa; border: 1px solid var(--line); display: grid; gap: 4px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.chart-series-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; padding: 10px 14px; background: #f6faf7; border: 1px solid var(--line); border-radius: 8px; }
.series-legend-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.series-legend-list { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.series-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.series-legend-badge { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.series-legend-name { font-weight: 700; color: var(--text); }
.series-legend-price { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-svg-wrap { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; padding: 14px 12px 6px; overflow: hidden; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid-line { stroke: #e5ece8; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-axis-text { fill: #5a6e65; font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-axis-x { font-weight: 600; fill: #5a6e65; }
.chart-area { transition: opacity .2s ease; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point-group { outline: none; cursor: pointer; }
.chart-dot { fill: #ffffff; stroke: var(--primary); stroke-width: 2.5; transition: transform .15s ease, r .15s ease, stroke-width .15s ease; }
.chart-dot.dot-latest { fill: var(--primary); stroke: #ffffff; stroke-width: 2; }
.chart-dot.dot-min { stroke: #2563eb; }
.chart-dot.dot-max { stroke: #d97706; }
.chart-dot-hitbox { fill: transparent; cursor: pointer; }
.chart-point-group:focus-visible .chart-dot-hitbox { fill: rgba(23, 107, 74, .1); stroke: var(--primary); stroke-width: 2; }
.chart-point-group:hover .chart-dot, .chart-point-group:focus .chart-dot { r: 6.5; stroke-width: 3.5; fill: #ffffff; }
.chart-crosshair { stroke: #176b4a; stroke-width: 1.5; stroke-dasharray: 3 3; pointer-events: none; transition: opacity .15s ease; }
.chart-focus-dot { fill: #176b4a; stroke: #ffffff; stroke-width: 2.5; pointer-events: none; transition: opacity .15s ease; }
.chart-tooltip[hidden] { display: none !important; }
.chart-tooltip { display: none; position: absolute; pointer-events: none; z-index: 15; transform: translate(-50%, -100%); margin-top: -14px; background: #102d22; color: #ffffff; padding: 7px 11px; border-radius: 8px; font-size: 12px; box-shadow: 0 8px 24px rgba(16, 45, 34, 0.28); white-space: nowrap; gap: 2px; }
.chart-tooltip.is-visible { display: grid; }
.chart-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #102d22; }
.chart-tooltip-price { color: #7ed7ad; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-tooltip-meta { color: #d0e4da; font-size: 12px; }
.chart-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot-latest { background: var(--primary); border: 1.5px solid var(--primary); }
.legend-dot-min { background: #ffffff; border: 2.5px solid #2563eb; }
.legend-dot-max { background: #ffffff; border: 2.5px solid #d97706; }
.legend-dot-normal { background: #ffffff; border: 2px solid var(--primary); }
.legend-hint { color: var(--muted); font-size: 12px; margin-left: auto; }

/* Componente de Relação de Troca por Insumo no Tempo (SIagro theme) */
.exchange-chart-card { margin-top: 24px; margin-bottom: 24px; transition: opacity .15s ease; }
.exchange-chart-card.is-loading { opacity: .55; pointer-events: none; }
.exchange-chart-subtitle { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.exchange-chart-hint { color: var(--text); font-weight: 600; margin-left: 6px; }
.exchange-chart-header { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.exchange-chart-heading { min-width: 0; }
.exchange-single-note { margin: 0 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfa; color: var(--muted); font-size: 13px; line-height: 1.5; }
.exchange-single-note a { color: var(--primary); font-weight: 750; }
.exchange-header-controls { display: grid; align-content: start; gap: 10px; min-width: 0; }
.exchange-header-controls > .button { justify-self: end; }
.exchange-input-selector-wrap { min-width: 0; width: 100%; }
.exchange-input-selector-wrap .option-search { margin-bottom: 6px; }
.exchange-input-select { width: 100%; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #ffffff; color: var(--text); }
.exchange-svg-wrap { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; padding: 14px 12px 6px; overflow: hidden; }
.chart-axis-annotation { font-size: 11px; font-weight: 750; fill: #176b4a; letter-spacing: 0.02em; }
.chart-average-band { fill: #f0f8f4; opacity: 0.7; }
.chart-average-line { stroke: #8fa79b; stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-average-label { fill: #52665c; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-line-exchange { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot.dot-compra { fill: #ffffff; stroke: #176b4a; stroke-width: 2.5; }
.chart-dot.dot-ultima { fill: #176b4a; stroke: #ffffff; stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(23, 107, 74, 0.35)); }
.chart-dot.dot-best { stroke-width: 3.5; }
.chart-callout-text { fill: #176b4a; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .03em; }

.legend-dot-purchase { background: #ffffff; border: 2.5px solid #176b4a; }
.legend-dot-last { background: #176b4a; border: 1.5px solid #176b4a; }
.chart-decision { fill: none; stroke-width: 2.5; pointer-events: all; }
.chart-decision-compra { stroke: #b54a2a; }
.chart-decision-recusa { stroke: #c79016; }
.chart-decision-ajuste { stroke: #2563eb; }
.legend-dot-decision-compra { background: transparent; border: 2.5px solid #b54a2a; }
.legend-dot-decision-recusa { background: transparent; border: 2.5px solid #c79016; }
.decision-insumo-cell { min-width: 200px; max-width: 340px; white-space: normal; }
.legend-line-average { width: 16px; height: 0; border-top: 2px dashed #8fa79b; display: inline-block; }

.exchange-tooltip-input-price { font-size: 12px; color: #a3c4b5; margin-top: 2px; }

/* Comparativo de fornecedores por insumo */
.exchange-suppliers-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.exchange-suppliers-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.exchange-suppliers-title { font-size: 17px; font-weight: 800; margin: 0; }
.exchange-supplier-list { display: grid; gap: 12px; }
.exchange-supplier-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfa; display: grid; gap: 8px; }
.exchange-supplier-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.exchange-supplier-name { font-weight: 750; color: var(--text); }
.exchange-supplier-values { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.val-cash { font-weight: 800; color: #176b4a; }
.val-term { font-weight: 700; color: var(--muted); }
.exchange-supplier-bars-track { width: 100%; background: #eef3f0; border-radius: 6px; padding: 4px; }
.supplier-bar { height: 10px; border-radius: 4px; }
.bar-cash { background: #176b4a; }
.exchange-suppliers-footnote { margin: 12px 0 0; color: var(--muted); font-size: 12px; font-style: italic; }

/* Sistema de Alertas e Notificações */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #ffffff; background: #c2382e; margin-left: auto; }
.mobile-topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-alert-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: white; }
.mobile-alert-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.mobile-badge { position: absolute; top: 4px; right: 4px; display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #ffffff; background: #c2382e; }

.filter-card { margin-bottom: 24px; padding: 16px 20px; }
.alert-filter-form { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.filter-tabs { display: flex; align-items: center; gap: 6px; }
.filter-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); background: #f1f6f3; transition: color .15s ease, background-color .15s ease; text-decoration: none; }
.filter-tab:hover { color: var(--primary); background: #e3ede7; }
.filter-tab.active { color: #ffffff; background: var(--primary); }
.filter-tab-badge { display: inline-flex; align-items: center; justify-content: center; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #ffffff; background: #c2382e; }
.filter-inputs { display: flex; align-items: center; gap: 12px; }
.filter-select { min-width: 180px; }
.filter-search { display: flex; align-items: center; gap: 8px; }

.alert-grid { display: grid; gap: 14px; }
.alert-list-actions { display: flex; align-items: center; gap: 10px; }
.alert-list-actions form { margin: 0; }
.alert-list-actions .button { gap: 7px; white-space: nowrap; }
.alert-card { padding: 20px 22px; transition: border-color .15s ease, box-shadow .15s ease; }
.alert-card-unread { border-left: 4px solid var(--primary); background: #fafdfb; }
.alert-card-opportunity { border-left-color: #176b4a; }
.alert-card-warning { border-left-color: #d97706; }
.alert-card-urgent { border-left-color: #c2382e; background: #fffbfb; }
.alert-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.alert-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.alert-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.alert-tag-cotacao { color: #115739; background: #def3e7; }
.alert-tag-orcamento { color: #1e40af; background: #dbeafe; }
.alert-tag-nota { color: #854d0e; background: #fef3c7; }
.alert-tag-geral { color: #374151; background: #f3f4f6; }
.alert-level { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; }
.alert-level-oportunidade { color: #15803d; }
.alert-level-aviso { color: #b45309; }
.alert-level-urgente { color: #b91c1c; }
.alert-level-info { color: #4b5563; }
.alert-unread-pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; color: #ffffff; background: var(--primary); }
.alert-date { color: var(--muted); font-size: 12px; }
.alert-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.alert-message { margin: 0; color: #374740; font-size: 14px; line-height: 1.5; }
.alert-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.button-danger-text { color: #b91c1c !important; }
.button-danger-text:hover { background: #fee2e2 !important; }

/* Preferências e Configurações de Alertas */
.alert-page-heading { align-items: center; }
.alert-page-heading > div { max-width: 700px; }
.alert-settings-section { padding: 28px; }
.alert-section-heading { margin-bottom: 22px; }
.alert-section-heading h2 { margin-bottom: 5px; font-size: 24px; }
.alert-section-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.alert-section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.alert-preference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.alert-preference-card { min-height: 244px; display: flex; flex-direction: column; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.alert-preference-topline { display: flex; justify-content: space-between; align-items: center; }
.alert-preference-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 850; }
.alert-preference-card h3 { margin: 0 0 7px; font-size: 16px; }
.alert-preference-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.alert-toggle { position: relative; flex: 0 0 auto; display: inline-flex; cursor: pointer; }
.alert-toggle input[type="checkbox"] { position: absolute; width: 1px; min-height: 1px; height: 1px; opacity: 0; pointer-events: none; }
.alert-toggle-track { position: relative; display: block; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: #cbd6d0; transition: background .18s ease; }
.alert-toggle-track > span { position: absolute; top: 3px; left: 3px; display: block; width: 20px; height: 20px; margin: 0; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(21, 35, 29, .2); transition: transform .18s ease; }
.alert-toggle input:checked + .alert-toggle-track { background: var(--primary); }
.alert-toggle input:checked + .alert-toggle-track > span { transform: translateX(18px); }
.alert-toggle input:focus-visible + .alert-toggle-track { outline: 3px solid var(--primary); outline-offset: 2px; }
.alert-toggle.is-disabled { cursor: not-allowed; opacity: .55; }
.alert-canais-link { margin-top: 8px !important; }
.notif-canais { width: min(620px, 100%); margin-top: 20px; padding: 26px; }
.notif-lista { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.notif-canal { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.notif-canal:first-child { border-top: 0; padding-top: 0; }
.notif-canal:last-child { padding-bottom: 0; }
.notif-canal-info { min-width: 0; }
.notif-canal-info h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; font-size: 16px; }
.notif-canal-info p { margin: 0 0 4px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.notif-breve { padding: 2px 8px; border-radius: 999px; color: #66756e; background: #edf1ef; font-size: 12px; font-weight: 800; }
.notif-salvo { color: #12603f; font-weight: 750; }
.notif-form { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 0; }
@media (max-width: 520px) { .notif-canais { padding: 20px; } }
.alert-inline-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: #45564e; font-size: 12px; font-weight: 750; }
.alert-inline-setting > span { margin: 0; font-size: inherit; }
.alert-number-field { display: inline-flex !important; align-items: center; gap: 6px; }
.alert-number-field input { width: 68px; min-height: 36px; padding: 6px 8px; text-align: right; }
.alert-number-field small { color: var(--muted); font-weight: 650; }
.alert-settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.alert-settings-actions p { margin: 0 auto 0 0; color: var(--muted); font-size: 12px; }
.alert-price-section { margin-top: 40px; }
.price-alert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.price-alert-card { padding: 20px; box-shadow: none; }
.price-alert-card.is-paused { background: #f8faf9; opacity: .78; }
.price-alert-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.price-alert-card-heading h3 { margin: 6px 0 0; font-size: 16px; }
.price-alert-kind { color: var(--primary); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.price-alert-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; color: #66756e; background: #edf1ef; font-size: 12px; font-weight: 800; }
.price-alert-status.is-active { color: #12603f; background: #dff2e8; }
.price-alert-target { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 10px; margin: 20px 0; padding: 15px; border-radius: 10px; background: #f3f8f5; }
.price-alert-target > span { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.price-alert-target strong { font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price-alert-target small { padding-bottom: 3px; color: var(--muted); }
.price-alert-meta { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.price-alert-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.alert-empty-card { display: flex; align-items: center; gap: 18px; padding: 24px; box-shadow: none; }
.alert-empty-icon { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-weight: 850; }
.alert-empty-card > div { flex: 1; }
.alert-empty-card h3 { margin: 0 0 4px; }
.alert-empty-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* Formulário de meta de preço */
.price-rule-card { width: min(820px, 100%); margin-inline: auto; padding: 0 30px; }
.price-rule-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.price-rule-step-number { display: grid; place-items: center; width: 30px; height: 30px; margin: 0; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 13px; font-weight: 850; }
.price-rule-step-content { min-width: 0; }
.price-rule-step-heading { margin-bottom: 18px; }
.price-rule-step-heading h2 { margin: 0 0 4px; }
.price-rule-step-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
.field-label small { color: var(--muted); font-weight: 600; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.price-rule-product-field { margin-top: 16px; }
.price-rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.currency-field { display: grid; grid-template-columns: auto 1fr; align-items: center; overflow: hidden; border: 1px solid #cbd6d0; border-radius: 8px; background: white; }
.currency-field:focus-within { outline: 2px solid var(--primary); box-shadow: 0 0 0 4px rgba(23, 107, 74, .14); border-color: var(--primary); }
.currency-field > span { margin: 0; padding-left: 12px; color: var(--muted); font-size: 13px; font-weight: 750; }
.currency-field input { border: 0; border-radius: 0; }
.currency-field input:focus { outline: 0; box-shadow: none; }
.alert-option-toggle { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; cursor: pointer; }
.alert-option-toggle + .alert-option-toggle { border-top: 1px solid var(--line); }
.alert-option-toggle > span:first-child { margin: 0; }
.alert-option-toggle strong, .alert-option-toggle small { display: block; }
.alert-option-toggle small { max-width: 540px; margin-top: 4px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.price-rule-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 0 28px; }

/* Relatório de entradas e saídas */
.report-page-heading { align-items: center; }
.report-page-heading > div:first-child { max-width: 700px; }
.report-actions { justify-content: flex-end; }
.report-action-label-mobile, .report-mobile-filter-toggle { display: none; }
.report-filter-card { margin-bottom: 18px; padding: 20px; }
.report-filter-grid { display: grid; grid-template-columns: minmax(155px, .8fr) minmax(165px, .9fr) minmax(240px, 1.6fr) minmax(170px, 1fr) auto; align-items: end; gap: 14px; }
.report-filter-grid label > span { white-space: nowrap; }
.report-filter-grid > .button { white-space: nowrap; }
.report-custom-dates { display: grid; grid-template-columns: minmax(190px, 1fr) auto; grid-column: 1 / -1; align-items: end; gap: 18px; padding: 16px; border: 1px solid #cfe1d8; border-radius: 10px; background: #f5faf7; }
.report-custom-dates[hidden] { display: none; }
.report-custom-dates-heading { align-self: center; }
.report-custom-dates-heading strong, .report-custom-dates-heading small { display: block; }
.report-custom-dates-heading strong { margin-bottom: 3px; color: var(--primary); font-size: 14px; }
.report-custom-dates-heading small { color: var(--muted); line-height: 1.35; }
.report-custom-date-fields { display: grid; grid-template-columns: repeat(2, minmax(160px, 190px)); gap: 10px; }
.report-filter-error { grid-column: 1 / -1; }
.report-period-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); }
.report-period-summary > span { flex: 0 0 auto; padding: 5px 9px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.report-period-summary small { text-align: right; }
.report-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.report-kpi { position: relative; display: grid; gap: 7px; overflow: hidden; padding: 19px; box-shadow: none; }
.report-kpi::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: #a5b2ac; content: ""; }
.report-kpi-entry::before { background: #d97706; }
.report-kpi-exit::before, .report-kpi-balance::before { background: var(--primary); }
.report-kpi-balance.is-negative::before { background: var(--danger); }
.report-kpi > span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.report-kpi strong { font-size: 23px; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.report-kpi small { color: var(--muted); font-size: 12px; }
.report-kpi-balance.is-negative strong { color: var(--danger); }
.report-chart-card, .report-breakdown-card, .report-partner-card, .report-detail-card { padding: 22px; box-shadow: none; }
.report-chart-card { margin-bottom: 18px; }
.report-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-section-heading .eyebrow { margin-bottom: 4px; }
.report-section-heading h2 { margin: 0; }
.report-chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.report-chart-legend span { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.report-chart-legend span::before { width: 9px; height: 9px; border-radius: 3px; background: #d97706; content: ""; }
.report-chart-legend .is-exit::before { background: var(--primary); }
.report-chart-scroll { overflow-x: auto; padding: 4px 2px 2px; }
.report-chart { display: flex; align-items: stretch; gap: 8px; min-width: max-content; height: 245px; border-bottom: 1px solid var(--line); }
.report-chart-group { display: grid; grid-template-rows: 190px auto auto; gap: 5px; width: 70px; text-align: center; }
.report-chart-values { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 190px; padding-top: 8px; background: repeating-linear-gradient(to top, transparent 0, transparent 46px, #edf1ef 47px, transparent 48px); }
.report-bar { display: block; width: 20px; min-height: 2px; height: var(--report-bar-height); border-radius: 5px 5px 2px 2px; background: #d97706; }
.report-bar-exit { background: var(--primary); }
.report-chart-group > strong { font-size: 12px; }
.report-chart-group > small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.report-chart-mobile { display: none; }
.report-breakdown-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; margin-bottom: 18px; }
.report-breakdown-grid > *, .report-partner-stack, .report-breakdown-card, .report-partner-card { min-width: 0; }
.report-partner-stack { display: grid; gap: 14px; }
.report-compact-table th, .report-compact-table td { padding: 12px 10px; }
.report-ranking { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: ranking; }
.report-ranking li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); counter-increment: ranking; }
.report-ranking li:first-child { padding-top: 0; border-top: 0; }
.report-ranking li > span { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; margin: 0; }
.report-ranking li > span::before { grid-row: 1 / 3; color: #8a9992; font-size: 12px; font-weight: 800; content: counter(ranking) "."; }
.report-ranking strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.report-ranking small { color: var(--muted); font-size: 12px; }
.report-ranking b { flex: 0 0 auto; color: var(--primary); font-size: 13px; font-variant-numeric: tabular-nums; }
.report-detail-card { overflow: hidden; padding: 0; }
.report-detail-heading { margin: 0; padding: 22px; }
.report-detail-heading > strong { color: var(--primary); font-size: 13px; }
.report-note-list { display: none; }
.report-empty-inline { padding: 30px 16px; color: var(--muted); text-align: center; }
.report-invalid-state { margin-top: 18px; }

/* Relação de troca baseada em notas */
.exchange-heading { align-items: center; }
.exchange-heading > div:first-child { max-width: 720px; }
.exchange-mobile-filter-toggle { display: none; }
.exchange-filter-card { overflow: hidden; margin-bottom: 18px; padding: 0; }
.exchange-filter-section { padding: 22px; }
.exchange-filter-section + .exchange-filter-section { border-top: 1px solid var(--line); }
.exchange-filter-heading { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; margin-bottom: 18px; }
.exchange-filter-heading h2, .exchange-filter-heading p { margin: 0; }
.exchange-filter-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.exchange-step-number { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 850; }
.exchange-reference-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 18px; }
.exchange-reference-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.exchange-reference-fieldset legend, .exchange-unit-field > span, .exchange-purchase-filters label > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
.exchange-reference-options { max-height: 285px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf9; }
.exchange-reference-options > div > div + div { border-top: 1px solid var(--line); }
.exchange-reference-options label { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 11px 10px; cursor: pointer; font-size: 12px; line-height: 1.4; }
.exchange-reference-options input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); }
.exchange-unit-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.exchange-purchase-filters { display: grid; grid-template-columns: 170px minmax(220px, 1.4fr) minmax(180px, 1fr); gap: 14px; align-items: end; }
.exchange-custom-dates { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); grid-column: 1 / -1; gap: 12px; padding: 14px; border: 1px solid #cfe1d8; border-radius: 9px; background: #f5faf7; }
.exchange-custom-dates[hidden] { display: none; }
.exchange-filter-actions { display: flex; justify-content: flex-end; padding: 18px 22px; border-top: 1px solid var(--line); background: #f8faf9; }
.exchange-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.exchange-kpi { display: grid; gap: 7px; min-width: 0; padding: 19px; box-shadow: none; }
.exchange-kpi > span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.exchange-kpi > strong { font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.exchange-kpi > small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.exchange-kpi-primary { color: white; border-color: #176b4a; background: #176b4a; }
.exchange-kpi-primary > span, .exchange-kpi-primary > small { color: #ccebdd; }
.exchange-formula { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #cfe1d8; border-radius: 9px; color: #365248; background: #f1f8f4; font-size: 12px; line-height: 1.45; }
.exchange-reference-summary { margin-bottom: 18px; padding: 22px; box-shadow: none; }
.exchange-reference-summary .report-section-heading > strong { color: var(--primary); font-size: 12px; }
.exchange-reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.exchange-reference-list article { display: grid; gap: 9px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.exchange-reference-list article > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.exchange-reference-list a { color: var(--primary); font-size: 12px; font-weight: 850; }
.exchange-reference-list article > div > span { color: var(--muted); font-size: 12px; text-align: right; }
.exchange-reference-list article > strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-reference-list dl, .exchange-note-list dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.exchange-reference-list dt, .exchange-note-list dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.exchange-reference-list dd, .exchange-note-list dd { margin: 3px 0 0; font-size: 12px; font-weight: 750; }
.exchange-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.exchange-breakdown-card { min-width: 0; padding: 22px; box-shadow: none; }
.exchange-breakdown-card td:first-child small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.exchange-ranking { display: grid; margin: 0; padding: 0; list-style: none; }
.exchange-ranking li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.exchange-ranking li:first-child { padding-top: 0; border-top: 0; }
.exchange-ranking li > span { min-width: 0; }
.exchange-ranking li strong, .exchange-ranking li small { display: block; }
.exchange-ranking li strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-ranking li small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.exchange-ranking li b { flex: 0 0 auto; color: var(--primary); font-size: 12px; font-variant-numeric: tabular-nums; }
.exchange-note-list { display: none; }
.exchange-empty-state { padding: 34px; text-align: center; }
.exchange-empty-state h2 { margin: 0 0 6px; }
.exchange-empty-state p { margin: 0; color: var(--muted); }

/* Dashboard de relação de troca */
.dashboard-heading { align-items: center; }
.dashboard-heading > div:first-child { max-width: 720px; }
.dashboard-period-form { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; padding: 16px; }
.dashboard-period-form > label { width: 190px; }
.dashboard-period-form label > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; }
.dashboard-custom-dates { display: grid; grid-template-columns: repeat(2, 160px); gap: 10px; }
.dashboard-custom-dates[hidden] { display: none; }
.dashboard-period-form > .button { margin-left: auto; white-space: nowrap; }
.dashboard-period-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.dashboard-period-summary span { padding: 5px 9px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.dashboard-customize { margin-bottom: 14px; box-shadow: none; }
.dashboard-customize > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-radius: 14px; color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.dashboard-customize > summary::-webkit-details-marker { display: none; }
.dashboard-customize > summary:hover { background: var(--primary-soft); }
.dashboard-customize > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.dashboard-customize[open] > summary { border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.dashboard-customize-chevron { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.dashboard-customize[open] .dashboard-customize-chevron { transform: rotate(180deg); }
.dashboard-customize form { display: grid; gap: 14px; padding: 16px 18px 18px; }
.dashboard-customize .project-checkbox-list > div { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.dashboard-customize form > .button { justify-self: start; }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.dashboard-kpi { position: relative; display: grid; gap: 6px; min-width: 0; overflow: hidden; padding: 18px; box-shadow: none; }
.dashboard-kpi::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #9aaba3; content: ""; }
.dashboard-kpi.has-warning::before { background: #d97706; }
.dashboard-kpi > span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.dashboard-kpi > strong { font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dashboard-kpi > small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.dashboard-grain-section { margin-bottom: 20px; }
.dashboard-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dashboard-section-heading .eyebrow { margin-bottom: 3px; }
.dashboard-section-heading h2 { margin: 0; }
.dashboard-section-heading > a, .dashboard-section-heading > span { color: var(--primary); font-size: 12px; font-weight: 750; text-decoration: none; }
.dashboard-grain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-grain-card { position: relative; display: grid; gap: 16px; min-width: 0; overflow: hidden; padding: 22px; color: #ffffff; border-color: #176b4a; background: linear-gradient(135deg, #114d37, #176b4a); box-shadow: none; }
.dashboard-grain-milho { border-color: #8f6711; background: linear-gradient(135deg, #6f500f, #9b7118); }
.dashboard-grain-card.is-empty { color: var(--text); border-color: var(--line); background: #ffffff; }
.dashboard-grain-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dashboard-grain-card-heading > div > span, .dashboard-grain-card-heading > div > small { display: block; }
.dashboard-grain-card-heading > div > span { font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-grain-card-heading > div > small { margin-top: 3px; color: #c8e6d8; font-size: 12px; }
.dashboard-grain-milho .dashboard-grain-card-heading > div > small { color: #f0dfb8; }
.dashboard-grain-card.is-empty .dashboard-grain-card-heading small { color: var(--muted); }
.dashboard-grain-icon { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 900; }
.dashboard-grain-card.is-empty .dashboard-grain-icon { color: var(--primary); border-color: #cfe1d8; background: var(--primary-soft); }
.dashboard-grain-card > strong { font-size: clamp(25px, 3vw, 34px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dashboard-grain-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dashboard-grain-metrics span { display: grid; gap: 3px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.dashboard-grain-metrics small { color: #d4e9df; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-grain-milho .dashboard-grain-metrics small { color: #f3e5c6; }
.dashboard-grain-metrics b { font-size: 13px; font-variant-numeric: tabular-nums; }
.dashboard-trend { margin: 0; color: #d4e9df; font-size: 12px; }
.dashboard-trend.is-worse { color: #ffd2c8; }
.dashboard-trend.is-better { color: #aaf0ce; }
.dashboard-grain-card > a { justify-self: start; color: #ffffff; font-size: 12px; font-weight: 800; }
.dashboard-grain-empty { align-self: center; padding: 10px 0; }
.dashboard-grain-empty strong { font-size: 17px; }
.dashboard-grain-empty p { max-width: 330px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dashboard-evolution-card { margin-bottom: 20px; padding: 22px; box-shadow: none; }
.dashboard-bars { display: flex; align-items: flex-end; gap: 10px; min-width: max-content; height: 245px; overflow: visible; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.dashboard-evolution-card:has(.dashboard-bars) { overflow-x: auto; }
.dashboard-bar-group { display: grid; grid-template-rows: 18px 165px auto auto; gap: 5px; width: 74px; text-align: center; }
.dashboard-bar-value { color: var(--primary); font-size: 12px; font-weight: 800; }
.dashboard-bar-track { position: relative; height: 165px; border-radius: 6px 6px 2px 2px; background: repeating-linear-gradient(to top, transparent 0, transparent 40px, #edf1ef 41px, transparent 42px); }
.dashboard-bar-track span { position: absolute; right: 12px; bottom: 0; left: 12px; min-height: 2px; height: var(--dashboard-bar-height); border-radius: 5px 5px 2px 2px; background: var(--primary); }
.dashboard-bar-group > strong { font-size: 12px; }
.dashboard-bar-group > small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.dashboard-analysis-card, .dashboard-references-card, .dashboard-quality-card, .dashboard-quick-card { min-width: 0; padding: 20px; box-shadow: none; }
.dashboard-ranking { display: grid; grid-template-columns: minmax(0, 1fr); }
.dashboard-ranking > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.dashboard-ranking > div:first-child { padding-top: 0; border-top: 0; }
.dashboard-ranking span { min-width: 0; }
.dashboard-ranking strong, .dashboard-ranking small { display: block; }
.dashboard-ranking strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-ranking small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.dashboard-ranking b { flex: 0 0 auto; color: var(--primary); font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); align-items: start; gap: 16px; }
.dashboard-reference-feed { display: grid; grid-template-columns: minmax(0, 1fr); }
.dashboard-reference-feed a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.dashboard-reference-feed a:first-child { padding-top: 0; border-top: 0; }
.dashboard-reference-feed span { min-width: 0; }
.dashboard-reference-feed strong, .dashboard-reference-feed small { display: block; }
.dashboard-reference-feed strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-reference-feed small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.dashboard-reference-feed b { flex: 0 0 auto; color: var(--primary); font-size: 12px; }
.dashboard-side-stack { display: grid; gap: 14px; }
.dashboard-quality-card h2 { margin: 0 0 6px; font-size: 17px; }
.dashboard-quality-card > p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dashboard-quality-card > a { color: var(--primary); font-size: 12px; font-weight: 800; }
.market-grain { display: grid; gap: 12px; }
.market-grain + .market-grain { margin-top: 36px; }
.market-grain > .chart-card { margin-bottom: 0; }
.market-summary-card { padding: 22px 24px; box-shadow: none; }
.market-quote { margin: 0 0 6px; }
.market-locals { display: grid; margin: 14px 0 0; padding: 0; list-style: none; }
.market-locals li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.market-source { margin-top: 28px; }
.table-card-note { margin: 0; padding: 12px 18px 16px; font-size: 13px; }
.dashboard-quality-card.has-warning { border-color: #ead3a6; background: #fffbf2; }
.dashboard-quick-card { display: grid; }
.dashboard-quick-card > a { padding: 10px 0; border-top: 1px solid var(--line); color: var(--primary); font-size: 12px; font-weight: 750; text-decoration: none; }
.dashboard-quick-card > .eyebrow + a { border-top: 0; }

/* Utilitários de Alertas */
.button-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.filter-tab.active .filter-tab-badge { color: var(--primary); background: #ffffff; }
.form-actions-spaced { margin-top: 22px; }
.form-section-spaced { margin-top: 24px; }
.form-grid-2col { grid-template-columns: 1fr 1fr; gap: 14px; }


@media (max-width: 960px) {
  .app-shell { display: block; min-height: calc(100dvh - 62px); }
  .app-main { width: min(100% - 32px, 1120px); }
  .mobile-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 18px; color: white; background: #102d22; box-shadow: 0 5px 18px rgba(16, 45, 34, .16); }
  .mobile-topbar .brand::after { content: "."; color: #5cc795; }
  .sidebar-open { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; }
  .sidebar-open:hover { background: rgba(255, 255, 255, .08); }
  .sidebar-open svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .sidebar { position: fixed; left: 0; visibility: hidden; transform: translateX(-102%); width: min(300px, calc(100vw - 44px)); box-shadow: 18px 0 45px rgba(6, 23, 16, .28); transition: transform .22s ease, visibility 0s linear .22s; }
  .sidebar-close { position: absolute; top: 16px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 8px; color: #a9c1b6; font-size: 27px; line-height: 1; cursor: pointer; }
  .sidebar-close:hover { color: white; background: rgba(255, 255, 255, .08); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(8, 24, 17, .52); backdrop-filter: blur(2px); cursor: pointer; }
  .menu-aberto .sidebar { visibility: visible; transform: translateX(0); transition-delay: 0s; }
  .menu-aberto .sidebar-backdrop { display: block; }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-partner { grid-column: 1 / -1; }
  .report-filter-submit { justify-self: end; }
  .report-custom-dates { grid-template-columns: minmax(190px, 1fr) auto; }
  .ai-integrations-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1120px); }
  .page { padding-top: 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading.market-heading { align-items: flex-start; flex-direction: row; }
  .market-heading > div { min-width: 0; }
  .market-heading h1 { font-size: clamp(28px, 9vw, 42px); }
  .filters, .form-grid, .summary-grid, .item-filters { grid-template-columns: 1fr; }
  .filter-q { grid-column: auto; }
  .filter-actions .button { width: 100%; }
  .quote-toolbar { align-items: stretch; flex-direction: column; }
  .quote-section-title { align-items: flex-start; flex-direction: column; }
  .source-strip { align-items: flex-start; flex-direction: column; gap: 11px; }
  .source-note { margin-left: 0; text-align: left; }
  .quote-update-form { align-self: flex-end; }
  .quote-update-form .quote-update-button { width: 48px; }
  .quote-loading { position: static; width: 100%; margin-top: 9px; }
  .import-layout, .radio-cards { grid-template-columns: 1fr; }
  .form-section { padding: 18px; }
  .items-heading { align-items: stretch; flex-direction: column; }
  .item-labels { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 42px; }
  .item-row label:first-of-type { grid-column: 1 / -1; }
  .item-row label > span.mobile-label { display: block; }
  .remove-cell { grid-column: 3; grid-row: 3; }
  .form-actions .button { flex: 1; }
  .project-reference-form, .project-workflow-grid { grid-template-columns: 1fr; }
  .ai-integrations-layout, .ai-provider-grid, .ai-access-grid { grid-template-columns: 1fr; }
  .ai-copy-field { grid-template-columns: 1fr; }
  .ai-copy-field .button { width: 100%; }
  .ai-config-heading { align-items: stretch; flex-direction: column; }
  .project-reference-form .button, .project-step-actions .button { width: 100%; }
  .project-step-heading { min-height: 0; }
  .chart-card { padding: 18px 14px; }
  .chart-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .exchange-chart-header { grid-template-columns: 1fr; gap: 14px; }
  .exchange-header-controls { width: 100%; }
  .exchange-header-controls > .button { justify-self: stretch; }
  .chart-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .chart-kpi { padding: 10px 12px; }
  .chart-kpi .kpi-label { font-size: 12px; }
  .chart-kpi .kpi-value { font-size: 16px; }
  .chart-kpi .kpi-sub { font-size: 12px; }
  .chart-svg-wrap { padding: 10px 4px 4px; }
  .chart-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .chart-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; width: 100%; font-size: 12px; }
  .legend-hint { margin-left: 0; font-size: 12px; }
  .alert-filter-form { flex-direction: column; align-items: stretch; }
  .filter-tabs { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .filter-inputs { flex-direction: column; align-items: stretch; width: 100%; }
  .filter-select { width: 100%; }
  .filter-search { width: 100%; }
  .filter-search .input { flex: 1; }
  .alert-card { padding: 16px; }
  .alert-card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .alert-card-actions { width: 100%; justify-content: flex-start; }
  .alert-list-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .alert-list-actions form, .alert-list-actions .button { width: 100%; }
  .form-grid-2col { grid-template-columns: 1fr; }
  .alert-page-heading .button { width: auto; }
  .alert-preference-grid, .price-alert-grid { grid-template-columns: 1fr; }
  .alert-settings-section { padding: 20px; }
  .alert-preference-card { min-height: 0; }
  .alert-section-heading-row { align-items: stretch; flex-direction: column; }
  .alert-section-heading-row .button { width: 100%; }
  .alert-settings-actions { align-items: stretch; flex-direction: column; }
  .alert-settings-actions .button { width: 100%; }
  .alert-empty-card { align-items: flex-start; flex-direction: column; }
  .alert-empty-card .button { width: 100%; }
  .price-rule-card { padding-inline: 18px; }
  .price-rule-step { grid-template-columns: 28px minmax(0, 1fr); gap: 11px; }
  .price-rule-step-number { width: 27px; height: 27px; }
  .price-rule-fields { grid-template-columns: 1fr; }
  .price-rule-actions { align-items: stretch; flex-direction: column-reverse; }
  .price-rule-actions .button { width: 100%; }
  .report-page-heading { align-items: stretch; }
  .report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .report-actions .button { width: 100%; }
  .report-action-label-desktop { display: none; }
  .report-action-label-mobile { display: inline; }
  .report-mobile-filter-toggle.is-enhanced { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin-bottom: 12px; padding: 15px 17px; color: inherit; text-align: left; cursor: pointer; }
  .report-mobile-filter-toggle > span:first-child { min-width: 0; margin: 0; }
  .report-mobile-filter-toggle strong, .report-mobile-filter-toggle small { display: block; }
  .report-mobile-filter-toggle strong { margin-bottom: 3px; font-size: 14px; }
  .report-mobile-filter-toggle small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .report-mobile-filter-action { flex: 0 0 auto; margin: 0; color: var(--primary); font-size: 12px; font-weight: 800; }
  .report-filter-card.is-mobile-collapsed { display: none; }
  .report-filter-grid { grid-template-columns: 1fr; }
  .report-custom-dates { grid-template-columns: 1fr; grid-column: auto; gap: 14px; padding: 14px; }
  .report-custom-date-fields { grid-template-columns: 1fr; }
  .report-filter-grid > .button { width: 100%; }
  .report-period-summary { align-items: flex-start; flex-direction: column; }
  .report-period-summary small { text-align: left; }
  .report-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpi { min-height: 130px; padding: 15px; }
  .report-kpi strong { font-size: clamp(15px, 4.1vw, 18px); overflow-wrap: anywhere; }
  .report-kpi small { line-height: 1.3; }
  .report-chart-card { padding: 20px; }
  .report-chart-card .report-section-heading { margin-bottom: 16px; }
  .report-chart-legend, .report-chart-desktop { display: none; }
  .report-chart-mobile { display: grid; gap: 18px; }
  .report-chart-mobile-period { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
  .report-chart-mobile-period:first-child { padding-top: 0; border-top: 0; }
  .report-chart-mobile-period > strong { font-size: 12px; }
  .report-chart-mobile-row { display: grid; grid-template-columns: 56px minmax(40px, 1fr) auto; align-items: center; gap: 8px; }
  .report-chart-mobile-row > span { color: var(--muted); font-size: 12px; font-weight: 750; }
  .report-chart-mobile-row > i { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
  .report-chart-mobile-row > i > b { display: block; width: max(2px, var(--report-bar-width)); height: 100%; border-radius: inherit; background: #d97706; }
  .report-chart-mobile-row > i > b.is-exit { background: var(--primary); }
  .report-chart-mobile-row > em { min-width: 94px; font-size: 12px; font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
  .report-breakdown-grid { grid-template-columns: 1fr; }
  .report-breakdown-card, .report-partner-card { padding: 20px; }
  .report-compact-table, .report-compact-table tbody, .report-compact-table tr, .report-compact-table td { display: block; width: 100%; }
  .report-compact-table thead { display: none; }
  .report-compact-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 10px; padding: 15px 0; border-top: 1px solid var(--line); }
  .report-compact-table tr:first-child { padding-top: 0; border-top: 0; }
  .report-compact-table td { display: grid; gap: 4px; padding: 0; border: 0; text-align: left; }
  .report-compact-table td:first-child { grid-column: 1 / -1; }
  .report-compact-table td::before { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; content: attr(data-label); }
  .report-compact-table .money { font-size: 13px; }
  .report-ranking li { align-items: flex-start; flex-direction: column; gap: 8px; }
  .report-ranking li > span { width: 100%; }
  .report-ranking strong { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.35; }
  .report-ranking b { margin-left: 22px; }
  .report-partner-card .report-empty-inline { padding: 12px 0 4px; text-align: left; }
  .report-detail-table { display: none; }
  .report-note-list { display: grid; }
  .report-note-card { display: grid; gap: 13px; padding: 18px 20px; border-top: 1px solid var(--line); }
  .report-note-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .report-note-card-heading .table-link { font-size: 16px; }
  .report-note-partner small, .report-note-partner strong { display: block; }
  .report-note-partner small, .report-note-card dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .report-note-partner strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
  .report-note-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0; }
  .report-note-card dl > div { min-width: 0; }
  .report-note-card dt, .report-note-card dd { margin: 0; }
  .report-note-card dd { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
  .report-section-heading, .report-detail-heading { align-items: flex-start; flex-direction: column; }
  .exchange-heading { align-items: stretch; }
  .exchange-mobile-filter-toggle.is-enhanced { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-bottom: 12px; padding: 15px 17px; color: inherit; text-align: left; cursor: pointer; }
  .exchange-mobile-filter-toggle > span:first-child { min-width: 0; margin: 0; }
  .exchange-mobile-filter-toggle strong, .exchange-mobile-filter-toggle small { display: block; }
  .exchange-mobile-filter-toggle strong { margin-bottom: 3px; font-size: 14px; }
  .exchange-mobile-filter-toggle small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .exchange-mobile-filter-action { flex: 0 0 auto; margin: 0; color: var(--primary); font-size: 12px; font-weight: 800; }
  .exchange-filter-card.is-mobile-collapsed { display: none; }
  .exchange-filter-section { padding: 18px; }
  .exchange-reference-layout, .exchange-purchase-filters, .exchange-breakdown-grid { grid-template-columns: 1fr; }
  .exchange-custom-dates { grid-template-columns: 1fr; grid-column: auto; }
  .exchange-reference-options { max-height: 330px; }
  .exchange-filter-actions { padding: 15px 18px; }
  .exchange-filter-actions .button { width: 100%; }
  .exchange-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .exchange-kpi { min-height: 128px; padding: 15px; }
  .exchange-kpi > strong { font-size: clamp(15px, 4.3vw, 19px); }
  .exchange-reference-summary, .exchange-breakdown-card { padding: 18px; }
  .exchange-reference-list { grid-template-columns: 1fr; }
  .exchange-reference-list article > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .exchange-reference-list article > div > span { text-align: left; }
  .exchange-reference-list article > strong { white-space: normal; }
  .exchange-category-table, .exchange-category-table tbody, .exchange-category-table tr, .exchange-category-table td { display: block; width: 100%; }
  .exchange-category-table thead { display: none; }
  .exchange-category-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
  .exchange-category-table tr:first-child { padding-top: 0; border-top: 0; }
  .exchange-category-table td { display: grid; gap: 3px; padding: 0; border: 0; text-align: left; }
  .exchange-category-table td:first-child { grid-column: 1 / -1; }
  .exchange-category-table td::before { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; content: attr(data-label); }
  .exchange-ranking li { align-items: flex-start; flex-direction: column; gap: 7px; }
  .exchange-ranking li strong { white-space: normal; }
  .exchange-note-table { display: none; }
  .exchange-note-list { display: grid; }
  .exchange-note-list article { display: grid; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); }
  .exchange-note-list article > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .exchange-note-list article > div:first-child > strong { color: var(--primary); font-size: 12px; }
  .exchange-note-list p { margin: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
  .exchange-note-list dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-heading { align-items: stretch; }
  .dashboard-heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .dashboard-heading-actions .button { width: 100%; }
  .dashboard-period-form { align-items: stretch; flex-direction: column; }
  .dashboard-period-form > label { width: 100%; }
  .dashboard-custom-dates { grid-template-columns: 1fr; }
  .dashboard-period-form > .button { width: 100%; margin-left: 0; }
  .dashboard-period-summary { align-items: flex-start; flex-direction: column; }
  .dashboard-kpi-grid, .dashboard-grain-grid, .dashboard-analysis-grid, .dashboard-bottom-grid { grid-template-columns: 1fr; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-kpi { min-height: 118px; padding: 15px; }
  .dashboard-kpi > strong { font-size: 16px; }
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .dashboard-grain-card { padding: 19px; }
  .dashboard-grain-card > strong { font-size: 29px; }
  .dashboard-evolution-card { padding: 18px; }
  .dashboard-bars { height: 225px; }
  .dashboard-analysis-card, .dashboard-references-card, .dashboard-quality-card, .dashboard-quick-card { padding: 18px; }
  .dashboard-ranking strong, .dashboard-reference-feed strong { white-space: normal; }
  .dashboard-reference-feed a { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (max-width: 460px) {
  .report-kpi-grid { gap: 10px; }
}

@media print {
  :root { --bg: #ffffff; }
  .mobile-topbar, .sidebar, .sidebar-backdrop, .report-actions, .report-filter-card, .print-hidden, .nav-logout { display: none !important; }
  .app-shell { display: block; }
  .app-main { width: 100%; }
  .page { padding: 0; }
  .report-page-heading { margin-bottom: 16px; }
  .report-page-heading h1 { font-size: 28px; }
  .card { break-inside: avoid; box-shadow: none; }
  .report-chart-scroll { overflow: visible; }
  .report-chart { min-width: 0; }
  .report-chart-group { flex: 1; min-width: 36px; }
  .report-breakdown-grid { grid-template-columns: 1fr 1fr; }
  .report-detail-card { break-inside: auto; }
  .pagination { display: none; }
}



.nav-logout { border: 0; padding: 6px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; }
.nav-logout:hover { color: var(--primary); }
.auth-shell { min-height: 68vh; display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { margin-bottom: 22px; }
.auth-card label { display: grid; gap: 7px; margin-bottom: 15px; font-weight: 700; }
.auth-card .button { width: 100%; margin-top: 8px; }
.state-card { max-width: 680px; margin: 8vh auto; padding: 32px; }
.state-card-warning { border-color: #e7ce8a; background: #fff8df; }

.option-search { display: grid; gap: 5px; margin-bottom: 8px; }
.option-search-input { min-height: 38px; padding: 7px 11px; font-size: 13px; }
.option-search-status { color: var(--muted); font-size: 12px; }
.option-search-status:empty { display: none; }
.option-search-empty { padding: 14px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.exchange-reference-options [hidden], .option-search-empty[hidden] { display: none; }

/* Simulador de relação de troca (antes da compra) */
.simulador { display: grid; gap: 18px; }
/* Sem isso, uma tabela larga aberta alarga o cartão e a página inteira. */
.simulador > *, .simulador-resultados > *, .simulador-item > * { min-width: 0; }
.simulador-form { margin-bottom: 0; }
.simulador.htmx-request .simulador-resultados { opacity: .55; transition: opacity .15s ease; }
.simulador button:disabled { cursor: wait; opacity: .7; }
.simulador-add-row { display: grid; grid-template-columns: minmax(0, 1fr) 210px auto; align-items: end; gap: 12px; }
.simulador-add-row > label { min-width: 0; }
.simulador-lista { display: grid; gap: 8px; margin: 16px 0 6px; padding: 0; list-style: none; }
.simulador-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto 42px; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfa; }
.simulador-lista-produto { display: grid; gap: 2px; min-width: 0; }
.simulador-lista-produto small { color: var(--muted); font-size: 12px; }
.simulador-lista-preco { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.simulador-vazio, .simulador-aviso { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.simulador-referencias { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; border: 0; }
.simulador-referencia-opcao { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.simulador-referencia-opcao:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.simulador-referencia-opcao input { width: auto; margin: 3px 0 0; }
.simulador-referencia-opcao > span { display: grid; gap: 2px; margin-bottom: 0; }
.simulador-referencia-opcao small { color: var(--muted); font-size: 12px; font-weight: 400; }
.simulador-seletor select { width: 100%; }
.simulador-configuracao { padding: 2px 18px; }
.simulador-configuracao[open] { padding-bottom: 16px; }
.simulador-configuracao summary { min-height: 44px; padding-block: 12px; cursor: pointer; font-weight: 750; }
.simulador-configuracao p { margin: 10px 0 0; font-size: 13px; }
.simulador-configuracao form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 12px; }
.simulador-configuracao label { display: grid; gap: 6px; }
.simulador-resultados { display: grid; gap: 18px; }
.simulador-resultados-heading h2 { margin: 0 0 10px; }
.simulador-resultados-heading h2:focus { outline: none; }
.simulador-resultados-heading .exchange-formula { margin-bottom: 0; }
.simulador-resumo td.number strong { font-variant-numeric: tabular-nums; }
.simulador-item { display: grid; gap: 14px; padding: 22px; }
.simulador-item .chart-kpis { margin-bottom: 0; }
.simulador-item-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.simulador-item-titulo { min-width: 0; }
.simulador-item-titulo .eyebrow { margin: 0 0 4px; }
.simulador-item-heading h3 { margin: 0; font-size: 18px; }
.simulador-item-heading .trend-badge { flex-shrink: 0; }
.simulador-conta { margin: 0; color: var(--muted); font-size: 13px; }
.simulador-conta strong { color: var(--text); }
.simulador-ligacao { fill: none; stroke: #2563eb; stroke-width: 1.5; stroke-dasharray: 4 4; }
.simulador-proposta-dot { fill: #2563eb; stroke: #ffffff; stroke-width: 2.5; }
.simulador-proposta-rotulo { fill: var(--text); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.simulador-legend-proposta { background: #2563eb; border: 1.5px solid #2563eb; }
/* Compra estimada com o preço de hoje: contorno laranja e tracejado. */
.chart-dot.dot-estimada { stroke: #d97706; stroke-dasharray: 3 2; }
.chart-dot.dot-ultima.dot-estimada { fill: #fde68a; filter: none; }
.legend-dot-estimada { background: #ffffff; border: 2px dashed #d97706; }
.simulador-item > .alert { margin: 0; font-size: 13px; }
.badge-estimada { color: #73510d; background: #fff7d6; }
/* No celular a célula vira grid: a etiqueta fica do tamanho do texto. */
.simulador-compras .badge { justify-self: start; margin-right: 4px; padding: 2px 8px; font-size: 12px; }
.simulador-grafico-compacto { display: none; }
/* Contorno branco: os rótulos continuam legíveis quando a linha passa por baixo. */
.simulador-svg-wrap .chart-average-label, .simulador-svg-wrap .chart-axis-annotation, .simulador-svg-wrap .simulador-proposta-rotulo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
/* Dica do ponto: quebra linha para caber no gráfico e abre para baixo perto do topo. */
.simulador-svg-wrap .chart-tooltip { width: max-content; max-width: calc(100% - 8px); white-space: normal; }
.simulador-svg-wrap .chart-tooltip.is-below { transform: translate(-50%, 0); margin-top: 14px; }
.simulador-svg-wrap .chart-tooltip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #102d22; }
.simulador-compras summary { min-height: 44px; padding-block: 12px; cursor: pointer; font-size: 13px; font-weight: 750; }
.simulador-compras table { margin-top: 10px; font-size: 12px; }
.simulador-compras th, .simulador-compras td { padding: 10px 12px; }
.simulador-compras tr.is-fora td { color: var(--muted); }
.simulador-pre-compra { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.simulador-pre-compra .alert { margin: 0; }
.simulador-comprar > summary { display: inline-flex; list-style: none; cursor: pointer; }
.simulador-comprar > summary::-webkit-details-marker { display: none; }
.simulador-comprar[open] > summary { margin-bottom: 12px; }
.simulador-comprar form p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.simulador-comprar-campos { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: end; gap: 12px; }
/* Salvar simulação e simulações salvas */
.simulador-salvar > summary { display: inline-flex; list-style: none; cursor: pointer; }
.simulador-salvar > summary::-webkit-details-marker { display: none; }
.simulador-salvar[open] > summary { margin-bottom: 12px; }
.simulador-salvar form { display: grid; gap: 12px; padding: 18px; }
.simulador-salvar form p { margin: 0; color: var(--muted); font-size: 13px; }
.simulador-salvar-campos { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px; }
.simulador-salvar-campos label { display: grid; gap: 6px; min-width: 0; }
.simulador-salvar-acoes, .simulador-salvar-links { display: flex; flex-wrap: wrap; gap: 10px; }
.simulador-salvar-ok { display: grid; gap: 10px; margin: 0; }
.simulador-salvar-ok p { margin: 0; }
.simulacoes-salvas-lista { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.simulacao-salva-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.simulacao-salva-texto { display: grid; gap: 3px; min-width: 0; }
.simulacao-salva-nome { display: block; padding-block: 3px; color: var(--text); font-size: 16px; font-weight: 800; text-decoration: none; }
.simulacao-salva-nome:hover { color: var(--primary); }
.simulacao-salva-texto small { color: var(--muted); font-size: 12px; }
.simulacao-salva-acoes { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.simulacao-salva-acoes form, .simulacao-salva-botoes form { margin: 0; }

@media (min-width: 1280px) {
  /* Três botões numa linha só quando há espaço ao lado do título. */
  .dashboard-heading-actions { flex-wrap: nowrap; flex-shrink: 0; }
}

@media (max-width: 960px) {
  /* A barra do topo fica fixa: o cartão aberto por link não para debaixo dela. */
  .simulador-item, .simulador-resultados-heading h2 { scroll-margin-top: 80px; }
}

@media (max-width: 760px) {
  .dashboard-heading-actions .dashboard-simulate-button { grid-column: 1 / -1; }
  /* Campo com menos de 16 px faz o iPhone dar zoom ao focar. */
  .option-search-input, .exchange-input-select { font-size: 16px; }
  /* Links soltos (Visão geral e voltar) com área de toque de 44 px. */
  .dashboard-section-heading > a, .dashboard-grain-card > a, .dashboard-quality-card > a, .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  .simulador-resumo-card { display: none; }
  /* No celular vale o gráfico estreito, que cabe na tela sem rolar de lado. */
  .simulador-grafico-largo { display: none; }
  .simulador-grafico-compacto { display: block; }
  .simulador-grafico-compacto .chart-axis-text, .simulador-grafico-compacto .chart-axis-annotation, .simulador-grafico-compacto .chart-average-label, .simulador-grafico-compacto .simulador-proposta-rotulo { font-size: 13px; }
  .simulador-add-row { grid-template-columns: 1fr; }
  .simulador-add-row > .button { width: 100%; }
  .simulador-referencias { grid-template-columns: 1fr; }
  .simulador-item { padding: 18px; }
  .simulador-item-heading { flex-direction: column; }
  .simulador-comprar-campos { grid-template-columns: 1fr; }
  .simulador-comprar-campos .button { width: 100%; }
  .simulador-salvar > summary { width: 100%; justify-content: center; }
  .simulador-salvar-campos { grid-template-columns: 1fr; }
  .simulador-salvar-acoes .button, .simulador-salvar-links .button { flex: 1; }
  .simulacao-salva-card { flex-direction: column; align-items: stretch; padding: 16px; }
  .simulacao-salva-acoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simulacao-salva-acoes .button { width: 100%; }
  .simulacao-salva-botoes { display: grid; width: 100%; gap: 10px; }
  .simulacao-salva-botoes .button { width: 100%; }
  /* Tabelas em linhas empilhadas, com o nome da coluna em cima de cada valor. */
  .simulador-compras table, .simulador-compras tbody, .simulador-compras tr, .simulador-compras td,
  .decisao-tabela, .decisao-tabela tbody, .decisao-tabela tr, .decisao-tabela td { display: block; width: 100%; }
  .simulador-compras thead, .decisao-tabela thead { display: none; }
  .simulador-compras tr, .decisao-tabela tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; border-top: 1px solid var(--line); }
  .simulador-compras tr { padding: 12px 0; }
  .decisao-tabela tr { padding: 16px 18px; }
  .simulador-compras tr:first-child, .decisao-tabela tr:first-child { border-top: 0; }
  .simulador-compras td, .decisao-tabela td { display: grid; gap: 3px; min-width: 0; max-width: none; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .simulador-compras td::before, .decisao-tabela td::before { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; content: attr(data-label); }
  .simulador-compras td:nth-child(5), .decisao-tabela td:nth-child(9) { grid-column: 1 / -1; }
  .decisao-tabela td:nth-child(2) { order: -1; grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  /* Em tela bem estreita, o preço de cada item desce para baixo do nome. */
  .simulador-lista li { grid-template-columns: minmax(0, 1fr) 42px; row-gap: 4px; }
  .simulador-lista-produto { grid-column: 1; grid-row: 1; }
  .simulador-lista-preco { grid-column: 1; grid-row: 2; }
  .simulador-lista li > .icon-button { grid-column: 2; grid-row: 1 / span 2; }
}

/* Chat do assistente */
.app-main:has(.chat) { padding-block: 32px 24px; }
.chat-titulo { margin-bottom: 16px; }
.chat-titulo h1 { margin-bottom: 0; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: min(74dvh, 780px); min-height: 480px; }
.chat-cabecalho { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; background: #102d22; font-weight: 850; letter-spacing: -.05em; }
.chat-avatar i { font-style: normal; color: #5cc795; }
.chat-identidade { min-width: 0; }
.chat-identidade h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.chat-identidade p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.chat-memoria { margin-left: auto; flex: 0 0 auto; }
.chat-memoria .curto { display: none; }
.chat-lista { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; overflow-y: auto; overscroll-behavior: contain; background: #f3f7f5; }
.chat-lista:focus-visible { outline-offset: -3px; }
.chat-vazio { margin: auto; display: grid; justify-items: center; gap: 8px; max-width: 540px; text-align: center; }
.chat-vazio-icone { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.chat-vazio-icone svg, .chat-sugestao svg, .chat-botao-icone svg, .chat-arquivo svg, .chat-icone { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-vazio-icone svg { width: 24px; height: 24px; }
.chat-vazio h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.02em; }
.chat-vazio p { max-width: 44ch; margin: 0; color: var(--muted); line-height: 1.5; }
.chat-sugestoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.chat-sugestao { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid #cfe1d7; border-radius: 999px; color: var(--primary-dark); background: var(--surface); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.chat-sugestao:hover { border-color: #b8d6c8; background: var(--primary-soft); }
.chat-sugestao svg { flex: 0 0 auto; width: 18px; height: 18px; }
.chat-troca { display: flex; flex-direction: column; gap: 8px; }
.chat-bolha { max-width: min(78%, 680px); padding: 10px 14px; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-bolha p { margin: 0; }
.chat-bolha p + p { margin-top: 6px; }
.chat-bolha small { display: block; margin-top: 4px; font-size: 12px; opacity: 0.9; }
.chat-bolha-usuario { align-self: flex-end; color: white; background: var(--primary); border-bottom-right-radius: 4px; }
.chat-bolha-assistente { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-bolha-aviso { background: #fff7d6; border-color: #ead58a; color: #73510d; }
.chat-pensando { display: flex; align-items: center; gap: 10px; color: var(--muted); font-style: italic; }
.chat-pensando-pontos { display: inline-flex; align-items: center; gap: 4px; }
/* A etapa do assistente nunca quebra a linha: sem espaço, corta com reticências. */
.chat-pensando-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pensando-pontos span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: chat-pensando 1.2s infinite ease-in-out; }
.chat-pensando-pontos span:nth-child(2) { animation-delay: .15s; }
.chat-pensando-pontos span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-pensando { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-pensando-pontos span { animation: none; opacity: .6; } .chat-sugestao, .chat-campo { transition: none; } }
.chat-enviando-texto { white-space: pre-line; }
.chat-anexo-nome { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.chat-icone { flex: 0 0 auto; width: 16px; height: 16px; }
.chat-arquivos { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.chat-arquivos a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; }
.chat-botoes { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.chat-revisao { align-self: flex-start; max-width: min(78%, 680px); display: grid; gap: 8px; padding: 12px 14px; border: 1px solid #b8d6c8; border-radius: 12px; background: #f1f8f4; }
.chat-revisao-titulo { margin: 0; color: var(--primary-dark); font-size: 13px; font-weight: 800; }
.chat-revisao-texto { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-revisao-situacao { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.chat-botoes form { margin: 0; }
.chat-form { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-arquivo { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid #cfe1d7; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); font-size: 13px; font-weight: 700; }
.chat-arquivo[hidden] { display: none; }
.chat-arquivo > svg { flex: 0 0 auto; width: 16px; height: 16px; }
.chat-arquivo-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-arquivo-remover { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; }
.chat-arquivo-remover:hover { background: rgba(23, 107, 74, .12); }
.chat-arquivo-remover svg { width: 18px; height: 18px; }
.chat-campo { display: flex; align-items: flex-end; gap: 4px; padding: 5px; border: 1px solid #cbd6d0; border-radius: 18px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.chat-campo:has(textarea:focus) { border-color: var(--primary); outline: 2px solid var(--primary); box-shadow: 0 0 0 4px rgba(23, 107, 74, .14); }
.chat-campo textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: 11px 6px; border: 0; border-radius: 0; background: transparent; line-height: 1.4; resize: none; }
.chat-campo textarea:focus { outline: 0; box-shadow: none; }
.chat-botao-icone { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.chat-botao-icone svg { width: 22px; height: 22px; }
.chat-clipe:hover { color: var(--text); background: #eef2f0; }
.chat-campo:has(#chat-anexo:focus-visible) .chat-clipe { outline: 3px solid var(--primary); outline-offset: -1px; }
.chat-enviar { color: white; background: var(--primary); }
.chat-enviar:hover { background: var(--primary-dark); }
.chat-enviar:disabled { cursor: wait; opacity: .6; }
.chat-dica { margin: 0; padding-left: 6px; color: var(--muted); font-size: 12px; }
.chat-rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.chat-uso { position: relative; display: flex; align-items: center; gap: 6px; margin-left: auto; --uso-proprio: #176b4a; --uso-outros: #2f6db5; --uso-livre: #c3d0c9; }
.chat-uso-botao { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.chat-uso-botao:hover { background: #eef2f0; }
.chat-uso-botao svg { width: 26px; height: 26px; transform: rotate(-90deg); fill: none; stroke-width: 4.5; }
.chat-uso-trilha { stroke: var(--uso-livre); }
.chat-uso-arco-proprio { stroke: var(--uso-proprio); }
.chat-uso-arco-outros { stroke: var(--uso-outros); }
.chat-uso-resta { font-size: 12px; font-weight: 800; color: #9a4a06; }
.chat-uso-esgotado .chat-uso-resta { color: var(--danger); }
.chat-uso-detalhe { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5; width: max-content; max-width: min(260px, calc(100vw - 48px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 30px rgba(21, 35, 29, .16); }
.chat-uso-detalhe[hidden] { display: none; }
.chat-uso-titulo { margin: 0 0 8px; font-size: 13px; font-weight: 800; }
.chat-uso-legenda { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.chat-uso-legenda li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.chat-uso-legenda strong { font-variant-numeric: tabular-nums; }
.chat-uso-chave { width: 12px; height: 12px; border-radius: 50%; }
.chat-uso-chave-proprio { background: var(--uso-proprio); }
.chat-uso-chave-outros { background: var(--uso-outros); }
.chat-uso-chave-livre { background: var(--uso-livre); }
.chat-uso-nota { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.chat-form .form-error:empty { display: none; }
.chat-form .form-error { margin: 0; }
.chat-rastreamento { align-self: stretch; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 9px; padding: 8px 12px; background: var(--surface); }
.chat-rastreamento summary { cursor: pointer; font-weight: 700; }
.chat-rastreamento ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.chat-rastreamento pre { margin: 4px 0 0; padding: 6px 8px; white-space: pre-wrap; word-break: break-word; background: #f5f7f8; border-radius: 6px; font-size: 12px; max-height: 220px; overflow: auto; }
.chat-rastreamento-erro { color: var(--danger); font-weight: 700; }

/* Várias conversas: lista à esquerda, painel à direita (no celular, a lista abre por cima). */
.chat-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-painel { min-width: 0; }
.chat-lateral { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); height: min(74dvh, 780px); min-height: 480px; }
.chat-novo { margin: 0; }
.chat-novo-botao { width: 100%; gap: 8px; }
.chat-novo-botao .chat-icone { width: 18px; height: 18px; }
.chat-lateral-rolagem { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-inline: -4px; padding-inline: 4px; }
.chat-itens { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.chat-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.chat-item:hover { background: #f3f7f5; }
.chat-item.ativo { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.chat-item > .chat-icone { width: 20px; height: 20px; color: var(--primary); }
.chat-item-texto { min-width: 0; display: grid; gap: 2px; }
.chat-item-texto strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-item-texto small { color: var(--muted); font-size: 12px; }
.chat-lateral-rotulo { margin: 14px 8px 6px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.chat-lateral-vazio { margin: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.chat-arquivadas { margin-top: 12px; }
.chat-arquivadas summary { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.chat-arquivadas summary:hover { background: #f3f7f5; }
.chat-lateral-fechar { display: none; min-height: 44px; }
.chat-conversas-botao { display: none; flex: 0 0 auto; gap: 6px; min-height: 44px; }
.chat-conversas-botao .chat-icone { width: 18px; height: 18px; }
.chat-cabecalho { flex-wrap: wrap; }
.chat-identidade { flex: 1; }
.chat-identidade h2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.chat-menu { position: relative; flex: 0 0 auto; margin-left: auto; }
.chat-menu summary { list-style: none; min-height: 44px; gap: 6px; }
.chat-menu summary::-webkit-details-marker { display: none; }
.chat-menu .chat-icone { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.chat-menu-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: grid; min-width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 30px rgba(21, 35, 29, .16); }
.chat-menu-lista form { margin: 0; }
.chat-menu-lista a, .chat-menu-lista button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font: inherit; font-size: 14px; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer; }
.chat-menu-lista a:hover, .chat-menu-lista button:hover { background: #f3f7f5; }
.chat-menu-lista .chat-menu-perigo { color: var(--danger); }
.chat-menu-lista .chat-menu-perigo:hover { background: #fff1f0; }
.chat-renomear { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.chat-renomear input { flex: 1 1 200px; min-width: 0; }
.chat-aviso { flex: 1 0 100%; margin: 0; padding: 8px 12px; border: 1px solid #ead58a; border-radius: 9px; color: #73510d; background: #fff7d6; font-size: 13px; font-weight: 700; }
.chat-historico-nota { align-self: center; margin: 0; padding: 4px 12px; border-radius: 999px; color: var(--muted); background: #e8eeeb; font-size: 12px; }
.chat-arquivada { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-arquivada p { margin: 0; color: var(--muted); font-size: 14px; }
.chat-arquivada form { margin: 0; }
.chat-somente-leitura { justify-content: flex-start; }

@media (max-width: 960px) {
  .app-main:has(.chat) { padding-block: 20px 12px; }
  .chat { height: calc(100dvh - 150px); min-height: 400px; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .chat-lateral { display: none; height: auto; min-height: 0; max-height: 60dvh; }
  .chat-conversas-abertas .chat-lateral { display: flex; }
  .chat-conversas-abertas .chat-lateral-fechar { display: inline-flex; }
  .chat-conversas-abertas .chat { display: none; }
  .chat-conversas-botao { display: inline-flex; }
}

@media (max-width: 760px) {
  .chat-titulo { margin-bottom: 12px; }
  .chat-titulo h1 { font-size: 26px; }
  .chat-cabecalho { padding: 10px 12px; }
  .chat-memoria .longo { display: none; }
  .chat-memoria .curto { display: inline; }
  .chat-memoria { min-height: 44px; }
  .chat-menu-texto { display: none; }
  .chat-menu-lista { min-width: min(260px, calc(100vw - 48px)); }
  .chat-lista { padding: 14px; }
  .chat-bolha, .chat-revisao { max-width: 92%; }
  .chat-sugestoes { flex-direction: column; align-items: stretch; width: 100%; }
  .chat-sugestao { justify-content: flex-start; }
  .chat-botoes .button { flex: 1; min-height: 44px; }
  .chat-form { padding: 10px 12px 12px; }
  .chat-arquivo-remover { width: 44px; height: 44px; }
}

/* Uso de IA na Minha conta */
.uso-ia { display: grid; gap: 14px; margin-top: 18px; padding: 22px; }
.uso-cabecalho { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.uso-cabecalho h2 { margin: 0 0 4px; }
.uso-cabecalho p { margin: 0; }
.uso-mes { display: grid; gap: 4px; min-width: 190px; }
.uso-mes label { font-size: 13px; font-weight: 700; }
#uso-ia-dados { display: grid; gap: 10px; min-width: 0; }
.uso-resumo { margin: 0; font-size: 16px; }
.uso-valor { font-size: 26px; letter-spacing: -.02em; }
.uso-barra { width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; accent-color: var(--primary); background: #e3ebe7; appearance: none; }
.uso-barra::-webkit-progress-bar { background: #e3ebe7; }
.uso-barra::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.uso-barra::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.uso-nota { margin: 0; font-size: 13px; }
.uso-subtitulo { margin: 8px 0 0; font-size: 15px; }
.uso-tabela { border: 1px solid var(--line); border-radius: 10px; }
.uso-tabela th, .uso-tabela td { padding: 11px 14px; font-size: 14px; }
.uso-tabela tbody th { color: var(--text); background: transparent; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.uso-tabela tbody tr:last-child th, .uso-tabela tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  .uso-ia { padding: 16px; }
  .uso-mes { width: 100%; }
  .uso-tabela th, .uso-tabela td { padding: 10px 8px; font-size: 13px; }
  .uso-tabela tbody th { white-space: normal; }
  .uso-tabela thead th { font-size: 12px; letter-spacing: 0; }
}

/* O que o assistente lembra */
.memoria-cabecalho > div { max-width: 760px; }
.memoria-cabecalho > .button { flex-shrink: 0; }
.memoria-lista { display: grid; gap: 16px; }
.memoria-arquivo, .memoria-bloco { display: grid; gap: 12px; padding: 20px 22px; min-width: 0; }
.memoria-arquivo h2, .memoria-bloco h2 { margin: 0 0 4px; }
.memoria-bloco p { margin: 0; }
.memoria-arquivo-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.memoria-acoes form { margin: 0; }
.memoria-texto { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.memoria-corrigido { margin: 0; font-size: 13px; }
.memoria-aviso { margin: 0; font-weight: 700; color: var(--primary); }
.memoria-removida { padding-block: 14px; box-shadow: none; }
.memoria-atual { display: grid; gap: 4px; padding-left: 12px; border-left: 3px solid var(--line); }
.memoria-atual p { margin: 0; }
.memoria-form { display: grid; gap: 8px; }
.memoria-form label { font-weight: 700; }
.memoria-form textarea { width: 100%; min-height: 220px; font: inherit; line-height: 1.5; }
.memoria-form .muted { margin: 0; font-size: 13px; }
.memoria-perigo { border-color: #efc2be; }
.memoria-perigo form { margin: 0; }

@media (max-width: 760px) {
  .memoria-arquivo, .memoria-bloco { padding: 16px; }
  .memoria-acoes { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .memoria-acoes .button, .memoria-perigo .button { width: 100%; min-height: 44px; }
  .memoria-form .button-group > * { flex: 1 1 auto; min-height: 44px; }
}

/* Movimento reduzido: o estado continua legível, sem deslocamento nem giro */
@keyframes pulso { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .mini-spinner, .spinner { animation: pulso 1.6s ease-in-out infinite; }
  .sidebar, .sidebar-chevron, .chart-dot, .chart-area, .chart-crosshair, .chart-focus-dot, .exchange-chart-card, .alert-toggle-track, .alert-toggle-track > span, .filter-tab, .alert-card { transition: none; }
}

/* Funcionários e permissões */
.equipe-lista { display: grid; gap: 12px; }
.equipe-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 18px; align-items: center; padding: 16px 20px; }
.equipe-item-inativo { background: #fafbfa; }
.equipe-item-inativo .equipe-nome { color: var(--muted); }
.equipe-quem, .equipe-acesso { display: grid; gap: 5px; min-width: 0; }
.equipe-acesso { grid-auto-flow: row; justify-items: start; }
.equipe-nome, .equipe-contato, .equipe-titulo { overflow-wrap: anywhere; }
.equipe-contato { font-size: 13px; }
.equipe-acoes { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.equipe-acoes form { margin: 0; }
.equipe-ok { color: #12563b; font-size: 13px; font-weight: 700; }
.badge-ajuste { color: #73510d; background: #fff2c2; }
.permissoes-painel { display: grid; gap: 18px; }
.permissoes-painel > .alert { margin-bottom: 0; }
.perm-resumo { padding: 18px 22px; }
.perm-resumo h2 { margin-bottom: 6px; overflow-wrap: anywhere; }
.perm-resumo p:last-child { margin-bottom: 0; }
.perm-bloco { padding: 22px; display: grid; gap: 18px; }
.perm-bloco-titulo { display: flex; gap: 14px; align-items: flex-start; }
.perm-bloco-titulo h2, .perm-bloco-titulo p { margin-bottom: 3px; }
.perm-grupos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perm-grupo { display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px; border: 1px solid #cbd6d0; border-radius: 10px; cursor: pointer; }
.perm-grupo > span { display: grid; gap: 3px; min-width: 0; }
.perm-grupo strong { overflow-wrap: anywhere; }
.perm-grupo small { color: var(--muted); font-size: 13px; font-weight: 450; }
.perm-grupo input { margin-top: 4px; }
.perm-grupo-atual { border-color: var(--primary); background: var(--primary-soft); }
.perm-grupo:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.perm-grupos-coluna { grid-template-columns: minmax(0, 1fr); }
.perm-acoes { margin-top: 2px; }
.perm-comparacao summary { cursor: pointer; font-weight: 750; color: var(--primary); }
.perm-comparacao .table-wrap { margin-top: 12px; }
.perm-comparacao th, .perm-comparacao td { padding: 10px 12px; }
.perm-comp-pagina { background: transparent; color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; }
.perm-comp-nenhum { color: #9aa7a1; }
.perm-comp-ver { color: #355e4b; }
.perm-comp-editar { color: var(--primary); font-weight: 750; }
.perm-modulo { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.perm-modulo > legend { padding: 0 10px 0 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.perm-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 8px; border-bottom: 1px solid #eef2f0; }
.perm-linha:last-child { border-bottom: 0; }
.perm-linha-ajustada { background: #fffbea; border-radius: 8px; }
.perm-linha-fora .perm-nome > span { color: var(--muted); }
.perm-nome { display: grid; gap: 2px; min-width: 0; }
.perm-nome > span { font-weight: 700; overflow-wrap: anywhere; }
.perm-nome small { font-size: 12px; }
.perm-ajuste-nota { color: #73510d; }
.perm-opcoes { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.perm-opcao { display: block; position: relative; margin: 0; cursor: pointer; }
.perm-opcao input { position: absolute; opacity: 0; pointer-events: none; }
.perm-opcao span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 13px; margin: 0; border: 1px solid #cbd6d0; border-radius: 999px; background: white; font-size: 13px; font-weight: 700; color: #355e4b; white-space: nowrap; }
.perm-opcao input:checked + span { border-color: var(--primary); background: var(--primary); color: white; }
.perm-opcao input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.perm-opcao input:disabled + span { opacity: .7; cursor: default; }
.perm-especial { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; margin: 0; cursor: pointer; }
.perm-especial > span { display: grid; gap: 2px; min-width: 0; margin: 0; }
.perm-especial strong { font-size: 14px; }
.perm-especial small { color: var(--muted); font-size: 13px; font-weight: 450; }
.perm-especial input { margin-top: 4px; }
@media (max-width: 760px) {
  .equipe-item { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
  .equipe-acoes { justify-content: flex-start; }
  .equipe-acoes .button { min-height: 44px; }
  .perm-bloco { padding: 16px; }
  .perm-grupos { grid-template-columns: minmax(0, 1fr); }
  .perm-linha { grid-template-columns: minmax(0, 1fr); }
  .perm-opcao span { min-height: 44px; }
  .perm-acoes .button { width: 100%; min-height: 46px; }
}
