:root {
  --forest: #315f79;
  --forest-2: #386b87;
  --sage: #6da2ba;
  --mint: #e1eff5;
  --lime: #8fc4d8;
  --paper: #f3f8fa;
  --white: #fff;
  --ink: #1d2b33;
  --muted: #647680;
  --line: #d5e1e7;
  --danger: #b55242;
  --warning: #d49b37;
  --shadow: 0 12px 40px rgba(24, 49, 39, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--paper); }
body { min-height: 100%; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(110, 150, 123, .28); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { font-family: inherit; }
.icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100dvh; }
.sidebar { width: 242px; position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; padding: 28px 18px 20px; background: var(--forest); color: #d8e5dc; }
.brand { display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; padding: 0 10px 34px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--lime); font-weight: 800; letter-spacing: -.08em; font-size: 12px; line-height: 1; }
.brand strong { display: block; font-size: 19px; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: #9bb3a6; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.main-nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 13px; border: 0; border-radius: 10px; padding: 0 13px; color: #acc1b5; background: transparent; text-align: left; transition: .2s; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(220,235,225,.12); box-shadow: inset 3px 0 var(--lime); }
.nav-item .icon { width: 19px; }
.nav-count { margin-left: auto; min-width: 25px; padding: 2px 7px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 11px; text-align: center; }
.sidebar-footer { margin-top: auto; }
.connection { display: flex; gap: 8px; align-items: center; margin: 0 10px 18px; color: #a9beb2; font-size: 11px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgba(212,155,55,.12); }
.connection.online i { background: #84b4c8; box-shadow: 0 0 0 4px rgba(132,180,200,.14); }
.user-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 10px 0; border: 0; border-top: 1px solid rgba(255,255,255,.1); color: inherit; background: transparent; text-align: left; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: #d7e6db; font-weight: 700; font-size: 12px; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 12px; color: white; }
.user-card small { margin-top: 2px; color: #8da99a; font-size: 10px; }
.icon-button { border: 0; margin-left: auto; background: none; color: #8da99a; }
.top-profile { min-height: 40px; display: none; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 22px; background: white; }
.top-profile .avatar { width: 31px; height: 31px; }
.top-profile .user-role { color: #5f6c65; font-size: 10px; font-weight: 700; }

.main-content { min-width: 0; margin-left: 242px; min-height: 100dvh; padding: 0 42px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 12px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 4px; color: var(--sage); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
.topbar-actions { display: flex; gap: 12px; }
.sync-button, .notification { height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: #536159; }
.sync-button { padding: 0 14px; font-size: 12px; font-weight: 600; }
.sync-button.syncing .icon { animation: rotate 1s linear infinite; }
.notification { width: 40px; justify-content: center; position: relative; }
.notification i { width: 7px; height: 7px; position: absolute; top: 8px; right: 8px; border-radius: 50%; background: #d76b55; border: 2px solid white; }
@keyframes rotate { to { transform: rotate(360deg); } }

.view { display: none; padding-top: 32px; animation: reveal .25s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.welcome-row, .section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 27px; }
.welcome-row h2, .section-heading h2 { margin-bottom: 6px; font-size: 25px; letter-spacing: -.8px; }
.welcome-row p, .section-heading p { margin: 0; color: var(--muted); }
.primary-button, .ghost-button, .filter-toggle { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; padding: 0 16px; font-weight: 700; font-size: 12px; transition: .18s; }
.primary-button, .ghost-button, .filter-toggle, .sync-button, .nav-item, .text-button { white-space: nowrap; }
button[hidden], [data-access-hidden="true"] { display: none !important; }
.primary-button { border: 1px solid var(--forest); color: white; background: var(--forest); box-shadow: 0 7px 18px rgba(18,55,42,.16); }
.primary-button:hover { background: var(--forest-2); transform: translateY(-1px); }
.primary-button.small { min-height: 38px; }
.ghost-button.small { min-height: 38px; }
.primary-button.full { width: 100%; margin-top: 23px; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ghost-button, .filter-toggle { border: 1px solid var(--line); background: white; color: #4d5c54; box-shadow: none; }
.text-button { border: 0; padding: 0; color: var(--forest-2); background: none; font-size: 12px; font-weight: 700; }
.text-button span { margin-left: 5px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 18px; }
.metric-card { min-width: 0; min-height: 127px; display: flex; align-items: flex-start; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 3px 15px rgba(30,53,44,.025); }
.metric-card.primary { color: white; background: var(--forest); border-color: var(--forest); position: relative; overflow: hidden; }
.metric-card.primary::after { content: ''; width: 120px; height: 120px; position: absolute; right: -55px; bottom: -70px; border-radius: 50%; border: 22px solid rgba(185,214,122,.09); }
.metric-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--mint); color: var(--forest); }
.metric-icon.warning { background: #fbf1de; color: #ae7621; }
.metric-icon.muted { background: #edf0ed; color: #647069; }
.metric-icon.success { background: #e1eff5; color: #467e9d; }
.primary .metric-icon { background: rgba(255,255,255,.12); color: var(--lime); }
.metric-card p { margin: 1px 0 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card.primary p { color: #acc2b7; }
.metric-card strong { display: block; margin-bottom: 7px; font-size: 27px; letter-spacing: -1px; }
.metric-card small { color: #9aa49f; font-size: 9px; }
.metric-card small b { color: #94c29f; }

.dashboard-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 4px 22px rgba(29,56,45,.035); }
.panel-heading, .manage-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 18px; }
.panel-heading h3, .manage-heading h3 { margin-bottom: 4px; font-size: 15px; }
.panel-heading p, .manage-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.area-list { padding: 0 24px 22px; display: grid; gap: 14px; }
.area-row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 12px; align-items: center; }
.area-row span { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-row b { font-family: inherit; font-size: 11px; text-align: right; }
.progress { height: 6px; overflow: hidden; border-radius: 9px; background: #eef1ed; }
.progress i { height: 100%; display: block; border-radius: inherit; background: var(--sage); }
.area-row:nth-child(2) .progress i { background: #93ae73; }
.area-row:nth-child(3) .progress i { background: #5e8c82; }
.area-row:nth-child(4) .progress i { background: #bd9c5d; }
.area-row:nth-child(5) .progress i { background: #7290a0; }
.area-row:nth-child(6) .progress i { background: #a39485; }
.quality-score { display: flex; align-items: center; gap: 17px; padding: 0 24px 18px; }
.score-ring { --score: 0%; width: 86px; height: 86px; flex: none; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle at center, white 64%, transparent 65%), conic-gradient(var(--forest) var(--score), #e7ebe7 0); }
.score-ring strong { font-size: 19px; }
.score-ring small { color: var(--muted); font-size: 8px; }
.quality-score > div:last-child strong { font-size: 13px; }
.quality-score > div:last-child p { max-width: 170px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.issue-list { margin: 0 24px 22px; border-top: 1px solid var(--line); }
.issue-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #eff1ef; }
.issue-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.issue-row span { font-size: 11px; }
.issue-row strong { margin-left: auto; font-size: 11px; }
.recent-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 41px; padding: 0 20px; color: #88938d; background: #fafbfa; border-block: 1px solid var(--line); font-size: 9px; letter-spacing: .5px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid #eef1ee; color: #47544d; font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; color: var(--ink); font-size: 11px; }
td small { color: #839087; font-size: 9px; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 12px; font-size: 8px; font-weight: 800; letter-spacing: .4px; }
.status-pill.active { color: #386b87; background: #e1eff5; }
.status-pill.inactive { color: #7e6258; background: #eee8e4; }
.status-pill.password-pending { color: #7b5712; background: #fff0c9; }

.chips { display: flex; gap: 8px; margin-bottom: 17px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips button { flex: none; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 18px; background: white; color: #657069; font-size: 11px; font-weight: 600; }
.chips button.active { color: white; background: var(--forest); border-color: var(--forest); }
.filter-panel { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 15px; margin-bottom: 16px; }
.search-box { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: #8d9791; }
.search-box input { width: 100%; border: 0; outline: none; background: transparent; font-size: 12px; }
.filter-toggle b { padding: 2px 6px; border-radius: 10px; color: white; background: var(--sage); font-size: 9px; }
.advanced-filters { grid-column: 1/-1; display: none; grid-template-columns: repeat(4, 1fr) auto; gap: 12px; align-items: end; padding-top: 15px; border-top: 1px solid var(--line); }
.advanced-filters.open { display: grid; }
.advanced-filters label { color: #6c7771; font-size: 10px; font-weight: 700; }
.advanced-filters select { width: 100%; height: 38px; display: block; margin-top: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 11px; }
.advanced-filters .text-button { height: 38px; padding-inline: 10px; }
.result-summary { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 13px; color: var(--muted); font-size: 11px; }
.result-summary p { margin: 0; }
.result-summary strong { color: var(--ink); }
.result-summary label { display: flex; align-items: center; gap: 8px; }
.result-summary select { border: 0; color: var(--forest); background: transparent; font-weight: 700; }
.verba-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.verba-card { position: relative; min-height: 222px; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; transition: .2s; }
.verba-card:hover { transform: translateY(-2px); border-color: #cbd6ce; box-shadow: var(--shadow); }
.verba-card::before { content: ''; width: 4px; position: absolute; inset: 0 auto 0 0; background: var(--sage); opacity: 0; transition: .2s; }
.verba-card:hover::before { opacity: 1; }
.verba-top { display: flex; justify-content: space-between; margin-bottom: 14px; }
.verba-code { display: flex; align-items: center; gap: 8px; color: var(--forest); font-family: inherit; font-size: 18px; font-weight: 800; }
.verba-code i { width: 7px; height: 7px; border-radius: 50%; background: #568faa; }
.verba-code i.inactive { background: #9a9f9c; }
.card-menu { width: 28px; height: 28px; border: 0; border-radius: 6px; background: #f7f8f6; color: #829087; }
.verba-card h3 { height: 35px; margin-bottom: 6px; font-size: 13px; line-height: 1.35; }
.verba-card > p { height: 28px; margin-bottom: 16px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.45; }
.card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding-top: 13px; border-top: 1px solid #edf0ed; }
.card-meta div { min-width: 0; }
.card-meta span { display: block; margin-bottom: 3px; color: #98a19c; font-size: 8px; text-transform: uppercase; }
.card-meta strong { display: block; overflow: hidden; color: #45534b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-price { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12px; }
.card-price span { color: #8d9791; font-size: 8px; text-transform: uppercase; }
.card-price strong { color: var(--forest); font-size: 15px; }
.edit-verba { border: 0; background: transparent; color: var(--sage); font-size: 10px; font-weight: 700; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 40px; height: 40px; margin-bottom: 15px; color: #aab5ae; }
.empty-state h3 { color: var(--ink); }

.calculation-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(390px, 1.15fr); gap: 20px; align-items: start; }
.calc-form-panel { padding: 25px; }
.step-label { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.step-label > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest); font-family: inherit; font-size: 11px; font-weight: 800; }
.step-label strong, .step-label small { display: block; }
.step-label strong { font-size: 12px; }
.step-label small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.field-label { display: block; margin-bottom: 7px; color: #57645d; font-size: 10px; font-weight: 700; }
.lookup-input { display: flex; margin-bottom: 4px; }
.lookup-input input { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px 0 0 9px; outline: 0; font-family: inherit; font-size: 16px; font-weight: 700; }
.lookup-input input:focus { border-color: var(--sage); }
.lookup-input button { flex: none; display: flex; align-items: center; gap: 7px; padding: 0 16px; border: 0; border-radius: 0 9px 9px 0; color: white; background: var(--forest); font-size: 11px; font-weight: 700; }
.lookup-suggestions { display: none; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.lookup-suggestions.open { display: grid; }
.lookup-suggestions button { padding: 9px; border: 0; border-radius: 6px; background: white; text-align: left; font-size: 10px; }
.lookup-suggestions button:hover { background: var(--paper); }
.calc-form-panel hr { height: 1px; border: 0; margin: 28px 0 22px; background: var(--line); }
.quantity-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.quantity-row input, .unit-display { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.unit-display { display: flex; align-items: center; color: var(--muted); background: #f7f8f6; font-size: 10px; font-weight: 700; }
.money-input { height: 48px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.money-input:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(110,150,123,.12); }
.money-input span { height: 100%; display: grid; place-items: center; padding: 0 14px; color: var(--forest); background: #f1f5f1; border-right: 1px solid var(--line); font-family: inherit; font-weight: 800; }
.money-input input { width: 100%; height: 100%; padding: 0 14px; border: 0; outline: 0; font-family: inherit; font-size: 17px; font-weight: 700; }
.verba-confirmation { min-height: 0; overflow: hidden; border-radius: 14px; color: white; background: var(--forest); box-shadow: 0 18px 55px rgba(18,55,42,.16); }
.verba-confirmation.empty { display: grid; place-items: center; background: #edf0ec; color: var(--ink); border: 1px dashed #c8d0ca; box-shadow: none; }
.confirmation-placeholder { max-width: 260px; padding: 40px 20px; text-align: center; }
.placeholder-icon { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: #779083; background: #e0e6e1; }
.placeholder-icon .icon { width: 28px; height: 28px; }
.confirmation-placeholder h3 { margin-bottom: 8px; font-size: 16px; }
.confirmation-placeholder p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.confirmation-content { padding: 28px; }
.confirm-header { display: flex; justify-content: space-between; align-items: center; }
.confirm-header > div span, .confirm-header > div strong { display: block; }
.confirm-header > div span { margin-bottom: 2px; color: #91ab9e; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.confirm-header > div strong { color: var(--lime); font-size: 25px; }
.confirmation-content > h3 { margin: 22px 0 5px; font-size: 18px; }
.confirmation-content > p { margin-bottom: 22px; color: #9eb5a9; font-size: 10px; line-height: 1.5; }
.confirm-data { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid rgba(255,255,255,.12); }
.confirm-data div { min-height: 67px; padding: 14px 0; }
.confirm-data div:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.12); padding-right: 15px; }
.confirm-data div:nth-child(even) { padding-left: 18px; }
.confirm-data div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
.confirm-data span, .confirm-data strong { display: block; }
.confirm-data span, .unit-price span, .total-result span { margin-bottom: 5px; color: #87a497; font-size: 8px; text-transform: uppercase; letter-spacing: .6px; }
.confirm-data strong { font-size: 10px; }

.confirm-dialog { display: flex; flex-direction: column; }
.confirm-dialog > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 27px 18px; border-bottom: 1px solid var(--line); }
.confirm-dialog > header h2 { margin: 0; font-size: 19px; }
.confirm-body { display: grid; justify-items: center; gap: 16px; padding: 28px 24px 18px; text-align: center; }
.confirm-avatar { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; color: var(--forest); background: var(--mint); font-weight: 800; letter-spacing: -.08em; }
.confirm-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.confirm-dialog > footer { display: flex; justify-content: flex-end; gap: 9px; padding: 0 27px 20px; border-top: 0; }
.confirm-dialog > footer > button { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.confirm-dialog > footer .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--danger); border-radius: 9px; padding: 0 16px; color: white; background: var(--danger); font-weight: 700; font-size: 12px; }
.confirm-dialog > footer .danger-button:hover { filter: brightness(.96); }
.warning-box { padding: 14px 16px; margin-bottom: 16px; border: 1px solid #e5d5c8; border-radius: 10px; background: #fefbf8; color: #7e6258; }
.warning-box strong { display: block; margin-bottom: 6px; font-size: 13px; color: #5d4a3f; }
.warning-box p { margin: 0; font-size: 12px; line-height: 1.4; }
.unit-price { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.unit-price span { margin: 0; }
.unit-price strong { color: var(--lime); font-size: 21px; }
.total-result { margin-bottom: 16px; padding: 16px; border-radius: 9px; color: var(--forest); background: var(--lime); }
.total-result span, .total-result strong, .total-result small { display: block; color: var(--forest); }
.total-result-quantity > strong { margin-bottom: 3px; font-size: 24px; }
.total-result small { opacity: .75; font-size: 9px; }
.total-result-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(18,55,42,.16); }
.total-result-values > div { min-width: 0; }
.total-result-values span { margin-bottom: 3px; }
.total-result-values strong { overflow-wrap: anywhere; font-size: 14px; }
.result-difference { margin: 10px 0 0; padding: 7px 9px; border-radius: 7px; color: var(--forest); background: rgba(255,255,255,.42); font-size: 10px; font-weight: 750; line-height: 1.35; }
.result-difference::before { content: '≈'; margin-right: 5px; }
.result-difference.exact::before { content: '✓'; }
.result-difference.above { background: rgba(255,246,224,.65); }
.report-button { width: 100%; display: flex; gap: 11px; align-items: center; padding: 13px 0 0; border: 0; border-top: 1px solid rgba(255,255,255,.12); color: #c2d3ca; background: transparent; text-align: left; }
.report-button > span:nth-child(2) { flex: 1; }
.report-button strong, .report-button small { display: block; }
.report-button strong { font-size: 9px; }
.report-button small { margin-top: 2px; color: #789789; font-size: 8px; }

.tabs { display: flex; gap: 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; padding: 0 1px 12px; border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.tabs button.active { color: var(--forest); }
.tabs button.active::after { content: ''; height: 2px; position: absolute; inset: auto 0 -1px; background: var(--forest); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.manage-panel { overflow: hidden; }
.manage-actions { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 8px; }
.record-list { border-top: 1px solid var(--line); }
.record-row { display: grid; grid-template-columns: 62px minmax(180px, 1fr) 130px 90px 36px; gap: 15px; align-items: center; padding: 14px 24px; border-bottom: 1px solid #eef1ee; }
.record-row:last-child { border: 0; }
.record-code { color: var(--forest); font-family: inherit; font-weight: 800; }
.record-row strong, .record-row small { display: block; }
.record-row strong { font-size: 11px; }
.record-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.record-stat { color: var(--muted); font-size: 10px; }
.record-edit { width: 30px; height: 30px; border: 0; border-radius: 7px; color: var(--sage); background: #f2f5f2; }
.record-actions-group { display: flex; gap: 6px; align-items: center; }
.record-actions-group button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: #f2f5f2; color: var(--sage); cursor: pointer; transition: .2s; }
.record-actions-group button:hover { background: #e6ebe6; color: var(--forest); }
.record-actions-group button.danger { color: var(--danger); }
.record-actions-group button.danger:hover { background: #f5ebe8; }
.record-actions-menu { position: relative; }
.record-actions-menu button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: #f2f5f2; color: var(--sage); cursor: pointer; transition: .2s; display: flex; align-items: center; justify-content: center; }
.record-actions-menu button:hover { background: #e6ebe6; }
.record-actions-menu > ul { position: absolute; top: 100%; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.1); min-width: 140px; z-index: 100; }
.record-actions-menu li { margin: 0; }
.record-actions-menu button[type="button"] { width: 100%; height: auto; border-radius: 0; background: transparent; padding: 8px 12px; text-align: left; font-size: 13px; color: var(--ink); }
.record-actions-menu button[type="button"]:first-child { border-radius: 7px 7px 0 0; }
.record-actions-menu button[type="button"]:last-child { border-radius: 0 0 7px 7px; }
.record-actions-menu button[type="button"]:hover { background: #f5f6f2; }
.record-actions-menu button[type="button"].danger { color: var(--danger); }
.report-row { grid-template-columns: 120px 1fr 150px 100px; }
.subcategory-block { padding: 18px 24px 22px; border-top: 1px solid var(--line); background: #fafbfa; }
.subcategory-block h4 { margin: 0 0 11px; color: #5d6962; font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1.2; text-transform: uppercase; letter-spacing: .5px; }
.subcategory-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.subcategory-tags > span { padding: 6px 10px; border: 1px solid #dfe5df; border-radius: 15px; color: #59685f; background: white; font-size: 9px; }

.modal { width: min(570px, calc(100% - 28px)); max-height: calc(100dvh - 30px); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: white; box-shadow: 0 25px 80px rgba(9,30,22,.28); }
.large-modal { width: min(810px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(11,29,22,.55); backdrop-filter: blur(3px); }
.modal form > header { display: flex; justify-content: space-between; padding: 24px 27px 19px; border-bottom: 1px solid var(--line); }
.modal h2 { margin-bottom: 4px; font-size: 19px; }
.modal header p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-kicker { display: block; margin-bottom: 5px; color: var(--sage); font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.close-modal { border: 0; background: transparent; color: #849089; font-size: 23px; }
.modal footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 27px 20px; border-top: 0; }
.modal footer .close-modal { min-height: 42px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 22px 27px; overflow-y: auto; }
.form-grid label, .record-fields label, .dialog-label { color: #59665f; font-size: 10px; font-weight: 700; }
.form-grid label b, .dialog-label b { color: var(--danger); }
.form-grid input, .form-grid select, .form-grid textarea, .record-fields input, .record-fields select, .record-fields textarea, .dialog-label textarea { width: 100%; display: block; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; outline: 0; font-size: 11px; }
.form-grid input, .form-grid select, .record-fields input, .record-fields select { height: 40px; }
.form-grid textarea, .record-fields textarea, .dialog-label textarea { padding-block: 10px; resize: vertical; }
.relation-search { height: 35px; display: flex; align-items: center; gap: 7px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; color: #89958e; background: #fafbfa; }
.relation-search .icon { width: 15px; height: 15px; }
.relation-search input { height: 32px; margin: 0; padding: 0; border: 0; background: transparent; }
.relation-field > select { margin-top: -1px; border-radius: 0 0 8px 8px; }
.form-grid label small { display: block; margin-top: 5px; color: #949e98; font-size: 8px; font-weight: 400; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.switch-field > span { height: 40px; display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.switch-field input { display: none; }
.switch-field i { width: 34px; height: 19px; position: relative; border-radius: 12px; background: #cbd2cd; transition: .2s; }
.switch-field i::after { content: ''; width: 15px; height: 15px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: white; transition: .2s; }
.switch-field input:checked + i { background: var(--forest); }
.switch-field input:checked + i::after { left: 17px; }
.switch-field em { font-style: normal; font-size: 10px; }

.password-field { position: relative; display: flex; align-items: center; height: 48px; margin-top: 6px; padding: 0 52px 0 13px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.password-field input { width: 100%; height: 100%; padding: 0; margin: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.password-field input:focus { outline: 0; }
.password-field .password-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; min-width: 44px; height: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; box-shadow: none; color: #6b7a71; cursor: pointer; }
.password-field .password-toggle:hover { color: var(--forest); }
.password-field .password-toggle .icon { width: 18px; height: 18px; }

.record-fields { display: grid; gap: 15px; padding: 22px 27px; }
.report-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 22px 27px 15px; }
.report-types label { cursor: pointer; }
.report-types input { position: absolute; opacity: 0; }
.report-types span { min-height: 38px; display: grid; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.report-types input:checked + span { color: var(--forest); border-color: var(--sage); background: var(--mint); }
.dialog-label { display: block; padding: 0 27px 16px; }
.dialog-label textarea { min-height: 100px; }
.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.toast { max-width: 350px; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 9px; color: white; background: var(--forest); box-shadow: 0 14px 35px rgba(10,35,25,.25); font-size: 11px; animation: toast-in .25s ease; }
.toast.error { background: #8e4035; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.skeleton { border-radius: 8px; background: linear-gradient(100deg, #eef1ee 30%, #f7f8f7 50%, #eef1ee 70%); background-size: 200%; animation: shimmer 1.2s infinite; }
.skeleton.tall { height: 180px; }
@keyframes shimmer { to { background-position-x: -200%; } }
.mobile-nav { display: none; }
.profile-options { display: grid; gap: 9px; padding: 22px 27px 14px; }
.profile-option { cursor: pointer; }
.profile-option input { position: absolute; opacity: 0; pointer-events: none; }
.profile-card { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; transition: .18s; }
.profile-card > span:first-child { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--mint); font-family: inherit; font-size: 11px; font-weight: 800; }
.profile-card strong, .profile-card small { display: block; }
.profile-card strong { font-size: 11px; }
.profile-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-card i { width: 17px; height: 17px; margin-left: auto; border: 2px solid #c9d1cc; border-radius: 50%; }
.profile-option input:checked + .profile-card { border-color: var(--sage); background: #f3f8f4; box-shadow: 0 0 0 2px rgba(110,150,123,.12); }
.profile-option input:checked + .profile-card i { border: 5px solid var(--forest); }
.permission-summary { margin: 0 27px 22px; padding: 13px; border-radius: 9px; color: #536158; background: var(--paper); font-size: 10px; line-height: 1.6; }

@media (max-width: 1100px) {
  .main-content { padding-inline: 25px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .verba-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-filters { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 940px) and (min-width: 761px) {
  .sidebar { width: 205px; padding-inline: 12px; }
  .main-content { margin-left: 205px; padding-inline: 20px; }
  .dashboard-grid, .calculation-layout { grid-template-columns: 1fr; }
  .verba-grid { grid-template-columns: 1fr; }
  .advanced-filters { grid-template-columns: 1fr 1fr; }
  .topbar { height: 88px; }
  .panel-heading, .manage-heading { padding-inline: 19px; }
}

@media (max-width: 760px) {
  body { padding-bottom: 0; }
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 0 16px calc(82px + env(safe-area-inset-bottom)); }
  .topbar { height: 76px; }
  .topbar > div:first-child { min-width: 0; }
  .topbar h1 { font-size: 19px; }
  .sync-button span:not(.icon) { display: none; }
  .sync-button { width: 40px; padding: 0; }
  .top-profile { display: flex; }
  .topbar-actions { gap: 7px; }
  .view { padding-top: 23px; }
  .welcome-row, .section-heading { align-items: flex-start; }
  .welcome-row, .section-heading { gap: 12px; }
  .welcome-row h2, .section-heading h2 { font-size: 21px; }
  .welcome-row .primary-button, .section-heading .primary-button { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 118px; display: block; padding: 15px; }
  .metric-icon { float: right; width: 31px; height: 31px; }
  .metric-card strong { font-size: 23px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quality-panel { order: -1; }
  .recent-panel { display: none; }
  .panel-heading { padding: 19px 18px 15px; }
  .area-list { padding-inline: 18px; }
  .area-row { grid-template-columns: 115px 1fr 28px; }
  .filter-panel { grid-template-columns: 1fr auto; padding: 10px; }
  .filter-toggle { width: 43px; padding: 0; font-size: 0; }
  .filter-toggle .icon { width: 17px; }
  .advanced-filters { grid-template-columns: 1fr; }
  .advanced-filters .text-button { width: 100%; min-height: 44px; justify-content: center; border: 1px solid var(--line); border-radius: 8px; }
  .verba-grid { grid-template-columns: 1fr; }
  .verba-card { min-height: 210px; }
  .calculation-layout { grid-template-columns: 1fr; }
  .verba-confirmation { min-height: 0; }
  .confirmation-content { padding: 23px; }
  .record-row { grid-template-columns: 55px 1fr 35px; padding: 13px 17px; }
  .manage-heading { align-items: flex-start; gap: 12px; }
  .manage-actions { flex: none; width: 100%; }
  .manage-actions button { min-height: 44px; width: 100%; }
  .record-row .record-stat, .record-row .status-pill { display: none; }
  .report-row { grid-template-columns: 95px 1fr; }
  .report-row > :nth-child(n+3) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .report-types { grid-template-columns: 1fr 1fr; }
  .mobile-nav { height: 66px; display: flex; position: fixed; z-index: 30; inset: auto 0 0; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: white; box-shadow: 0 -8px 30px rgba(30,55,45,.08); }
  /* Prevent buttons from shifting when activated on native */
  .mobile-nav button { min-width: 0; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: white; color: #89938d; transform: none; }
  .mobile-nav button:active { transform: none; }
  .mobile-nav button.active { color: var(--forest); }
  .mobile-nav small { font-size: 8px; font-weight: 700; }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .mobile-nav .mobile-add { width: 48px; height: 48px; flex: 0 0 56px; align-self: center; justify-self: center; margin-top: -22px; border: 4px solid var(--paper); border-radius: 50%; color: white; background: var(--forest); font-size: 25px; box-shadow: 0 6px 18px rgba(18,55,42,.25); }
  .toast-region { right: 14px; bottom: 80px; left: 14px; }
  .toast { max-width: none; }
  .primary-button, .ghost-button, .filter-toggle { min-height: 46px; padding-inline: 15px; }
  .modal footer { display: grid; grid-template-columns: 1fr 1fr; padding-inline: 20px; }
  .modal footer button { width: 100%; min-width: 0; }
  .result-summary { gap: 10px; flex-wrap: wrap; }
  .permission-summary { margin-inline: 20px; }
  .profile-options { padding-inline: 20px; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card { min-height: 100px; }
  .notification { display: none; }
  .top-profile { width: 40px; flex: 0 0 40px; padding: 3px; }
  .top-profile .user-role { display: none; }
  .topbar h1 { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav { width: 100vw; max-width: 100%; }
  .filter-panel, .calc-form-panel, .verba-confirmation, .panel { min-width: 0; }
  .area-row { grid-template-columns: minmax(90px, 115px) minmax(0, 1fr) 28px; }
  .record-row { grid-template-columns: 55px 1fr 32px; }
  .record-row .record-stat, .record-row .status-pill { display: none; }
  .record-actions-group { display: none; }
  .record-actions-menu > ul { right: auto; left: -4px; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .quantity-row { grid-template-columns: 1fr 95px; }
  .lookup-input { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .lookup-input input, .lookup-input button { width: 100%; min-height: 46px; border-radius: 9px; }
  .report-types { grid-template-columns: 1fr; }
  .modal footer { grid-template-columns: 1fr; }
  .manage-heading { display: grid; }
  .manage-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}

/* Sistema visual 2.0: controles, ícones e organização */
:root {
  --surface: #ffffff;
  --surface-soft: #f7f9f7;
  --surface-muted: #eef3ef;
  --border: #dfe6e1;
  --border-strong: #cbd7cf;
  --text-secondary: #5f6f66;
  --text-tertiary: #76857c;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(49, 95, 121, .04), 0 6px 18px rgba(49, 95, 121, .05);
  --shadow-md: 0 12px 32px rgba(49, 95, 121, .11);
}

body { line-height: 1.45; background: #f3f6f4; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(55, 116, 83, .42); outline-offset: 2px; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; }
.icon svg { stroke-width: 2; }

.brand { padding: 0 10px 32px; }
.brand-mark { width: 44px; height: 44px; padding: 4px; overflow: hidden; background: rgba(220, 235, 225, .11); border: 1px solid rgba(255,255,255,.11); box-shadow: 0 8px 18px rgba(3, 20, 13, .18); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; transform: scale(1.18); }
.brand strong { font-size: 18px; letter-spacing: -.35px; }
.brand small { color: #a7c0b1; font-size: 10px; letter-spacing: 1.35px; }
.main-nav { gap: 7px; }
.nav-item { min-height: 48px; border-radius: 12px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.nav-item .icon { width: 20px; height: 20px; }
.nav-item.active { background: rgba(255,255,255,.105); box-shadow: inset 3px 0 0 var(--lime); }
.nav-item:active { transform: scale(.985); }
.nav-count { min-width: 27px; padding: 3px 8px; background: rgba(255,255,255,.12); }
.user-card { min-height: 58px; border-radius: 12px; padding: 10px; border-top: 1px solid rgba(255,255,255,.1); transition: background .18s ease; }
.user-card:hover { background: rgba(255,255,255,.06); }
.user-card .icon-button { width: 18px; height: 18px; }

.topbar { position: sticky; top: 0; z-index: 12; height: 92px; padding-inline: 2px; background: rgba(243,246,244,.92); border-bottom-color: var(--border); backdrop-filter: blur(16px); }
.topbar h1 { font-size: 21px; font-weight: 750; }
.eyebrow { color: #557d66; font-size: 10px; letter-spacing: 1.4px; }
.topbar-actions { align-items: center; gap: 9px; }

.primary-button, .ghost-button, .secondary-button, .filter-toggle, .sync-button, .compact-button, .icon-only-button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 11px; padding: 0 16px; font-size: 13px; line-height: 1; font-weight: 700;
  text-decoration: none; transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.primary-button { border-color: var(--forest); background: var(--forest); box-shadow: 0 7px 16px rgba(18,55,42,.14); }
.primary-button:hover { background: #386b87; border-color: #386b87; box-shadow: 0 9px 20px rgba(49,95,121,.21); transform: translateY(-1px); }
.primary-button:active, .ghost-button:active, .secondary-button:active, .filter-toggle:active, .compact-button:active { transform: translateY(0) scale(.98); }
.primary-button:disabled { opacity: .46; box-shadow: none; }
.ghost-button, .secondary-button, .filter-toggle, .sync-button { color: #405148; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(18,55,42,.025); }
.ghost-button:hover, .secondary-button:hover, .filter-toggle:hover, .sync-button:hover { color: var(--forest); background: #f8fbf9; border-color: var(--border-strong); }
.filter-toggle.active { color: var(--forest); border-color: #8eaf9b; background: #edf5ef; }
.filter-toggle .filter-chevron { width: 15px; height: 15px; transition: transform .18s ease; }
.filter-toggle.active .filter-chevron { transform: rotate(180deg); }
.primary-button.small, .ghost-button.small { min-height: 44px; padding-inline: 14px; }
.primary-button.full { margin-top: 20px; }
.text-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; border-radius: 9px; color: #285d42; font-size: 12px; }
.text-button:hover { background: #edf4ef; }
.text-button .icon { width: 16px; height: 16px; }
.danger-subtle { color: #9a463b; }
.danger-subtle:hover { color: #7f342c; background: #fbefed; }
.icon-only-button { width: 44px; min-width: 44px; padding: 0; border: 1px solid var(--border); color: #607067; background: var(--surface-soft); }
.icon-only-button:hover { color: var(--forest); border-color: var(--border-strong); background: var(--surface); }
.compact-button { min-height: 44px; padding: 0 10px; border: 1px solid transparent; color: #3f7256; background: transparent; font-size: 12px; box-shadow: none; }
.compact-button:hover { background: #edf5ef; border-color: #d8e6dc; }
.compact-button .icon { width: 16px; height: 16px; }
.sync-button { height: 44px; padding-inline: 14px; }
.top-profile { min-height: 44px; border-color: var(--border); box-shadow: 0 1px 2px rgba(18,55,42,.03); }

.view { max-width: 1420px; margin-inline: auto; padding-top: 30px; }
.welcome-row, .section-heading { margin-bottom: 24px; }
.welcome-row h2, .section-heading h2 { margin-bottom: 5px; font-size: clamp(22px, 2.1vw, 28px); font-weight: 760; letter-spacing: -.65px; }
.welcome-row p, .section-heading p { color: var(--text-secondary); font-size: 13px; }
.module-toolbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.module-toolbar-compact { min-height: 0; justify-content: flex-start; }
.module-description { max-width: 760px; margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.module-toolbar > .primary-button { min-width: 180px; flex: 0 0 auto; }
.module-toolbar,
.welcome-row,
.section-heading,
.panel-heading,
.manage-heading {
  align-items: center;
}
.module-toolbar > .primary-button,
.manage-actions > button,
.modal footer > button,
#verba-form > footer > button,
#record-form > footer > button,
#report-form > footer > button,
#user-form > footer > button,
#api-settings-form > footer > button,
.login-form > footer > button,
.account-sheet > footer > button {
  margin-inline: auto;
}
.panel { border-color: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.panel-heading, .manage-heading { padding: 22px 24px 18px; gap: 16px; }
.panel-heading > button, .manage-heading > button { min-width: 170px; }
.panel-heading h3, .manage-heading h3 { font-size: 15px; font-weight: 740; }
.panel-heading p, .manage-heading p { color: var(--text-secondary); font-size: 12px; }

.metric-grid { gap: 14px; }
.metric-card { min-height: 132px; padding: 20px; border-color: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric-card:not(.primary):hover { border-color: var(--border-strong); box-shadow: 0 8px 24px rgba(18,55,42,.06); }
.metric-icon { width: 40px; height: 40px; border-radius: 11px; }
.metric-card p { color: var(--text-secondary); font-size: 12px; }
.metric-card strong { margin: 3px 0 6px; font-size: 28px; font-weight: 760; }
.metric-card small { color: var(--text-tertiary); font-size: 11px; }
.metric-card.primary p { color: #b8cbbf; }
.metric-card.primary small { color: #b2c5ba; }
.metric-card.primary small b { color: #b9d989; }

.area-row span, .area-row b { font-size: 12px; }
.progress { height: 7px; }
.quality-score > div:last-child strong { font-size: 14px; }
.quality-score > div:last-child p { max-width: 210px; font-size: 11px; }
.issue-row { min-height: 44px; }
.issue-row span, .issue-row strong { font-size: 12px; }
th { height: 45px; color: #68776e; font-size: 10px; }
td { padding-block: 15px; color: #4e5e55; font-size: 12px; }
td strong { font-size: 12px; }
td small { font-size: 10px; }

.chips { gap: 8px; padding-bottom: 4px; }
.chips button { min-height: 44px; height: 44px; padding: 0 15px; border-color: var(--border); color: #596a61; font-size: 12px; }
.chips button:hover { color: var(--forest); border-color: var(--border-strong); background: #f8faf8; }
.chips button.active { box-shadow: 0 5px 13px rgba(18,55,42,.12); }
.filter-panel { padding: 14px; gap: 10px; border-radius: var(--radius-md); }
.search-box { min-height: 46px; border-color: var(--border); border-radius: 11px; background: #fbfcfb; }
.search-box:focus-within { border-color: #6da2ba; box-shadow: 0 0 0 3px rgba(109,162,186,.16); background: white; }
.search-box input { font-size: 13px; }
.advanced-filters { gap: 14px; }
.advanced-filters label { color: #56665d; font-size: 11px; }
.advanced-filters select { height: 44px; border-color: var(--border); border-radius: 10px; font-size: 12px; }
.result-summary { min-height: 40px; font-size: 12px; }
.result-summary select { min-height: 38px; padding-inline: 8px; border: 1px solid transparent; border-radius: 8px; }
.result-summary select:hover { border-color: var(--border); background: var(--surface); }

.verba-grid { gap: 12px; }
.verba-card { min-height: 0; display: flex; flex-direction: column; padding: 16px 17px; border-color: var(--border); border-radius: var(--radius-md); box-shadow: 0 2px 10px rgba(18,55,42,.025); }
.verba-card:hover { border-color: #bfcfc4; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.verba-card::before { width: 3px; }
.verba-top { align-items: center; margin-bottom: 8px; }
.verba-code { font-size: 17px; }
.verba-card h3 { height: auto; min-height: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-bottom: 4px; font-size: 14px; line-height: 1.35; }
.verba-card > p { height: auto; min-height: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-bottom: 10px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.card-meta { gap: 10px; padding-top: 9px; }
.card-meta span, .card-price span { color: #738279; font-size: 9px; }
.card-meta strong { color: #405048; font-size: 11px; }
.card-price { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 9px; padding-top: 8px; border-top: 1px solid #edf1ee; }
.card-price > div { min-width: 0; display: grid; gap: 3px; }
.card-price > .edit-verba { justify-self: end; }
.card-price span, .card-price strong { display: block; }
.card-price strong { font-size: 16px; }
.status-pill { padding: 5px 9px; font-size: 9px; }

.calc-form-panel { position: relative; z-index: 1; padding: 26px; isolation: isolate; }
.calc-form-panel.lookup-focused { z-index: 15; }
.step-label > span { width: 34px; height: 34px; font-size: 12px; }
.step-label strong { font-size: 13px; }
.step-label small, .field-label { font-size: 11px; }
.lookup-input input { height: 48px; border-color: var(--border); font-size: 15px; }
.lookup-input .lookup-button { min-height: 48px; border-radius: 0 11px 11px 0; padding-inline: 18px; }
.lookup-suggestions { padding: 6px; border-radius: 11px; }
.lookup-suggestions button { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; font-size: 11px; }
.lookup-suggestions button .icon { width: 16px; height: 16px; color: var(--sage); }
.money-input { height: 48px; border-color: var(--border); }
.verba-confirmation { border-radius: var(--radius-lg); min-height: 0; display: flex; flex-direction: column; }
.confirmation-content { padding: 30px; overflow: visible; }
.confirm-data span, .unit-price span, .total-result span { font-size: 9px; }
.confirm-data strong { font-size: 11px; }
.report-button { min-height: 66px; gap: 12px; padding: 13px 2px 0; }
.report-button .report-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--lime); background: rgba(255,255,255,.08); }
.report-button strong { font-size: 11px; }
.report-button small { margin-top: 4px; color: #9bb2a6; font-size: 10px; }

.installment-panel { margin: 0 0 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: rgba(255,255,255,.055); }
.installment-header { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; }
.installment-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--lime); background: rgba(185,214,122,.12); }
.installment-header > div { min-width: 0; flex: 1; }
.installment-header strong, .installment-header small { display: block; }
.installment-header strong { color: #f7fbf8; font-size: 13px; }
.installment-header small { margin-top: 3px; color: #a8bbb1; font-size: 10px; line-height: 1.4; }
.installment-switch { min-height: 44px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.installment-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { width: 38px; height: 22px; position: relative; flex: 0 0 auto; border-radius: 12px; background: #587065; transition: background .18s ease; }
.switch-track::after { content: ''; width: 18px; height: 18px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .18s ease; }
.installment-switch input:checked + .switch-track { background: var(--lime); }
.installment-switch input:checked + .switch-track::after { transform: translateX(16px); }
.installment-switch input:focus-visible + .switch-track { outline: 3px solid rgba(185,214,122,.48); outline-offset: 2px; }
.switch-state { min-width: 25px; color: #c0d0c7; font-size: 11px; font-weight: 700; }
.installment-body { padding: 15px 14px 14px; border-top: 1px solid rgba(255,255,255,.11); }
.installment-control { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.installment-control label, .installment-control small { display: block; }
.installment-control label { color: white; font-size: 12px; font-weight: 700; }
.installment-control small { margin-top: 3px; color: #9fb3a9; font-size: 10px; }
.number-stepper { display: grid; grid-template-columns: 44px 66px 44px; gap: 5px; }
.number-stepper .icon-only-button { color: #dce9e1; border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.07); }
.number-stepper .icon-only-button:hover { color: var(--lime); background: rgba(255,255,255,.11); }
.number-stepper input { width: 66px; height: 44px; padding: 0 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; outline: none; color: white; background: rgba(5,28,19,.22); font-size: 16px; font-weight: 800; text-align: center; }
.number-stepper input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(185,214,122,.12); }
.number-stepper input::-webkit-inner-spin-button, .number-stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.field-error { min-height: 16px; margin: 6px 0 0; color: #ffc1b5; font-size: 10px; }
.installment-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.installment-summary > div { min-width: 0; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.075); }
.installment-summary span, .installment-summary strong { display: block; }
.installment-summary span { margin-bottom: 5px; color: #a8bab1; font-size: 9px; text-transform: uppercase; letter-spacing: .45px; }
.installment-summary strong { overflow-wrap: anywhere; color: var(--lime); font-size: 13px; line-height: 1.35; }
.installment-groups { display: grid; gap: 6px; margin-top: 10px; }
.installment-group { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 3px 9px; align-items: center; padding: 9px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; }
.installment-group > strong { grid-row: 1 / span 2; min-width: 24px; color: white; font-size: 12px; }
.installment-group span { color: #c0d0c8; font-size: 11px; text-transform: none; letter-spacing: 0; }
.installment-group small { color: #9fb3a9; font-size: 10px; }
.installment-group.installment-adjustment { border-color: rgba(185,214,122,.32); background: rgba(185,214,122,.07); }
.installment-group.installment-adjustment > strong { color: var(--lime); }
.installment-note { margin: 9px 2px 0; color: #adbfb6; font-size: 10px; line-height: 1.5; }

.tabs { min-height: 48px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: 46px; flex: none; padding: 0 13px; border-radius: 10px 10px 0 0; font-size: 12px; }
.tabs button:hover { color: var(--forest); background: rgba(220,235,225,.35); }
.tabs button.active::after { height: 3px; border-radius: 3px 3px 0 0; }
.registration-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-bottom: 16px; padding: 6px; overflow: visible; border: 1px solid var(--border); border-radius: 14px; background: #eaf0ec; box-shadow: inset 0 1px 2px rgba(18,55,42,.035); }
.registration-tabs button { width: 100%; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border-radius: 10px; text-align: center; font-size: 11px; font-weight: 650; line-height: 1.2; }
.registration-tabs button .icon { width: 18px; height: 18px; }
.registration-tabs button.active { color: var(--forest); background: white; box-shadow: 0 3px 10px rgba(18,55,42,.08); }
.registration-tabs button.active::after { display: none; }
.tab-pane:focus-visible { outline: 3px solid rgba(55,116,83,.35); outline-offset: 4px; border-radius: var(--radius-md); }
.manage-actions { gap: 10px; }
.manage-actions button { width: 100%; min-width: 140px; min-height: 44px; }
.record-row { min-height: 0; padding-block: 14px; display: grid; grid-template-columns: 62px minmax(180px, 1fr) auto auto 44px; gap: 15px; align-items: center; }
.record-row > div { min-width: 0; }
.record-row strong { font-size: 12px; }
.record-row small, .record-stat { color: var(--text-secondary); font-size: 10px; }
.record-row small { margin-top: 3px; }
.record-edit { width: 44px; height: 44px; border-radius: 10px; justify-self: end; }
.subcategory-tags > span { padding: 7px 11px; font-size: 10px; }

.filial-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; border-top: 1px solid var(--border); background: #fafcfb; }
.filial-card { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: white; box-shadow: 0 2px 8px rgba(18,55,42,.025); }
.filial-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.filial-code { width: 48px; min-height: 40px; display: grid; place-items: center; padding: 5px; border-radius: 10px; color: var(--forest); background: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .35px; text-align: center; }
.filial-details { min-width: 0; }
.filial-details strong, .filial-details small { display: block; }
.filial-details strong { color: var(--ink); font-size: 14px; }
.filial-details small { margin-top: 4px; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.filial-actions { display: flex; align-items: center; gap: 10px; }
.filial-actions .status-pill { flex: 0 0 auto; }

.modal { border-radius: var(--radius-lg); }
.modal form { width: 100%; min-width: 0; max-height: calc(100dvh - 30px); display: flex; flex-direction: column; overflow: hidden; }
.modal form > header > div,
.modal .form-grid > *,
.modal .record-fields > *,
.modal .profile-options > *,
.modal .dialog-label {
  min-width: 0;
  max-width: 100%;
}
.modal fieldset { min-width: 0; max-width: 100%; min-inline-size: 0; }
.modal h2,
.modal header p { max-width: 100%; overflow-wrap: anywhere; }
.modal form > header { flex: 0 0 auto; align-items: flex-start; padding: 23px 26px 18px; border-bottom: 1px solid var(--border); }
.modal h2 { font-size: 20px; }
.modal header p { color: var(--text-secondary); font-size: 11px; }
.close-modal { margin: -4px -5px 0 12px; font-size: inherit; }
.modal footer { flex: 0 0 auto; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 26px 20px; border-top: 0; background: var(--surface); }
.modal footer > button:not(.icon-only-button) { min-width: 140px; justify-content: center; }
#verba-form > footer,
#record-form > footer,
#report-form > footer,
#user-form > footer,
#api-settings-form > footer,
#login-form > footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  padding: 16px 26px 20px;
}
#verba-form > footer { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); }
#verba-form > footer > button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  align-self: stretch;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}
#record-form > footer > button,
#report-form > footer > button,
#user-form > footer > button,
#api-settings-form > footer > button,
#login-form > footer > button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  align-self: stretch;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}
.form-grid, .record-fields, .profile-options, .dialog-label { min-height: 0; flex: 0 1 auto; }
.form-grid, .record-fields, .profile-options { overflow-y: auto; flex-shrink: 1; }
.form-grid label, .record-fields label, .dialog-label { color: #506058; font-size: 11px; }
.form-grid input, .form-grid select, .record-fields input, .record-fields select { height: 44px; border-color: var(--border); border-radius: 10px; font-size: 13px; }
.form-grid textarea, .record-fields textarea, .dialog-label textarea { border-color: var(--border); border-radius: 10px; font-size: 13px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .record-fields input:focus, .record-fields select:focus, .record-fields textarea:focus, .dialog-label textarea:focus { border-color: #6da2ba; box-shadow: 0 0 0 3px rgba(109,162,186,.16); }
.switch-field input { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.switch-field input:focus-visible + i { outline: 3px solid rgba(55,116,83,.42); outline-offset: 2px; }
.profile-card { min-height: 72px; border-radius: 12px; }
.profile-card strong { font-size: 12px; }
.profile-card small { color: var(--text-secondary); font-size: 10px; }
.profile-option input:focus-visible + .profile-card { outline: 3px solid rgba(55,116,83,.42); outline-offset: 2px; }
.permission-summary { color: #4e5f55; font-size: 11px; }
.toast { min-height: 50px; border-radius: 12px; font-size: 12px; }
.toast-icon { color: var(--lime); }
.toast.error .toast-icon { color: #ffd0c9; }

.mobile-nav .mobile-add { font-size: inherit; }
.mobile-add-icon { display: grid; place-items: center; }

.account-dialog { max-height: calc(100dvh - 30px); display: flex; flex-direction: column; }
.account-dialog > header { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-start; padding: 23px 26px 18px; border-bottom: 1px solid var(--border); }
.login-form { display: flex; flex-direction: column; }
#login-form[hidden], #account-section[hidden], .api-bootstrap-callout[hidden] { display: none !important; }
.login-form > label { display: block; margin: 0 26px 16px; color: #506058; font-size: 11px; font-weight: 700; }
.login-form > label:first-of-type { margin-top: 23px; }
.login-form input { width: 100%; height: 48px; display: block; margin-top: 7px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; outline: 0; color: var(--ink); background: white; font-size: 16px; }
.login-form input:focus { border-color: #6da2ba; box-shadow: 0 0 0 3px rgba(109,162,186,.16); }
.login-form .password-field { margin-top: 14px; padding: 0 52px 0 12px; display: block; position: relative; }
/* On native, let native-form-fixes.css handle the visual border on the input */
html.native-app .login-form .password-field { padding: 0 !important; }
.login-form .password-field input, .record-fields .password-field input { height: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
.login-form .password-field:focus-within { border-color: #6da2ba; box-shadow: 0 0 0 3px rgba(109,162,186,.16); }
.login-form > .native-save-login { display: grid; gap: 6px; margin-top: 0; }
.native-save-login[hidden] { display: none !important; }
.native-save-login > span { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: center; }
.native-save-login input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.native-save-login i { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 7px; background: white; transition: .18s ease; }
.native-save-login input:checked + i { border-color: var(--forest); background: var(--forest); box-shadow: inset 0 0 0 4px white; }
.native-save-login input:focus-visible + i { outline: 3px solid rgba(55,116,83,.28); outline-offset: 2px; }
.native-save-login em { min-width: 0; color: var(--ink); font-style: normal; font-weight: 750; }
.native-save-login small { padding-left: 32px; color: var(--text-secondary); font-size: 10px; font-weight: 500; line-height: 1.45; }
.api-bootstrap-callout { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 4px 11px; align-items: center; margin: 20px 26px 0; padding: 13px; border: 1px solid #c9d9ce; border-radius: 12px; color: var(--forest); background: #f3f8f4; }
.api-bootstrap-callout > .icon { width: 34px; height: 34px; grid-row: 1 / span 2; padding: 7px; border-radius: 9px; background: var(--mint); }
.api-bootstrap-callout div { min-width: 0; }
.api-bootstrap-callout strong, .api-bootstrap-callout small { display: block; }
.api-bootstrap-callout strong { font-size: 11px; }
.api-bootstrap-callout small { margin-top: 3px; color: var(--text-secondary); font-size: 9px; line-height: 1.45; }
.api-bootstrap-callout .ghost-button { width: 100%; min-height: 38px; grid-column: 1 / -1; margin-top: 6px; }
.api-bootstrap-callout:not([hidden]) + label { margin-top: 16px; }
.auth-message { min-height: 20px; margin: -4px 26px 4px; color: #a04437; font-size: 11px; }
.account-section { width: 100%; min-height: 0; overflow-y: auto; flex: 0 1 auto; display: flex; justify-content: center; }
.account-section > .account-sheet { width: 100%; }
.account-content { display: grid; gap: 14px; padding: 20px 0 0; }
.account-identity, .account-permissions { border: 1px solid var(--border); border-radius: 14px; background: #fafcfb; }
.account-identity { padding: 14px 18px 18px; }
.account-block-label { display: block; margin-bottom: 13px; color: var(--text-tertiary); font-size: 9px; font-weight: 800; letter-spacing: .8px; text-align: center; text-transform: uppercase; }
.account-summary { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; padding: 0; text-align: center; }
.account-summary .avatar { width: 64px; height: 64px; flex: 0 0 auto; color: white; background: var(--forest); font-size: 17px; box-shadow: 0 0 0 6px var(--mint); }
.account-summary .account-avatar .icon { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; }
.account-summary .account-avatar .icon svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; }
.account-summary > div { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.account-summary strong { font-size: 17px; font-weight: 760; }
.account-summary span { max-width: 100%; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.account-summary small { margin-top: 3px; padding: 5px 10px; border-radius: 14px; color: var(--forest); background: var(--mint); font-size: 10px; font-weight: 800; }
.account-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.account-meta article { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.account-meta small { display: block; color: var(--text-secondary); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.account-meta strong { display: block; margin-top: 5px; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.account-permissions { overflow: hidden; background: white; }
.account-section-heading { display: flex; align-items: center; gap: 11px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.account-section-heading > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 9px; color: var(--forest); background: var(--mint); }
.account-section-heading strong, .account-section-heading small { display: block; }
.account-section-heading strong { color: var(--forest); font-size: 12px; }
.account-section-heading small { margin-top: 2px; color: var(--text-secondary); font-size: 10px; }
.account-section .permission-summary { display: grid; gap: 6px; margin: 0; padding: 14px 16px 16px; border: 0; border-radius: 0; background: white; }
.account-section .permission-summary strong { color: var(--forest); font-size: 12px; font-weight: 750; }
.account-section .permission-summary span { color: #5f6d64; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.account-section .permission-pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.account-section .permission-pill { display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 999px; color: var(--forest); background: var(--mint); font-size: 10px; font-weight: 750; line-height: 1.35; }
.account-section .permission-empty { color: var(--text-secondary); font-size: 11px; }
.login-form > footer { margin-top: 0; }
.account-sheet > footer { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 10px; padding: 0; border-top: 0; }
.account-sheet > footer > button { width: min(180px, calc(50% - 5px)); min-width: 145px; min-height: 46px; margin: 0; white-space: normal; }
.account-card-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.account-card-heading .account-block-label { margin: 0; text-align: left; }
.account-connection-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; color: #386b87; background: #e1eff5; font-size: 9px; font-weight: 800; }
.account-connection-state i { width: 7px; height: 7px; border-radius: 50%; background: #568faa; box-shadow: 0 0 0 3px rgba(86, 143, 170, .14); }
.account-meta article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.account-meta article > div { min-width: 0; }
.account-meta-icon { width: 34px; height: 34px; display: grid; place-items: center; padding: 8px; border-radius: 9px; color: var(--forest); background: var(--mint); }
.account-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
.account-sheet > .account-actions > button { width: 100%; max-width: none; min-width: 0; min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 11px; align-items: center; justify-items: start; margin: 0; padding: 9px 13px; border-radius: 12px; text-align: left; white-space: normal; }
.account-actions .account-action-icon { width: 38px; height: 38px; display: grid; place-items: center; padding: 9px; border-radius: 10px; }
.account-actions .account-action-copy { min-width: 0; display: grid; gap: 2px; }
.account-actions .account-action-copy strong { font-size: 12px; line-height: 1.25; }
.account-actions .account-action-copy small { font-size: 10px; font-weight: 600; line-height: 1.35; }
.account-actions .account-action-arrow { width: 18px; height: 18px; justify-self: end; }
.account-manage-button { color: var(--forest); border-color: #c8d8ce; background: #f7faf7; }
.account-manage-button .account-action-icon { color: var(--forest); background: var(--mint); }
.account-manage-button .account-action-copy small { color: var(--text-secondary); }
.account-logout-button { color: #873b32; border: 1px solid #e7cbc6; background: #fff8f6; font: inherit; cursor: pointer; }
.account-logout-button:hover { border-color: #d9aaa2; background: #fff2ef; }
.account-logout-button:focus-visible { outline: 3px solid rgba(159, 68, 55, .22); outline-offset: 2px; }
.account-logout-button .account-action-icon { color: #9b4338; background: #f8e3df; }
.account-logout-button .account-action-copy { width: 100%; justify-self: stretch; justify-items: center; text-align: center; }
.account-logout-button .account-action-copy strong { color: #873b32; }
.account-logout-button .account-action-copy small { color: #9a6861; }
.account-logout-button .account-action-arrow { color: #a96a61; }
.danger-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid #e5c6c1; border-radius: 10px; color: #943f34; background: #fff7f5; font: inherit; font-size: 12px; font-weight: 750; }
.danger-button .icon { width: 18px; height: 18px; }

.api-settings-button { background: white; box-shadow: 0 4px 12px rgba(20,49,38,.06); }
.api-connection-status { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-secondary); background: #f7f9f7; font-size: 11px; }
.api-connection-status .icon { width: 20px; height: 20px; flex: 0 0 auto; }
.api-connection-status.success { color: #386b87; border-color: #bdd6e1; background: #edf6f9; }
.api-connection-status.error { color: #963f34; border-color: #e6c1bb; background: #fff5f3; }
.api-connection-status.testing .icon { animation: spin .8s linear infinite; }
.field-help { margin: -4px 1px 0; color: var(--text-secondary); font-size: 10px; line-height: 1.55; }

.profile-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.profile-overview-card { min-width: 0; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 4px 11px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: var(--shadow-soft); }
.profile-overview-card > .icon { width: 40px; height: 40px; grid-row: 1 / span 2; padding: 9px; border-radius: 11px; color: var(--forest); background: var(--mint); }
.profile-overview-card div { min-width: 0; }
.profile-overview-card strong, .profile-overview-card small { display: block; }
.profile-overview-card strong { font-size: 13px; }
.profile-overview-card small { margin-top: 3px; color: var(--text-secondary); font-size: 9px; line-height: 1.4; }
.profile-overview-card b { color: var(--forest); font-size: 22px; }
.profile-overview-card > span:last-child { grid-column: 3; color: var(--text-secondary); font-size: 9px; }
.users-panel { overflow: hidden; }
.user-admin-list { border-top: 1px solid var(--border); }
.user-admin-row { min-height: 76px; display: grid; grid-template-columns: 42px minmax(190px,1fr) 120px 112px 44px; gap: 13px; align-items: center; padding: 13px 22px; border-bottom: 1px solid #edf1ee; }
.user-admin-row:last-child { border-bottom: 0; }
.user-admin-row .avatar { width: 42px; height: 42px; }
.user-admin-row > div { min-width: 0; }
.user-admin-row strong, .user-admin-row small { display: block; }
.user-admin-row strong { font-size: 12px; }
.user-admin-row small { margin-top: 3px; overflow: hidden; color: var(--text-secondary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { justify-self: start; padding: 6px 9px; border-radius: 15px; color: var(--forest); background: var(--mint); font-size: 9px; font-weight: 750; }
.edit-user { width: 44px; height: 44px; }

.permission-customization { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; color: #46574d; background: var(--surface-soft); min-height: 48px; }
.permission-customization > span, .permission-customization > div { min-width: 0; }
.permission-customization.switch-field > span { height: auto; justify-content: flex-end; margin: 0; }
.permission-selector { min-width: 0; margin: 8px 0 0; padding: 11px 14px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafcfb; }
.permission-selector[hidden] { display: none; }
.permission-selector legend { padding: 0 6px; color: var(--forest); font-size: 12px; font-weight: 750; }
.permission-selector > p { margin: 2px 0 12px; color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.permission-selector.customized { border-color: #a8c1b0; background: #f7fbf8; }
.permission-selector-heading { display: grid; gap: 3px; margin-bottom: 12px; }
.permission-selector-heading strong { color: var(--forest); font-size: 12px; }
.permission-selector-heading small { color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.permission-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.permission-options label { min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; color: #46564d; background: white; cursor: pointer; font-size: 11px; font-weight: 650; line-height: 1.35; }
.permission-options label > span { min-width: 0; }
.permission-options label strong, .permission-options label small { display: block; }
.permission-options label strong { font-size: 11px; }
.permission-options label small { margin-top: 2px; color: var(--text-secondary); font-size: 9px; font-weight: 450; }
.permission-options label:has(input:checked) { color: var(--forest); border-color: #9ab7a4; background: #eef6f0; }
.permission-options label:has(input:disabled) { cursor: default; opacity: .68; }
.permission-options input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--forest); }
.permission-options input:focus-visible { outline: 3px solid rgba(55,116,83,.35); outline-offset: 2px; }

@media (max-width: 940px) and (min-width: 761px) {
  .dashboard-grid, .calculation-layout { grid-template-columns: 1fr; }
  .verba-grid { grid-template-columns: 1fr; }
  .filial-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: 0; }
  .main-content { padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: calc(82px + env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left)); }
  .topbar { height: calc(76px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .view { padding-top: 24px; }
  button { text-align: center; }
  .module-toolbar { min-height: 0; align-items: center; flex-direction: column; gap: 14px; margin-bottom: 20px; text-align: center; }
  .module-toolbar-compact { gap: 0; }
  .module-description { max-width: 680px; line-height: 1.55; }
  .module-toolbar > .primary-button { width: 100%; max-width: 360px; }
  .primary-button, .ghost-button, .secondary-button, .filter-toggle, .sync-button, .compact-button, .icon-only-button, .text-button { text-align: center; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; align-items: start; min-height: 112px; }
  .metric-card .metric-icon { grid-column: 2; grid-row: 1 / span 3; float: none; }
  .metric-card > div:last-child { grid-column: 1; grid-row: 1 / span 3; }
  .recent-panel { display: block; }
  .recent-panel .table-wrap { overflow-x: auto; }
  .recent-panel table { min-width: 720px; }
  .filter-toggle { width: auto; padding-inline: 13px; font-size: 12px; }
  .filter-toggle b { font-size: 9px; }
  .advanced-filters select { min-height: 46px; }
  .registration-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; padding: 5px; overflow: visible; }
  .registration-tabs button { min-height: 62px; flex-direction: column; gap: 4px; padding: 5px 2px; font-size: 9px; line-height: 1.15; white-space: normal; }
  .registration-tabs button .icon { width: 17px; height: 17px; }

  .filial-list { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .filial-list { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .filial-card { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; padding: 13px; }
  .filial-code { width: 44px; min-height: 38px; }
  .filial-actions { flex-direction: column-reverse; gap: 6px; }
  .filial-actions .record-edit { width: 42px; height: 42px; }

  .record-row { grid-template-columns: 55px 1fr 35px; padding: 13px 17px; }
  .manage-heading { align-items: flex-start; gap: 12px; }
  .report-row { grid-template-columns: 95px 1fr; }
  .report-row > :nth-child(n+3) { display: none; }
  .report-row > :nth-child(3), .report-row > :nth-child(4) { display: inline-flex; }
  .report-row > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .report-row > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .mobile-nav { height: calc(68px + env(safe-area-inset-bottom)); padding: 0 max(4px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-right)); }
  .mobile-nav button { min-height: 64px; align-items: center; justify-content: center; gap: 4px; padding: 0 2px; text-align: center; }
  .mobile-nav small { display: block; font-size: 10px; line-height: 1.1; text-align: center; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .mobile-nav .mobile-add { width: auto; height: auto; flex: 1 1 0; margin-top: 0; border: 0; border-radius: 0; color: #89938d; background: white; box-shadow: none; }
  .mobile-nav .mobile-add-icon { width: 34px; height: 34px; margin: 0 auto; border: 0; border-radius: 50%; color: white; background: var(--forest); box-shadow: 0 5px 13px rgba(18,55,42,.2); }
  .mobile-nav .mobile-add small { margin: 0; }
  .mobile-nav.calculation-primary > [data-view="dashboard"] { order: 1; }
  .mobile-nav.calculation-primary > #mobile-calculate-nav { order: 2; }
  .mobile-nav.calculation-primary > [data-view="verbas"] { order: 3; }
  .mobile-nav.calculation-primary > [data-view="cadastros"] { order: 4; }
  .mobile-nav .mobile-primary-action > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 50%; color: white; background: var(--forest); box-shadow: 0 5px 13px rgba(18,55,42,.2); }
  .mobile-nav .mobile-primary-action small { color: var(--forest); font-weight: 800; }
  .modal form > header { padding-inline: 20px; }
  .modal footer { padding: 16px 20px 20px; }
  .account-dialog > header { padding: 23px 20px 18px; }
  .account-content { padding: 16px 0 14px; }
  .account-sheet > footer { padding: 0; }
  .form-grid input, .form-grid select, .record-fields input, .record-fields select { height: 48px; font-size: 16px; }
  .form-grid textarea, .record-fields textarea, .dialog-label textarea { font-size: 16px; }
  .profile-overview { grid-template-columns: 1fr; gap: 14px; }
  .permission-options { grid-template-columns: 1fr; }
  .user-admin-row { grid-template-columns: 42px minmax(0,1fr) 44px; grid-template-rows: auto auto; gap: 7px 11px; padding: 14px 16px; }
  .user-admin-row > div { grid-column: 2; grid-row: 1; }
  .user-admin-row .avatar { grid-column: 1; grid-row: 1; }
  .user-admin-row .role-badge { grid-column: 1 / span 2; grid-row: 2; }
  .user-admin-row .status-pill { grid-column: 2; grid-row: 2; justify-self: end; }
  .user-admin-row .edit-user { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 520px) {
  .topbar > div:first-child { flex: 1 1 auto; }
  .topbar-actions { flex: 0 0 auto; }
  .topbar h1 { max-width: none; overflow: visible; line-height: 1.12; text-overflow: clip; white-space: normal; }
  .eyebrow { display: none; }
  .panel-heading, .manage-heading { padding-inline: 18px; }
  .panel-heading, .manage-heading { align-items: stretch; flex-direction: column; }
  .panel-heading > button, .manage-heading > button { width: min(100%, 320px); align-self: center; }
  .manage-actions { width: min(100%, 420px); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0 auto; }
  .manage-actions button { width: 100%; min-width: 0; margin: 0 auto; }
  .area-list { padding-inline: 18px; }
  .metric-grid { grid-template-columns: minmax(0,1fr); }
  .metric-card { min-height: 106px; }
  .calculation-layout { grid-template-columns: minmax(0,1fr); }
  .confirmation-content, .calc-form-panel { padding: 21px; }
  .tabs { margin-inline: -2px; }
  .permission-customization { flex-direction: column; align-items: flex-start; gap: 12px; }
  .permission-customization.switch-field > span { justify-content: flex-start; min-height: auto; }
  .login-form > footer, .account-sheet > footer { flex-direction: row; justify-content: center; gap: 8px; }
  .login-form > footer button, .account-sheet > footer button { width: calc(50% - 4px); min-width: 120px; }
  .account-content { padding-inline: 0; }
  .account-sheet > footer { padding-inline: 0; }
}

@media (max-width: 390px) {
  .main-content { padding-inline: 12px; }
  .topbar-actions { gap: 5px; }
  .topbar h1 { max-width: none; font-size: 18px; }
  .api-settings-button, .top-profile { width: 40px; min-width: 40px; }
  .lookup-input { display: grid; grid-template-columns: 1fr; }
  .lookup-input input, .lookup-input .lookup-button { border-radius: 11px; }
  .manage-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-actions button { width: 100%; }
  .modal footer { grid-template-columns: 1fr; }
  #verba-form > footer,
  #record-form > footer,
  #report-form > footer,
  #user-form > footer,
  #api-settings-form > footer,
  #login-form > footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #verba-form > footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #verba-form > footer > button,
  #record-form > footer > button,
  #report-form > footer > button,
  #user-form > footer > button,
  #api-settings-form > footer > button,
  #login-form > footer > button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    justify-content: center;
    padding-inline: 8px;
    white-space: normal;
  }
  .account-sheet > footer { gap: 8px; }
  .account-sheet > footer > button { width: calc(50% - 4px); min-width: 0; min-height: 46px; padding-inline: 8px; justify-content: center; }
  .installment-header { align-items: flex-start; flex-wrap: wrap; }
  .installment-header > div { width: calc(100% - 52px); }
  .installment-switch { margin-left: 49px; }
  .installment-control { align-items: flex-start; flex-direction: column; }
  .number-stepper { width: 100%; grid-template-columns: 48px minmax(70px,1fr) 48px; }
  .number-stepper input { width: 100%; }
  .installment-summary { grid-template-columns: 1fr; }
  .total-result-values { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  .topbar h1 { max-width: none; font-size: 17px; }
  .topbar-actions { gap: 3px; }
  .sync-button, .api-settings-button, .top-profile { width: 38px; min-width: 38px; }
  .mobile-nav small { font-size: 9px; }
  .registration-tabs button { font-size: 9px; }
}

@media (min-width: 1680px) {
  .verba-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Cadastro em cartões, ações consistentes e formulários de usuário organizados. */
.primary-button,
.ghost-button,
.secondary-button,
.danger-button,
.compact-button,
.text-button,
.manage-actions button,
.modal footer button {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.money-input-help {
  display: block;
  margin: 8px 1px 17px;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

.manage-panel {
  overflow: hidden;
}

.manage-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 15px;
}

.manage-heading > div:first-child {
  min-width: 0;
}

.manage-heading > .manage-primary-action {
  width: min(100%, 420px);
  min-height: 44px;
  justify-self: center;
}

.manage-actions {
  width: min(100%, 600px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: center;
  gap: 10px;
  justify-self: center;
}

.manage-actions button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

#centro-list,
#area-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 11px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fafcfb;
}

.record-row.record-card {
  min-width: 0;
  min-height: 92px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "code details actions"
    "code details status";
  gap: 8px 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  box-shadow: 0 2px 8px rgba(49, 95, 121, .035);
}

.record-row.record-card:hover,
.filial-card.record-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.record-card .record-code {
  width: 58px;
  min-height: 46px;
  display: grid;
  grid-area: code;
  place-items: center;
  align-self: center;
  padding: 6px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  color: var(--forest);
  background: var(--mint);
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: .2px;
  text-align: center;
}

.record-card .record-details {
  min-width: 0;
  grid-area: details;
  align-self: center;
}

.record-card .record-details strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.record-card .record-details small,
.record-card .record-stat {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.4;
}

.record-card .record-stat {
  margin-top: 6px;
  color: #738078;
  font-weight: 650;
}

.record-card > .status-pill {
  grid-area: status;
  justify-self: end;
  align-self: end;
}

.record-actions-group {
  display: flex;
  grid-area: actions;
  justify-self: end;
  gap: 6px;
}

.record-actions-group button,
.filial-actions .record-edit,
.filial-actions .record-delete {
  width: 39px;
  height: 39px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d8dfda;
  border-radius: 9px;
  color: #46564d;
  background: white;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.record-actions-group button .icon,
.filial-actions button .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.record-actions-group button:hover,
.filial-actions .record-edit:hover {
  border-color: #9db5a5;
  color: var(--forest);
  background: #f2f7f3;
  transform: translateY(-1px);
}

.record-actions-group .record-delete,
.filial-actions .record-delete {
  border-color: #decac5;
  color: #7e3f37;
  background: #fffdfc;
}

.record-actions-group .record-delete:hover,
.filial-actions .record-delete:hover {
  border-color: #c98f84;
  color: #9b3428;
  background: #fff3f0;
  transform: translateY(-1px);
}

.filial-actions {
  display: grid;
  grid-template-columns: repeat(2, 39px);
  justify-content: end;
  gap: 6px;
}

.filial-actions .status-pill {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: end;
}

#user-modal {
  width: min(780px, calc(100% - 28px));
  overflow: hidden;
}

#user-modal form,
#user-modal form > header > div,
#user-modal .record-fields > *,
#user-modal .user-form-section > * {
  min-width: 0;
  max-width: 100%;
}

.user-form-layout {
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: 18px 22px 22px;
  overflow-x: hidden;
  background: #f7f9f7;
}

.user-form-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
}

.user-form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid #edf1ee;
}

.user-form-section-title > .icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 9px;
  color: var(--forest);
  background: var(--mint);
}

.user-form-section-title strong,
.user-form-section-title small {
  display: block;
}

.user-form-section-title strong {
  color: var(--ink);
  font-size: 12px;
}

.user-form-section-title small {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.4;
}

.user-fields-grid,
.user-access-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-field-wide {
  grid-column: 1 / -1;
}

.user-form-section > label,
.user-fields-grid > label {
  min-width: 0;
}

.user-form-section input,
.user-form-section select {
  width: 100%;
  margin-top: 7px;
}

/* Inputs compactos não podem herdar a largura dos campos de texto. */
.user-form-section .switch-field input {
  width: 1px;
  height: 1px;
  margin: 0;
}

.user-form-section .permission-options input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
}

.user-scope-selector {
  min-width: 0;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.user-scope-selector legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.user-scope-selector > small,
.user-global-scope-note {
  display: block;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.user-scope-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  max-height: 150px;
  overflow: auto;
}

.user-scope-options label {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.user-scope-options label:has(input:checked) {
  border-color: var(--green-700);
  background: var(--green-50);
}

.user-scope-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green-800);
}

.user-scope-options strong,
.user-scope-options small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-scope-options strong { font-size: 11px; }
.user-scope-options small { margin-top: 2px; color: var(--text-secondary); font-size: 9px; }

.user-global-scope-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--green-300);
  border-radius: var(--radius-md);
  color: var(--green-950);
  background: var(--green-50);
  font-weight: 700;
}

.user-form-section .password-field {
  margin-top: 7px;
}

.user-form-section .password-field input {
  margin-top: 0;
}

.user-password-help {
  margin-top: -6px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.5;
}

.password-change-policy {
  min-width: 0;
  margin: 2px 0 0;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.password-change-policy > span {
  width: 100%;
  max-width: 100%;
}

.password-change-policy i {
  flex: 0 0 34px;
}

.password-change-policy em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.password-policy-help {
  margin-top: -7px;
  padding-inline: 2px;
}

.user-access-switches .switch-field {
  min-width: 0;
  margin: 0;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.user-access-switches .switch-field > span,
.permission-customization.switch-field > span {
  width: 100%;
  max-width: 100%;
}

.user-access-switches .switch-field i,
.permission-customization.switch-field i {
  flex: 0 0 34px;
}

.user-access-switches .switch-field em,
.permission-customization.switch-field em {
  min-width: 0;
  overflow-wrap: anywhere;
}

#user-modal .permission-selector {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  overflow: hidden;
}

#user-modal .permission-options {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#user-modal .permission-options label {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  overflow: hidden;
}

#user-modal .permission-options label > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#user-modal .permission-options label strong,
#user-modal .permission-options label small {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.password-change-modal {
  width: min(510px, calc(100% - 28px));
}

.password-change-modal .security-lock {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: var(--mint);
}

.password-change-modal .security-lock .icon {
  width: 21px;
  height: 21px;
}

.password-change-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  padding: 20px 24px;
}

#password-change-modal .password-change-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #40564e;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

#password-change-modal .password-change-label {
  display: block;
  min-width: 0;
}

#password-change-modal .password-change-field .password-field {
  width: 100%;
  height: 52px;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

#password-change-modal .password-change-field .password-field:focus-within {
  border-color: #6da2ba;
  box-shadow: 0 0 0 4px rgba(109, 162, 186, .16);
}

#password-change-modal .password-change-field .password-field input {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  line-height: 1.2;
}

#password-change-modal .password-change-field .password-field input:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}

#password-change-modal .password-change-field .password-toggle {
  position: static;
  width: 48px;
  min-width: 48px;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  transform: none;
  border: 0;
  border-left: 1px solid #e1e9e4;
  border-radius: 0;
  color: #526960;
  background: #f7faf8;
  box-shadow: none;
}

#password-change-modal .password-change-field .password-toggle:focus-visible {
  outline: 2px solid #6da2ba;
  outline-offset: -3px;
}

#password-change-modal .password-change-field .password-toggle .icon {
  width: 19px;
  height: 19px;
}

#password-change-modal #password-change-message {
  min-height: 0;
  margin: 0;
  line-height: 1.45;
}

#password-change-modal #password-change-message:empty {
  display: none;
}

.password-change-notice {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #bfd6c6;
  border-radius: 11px;
  color: var(--forest);
  background: #f1f8f3;
}

.password-change-notice > .icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.password-change-notice strong,
.password-change-notice small {
  display: block;
}

.password-change-notice strong {
  font-size: 11px;
}

.password-change-notice small {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.4;
}

#password-change-form > footer {
  display: grid;
  grid-template-columns: minmax(0, 240px);
  justify-content: center;
}

#password-change-form > footer > button {
  width: 100%;
  justify-content: center;
}

@media (max-width: 760px) {
  .registration-tabs button {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .registration-tabs button > span:last-child {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(7.5px, 2.25vw, 10px);
    text-overflow: clip;
    white-space: nowrap;
  }

  #centro-list,
  #area-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .manage-heading {
    align-items: stretch;
  }

  .user-form-layout {
    padding: 14px 16px 18px;
  }
}

@media (max-width: 520px) {
  .manage-heading {
    text-align: left;
  }

  .manage-heading > .manage-primary-action,
  .manage-actions {
    width: 100%;
  }

  .manage-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manage-actions button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .record-row.record-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 12px;
  }

  .record-card .record-code {
    width: 48px;
    min-height: 42px;
    font-size: 9px;
  }

  .record-actions-group button,
  .filial-actions .record-edit,
  .filial-actions .record-delete {
    width: 36px;
    height: 36px;
  }

  .filial-actions {
    grid-template-columns: repeat(2, 36px);
  }

  .user-fields-grid,
  .user-access-switches {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-field-wide {
    grid-column: auto;
  }

  .user-form-section {
    padding: 14px;
  }

  #verba-form > footer > button,
  #record-form > footer > button,
  #report-form > footer > button,
  #user-form > footer > button,
  #api-settings-form > footer > button,
  #login-form > footer > button {
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  .registration-tabs {
    gap: 3px;
    padding: 4px;
  }

  .registration-tabs button {
    padding-inline: 1px;
  }

  .registration-tabs button > span:last-child {
    font-size: 7.5px;
    letter-spacing: -.15px;
  }
}

/* Exclusão segura e identificação compacta das filiais. */
.filial-code {
  overflow: hidden;
  font-size: 12px;
  letter-spacing: .6px;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.record-actions-group .record-delete,
.filial-actions .record-delete {
  border-color: #e7c7c1;
  color: #a64639;
  background: linear-gradient(180deg, #fffdfc 0%, #fff6f4 100%);
  box-shadow: 0 2px 6px rgba(151, 61, 48, .06);
}

.record-actions-group .record-delete .icon,
.filial-actions .record-delete .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.15;
}

.record-actions-group .record-delete:hover,
.filial-actions .record-delete:hover {
  border-color: #c98276;
  color: #962f23;
  background: #fff0ed;
  box-shadow: 0 4px 10px rgba(151, 61, 48, .1);
}

.record-actions-group .record-delete:active,
.filial-actions .record-delete:active {
  transform: translateY(0) scale(.96);
}

#delete-confirm-modal {
  width: min(500px, calc(100% - 28px));
  overflow: hidden;
  border-radius: 18px;
}

.delete-confirm-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 30px);
  overflow: hidden;
}

.delete-confirm-content > header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.delete-confirm-content > header > div {
  min-width: 0;
}

.delete-confirm-content > header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.delete-confirm-content > header p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.delete-confirm-content > header .close-modal {
  width: 42px;
  min-width: 42px;
  height: 42px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: #607068;
  background: #f7f9f7;
}

.delete-confirm-content > header .close-modal:hover {
  color: var(--forest);
  border-color: #a9bdb0;
  background: #eef5f0;
}

.delete-confirm-content > header .close-modal:focus-visible {
  outline: 2px solid rgba(74, 126, 94, .38);
  outline-offset: 2px;
}

.delete-confirm-body {
  min-height: 0;
  display: grid;
  gap: 15px;
  padding: 20px 24px;
  overflow-y: auto;
  background: #fbfcfb;
}

.delete-target {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #ead5d0;
  border-radius: 13px;
  background: white;
}

.delete-target-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #a34235;
  background: #fff0ed;
}

.delete-target-icon .icon {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.delete-target > div {
  min-width: 0;
}

.delete-target small,
.delete-target strong,
.delete-target > div > span {
  display: block;
}

.delete-target small {
  margin-bottom: 4px;
  color: #8d6b64;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .8px;
}

.delete-target strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.delete-target > div > span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}

.delete-message {
  margin: 0;
  color: #59675f;
  font-size: 12px;
  line-height: 1.55;
}

#delete-linked-warning.warning-box {
  margin: 0;
  padding: 14px;
  border-color: #e6cdb9;
  border-radius: 12px;
  color: #765548;
  background: #fff9f3;
}

#delete-linked-warning[hidden] {
  display: none;
}

.warning-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.warning-heading .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #a26735;
}

.warning-heading strong {
  margin: 0;
  color: #704e3f;
  font-size: 12px;
}

#delete-linked-warning p {
  color: #86675a;
  font-size: 11px;
  line-height: 1.55;
}

.delete-confirm-content > footer {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 0;
  background: white;
}

.delete-confirm-content > footer > button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  justify-content: center;
  white-space: nowrap;
}

#delete-confirm-btn:not(:disabled) {
  color: white;
  border-color: #a74437;
  background: #a74437;
}

#delete-confirm-btn:disabled {
  cursor: not-allowed;
  color: #aa9995;
  border-color: #eadfdd;
  background: #f7f3f2;
  opacity: 1;
}

#delete-inactivate-btn {
  grid-column: 1 / -1;
}

@media (max-width: 420px) {
  .delete-confirm-content > header,
  .delete-confirm-body,
  .delete-confirm-content > footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .delete-confirm-content > header h2 {
    font-size: 18px;
  }

  .delete-confirm-content > footer {
    gap: 8px;
  }

  .delete-confirm-content > footer > button {
    padding-inline: 8px;
    font-size: 11px;
  }
}

/* Mantém a página de fundo imóvel enquanto qualquer janela está aberta. */
html.dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}

html.dialog-open body {
  width: 100%;
  position: fixed;
  inset: var(--dialog-page-offset, 0) 0 auto;
  overflow: hidden;
  overscroll-behavior: none;
}

.modal,
.modal form,
.account-dialog,
.delete-confirm-content {
  overscroll-behavior: contain;
}

.modal .form-grid,
.modal .record-fields,
.modal .profile-options,
.modal .account-section,
.modal .delete-confirm-body {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Tipografia um pouco maior para leitura confortável em web e Android. */
body { font-size: 15px; }
.nav-item { font-size: 14px; }
.topbar h1 { font-size: 22px; }
.welcome-row p,
.section-heading p,
.module-description { font-size: 14px; }
.panel-heading p,
.manage-heading p,
.metric-card p,
.result-summary { font-size: 13px; }
.metric-card small,
.record-row small,
.record-stat,
.filial-details small,
.account-section-heading small,
.account-section .permission-summary span { font-size: 11.5px; }
.area-row span,
.area-row b,
td,
td strong,
.chips button,
.tabs button,
.record-row strong { font-size: 13px; }
td small { font-size: 11px; }
.status-pill { font-size: 10px; }
.primary-button,
.ghost-button,
.secondary-button,
.danger-button,
.compact-button,
.text-button,
.modal footer button { font-size: clamp(12px, 2.8vw, 13.5px); }
.modal h2 { font-size: 22px; }
.modal header p { font-size: 12.5px; line-height: 1.5; }
.modal-kicker { font-size: 9px; }
.form-grid label,
.record-fields label,
.dialog-label,
.login-form > label { font-size: 12px; }
.form-grid input,
.form-grid select,
.form-grid textarea,
.record-fields input,
.record-fields select,
.record-fields textarea,
.dialog-label textarea { font-size: 16px; }
.switch-field em { font-size: 12px; }
.field-help,
.user-password-help,
.permission-selector > p { font-size: 11px; }
.permission-options label strong { font-size: 12.5px; }
.permission-options label small { font-size: 10.5px; line-height: 1.45; }

/* No APK, amplia a leitura sem alterar a densidade visual da versão web. */
html.native-app body { font-size: 17px; }
html.native-app .nav-item { font-size: 15px; }
html.native-app .topbar h1,
html.native-app .modal h2 { font-size: 23px; }
html.native-app .welcome-row p,
html.native-app .section-heading p,
html.native-app .module-description { font-size: 16px; }
html.native-app .panel-heading p,
html.native-app .manage-heading p,
html.native-app .metric-card p,
html.native-app .result-summary { font-size: 15px; }
html.native-app .metric-card small,
html.native-app .record-row small,
html.native-app .record-stat,
html.native-app .filial-details small,
html.native-app .account-section-heading small,
html.native-app .account-section .permission-summary span { font-size: 13px; }
html.native-app .area-row span,
html.native-app .area-row b,
html.native-app td,
html.native-app td strong,
html.native-app .chips button,
html.native-app .tabs button,
html.native-app .record-row strong { font-size: 15px; }
html.native-app td small,
html.native-app .field-help,
html.native-app .user-password-help,
html.native-app .permission-selector > p { font-size: 13px; }
html.native-app .status-pill { font-size: 11.5px; }
html.native-app .primary-button,
html.native-app .ghost-button,
html.native-app .secondary-button,
html.native-app .danger-button,
html.native-app .compact-button,
html.native-app .text-button,
html.native-app .modal footer button { font-size: 14.5px; }
html.native-app .modal header p { font-size: 14.5px; }
html.native-app .form-grid label,
html.native-app .record-fields label,
html.native-app .dialog-label,
html.native-app .login-form > label,
html.native-app .switch-field em { font-size: 14px; }
html.native-app .native-save-login em { font-size: 14px; }
html.native-app .native-save-login small { font-size: 12.5px; }
html.native-app .form-grid input,
html.native-app .form-grid select,
html.native-app .form-grid textarea,
html.native-app .record-fields input,
html.native-app .record-fields select,
html.native-app .record-fields textarea,
html.native-app .dialog-label textarea { font-size: 17px; }
html.native-app .permission-options label strong { font-size: 14.5px; }
html.native-app .permission-options label small { font-size: 12.5px; }

/* A versão web aproveita toda a área útil; o APK mantém o layout móvel. */
@media (min-width: 761px) {
  html.web-app .main-content {
    padding-right: clamp(18px, 2vw, 30px);
    padding-left: clamp(18px, 2vw, 30px);
  }

  html.web-app .view {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }
}

/* Paleta exclusiva do APK: azuis claros e azul-petróleo. */
html.native-app {
  --forest: #315f79;
  --forest-2: #386b87;
  --sage: #6da2ba;
  --mint: #e1eff5;
  --lime: #8fc4d8;
  --paper: #f3f8fa;
  --white: #ffffff;
  --ink: #1d2b33;
  --muted: #647680;
  --line: #d5e1e7;
  --danger: #bd594c;
  --warning: #d59a3d;
  --shadow: 0 14px 38px rgba(49, 95, 121, .12);
  background: #f3f8fa;
}

html.native-app body {
  background:
    radial-gradient(circle at 100% 0, rgba(143, 196, 216, .14), transparent 32%),
    linear-gradient(180deg, #f8fbfc 0, #f3f8fa 42%, #edf6f9 100%);
}

html.native-app .topbar {
  border-bottom-color: rgba(49, 95, 121, .14);
  background: rgba(248, 251, 252, .9);
}

html.native-app .eyebrow { color: #568faa; }

html.native-app .sync-button,
html.native-app .notification,
html.native-app .top-profile,
html.native-app .api-settings-button {
  border-color: #d5e1e7;
  color: #315f79;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(49, 95, 121, .09);
}

html.native-app .panel,
html.native-app .metric-card,
html.native-app .verba-card,
html.native-app .calc-form-panel,
html.native-app .filter-panel,
html.native-app .registration-panel,
html.native-app .user-form-section,
html.native-app .account-section,
html.native-app .record-card,
html.native-app .filial-card {
  border-color: #d5e1e7;
  box-shadow: 0 10px 28px rgba(49, 95, 121, .08);
}

html.native-app .metric-card.primary,
html.native-app .verba-confirmation:not(.empty) {
  border-color: #315f79;
  background: linear-gradient(145deg, #467e9d, #315f79 82%);
  box-shadow: 0 18px 38px rgba(49, 95, 121, .22);
}

html.native-app .primary-button,
html.native-app .chips button.active,
html.native-app .tabs button.active {
  border-color: #315f79;
  background: linear-gradient(135deg, #467e9d, #315f79);
  box-shadow: 0 8px 20px rgba(49, 95, 121, .22);
}

html.native-app .primary-button:active { transform: translateY(1px) scale(.985); }

html.native-app input:focus,
html.native-app select:focus,
html.native-app textarea:focus {
  border-color: #6da2ba;
  box-shadow: 0 0 0 3px rgba(109, 162, 186, .18);
}

html.native-app .status-pill.active {
  color: #386b87;
  background: #dcf2e5;
}

/* Todo texto apoiado em superfícies azuis usa contraste branco no APK. */
html.native-app .primary-button,
html.native-app .primary-button *,
html.native-app .chips button.active,
html.native-app .chips button.active *,
html.native-app .tabs button.active,
html.native-app .tabs button.active * {
  color: #fff;
}

html.native-app .metric-card.primary :is(h1, h2, h3, p, span, strong, small, b),
html.native-app .verba-confirmation:not(.empty) :is(h1, h2, h3, p, span, strong, small, b) {
  color: #fff;
}

html.native-app .verba-confirmation .total-result,
html.native-app .verba-confirmation .total-result :is(p, span, strong, small, b) {
  color: var(--forest);
}

html.native-app .verba-confirmation .status-pill.active {
  color: #386b87;
}

/* Reserva a área segura do Android em telas amplas e em todas as janelas. */
html.native-app .modal {
  max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 28px);
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 30px);
}

html.native-app .modal form,
html.native-app .account-dialog,
html.native-app .delete-confirm-content,
html.native-app .confirm-dialog {
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 30px);
}

@media (min-width: 761px) {
  html.native-app .app-shell { padding-top: env(safe-area-inset-top); }
  html.native-app .sidebar { top: env(safe-area-inset-top); }
}

/* Acabamento nativo: barra de status integrada e ação central elevada. */
@media (max-width: 760px) {
  html.native-app body::before {
    content: '';
    height: env(safe-area-inset-top);
    position: fixed;
    z-index: 45;
    inset: 0 0 auto;
    pointer-events: none;
    background: linear-gradient(135deg, #294f65, #467e9d);
  }

  html.native-app .mobile-nav {
    width: auto;
    max-width: none;
    height: 72px;
    overflow: visible;
    inset: auto max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    isolation: isolate;
    padding: 0 7px;
    border: 1px solid rgba(49, 95, 121, .14);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(246, 250, 248, .98));
    box-shadow: 0 14px 34px rgba(49, 95, 121, .2), 0 3px 10px rgba(49, 95, 121, .09);
    backdrop-filter: blur(18px);
  }

  html.native-app .mobile-nav::before {
    content: '';
    width: 84px;
    height: 84px;
    position: absolute;
    z-index: 0;
    top: -42px;
    left: 50%;
    border-radius: 50%;
    pointer-events: none;
    background: #eef5f2;
    box-shadow: 0 7px 12px rgba(49, 95, 121, .11);
    transform: translateX(-50%);
  }

  html.native-app .mobile-nav button {
    min-height: 68px;
    position: relative;
    z-index: 1;
    gap: 5px;
    padding: 7px 3px 4px;
    border-radius: 15px;
    background: transparent;
    transition: color .2s ease, transform .18s ease;
  }

  html.native-app .mobile-nav button:not(.mobile-add):not(.mobile-primary-action) > .icon {
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 12px;
    transition: color .2s ease, background .2s ease, transform .18s ease, box-shadow .2s ease;
  }

  html.native-app .mobile-nav button:not(.mobile-add):not(.mobile-primary-action).active > .icon {
    color: #315f79;
    background: linear-gradient(145deg, #e5f5ef, #d4ece4);
    box-shadow: 0 5px 14px rgba(49, 95, 121, .15);
    transform: translateY(-2px);
  }

  html.native-app .mobile-nav button:not(.mobile-add):not(.mobile-primary-action):active > .icon {
    transform: scale(.9);
  }

  html.native-app .mobile-nav small {
    color: #748780;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1;
    transition: color .2s ease;
  }

  html.native-app .mobile-nav button.active small {
    color: #315f79;
  }

  html.native-app .mobile-nav .mobile-add,
  html.native-app .mobile-nav .mobile-primary-action {
    width: auto;
    height: auto;
    min-height: 68px;
    flex: 1 1 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--forest);
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  html.native-app .mobile-nav .mobile-add-icon,
  html.native-app .mobile-nav .mobile-primary-action > .icon {
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    display: grid;
    place-items: center;
    position: absolute;
    top: -34px;
    left: 50%;
    margin: 0;
    padding: 0;
    border: 4px solid #f2f7f5;
    border-radius: 50%;
    color: white;
    background: linear-gradient(145deg, #568faa, #315f79 72%);
    box-shadow: 0 10px 22px rgba(49, 95, 121, .32), 0 3px 7px rgba(49, 95, 121, .2);
    transform: translateX(-50%);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  }

  html.native-app .mobile-nav .mobile-add-icon::after,
  html.native-app .mobile-nav .mobile-primary-action > .icon::after {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: inherit;
    pointer-events: none;
  }

  html.native-app .mobile-nav .mobile-add-icon > .icon {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    line-height: 0;
    transform: translate(-50%, -50%);
  }

  html.native-app .mobile-nav .mobile-add-icon > .icon svg {
    width: 27px;
    height: 27px;
    display: block;
    overflow: visible;
    stroke-width: 2.2;
  }

  html.native-app .mobile-nav .mobile-primary-action > .icon svg {
    width: 27px;
    height: 27px;
  }

  html.native-app .mobile-nav .mobile-add small,
  html.native-app .mobile-nav .mobile-primary-action small {
    position: absolute;
    top: 43px;
    right: 0;
    left: 0;
    margin: 0;
    color: #315f79;
    font-weight: 850;
    text-align: center;
  }

  html.native-app .mobile-nav .mobile-add:active .mobile-add-icon,
  html.native-app .mobile-nav .mobile-primary-action:active > .icon {
    filter: brightness(1.08);
    transform: translateX(-50%) translateY(2px) scale(.94);
    box-shadow: 0 5px 14px rgba(49, 95, 121, .3), 0 0 0 4px rgba(143, 196, 216, .3);
  }

  html.native-app .main-content {
    padding-bottom: calc(116px + env(safe-area-inset-bottom));
  }

  html.native-app .toast-region {
    bottom: calc(104px + env(safe-area-inset-bottom));
  }

  /* Menu nivelado: o item ativo é um cartão azul dentro da barra. */
  html.native-app .mobile-nav::before { display: none; }

  html.native-app .mobile-nav button,
  html.native-app .mobile-nav .mobile-primary-action {
    min-height: 68px;
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 7px 3px 4px;
    border: 0;
    border-radius: 15px;
    color: #748780;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  html.native-app .mobile-nav button:not(.mobile-add):not(.mobile-primary-action) > .icon,
  html.native-app .mobile-nav .mobile-primary-action > .icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    position: relative;
    inset: auto;
    margin: 0;
    padding: 7px;
    border: 0;
    border-radius: 12px;
    color: #748780;
    background: transparent;
    box-shadow: none;
    filter: none;
    transform: none;
  }

  html.native-app .mobile-nav .mobile-primary-action > .icon::after {
    display: none;
  }

  html.native-app .mobile-nav button small,
  html.native-app .mobile-nav .mobile-primary-action small {
    position: static;
    inset: auto;
    margin: 0;
    color: #748780;
    font-weight: 750;
    text-align: center;
  }

  html.native-app .mobile-nav button.active {
    min-height: 54px;
    z-index: 2;
    gap: 2px;
    margin: 7px 3px;
    padding: 4px 3px 3px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, #568faa, #315f79 78%);
    box-shadow: 0 7px 17px rgba(49, 95, 121, .24), inset 0 1px rgba(255, 255, 255, .12);
    transform: none;
  }

  html.native-app .mobile-nav button:not(.mobile-add):not(.mobile-primary-action).active > .icon,
  html.native-app .mobile-nav .mobile-primary-action.active > .icon {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    position: relative;
    inset: auto;
    margin: 0;
    padding: 6px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    box-shadow: none;
    filter: none;
    transform: none;
  }

  html.native-app .mobile-nav button.active > .icon svg {
    width: 19px;
    height: 19px;
  }

  html.native-app .mobile-nav button.active small,
  html.native-app .mobile-nav .mobile-primary-action.active small {
    position: static;
    inset: auto;
    color: #fff;
    font-weight: 850;
  }

  html.native-app .mobile-nav button.active:active > .icon,
  html.native-app .mobile-nav .mobile-primary-action.active:active > .icon {
    filter: brightness(1.08);
    transform: scale(.92);
    box-shadow: none;
  }

  html.native-app .mobile-nav .mobile-primary-action:not(.active):active > .icon {
    filter: none;
    transform: scale(.9);
    box-shadow: none;
  }

  html.native-app .mobile-nav {
    overflow: hidden;
  }

  html.native-app #view-verbas .module-toolbar .open-verba-modal {
    width: 100%;
    max-width: 360px;
    min-height: 50px;
    display: inline-flex;
    margin: 2px auto 0;
    justify-content: center;
  }
}

/* Ferramentas de produtividade e contenção responsiva da versão web. */
.web-only { display: none !important; }
html.web-app .web-only { display: inline-flex !important; }
html.web-app .web-only[hidden] { display: none !important; }

.module-actions,
.panel-actions,
.calculation-export-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.module-actions > button,
.panel-actions > button,
.calculation-export-actions > button {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
}

.module-toolbar > *,
.welcome-row > *,
.panel-heading > *,
.manage-heading > *,
.filter-panel > *,
.result-summary > *,
.calculation-layout > *,
.form-grid > *,
.record-fields > * {
  min-width: 0;
  max-width: 100%;
}

.module-actions .primary-button { min-width: 170px; }
.panel-actions { flex: 1 1 auto; }
.user-search-box { width: min(330px, 40vw); flex: 1 1 240px; margin: 0; }
.user-search-box input { min-width: 0; }
.calculation-export-actions { justify-content: flex-start; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(49, 95, 121, .16); }
.calculation-export-actions .ghost-button { color: var(--forest); border-color: #c9d9ce; background: rgba(255,255,255,.78); }
html.native-app .module-actions { width: 100%; justify-content: center; }

.result-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 14px; }
.result-tools label { white-space: nowrap; }
html.web-app .chips { max-width: 100%; flex-wrap: wrap; overflow-x: visible; }
.view-toggle { padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.view-toggle button { width: 34px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.view-toggle button.active { color: #fff; background: var(--forest); box-shadow: 0 3px 9px rgba(49, 95, 121, .22); }
.view-toggle .icon { width: 17px; height: 17px; }

.pagination { align-items: center; justify-content: center; gap: 14px; margin: 20px auto 0; }
.pagination > span { min-width: 150px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

html.web-app .verba-grid.list-view { grid-template-columns: minmax(0, 1fr); }
html.web-app .verba-grid.list-view .verba-card { display: grid; grid-template-columns: minmax(105px, .45fr) minmax(150px, .9fr) minmax(190px, 1.25fr) minmax(250px, 1.4fr) minmax(220px, 1fr); gap: 14px; align-items: center; }
html.web-app .verba-grid.list-view .verba-card > * { min-width: 0; margin: 0; }
html.web-app .verba-grid.list-view .verba-card h3,
html.web-app .verba-grid.list-view .verba-card > p { -webkit-line-clamp: 2; }
html.web-app .verba-grid.list-view .card-meta { margin: 0; }
html.web-app .verba-grid.list-view .card-price { margin: 0; padding: 0; border: 0; }

.catalog-tools { width: 100%; margin: 0 0 16px; padding: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255,255,255,.72); }
.catalog-tools .search-box { width: min(480px, 100%); flex: 1 1 280px; margin: 0; }
.compact-select { min-width: 130px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px 0 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.compact-select select { min-width: 0; min-height: 42px; padding: 0 4px; border: 0; color: var(--forest); background: transparent; font: inherit; }
.panel-actions .compact-select { flex: 0 1 auto; }

html.web-app .calculation-history-panel.web-only { width: 100%; display: block !important; margin-top: 20px; overflow: hidden; }
.calculation-history-panel .panel-heading { padding: 18px 20px; }
.calculation-history-panel table { min-width: 760px; }
.calculation-history-panel tbody td { vertical-align: middle; }
.calculation-history-panel tbody td:nth-child(2) strong,
.calculation-history-panel tbody td:nth-child(2) small { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calculation-history-panel tbody td:nth-child(2) small { margin-top: 3px; color: var(--muted); }
.empty-state.compact { padding: 32px 18px; }

html.web-app button > span:not(.icon),
html.web-app .primary-button > span:not(.icon),
html.web-app .ghost-button > span:not(.icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.web-app input,
html.web-app select,
html.web-app textarea,
html.web-app .password-field,
html.web-app .money-input,
html.web-app .search-box,
html.web-app .relation-search {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1180px) and (min-width: 761px) {
  html.web-app .topbar > div:first-child { min-width: 0; }
  html.web-app .topbar h1 { overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
  html.web-app .topbar-actions { flex: 0 0 auto; gap: 6px; margin-left: 8px; }
  html.web-app .sync-button span:not(.icon),
  html.web-app .top-profile .user-role { display: none; }
  html.web-app .sync-button,
  html.web-app .top-profile { width: 42px; min-width: 42px; padding-inline: 0; justify-content: center; }
  html.web-app .calculation-layout { grid-template-columns: minmax(0, 1fr); }
  html.web-app .module-toolbar,
  html.web-app .welcome-row,
  html.web-app .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  html.web-app .module-description,
  html.web-app .panel-heading > div:first-child { flex: 1 1 420px; }
  html.web-app .module-actions,
  html.web-app .panel-actions { flex: 1 1 100%; justify-content: flex-end; }
  html.web-app .user-search-box { width: min(100%, 420px); }
  html.web-app .verba-grid.list-view .verba-card { grid-template-columns: minmax(105px, .45fr) minmax(160px, 1fr) minmax(240px, 1.4fr); }
  html.web-app .verba-grid.list-view .verba-card > p { display: none; }
  html.web-app .verba-grid.list-view .card-meta { grid-column: 3; }
  html.web-app .verba-grid.list-view .card-price { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  html.web-app,
  html.web-app body,
  html.web-app .app-shell,
  html.web-app .main-content,
  html.web-app .view { width: 100%; max-width: 100%; min-width: 0; }
  html.web-app .main-content { overflow-x: clip; }
  html.web-app .topbar { width: 100%; min-width: 0; }
  html.web-app .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  html.web-app .topbar-actions { min-width: 0; flex: 0 0 auto; margin-left: 8px; }
  html.web-app .welcome-row { width: 100%; align-items: stretch; flex-direction: column; gap: 16px; }
  html.web-app .welcome-row > div:first-child { width: 100%; }
  html.web-app .module-actions { width: 100%; justify-content: center; }
  html.web-app .module-actions > button { flex: 1 1 170px; max-width: 360px; }
  html.web-app .panel-actions { width: 100%; justify-content: stretch; }
  html.web-app .panel-actions > button { flex: 0 0 auto; }
  html.web-app .user-search-box { width: auto; flex: 1 1 220px; }
  html.web-app .calculation-export-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.web-app .calculation-export-actions button { width: 100%; }
  html.web-app .result-summary { align-items: flex-start; flex-direction: column; }
  html.web-app .result-tools { width: 100%; justify-content: flex-start; }
  html.web-app .verba-grid.list-view .verba-card { display: flex; }
  html.web-app .catalog-tools { align-items: stretch; }
  html.web-app .catalog-tools .search-box { flex-basis: 100%; }
  html.web-app .panel-actions .compact-select { flex: 1 1 150px; }
}

@media (max-width: 520px) {
  html.web-app .module-actions,
  html.web-app .panel-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  html.web-app .module-actions > button,
  html.web-app .panel-actions > button,
  html.web-app .user-search-box { width: 100%; max-width: none; }
  html.web-app .manage-actions { grid-template-columns: minmax(0, 1fr); }
  html.web-app .registration-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.web-app .calculation-export-actions { grid-template-columns: minmax(0, 1fr); }
  html.web-app .result-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  html.web-app .result-tools label { width: 100%; justify-content: space-between; }
  html.web-app .view-toggle { width: fit-content; }
  html.web-app .pagination { width: 100%; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.web-app .pagination > span { min-width: 0; grid-column: 1 / -1; grid-row: 1; }
  html.web-app .pagination button { width: 100%; }
  html.web-app .catalog-tools { display: grid !important; grid-template-columns: minmax(0, 1fr); }
  html.web-app .catalog-tools > * { width: 100%; max-width: none; }
  html.web-app .compact-select { justify-content: space-between; }
  html.web-app #verba-form > footer,
  html.web-app #record-form > footer,
  html.web-app #report-form > footer,
  html.web-app #user-form > footer,
  html.web-app #api-settings-form > footer,
  html.web-app #login-form > footer { grid-template-columns: minmax(0, 1fr); }
  html.web-app .modal footer button { white-space: nowrap; }
}

/* Cálculo automático, DATASUL e layouts resilientes a zoom/texto ampliado. */
.lookup-input.automatic { position: relative; z-index: 2; display: block; scroll-margin-block: 110px 38dvh; }
.lookup-input.automatic:focus-within { z-index: 16; }
.lookup-input.automatic > .icon { width: 20px; height: 20px; position: absolute; z-index: 1; top: 50%; left: 15px; transform: translateY(-50%); color: var(--sage); pointer-events: none; }
.lookup-input.automatic input { width: 100%; padding-inline: 46px 145px; border-radius: 11px; }
.lookup-input.automatic:focus-within > .icon { color: var(--forest); }
.lookup-progress { position: absolute; top: 50%; right: 14px; max-width: 125px; overflow: hidden; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.lookup-help, .money-input-help { display: block; margin: 8px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.lookup-suggestions { position: relative; z-index: 17; max-height: min(330px, 48dvh); overflow-y: auto; }
.lookup-suggestions button { width: 100%; min-width: 0; border-bottom: 1px solid #edf1ee; }
.lookup-suggestions button:last-child { border-bottom: 0; }
.lookup-result-main { min-width: 0; display: grid; gap: 2px; }
.lookup-result-main small { color: var(--sage); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.lookup-result-main strong { color: var(--forest); font-size: 14px; }
.lookup-result-main > span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.desired-value-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); scroll-margin: 110px 0 210px; }
.desired-value-section .step-label { margin-bottom: 18px; }
.desired-value-section .field-label { color: rgba(255,255,255,.85); }
.money-input-primary { height: 64px; background: #fff; }
.money-input-primary input { min-width: 0; color: var(--ink); font-size: clamp(28px, 4vw, 38px); font-variant-numeric: tabular-nums; }
.money-input-primary span { font-size: 16px; }
.desired-value-section .money-input-help { margin-top: 10px; color: rgba(255,255,255,.72); }
.calculate-primary { min-height: 52px; color: var(--forest); border-color: var(--lime); background: var(--lime); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.calculate-primary:hover { color: var(--forest); border-color: #e3c873; background: #e3c873; }
.datasul-origin { display: flex; align-items: center; gap: 11px; margin: 18px 0; padding: 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; background: rgba(255,255,255,.075); }
.datasul-origin[hidden] { display: none; }
.datasul-origin > .icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--lime); }
.datasul-origin div { min-width: 0; display: grid; gap: 2px; }
.datasul-origin small { color: #a8bbb1; font-size: 10px; }
.datasul-origin strong { overflow-wrap: anywhere; font-size: 13px; }
.datasul-origin div > span { color: var(--lime); font-size: 10px; font-weight: 800; }
.verba-details { margin: 0 0 4px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; }
.verba-details summary { min-height: 46px; display: flex; align-items: center; padding: 0 13px; color: #d9e5df; font-size: 12px; font-weight: 750; cursor: pointer; }
.verba-details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; padding: 1px; background: rgba(255,255,255,.09); }
.verba-details-grid > div { min-width: 0; display: grid; gap: 4px; padding: 11px; background: var(--forest); }
.verba-details-grid span { color: #95ada1; font-size: 9px; text-transform: uppercase; }
.verba-details-grid strong { overflow-wrap: anywhere; color: #fff; font-size: 12px; }

.total-result { display: grid; gap: 14px; margin-top: 22px; padding: clamp(16px, 3vw, 22px); }
.total-result-quantity > strong { overflow-wrap: anywhere; font-size: clamp(30px, 5vw, 42px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.total-result-quantity > small { margin-top: 6px; font-size: 11px; }
.total-result-values { margin-top: 0; }
.result-value-card { min-width: 0; padding: 13px; border-radius: 10px; background: rgba(255,255,255,.42); }
.total-result-values .result-value-card strong { font-size: clamp(24px, 3vw, 32px); font-variant-numeric: tabular-nums; }
.result-difference-card { padding: 15px; border: 1px solid rgba(18,55,42,.17); border-radius: 11px; background: rgba(255,255,255,.55); }
.result-difference-card > span { font-weight: 800; }
.result-difference-card .result-difference { margin: 4px 0; padding: 0; background: transparent; font-size: clamp(22px, 3vw, 30px); font-variant-numeric: tabular-nums; }
.result-difference-card .result-difference::before { display: none; }
.result-difference-card small { font-size: 11px; }
.result-difference.within-tolerance, .installment-card.within-tolerance footer strong { color: #386b87; }
.result-difference.outside-tolerance, .installment-card.outside-tolerance footer strong { color: #a2362e; }
.result-difference-card:has(.outside-tolerance) { border-color: #e1aaa5; background: #fff1ef; }
.installment-groups { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.installment-card { min-width: 0; display: grid; gap: 9px; padding: 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; background: rgba(255,255,255,.075); }
.installment-card header, .installment-card div, .installment-card footer { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.installment-card header { padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.11); }
.installment-card header > span { color: var(--lime); font-size: 12px; font-weight: 800; }
.installment-card header > strong { overflow-wrap: anywhere; color: #fff; font-size: clamp(20px, 3vw, 26px); font-variant-numeric: tabular-nums; }
.installment-card div > span, .installment-card footer > span { color: #a8bab1; font-size: 10px; text-transform: none; }
.installment-card div > b, .installment-card footer > strong { overflow-wrap: anywhere; color: #fff; font-size: 13px; text-align: right; }
.installment-card footer { padding-top: 9px; border-top: 1px solid rgba(255,255,255,.1); }

.registration-tabs { grid-template-columns: repeat(6,minmax(0,1fr)); }
.datasul-panel { overflow: visible; }
.datasul-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 0 20px 16px; }
.datasul-stats > div { min-width: 0; display: grid; gap: 3px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.datasul-stats strong { color: var(--forest); font-size: 24px; }
.datasul-stats span { color: var(--muted); font-size: 11px; }
.datasul-stats .attention { border-color: #e4c994; background: #fff9ed; }
.datasul-mode-tabs { display: flex; gap: 5px; margin: 0 20px 12px; padding: 4px; border-radius: 11px; background: #eaf0ec; }
.datasul-mode-tabs button { min-height: 42px; flex: 1; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.datasul-mode-tabs button.active { color: var(--forest); background: white; box-shadow: 0 2px 8px rgba(18,55,42,.08); }
.datasul-filters { display: grid; grid-template-columns: minmax(230px,2fr) repeat(4,minmax(120px,1fr)); gap: 9px; align-items: end; padding: 0 20px 18px; }
.datasul-filters > label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.datasul-filters select { width: 100%; min-width: 0; height: 44px; padding-inline: 9px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.datasul-filters .search-box { width: 100%; margin: 0; }
.datasul-list { border-top: 1px solid var(--border); }
.datasul-row { min-width: 0; display: grid; grid-template-columns: minmax(82px,.45fr) minmax(220px,2fr) auto auto; gap: 13px; align-items: center; padding: 14px 20px; border-bottom: 1px solid #edf1ee; }
.datasul-link-row { grid-template-columns: minmax(75px,.4fr) 24px minmax(75px,.4fr) minmax(220px,2fr) auto auto; }
.datasul-code, .datasul-description { min-width: 0; display: grid; gap: 3px; }
.datasul-code small { color: var(--sage); font-size: 9px; font-weight: 850; }
.datasul-code strong { overflow-wrap: anywhere; color: var(--forest); font-size: 15px; }
.datasul-code.pims small { color: #587087; }
.datasul-arrow { color: var(--sage); font-size: 22px; text-align: center; }
.datasul-description strong, .datasul-description small, .datasul-description span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datasul-description strong { font-size: 13px; }
.datasul-description small, .datasul-description span { color: var(--muted); font-size: 11px; }
.datasul-status { padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.datasul-status.confirmado { color: #386b87; background: #e1eff5; }
.datasul-status.sugerido { color: #77570b; background: #fff0bd; }
.datasul-status.revisar { color: #983d33; background: #fde5e1; }
.record-actions-group { display: flex; justify-content: flex-end; gap: 5px; }
.record-actions-group button { width: 44px; height: 44px; display: grid; place-items: center; }
.datasul-row.inactive-row { opacity: .64; }
.subcategory-tags { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.subcategory-card { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.subcategory-card > div:first-child { min-width: 0; display: grid; gap: 3px; }
.subcategory-card strong { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.subcategory-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#datasul-link-form .datasul-link-body { display: grid; gap: 16px; overflow-x: hidden; overflow-y: auto; }
#datasul-link-form .datasul-link-pickers { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
#datasul-link-form .datasul-link-picker,
#datasul-link-form .datasul-link-details { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fbfcfb; }
#datasul-link-form .datasul-link-picker { display: grid; grid-template-rows: auto auto minmax(150px,1fr); gap: 12px; }
#datasul-link-form .datasul-link-picker-heading { min-width: 0; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; align-items: center; }
#datasul-link-form .datasul-link-picker-heading > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--forest); font-size: 12px; font-weight: 850; }
#datasul-link-form .datasul-link-picker-heading h3 { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.3; }
#datasul-link-form .datasul-link-picker-heading h3 b { color: var(--danger); }
#datasul-link-form .datasul-link-picker-heading small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
#datasul-link-form .datasul-link-picker > label { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
#datasul-link-form .datasul-link-picker > label input { margin-top: 6px; }
#datasul-link-form select[size] { height: 168px; min-height: 168px; margin: 0; padding: 5px; line-height: 1.35; }
#datasul-link-form select[size] option { min-height: 34px; padding: 8px; border-radius: 6px; white-space: normal; }
#datasul-link-form .datasul-link-summary { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 32px minmax(0,1fr); gap: 10px; align-items: stretch; padding: 13px 15px; border: 1px dashed #b8c9bf; border-radius: 13px; background: #f5f9f6; transition: border-color .18s ease, background .18s ease; }
#datasul-link-form .datasul-link-summary.complete { border-color: #6da2ba; background: #edf6f9; }
#datasul-link-form .datasul-link-summary > div { min-width: 0; display: grid; align-content: center; gap: 3px; }
#datasul-link-form .datasul-link-summary small { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
#datasul-link-form .datasul-link-summary strong { overflow-wrap: anywhere; color: var(--forest); font-size: 11px; line-height: 1.4; }
#datasul-link-form .datasul-link-summary-arrow { width: 32px; height: 32px; display: grid; place-items: center; align-self: center; border-radius: 50%; color: var(--forest); background: white; box-shadow: 0 2px 8px rgba(30,72,51,.1); font-size: 16px; font-weight: 850; }
#datasul-link-form .datasul-link-details > .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 14px 0 0; overflow: visible; }
#datasul-link-form .datasul-link-details > .form-grid .span-3 { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .registration-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .datasul-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .datasul-filters .search-box { grid-column: 1 / -1; }
  .datasul-row, .datasul-link-row { grid-template-columns: minmax(78px,.4fr) minmax(0,1fr) auto; }
  .datasul-link-row .datasul-arrow, .datasul-link-row .datasul-code.pims { display: none; }
  .datasul-row .record-actions-group { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 720px) {
  #datasul-link-form .datasul-link-pickers { grid-template-columns: minmax(0,1fr); }
  #datasul-link-form .datasul-link-summary { grid-template-columns: minmax(0,1fr); }
  #datasul-link-form .datasul-link-summary-arrow { justify-self: center; transform: rotate(90deg); }
  #datasul-link-form .datasul-link-details > .form-grid { grid-template-columns: minmax(0,1fr); }
  #datasul-link-form .datasul-link-details > .form-grid .span-3 { grid-column: 1; }
}

@media (max-width: 520px) {
  .lookup-input.automatic input { height: 56px; min-height: 56px; padding: 0 42px 0 46px; line-height: normal; }
  .lookup-input.automatic > .icon { top: 28px; bottom: auto; left: 15px; transform: translateY(-50%); }
  .lookup-progress { position: static; width: fit-content; max-width: 100%; min-height: 20px; display: flex; align-items: center; margin: 6px 2px 0 auto; overflow: visible; transform: none; font-size: 10px; line-height: 1.35; text-align: right; text-overflow: clip; white-space: normal; }
  .lookup-result-main > span { white-space: normal; }
  .confirmation-content, .calc-form-panel { padding: 18px; }
  .confirm-data, .verba-details-grid, .total-result-values, .installment-groups { grid-template-columns: minmax(0,1fr); }
  .confirm-data div { min-height: 0; padding: 12px 0 !important; border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,.12); }
  .money-input-primary input { font-size: clamp(28px, 10vw, 36px); }
  .total-result-quantity > strong { font-size: clamp(28px, 9vw, 38px); }
  .total-result-values .result-value-card strong { font-size: clamp(23px, 8vw, 30px); }
  .registration-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .datasul-stats { grid-template-columns: repeat(2,minmax(0,1fr)); padding-inline: 14px; }
  .datasul-mode-tabs { margin-inline: 14px; }
  .datasul-filters { grid-template-columns: minmax(0,1fr); padding-inline: 14px; }
  .datasul-filters .search-box { grid-column: auto; }
  .datasul-row, .datasul-link-row { grid-template-columns: minmax(72px,.45fr) minmax(0,1fr); padding-inline: 14px; }
  .datasul-row > .status-pill, .datasul-row > .datasul-status { justify-self: start; }
  .datasul-row .record-actions-group { grid-column: 1 / -1; width: 100%; justify-content: flex-end; }
  .datasul-description strong, .datasul-description small, .datasul-description span { white-space: normal; overflow-wrap: anywhere; }
  .installment-card header { align-items: flex-start; flex-direction: column; }
  .subcategory-tags { grid-template-columns: minmax(0,1fr); }
  .subcategory-card { grid-template-columns: minmax(0,1fr) auto; }
  .subcategory-card .record-actions-group { grid-column: 1 / -1; }
}

html.native-app .lookup-help,
html.native-app .money-input-help { font-size: 14px; }
html.native-app .step-label strong { font-size: 16px; }
html.native-app .step-label small,
html.native-app .field-label { font-size: 14px; }
html.native-app .lookup-input input { font-size: 18px; }
html.native-app .lookup-progress { font-size: 12px; }
html.native-app .lookup-result-main small { font-size: 12px; }
html.native-app .lookup-result-main strong { font-size: 17px; }
html.native-app .lookup-result-main > span { font-size: 14px; }
html.native-app .confirmation-content > h3 { font-size: 23px; }
html.native-app .confirmation-content > p,
html.native-app .confirm-data strong,
html.native-app .verba-details summary { font-size: 15px; }
html.native-app .confirm-data span,
html.native-app .unit-price span,
html.native-app .total-result span { font-size: 12px; }
html.native-app .unit-price strong { font-size: 28px; }
html.native-app .installment-header strong,
html.native-app .installment-control label { font-size: 16px; }
html.native-app .installment-header small,
html.native-app .installment-control small,
html.native-app .installment-note { font-size: 13px; }

/* Ícones semânticos e ações consistentes no módulo de cadastros. */
.registration-tabs button {
  gap: 9px;
  padding: 7px 9px;
  color: #5f6f66;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.registration-tabs button:hover { transform: translateY(-1px); }
.registration-tab-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(95, 126, 105, .14);
  border-radius: 10px;
  color: #557164;
  background: rgba(255, 255, 255, .58);
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.registration-tab-icon > .icon { width: 19px !important; height: 19px !important; }
.registration-tabs button.active .registration-tab-icon {
  color: #fff;
  border-color: var(--forest);
  background: var(--forest);
  box-shadow: 0 4px 10px rgba(49, 95, 121, .22);
}
.registration-tabs button:focus-visible,
.record-actions-group button:focus-visible,
.filial-actions button:focus-visible {
  outline: 3px solid rgba(55, 116, 83, .28);
  outline-offset: 2px;
}

.manage-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}
.manage-title > div { min-width: 0; }
.manage-title-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid #cfe0d5;
  border-radius: 12px;
  color: var(--forest);
  background: linear-gradient(145deg, #f2f8f4, #e2efe7);
}
.manage-title-icon > .icon { width: 22px; height: 22px; }
.manage-title-icon.attention { color: #966025; border-color: #ead4ab; background: #fff8e9; }
.manage-title-icon.datasul { color: #42647d; border-color: #cadbe7; background: #eef6fb; }
.manage-heading .primary-button > .icon,
.manage-heading .ghost-button > .icon { width: 18px; height: 18px; }

.subcategory-block h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.subcategory-block h4 > .icon { width: 17px; height: 17px; color: var(--sage); }
.datasul-mode-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.datasul-mode-tabs button > .icon { width: 17px; height: 17px; }
.datasul-mode-tabs button.active > .icon { color: var(--forest); }

.record-actions-group button,
.filial-actions .record-edit,
.filial-actions .record-delete {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}
.record-actions-group button .icon,
.filial-actions button .icon { width: 19px; height: 19px; }
.subcategory-card .record-actions-group .icon {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
}
.record-actions-group .record-delete .icon,
.filial-actions .record-delete .icon { width: 18px; height: 18px; }
.manage-panel .empty-state > .icon {
  width: 52px;
  height: 52px;
  padding: 13px;
  border: 1px solid #d7e3da;
  border-radius: 15px;
  color: var(--forest);
  background: #f0f6f2;
}

@media (max-width: 760px) {
  .registration-tabs button { min-height: 72px; gap: 5px; padding: 6px 4px; font-size: 10px; }
  .registration-tab-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; }
  .registration-tab-icon > .icon { width: 18px !important; height: 18px !important; }
  .manage-title { align-items: flex-start; }
  .manage-title-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; }
  .manage-title-icon > .icon { width: 20px; height: 20px; }
}

@media (max-width: 360px) {
  .registration-tabs button > span:last-child { font-size: 9px; letter-spacing: 0; }
}

.sync-status-dialog { width: min(760px, calc(100vw - 32px)); }
.sync-status-dialog > header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.sync-diagnostics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px 0; }
.sync-diagnostics-grid article { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: #f7f9f7; display: grid; gap: 6px; }
.sync-diagnostics-grid small { color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.sync-diagnostics-grid strong { overflow-wrap: anywhere; }
.sync-diagnostics-grid .app-update-card { border-color: #b8d1ad; background: var(--green-50); }
.sync-diagnostics-grid .app-update-card .sync-diagnostic-icon { color: var(--green-800); }
.sync-diagnostics-grid .app-update-card strong { color: var(--green-950); }
.sync-status-dialog > footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }

@media (max-width: 640px) {
  .sync-diagnostics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-status-dialog > footer > button { flex: 1 1 100%; }
}

@media print {
  body.printing-calculation { background: white; }
  body.printing-calculation .sidebar,
  body.printing-calculation .topbar,
  body.printing-calculation .mobile-nav,
  body.printing-calculation .module-toolbar,
  body.printing-calculation .calc-form-panel,
  body.printing-calculation .report-button,
  body.printing-calculation .calculation-export-actions,
  body.printing-calculation .toast-region { display: none !important; }
  body.printing-calculation .main-content { min-height: 0; margin: 0; padding: 0; }
  body.printing-calculation .view { display: none !important; }
  body.printing-calculation #view-calculo { display: block !important; padding: 0; }
  body.printing-calculation .calculation-layout { display: block; }
  body.printing-calculation .verba-confirmation { color: #172a26; background: white; border: 1px solid #cad7cf; box-shadow: none; }
  body.printing-calculation #view-calculo .confirmation-content * { color: #172a26 !important; }
  body.printing-calculation .confirm-data,
  body.printing-calculation .unit-price,
  body.printing-calculation .total-result,
  body.printing-calculation .installment-panel { color: #172a26; border-color: #cad7cf; background: white; }
}

/* Botões com superfície azul mantêm texto e ícones brancos na Web e no APK. */
:is(html.web-app, html.native-app) :is(
  .primary-button,
  .lookup-input button,
  .chips button.active,
  .view-toggle button.active,
  .verba-workspace-tabs button.active,
  .verba-card-actions .calculate-verba,
  .login-card-action .secondary-button
) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

:is(html.web-app, html.native-app) :is(
  .primary-button,
  .lookup-input button,
  .chips button.active,
  .view-toggle button.active,
  .verba-workspace-tabs button.active,
  .verba-card-actions .calculate-verba,
  .login-card-action .secondary-button
) :is(span, strong, small, b, em, .icon) {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

html.native-app :is(
  .calculate-primary,
  .tabs button.active,
  .mobile-nav button.active,
  .mobile-nav button.account-active,
  .mobile-nav .mobile-primary-action.active,
  .number-stepper .icon-only-button:active
) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html.native-app :is(
  .calculate-primary,
  .tabs button.active,
  .mobile-nav button.active,
  .mobile-nav button.account-active,
  .mobile-nav .mobile-primary-action.active,
  .number-stepper .icon-only-button:active
) :is(span, strong, small, b, em, .icon) {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}
