.fw-root {
  display: grid;
  gap: 18px;
  max-width: 1600px;
}
.fw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.fw-head h2 {
  margin: 4px 0;
  font-size: 28px;
}
.fw-head p {
  margin: 6px 0;
  color: #52685b;
}
.fw-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.fw-root .fw-export {
  background: #175438;
  color: #fff;
  border-color: #175438;
  font-weight: 700;
}
.fw-import {
  display: inline-flex;
  align-items: center;
  border: 1px solid #175438;
  border-radius: 8px;
  padding: 9px 13px;
  color: #175438;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.fw-import input {
  display: none;
}
.fw-import.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.fw-import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.fw-import-summary article {
  padding: 14px;
  border: 1px solid #d7e5d9;
  border-radius: 9px;
  background: #f5f9f6;
}
.fw-import-summary small,
.fw-import-summary strong {
  display: block;
}
.fw-import-summary strong {
  margin-top: 5px;
  font-size: 24px;
  color: #174b33;
}
.fw-safe-note {
  padding: 10px 12px;
  border-left: 4px solid #cc8a16;
  background: #fff8e8;
}
.fw-root button,
.fw-dialog button {
  font: inherit;
  font-size: 14px;
  border: 1px solid #c9d9cd;
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  background: #fff;
  color: #16452e;
}
.fw-root button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fw-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fw-tabs .active,
.fw-primary {
  background: #175438 !important;
  color: #fff !important;
}
.fw-toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.fw-invoice-search {
  display: grid;
  gap: 8px;
  width: min(100%, 500px);
  padding: 14px 16px;
  border: 1px solid #cbded0;
  border-radius: 10px;
  background: #f7fbf8;
  box-sizing: border-box;
}
.fw-invoice-search label { font-weight: 700; color: #244b33; }
.fw-invoice-search-row { display: flex; gap: 8px; }
.fw-invoice-search input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b9d0bf;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.fw-invoice-search button {
  border: 1px solid #b9d0bf;
  border-radius: 6px;
  background: #fff;
  color: #244b33;
  padding: 9px 12px;
  cursor: pointer;
}
.fw-invoice-search small { color: #52685a; font-size: 13px; }
.fw-toolbar label,
.fw-fields label,
.fw-dialog form > label {
  display: grid;
  gap: 5px;
  font-size: 14px;
  color: #365441;
}
.fw-toolbar input,
.fw-toolbar select,
.fw-fields input,
.fw-fields select,
.fw-dialog input {
  font: inherit;
  font-size: 16px;
  padding: 9px;
  border: 1px solid #c9d9cd;
  border-radius: 6px;
  background: #fff;
  color: #163d27;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.fw-formula {
  background: #eef5ef;
  border: 1px solid #d7e5d9;
  border-radius: 9px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
}
.fw-formula summary {
  font-weight: 700;
  cursor: pointer;
}
.fw-formula small {
  font-size: 14px;
}
.fw-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #fff;
  border: 1px dashed #8db59a;
  padding: 18px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.fw-upload > div {
  flex: 1;
  min-width: 230px;
}
.fw-upload strong {
  font-size: 18px;
}
.fw-upload p {
  font-size: 14px;
  margin: 6px 0;
}
.fw-upload label {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}
.fw-upload input {
  display: block;
  max-width: 220px;
  margin-top: 6px;
}
.fw-upload #fwProgress {
  flex-basis: 100%;
  margin: 0;
}
.fw-sheet {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid #d3dfd5;
  background: #fff;
  margin-top: 12px;
  border-radius: 10px;
}
.fw-sheet table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 14px;
  white-space: nowrap;
}
.fw-sheet th {
  position: sticky;
  top: 0;
  background: #e9f1eb;
  color: #244b33;
  text-align: left;
  z-index: 1;
}
.fw-sheet th,
.fw-sheet td {
  padding: 12px 14px;
  border-bottom: 1px solid #dce6de;
  border-right: 1px solid #e6ece7;
}
.fw-sort-heading {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.fw-sort-heading:hover { text-decoration: underline; }
.fw-sort-heading:focus-visible { outline: 2px solid #175438; outline-offset: 3px; }
.fw-invoice-note { display: block; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.fw-sheet tbody tr:nth-child(even) {
  background: #f8fbf8;
}
.fw-sheet tbody tr:hover {
  background: #edf7ee;
}
.fw-dialog.fw-batch-dialog {
  width: min(1100px, 96vw);
}
.fw-batch-dialog .fw-sheet thead th:first-child,
.fw-batch-dialog .fw-sheet tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 48px;
  text-align: center;
  background: #e9f1eb;
}
.fw-batch-dialog .fw-sheet thead th:first-child {
  z-index: 3;
}
.fw-batch-dialog .fw-sheet tr.fw-batch-invalid {
  background: #fff3f2;
}
.fw-batch-dialog .fw-sheet tr.fw-batch-invalid th:first-child {
  color: #a52222;
  background: #ffe2df;
}
.fw-batch-dialog .fw-sheet tr.fw-batch-special {
  background: #fff7e7;
}
.fw-batch-dialog .fw-sheet tr.fw-batch-special th:first-child {
  background: #fce8bd;
}
.fw-batch-dialog .fw-sheet .fw-invalid {
  border: 2px solid #c62828;
  background: #fff5f3;
  box-shadow: 0 0 0 2px #c6282826;
}
.fw-sheet td b {
  color: #185639;
}
.fw-sheet .fw-empty {
  padding: 36px;
  text-align: center;
  white-space: normal;
  color: #607767;
}
.fw-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.fw-cards article {
  background: #fff;
  border: 1px solid #d3e0d5;
  border-top: 4px solid #347652;
  border-radius: 10px;
  padding: 20px;
}
.fw-cards small {
  display: block;
  font-size: 14px;
}
.fw-cards strong {
  display: block;
  font-size: 28px;
  margin-top: 12px;
  color: #204c32;
}
.fw-year {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 8px;
}
.fw-year strong {
  font-size: 1.35rem;
}
.fw-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fw-month-grid button {
  display: grid;
  gap: 7px;
  text-align: left;
  min-height: 128px;
  padding: 15px;
  border-radius: 12px;
}
.fw-month-grid button b {
  font-size: 1.05rem;
}
.fw-month-grid button span {
  color: #587060;
}
.fw-month-grid button.active {
  color: #fff;
  background: linear-gradient(145deg, #174d32, #287149);
  border-color: #174d32;
  box-shadow: 0 12px 26px rgba(17, 72, 44, 0.2);
}
.fw-month-grid button.active span,
.fw-month-grid button.active strong {
  color: #fff;
}
.fw-month-grid .negative {
  color: #b62920;
}
.fw-month-detail {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding: 18px;
  background: #f5f9f5;
  border: 1px solid #d3e0d5;
  border-radius: 14px;
}
.fw-month-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.fw-month-title h3,
.fw-month-title p {
  margin: 0;
}
.fw-month-title > div:last-child {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.fw-sheet input,
.fw-sheet select {
  min-width: 115px;
  padding: 7px;
  border: 1px solid #cbd9ce;
  border-radius: 6px;
}
.fw-dialog {
  width: min(760px, 92vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid #cbdace;
  border-radius: 16px;
  padding: 26px;
  color: #153d28;
  background: #fff;
}
.fw-dialog::backdrop {
  background: #10271bc4;
}
.fw-close {
  float: right;
}
.fw-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.fw-wide {
  grid-column: 1/-1;
  font-size: 14px;
}
.fw-alert {
  background: #fff3da;
  border: 1px solid #e3c682;
  color: #765414;
  padding: 14px;
  border-radius: 8px;
}
.fw-subnav {
  display: grid;
  border-left: 2px solid #b6cdbb;
  margin: 0 0 12px 18px;
  padding-left: 8px;
  gap: 3px;
}
.fw-subnav a {
  display: block;
  font-size: 14px;
  padding: 8px;
  color: inherit;
  text-decoration: none;
  border-radius: 5px;
}
.fw-subnav a:hover,
.fw-subnav a.active {
  background: #e5f0e7;
  color: #13472c;
}
.fw-dialog [role="status"] {
  color: #8d4025;
  white-space: normal;
  font-size: 14px;
}
.fw-root, #fwBody, .fw-sheet { min-width: 0; max-width: 100%; box-sizing: border-box; }
.fw-root { width: 100%; padding-bottom: 90px; }
.fw-head { flex-wrap: wrap; }
.mw-month-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 9px; }
.mw-month-grid button { display: grid; gap: 4px; text-align: left; border: 1px solid #cbdace; background: #fff; color: #214a31; border-radius: 10px; padding: 12px; }
.mw-month-grid button.active { border-color: #175438; background: #e9f3eb; }
.mw-month-grid small { line-height: 1.5; }
.mw-totals { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; }
.mw-totals div { display: grid; gap: 4px; background: #eef6ef; border: 1px solid #cbdace; border-radius: 10px; padding: 12px; }
.mw-day-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr)); gap: 10px; }
.mw-day { min-width: 0; padding: 14px; border: 1px solid #d5e4d8; border-radius: 10px; background: #fff; }
.mw-day-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mw-day-head span { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
.mw-day small { display: block; color: #52685a; margin-top: 8px; line-height: 1.5; }
.mw-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-count { display: inline-block; padding: 6px 9px; border-radius: 7px; background: #e9f3eb; color: #17452b; }
.mw-secondary { margin-top: 14px; padding: 12px; border: 1px solid #d3dfd5; border-radius: 10px; }
.mw-secondary summary { font-weight: 700; cursor: pointer; }
.fw-dialog.mw-review-dialog { width: min(900px,calc(100vw - 20px)); max-height: calc(100dvh - 24px); box-sizing: border-box; padding: 18px; }
.mw-review h2 { margin-top: 0; }
.mw-review-identity { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.mw-review-identity label, .mw-import-fields label { display: grid; gap: 5px; font-size: 14px; }
.mw-review-notes, .mw-import-month { margin: 9px 0; border: 1px solid #d3dfd5; border-radius: 9px; background: #fff; }
.mw-review-notes summary, .mw-import-month summary { display: flex; flex-wrap: wrap; gap: 10px; cursor: pointer; padding: 12px; }
.mw-review-notes > p { margin: 8px 12px; }
.mw-review-notes .fw-sheet { max-height: 38vh; }
.mw-import-month summary span { color: #52685a; }
.mw-import-month-body { display: grid; gap: 8px; padding: 0 10px 10px; max-height: 48vh; overflow-y: auto; }
.mw-import-card { border: 1px solid #d7e5d9; border-radius: 8px; padding: 10px; background: #f9fcf9; }
.mw-import-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.mw-import-head label { display: flex; align-items: center; gap: 8px; }
.fw-dialog .mw-import-head input[type="checkbox"] { width: auto; padding: 0; margin: 0; }
.mw-import-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; margin: 10px 0; }
.mw-import-fields small { display: block; color: #52685a; margin-bottom: 7px; }
.mw-import-card > p { margin: 6px 0 0; }
.mw-review-action { position: sticky; bottom: -18px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; margin: 12px -18px -18px; border-top: 1px solid #cbdace; background: #fff; z-index: 5; }
.mw-review-action p { margin: 0; }
.mw-review-action button { font-weight: 700; }
@media (max-width: 760px) {
  .fw-head {
    align-items: start;
    flex-direction: column;
  }
  .fw-cards {
    grid-template-columns: 1fr;
  }
  .fw-import-summary {
    grid-template-columns: 1fr;
  }
  .fw-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fw-month-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .fw-fields {
    grid-template-columns: 1fr;
  }
  .fw-dialog {
    padding: 18px;
  }
  .fw-tabs {
    gap: 4px;
  }
  .fw-toolbar label {
    flex: 1;
    min-width: 140px;
  }
  .fw-head h2 {
    font-size: 24px;
  }
}

.fw-return-note { padding: .75rem 1rem; border-left: 4px solid #28734f; background: #eaf5ed; border-radius: .5rem; }
.fw-batch-dialog .fw-sheet tr.fw-batch-return { background: #eaf5ed; }
.fw-batch-dialog .fw-sheet tr.fw-batch-return th:first-child { background: #d8eadc; }
.bank-review-dialog{width:min(1040px,96vw)!important;max-height:92dvh!important;overflow-y:auto!important}.bank-controls{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin:16px 0}.bank-controls label{display:grid;gap:5px;flex:1;min-width:160px}.bank-row{border:1px solid #ccd8d2;border-radius:12px;padding:16px;margin:12px 0;background:#fff}.bank-row header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.bank-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.bank-fields label{display:grid;gap:5px;min-width:0}.bank-fields input,.bank-fields select{width:100%;min-width:0;box-sizing:border-box;font-size:16px}.bank-row p,.bank-row details{overflow-wrap:anywhere}.bank-needs{border:2px solid #b45309}.bank-error{color:#b42318}.bank-review-dialog input[type=checkbox]{width:18px;height:18px;vertical-align:middle}.bank-row:has(input:disabled){opacity:.75}@media(max-width:650px){.bank-fields{grid-template-columns:1fr 1fr}.bank-row{padding:12px}}
.fw-upload-minimize{margin:0 48px 16px 0;font-size:14px}.fw-upload-dock{position:fixed;bottom:20px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:calc(100vw - 32px)}.fw-upload-dock[hidden]{display:none}.fw-upload-dock button{background:#174c38;color:white;border:1px solid #d9e38b;padding:14px 18px;border-radius:12px;box-shadow:0 4px 18px #0003;font-size:15px;text-align:left}
.bank-description{display:grid;gap:6px;margin:14px 0}.bank-description textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:72px;font:inherit;font-size:16px;padding:10px;border:1px solid #bdcbc3;border-radius:8px}
.fo-section{padding:24px;margin:0 0 24px;border:1px solid #dfe5dc;border-radius:20px;background:#fff}.fo-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}.fo-heading h3{margin:4px 0}.fo-heading label,.fo-scenario label{display:grid;gap:6px}.fo-chip{background:#eef3e8;border-radius:20px;padding:8px 14px}.fo-channels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.fo-channels article{padding:16px;background:#f6f8f3;border-radius:12px}.fo-channels strong{display:block;font-size:1.25rem}.fo-note{color:#58645c;font-size:.9rem;line-height:1.6}.fo-section td small{display:block}.fo-scenario{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:20px 0}.fo-calendar details{border:1px solid #dfe5dc;padding:14px;border-radius:12px;margin:10px 0}.fo-calendar summary{display:flex;gap:18px;flex-wrap:wrap;cursor:pointer}.fo-shortage{background:#fff5ee;border-color:#dca885!important}.fo-section p{overflow-wrap:anywhere}@media(max-width:850px){.fo-section{padding:16px}.fo-channels{grid-template-columns:repeat(2,minmax(0,1fr))}.fo-calendar summary{display:grid;gap:5px}}
