:root {
  color-scheme: light;
  --ink: #26362f;
  --ink-soft: #43534c;
  --muted: #849089;
  --line: #e4eae5;
  --line-strong: #d4dfd7;
  --green: #326d56;
  --green-deep: #265a45;
  --green-soft: #e9f3ec;
  --paper: #ffffff;
  --canvas: #f5f7f5;
  --canvas-green: #edf3ee;
  --gold: #c49632;
  --danger: #bd5b4d;
  --shadow: 0 3px 15px rgba(33, 67, 49, .045), 0 1px 2px rgba(33, 67, 49, .04);
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 360px; background: var(--canvas); scroll-behavior: smooth; }
body { min-width: 360px; margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.app-shell { max-width: 1540px; margin: 0 auto; padding: 0 46px; }

.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5ebe6; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: #e3efe6; color: var(--green); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 15px; font-weight: 700; letter-spacing: -.25px; }
.brand-copy small { color: var(--muted); font-size: 10.5px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: #6f8176; font-size: 11.5px; margin-left: 5px; }
.save-state i, .status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #54a375; box-shadow: 0 0 0 3px #e7f2e9; }
.save-state.is-saving i { background: #c49731; box-shadow: 0 0 0 3px #fbf3df; }
.save-state.is-error i { background: #bd5b4d; box-shadow: 0 0 0 3px #fae8e4; }
.button { min-height: 37px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s, transform .13s; text-decoration: none; font-size: 12px; font-weight: 600; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, .view-tab:focus-visible, .dialog-close:focus-visible { outline: 3px solid #aed4bb; outline-offset: 2px; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 1px 2px #19472f22; }
.button-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.button-quiet { color: #455b4d; background: transparent; border-color: transparent; }
.button-quiet:hover, .button-text:hover { background: #e9efea; }
.button-outline { color: #42564a; background: #fff; border-color: #dfe7e0; }
.button-outline:hover { border-color: #b9cbbd; background: #f8fbf8; }
.button-text { background: transparent; color: #64746a; }
.count-pill, .tab-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: #577261; background: #e9f0e9; font-size: 10px; font-variant-numeric: tabular-nums; }
.icon-button { width: 36px; height: 37px; display: grid; place-items: center; border: 1px solid #dfe7e0; border-radius: 7px; color: #53665a; background: #fff; cursor: pointer; }
.icon-button:hover { background: #f8fbf8; border-color: #b9cbbd; }
.icon-button svg { width: 18px; height: 18px; }

.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 31px 0 26px; }
.intro-copy { min-width: 240px; }
.eyebrow { display: flex; gap: 7px; align-items: center; color: #7d8a81; font-size: 10.5px; letter-spacing: .05px; }
.eyebrow-dot, .section-overline > span { width: 6px; height: 6px; border-radius: 50%; background: #6ba480; box-shadow: 0 0 0 3px #e5f0e8; }
.eyebrow-divider { color: #c1cac3; }
.intro h1 { margin: 6px 0 3px; color: #273a30; font-size: 29px; line-height: 1.3; letter-spacing: -.65px; outline-offset: 4px; }
.intro h1[contenteditable="true"] { cursor: text; }
.intro h1[contenteditable="true"]:focus { outline: 2px solid #a5ccb0; border-radius: 3px; }
.intro-copy > p { margin: 0; color: #87938b; font-size: 12px; }
.intro-tools { display: flex; align-items: center; gap: 9px; padding-bottom: 2px; }
.orientation-control { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; min-height: 36px; border: 1px solid #e1e8e2; border-radius: 7px; background: #fff; color: #819087; font-size: 10.5px; }
.report-date-control { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 8px; border: 1px solid #e1e8e2; border-radius: 7px; background: #fff; color: #819087; font-size: 10px; }
.report-date-control input { width: 112px; min-width: 0; padding: 0; border: 0; outline: 0; color: #485b4e; background: transparent; font-size: 10px; font-weight: 600; }
.report-date-control:focus-within { border-color: #7ba988; box-shadow: 0 0 0 3px #e8f2e9; }
.orientation-control select { max-width: 86px; appearance: none; padding: 0 1px; outline: 0; color: #485b4e; border: 0; background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; }
.orientation-control svg { width: 12px; height: 12px; pointer-events: none; margin-right: -4px; }
.blank-rows-control { display: inline-flex; align-items: center; gap: 6px; color: #7b897f; font-size: 9.5px; white-space: nowrap; cursor: pointer; }
.blank-rows-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checkmark { width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid #d8e2d9; border-radius: 4px; color: transparent; background: #fff; font-size: 10px; }
.blank-rows-control input:checked + .checkmark { color: white; border-color: #5d9268; background: #5d9268; }
.blank-rows-control input:focus-visible + .checkmark { outline: 3px solid #aed4bb; outline-offset: 2px; }
.tool-separator { width: 1px; height: 23px; margin: 0 2px; background: #e3e9e4; }

.view-tabs { display: flex; align-items: center; gap: 22px; height: 47px; border-bottom: 1px solid #dfe7e1; }
.view-tab { position: relative; align-self: stretch; display: inline-flex; align-items: center; gap: 8px; padding: 0 2px; border: 0; background: transparent; color: #78857c; cursor: pointer; font-size: 12px; font-weight: 500; }
.view-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ""; }
.view-tab.is-active { color: var(--green); font-weight: 700; }
.view-tab.is-active::after { background: #4f8966; }
.view-tab .tab-icon { width: 17px; height: 17px; display: grid; place-items: center; }
.view-tab svg { width: 16px; height: 16px; }
.view-tab .tab-count { background: #edf1ee; color: #7c8b81; font-weight: 500; }
.view-tab.is-active .tab-count { color: var(--green); background: #e8f1e9; }
.tabs-fill { flex: 1; }
.keyboard-hint { display: flex; align-items: center; gap: 4px; color: #9aa49d; font-size: 10px; }
kbd { min-width: 17px; padding: 2px 4px; text-align: center; border: 1px solid #e1e7e2; border-radius: 4px; background: #fafbfa; color: #748078; font-size: 9px; font-family: inherit; }

.entry-view { display: grid; grid-template-columns: minmax(310px, 355px) minmax(0, 1fr); gap: 19px; align-items: start; padding: 21px 0 26px; }
.form-card, .ledger-card { background: var(--paper); border: 1px solid #e6ebe7; border-radius: 9px; box-shadow: var(--shadow); }
.form-card { padding: 18px 17px 13px; }
.card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.heading-symbol { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px; background: #eaf2eb; color: #548063; }
.heading-symbol svg { width: 17px; height: 17px; }
.card-heading h2 { margin: 0 0 2px; color: #33443a; font-size: 14px; line-height: 1.4; font-weight: 700; }
.card-heading p { margin: 0; color: #9aa49c; font-size: 10px; }
#entry-form { display: grid; gap: 14px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; min-width: 0; gap: 5px; color: #5b6b61; font-size: 10.5px; font-weight: 600; }
.field > span:first-child > b { padding-right: 2px; color: #d37460; font-size: 10px; font-weight: 500; }
.field input { width: 100%; height: 36px; min-width: 0; padding: 0 9px; border: 1px solid #e2e8e3; border-radius: 6px; outline: none; color: #34483c; background: #fff; font-size: 11.5px; font-weight: 500; transition: border .15s, box-shadow .15s; }
.field input::placeholder { color: #b8c1ba; font-weight: 400; }
.field input:focus { border-color: #7ba988; box-shadow: 0 0 0 3px #e8f2e9; }
.field input[dir="ltr"] { text-align: left; font-variant-numeric: tabular-nums; }
.field input[aria-invalid="true"] { border-color: #cd7669; box-shadow: 0 0 0 3px #fbefec; }
.input-with-unit { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px; border: 1px solid #e2e8e3; border-radius: 6px; background: #fff; transition: border .15s, box-shadow .15s; }
.input-with-unit:focus-within { border-color: #7ba988; box-shadow: 0 0 0 3px #e8f2e9; }
.input-with-unit input { height: 33px; padding: 0 2px; border: 0; border-radius: 0; box-shadow: none !important; }
.input-with-unit > span { color: #a1aba4; font-size: 9px; font-weight: 500; white-space: nowrap; }
.color-section { min-width: 0; padding: 0; margin: 0; border: 0; }
.color-section legend { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #5b6b61; font-size: 10.5px; font-weight: 600; }
.color-section legend > span { color: #a0aaa2; font-size: 9px; font-weight: 400; }
.color-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.palette-swatch { position: relative; width: 24px; height: 24px; padding: 0; overflow: hidden; border: 2px solid #fff; border-radius: 50%; outline: 1px solid #e3e9e4; cursor: pointer; transition: transform .12s, outline .15s; }
.palette-swatch:hover { transform: scale(1.08); }
.palette-swatch.is-selected { outline: 2px solid #58896a; outline-offset: 1px; }
.palette-swatch .swatch-mini { position: absolute; inset: 0; background: var(--swatch); }
.palette-swatch[data-dark="true"] .swatch-mini { box-shadow: inset 0 0 0 1px #ffffff80; }
.palette-swatch.is-custom::after { position: absolute; inset: 0; border: 1px dashed #4b765d; border-radius: 50%; content: ""; }
.custom-color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.add-color-control { display: inline-flex; align-items: center; gap: 6px; color: #79877d; font-size: 9.5px; font-weight: 500; cursor: pointer; }
.color-input-wrap { width: 19px; height: 19px; display: grid; place-items: center; overflow: hidden; border: 1px solid #dee6df; border-radius: 6px; background: conic-gradient(#e16b60 0 25%, #e7c256 0 50%, #4f9a77 0 75%, #6385c1 0) }
.color-input-wrap input { width: 25px; height: 25px; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.selection-hint { color: #a1aaa3; font-size: 9px; }
.color-mode-control { display: flex; width: max-content; max-width: 100%; padding: 3px; margin-top: 9px; border: 1px solid #e8ede9; border-radius: 7px; background: #f7f9f7; }
.color-mode-control button { min-height: 25px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: #87938a; cursor: pointer; font-size: 9px; }
.color-mode-control button.is-selected { background: #fff; color: #40664e; box-shadow: 0 1px 3px #233d2c16; font-weight: 600; }
.field-row-3 { display: grid; grid-template-columns: .75fr 1fr 1fr; gap: 8px; }
.form-footer { display: flex; align-items: center; gap: 8px; margin-top: 1px; }
.submit-entry { flex: 1; min-height: 39px; font-size: 11.5px; }
.submit-entry kbd { margin-right: auto; color: #e0eee4; border-color: #ffffff48; background: #ffffff14; }
.form-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #edf0ed; color: #9aa49d; font-size: 9.5px; }
.form-note svg { width: 14px; height: 14px; color: #79a080; }

.ledger-card { min-height: 392px; overflow: hidden; }
.ledger-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 19px 13px; }
.section-overline { display: flex; align-items: center; gap: 8px; color: #89958c; font-size: 9.5px; }
.section-overline > span { width: 5px; height: 5px; box-shadow: none; }
.ledger-heading h2 { display: flex; align-items: center; gap: 8px; margin: 4px 0 3px; color: #33443a; font-size: 16px; line-height: 1.5; letter-spacing: -.2px; }
.heading-count { min-width: 23px; height: 21px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: #e9f2ea; color: #528060; font-size: 10px; font-weight: 600; }
.ledger-heading p { margin: 0; color: #8d9991; font-size: 10px; }
.order-offices-button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.order-offices-button svg { width: 15px; height: 15px; }
.ledger-summary-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 19px 12px; }
.summary-chip { min-height: 25px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid #edf0ed; border-radius: 5px; background: #fbfcfb; color: #89968c; font-size: 9px; }
.summary-chip strong { color: #48614e; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-chip::before { width: 5px; height: 5px; border-radius: 50%; background: #83ac8b; content: ""; }
.table-scroller { position: relative; width: 100%; overflow-x: auto; border-top: 1px solid #edf0ed; }
.ledger-table { width: 100%; min-width: 690px; border-collapse: collapse; table-layout: auto; text-align: right; }
.ledger-table th { height: 35px; padding: 0 12px; background: #f8faf8; color: #89958d; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.ledger-table td { height: 49px; padding: 7px 12px; border-top: 1px solid #f0f2f0; color: #47584c; font-size: 10.5px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.ledger-table tbody tr:hover td { background-color: #f9fbf9; }
.ledger-table td:first-child { width: 36px; color: #a4ada6; text-align: center; font-size: 9px; }
.ledger-table td:nth-child(4), .ledger-table td:nth-child(5), .ledger-table td:nth-child(6) { direction: ltr; text-align: right; white-space: nowrap; }
.office-fisherman { min-width: 110px; display: grid; gap: 3px; }
.office-fisherman strong { color: #46594b; font-size: 10.5px; font-weight: 600; }
.office-fisherman span { color: #98a39b; font-size: 9.5px; }
.mini-color-group { display: inline-flex; align-items: center; gap: 5px; max-width: 110px; }
.mini-color-bar { width: 25px; height: 11px; flex: 0 0 25px; border: 1px solid #dce5de; border-radius: 4px; }
.mini-color-label { max-width: 77px; overflow: hidden; color: #77847b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.money-cell { direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.muted-value { color: #c1c9c3; }
.action-column { width: 86px; text-align: center !important; }
.row-actions { display: flex; justify-content: center; gap: 3px; }
.row-action { width: 25px; height: 25px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #829086; cursor: pointer; }
.row-action:hover { color: #42684e; border-color: #e2ece4; background: #f3f8f3; }
.row-action.delete:hover { color: var(--danger); border-color: #f2e2df; background: #fcf2f0; }
.row-action:disabled { opacity: .34; cursor: not-allowed; }
.row-action svg { width: 14px; height: 14px; }
.empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 27px 24px 31px; text-align: center; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 15px; background: #eff5f0; color: #84a78c; }
.empty-icon svg { width: 29px; height: 29px; }
.empty-state strong { color: #516258; font-size: 12px; font-weight: 600; }
.empty-state p { max-width: 290px; margin: 6px 0 12px; color: #9aa49d; font-size: 10px; line-height: 1.7; }
.empty-cta { padding: 0; border: 0; background: transparent; color: #497458; cursor: pointer; font-size: 10px; font-weight: 600; }
.empty-cta span { padding-right: 4px; }
.table-footer-bar { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 13px; border-top: 1px solid #edf0ed; color: #9aa49d; background: #fcfdfc; font-size: 9px; }
.table-footer-bar > span:first-child { display: flex; align-items: center; gap: 6px; }
.table-footer-bar .status-dot { width: 6px; height: 6px; flex-basis: 6px; box-shadow: none; }

.app-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e5ebe6; color: #a0aaa2; font-size: 9px; }
.app-footer > span:last-child { display: inline-flex; align-items: center; gap: 5px; }
.footer-shield { width: 15px; height: 15px; display: inline-grid; place-items: center; border-radius: 50%; background: #e8f1e9; color: #5b8966; font-size: 9px; font-weight: 700; }

.report-view { padding: 22px 0 26px; }
.report-sheet { min-height: 400px; padding: 25px 29px 16px; overflow: hidden; border: 1px solid #e2e8e3; border-top: 3px solid #47775a; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.sheet-heading { display: flex; align-items: center; gap: 13px; padding-bottom: 17px; border-bottom: 1px solid #e8ede9; }
.sheet-brand-mark { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; color: #49805e; background: #e8f1e9; }
.sheet-brand-mark svg { width: 27px; height: 27px; }
.sheet-titles { min-width: 0; }
.sheet-titles > p { margin: 0 0 2px; color: #87948a; font-size: 10px; }
.sheet-titles h2 { margin: 0; color: #2d4135; font-size: 20px; line-height: 1.4; letter-spacing: -.25px; }
.sheet-subtitle { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 4px; color: #98a29a; font-size: 9px; }
.sheet-subtitle-dot { width: 3px; height: 3px; border-radius: 50%; background: #b1bbb3; }
.sheet-stamp { display: flex; align-items: center; gap: 5px; margin-right: auto; padding: 6px 9px; border: 1px solid #e0e9e1; border-radius: 5px; color: #74907b; background: #f7faf7; font-size: 9px; }
.sheet-stamp svg { width: 15px; height: 15px; color: #76a07d; }
.sheet-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0; color: #95a098; font-size: 9px; }
.sheet-meta > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.sheet-meta > span:first-child i { width: 6px; height: 6px; border-radius: 50%; background: #6ba37a; }
.report-table-wrap { position: relative; width: 100%; overflow-x: auto; border: 1px solid #dfe7e1; border-radius: 5px; }
.report-table { width: 100%; border-collapse: collapse; table-layout: fixed; direction: rtl; text-align: right; }
.report-table .col-office { width: 17%; }
.report-table .col-fisherman { width: 17%; }
.report-table .col-boxcolor { width: 20%; }
.report-table .col-count { width: 12%; }
.report-table .col-aed { width: 17%; }
.report-table .col-kwd { width: 17%; }
.report-table thead th { height: 44px; padding: 5px 10px; border-left: 1px solid #dfe7e1; border-bottom: 1px solid #cfdbd1; background: #edf4ee; color: #3f5948; font-size: 10.5px; font-weight: 700; line-height: 1.45; text-align: center; vertical-align: middle; }
.report-table thead th:last-child, .report-table tbody td:last-child, .report-table tfoot td:last-child { border-left: 0; }
.report-table thead th small { color: #829486; font-size: 8px; font-weight: 500; }
.report-table tbody td { height: 36px; overflow: hidden; padding: 5px 10px; border-left: 1px solid #e6ebe7; border-bottom: 1px solid #e3e8e4; color: #39483d; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.report-table tbody tr.office-group-start td { border-top: 2px solid #cbd9cd; }
.report-table tbody tr.office-group-end td { border-bottom: 2px solid #bacbbb; }
.report-table tbody tr:first-child td { border-top: 0; }
.report-table tbody td:nth-child(4), .report-table tbody td:nth-child(5), .report-table tbody td:nth-child(6) { direction: ltr; text-align: center; font-variant-numeric: tabular-nums; }
.report-table tbody td:nth-child(1), .report-table tbody td:nth-child(2) { font-weight: 500; }
.report-table .box-color-cell { padding: 4px 9px; }
.box-color-display { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.box-color-swatches { display: inline-flex; width: 36px; height: 14px; flex: 0 0 36px; overflow: hidden; border: 1px solid #d0dbd3; border-radius: 3px; }
.box-color-swatches span { height: 100%; flex: 1 1 0; }
.box-color-display > span:last-child { overflow: hidden; color: #647267; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.report-table tbody tr.gap-row td { height: 10px; padding: 0; border: 0; background: #fff; }
.report-table tfoot td { height: 42px; padding: 7px 10px; border-left: 1px solid #ccdbcf; border-top: 2px solid #64886d; background: #f0f6f0; color: #355442; font-size: 11px; font-weight: 700; }
.report-table tfoot td:first-child { text-align: right; }
.report-table tfoot td:nth-child(n+2) { direction: ltr; text-align: center; font-variant-numeric: tabular-nums; }
.report-table tfoot td .sum-label { display: block; color: #809084; font-size: 8px; font-weight: 500; }
.report-empty { position: absolute; inset: 44px 0 0; min-height: 205px; display: none; flex-direction: column; align-items: center; justify-content: center; background: #fff; text-align: center; }
.report-empty.is-visible { display: flex; }
.report-empty > span { color: #78a183; font-size: 25px; }
.report-empty strong { color: #526359; font-size: 12px; }
.report-empty p { margin: 5px 0 10px; color: #9ba59e; font-size: 10px; }
.report-empty .button { min-height: 31px; font-size: 10px; }
.sheet-legend { min-height: 38px; display: flex; align-items: center; gap: 6px; color: #9aa49c; font-size: 9px; }
.legend-swatch { width: 21px; height: 11px; border-radius: 3px; background: linear-gradient(90deg, #cde5d9 0 33%, #c8d9ed 33% 66%, #f2dfaa 66%); }
.legend-tail { flex: 1; }
.sheet-page-hint { color: #b0b9b2; font-size: 8px; }
.sheet-page-hint > span { padding: 0 3px; color: #6f9478; }
.report-actions { display: flex; align-items: center; gap: 8px; padding-top: 14px; }
.report-actions .button { min-height: 37px; font-size: 11px; }
.report-actions-spacer { flex: 1; }
.print-help { margin: 9px 0 0; text-align: left; color: #9aa49c; font-size: 9px; }
.print-help strong { color: #6f8175; }

.app-dialog { width: min(540px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); padding: 0; overflow: hidden; border: 1px solid #dfe7e1; border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 20px 60px #24372b30; }
.app-dialog::backdrop { background: #29392e66; backdrop-filter: blur(2px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px 22px 15px; border-bottom: 1px solid #ecf0ed; }
.dialog-kicker { color: #819188; font-size: 9.5px; }
.dialog-header h2 { margin: 3px 0 0; color: #34473b; font-size: 17px; }
.dialog-description { margin: 5px 0 0; color: #87938a; font-size: 10px; }
.dialog-close { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #e5ebe6; border-radius: 6px; color: #738177; background: white; cursor: pointer; font-size: 21px; line-height: 1; }
.dialog-close:hover { background: #f6f9f6; }
.dialog-body { max-height: min(470px, calc(100vh - 230px)); overflow-y: auto; padding: 7px 15px; }
.report-list-row { display: flex; align-items: center; gap: 12px; padding: 13px 8px; border-bottom: 1px solid #f0f2f0; }
.report-list-row:last-child { border-bottom: 0; }
.report-list-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 9px; color: #63876b; background: #edf4ed; }
.report-list-icon svg { width: 17px; height: 17px; }
.report-list-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.report-list-copy strong { overflow: hidden; color: #415247; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-list-copy span { color: #929e95; font-size: 9px; }
.report-list-row.is-active .report-list-copy strong { color: #38664a; }
.report-list-row .button { min-height: 30px; padding: 0 9px; font-size: 9.5px; }
.dialog-footer { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px; border-top: 1px solid #edf0ed; color: #8d9991; background: #fcfdfc; font-size: 9px; }
.dialog-footer .button { min-height: 33px; font-size: 10px; }
.compact-dialog { width: min(440px, calc(100vw - 32px)); }
.office-order-list { display: grid; gap: 5px; max-height: 420px; overflow-y: auto; padding: 12px 20px 18px; margin: 0; list-style: none; counter-reset: item; }
.office-order-list li { min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 6px 9px; border: 1px solid #eaf0eb; border-radius: 7px; background: #fbfdfb; }
.office-rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #edf4ee; color: #66836b; font-size: 10px; font-weight: 600; }
.office-order-list li > strong { flex: 1; color: #4b5d51; font-size: 11px; font-weight: 600; }
.office-record-count { color: #96a198; font-size: 9px; }
.office-move-controls { display: inline-flex; gap: 4px; }
.office-move-controls button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid #e5ebe6; border-radius: 5px; color: #6e8273; background: white; cursor: pointer; }
.office-move-controls button:hover:not(:disabled) { border-color: #bdd2c1; background: #eef5ef; }
.office-move-controls button:disabled { opacity: .35; cursor: default; }
.office-move-controls svg { width: 12px; height: 12px; }
.office-order-empty { padding: 25px; color: #8c9990; text-align: center; font-size: 11px; }
.toast-region { position: fixed; z-index: 5; right: 50%; bottom: 22px; transform: translateX(50%); display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(430px, calc(100vw - 28px)); display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border: 1px solid #dce8dd; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px #1e392529; color: #435849; font-size: 11px; animation: toast-in .2s ease-out; }
.toast::before { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #59a070; content: ""; }
.toast.is-error::before { background: #bd5b4d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.view-panel { display: none; }
.view-panel.is-visible { display: block; }
.entry-view.view-panel.is-visible { display: grid; }

@media (min-width: 1400px) {
  .entry-view { grid-template-columns: minmax(330px, 375px) minmax(0, 1fr); }
  .app-shell { padding-right: 54px; padding-left: 54px; }
}
@media (max-width: 1060px) {
  .app-shell { padding-right: 27px; padding-left: 27px; }
  .entry-view { grid-template-columns: minmax(285px, 330px) minmax(0, 1fr); gap: 13px; }
  .form-card { padding-right: 13px; padding-left: 13px; }
  .intro { padding-top: 25px; }
  .intro-tools { gap: 6px; }
  .intro-tools .button { padding-right: 9px; padding-left: 9px; font-size: 10.5px; }
  .report-sheet { padding-right: 21px; padding-left: 21px; }
}
@media (max-width: 800px) {
  .app-shell { padding-right: 19px; padding-left: 19px; }
  .topbar { min-height: 67px; }
  .save-state { display: none; }
  .intro { align-items: flex-start; flex-direction: column; gap: 13px; padding: 23px 0 20px; }
  .intro-tools { flex-wrap: wrap; }
  .entry-view { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .form-card { padding: 16px; }
  .ledger-card { min-height: 320px; }
  .view-tabs { gap: 17px; }
  .keyboard-hint { display: none; }
  .report-sheet { padding: 21px 17px 12px; }
  .report-table { min-width: 700px; }
  .report-actions { flex-wrap: wrap; }
  .report-actions-spacer { min-width: 100%; height: 0; order: 2; }
  #excel-export { order: 3; }
  #pdf-export { order: 4; }
  #print-report { order: 5; }
  #report-back { order: 1; }
}
@media (max-width: 510px) {
  .app-shell { padding-right: 13px; padding-left: 13px; }
  .topbar { min-height: 62px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .top-actions { gap: 3px; }
  .top-actions .button { min-height: 33px; padding-right: 7px; padding-left: 7px; font-size: 9.5px; }
  .top-actions .button svg { width: 14px; height: 14px; }
  .top-actions .button-quiet > span:not(.count-pill) { display: none; }
  .top-actions .count-pill { min-width: 17px; height: 17px; }
  .intro h1 { font-size: 25px; }
  .intro-copy > p { max-width: 320px; line-height: 1.7; }
  .intro-tools { gap: 6px; }
  .orientation-control { min-height: 33px; }
  .report-date-control { min-height: 33px; gap: 5px; padding: 0 6px; font-size: 9px; }
  .report-date-control input { width: 102px; font-size: 9px; }
  .intro-tools .button { min-height: 33px; font-size: 9px; }
  .tool-separator { display: none; }
  .view-tabs { height: 43px; gap: 13px; }
  .view-tab { gap: 5px; font-size: 10px; }
  .view-tab .tab-icon { width: 14px; }
  .view-tab svg { width: 14px; height: 14px; }
  .view-tab .tab-count { min-width: 17px; height: 17px; padding: 0 4px; font-size: 8px; }
  .form-grid-two { gap: 8px; }
  .field-row-3 { grid-template-columns: .68fr 1fr 1fr; gap: 6px; }
  .field input { padding-right: 7px; padding-left: 7px; }
  .field-row-3 .field { font-size: 9px; }
  .input-with-unit { padding-right: 6px; padding-left: 6px; }
  .ledger-heading { align-items: flex-start; padding: 15px 13px 12px; }
  .ledger-heading h2 { font-size: 14px; }
  .ledger-heading p { max-width: 230px; font-size: 9px; }
  .order-offices-button { min-height: 29px; padding: 0 6px; font-size: 8.5px; }
  .order-offices-button svg { width: 13px; }
  .ledger-summary-strip { padding-right: 13px; padding-left: 13px; }
  .report-sheet { padding: 17px 11px 9px; }
  .sheet-heading { gap: 9px; }
  .sheet-brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .sheet-brand-mark svg { width: 23px; height: 23px; }
  .sheet-titles h2 { font-size: 17px; }
  .sheet-stamp { padding: 5px 6px; font-size: 8px; }
  .sheet-stamp svg { width: 13px; }
  .report-actions { gap: 5px; }
  .report-actions .button { min-height: 33px; padding-right: 7px; padding-left: 7px; font-size: 9px; }
  .report-actions .button svg { width: 14px; }
  .app-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 0; }
}

@media print {
  :root { --font: "Segoe UI", Tahoma, Arial, sans-serif; }
  @page { size: A4 landscape; margin: 11mm; }
  html, body { min-width: 0 !important; background: #fff !important; print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
  body { font-family: var(--font); }
  .app-shell { max-width: none; padding: 0 !important; margin: 0 !important; }
  .no-print, .topbar, .intro, .view-tabs, .entry-view, .app-footer, .report-actions, .print-help { display: none !important; }
  .entry-view.view-panel { display: none !important; }
  .report-view.view-panel, .report-view.view-panel.is-visible { display: block !important; padding: 0 !important; }
  .report-sheet { min-height: 0; padding: 0; overflow: visible; border: 0; border-top: 2.5px solid #47775a; border-radius: 0; box-shadow: none; }
  .sheet-heading { padding-bottom: 9px; }
  .sheet-brand-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .sheet-titles h2 { font-size: 17pt; }
  .sheet-titles > p { font-size: 8pt; }
  .sheet-subtitle { font-size: 7pt; }
  .sheet-stamp { font-size: 7pt; }
  .sheet-meta { padding: 7px 0; font-size: 7pt; }
  .report-table-wrap { overflow: visible; border: 1px solid #d5dfd6; border-radius: 0; }
  .report-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; }
  .report-table .col-office { width: 17%; }
  .report-table .col-fisherman { width: 17%; }
  .report-table .col-boxcolor { width: 20%; }
  .report-table .col-count { width: 12%; }
  .report-table .col-aed { width: 17%; }
  .report-table .col-kwd { width: 17%; }
  .report-table thead { display: table-header-group; }
  .report-table thead th { height: 34px; padding: 4px 6px; font-size: 8.5pt; }
  .report-table thead th small { font-size: 6.5pt; }
  .report-table tbody td { height: 25px; padding: 3px 7px; font-size: 8pt; }
  .report-table tbody tr { break-inside: avoid; }
  .report-table tbody tr.gap-row td { height: 6px; }
  .report-table tfoot { display: table-row-group; }
  .report-table tfoot tr { break-inside: avoid; }
  .report-table tfoot td { height: 32px; padding: 4px 7px; font-size: 9pt; }
  .report-table tfoot td .sum-label { font-size: 6pt; }
  .box-color-display > span:last-child { font-size: 7pt; }
  .box-color-swatches { height: 11px; }
  .sheet-legend { min-height: 26px; font-size: 7pt; }
  .report-empty { position: static; min-height: 60px; }
  .report-empty:not(.is-visible) { display: none !important; }
}
