:root {
  --forest: #12372a;
  --forest-2: #1c4d3b;
  --sage: #6e967b;
  --mint: #dcebe1;
  --lime: #b9d67a;
  --paper: #f5f6f2;
  --white: #fff;
  --ink: #17211d;
  --muted: #68736d;
  --line: #e3e7e2;
  --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: #86c596; box-shadow: 0 0 0 4px rgba(134,197,150,.12); }
.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 { height: 98px; display: flex; align-items: center; justify-content: space-between; 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: #e2f1e4; color: #347149; }
.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: #377049; background: #e2f1e4; }
.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: #58a16e; }
.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; }
.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: 1px solid var(--line); }
.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); }
  .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; }
  .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(18, 55, 42, .04), 0 6px 18px rgba(18, 55, 42, .04);
  --shadow-md: 0 12px 32px rgba(18, 55, 42, .09);
}

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: #194936; border-color: #194936; box-shadow: 0 9px 20px rgba(18,55,42,.19); 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-section 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: #78a087; box-shadow: 0 0 0 3px rgba(110,150,123,.12); 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 { padding: 26px; }
.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; 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: #78a087; box-shadow: 0 0 0 3px rgba(110,150,123,.12); }
.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: #78a087; box-shadow: 0 0 0 3px rgba(110,150,123,.12); }
.login-form .password-field { margin-top: 7px; padding: 0 52px 0 12px; }
.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: #78a087; box-shadow: 0 0 0 3px rgba(110,150,123,.12); }
.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 { min-height: 0; overflow-y: auto; flex: 0 1 auto; display: flex; flex-direction: column; }
.account-content { display: grid; gap: 14px; padding: 20px 26px; }
.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 > 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-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; }
.login-form > footer { margin-top: 0; }
.account-section footer { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 10px; padding: 0 26px 20px; }
.account-section footer > button { width: min(180px, calc(50% - 5px)); min-width: 145px; min-height: 46px; margin: 0; white-space: normal; }
.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: #24633f; border-color: #bcdac6; background: #eef8f1; }
.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 20px 14px; }
  .account-section footer { padding: 0 20px 20px; }
  .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-section footer { flex-direction: row; justify-content: center; gap: 8px; }
  .login-form > footer button, .account-section footer button { width: calc(50% - 4px); min-width: 120px; }
  .account-content { padding-inline: 16px; }
  .account-section footer { padding-inline: 16px; }
}

@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-section footer { gap: 8px; }
  .account-section 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(18, 55, 42, .025);
}

.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-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;
  gap: 14px;
  padding: 20px 24px;
}

.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: 1px solid var(--border);
  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; }

/* 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;
  }
}
