.agri-wizard {
  max-width: 1180px;
  margin: 0;
  background: #fff;
  border: 1px solid #dbe5df;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 55, 42, .07);
  overflow: clip;
}

.agri-wizard,
.agri-wizard *,
.calculation-history-filters,
.calculation-history-filters * {
  box-sizing: border-box;
}

.agri-step-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(115px, 1fr));
  overflow-x: auto;
  border-bottom: 1px solid #dbe5df;
  background: #f7faf8;
}

.agri-step-tabs button {
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #587064;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.agri-step-tabs button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e4ece7;
  font-size: 12px;
}

.agri-step-tabs button.active { color: #294f65; border-bottom-color: #568faa; background: #fff; }
.agri-step-tabs button.active span,
.agri-step-tabs button.complete span { color: #fff; background: #467e9d; }

.agri-step { min-height: 430px; padding: 28px clamp(18px, 3vw, 38px); }
.agri-step[hidden] { display: none; }
.agri-step > header { margin-bottom: 24px; }
.agri-step > header > span { color: #568faa; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.agri-step h2 { margin: 5px 0; color: #173d2f; font-size: clamp(22px, 2.4vw, 30px); }
.agri-step header p { margin: 0; color: #63766d; }

.agri-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.agri-form-grid label,
.agri-search-label,
.agri-add-parcel label { min-width: 0; display: grid; align-content: start; gap: 7px; color: var(--text-secondary); font-size: 12px; font-weight: 750; line-height: 1.35; }
.agri-form-grid label > b { color: var(--danger); }
.agri-form-grid label > span:first-child,
.agri-add-parcel label > span:first-child { display: block; }
.agri-form-grid label > small,
.agri-add-parcel label > small { color: #718078; font-size: 11px; font-weight: 500; line-height: 1.4; }
.agri-add-parcel label > span:first-child b { color: var(--danger); }
.agri-form-grid .wide { grid-column: 1 / -1; }
.agri-form-grid input,
.agri-form-grid select,
.agri-form-grid textarea,
.agri-add-parcel select,
.agri-input-with-icon input,
.agri-search-label input,
.agri-parcel-table input {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.25;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.agri-form-grid input,
.agri-form-grid select,
.agri-add-parcel select,
.agri-input-with-icon input,
.agri-parcel-table input { height: 48px; min-height: 48px; padding: 0 13px; }
.agri-form-grid textarea { min-height: 104px; padding: 12px 13px; line-height: 1.5; resize: vertical; }
.agri-form-grid :is(input, select, textarea):hover,
.agri-add-parcel select:hover,
.agri-input-with-icon input:hover,
.agri-parcel-table input:hover { border-color: #aebdb2; }
.agri-form-grid :is(input, select, textarea):focus,
.agri-add-parcel select:focus,
.agri-input-with-icon input:focus,
.agri-search-label input:focus,
.agri-parcel-table input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(86, 143, 170, .16);
}
.agri-form-grid input[readonly] { color: var(--text-secondary); background: var(--green-50); cursor: default; }
.agri-form-grid :is(input, textarea)::placeholder,
.agri-search-label input::placeholder { color: #849189; opacity: 1; }
.agri-search-label .lookup-input { width: 100%; margin: 0; }
.agri-search-label .lookup-input input { height: 52px; min-height: 52px; padding-right: 16px; padding-left: 46px; border-radius: 10px; }

.agri-scope-note { min-height: 64px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid #bad9c7; border-radius: 10px; color: #245f45; background: #eef8f1; }
.agri-scope-note > .icon { width: 24px; height: 24px; }
.agri-scope-note strong,
.agri-scope-note small { display: block; }
.agri-scope-note small { margin-top: 3px; color: #526b60; font-size: 12px; line-height: 1.45; }
.agri-scope-note.scope-error { border-color: #e4b4aa; color: #8d3f34; background: #fff4f1; }
.agri-form-grid select:disabled { color: #40564e; background-color: #f1f5f2; opacity: 1; cursor: not-allowed; }
.agri-date-context { margin-top: 20px; }
.agri-day-badge { min-height: 64px; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #c9ddd2; border-radius: 10px; color: #205d45; background: #f1f8f4; }
.agri-day-badge > .icon { width: 22px; height: 22px; }
.agri-day-badge strong,
.agri-day-badge small { display: block; }
.agri-day-badge small { margin-top: 3px; color: #60766b; font-size: 11px; }
.agri-day-badge.saturday,
.agri-day-badge.holiday,
.agri-day-badge.holiday_saturday { border-color: #e1c578; color: #71520b; background: #fff9e8; }

.agri-search-results { display: grid; gap: 8px; max-height: 260px; margin-top: 10px; overflow: auto; }
.agri-search-results button { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px; border: 1px solid #dbe5df; border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.agri-search-results button:hover { border-color: #568faa; background: #f5fafc; }
.agri-selected-verba { margin-top: 18px; padding: 18px; border-left: 4px solid #568faa; background: #edf6f9; }
.agri-selected-verba h3 { margin: 0 0 8px; color: #173d2f; }
.agri-selected-verba dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 14px 0 0; }
.agri-selected-verba dt { color: #6b7d74; font-size: 12px; }
.agri-selected-verba dd { margin: 3px 0 0; font-weight: 700; }

.agri-add-parcel { display: block; width: min(100%, 760px); margin-bottom: 18px; }
.agri-parcel-search-field { min-width: 0; position: relative; display: grid; align-content: start; gap: 7px; color: var(--text-secondary); font-size: 12px; font-weight: 750; line-height: 1.35; }
.agri-parcel-search-field > label b { color: var(--danger); }
.agri-parcel-search-field > small { color: #718078; font-size: 11px; font-weight: 500; line-height: 1.4; }
.agri-input-with-icon { position: relative; display: block; }
.agri-input-with-icon > .icon { position: absolute; top: 50%; left: 14px; z-index: 1; width: 18px; height: 18px; color: #668078; transform: translateY(-50%); pointer-events: none; }
.agri-input-with-icon input { padding-left: 43px; }
.agri-parcel-table td small { display: block; color: #708178; }
.agri-parcel-table input { min-width: 140px; max-width: 220px; }
.agri-parcel-table td:last-child { width: 58px; text-align: center; }
.agri-parcel-remove { width: 40px; min-width: 40px; height: 40px; min-height: 40px; margin: 0 auto; color: #9a463b; border-color: #e7c8c4; background: #fff7f6; }
.agri-parcel-remove:hover,
.agri-parcel-remove:focus-visible { color: #7f342c; border-color: #cf8e87; background: #fbefed; }
.agri-empty-hint { padding: 24px; color: #708178; text-align: center; }
.execution-config { margin-bottom: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.agri-values-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.agri-value-card { padding: 16px; border: 1px solid #dbe5df; border-radius: 8px; background: #fafcfb; }
.agri-value-card span { display: block; color: #6a7c73; font-size: 12px; text-transform: uppercase; }
.agri-value-card strong { display: block; margin-top: 7px; color: #173d2f; font-size: 21px; }
.agri-value-card.status-ok { border-color: #8dc5aa; background: #eef9f2; }
.agri-value-card.status-review { border-color: #e2aaa7; background: #fff2f1; }
.agri-math-details { margin-top: 18px; padding: 14px 16px; border: 1px solid #dbe5df; border-radius: 8px; }
.agri-math-details summary { color: #467e9d; font-weight: 800; cursor: pointer; }
.agri-math-details p { margin: 12px 0 0; color: #52665c; }
.agri-distribution { margin-top: 18px; }

.agri-summary-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.agri-summary-meta div { padding: 12px; border-bottom: 1px solid #dbe5df; }
.agri-summary-meta span { display: block; color: #708178; font-size: 11px; text-transform: uppercase; }
.agri-summary-meta strong { display: block; margin-top: 4px; }
.agri-employee-section { display: grid; gap: 14px; margin-bottom: 20px; padding: 16px; border: 1px solid #c9dce5; background: #f4f9fb; }
.agri-employee-section > div:first-child strong,
.agri-employee-section > div:first-child small { display: block; }
.agri-employee-section > div:first-child strong { color: #294f65; font-size: 16px; }
.agri-employee-section > div:first-child small { margin-top: 4px; color: #607580; font-size: 12px; }
.agri-employee-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agri-employee-fields label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 750; }
.agri-employee-fields input { width: 100%; min-width: 0; height: 48px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-primary); background: var(--surface); font-size: 15px; outline: 0; }
.agri-employee-fields input:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(86, 143, 170, .16); }
.agri-launch-list { overflow: hidden; border: 1px solid #dbe5df; border-radius: 12px; }
.agri-launch-head,
.agri-launch-row,
.agri-launch-total { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, .7fr) 100px; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border-bottom: 1px solid #e4ebe7; }
.agri-launch-head { min-height: 42px; color: #64776e; background: #f5f8f6; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.agri-launch-row output,
.agri-launch-total output { color: #123d2c; font-size: 18px; font-weight: 900; }
.agri-launch-row .text-button { justify-self: end; }
.agri-launch-total { border-bottom: 0; background: #eef7f2; }
.agri-final-details { margin-top: 18px; padding: 14px 16px; border: 1px solid #dbe5df; border-radius: 10px; }
.agri-final-details summary { color: #467e9d; font-weight: 800; cursor: pointer; }
.agri-observation-field { display: grid; gap: 7px; margin-top: 14px; color: var(--text-secondary); font-size: 12px; font-weight: 750; }
.agri-observation-field textarea { width: 100%; min-height: 96px; padding: 12px 13px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-primary); background: var(--surface); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; outline: 0; }
.agri-observation-field textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(86, 143, 170, .16); }
.agri-observation-field small { color: #718078; font-size: 11px; font-weight: 500; }
.agri-summary-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.calculation-history-filters { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; padding: 16px 20px; border-top: 1px solid #e4ebe7; background: #f8faf9; }
.calculation-history-filters label { display: grid; gap: 5px; color: #52665c; font-size: 12px; font-weight: 700; }
.calculation-history-filters input,
.calculation-history-filters select {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--surface);
  font-size: 13px;
  outline: 0;
}
.calculation-history-filters :is(input, select):focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(86, 143, 170, .15); }
.calculation-history-filters .text-button { align-self: end; justify-self: start; min-height: 40px; }
.calculation-settings-panel { margin-top: 18px; }
.calculation-settings-panel form { max-width: 840px; }
.calculation-detail-dialog { width: min(1050px, calc(100vw - 32px)); }
.calculation-detail-content { padding: 20px; overflow: auto; }
.calculation-detail-content .agri-summary-meta { margin-top: 0; }

.agri-wizard-footer { position: sticky; bottom: 0; z-index: 250; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid #dbe5df; background: rgba(255, 255, 255, .98); box-shadow: 0 -8px 20px rgba(49, 95, 121, .09); }
.agri-wizard-footer #agri-step-status { flex: 1; color: #63766d; text-align: center; font-size: 13px; }
.agri-wizard-footer :is(#agri-next, #agri-save) { margin-left: auto; }

@media (max-width: 820px) {
  .agri-step-tabs { grid-template-columns: repeat(6, 125px); }
  .agri-step { min-height: 0; padding: 20px 15px 90px; }
  .agri-form-grid,
  .execution-config,
  .agri-values-grid,
  .agri-summary-meta,
  .agri-employee-fields { grid-template-columns: 1fr; }
  .calculation-history-filters { grid-template-columns: 1fr 1fr; }
  .agri-add-parcel { grid-template-columns: 1fr; }
  .agri-selected-verba dl { grid-template-columns: 1fr 1fr; }
  .agri-wizard-footer { position: fixed; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); left: 0; border: 1px solid #dbe5df; }
  .agri-wizard-footer #agri-step-status { display: none; }
  .agri-launch-head { display: none; }
  .agri-launch-row,
  .agri-launch-total { grid-template-columns: minmax(90px, 1fr) minmax(105px, auto) auto; gap: 8px; padding: 10px 12px; }
  .agri-launch-row .text-button span:last-child { display: none; }
}

/* APK: usa exatamente a mesma escala dos formulários nativos consolidados. */
html.native-app .agri-wizard {
  width: 100%;
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(18, 58, 39, .05);
}

html.native-app .agri-form-grid label,
html.native-app .agri-search-label,
html.native-app .agri-add-parcel label,
html.native-app .calculation-history-filters label {
  color: #40564e;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

html.native-app .agri-form-grid :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select),
html.native-app .agri-add-parcel select,
html.native-app .agri-input-with-icon input,
html.native-app .agri-parcel-table input,
html.native-app .calculation-history-filters :is(input, select) {
  width: 100%;
  height: var(--native-control-height, 52px);
  min-height: var(--native-control-height, 52px);
  margin: 0;
  padding: 0 14px;
  border: 1px solid #c9dad3;
  border-radius: var(--native-control-radius, 12px);
  color: #172a26;
  background-color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

html.native-app .agri-form-grid textarea {
  width: 100%;
  min-height: 112px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #c9dad3;
  border-radius: var(--native-control-radius, 12px);
  color: #172a26;
  background: #fff;
  font-size: 16px;
  line-height: 1.45;
}

/* No APK, a identificação do funcionário é feita somente pela matrícula. */
html.native-app .agri-employee-fields { grid-template-columns: 1fr; }
html.native-app .agri-employee-fields label[hidden] { display: none !important; }

html.native-app .agri-search-label .lookup-input input {
  height: 56px;
  min-height: 56px;
  border-color: #c9dad3;
  border-radius: var(--native-control-radius, 12px);
  font-size: 16px;
}

html.native-app .agri-input-with-icon input { padding-left: 46px; }

html.native-app .agri-form-grid :is(input, select, textarea):focus,
html.native-app .agri-add-parcel select:focus,
html.native-app .agri-input-with-icon input:focus,
html.native-app .agri-search-label input:focus,
html.native-app .agri-parcel-table input:focus,
html.native-app .calculation-history-filters :is(input, select):focus {
  border-color: #6da2ba;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(109, 162, 186, .17);
}

html.native-app .agri-form-grid input[readonly] {
  color: #52635b;
  background: #f1f5ef;
}

html.native-app .agri-add-parcel .secondary-button,
html.native-app .agri-summary-actions .ghost-button,
html.native-app .agri-wizard-footer :is(.primary-button, .ghost-button) {
  min-height: 50px;
  border-radius: 13px;
  font-size: 14px;
}

@media (min-width: 821px) {
  html.web-app .agri-wizard { max-width: 1320px; border-radius: 16px; }
  html.web-app .agri-step { min-height: 470px; padding: 30px clamp(28px, 3vw, 44px); }
  html.web-app .agri-context-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
  html.web-app .agri-context-grid .wide { grid-column: 1 / -1; }
  html.web-app .agri-form-grid label,
  html.web-app .agri-search-label,
  html.web-app .agri-add-parcel label { font-size: 13px; }
  html.web-app .agri-form-grid :is(input, select),
  html.web-app .agri-add-parcel :is(input, select) { height: 50px; min-height: 50px; border-radius: 10px; font-size: 14px; }
  html.web-app .agri-form-grid textarea { min-height: 112px; }
  html.web-app .agri-selected-verba dl { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  html.web-app .agri-parcel-table td { vertical-align: middle; }
  html.web-app .agri-parcel-table td small { margin-top: 4px; }
  html.web-app .agri-wizard-footer { position: sticky; right: auto; bottom: 0; left: auto; padding: 16px 28px; }
}

@media (max-width: 820px) {
  html.native-app .agri-step { padding: 20px 15px 102px; }
  html.native-app .agri-wizard-footer {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    padding: 10px;
    border-radius: 13px;
    box-shadow: 0 -5px 20px rgba(18, 58, 39, .1);
  }

  html.viewport-keyboard-aware.keyboard-open .mobile-nav { display: none !important; }
  html.viewport-keyboard-aware.keyboard-open .agri-wizard-footer {
    right: max(0px, env(safe-area-inset-right));
    bottom: var(--app-keyboard-offset, 0px);
    left: max(0px, env(safe-area-inset-left));
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 520px) {
  .calculation-history-filters { grid-template-columns: minmax(0, 1fr); }
  .agri-selected-verba dl { grid-template-columns: minmax(0, 1fr); }
  .agri-search-results button { grid-template-columns: minmax(74px, auto) minmax(0, 1fr); }
  .agri-search-results button > :last-child { grid-column: 1 / -1; }
}

/* Tema azul-claro e geometria mais reta, compartilhados pela Web e pelo APK. */
html.web-app,
html.native-app {
  --native-control-radius: 5px;
  --web-radius-md: 4px;
  --web-radius-lg: 5px;
}

html :is(
  button:not(.password-toggle),
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .lookup-input,
  .search-box,
  .money-input,
  .agri-money-input
) { border-radius: 4px !important; }

.legacy-calculation { display: none !important; }
.agri-wizard { border-color: #d5e1e7; border-radius: 5px; box-shadow: 0 8px 24px rgba(49, 95, 121, .07); }
.agri-step-tabs { border-color: #d5e1e7; background: #f3f8fa; }
.agri-step-tabs button { color: #526a76; }
.agri-step-tabs button:disabled { color: #8799a2; cursor: not-allowed; opacity: .62; }
.agri-step-tabs button span { border-radius: 4px; background: #e1eff5; }
.agri-step-tabs button.active { color: #294f65; border-bottom-color: #568faa; }
.agri-step-tabs button.active span,
.agri-step-tabs button.complete span { color: #fff; background: #467e9d; }
.agri-step > header > span { color: #568faa; }
.agri-step h2 { color: #294f65; }
.agri-step header p { color: #60747e; }
.agri-form-grid :is(input, select, textarea):focus,
.agri-add-parcel select:focus,
.agri-input-with-icon input:focus,
.agri-search-label input:focus,
.agri-parcel-table input:focus { border-color: #568faa; box-shadow: 0 0 0 3px rgba(86, 143, 170, .16); }
.agri-selected-verba { border-color: #568faa; background: #edf6f9; }
.agri-selected-verba h3,
.agri-value-card strong,
.agri-launch-row output,
.agri-launch-total output { color: #294f65; }
.agri-day-badge,
.agri-scope-note { border-color: #bdd6e1; color: #3b718c; background: #edf6f9; }
.agri-value-card { border-radius: 4px; background: #f8fbfc; }
.agri-math-details,
.agri-final-details,
.agri-launch-list { border-radius: 4px; }
.agri-math-details summary,
.agri-final-details summary { color: #467e9d; }
.agri-launch-head { background: #edf6f9; }
.agri-launch-total { background: #e1eff5; }
.agri-wizard-footer { border-color: #d5e1e7; }
.agri-wizard-footer :is(#agri-previous, #agri-next, #agri-save) { position: relative; z-index: 251; }

@media (min-width: 821px) {
  html.web-app .agri-date-context { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 820px) {
  .agri-step-tabs { grid-template-columns: repeat(6, minmax(108px, 1fr)); }
  .agri-wizard-footer { z-index: 250; padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left)); }
  .agri-wizard-footer :is(#agri-previous, #agri-next, #agri-save) { min-width: 116px; min-height: 48px; }
}

@media (max-width: 360px) {
  .agri-wizard-footer :is(#agri-previous, #agri-next, #agri-save) { min-width: 104px; padding-inline: 10px; }
}

/* Web 1.13.4: catálogo, cálculo proporcional e histórico no mesmo módulo. */
html.web-app .sidebar [data-view="calculo"] { display: none; }

.verba-workspace-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid #dbe5df;
  border-radius: 13px;
  background: #f1f5f2;
}

.verba-workspace-tabs button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: #52665c;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.verba-workspace-tabs button .icon { width: 18px; height: 18px; }
.verba-workspace-tabs button.active { color: #fff; background: #315f79; box-shadow: 0 5px 14px rgba(49, 95, 121, .2); }
.verba-workspace { min-width: 0; }
.verba-workspace[hidden] { display: none !important; }

.verba-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.verba-card-actions .calculate-verba { color: #fff; border-color: #467e9d; background: #467e9d; }
.verba-card-actions .calculate-verba:hover { background: #386b87; }

/* Resultados de parcela aparecem como ações claras, inclusive no APK. */
.agri-parcel-results {
  width: 100%;
  max-height: 230px;
  margin-top: 0;
}
.agri-parcel-results:empty { display: none; }
.agri-parcel-results button { grid-template-columns: minmax(72px, 100px) minmax(0, 1fr); }
.agri-parcel-results button small { grid-column: 1 / -1; color: #647680; }

/* Toast em Top Layer: sempre acima de dialogs, rodapés fixos e navegação. */
.toast-region,
.toast-region[popover] {
  width: min(390px, calc(100vw - 28px));
  max-width: none;
  position: fixed;
  z-index: 2147483647;
  inset: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) auto auto;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  color: inherit;
  background: transparent;
  pointer-events: none;
}
.toast-region:not(:popover-open)[popover] { display: none; }
.toast-region .toast { width: 100%; max-width: none; pointer-events: auto; box-shadow: 0 16px 42px rgba(29, 43, 51, .28); }
.toast-region .toast:not(.error) { background: #315f79; }
.toast-region .toast.error { border: 1px solid rgba(255, 255, 255, .22); background: #9b3f38; }

/* Confirmação de rascunho: o X permanece no cabeçalho e Descartar é a ação secundária. */
#app-confirm-modal .confirm-cancel-button {
  min-width: 112px;
  color: #315f79;
  border: 1px solid #bdd6e1;
  background: #f5fafc;
}
#app-confirm-modal .confirm-cancel-button:hover { border-color: #6da2ba; background: #e1eff5; }

@media (max-width: 520px) {
  .toast-region,
  .toast-region[popover] {
    width: auto;
    inset: calc(env(safe-area-inset-top) + 10px) max(10px, env(safe-area-inset-right)) auto max(10px, env(safe-area-inset-left));
  }
  #app-confirm-modal .confirm-dialog > footer { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  #app-confirm-modal .confirm-dialog > footer > button { width: 100%; min-width: 0; }
}

.agri-desired-payment {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 22px;
  border-radius: 4px;
  color: #fff;
  background: #315f79;
}

.agri-desired-payment .step-label { display: flex; align-items: center; gap: 12px; }
.agri-desired-payment .step-label > span { width: 32px; height: 32px; display: grid; flex: 0 0 32px; place-items: center; border-radius: 4px; color: #294f65; background: #b9dce8; font-weight: 900; }
.agri-desired-payment .step-label strong,
.agri-desired-payment .step-label small { display: block; }
.agri-desired-payment .step-label strong { font-size: 24px; }
.agri-desired-payment .step-label small { margin-top: 4px; color: #d5e8ef; font-size: 15px; font-weight: 500; }
.agri-desired-payment > label { margin-top: 7px; color: #eef7fa; font-size: 17px; font-weight: 800; }
.agri-desired-payment > small { color: #d5e8ef; font-size: 14px; line-height: 1.5; }

.agri-money-input {
  min-height: 104px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 2px solid #8fc4d8;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
}

.agri-money-input > span { padding: 0 19px; color: #315f79; font-size: 30px; font-weight: 900; }
.agri-money-input input {
  width: 100%;
  height: 98px;
  min-width: 0;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid #d4ddd7;
  outline: 0;
  color: #294f65;
  background: #fff;
  font: inherit;
  font-size: clamp(48px, 6vw, 66px);
  font-weight: 850;
}
.agri-money-input input::placeholder { color: #93a59c; opacity: 1; }
.agri-preview-button { width: 100%; min-height: 54px; margin-top: 18px; }

html.web-app .web-inline-calculation {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
html.web-app .web-inline-calculation > .agri-step[hidden] { display: none !important; }
html.web-app #verba-history-workspace .calculation-history-panel { margin: 0; }
html.web-app body:has(#verba-calculation-workspace:not([hidden])) #view-verbas > .module-toolbar .module-actions,
html.web-app body:has(#verba-history-workspace:not([hidden])) #view-verbas > .module-toolbar .module-actions { visibility: hidden; }

@media (max-width: 720px) {
  .verba-workspace-tabs { overflow-x: auto; }
  .verba-workspace-tabs button { flex: 0 0 auto; }
}

html.native-app .agri-desired-payment {
  gap: 12px;
  padding: 20px 16px;
}

html.native-app .agri-desired-payment .step-label strong { font-size: 26px; line-height: 1.15; }
html.native-app .agri-desired-payment .step-label small { font-size: 16px; line-height: 1.4; }
html.native-app .agri-desired-payment > label { font-size: 19px; }
html.native-app .agri-desired-payment > small { font-size: 15px; }
html.native-app .agri-money-input { min-height: 114px; }
html.native-app .agri-money-input > span { padding: 0 15px; font-size: 32px; }
html.native-app .agri-money-input #agri-desired-value {
  height: 108px;
  padding: 0 14px;
  font-size: clamp(54px, 15vw, 70px);
  line-height: 1;
}
.daily-summary-dialog { width: min(1040px, calc(100vw - 32px)); }
.daily-summary-content { display: grid; gap: 16px; padding: 18px; overflow: auto; }
.daily-summary-message { display: flex; align-items: center; gap: 10px; padding: 11px 13px; color: #254f67; background: #e5f3f8; border-left: 4px solid #5a9fbe; }
.daily-summary-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.daily-summary-identity > div { display: grid; gap: 4px; padding: 14px; border: 1px solid #ccdee7; background: #fff; }
.daily-summary-identity small, .daily-summary-metrics small, .daily-parcel-row small { color: #657984; }
.daily-summary-identity span { color: #435a66; }
.daily-summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.daily-summary-metrics article { display: grid; gap: 5px; padding: 13px; border: 1px solid #ccdee7; background: #f8fbfc; }
.daily-summary-metrics strong { color: #244e65; font-size: 1.2rem; }
.daily-summary-metrics .daily-total { color: #fff; background: #467e9d; border-color: #467e9d; }
.daily-summary-metrics .daily-total small, .daily-summary-metrics .daily-total strong { color: #fff; }
.daily-summary-calculations { display: grid; gap: 12px; }
.daily-calculation-card { border: 1px solid #c9dce5; background: #fff; }
.daily-calculation-card > header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; background: #eef7fa; border-bottom: 1px solid #c9dce5; }
.daily-calculation-card > header div { display: grid; gap: 3px; min-width: 0; }
.daily-calculation-card > header strong { overflow-wrap: anywhere; }
.daily-calculation-card > header b { color: #315f79; white-space: nowrap; }
.daily-parcel-list { display: grid; }
.daily-parcel-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(100px, .7fr)); align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid #e0eaef; }
.daily-parcel-row:first-child { border-top: 0; }
.daily-parcel-row > span { display: grid; gap: 2px; }
.daily-empty-parcels { margin: 0; padding: 14px; color: #657984; }

@media (max-width: 720px) {
  .daily-summary-dialog { width: calc(100vw - 12px); }
  .daily-summary-content { padding: 12px; }
  .daily-summary-identity, .daily-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-parcel-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-parcel-row > span:first-child { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .daily-summary-identity, .daily-summary-metrics { grid-template-columns: 1fr; }
  .daily-parcel-row { grid-template-columns: 1fr; }
  .daily-parcel-row > span:first-child { grid-column: auto; }
}

.employee-summary-filter-panel { margin-bottom: 14px; }
.employee-summary-filters { display: grid; grid-template-columns: repeat(2, minmax(145px, .7fr)) minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding: 16px; }
.employee-summary-filters label { display: grid; gap: 6px; color: #435a66; font-size: .82rem; font-weight: 700; }
.employee-summary-filters input, .employee-summary-filters select { width: 100%; min-height: 44px; }
.employee-summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.employee-summary-metrics article { display: grid; gap: 5px; padding: 16px; border: 1px solid #c9dce5; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(37, 78, 101, .06); }
.employee-summary-metrics span { color: #657984; font-size: .82rem; font-weight: 700; }
.employee-summary-metrics strong { color: #244e65; font-size: 1.35rem; }
.employee-summary-metrics article.primary { color: #fff; border-color: #467e9d; background: #467e9d; }
.employee-summary-metrics article.primary span, .employee-summary-metrics article.primary strong { color: #fff; }
.employee-summary-table-wrap { width: 100%; max-width: 100%; max-height: min(62vh, 720px); overflow-x: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.employee-summary-table { width: 100%; width: max-content; min-width: 1380px; table-layout: auto; }
.employee-summary-table thead { position: sticky; top: 0; z-index: 2; }
.employee-summary-table td { vertical-align: top; }
.employee-summary-table th:first-child, .employee-summary-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 112px; width: 112px; background: #fff; box-shadow: 3px 0 5px rgba(37, 78, 101, .08); }
.employee-summary-table thead th:first-child { z-index: 4; }
.employee-summary-table tbody td:first-child { z-index: 3; }
.employee-summary-table thead th { white-space: nowrap; }
.employee-summary-table th:nth-child(2), .employee-summary-table td:nth-child(2) { min-width: 112px; }
.employee-summary-table th:nth-child(3), .employee-summary-table td:nth-child(3) { min-width: 190px; }
.employee-summary-table th:nth-child(4), .employee-summary-table td:nth-child(4) { min-width: 140px; }
.employee-summary-table th:nth-child(5), .employee-summary-table td:nth-child(5) { min-width: 140px; }
.employee-summary-table th:nth-child(6), .employee-summary-table td:nth-child(6) { min-width: 125px; }
.employee-summary-table th:nth-child(n+7), .employee-summary-table td:nth-child(n+7) { min-width: 108px; }
.summary-quantity { text-align: right; font-variant-numeric: tabular-nums; }
.employee-summary-table td:nth-child(2), .employee-summary-table td:nth-child(7), .employee-summary-table td:nth-child(8), .employee-summary-table td:nth-child(9), .employee-summary-table td:nth-child(10), .employee-summary-table td:nth-child(11) { white-space: nowrap; }
.employee-summary-verba { display: block; min-width: 0; max-width: none; overflow-wrap: normal; white-space: nowrap; }
.daily-report-title { display: none; }

html.native-app #view-resumos .employee-summary-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: auto;
  scrollbar-color: #568faa #e8f1f5;
}
html.native-app #view-resumos .employee-summary-table {
  display: table;
  width: max-content !important;
  min-width: 1420px !important;
  table-layout: auto;
}
html.native-app #view-resumos .employee-summary-table-wrap::-webkit-scrollbar { height: 9px; }
html.native-app #view-resumos .employee-summary-table-wrap::-webkit-scrollbar-track { background: #e8f1f5; }
html.native-app #view-resumos .employee-summary-table-wrap::-webkit-scrollbar-thumb { border-radius: 8px; background: #568faa; }
html.native-app #view-resumos .employee-summary-table th:first-child,
html.native-app #view-resumos .employee-summary-table td:first-child {
  left: 0;
  min-width: 112px;
  width: 112px;
  background: #fff;
}
html.native-app #view-resumos .employee-summary-table thead { z-index: 5; }
html.native-app #view-resumos .employee-summary-table tbody td:first-child { z-index: 3; }
html.native-app #view-resumos .module-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html.native-app #view-resumos #export-employee-summaries-excel { display: inline-flex !important; }
html.native-app #view-resumos #generate-daily-report { grid-column: 1 / -1; order: -1; width: 100%; }
html.native-app #view-resumos #generate-daily-report .icon { width: 20px; height: 20px; }

@media (max-width: 1100px) {
  .employee-summary-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-summary-filters button { min-height: 44px; }
}

@media (max-width: 720px) {
  .employee-summary-filters, .employee-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-summary-filters { padding: 12px; }
  .employee-summary-filters label:nth-child(3), .employee-summary-filters button { grid-column: 1 / -1; }
  .employee-summary-panel { padding-bottom: 0; }
  .employee-summary-table-wrap { max-height: 65vh; overflow: auto; }
  .employee-summary-table { min-width: 1180px; }
  .employee-summary-table tbody tr:nth-child(even) td { background: #f8fbfc; }
  .employee-summary-table tbody td:first-child { background: inherit; }
  .employee-summary-table td::before { content: attr(data-label); display: none; }
  .employee-summary-verba { min-width: 0; max-width: none; }
}

@media (max-width: 420px) {
  .employee-summary-filters, .employee-summary-metrics, .employee-summary-table tr { grid-template-columns: 1fr; }
  .employee-summary-filters label, .employee-summary-filters button, .employee-summary-table td { grid-column: auto !important; }
}

@media print {
  body.printing-daily-report * { visibility: hidden !important; }
  body.printing-daily-report #view-resumos,
  body.printing-daily-report #view-resumos * { visibility: visible !important; }
  body.printing-daily-report #view-resumos { position: absolute; inset: 0; padding: 0; background: #fff; }
  body.printing-daily-report .employee-summary-filter-panel,
  body.printing-daily-report .module-actions,
  body.printing-daily-report .employee-summary-metrics { display: none !important; }
  body.printing-daily-report .employee-summary-table-wrap { max-height: none; overflow: visible; }
  body.printing-daily-report .daily-report-title { display: block; margin: 0 0 8px; color: #193e52; font-size: 16px; letter-spacing: .04em; }
  body.printing-daily-report .employee-summary-table { min-width: 0; width: 100%; font-size: 9px; }
  body.printing-daily-report .employee-summary-table th,
  body.printing-daily-report .employee-summary-table td { position: static; padding: 4px; }
  @page { size: landscape; margin: 10mm; }
}
