@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "Inter", sans-serif;
  color: #19231d;
  background: #f1f5f1;
  --brand-900: #103c29;
  --brand-800: #155238;
  --brand-700: #176b42;
  --brand-500: #35a765;
  --brand-100: #dff3e6;
  --surface: #ffffff;
  --surface-soft: #f6faf7;
  --line: #d8e2da;
  --shadow-sm: 0 4px 14px #103c290d;
  --shadow-md: 0 14px 34px #103c2917;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, #dff1e664 0, transparent 28rem),
    radial-gradient(circle at 92% 18%, #e7f2e955 0, transparent 32rem),
    linear-gradient(180deg, #f7f9f7 0, #f1f5f1 55%, #edf3ee 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(#173d2b05 1px, transparent 1px), linear-gradient(90deg, #173d2b05 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #0006, transparent 70%);
}
.legacy-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px max(24px, calc((100% - 1880px)/2));
  background: #103c29ee;
  border-bottom: 1px solid #ffffff1f;
  box-shadow: 0 8px 24px #0b2b1d18;
  backdrop-filter: blur(14px) saturate(1.25);
}
.legacy-header a { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 750; letter-spacing: .01em; }
.legacy-header a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #6fe39e; box-shadow: 0 0 0 5px #6fe39e24; transition: transform .35s var(--ease-spring), box-shadow .35s ease; }
.legacy-header a:hover::before { transform: scale(1.25); box-shadow: 0 0 0 8px #6fe39e1f; }
main { max-width: 1880px; margin: 28px auto; padding: 0 20px 60px; animation: page-enter .52s var(--ease-out) both; }
h1, h2, h3 { margin-top: 0; }
.card, .alert {
  position: relative;
  background: #ffffffed;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  animation: surface-enter .58s var(--ease-out) both;
}
main > .card:nth-of-type(2), main > .alert:nth-of-type(2) { animation-delay: 70ms; }
main > .card:nth-of-type(3), main > .alert:nth-of-type(3) { animation-delay: 120ms; }
.card:not(.wide) { transition: transform .3s var(--ease-out), box-shadow .3s ease, border-color .3s ease; }
.card:not(.wide):hover { transform: translateY(-2px); border-color: #c5d8ca; box-shadow: var(--shadow-md); }
.wide { max-width: none; }
.upload-card { overflow: hidden; background: linear-gradient(135deg, #fffffffa, #edf8f1f2); }
.upload-card::after { content: ""; position: absolute; width: 280px; height: 280px; top: -190px; right: -90px; border-radius: 50%; background: radial-gradient(circle, #63c7872e, transparent 68%); pointer-events: none; }
.upload-drop-zone { min-height: 190px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 2px dashed #91aa99; border-radius: 14px; background: #fbfdfbe8; text-align: center; cursor: pointer; transition: transform .3s var(--ease-out), border-color .2s ease, background .2s ease, box-shadow .3s ease; }
.upload-drop-zone:hover, .upload-drop-zone:focus, .upload-drop-zone.is-dragging { outline: none; border-color: var(--brand-700); background: #eaf7ee; box-shadow: 0 0 0 5px #2a9a5d18, 0 14px 28px #176b4212; transform: translateY(-2px); }
.upload-drop-zone.is-dragging { transform: scale(1.008); }
.drop-zone-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); font-size: 30px; box-shadow: inset 0 0 0 1px #176b4210; transition: transform .35s var(--ease-spring), background .25s ease; }
.upload-drop-zone:hover .drop-zone-icon, .upload-drop-zone:focus .drop-zone-icon { transform: translateY(-3px) scale(1.07); background: #d2efdc; }
.upload-drop-zone.is-dragging .drop-zone-icon { animation: drop-bob .75s ease-in-out infinite alternate; }
.upload-drop-zone span { color: #657269; }
.upload-submit { margin-top: 14px; }
.upload-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; margin-top: 14px; }
.upload-preview { position: relative; min-width: 0; padding: 8px; border: 1px solid #d4ddd6; border-radius: 11px; background: white; box-shadow: var(--shadow-sm); animation: preview-in .42s var(--ease-spring) both; transition: transform .25s var(--ease-out), box-shadow .25s ease; }
.upload-preview:hover { transform: translateY(-3px); box-shadow: 0 12px 24px #103c2918; }
.upload-preview img { display: block; width: 100%; height: 115px; object-fit: contain; background: #f3f5f3; border-radius: 6px; }
.upload-preview span { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.preview-remove { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: #d84f5b; font-size: 20px; line-height: 1; }
.archive-link { position: relative; color: var(--brand-700); font-weight: 750; text-decoration: none; }
.archive-link::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px; background: currentColor; transition: right .28s var(--ease-out); }
.archive-link:hover::after { right: 0; }
button {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #1d7b4c, var(--brand-700));
  color: white;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 5px 12px #176b421c;
  transition: transform .2s var(--ease-spring), box-shadow .22s ease, filter .22s ease, background .22s ease;
}
button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 22%, #ffffff2e 48%, transparent 74%); transform: translateX(-130%); transition: transform .55s var(--ease-out); pointer-events: none; }
button:hover { transform: translateY(-2px); box-shadow: 0 9px 18px #176b4228; filter: saturate(1.08); }
button:hover::after { transform: translateX(130%); }
button:active { transform: translateY(0) scale(.975); box-shadow: 0 3px 8px #176b4220; }
button:focus-visible { outline: 3px solid #4fbd7b4f; outline-offset: 3px; }
button:disabled, button.is-busy { cursor: wait; opacity: .78; transform: none; }
button.is-busy::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: 8px; vertical-align: -.08em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .72s linear infinite; }
button.is-success { animation: success-pop .45s var(--ease-spring); }
button.secondary { background: linear-gradient(180deg, #edf4ef, #e2ece5); color: #244832; box-shadow: 0 4px 10px #173d2b12; }
button.danger { background: linear-gradient(180deg, #e45d69, #d74754); }
input[type=file], input[type=text], input:not([type]), select { max-width: 100%; padding: 9px; margin-right: 8px; border: 1px solid #c9d3cb; border-radius: 8px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease-out); }
input:focus, select:focus { outline: none; border-color: #49a66e; box-shadow: 0 0 0 4px #3fa96b18; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px; border-bottom: 1px solid #e3e8e4; vertical-align: top; }
th { background: linear-gradient(180deg, #f8faf8, #f2f6f3); font-size: .88rem; }
tbody tr { transition: background-color .22s ease, box-shadow .22s ease; }
tbody tr:hover { background-color: #f2f8f4; box-shadow: inset 4px 0 0 #69b989; }
.table-scroll { overflow-x: auto; }
.products-table { min-width: 1260px; table-layout: fixed; font-size: 15px; line-height: 1.35; }
.products-table th { font-size: 14px; line-height: 1.22; }
.products-table td strong { font-size: 16px; }
.products-table td small { font-size: 13px; line-height: 1.35; }
.products-table select, .products-table button { font-size: 14px; }
.products-table .copy-box pre { font-size: 13px; line-height: 1.45; }
.products-table th:nth-child(1) { width: 38px; }
.products-table th:nth-child(2) { width: 280px; }
.products-table th:nth-child(3) { width: 78px; }
.products-table th:nth-child(4) { width: 104px; }
.products-table th:nth-child(5) { width: 82px; }
.products-table th:nth-child(6) { width: 112px; }
.products-table th:nth-child(7) { width: 108px; }
.products-table th:nth-child(8) { width: auto; }
.products-table .candidate-form { width: 100%; }
.products-table tbody tr { scroll-margin-top: 76px; }
.products-table tbody tr:target { animation: target-row 1.8s var(--ease-out) both; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: #e8ece9; font-size: .82rem; font-weight: 650; transition: transform .22s var(--ease-spring), box-shadow .22s ease; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .72; }
.status:hover { transform: translateY(-1px); box-shadow: 0 5px 12px #173d2b14; }
.status-ready, .status-created { background: #d9f5e4; color: #12552f; }
.status-error { background: #ffe1df; color: #8b1e16; }
.status-review { background: #fff0c7; color: #735000; }
.status-pending::before, .status-extracting::before, .status-matching::before { animation: status-pulse 1.25s ease-in-out infinite; }
.status-review::before { animation: status-breathe 2.2s ease-in-out infinite; }
.alert.error { border-color: #e6a29d; background: #fff2f1; }
.alert.success { border-color: #8bcea5; background: #effaf3; }
.alert.warning { border-color: #e6c76c; background: #fff9e8; }
.ok { color: #126037; font-weight: 650; }
.job-head, .section-head, .section-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-actions { justify-content: flex-end; }
.section-actions form { margin: 0; }
.images { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0; }
.images img { height: 230px; width: auto; border-radius: 10px; border: 1px solid #ccd5ce; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease-out), box-shadow .3s ease; }
.images img:hover { transform: translateY(-3px) scale(1.015); box-shadow: var(--shadow-md); }
.summary { display: grid; grid-template-columns: 180px 1fr; gap: 8px; }
.summary dt { color: #637069; }
.summary dd { margin: 0; font-weight: 600; }
.recognized-cell { min-width: 280px; }
.line-numbers-cell { min-width: 484px; }
.line-number-grid { display: grid; grid-template-columns: 78px 104px 82px 112px 108px; align-items: start; gap: 0; }
.arm-match-cell { min-width: 450px; }
.line-confirm { display: flex; flex-direction: column; gap: 7px; min-width: 450px; max-width: 720px; margin-bottom: 8px; }
.line-confirm .candidate-select { width: 100%; }
.line-confirm .candidate-select:disabled { opacity: .5; cursor: not-allowed; }
.line-confirm .manual-pick { margin: 0; max-width: none; }
.candidate-action-row { display: grid; grid-template-columns: minmax(300px, 1fr) auto; gap: 8px; align-items: center; }
.line-action-row { display: flex; align-items: center; gap: 8px; margin-top: 0; white-space: nowrap; }
.line-confirm-submit { flex: none; }
.manual-chosen-clear { position: absolute; top: 50%; right: 8px; width: 28px; height: 28px; padding: 0; background: transparent; color: #12552f; box-shadow: none; font-size: 20px; line-height: 1; transform: translateY(-50%); }
.manual-chosen-clear::after { content: none; }
.manual-chosen-clear:hover { background: #ffffff66; transform: translateY(-50%); box-shadow: none; filter: none; }

/* Inline button icons + per-line controls */
.btn-icon { flex: none; margin-right: 5px; }
.line-photo { display: inline-flex; align-items: center; }
.line-delete { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: 8px; font-size: 18px; line-height: 1; background: #fbeaec; color: #8b1e16; box-shadow: none; }
.line-delete::after { content: none; }
.line-delete:hover { background: #f3d2d6; transform: none; box-shadow: none; filter: none; }
.ocr-text { margin: 12px 0 0; white-space: pre-wrap; color: #26352d; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.line-tools { display: flex; align-items: center; flex-direction: row; flex-wrap: nowrap; gap: 7px; margin-top: 30px; white-space: nowrap; }
.line-tools .confidence, .line-tools .line-photo, .line-tools .copy-name { display: inline-flex; align-items: center; justify-content: center; width: 118px; min-height: 30px; padding: 5px 8px; border-radius: 8px; font-size: 12px; line-height: 1; box-sizing: border-box; }
.line-tools .line-photo .btn-icon { width: 14px; height: 14px; }
.copy-name { margin: 0; }
.copy-box { background: #f6f8f6; border-radius: 8px; padding: 10px; }
.ocr-copy-box { margin-top: 10px; max-width: 520px; }
.copy-box pre { white-space: pre-wrap; margin: 0 0 8px; font: 12px/1.45 ui-monospace, monospace; }
.selected-product-details { margin-top: 10px; padding: 11px 12px; border: 1px solid #d8e1dc; border-radius: 8px; background: #f8fbf9; color: #26352d; }
.selected-product-title { margin-bottom: 8px; font-weight: 750; line-height: 1.3; }
.selected-product-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px; margin: 0; font-size: 13px; line-height: 1.35; }
.selected-product-details dt { color: #667169; }
.selected-product-details dd { margin: 0; font-weight: 650; }
.selected-product-empty { color: #667169; font-size: 13px; }
.match-unmatched, .match-suggested { background: #fffdf6; }
.action-card { border: 2px solid #70b98d; }
.product-dialog { width: min(760px, calc(100vw - 28px)); border: 1px solid #89958d; border-radius: 10px; padding: 0; box-shadow: 0 24px 70px #0a1c1252; font-size: 15px; }
.product-dialog[open] { animation: dialog-in .36s var(--ease-spring) both; }
.product-dialog::backdrop { background: #17251d66; backdrop-filter: blur(3px); animation: backdrop-in .25s ease both; }
.product-dialog form { padding: 0 12px 12px; }
.product-dialog input, .product-dialog select, .product-dialog button { font-size: 14px; }
.dialog-titlebar { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 14px; }
.dialog-titlebar strong { font-size: 16px; }
.dialog-close { color: #1d251f; background: transparent; padding: 0 7px; font-size: 24px; line-height: 1; }
.product-identification { display: grid; grid-template-columns: 160px 1fr; gap: 10px; position: relative; }
.product-identification label, .product-calculation-grid label { display: grid; gap: 5px; text-align: center; font-size: 14px; }
.product-identification input { width: 100%; text-align: center; }
.product-search-results { position: absolute; z-index: 3; top: 66px; left: 0; width: 100%; max-height: 230px; overflow: auto; background: white; border: 1px solid #aab5ad; box-shadow: 0 14px 32px #17251d2e; animation: search-results-in .22s var(--ease-out) both; }
.product-search-result { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; width: 100%; text-align: left; color: #17251d; background: white; border-radius: 0; border-bottom: 1px solid #e1e5e2; }
.product-search-result:hover { background: #eff7f1; }
.product-search-result small { white-space: nowrap; }
.product-calculation-grid { display: grid; grid-template-columns: 95px 85px 70px 48px 48px 95px 95px 110px; gap: 10px; align-items: end; margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid #ccd3ce; }
.product-calculation-grid input { width: 100%; text-align: center; padding: 8px; border: 1px solid #abb5ae; }
.formula-button { background: #edf0ee; color: #34433a; border: 1px solid #c8cfca; padding: 8px 6px; }
.product-sums { grid-row: span 2; display: grid; gap: 10px; margin: 0; padding: 8px 10px 10px; border: 1px solid #c7cec9; }
.product-sums label { text-align: left; }
.previous-price-note { margin: 12px 0; color: #526159; }
.dialog-error { margin: 10px 0; padding: 9px; color: #8b1e16; background: #fff2f1; border: 1px solid #e6a29d; }
.dialog-actions { display: grid; grid-template-columns: auto auto auto 1fr; gap: 10px; margin-top: 14px; }
.dialog-actions .primary { background: #36a853; }
.quick-entry { text-align: center; margin: 10px 0 0; font-size: 14px; }
small { color: #667169; }
@keyframes page-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes surface-enter { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes preview-in { from { opacity: 0; transform: translateY(10px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes drop-bob { from { transform: translateY(-4px) scale(1.05); } to { transform: translateY(4px) scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes success-pop { 45% { transform: scale(1.06); } }
@keyframes choice-ready { 40% { transform: translateY(-2px) scale(1.035); box-shadow: 0 10px 22px #176b4230; } }
@keyframes status-pulse { 50% { opacity: .3; transform: scale(.72); } }
@keyframes status-breathe { 50% { box-shadow: 0 0 0 5px #b98b1618; } }
@keyframes target-row { 0% { background: #ccefd8; box-shadow: inset 6px 0 0 #2d9c5b; } 100% { background: transparent; box-shadow: inset 0 0 0 transparent; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.965); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes search-results-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 850px) { .product-calculation-grid { grid-template-columns: repeat(4, 1fr); } .product-sums { grid-row: auto; grid-column: span 2; } }
@media (max-width: 700px) { main { padding: 0 10px 40px; } .summary { grid-template-columns: 1fr; } .candidate-form { min-width: 300px; } .section-head, .section-actions { align-items: stretch; flex-direction: column; } .product-identification { grid-template-columns: 1fr; } .product-calculation-grid { grid-template-columns: repeat(2, 1fr); } .dialog-actions { grid-template-columns: 1fr 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; }
}

/* Job header actions + delete buttons in lists */
.job-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.job-head-actions form { margin: 0; }
.row-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions form { margin: 0; }
.row-delete { padding: 6px 11px; font-size: 14px; line-height: 1; }

/* Image thumbnails open the modal viewer */
.images .image-thumb { padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; cursor: zoom-in; line-height: 0; overflow: visible; }
.images .image-thumb::after { content: none; }
.images .image-thumb:hover { transform: none; box-shadow: none; filter: none; }

/* Full-screen image viewer with zoom/pan/rotate */
body.viewer-open { overflow: hidden; }
.image-viewer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: #0b1a12f2; backdrop-filter: blur(6px); animation: backdrop-in .2s ease both; }
.image-viewer[hidden] { display: none; }
.viewer-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.viewer-image { max-width: 92vw; max-height: 86vh; user-select: none; -webkit-user-drag: none; transform-origin: center center; transition: transform .12s ease-out; will-change: transform; }
.viewer-stage.is-zoomed .viewer-image { cursor: grab; }
.viewer-stage.is-dragging .viewer-image { cursor: grabbing; transition: none; }
.viewer-toolbar { position: fixed; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.viewer-spacer { flex: 1; }
.viewer-counter { color: #eaf5ee; font-weight: 700; font-size: 15px; padding: 6px 12px; border-radius: 999px; background: #ffffff1f; }
.viewer-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; background: #ffffff1a; color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; box-shadow: none; }
.viewer-btn::after { content: none; }
.viewer-btn:hover { background: #ffffff33; transform: none; box-shadow: none; filter: none; }
.viewer-close { background: #e45d6933; }
.viewer-close:hover { background: #e45d6959; }
.viewer-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 84px; border-radius: 12px; background: #ffffff1a; color: #fff; font-size: 38px; line-height: 1; box-shadow: none; z-index: 2; }
.viewer-nav::after { content: none; }
.viewer-nav:hover { background: #ffffff33; transform: translateY(-50%); box-shadow: none; filter: none; }
.viewer-nav:active { transform: translateY(-50%) scale(.96); }
.viewer-nav[hidden] { display: none; }
.viewer-prev { left: 14px; }
.viewer-next { right: 14px; }
.viewer-hint { position: fixed; bottom: 14px; left: 0; right: 0; margin: 0; padding: 0 12px; text-align: center; color: #cfe6d8cc; font-size: 13px; pointer-events: none; }
@media (max-width: 700px) { .viewer-hint { display: none; } .viewer-image { max-width: 98vw; max-height: 80vh; } .viewer-nav { width: 44px; height: 70px; font-size: 32px; } }

/* Per-line confidence + scan button */
.line-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.confidence { font-size: 13px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: #eef2ef; color: #4a5a50; }
.confidence.conf-high { background: #d9f5e4; color: #12552f; }
.confidence.conf-mid { background: #fff0c7; color: #735000; }
.confidence.conf-low { background: #ffe1df; color: #8b1e16; }
.line-photo { padding: 3px 11px; font-size: 13px; background: linear-gradient(180deg, #edf4ef, #e2ece5); color: #244832; box-shadow: 0 3px 8px #173d2b12; }

/* Manual product search for an unmatched line */
.manual-pick { position: relative; margin: 8px 0; max-width: 460px; }
.manual-pick-input { width: 100%; margin: 0; padding-right: 42px; }
.manual-pick-input.is-chosen { border-color: #b9e7cc; background: #d9f5e4; color: #12552f; font-weight: 650; }
.manual-pick-results { position: absolute; z-index: 6; left: 0; top: calc(100% + 3px); width: 100%; max-height: 280px; overflow: auto; background: #fff; border: 1px solid #aab5ad; border-radius: 8px; box-shadow: 0 14px 32px #17251d2e; animation: search-results-in .2s var(--ease-out) both; }
.manual-pick-result { display: grid; grid-template-columns: 118px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; color: #17251d; background: #fff; border: 0; border-bottom: 1px solid #e1e5e2; border-radius: 0; box-shadow: none; padding: 9px 11px; font-size: 15px; }
.manual-pick-result::after { content: none; }
.manual-pick-result:hover { background: #eff7f1; transform: none; box-shadow: none; filter: none; }
.manual-pick-result small { white-space: nowrap; color: #667169; }

/* Archive bulk delete */
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: #33433a; cursor: pointer; }
.col-check { width: 38px; text-align: center; }
.bulk-item, #bulk-select-all { width: 18px; height: 18px; cursor: pointer; accent-color: var(--brand-700); }
#bulk-delete:disabled { cursor: not-allowed; }

/* АБТ public landing */
.public-body, .admin-body { background: #eef3f7; }
.public-body::before, .admin-body::before { display: none; }
.abt-landing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background: #181f1a;
}
.abt-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.abt-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #11160fe8 0, #11160fbf 32%, #11160f5c 57%, #11160f12 100%),
    linear-gradient(180deg, #11160f6b 0, transparent 34%, #11160f8a 100%);
}
.abt-public-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}
.abt-public-logo {
  display: inline-flex;
  align-items: center;
  width: 178px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fffffff2;
  box-shadow: 0 18px 42px #00000030;
}
.abt-public-logo img { width: 100%; height: auto; display: block; }
.abt-login-open {
  border: 1px solid #ffffff42;
  border-radius: 8px;
  background: #ffffffef;
  color: #b21f24;
  box-shadow: 0 16px 36px #00000030;
}
.abt-login-open:hover { background: #fff; }
.abt-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 120px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 28px 76px;
}
.abt-kicker {
  margin: 0 0 14px;
  color: #ffd8d8;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.abt-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: 74px;
  line-height: .98;
  font-weight: 900;
  text-shadow: 0 18px 44px #00000066;
}
.abt-lead {
  max-width: 590px;
  margin: 26px 0 30px;
  color: #f8f3ee;
  font-size: 22px;
  line-height: 1.45;
}
.abt-hero-copy address {
  max-width: 560px;
  font-style: normal;
  color: #fff7ef;
  font-size: 18px;
  line-height: 1.55;
  border-left: 4px solid #e3342f;
  padding-left: 18px;
}
.login-dialog {
  width: min(430px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: #20262c;
}
.login-dialog::backdrop {
  background: #09100ee0;
  backdrop-filter: blur(7px);
}
.login-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 34px;
  border: 1px solid #ffffff80;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffffff7, #f7fbfff5),
    #fff;
  box-shadow: 0 30px 90px #00000066;
}
.login-panel img { width: 142px; height: auto; }
.login-panel h2 { margin: 6px 0 0; font-size: 30px; }
.login-panel p { margin: 0 0 8px; color: #66707c; }
.login-panel label {
  display: grid;
  gap: 7px;
  color: #2d3640;
  font-weight: 750;
}
.login-panel input {
  width: 100%;
  height: 46px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #d2d9e2;
  background: #fff;
  font-size: 16px;
}
.login-submit {
  height: 48px;
  margin-top: 6px;
  background: linear-gradient(180deg, #ef3b36, #bc2528);
  border-radius: 8px;
  box-shadow: 0 14px 26px #bc25282b;
}
.login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: #eef2f6;
  color: #48515b;
  box-shadow: none;
  font-size: 24px;
}
.login-close::after { content: none; }
.login-error {
  padding: 10px 12px;
  border: 1px solid #f0b2b2;
  border-radius: 8px;
  color: #981b1f;
  background: #fff0f0;
  font-weight: 700;
}

/* ARM-style admin shell */
.admin-body {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.admin-body button,
.admin-body input,
.admin-body select,
.admin-body textarea {
  font-family: inherit;
}
.admin-body h1,
.admin-body h2,
.admin-body h3,
.admin-body h4,
.admin-body h5,
.admin-body h6 {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  line-height: 1.3;
  color: #1f2937;
}
.admin-layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  background: #e9eff6;
  color: #263445;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 10px;
  background: #1e2d3d;
  color: #dbe6f0;
  font-family: "Inter", Arial, sans-serif;
  letter-spacing: 0;
}
.admin-brand {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: #31c39a;
  text-decoration: none;
  font-weight: 800;
}
.admin-brand img {
  width: 58px;
  padding: 5px;
  border-radius: 8px;
  background: #fff;
}
.admin-nav {
  display: grid;
  gap: 4px;
}
.admin-nav a,
.admin-nav .is-disabled {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #d9e4ef;
  text-decoration: none;
  font-family: "Inter", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.admin-nav a:hover, .admin-nav a.is-active { background: #34465b; color: #fff; }
.admin-nav a span, .admin-nav .is-disabled span { color: #93a6b8; text-align: center; }
.admin-nav a.is-active span { color: #2ac99a; }
.admin-nav .admin-nav-parent {
  grid-template-columns: 24px 1fr 16px;
  min-height: 44px;
  border: 1px solid #ffffffb8;
  background: #34465b;
}
.admin-nav .admin-nav-parent strong {
  font-size: 14px;
  font-weight: 700;
}
.admin-nav .admin-nav-parent i {
  color: #fff;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  transform: rotate(0deg);
}
.admin-report-tree {
  display: grid;
  gap: 8px;
  padding: 6px 6px 12px 42px;
}
.admin-nav .admin-report-group,
.admin-nav .admin-report-leaf {
  color: #d9e4ef;
  text-decoration: none;
  line-height: 1.12;
}
.admin-nav .admin-report-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0;
  border-radius: 0;
  font-family: "Inter", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
}
.admin-nav .admin-report-group span {
  color: #93a6b8;
  font-size: 16px;
  text-align: right;
}
.admin-nav .admin-report-leaf {
  position: relative;
  display: block;
  min-height: 26px;
  padding: 0 0 0 15px;
  border-radius: 0;
  font-family: "Inter", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.18;
}
.admin-nav .admin-report-leaf::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #9eacbc;
}
.admin-nav .admin-report-group:hover,
.admin-nav .admin-report-leaf:hover {
  color: #31c39a;
  background: transparent;
}
.admin-report-tree .is-disabled {
  color: #9cadbd;
  cursor: not-allowed;
  opacity: .72;
}
.admin-report-tree .is-disabled span {
  color: #9cadbd;
}
/* «Довідники» — заголовок групи, а не пункт: колір і шрифт спільні з рештою,
   відрізняється лише курсором, бо натискати нема на що. */
.admin-nav .is-disabled {
  color: #d9e4ef;
  cursor: default;
}
.admin-nav .is-disabled.is-green {
  color: #25c28f;
  opacity: .82;
}
.admin-nav .is-disabled.is-green span { color: #25c28f; }
.admin-nav .admin-sub-link {
  min-height: 32px;
  padding-left: 24px;
  color: #d9e4ef;
  font-size: 14px;
  font-weight: 700;
}
.admin-nav .admin-sub-link span {
  color: #93a6b8;
  font-size: 16px;
  line-height: 1;
}
.admin-logout { margin-top: auto; }
.admin-logout button {
  width: 100%;
  background: #2b3d51;
  box-shadow: none;
  border-radius: 8px;
}
.admin-main { min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 10px;
}
.admin-topbar strong {
  display: block;
  color: #263445;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
}
.admin-topbar span {
  display: block;
  margin-top: 4px;
  color: #7b8a9a;
  font-size: .8125rem;
  line-height: 1.45;
  font-weight: 400;
}
.admin-site-link {
  flex: none;
  padding: 10px 13px;
  border: 1px solid #d5dde7;
  border-radius: 8px;
  background: #fff;
  color: #2d4157;
  text-decoration: none;
  font-weight: 800;
}
.admin-content {
  max-width: none;
  margin: 0;
  padding: 12px 24px 50px;
}
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #738296;
  font-size: .875rem;
  line-height: 1.5;
}
.quick-actions a, .quick-disabled, .chart-tabs button, .chart-tabs a {
  padding: 8px 13px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
  color: #32465b;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 5px 14px #1f2d3d0d;
}
.quick-disabled {
  color: #9aa7b7;
  cursor: not-allowed;
  background: #f8fafc;
}
.period-form {
  display: flex;
  align-items: end;
  gap: 9px;
}
.period-form label {
  display: grid;
  gap: 4px;
  color: #7b8a9a;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
}
.period-form input, .period-form select {
  height: 38px;
  margin: 0;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
}
.period-form select:disabled {
  color: #8b98aa;
  background: #f8fafc;
}
.period-form button { height: 38px; border-radius: 8px; background: #266bdc; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric-card {
  min-height: 106px;
  padding: 16px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px #1f2d3d0b;
}
.metric-card[data-href],
.dashboard-panel[data-href],
.leader-row[data-href] {
  cursor: pointer;
}
.metric-card[data-href]:hover,
.metric-card[data-href]:focus,
.dashboard-panel[data-href]:hover,
.dashboard-panel[data-href]:focus {
  border-color: #b9c9dc;
  box-shadow: 0 18px 38px #1f2d3d14;
  transform: translateY(-1px);
}
.metric-card.is-disabled {
  cursor: not-allowed;
}
.metric-card span, .metric-card small { display: block; color: #8a98aa; }
.metric-card strong {
  display: block;
  margin: 3px 0 12px;
  color: #1f2d3d;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 600;
}
.metric-card span { font-size: .875rem; font-weight: 500; }
.metric-card small { font-size: .8125rem; line-height: 1.45; }
.metric-card em { font-size: .75rem; font-style: normal; font-weight: 400; }
.metric-card b { color: #17b987; font-size: .75rem; font-weight: 600; }
.metric-card b.down { color: #f04458; }
.metric-card b.neutral { color: #8a98aa; }
.metric-card b.warn { color: #f3a417; }
.metric-card.online { background: #ccf7df; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.dashboard-panel {
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px #1f2d3d0d;
}
.dashboard-panel h2 {
  margin: 0;
  color: #263445;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf1f6;
}
.panel-head span { color: #506176; font-size: .75rem; font-weight: 500; }
.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-head-actions button {
  min-height: 34px;
  white-space: nowrap;
}
.panel-head i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 12px;
  border-radius: 50%;
  background: #243041;
}
.panel-head i + i { background: #12bf85; }
.chart-card {
  height: 330px;
  padding: 18px 18px 4px;
  background-image: linear-gradient(#eef2f7 1px, transparent 1px), linear-gradient(90deg, #eef2f7 1px, transparent 1px);
  background-size: 64px 42px;
}
.chart-card svg { display: block; width: 100%; height: 100%; }
.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 20px 16px;
  color: #66768a;
  font-size: .75rem;
  font-weight: 500;
}
.chart-tabs {
  display: flex;
  gap: 8px;
  padding: 0 18px 18px;
}
.chart-tabs button:first-child,
.chart-tabs a.is-active { background: #13854f; color: #fff; border-color: #13854f; }
.leaders-panel, .warning-panel, .cash-panel { padding: 18px; }
.leader-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 22px;
  color: #405166;
  border-radius: 8px;
  outline-offset: 4px;
}
.leader-row[data-href]:hover,
.leader-row[data-href]:focus {
  color: #263445;
}
.leader-row[data-href]:hover i,
.leader-row[data-href]:focus i {
  box-shadow: 0 0 0 3px #16c58a1c;
}
.leader-row strong { font-size: .875rem; font-weight: 600; line-height: 1.4; }
.leader-row span { color: #78889b; font-size: .8125rem; font-weight: 600; }
.leader-row small {
  grid-column: 1 / -1;
  color: #7b899b;
  font-size: .75rem;
}
.leader-row i {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16c58a var(--w), #e6ebf1 var(--w));
}
.dashboard-empty {
  margin: 16px 0 0;
  color: #7b899b;
  font-size: .875rem;
}
.warning-panel { border-left: 4px solid #3478ed; }
.warning-panel p { color: #f0a51a; font-weight: 800; }
.warning-panel div {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #edf1f6;
}
.warning-panel span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1355b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.cash-ring {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 24px auto;
  border-radius: 50%;
  background: conic-gradient(#14bf86 0 74%, #e7edf4 74% 100%);
}
.cash-ring span {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  padding: 12px;
  border-radius: 50%;
  background: #fff;
  text-align: center;
  color: #2a3c50;
  font-weight: 900;
}
.cash-panel dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin: 0;
}
.cash-panel dt { color: #65758a; }
.cash-panel dd { margin: 0; font-weight: 850; }
.directory-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.directory-toolbar > span {
  color: #77869a;
  font-size: .875rem;
  font-weight: 600;
}
.directory-search {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.directory-search label {
  display: grid;
  gap: 5px;
  color: #7b8a9a;
  font-size: .75rem;
  font-weight: 600;
}
.directory-search input {
  width: min(420px, 70vw);
  height: 38px;
  margin: 0;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
}
.directory-search button {
  height: 38px;
  border-radius: 8px;
  background: #266bdc;
}
.directory-search a {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
  color: #40536a;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.directory-panel {
  padding: 0;
  overflow: hidden;
}
.directory-table {
  min-width: 980px;
  font-size: .875rem;
}
.directory-table th {
  color: #65758a;
  font-size: .75rem;
  font-weight: 700;
}
.directory-table td {
  color: #34465b;
  vertical-align: middle;
}
.directory-table td strong {
  color: #27374a;
  font-weight: 600;
}
.clickable-row {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.clickable-row:hover,
.clickable-row:focus {
  background: #f3f7fc;
  outline: none;
}
.clickable-row:focus {
  box-shadow: inset 3px 0 0 #266bdc;
}
.object-link {
  color: #23435f;
  text-decoration: none;
  font-weight: 700;
}
.object-link:hover {
  color: #126bd9;
  text-decoration: underline;
}
.object-link.strong {
  color: #243247;
  font-weight: 800;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.detail-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
  color: #32465b;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 800;
  box-shadow: 0 5px 14px #1f2d3d0d;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr);
  gap: 18px;
}
.detail-card {
  padding: 18px;
}
.detail-card h2 {
  margin-bottom: 16px;
}
.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, .45fr) 1fr;
  gap: 10px 16px;
  margin: 0;
}
.detail-list dt {
  color: #78889b;
  font-size: .8125rem;
  font-weight: 700;
}
.detail-list dd {
  margin: 0;
  color: #2d4056;
  font-weight: 700;
}
.detail-list a {
  color: #126bd9;
  text-decoration: none;
}
.detail-wide {
  grid-column: 1 / -1;
}
.invoice-meta {
  margin-bottom: 18px;
}
.report-toolbar {
  align-items: end;
}
.report-stat-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .88fr);
  gap: 18px;
}
.report-panel {
  overflow: hidden;
}
.report-panel .panel-head {
  align-items: center;
}
.report-panel .panel-head span {
  color: #7b8a9a;
  font-weight: 700;
}
.report-table {
  min-width: 760px;
}
.report-table th,
.report-table td {
  white-space: nowrap;
}
.report-table td:nth-child(2) strong {
  white-space: normal;
}
.report-wide {
  grid-column: 1 / -1;
}
.invoice-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.invoice-filter input[name="q"] {
  width: min(300px, 60vw);
}
.invoice-filter a {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #fff;
  color: #40536a;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.invoice-table {
  min-width: 1180px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid #e4eaf1;
  background: #fff;
}
.pagination div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.pagination a {
  min-width: 38px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f9fbfc;
  color: #40536a;
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
}
.pagination a:hover {
  background: #eff7f2;
  border-color: #bdd7c8;
  color: #1f5538;
}
.pagination a.is-current {
  background: #13854f;
  border-color: #13854f;
  color: #fff;
}
.pagination a.is-disabled {
  pointer-events: none;
  opacity: .45;
}
.price-tags-form {
  display: grid;
  gap: 14px;
}
.price-mode-tabs a.is-active {
  background: #13854f;
  border-color: #13854f;
  color: #fff;
}
.price-template-option {
  display: block;
}
.price-template-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.price-template-option:has(input:checked) {
  border-color: #13854f;
  box-shadow: 0 0 0 3px #16c58a1c, 0 12px 28px #1f2d3d0b;
}
.price-print-list {
  overflow: hidden;
}
.price-print-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
}
.price-selected-list {
  display: grid;
  gap: 8px;
}
.price-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 38px;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f9fbfd;
}
.price-selected-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #263445;
}
.price-selected-row span {
  color: #66768a;
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.price-selected-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #7a3f00;
  background: #fff1d5;
  font-style: normal;
  font-size: .75rem;
  font-weight: 800;
}
.price-tags-actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}
.tobacco-template-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid #cad7e3;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 28px 80px #10223645;
}
.tobacco-template-dialog[open] {
  animation: dialog-in .28s var(--ease-spring) both;
}
.tobacco-template-dialog::backdrop {
  background: #17233466;
  backdrop-filter: blur(3px);
}
.tobacco-template-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  color: #263445;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}
.tobacco-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tobacco-template-head strong {
  font-size: 1.05rem;
}
.tobacco-template-card p {
  margin: 0;
  color: #52657b;
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.45;
}
.tobacco-template-note {
  padding: 10px 12px;
  border: 1px solid #dce7f0;
  border-radius: 8px;
  background: #eef6f1;
}
.tobacco-template-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.row-add {
  min-width: 82px;
}
.price-invoice-list {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}
.price-invoice-card {
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
}
.price-invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #edf1f6;
}
.price-invoice-head small {
  display: block;
  margin-top: 4px;
  color: #66768a;
  font-size: .8125rem;
  font-weight: 600;
}
.price-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.price-invoice-products {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}
.price-product-chip {
  display: inline-grid;
  gap: 2px;
  max-width: 320px;
  padding: 7px 10px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #f8fbfc;
  color: #2e4156;
  text-align: left;
  box-shadow: none;
}
.price-product-chip[hidden] {
  display: none !important;
}
.price-product-chip::after {
  content: none;
}
.price-product-chip span {
  color: #728299;
  font-size: .75rem;
}
.price-product-chip.is-price-changed {
  border-color: #f0c36f;
  background: #fff7df;
  color: #5e4314;
  box-shadow: inset 3px 0 0 #e6a817;
}
.price-product-chip.is-price-changed span {
  color: #8a6a22;
}
.price-more {
  align-self: center;
  padding: 7px 10px;
  border: 1px dashed #c8d5e2;
  border-radius: 8px;
  background: #f7fafc;
  color: #728299;
  font-size: .8125rem;
  font-weight: 700;
  box-shadow: none;
}
.price-more:hover {
  border-color: #91b9a1;
  background: #eef7f1;
  color: #1f6d42;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: #65758a;
  font-size: .75rem;
  font-weight: 800;
}
.status-pill.is-posted {
  background: #d8f8ec;
  color: #118a63;
}

.preorder-toolbar {
  align-items: flex-end;
}
.preorder-filter select {
  min-width: 230px;
}
.stepper-field,
.preorder-qty {
  display: inline-grid;
  grid-template-columns: 36px 72px 36px;
  gap: 0;
  align-items: stretch;
}
.stepper-field button,
.preorder-qty button {
  min-height: 38px;
  padding: 0;
  border-radius: 0;
  background: #eef4f1;
  color: #244336;
  box-shadow: none;
}
.stepper-field button:first-child,
.preorder-qty button:first-child {
  border-radius: 8px 0 0 8px;
}
.stepper-field button:last-child,
.preorder-qty button:last-child {
  border-radius: 0 8px 8px 0;
}
.stepper-field input,
.preorder-qty input {
  width: 100%;
  min-height: 38px;
  border-radius: 0;
  text-align: center;
}
.preorder-selected-table .preorder-pack input,
.preorder-selected-table .preorder-qty input {
  border: 1px solid #d8e2dc;
  background: #fbfdfc;
  color: #344961;
  font: inherit;
  font-size: .95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.preorder-selected-table .preorder-pack input:focus,
.preorder-selected-table .preorder-qty input:focus {
  border-color: #8ebda3;
  box-shadow: 0 0 0 3px #3fa96b18;
}
.preorder-selected-table .preorder-qty input {
  border-left: 0;
  border-right: 0;
}
.preorder-app {
  display: grid;
  gap: 14px;
}
.preorder-panel {
  overflow: hidden;
}
.preorder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 14px;
}
.preorder-selected-scroll {
  border-top: 1px solid #e3e8e4;
}
.products-table.preorder-selected-table {
  min-width: 980px;
  table-layout: fixed;
}
.products-table.preorder-selected-table th {
  color: #526579;
  font-size: .82rem;
  font-weight: 850;
  white-space: nowrap;
}
.products-table.preorder-selected-table th:nth-child(1) { width: auto; }
.products-table.preorder-selected-table th:nth-child(2) { width: 145px; text-align: center; }
.products-table.preorder-selected-table th:nth-child(3) { width: 170px; text-align: center; }
.products-table.preorder-selected-table th:nth-child(4) { width: 54px; }
.products-table.preorder-selected-table td {
  padding: 9px 11px;
  vertical-align: middle;
}
.preorder-product-cell strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #263445;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preorder-product-cell small {
  display: block;
  margin-top: 3px;
  color: #66768a;
  font-size: .78rem;
  font-weight: 650;
}
.preorder-pack-cell,
.preorder-qty-cell {
  text-align: center;
}
.preorder-pack-cell,
.preorder-qty-cell,
.preorder-remove-cell {
  vertical-align: middle;
}
.preorder-pack-cell,
.preorder-qty-cell {
  padding-inline: 6px !important;
}
.preorder-pack-cell {
  display: flex;
  justify-content: center;
}
.preorder-qty-cell {
  text-align: center;
}
.preorder-remove-cell {
  text-align: center;
  padding-inline: 8px !important;
}
.preorder-pack {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #6f8095;
  font-size: .74rem;
  font-weight: 800;
}
.preorder-pack span {
  display: none;
}
.preorder-pack input {
  width: 108px;
  min-height: 38px;
  margin-right: 0;
  text-align: center;
}
.preorder-selected-table .preorder-qty {
  margin-inline: auto;
  width: 144px;
}
.preorder-selected-table .line-delete {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.preorder-empty-row td {
  padding: 18px;
  color: #78889a;
  font-weight: 700;
}
.preorder-catalog {
  min-width: 1180px;
}
.preorder-catalog td small {
  display: block;
  margin-top: 3px;
  color: #708198;
  font-size: .75rem;
  font-weight: 650;
}

.uk-datepicker {
  position: absolute;
  z-index: 80;
  width: 268px;
  padding: 12px;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(27, 43, 64, .18);
  color: #203247;
}
.uk-datepicker-head,
.uk-datepicker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.uk-datepicker-head {
  margin-bottom: 10px;
}
.uk-datepicker-head strong {
  flex: 1;
  text-align: center;
  font-size: 14px;
}
.uk-datepicker button {
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}
.uk-datepicker button:hover {
  background: #edf3f9;
}
.uk-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.uk-datepicker-dayname {
  padding: 4px 0;
  text-align: center;
  color: #75869a;
  font-size: 12px;
  font-weight: 800;
}
.uk-datepicker-day {
  aspect-ratio: 1;
  font-size: 13px;
}
.uk-datepicker-day.is-muted {
  color: #9ba8b7;
}
.uk-datepicker-day.is-selected,
.uk-datepicker-day.is-selected:hover {
  background: #1f6fe5;
  color: #fff;
}
.uk-datepicker-foot {
  margin-top: 10px;
}
.uk-datepicker-foot button {
  color: #1267d9;
}
.settings-panel {
  max-width: 860px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  padding: 18px;
}
.settings-grid label {
  display: grid;
  gap: 8px;
  color: #718299;
  font-size: .83rem;
  font-weight: 800;
}
.settings-grid input {
  width: 100%;
  border: 1px solid #d6e0ea;
  border-radius: 9px;
  padding: 11px 12px;
  color: #25364b;
  font: inherit;
  font-weight: 700;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

@media (max-width: 1540px) {
  .admin-layout { grid-template-columns: 248px minmax(0, 1fr); }
  .admin-sidebar {
    gap: 9px;
    padding: 10px 8px;
  }
  .admin-brand {
    grid-template-columns: 54px 1fr;
    gap: 8px;
    min-height: 42px;
    font-size: 14px;
  }
  .admin-brand img {
    width: 54px;
    padding: 4px;
  }
  .admin-nav { gap: 3px; }
  .admin-nav a,
  .admin-nav .is-disabled {
    grid-template-columns: 22px 1fr;
    min-height: 32px;
    padding: 7px 8px;
    font-size: 13px;
  }
  .admin-nav .admin-nav-parent {
    grid-template-columns: 22px 1fr 14px;
    min-height: 40px;
  }
  .admin-nav .admin-nav-parent strong,
  .admin-nav .admin-report-group,
  .admin-nav .admin-report-leaf,
  .admin-nav .admin-sub-link {
    font-size: 13px;
  }
  .admin-report-tree {
    gap: 6px;
    padding: 4px 4px 9px 35px;
  }
  .admin-nav .admin-report-group {
    grid-template-columns: minmax(0, 1fr) 13px;
    min-height: 29px;
  }
  .admin-nav .admin-report-group span { font-size: 14px; }
  .admin-nav .admin-report-leaf {
    min-height: 23px;
    padding-left: 13px;
  }
  .admin-nav .admin-sub-link {
    min-height: 28px;
    padding-left: 23px;
  }
  .admin-topbar {
    gap: 14px;
    padding: 14px 18px 8px;
  }
  .admin-topbar strong { font-size: 1.32rem; }
  .admin-site-link {
    padding: 8px 11px;
    font-size: 13px;
  }
  .admin-content { padding: 8px 18px 36px; }
  .admin-body .card,
  .admin-body .alert {
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
  }
  .admin-body button {
    padding: 8px 12px;
    border-radius: 8px;
  }
  .job-head,
  .section-head,
  .section-actions {
    gap: 12px;
  }
  .job-head h1 { margin-bottom: 4px; font-size: 1.55rem; }
  .job-head p { margin: 0; }
  .images img { height: 180px; }
  .summary {
    grid-template-columns: 165px 1fr;
    gap: 7px 10px;
  }
  th, td { padding: 9px; }
  .products-table {
    min-width: 1180px;
    font-size: 14px;
  }
  .products-table th { font-size: 13px; }
  .products-table td strong { font-size: 15px; }
  .products-table td small { font-size: 12px; }
  .products-table select,
  .products-table button { font-size: 13px; }
  .products-table th:nth-child(1) { width: 34px; }
  .products-table th:nth-child(2) { width: 250px; }
  .products-table th:nth-child(3) { width: 70px; }
  .products-table th:nth-child(4) { width: 94px; }
  .products-table th:nth-child(5) { width: 74px; }
  .products-table th:nth-child(6) { width: 102px; }
  .products-table th:nth-child(7) { width: 100px; }
  .line-numbers-cell { min-width: 440px; }
  .line-number-grid { grid-template-columns: 70px 94px 74px 102px 100px; }
  .arm-match-cell { min-width: 410px; }
  .line-confirm {
    min-width: 410px;
    max-width: 620px;
  }
  .candidate-action-row { grid-template-columns: minmax(260px, 1fr) auto; }
  .line-tools {
    gap: 6px;
    margin-top: 24px;
  }
  .line-tools .confidence,
  .line-tools .line-photo,
  .line-tools .copy-name {
    width: 108px;
    min-height: 28px;
    font-size: 12px;
  }
  .selected-product-details {
    margin-top: 8px;
    padding: 9px 10px;
  }
  .selected-product-details dl {
    gap: 4px 10px;
    font-size: 12px;
  }
  .stat-grid,
  .dashboard-grid,
  .report-grid,
  .detail-grid {
    gap: 12px;
  }
  .stat-grid { margin-bottom: 12px; }
  .metric-card {
    min-height: 92px;
    padding: 12px;
  }
  .metric-card strong {
    margin-bottom: 8px;
    font-size: 1.3rem;
  }
  .dashboard-toolbar { margin-bottom: 12px; }
  .panel-head { padding: 12px 14px; }
  .chart-card { height: 286px; padding: 14px 14px 4px; }
  .leaders-panel,
  .warning-panel,
  .cash-panel { padding: 14px; }
  .directory-table { min-width: 900px; }
  .invoice-table { min-width: 1080px; }
  .report-table { min-width: 700px; }
}

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .period-form { flex-wrap: wrap; }
  .price-print-body { grid-template-columns: 1fr; }
  .price-tags-actions { flex-wrap: wrap; }
  .price-invoice-head { flex-direction: column; }
}
@media (max-width: 760px) {
  .abt-public-header { padding: 18px; }
  .abt-public-logo { width: 132px; }
  .abt-public-header { align-items: flex-start; }
  .abt-login-open { padding: 9px 11px; font-size: 13px; }
  .abt-hero-copy { min-height: calc(100vh - 92px); padding: 24px 18px 48px; }
  .abt-hero-copy h1 { max-width: 520px; font-size: 44px; line-height: 1.04; }
  .abt-lead { font-size: 18px; }
  .abt-hero-copy address { font-size: 16px; }
  .login-panel { padding: 26px 20px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    display: block;
    /* Без min-width:0 елемент гріда не може стиснутись нижче ширини свого
       вмісту, тож overflow-x на меню не спрацьовує і сторінка розповзається
       на всю довжину списку пунктів. */
    min-width: 0;
  }
  .admin-brand { margin-bottom: 10px; }
  .admin-nav {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .admin-nav a,
  .admin-nav .is-disabled {
    grid-template-columns: 20px max-content;
    flex: none;
    white-space: nowrap;
  }
  /* Пункти підменю звітів стають частиною тієї ж горизонтальної стрічки —
     інакше на телефоні вони просто зникали разом із деревом. */
  .admin-report-tree {
    display: contents;
  }
  .admin-nav .admin-report-group {
    flex: none;
    grid-template-columns: max-content;
    min-height: 32px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #26374a;
    white-space: nowrap;
  }
  .admin-nav .admin-report-group span { display: none; }
  .admin-nav .admin-report-group.is-active { background: #34465b; color: #fff; }
  .admin-nav .is-disabled { display: none; }
  .admin-logout { display: none; }
  .admin-topbar, .admin-content { padding-left: 14px; padding-right: 14px; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .admin-topbar strong { font-size: 21px; }
  .stat-grid { grid-template-columns: 1fr; }
  .chart-card { height: 240px; }
  /* Дві колонки по 220px не влазять у телефон — 440px плюс відступи. */
  .settings-grid { grid-template-columns: 1fr; padding: 14px; }
  .settings-actions { padding: 0 14px 14px; }
  .settings-actions button { width: 100%; }
}
