:root {
  font-family:
    Manrope,
    Segoe UI,
    Arial,
    sans-serif;
  color: #172d36;
  background: #f3f5f5;
  font-size: 14px;
  --green: #17755e;
  --muted: #75858b;
  --border: #e1e7e7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
}
button,
.button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  color: #283c43;
  padding: 10px 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  background: #edf4f1;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #105a48;
}
.small {
  padding: 6px 10px;
  font-size: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #142c31;
  color: #cfdbdc;
  padding: 29px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  font-weight: 800;
  letter-spacing: -1.8px;
  font-size: 30px;
  color: white;
  padding: 0 16px 30px;
}
.brand span {
  color: #9ddaba;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #8fa9aa;
  margin-top: 7px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #829a9d;
  padding: 16px;
  margin-top: 4px;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.sidebar nav button {
  border: 0;
  text-align: left;
  background: none;
  color: #adc1c3;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  padding: 12px 15px;
}
.sidebar nav button:hover {
  background: #233e42;
}
.sidebar nav button.active {
  background: #2c4b47;
  color: #d1efda;
}
.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  opacity: 0.9;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #2d4549;
  padding: 22px 14px 0;
  color: #99afb1;
  font-size: 12px;
}
.sidebar-bottom strong {
  color: #e5efed;
  display: block;
  margin-bottom: 7px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71ba93;
  margin-right: 7px;
}
.main {
  min-width: 0;
}
.topbar {
  height: 75px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  gap: 15px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb b {
  color: #30474d;
  font-weight: 500;
}
.topright {
  display: flex;
  align-items: center;
  gap: 20px;
}
.mode {
  color: #64786f;
  font-size: 11px;
  background: #f0f5ef;
  padding: 7px 11px;
  border-radius: 20px;
}
.avatar {
  display: inline-grid;
  place-items: center;
  background: #e8eeed;
  color: #335b51;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.content {
  max-width: 1600px;
  margin: auto;
  padding: 33px 38px 55px;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 20px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 10px;
  color: var(--green);
  font-weight: 800;
  margin-bottom: 9px;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.9px;
  margin: 0 0 8px;
  font-weight: 800;
}
h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 800;
}
h3 {
  font-size: 15px;
  margin: 22px 0 12px;
}
p {
  color: #76878c;
  line-height: 1.7;
  margin: 0;
  font-size: 13px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 21px 22px;
  position: relative;
}
.metric-label {
  font-size: 12px;
  color: #708287;
  margin-bottom: 15px;
}
.metric-value {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 700;
  line-height: 1.2;
}
.metric-note {
  margin-top: 13px;
  font-size: 11px;
  color: #87979b;
}
.metric-icon {
  position: absolute;
  top: 19px;
  right: 20px;
  color: #829d93;
  font-size: 18px;
}
.green {
  color: var(--green);
}
.amber {
  color: #b18b32;
}
.notice {
  border: 1px solid #e4decb;
  background: #faf8f0;
  border-radius: 8px;
  padding: 17px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #7e703f;
}
.notice strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.notice p {
  font-size: 12px;
  color: #928669;
}
.notice button {
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  border-color: #ddd3b6;
  color: #7e703f;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 21px 23px;
  border-bottom: 1px solid #edf0f0;
  gap: 15px;
}
.panel-head p {
  font-size: 11px;
  margin-top: 5px;
}
.panel-body {
  padding: 23px;
}
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 1fr);
  gap: 22px;
}
.workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 28px 23px;
  gap: 12px;
}
.step {
  border-right: 1px solid var(--border);
  padding: 0 15px;
}
.step:first-child {
  padding-left: 0;
}
.step:last-child {
  border: 0;
}
.step-num {
  font-size: 10px;
  letter-spacing: 1px;
  color: #8ba298;
  margin-bottom: 13px;
}
.step strong {
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}
.step p {
  font-size: 11px;
}
.step-status {
  display: inline-block;
  font-size: 10px;
  color: var(--green);
  margin-top: 14px;
  background: #eef6f1;
  padding: 4px 7px;
  border-radius: 4px;
}
.step-status.wait {
  color: #9c8a5e;
  background: #f6f3ec;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #8b989c;
  background: #fafbfb;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f1;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fbfdfc;
}
.badge {
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #eef5f0;
  color: #3b8667;
  display: inline-block;
  white-space: nowrap;
}
.badge.warn {
  background: #fbf5e7;
  color: #a88836;
}
.badge.error {
  background: #fbeeee;
  color: #b45a56;
}
.muted {
  color: #94a0a4;
}
.empty {
  padding: 45px;
  text-align: center;
  color: #7d8f95;
  line-height: 1.8;
}
.empty strong {
  display: block;
  color: #426066;
  margin-bottom: 8px;
}
.category {
  margin-bottom: 20px;
}
.category-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 9px;
  gap: 12px;
}
.bar {
  height: 5px;
  background: #eff3f1;
  border-radius: 5px;
  overflow: hidden;
}
.bar > i {
  display: block;
  background: #7faca0;
  height: 100%;
  border-radius: 5px;
}
.footer-note {
  font-size: 10px;
  color: #96a4a7;
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.toolbar input {
  max-width: 420px;
  flex: 1;
}
.toolbar .count {
  margin-left: auto;
  color: #94a0a4;
  font-size: 11px;
}
.search,
input,
select,
textarea {
  border: 1px solid #dce4e3;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: #29434a;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b9d9cc;
  outline-offset: 1px;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.product-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 280px;
  max-width: 530px;
}
.product-cell img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #edf0ee;
  border-radius: 5px;
}
.product-cell button {
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.product-cell small {
  display: block;
  color: #91a1a5;
  font-size: 10px;
  margin-top: 4px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 18px;
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field {
  display: grid;
  gap: 8px;
  font-size: 12px;
}
.field small {
  font-size: 10px;
  color: #8b999c;
}
.field.full {
  grid-column: 1/-1;
}
.field input,
.field textarea,
.field select {
  width: 100%;
}
.field textarea {
  min-height: 100px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 15px 0;
  line-height: 1.5;
}
.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #142c31;
}
.login-box {
  background: #f8faf9;
  border-radius: 12px;
  width: min(420px, 90vw);
  padding: 36px;
}
.login-box .brand {
  color: #193e36;
  padding: 0 0 27px;
}
.login-box p {
  margin: 12px 0 24px;
}
.login-box input,
.login-box button {
  width: 100%;
  margin-top: 12px;
}
.login-box small {
  display: block;
  color: #98a5a5;
  margin-top: 22px;
  font-size: 10px;
  line-height: 1.6;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: #183d34;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 30px #142c3120;
  z-index: 10;
  display: none;
  max-width: 480px;
  font-size: 13px;
}
dialog {
  border: 1px solid #dce5e2;
  border-radius: 12px;
  padding: 32px;
  width: min(1000px, 92vw);
  max-height: 90vh;
  color: #17363c;
}
dialog::backdrop {
  background: #10232988;
}
.close {
  float: right;
  font-size: 23px;
  border: 0;
  padding: 0 8px;
}
.detail-title {
  font-size: 21px;
  max-width: 85%;
  margin: 5px 0 20px;
}
.gallery {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  overflow: auto;
}
.gallery img {
  height: 110px;
  width: 110px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.breakdown {
  display: grid;
  gap: 0;
}
.breakdown > div {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #edf0ef;
  font-size: 12px;
}
.breakdown > div:last-child {
  font-weight: 800;
  font-size: 16px;
  color: var(--green);
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f6f8f7;
  padding: 14px;
  border-radius: 6px;
  font-size: 11px;
  color: #61777b;
}
details {
  margin: 15px 0;
}
summary {
  cursor: pointer;
  color: #5b747a;
  font-size: 12px;
}
.loading {
  padding: 80px;
  text-align: center;
  color: #728b86;
}
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.setup-item {
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 8px;
}
.setup-item p {
  font-size: 12px;
  margin-top: 8px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #edf0ef;
  font-size: 12px;
}
.warning-text {
  color: #a28439;
  font-size: 12px;
  margin: 12px 0;
}
.no-wrap {
  white-space: nowrap;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 45px;
  }
  .metrics {
    gap: 22px;
  }
  .metric {
    padding: 26px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 210px 1fr;
  }
  .content {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .sidebar {
    padding: 25px 12px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow {
    gap: 0;
  }
  .step {
    padding: 0 10px;
  }
  .mode {
    display: none;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .brand {
    padding: 0 10px 15px;
  }
  .brand small,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 9px;
    font-size: 11px;
  }
  .nav-icon {
    display: none;
  }
  .topbar {
    height: 55px;
    padding: 0 18px;
  }
  .content {
    padding: 22px 15px;
  }
  .pagehead {
    align-items: flex-start;
  }
  .pagehead > button {
    font-size: 11px;
    padding: 8px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .metric-value {
    font-size: 25px;
  }
  .metric-icon {
    display: none;
  }
  .workflow {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
  .step {
    border: 0;
  }
  .form-grid,
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .notice {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .notice button {
    margin: 0;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar input {
    width: 100%;
    flex: auto;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .footer-note {
    display: block;
  }
  .topright {
    gap: 10px;
  }
  h1 {
    font-size: 23px;
  }
  dialog {
    padding: 22px;
  }
  .panel-head {
    padding: 18px;
  }
  td,
  th {
    padding: 12px;
  }
}

progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 5px;
  background: #eff3f1;
  accent-color: #7faca0;
}
progress::-webkit-progress-bar {
  background: #eff3f1;
  border-radius: 5px;
}
progress::-webkit-progress-value {
  background: #7faca0;
  border-radius: 5px;
}
[hidden] {
  display: none !important;
}
.kb-document { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; font: inherit; line-height: 1.6; }
/* Profitability scenario report */
.profit-meta { display:block; margin-top:6px; color:#677182; font-size:11px; max-width:290px; white-space:normal; }
.profit-positive { color:#087a51; }
.profit-negative { color:#bf3434; }
.profit-filters { flex-wrap:wrap; }
.profit-filters select { max-width:260px; }
.profit-footnote { padding:0 24px 18px; color:#677182; font-size:12px; }
.profit-detail { text-align:left; white-space:normal; min-width:230px; max-width:290px; padding:0; border:0; background:none; font-weight:600; }
#profit-results th, #profit-results td { padding:14px 10px; }
#profit-results .badge { white-space:normal; }

.bp-controls { display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:18px 22px; } .bp-controls input { min-width:260px; flex:1; } #bp-status { padding:0 22px 20px; } #bp-results td { vertical-align:top; } #bp-results td:first-child { min-width:270px; } #bp-results td:last-child { min-width:220px; }
