:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2633;
  background: #f3f6fa;
}

body {
  margin: 0;
}

.page {
  max-width: none;
  margin: 0;
  padding: 52px 48px 72px;
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.users-layout { display:grid; grid-template-columns:180px 1fr; gap:24px; align-items:start; }
.users-menu { display:grid; gap:4px; padding:8px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
.users-menu a { padding:9px 10px; border-radius:7px; color:#52606d; text-decoration:none; font-weight:600; }
.users-menu a.active { background:#edf3ff; color:#005bff; }
.create-user-form { display:grid; grid-template-columns:1fr 1.35fr 1fr 130px auto; gap:14px; align-items:end; }
.create-user-form label { display:grid; gap:6px; font-size:13px; font-weight:600; }
.create-user-form input, .create-user-form select { box-sizing:border-box; width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; }
.create-user-form .button { min-height:38px; }
.change-password-form { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; align-items:end; }
.change-password-form label { display:grid; gap:6px; font-size:13px; font-weight:600; }
.change-password-form input { box-sizing:border-box; width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; }
.change-password-form .button { grid-column:1; min-height:38px; }
.profile-card { margin-bottom: 18px; }
.profile-card h2 { margin-top: 0; }
.profile-login { margin: -4px 0 22px; color: #52606d; }
.profile-name-form { display: flex; align-items: end; gap: 14px; max-width: 520px; }
.profile-name-form label { display: grid; flex: 1; gap: 6px; font-size: 13px; font-weight: 600; }
.profile-name-form input { box-sizing: border-box; width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; font: inherit; }
.profile-name-form .button { min-height: 38px; margin: 0; }
.calculation-settings-card { max-width: 700px; }
.calculation-settings-form { display: grid; gap: 20px; margin-top: 22px; }
.calculation-settings-group { padding: 0 0 20px; border-bottom: 1px solid #edf0f4; }
.calculation-settings-group h3 { margin: 0 0 14px; font-size: 17px; }
.calculation-settings-group label { display: grid; gap: 7px; max-width: 280px; color: #344054; font-size: 14px; font-weight: 600; }
.calculation-settings-group input { box-sizing: border-box; min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.calculation-settings-form .button { justify-self: start; margin: 0; }
.work-types-section { margin-top: 26px; border-bottom: 0; }
.work-types-list { display: grid; gap: 6px; margin: 0 0 18px; }
.work-type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 30px; gap: 12px; align-items: center; max-width: 520px; padding: 8px 0; border-bottom: 1px solid #edf0f4; }
.work-type-row strong { text-align: right; }
.work-type-row form { margin: 0; }
.work-type-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(150px, .7fr) auto; gap: 12px; align-items: end; max-width: 650px; }
.work-type-form label { display: grid; gap: 7px; color: #344054; font-size: 14px; font-weight: 600; }
.work-type-form input { box-sizing: border-box; min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.work-type-form .button { min-height: 38px; margin: 0; }
@media (max-width: 900px) { .create-user-form { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .change-password-form { grid-template-columns:1fr; } .change-password-form .button { grid-column:auto; } .profile-name-form { display:grid; } }
@media (max-width: 700px) { .work-type-form { grid-template-columns: 1fr; } }

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

.header-period {
  margin: 0 0 3px;
  color: #687078;
}

.tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin: -10px 0 28px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.warehouse-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.warehouse-tab { display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border:1px solid #d5deea; border-radius:8px; background:#fff; color:#52606d; font-size:14px; font-weight:600; text-decoration:none; }
.warehouse-tab:hover { border-color:#9dbdf5; color:#005bff; }
.warehouse-tab-active { border-color:#005bff; background:#edf3ff; color:#005bff; }
.warehouse-section-header { display:block; }
.warehouse-section-header h2 { margin:0; }
.warehouse-section-actions { display:flex; justify-content:flex-start; margin-top:16px; }
.warehouse-section-header:has(#supply-refresh-form) > h2 { display:inline-block; vertical-align:middle; }
.warehouse-section-header:has(#supply-refresh-form) > .warehouse-section-actions { display:inline-flex; margin:0 0 0 16px; vertical-align:middle; }
.warehouse-documents { margin-top:20px; overflow-x:auto; }
.warehouse-documents table { min-width:720px; }
.operations-log-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.operations-log-heading h2 { margin:0; }
.operations-log-filter { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.operations-log-filter label { margin:0; }
.operations-log-table table { width:100%; min-width:760px; table-layout:fixed; }
.operations-log-table th:nth-child(1), .operations-log-table td:nth-child(1) { width:150px; white-space:nowrap; }
.operations-log-table th:nth-child(2), .operations-log-table td:nth-child(2) { width:235px; }
.operations-log-table th:nth-child(4), .operations-log-table td:nth-child(4) { width:100px; }
.operations-log-table th:nth-child(5), .operations-log-table td:nth-child(5) { width:82px; }
.operations-log-table th:nth-child(3), .operations-log-table td:nth-child(3) { width:auto; }
.audit-details summary { color:#2367d1; cursor:pointer; white-space:nowrap; }
.audit-snapshots { display:grid; grid-template-columns:repeat(2, minmax(280px, 1fr)); gap:12px; margin-top:12px; }
.audit-snapshots section { min-width:0; }
.audit-snapshots h3 { margin:0 0 6px; font-size:14px; }
.audit-snapshots pre { max-height:360px; overflow:auto; margin:0; padding:10px; border:1px solid #dce3ed; border-radius:6px; background:#f7f9fc; font:12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space:pre-wrap; }
@media (max-width: 720px) { .audit-snapshots { grid-template-columns:1fr; } }
.warehouse-empty-text { margin:20px 0 0; color:#667383; }
.production-status { font-weight:700; }
.production-status-success { color:#248235; }
.production-status-failed { color:#c7352b; }
.production-status-changed { color:#9a6700; }
.production-status-waiting { color:#667085; }
.supply-clusters { margin-top:4px; color:#667085; font-size:.88rem; font-weight:500; }
.supply-direction-link { color:#005bff; font-weight:600; text-decoration:none; }
.supply-direction-link:hover { text-decoration:underline; }
.warehouse-documents .supply-documents-table .supply-heading-row td,
.warehouse-documents .supply-documents-table .supply-direction-row:nth-child(even) td { background:#fff; }
.warehouse-documents .supply-documents-table .supply-direction-row:nth-child(odd) td { background:#fafbfd; }
.supply-heading-row td { color:#344054; font-weight:700; }
.supply-directions-body + .supply-directions-body .supply-heading-row td { border-top:4px solid #b9c5d4; }
.supply-document-summary { margin:4px 0 14px; color:#52606d; font-size:.9rem; font-weight:600; }
.supply-archive { margin-top:18px; }
.supply-archive #supply-archive-content { margin-top:12px; }
.supply-document-header { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; margin-bottom:20px; }
.supply-document-field { display:grid; gap:6px; color:#667085; font-size:13px; font-weight:600; }
.supply-document-field strong { min-height:38px; box-sizing:border-box; display:flex; align-items:center; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; background:#f8fafc; color:#1d2633; font-size:15px; }
.supply-document-items { margin-top:20px; overflow-x:auto; }
.supply-document-items table { min-width:0; }
.supply-document-items th:first-child, .supply-document-items td:first-child { width:38%; white-space:normal; }
.supply-document-items th:nth-child(2), .supply-document-items td:nth-child(2), .supply-document-items th:nth-child(3), .supply-document-items td:nth-child(3), .supply-document-items th:nth-child(4), .supply-document-items td:nth-child(4) { width:18%; }
.supply-document-items th:last-child, .supply-document-items td:last-child { width:42px; }
.supply-document-items input[name="required_quantity"] { box-sizing:border-box; width:100%; min-width:0; }
.supply-collected-match { background:#e5f5e8; color:#248235; font-weight:700; }
.supply-collected-excess { background:#fde8e7; color:#b42318; font-weight:700; }
.supply-document-items tbody tr:nth-child(even) td.supply-collected-match { background:#e5f5e8; }
.supply-document-items tbody tr:nth-child(even) td.supply-collected-excess { background:#fde8e7; }
.supply-available-insufficient { background:#fde8e7; color:#b42318; font-weight:700; }
.supply-document-items tbody tr:nth-child(even) td.supply-available-insufficient { background:#fde8e7; }
.receipt-form.supply-direction-form { max-width:none; }
.supply-document-content-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:24px; margin-top:22px; }
.supply-document-content-grid h2 { margin:0; }
.supply-document-boxes { min-height:120px; padding-left:24px; border-left:1px solid #e2e8f0; }
.supply-box-actions { display:flex; flex-wrap:wrap; gap:8px; }
.supply-box-work-cost { margin:14px 0 0; font-weight:700; }
.supply-posted-status { display:inline-block; margin:8px 0 0; padding:6px 9px; border-radius:6px; background:#dff7e7; color:#137333; font-size:14px; font-weight:700; }
.supply-box { margin-top:10px; padding:8px; border:1px solid #e2e8f0; border-radius:8px; }
.supply-box h3 { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 6px; font-size:15px; }
.box-ozon-number { box-sizing:border-box; width:190px; min-height:32px; padding:4px 7px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; font-weight:600; }
.box-ozon-code { display:inline-block; padding:3px 7px; border-radius:3px; background:#000; color:#fff; font:700 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing:.4px; }
.box-ozon-code[hidden] { display:none; }
.box-ozon-duplicate-warning { color:#b42318; font-size:14px; font-weight:700; }
.box-ozon-duplicate-warning[hidden] { display:none; }
.box-header-actions { display:flex; flex-wrap:wrap; gap:8px; }
.box-header-actions .button { margin-top:0; }
.box-delete { margin-top:0; margin-left:auto; }
.box-delete[hidden] { display:none; }
.box-item-quantity-readonly { box-sizing:border-box; display:inline-flex; align-items:center; min-height:32px; padding:4px 6px; font-weight:700; }
.box-export[hidden] { display:none; }
.supply-box table { width:100%; margin-bottom:10px; }
.supply-box td { padding:4px 0; }
.box-items { display:grid; gap:3px; }
.box-item { display:grid; grid-template-columns:minmax(0, 1fr) 72px 34px; gap:10px; align-items:center; padding:3px 0; border-bottom:1px solid #edf0f4; font-size:14px; }
.box-item strong { min-width:0; }
.box-item-quantity { box-sizing:border-box; width:72px; min-height:32px; padding:4px 6px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; }
.box-product-field { position:relative; }
.box-product-field input { box-sizing:border-box; width:100%; min-height:36px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; }
.box-total-weight { margin:2px 0 0; color:#52606d; font-size:14px; }
.box-total-weight.box-total-weight-excess { padding:7px 9px; border-radius:6px; background:#fde8e7; color:#b42318; }
.box-item-missing-warning { margin:10px 0 0; padding:9px 10px; border-radius:6px; background:#fde8e7; color:#b42318; font-size:13px; font-weight:600; }
.supply-document-add-item { margin-top:16px; }
.supply-document-changes { margin-top:18px; }
.supply-document-changes h2 { margin:0; }
.supply-document-changes-list { margin-top:16px; overflow-x:auto; }
.supply-document-changes-list table { min-width:420px; }
.supply-change-negative { color:#c7352b; font-weight:700; }
.supply-change-positive { color:#248235; font-weight:700; }
.supply-product-dialog { width:min(560px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; }
.supply-product-dialog h2 { margin-top:0; }
.supply-product-search-field { position:relative; display:grid; gap:6px; font-size:14px; font-weight:600; }
.supply-product-search-field input { box-sizing:border-box; min-height:38px; width:100%; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; font:inherit; }
.supply-product-search-field .production-search-results { position:static; max-height:min(280px, calc(100dvh - 190px)); margin-top:2px; }
@media (max-width:700px) { .supply-document-header, .supply-document-content-grid { grid-template-columns:1fr; } .supply-document-boxes { min-height:0; padding:20px 0 0; border-top:1px solid #e2e8f0; border-left:0; } }
.production-form { max-width:860px; }
.production-form-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; }
.production-form label { display:flex; flex-direction:column; gap:6px; font-weight:600; color:#3e4a59; }
.production-form input, .production-form select { box-sizing:border-box; width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; background:#fff; font:inherit; }
.production-readonly-field { display:flex; flex-direction:column; gap:6px; color:#3e4a59; font-weight:600; }
.production-readonly-field strong { display:flex; align-items:center; min-height:38px; color:#1d2633; font-weight:500; }
.production-form h2 { margin:28px 0 14px; }
.production-items-header { display:grid; grid-template-columns:minmax(0, 1fr) 150px 155px 34px; gap:12px; margin:0 0 6px; color:#3e4a59; font-size:14px; font-weight:600; }
.production-item { display:grid; grid-template-columns:minmax(0, 1fr) 150px 155px 34px; align-items:start; gap:12px; margin-bottom:12px; }
.production-items-total { display:grid; grid-template-columns:minmax(0, 1fr) 150px 155px 34px; gap:12px; margin-top:-2px; color:#3e4a59; font-size:15px; font-weight:700; }
.production-items-total div { display:flex; align-items:center; min-height:32px; }
.receipt-form { max-width:860px; }
.receipt-items-header, .receipt-item { display:grid; grid-template-columns:minmax(0, 1fr) 150px 155px 34px; gap:12px; }
.receipt-items-header { margin:0 0 6px; color:#3e4a59; font-size:14px; font-weight:600; }
.receipt-item { margin-bottom:12px; }
.receipt-position-field { position:relative; }
.receipt-item select, .receipt-item input { box-sizing:border-box; width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; background:#fff; font:inherit; }
.receipt-search-results { position:absolute; z-index:20; top:100%; right:0; left:0; max-height:260px; overflow:auto; border:1px solid #cbd7e6; border-radius:8px; background:#fff; box-shadow:0 8px 20px rgba(33,45,63,.16); }
.receipt-search-result { display:block; width:100%; padding:9px 11px; border:0; border-bottom:1px solid #e7edf5; background:#fff; text-align:left; cursor:pointer; }
.receipt-search-result:hover { background:#edf3ff; }
.receipt-add-line { margin-top:2px; }
.receipt-product-mode .receipt-items-header,
.receipt-product-mode .receipt-item { grid-template-columns:minmax(0, 1fr) 150px 34px; }
.receipt-product-mode .receipt-items-header span:nth-child(3),
.receipt-product-mode .receipt-item input[name="unit_cost"] { display:none; }
.production-work-cost { display:flex; align-items:center; min-height:38px; color:#3e4a59; font-size:14px; font-weight:600; }
.production-work-cost strong { display:flex; align-items:center; min-height:38px; color:#52606d; font-size:16px; font-weight:600; }
.production-product-field { position:relative; }
.production-product-card-link { display:flex; align-items:center; min-height:38px; color:#005bff; font-weight:600; text-decoration:none; }
.production-product-card-link:hover { text-decoration:underline; }
.production-search-results { position:absolute; z-index:20; top:100%; right:0; left:0; max-height:280px; overflow-y:auto; border:1px solid #cbd7e6; border-radius:8px; background:#fff; box-shadow:0 8px 20px rgba(33, 45, 63, .16); }
.production-search-result { display:flex; flex-direction:column; width:100%; padding:9px 11px; border:0; border-bottom:1px solid #e7edf5; background:#fff; color:#1d2633; text-align:left; cursor:pointer; }
.production-search-result:last-child { border-bottom:0; }
.production-search-result:hover { background:#edf3ff; }
.production-search-result.is-selected { background:#dceaff; }
.production-search-result span { margin-top:3px; color:#677586; font-size:12px; }
.production-scan-error { display:block; margin-top:5px; color:#c7352b; font-size:12px; font-weight:500; line-height:1.3; }
.production-remove-item { width:34px; height:34px; padding:0; font-size:22px; line-height:1; }
.production-remove-item[hidden] { display:none; }
.production-form input[name="quantity"] { appearance:textfield; -moz-appearance:textfield; }
.production-form input[name="quantity"]::-webkit-outer-spin-button,
.production-form input[name="quantity"]::-webkit-inner-spin-button { margin:0; -webkit-appearance:none; }
.production-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.production-delete-document { margin-right:auto; color:#b42318; }
.production-delete-document:hover { border-color:#d84343; color:#b42318; background:#fff4f3; }
.production-material-check { max-width:860px; margin-top:18px; }
.production-material-check h2 { margin-top:0; }
.production-material-check p { color:#52606d; }
.production-post-success { margin:0 0 18px; padding:12px 16px; border-radius:8px; background:#e5f5e8; color:#248235; font-size:18px; font-weight:700; }
.production-post-success span { font-size:14px; font-weight:600; }
.production-post-error { margin:0 0 18px; padding:12px 16px; border-radius:8px; background:#fde8e7; color:#b42318; font-size:18px; font-weight:700; }
.production-material-check-ok { border-left:4px solid #29843a; }
.production-material-check-error { border-left:4px solid #cf3c32; }
@media (max-width:700px) { .production-form-grid { grid-template-columns:1fr; } .production-items-header, .production-item, .production-items-total { grid-template-columns:minmax(0, 1fr) 110px 125px 34px; } .receipt-items-header, .receipt-item { grid-template-columns:minmax(0, 1fr) 105px 115px 34px; } }

.tab {
  padding: 9px 13px;
  border-radius: 7px;
  color: #687078;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.tab:hover {
  color: #005bff;
}

.tab-active {
  background: #edf3ff;
  color: #005bff;
}

.rnp-product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 20px;
}

.unit-view-tabs {
  margin: -12px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d9e1eb;
}

.unit-type-tabs {
  margin: 0 0 20px;
}

.unit-calculation-intro {
  max-width: 720px;
}

.unit-calculation-intro p {
  line-height: 1.5;
}

.unit-calculation-intro .unit-calculation-in-progress {
  color: #b42318;
}

.card.unit-calculation-intro {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
}

.unit-calculation-table-wrap {
  margin: 0;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.unit-calculation-table {
  width: max-content;
  min-width: 1428px;
}

/* The calculation has many columns, so reserve a consistent two-line header
   and keep the product name readable instead of squeezing it like a metric. */
.unit-calculation-table th {
  height: 44px;
  width: 58px;
  min-width: 58px;
  white-space: normal;
  line-height: 1.2;
  vertical-align: middle;
}

.unit-calculation-table th:first-child,
.unit-calculation-table td:first-child {
  width: 210px;
  min-width: 210px;
  white-space: normal;
}

.unit-calculation-table th:not(:first-child),
.unit-calculation-table td:not(:first-child) {
  width: 58px;
  min-width: 58px;
}

.unit-calculation-table th,
.unit-calculation-table td {
  padding: 6px 5px;
}

.unit-calculation-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.calculation-auto-form {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calculation-auto-form input {
  box-sizing: border-box;
  width: 64px;
  min-height: 28px;
  padding: 4px 5px;
  border: 1px solid #cfd7e2;
  border-radius: 6px;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calculation-auto-form input:focus {
  outline: none;
}

.calculation-auto-form input.calculation-input-pending {
  border-color: #005bff !important;
  box-shadow: 0 0 0 2px rgba(0, 91, 255, 0.12) !important;
}

.calculation-auto-form input.calculation-input-saved {
  border-color: #2d9a55 !important;
  box-shadow: 0 0 0 2px rgba(45, 154, 85, 0.12) !important;
}

.calculation-auto-form input.calculation-input-error {
  border-color: #d84343 !important;
  box-shadow: 0 0 0 2px rgba(216, 67, 67, 0.12) !important;
}

.calculation-reset-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 1px solid #75b98b;
  border-radius: 6px;
  background: #f2fbf4;
  color: #138a4b;
  font: 700 16px/1 sans-serif;
  cursor: pointer;
}

.calculation-reset-button:hover {
  border-color: #138a4b;
  background: #e3f6e8;
  color: #0b6d39;
}

.calculation-reset-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.unit-calculation-table td.calculation-readonly {
  color: #788391;
}

.unit-calculation-table td.calculation-result-positive {
  background: #e8f6eb;
  color: #176b36;
}

.unit-calculation-table td.calculation-result-negative {
  background: #fde9e7;
  color: #b42318;
}

.unit-calculation-table td.calculation-result-warning {
  background: #fff7d6;
  color: #8a5a00;
}

.calculation-source {
  margin: 5px 0 0;
}

.rnp-product-tab {
  padding: 8px 12px;
  border: 1px solid #d9e1eb;
  border-radius: 8px;
  background: #fff;
  color: #52606d;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.rnp-product-tab:hover {
  border-color: #005bff;
  color: #005bff;
}

.rnp-product-tab-active {
  border-color: #005bff;
  background: #edf3ff;
  color: #005bff;
}

.card {
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgb(37 55 78 / 7%);
  padding: 30px;
}

.table-card {
  padding: 0;
}

.rnp-date-navigation {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 10px;
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
}

.rnp-date-navigation .icon-button:disabled {
  cursor: default;
  opacity: 0.35;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f4;
  white-space: nowrap;
}

th:not(:first-child),
td:not(:first-child) {
  border-left: 1px solid #edf0f4;
}

tbody tr.product-start:not(:first-child) {
  border-top: 3px solid #cfd7e2;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  color: #687078;
  font-size: 12px;
  font-weight: 600;
}

/* Unit-economics headers are intentionally compact: wrap only between words
   so the table needs less horizontal space without breaking abbreviations. */
.unit-table-card th {
  white-space: normal;
  line-height: 1.2;
}

/* Give the product name enough room and make numeric columns deliberately
   compact. With a fixed-layout table the remaining columns share the space. */
.unit-table-card th,
.unit-table-card td {
  padding: 6px 5px;
}

.unit-table-card th:first-child,
.unit-table-card td:first-child {
  width: 210px;
  white-space: normal;
}

td {
  font-size: 13px;
  font-weight: 600;
}

.metric-value {
  position: relative;
}

.metric-value.has-trend {
  padding-left: 23px;
}

.trend-arrow {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.trend-positive { color: #16833d; }
.trend-negative { color: #d84343; }

/* A nearly white stripe makes it easier to follow one metric across dates. */
tbody tr:nth-child(even) td {
  background: #fafbfd;
}

.unit-table-card td.unit-price-positive,
.unit-table-card td.unit-profit-positive {
  background: #e8f6eb;
  color: #176b36;
}

.unit-table-card td.unit-profit-negative {
  background: #fde9e7;
  color: #b42318;
}

tbody tr td.position-green { background: #e8f6eb; }
tbody tr td.position-olive { background: #f1f5dd; }
tbody tr td.position-yellow { background: #fff7d9; }
tbody tr td.position-orange { background: #fff0df; }
tbody tr td.position-red { background: #fde9e7; }
tbody tr td.position-burgundy { background: #f5e4e8; }

.product-name {
  white-space: normal;
}

.product-column { width: 180px; }
.metric-column { width: 215px; }

/* Keep the product identity and the final calculation visible while the
   intermediate costs are viewed with the horizontal scrollbar. */
.unit-calculation-table th:first-child,
.unit-calculation-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 2px 0 3px rgba(29, 42, 58, 0.08);
}

.unit-calculation-table thead th:first-child {
  top: 0;
  z-index: 5;
}

.unit-calculation-table th:nth-last-child(-n + 4) {
  position: sticky;
  z-index: 4;
  background: #fff;
}

.unit-calculation-table td:nth-last-child(-n + 4) {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.unit-calculation-table th:nth-last-child(4),
.unit-calculation-table td:nth-last-child(4) {
  right: 174px;
  box-shadow: -2px 0 3px rgba(29, 42, 58, 0.10);
}
.unit-calculation-table th:nth-last-child(3),
.unit-calculation-table td:nth-last-child(3) { right: 116px; }
.unit-calculation-table th:nth-last-child(2),
.unit-calculation-table td:nth-last-child(2) { right: 58px; }
.unit-calculation-table th:last-child,
.unit-calculation-table td:last-child { right: 0; }

.unit-calculation-table tbody tr:nth-child(even) td:first-child,
.unit-calculation-table tbody tr:nth-child(even) td:nth-last-child(-n + 4) {
  background: #fafbfd;
}

.unit-calculation-table tbody td:nth-last-child(-n + 4).calculation-result-positive { background: #e8f6eb !important; }
.unit-calculation-table tbody td:nth-last-child(-n + 4).calculation-result-negative { background: #fde9e7 !important; }

.inventory-form td.inventory-change-positive {
  background: #e8f6eb;
  color: #176b36;
}

.inventory-form td.inventory-change-negative {
  background: #fde9e7;
  color: #b42318;
}
.unit-calculation-table tbody td:nth-last-child(-n + 4).calculation-result-warning { background: #fff7d6 !important; }
.product-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.product-details-content { width: 100%; }
.product-image {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: contain;
}
.product-image-placeholder {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: #f2f4f7;
  color: #9aa5b1;
}
.metric-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  white-space: normal;
  line-height: 1.15;
}

.metric-cell > span { min-width: 0; }
.metric-cell .chart-button { flex: 0 0 auto; }

/* RNP has many metrics for one product; keep its rows as compact as the
   factual unit-economics table without affecting the other tables. */
.rnp-table-card th,
.rnp-table-card td { padding: 4px 6px; }
.rnp-table-card .chart-button { width: 22px; height: 22px; font-size: 15px; }
.rnp-table-card .metric-value.has-trend { padding-left: 21px; }
.rnp-table-card .trend-arrow { top: 3px; left: 5px; }

.product-controls { display: flex; gap: 4px; margin-bottom: 6px; }
.product-controls form { margin: 0; }
.product-title { display: block; }
.icon-button { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #dbe3ed; border-radius: 6px; background: #fff; color: #52606d; cursor: pointer; font: 700 18px/1 sans-serif; }
.product-controls .icon-button { width: 26px; height: 26px; }
.chart-button { width: 24px; height: 24px; border-radius: 5px; font-size: 16px; }
.settings-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-color: #dbe3ed;
  border-radius: 10px;
  background: #fff;
  color: #1d2633;
}

.settings-button svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.3;
}
.import-link { align-self: center; text-decoration: none; }
.narrow-page { max-width: 860px; }
.import-card { max-width: 760px; }
.import-form { display: grid; gap: 16px; margin-top: 20px; }
.import-form label { display: grid; gap: 7px; max-width: 440px; color: #344054; font-weight: 600; }
.import-form input { min-height: 38px; }
.import-message { padding: 12px 14px; border-radius: 8px; }
.import-message.success { background: #eaf8ef; color: #176b37; }
.import-message.error { background: #fff0f0; color: #ae2d2d; }
.import-message.warning { background: #fff7dd; color: #805d00; }
.product-link { color: #005bff; text-decoration: none; }
.product-link:hover { text-decoration: underline; }
.back-link { display: inline-block; margin: 4px 0 18px; padding: 5px 0; color: #005bff; font-size: 18px; font-weight: 600; text-decoration: none; }
.product-card-overview { display: flex; align-items: center; gap: 20px; }
.product-card-overview h2 { margin: 0 0 8px; }

.product-list-entry {
  display: flex;
  align-items: center;
  gap: 20px;
}

.product-list-entry h2 { margin: 0 0 8px; }

.product-display-name-card { margin-bottom: 20px; }
.product-display-name-card h2 { margin-top: 0; }
.product-display-name-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.product-display-name-form label { display: grid; flex: 1 1 420px; gap: 7px; color: #344054; font-size: 14px; font-weight: 600; }
.product-display-name-form input { box-sizing: border-box; min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.product-display-name-form .button { min-height: 38px; margin: 0; }
.product-settings-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.product-settings-form > label { display: grid; flex: 1 1 260px; gap: 7px; color: #344054; font-size: 14px; font-weight: 600; }
.product-settings-form > label:first-child { flex-basis: 420px; }
.product-settings-form input[type="text"], .product-settings-form > label input { box-sizing: border-box; min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.product-settings-form select { min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.product-settings-form fieldset { display: flex; flex: 1 1 260px; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 38px; margin: 0; padding: 0; border: 0; }
.product-settings-form legend { width: 100%; margin-bottom: 5px; color: #344054; font-size: 14px; font-weight: 600; }
.product-settings-form fieldset label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; cursor: pointer; }
.product-settings-form input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #005bff; }
.product-settings-form .button { min-height: 38px; margin: 0; }
.product-settings-facts { margin-bottom: 0; }
.material-settings-form { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:18px 22px; align-items:start; }
.material-settings-form > label, .material-settings-form fieldset { display:grid; gap:7px; min-width:0; color:#344054; font-size:14px; font-weight:600; }
.material-settings-form input[type="text"], .material-settings-form > label input { box-sizing:border-box; width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7e2; border-radius:6px; background:#fff; font:inherit; }
.material-settings-form fieldset { margin:0; padding:0; border:0; }
.material-settings-form legend { margin:0 0 7px; padding:0; }
.material-settings-form fieldset > label:first-of-type { display:flex; align-items:center; gap:6px; min-height:20px; }
.material-settings-form fieldset > label:last-of-type { display:grid; gap:7px; }
.material-settings-form input[type="checkbox"] { width:16px; height:16px; margin:0; accent-color:#005bff; }
.material-settings-form .button { grid-column:1 / -1; justify-self:start; min-height:38px; margin:0; }
.material-settings-readonly { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:18px 22px; margin:0; }
.material-settings-readonly div { min-width:0; }
.material-settings-readonly dt { margin-bottom:6px; color:#667085; font-size:14px; font-weight:600; }
.material-settings-readonly dd { margin:0; overflow-wrap:anywhere; }
@media (max-width: 700px) { .material-settings-form, .material-settings-readonly { grid-template-columns:1fr; } }

.products-period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: end;
  gap: 8px;
}
.products-header-actions { display: flex; flex-wrap: wrap; align-items: end; justify-content: end; gap: 10px; }
.planning-cards { display:grid; grid-template-columns:minmax(620px, 760px) minmax(300px, 1fr); gap:24px; align-items:start; margin-top:20px; }
.packing-card { margin:0; max-width:none; }
.packing-card h2 { margin: 0; font-size: 20px; }
.purchase-card h2 { margin:0; font-size:20px; }
.planning-title { display:flex; align-items:center; gap:12px; }
.planning-title .button { min-height:34px; margin:0; white-space:nowrap; }
.purchase-card .dialog-hint { margin:0; }
.purchase-card .dialog-hint { margin-top:12px; }
.purchase-table th:not(:first-child), .purchase-table td:not(:first-child) { width:120px; text-align:right; }
.purchase-table tbody tr.purchase-row-odd td { background:#fff; }
.purchase-table tbody tr.purchase-row-even td { background:#fafbfd; }
.supply-forecast-card { margin-top:24px; }
.supply-forecast-form { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:16px 0; }
.supply-forecast-form label { display:grid; gap:5px; color:#52606d; font-size:13px; font-weight:600; }
.supply-forecast-form select, .supply-forecast-form input { box-sizing:border-box; min-height:36px; padding:6px 8px; border:1px solid #cfd7e2; border-radius:6px; background:#fff; font:inherit; }
.supply-forecast-form input { width:104px; }
.supply-forecast-days { width:146px; }
.supply-forecast-days input { width:64px; }
.supply-forecast-days > span { display:flex; align-items:center; gap:7px; min-height:36px; color:#52606d; font-size:14px; }
.supply-forecast-form .button { min-height:36px; margin:0; }
.supply-forecast-priorities { display:grid; gap:5px; margin:0; padding:0; border:0; }
.supply-forecast-priorities legend { margin:0; color:#52606d; font-size:13px; font-weight:600; }
.supply-forecast-priorities > div { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; min-height:36px; }
.supply-forecast-priorities label { display:inline-flex; align-items:center; gap:5px; color:#344054; font-size:14px; font-weight:600; cursor:pointer; }
.supply-forecast-priorities input { width:16px; min-height:auto; margin:0; accent-color:#005bff; }
.supply-forecast-table-scroll { max-width:100%; overflow-x:auto; }
.supply-forecast-table { width:1017px; table-layout:fixed; margin-left:0; }
.supply-forecast-table th, .supply-forecast-table td { box-sizing:border-box; }
.supply-forecast-table th:first-child, .supply-forecast-table td:first-child { width:267px; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.supply-forecast-table th:not(:first-child) { text-align:right; white-space:nowrap; }
.supply-forecast-table th:nth-child(2), .supply-forecast-table th:nth-child(3) { width:120px; }
.supply-forecast-table th:nth-child(4) { width:110px; }
.supply-forecast-table th:nth-child(5), .supply-forecast-table th:nth-child(7) { width:135px; }
.supply-forecast-table th:nth-child(6) { width:130px; }
.supply-forecast-table td:not(:first-child) { text-align:right; white-space:nowrap; }
.supply-forecast-table td.supply-coverage-low { background:#fde8e7; color:#b42318; }
.supply-forecast-table td.supply-coverage-medium { background:#fff3cf; color:#8a5a00; }
.supply-forecast-table td.supply-coverage-high { background:#e5f5e8; color:#216e39; }
.supply-forecast-table th.supply-forecast-sortable { position:relative; padding-right:20px; color:#005bff; cursor:pointer; user-select:none; }
.supply-forecast-table th.supply-forecast-sortable::after { content:''; position:absolute; top:50%; right:7px; width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; transform:translateY(-50%); }
.supply-forecast-table th.supply-forecast-sortable[data-sort-direction="desc"]::after { border-top:6px solid currentColor; }
.supply-forecast-table th.supply-forecast-sortable[data-sort-direction="asc"]::after { border-bottom:6px solid currentColor; }
.packing-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.packing-heading form { margin:0; }
.packing-heading .button { min-height:34px; margin:0; }
.packing-refresh-countdown { color:#667085; font-size:14px; white-space:nowrap; }
.packing-refresh-result { margin:12px 0 0; color:#216e39; font-size:14px; font-weight:600; }
.packing-refresh-result-error { color:#c62828; }
.packing-warehouses { display:flex; flex-wrap:wrap; gap:8px 16px; margin:0 0 12px; }
.packing-warehouses label { display:inline-flex; align-items:center; gap:7px; color:#1d2633; font-size:14px; font-weight:600; cursor:pointer; }
.packing-warehouses input { width:16px; height:16px; margin:0; accent-color:#005bff; }
.packing-card .dialog-hint { margin: 0; }
.packing-supplies { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.packing-supplies label { display: inline-flex; align-items: center; gap: 7px; color: #1d2633; font-size: 14px; font-weight: 600; cursor: pointer; }
.packing-supplies input { width: 16px; height: 16px; margin: 0; accent-color: #005bff; }
.packing-empty { margin-top: 12px !important; }
.packing-table { table-layout: auto; }
.packing-table th:not(:first-child), .packing-table td:not(:first-child) { width: 150px; text-align: right; }
.products-header-actions > .button { min-height: 36px; margin: 0; }
.one-c-import-dialog { width: min(560px, calc(100% - 36px)); }
.one-c-import-dialog p { line-height: 1.5; }

.products-period-form label {
  display: grid;
  gap: 5px;
  color: #52606d;
  font-size: 13px;
  font-weight: 600;
}

.products-period-form select,
.products-period-form input {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #cfd7e2;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.products-period-form .button { min-height: 36px; margin: 0; }
.products-custom-date.is-hidden { display: none; }
.earnings-period-form { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin-top:16px; }
.earnings-period-form label { display:grid; gap:5px; color:#52606d; font-size:13px; font-weight:600; }
.earnings-period-form select, .earnings-period-form input { min-height:36px; padding:6px 8px; border:1px solid #cfd7e2; border-radius:6px; background:#fff; font:inherit; }
.earnings-period-form .button { min-height:36px; margin:0; }
.earnings-custom-date.is-hidden { display:none; }
.products-period-text { margin: -14px 0 14px; color: #687078; font-size: 14px; }
.products-sync-status { margin: 16px 0 0; padding: 18px 20px; }
.products-sync-status h2 { margin: 0 0 4px; font-size: 18px; }
.products-sync-status .dialog-hint { margin: 0; }
.products-sync-list { display: grid; gap: 7px; margin-top: 14px; }
.products-sync-row { display: grid; grid-template-columns: minmax(230px, 1.25fr) minmax(190px, 1fr) minmax(250px, 1.3fr); gap: 10px; align-items: center; color: #687078; font-size: 14px; }
.products-sync-label { color: #1d2633; font-weight: 700; }
@media (max-width: 760px) { .products-sync-row { grid-template-columns: 1fr; gap: 2px; } }
.products-table-card {
  --products-group-header-height: 32px;
  max-height: calc(100vh - 250px);
  overflow: auto;
}
.products-table-card table { min-width: max(100%, calc(320px + var(--product-metric-count) * 92px)); }
.products-table-card thead tr:first-child th:first-child, .products-table-card tbody td:first-child { width: 256px; }
.products-name-header { display: grid; gap: 6px; color: inherit; }
.products-name-header input { box-sizing: border-box; width: 100%; min-height: 28px; padding: 5px 8px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; color: #1d2633; font: 400 12px/1.2 inherit; }
.products-name-header input:focus { outline: 2px solid #b7d0ff; border-color: #005bff; }
.materials-name-header { display: grid; gap: 6px; color: inherit; }
.materials-name-header input { box-sizing: border-box; width: 100%; min-height: 28px; padding: 5px 8px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; color: #1d2633; font: 400 12px/1.2 inherit; }
.materials-name-header input:focus { outline: 2px solid #b7d0ff; border-color: #005bff; }
.materials-table-card th.materials-sortable { color: #005bff; cursor: pointer; user-select: none; }
.products-table-card thead tr:first-child th:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
}
.products-table-card tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 2px 0 4px rgba(31, 47, 70, 0.08);
}
.products-table-card tbody tr:nth-child(even) td:first-child { background: #fafbfd; }
.products-table-card tfoot td { position: sticky; bottom: 0; z-index: 3; background: #eef3fb; font-weight: 700; border-top: 2px solid #cfd7e2; }
.products-table-card tfoot td:first-child { left: 0; z-index: 5; box-shadow: 2px 0 4px rgba(31, 47, 70, .08); }
.materials-table-card tfoot td { position:sticky; bottom:0; z-index:3; background:#eef3fb; font-weight:700; border-top:2px solid #cfd7e2; }
.materials-table-card tfoot td:first-child { left:0; z-index:5; box-shadow:2px 0 4px rgba(31, 47, 70, .08); }
.products-table-card tfoot .info-tooltip-text { top: auto; bottom: 21px; }
.products-table-card .products-group-start { border-left: 3px solid #cfd7e2; }
.products-table-card thead tr:nth-child(2) th,
.products-table-card thead th[rowspan="2"] { box-shadow: inset 0 -3px 0 #cfd7e2; }
.products-table-card td.product-profit-positive { background: #e8f6eb; color: #176b36; }
.products-table-card td.product-profit-negative,
.products-table-card td.product-expense-alert,
.products-table-card td.product-cost-missing { background: #fde9e7; color: #b42318; }
.products-table-card th { padding: 10px 8px; white-space: normal; line-height: 1.25; vertical-align: top; }
.products-table-card th.products-sortable { color: #005bff; cursor: pointer; user-select: none; }
.products-table-card th.products-sortable:hover { color: #005bff; }
.products-table-card th:not(:first-child), .products-table-card td:not(:first-child) { padding-left: 9px; padding-right: 9px; }
.products-table-groups th { position: sticky; top: 0; z-index: 4; padding: 7px 8px; text-align: center; vertical-align: middle; font-size: 13px; }
.products-table-groups th:first-child { text-align: left; }
.products-table-card thead tr:nth-child(2) th { top: calc(var(--products-group-header-height) - 3px); z-index: 3; }
.products-table-groups .info-tooltip { z-index: 3; }
.products-table-groups .info-tooltip-text { top: 21px; bottom: auto; }
.products-info-popover { position: fixed; z-index: 1000; display: none; width: min(280px, calc(100vw - 24px)); padding: 8px 10px; border-radius: 7px; background: #1d2633; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.35; text-align: left; pointer-events: none; }
.products-metric-groups { display: grid; gap: 12px; margin: 18px 0; }
.products-metric-group { margin: 0; padding: 11px 14px 13px; border: 1px solid #d9e1eb; border-radius: 9px; }
.products-metric-group legend { padding: 0 5px; font-weight: 700; }
.products-group-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.products-group-toggle input { width: 17px; height: 17px; margin: 0; }
.products-metric-options { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 6px; }
.products-metric-options label { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.products-metric-options input { width: 16px; height: 16px; margin: 0; }
.products-metrics-dialog .products-group-toggle,
.products-metrics-dialog .products-metric-options label { justify-content: flex-start; white-space: nowrap; }
.products-metrics-dialog .products-group-toggle input,
.products-metrics-dialog .products-metric-options input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; }
.products-info-popover.is-visible { display: block; }

.stock-header { position: relative; display: block; padding-right: 18px; }
.info-tooltip { position: absolute; top: -3px; right: 0; display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1px solid #8693a3; border-radius: 50%; color: #52606d; font-size: 10px; font-style: normal; line-height: 1; cursor: help; }
.info-tooltip-text { position: absolute; z-index: 10; top: 21px; right: 0; display: none; width: 180px; padding: 8px 10px; border-radius: 7px; background: #1d2633; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.35; text-align: left; white-space: normal; }
.info-tooltip:hover .info-tooltip-text, .info-tooltip:focus .info-tooltip-text { display: block; }
.product-card-overview p { margin: 0; }
.product-card-image { width: 112px; height: 112px; flex: 0 0 auto; border-radius: 12px; object-fit: contain; }
.product-priority-form { display: flex; align-items: end; gap: 10px; margin-top: 14px; }
.product-priority-form label { display: grid; gap: 5px; color: #52606d; font-size: 13px; font-weight: 600; }
.product-priority-form select { min-height: 34px; padding: 6px 8px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.product-priority-form .button { min-height: 34px; margin: 0; }
.product-warehouses-form { display: flex; align-items: end; gap: 10px; margin-top: 14px; }
.product-warehouses-form fieldset { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0; padding: 0; border: 0; }
.product-warehouses-form legend { width: 100%; margin-bottom: 5px; color: #52606d; font-size: 13px; font-weight: 600; }
.product-warehouses-form label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; cursor: pointer; }
.product-warehouses-form input { width: 16px; height: 16px; margin: 0; accent-color: #005bff; }
.product-warehouses-form .button { min-height: 34px; margin: 0; }
.product-priority-text { margin: 14px 0 0; color: #344054; }
.product-type { margin-top: 10px !important; color: #52606d; font-weight: 600; }
.product-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.product-card-grid .card { padding: 22px; }
.product-card-grid h2 { margin-top: 0; font-size: 19px; }
.product-facts { display: grid; gap: 12px; margin: 0; }
.product-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.product-facts dt { color: #687078; }
.product-facts dd { margin: 0; font-weight: 700; text-align: right; }
.unit-settings-form { display: grid; gap: 12px; }
.unit-settings-form label { display: grid; gap: 7px; color: #344054; font-size: 14px; font-weight: 600; }
.optional-label { color: #687078; font-weight: 500; }
.unit-settings-form input, .unit-settings-form select { box-sizing: border-box; min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font: inherit; }
.unit-settings-form .button { justify-self: start; margin-top: 0; }
.calculated-fact { margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf0f4; }
.product-facts .final-cost { margin-top: 6px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.product-facts .final-cost dt, .product-facts .final-cost dd { color: #1d2633; font-size: 15px; font-weight: 800; }
.icon-button:hover { border-color: #005bff; color: #005bff; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.delete-button:hover { border-color: #d84343; color: #d84343; }
.chart-dialog { width: min(760px, calc(100% - 36px)); }
.chart-dialog canvas { max-height: 420px; margin: 18px 0; }
.chart-comparison-control { display: inline-flex; align-items: center; gap: 8px; margin: 0 14px 0 0; color: #344054; font-size: 14px; font-weight: 600; }
.chart-comparison-control select { min-height: 34px; max-width: min(310px, 100%); padding: 5px 8px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; color: #1d2633; font: inherit; }

tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(500px, 1.7fr);
  gap: 24px;
  align-items: stretch;
}

.summary-card {
  display: flex;
  min-height: 350px;
  flex-direction: column;
}

.summary-metrics { display: grid; gap: 22px; }
.summary-metric { display: grid; gap: 8px; }
.summary-metric-units { padding-top: 20px; border-top: 1px solid #edf0f4; }

.label, .period {
  color: #687078;
}

.label {
  margin: 0;
  font-size: 18px;
}

.total {
  margin: 2px 0 0;
  font-size: clamp(36px, 3.5vw, 50px);
  font-weight: 700;
  letter-spacing: -0.04em;
  word-spacing: 0.14em;
  white-space: nowrap;
}

.quantity-total {
  margin: 0;
  color: #1d2633;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.delivered-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: #687078;
  font-size: 14px;
}

.delivered-summary strong {
  color: #1d2633;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.summary-details {
  display: grid;
  gap: 4px;
  margin-top: auto;
  margin-bottom: 10px;
  padding-top: 22px;
  border-top: 1px solid #edf0f4;
  font-size: 14px;
}

.quantity-total small,
.delivered-summary small {
  color: #687078;
  font-size: 14px;
  font-weight: 500;
}

.summary-details span {
  color: #687078;
}

.button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #005bff;
  color: white;
  text-decoration: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.button-secondary { background: #e7ecf3; color: #1d2633; }
.dialog { width: min(420px, calc(100% - 36px)); border: 0; border-radius: 16px; padding: 28px; }
.dialog::backdrop { background: rgb(29 38 51 / 45%); }
.dialog h2 { margin-top: 0; font-size: 20px; }
.dialog-error { color: #d84343; }
.dialog-hint { color: #687078; font-size: 14px; }
.dialog input { box-sizing: border-box; width: 100%; padding: 11px; border: 1px solid #cfd7e2; border-radius: 8px; font: inherit; }
.dialog-actions { display: flex; gap: 10px; }
.material-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.material-card-title-row h2 { margin: 18px 0; }
.product-search-results { display: grid; gap: 10px; margin-top: 18px; }
.product-search-results .dialog-hint { margin: 0; }
.product-search-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0f4; }
.product-search-result strong, .product-search-result small { display: block; }
.product-search-result strong { font-size: 14px; }
.product-search-result small, .product-already-added { margin-top: 3px; color: #687078; font-size: 12px; }
.product-search-result .button { flex: 0 0 auto; margin: 0; padding: 8px 12px; }
.product-suggestions { display: grid; max-height: 270px; margin-top: 10px; overflow-y: auto; border: 1px solid #d9e1eb; border-radius: 8px; background: #fff; }
.product-suggestion { display: grid; gap: 3px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; color: #1d2633; font: inherit; text-align: left; cursor: pointer; }
.product-suggestion:last-child { border-bottom: 0; }
.product-suggestion:hover { background: #edf3ff; }
.product-suggestion strong, .product-suggestion small { display: block; }
.product-suggestion strong { font-size: 14px; }
.product-suggestion small { color: #687078; font-size: 12px; }
.metric-options { display: grid; gap: 10px; margin: 18px 0 6px; }
.metric-options label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.metric-options input { width: auto; accent-color: #005bff; }

.chart-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chart-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.chart-card h2 {
  margin: 6px 0 0;
  font-size: 20px;
}

.chart-unit {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #edf3ff;
  color: #005bff;
  font-weight: 700;
}

.chart-area {
  position: relative;
  min-height: 270px;
  flex: 1;
  margin-top: 24px;
}

.updated-at {
  margin: 12px 0 0;
  color: #687078;
  font-size: 14px;
}

.rnp-sync-status {
  display: grid;
  gap: 6px;
  margin: 14px 0 12px;
  color: #687078;
  font-size: 14px;
}

.unit-sync-status {
  display: grid;
  gap: 6px;
  margin: 14px 0 12px;
  color: #687078;
  font-size: 14px;
}

.unit-sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.unit-sync-label {
  color: #1d2633;
  font-weight: 700;
}

.rnp-sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rnp-sync-label {
  color: #1d2633;
  font-weight: 700;
}

.rnp-sync-success {
  color: #138a4b;
  font-weight: 700;
}

.rnp-sync-error {
  color: #d84343;
  font-weight: 700;
}

.rnp-sync-progress {
  color: #005bff;
  font-weight: 700;
}

@media (max-width: 1000px) {
  .rnp-date-navigation {
    display: flex;
  }
}

.error {
  border-left: 5px solid #d84343;
}

@media (max-width: 800px) {
  .page {
    padding: 32px 18px 48px;
  }

  .dashboard-header {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: 30px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: auto;
  }

  .card {
    padding: 24px;
  }

  .table-card {
    padding: 0;
  }

  .product-column { width: 160px; }
  .metric-column { width: 180px; }
  th, td { padding: 6px; }
  .product-image, .product-image-placeholder { width: 40px; height: 40px; }

  .chart-area {
    min-height: 230px;
  }

}

@media (max-width: 1100px) {
  .planning-cards { grid-template-columns: 1fr; }
}
