/* Shared presentation for action buttons. Navigation, tabs and quantity controls keep their own styles. */
:where(main, dialog, header) button {
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
button:focus-visible, .invoiceMore > summary:focus-visible {
  outline: 2px solid #2459a1;
  outline-offset: 2px;
}
button[data-chm-action] {
  border: 1px solid var(--action-border);
  border-radius: 8px;
  background: var(--action-bg);
  color: var(--action-ink);
  font-weight: 650;
}
button[data-chm-action]:not(:disabled):hover {
  background: color-mix(in srgb, var(--action-bg) 93%, var(--action-ink));
  border-color: var(--action-ink);
}
button[data-chm-action]:disabled {
  opacity: .55;
  cursor: default;
}
button[data-chm-action]::before {
  content: "";
  display: inline-block;
  width: 1.12em;
  height: 1.12em;
  margin-inline-end: .45em;
  vertical-align: -.19em;
  background-color: currentColor;
  mask: var(--action-icon) center / contain no-repeat;
}
@media (forced-colors: active) {
  button[data-chm-action]::before {
    background-color: ButtonText;
    forced-color-adjust: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  :where(main, dialog, header) button { transition: none; }
}


button[data-chm-action="create"] {
  --action-ink: #146145;
  --action-bg: #e7f6ed;
  --action-border: #a5d3b9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E");
}

button[data-chm-action="save"], button[data-chm-action="submit"] {
  --action-ink: #146145;
  --action-bg: #e7f6ed;
  --action-border: #a5d3b9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m5 12 4 4L19 6%22/%3E%3C/svg%3E");
}

button[data-chm-action="payment"] {
  --action-ink: #146145;
  --action-bg: #e7f6ed;
  --action-border: #a5d3b9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 6h16v12H4zM4 10h16M7 15h3%22/%3E%3C/svg%3E");
}

button[data-chm-action="edit"] {
  --action-ink: #174d95;
  --action-bg: #eaf2ff;
  --action-border: #afc8ed;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m14 6 4 4M4 20l4-.9L20 7l-3-3L5 16l-1 4Z%22/%3E%3C/svg%3E");
}

button[data-chm-action="export"] {
  --action-ink: #174d95;
  --action-bg: #eaf2ff;
  --action-border: #afc8ed;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3v12m-4-4 4 4 4-4M5 16v4h14v-4%22/%3E%3C/svg%3E");
}

button[data-chm-action="import"] {
  --action-ink: #00615e;
  --action-bg: #e4f6f4;
  --action-border: #9ed2ce;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 16V4m-4 4 4-4 4 4M5 16v4h14v-4%22/%3E%3C/svg%3E");
}

button[data-chm-action="transfer"] {
  --action-ink: #5d3692;
  --action-bg: #f3ecfc;
  --action-border: #d0bce9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 7h13m-4-4 4 4-4 4m9 6H8m4-4-4 4 4 4%22/%3E%3C/svg%3E");
}

button[data-chm-action="print"] {
  --action-ink: #005d68;
  --action-bg: #e7f5f8;
  --action-border: #a8d3db;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 8V3h10v5m-10 8H4V8h16v8h-3M7 13h10v8H7zm10-2h.01%22/%3E%3C/svg%3E");
}

button[data-chm-action="copy"] {
  --action-ink: #174d95;
  --action-bg: #eaf2ff;
  --action-border: #afc8ed;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M8 8h12v12H8zM16 4H4v12%22/%3E%3C/svg%3E");
}

button[data-chm-action="share"] {
  --action-ink: #5d3692;
  --action-bg: #f3ecfc;
  --action-border: #d0bce9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 16V3m-4 4 4-4 4 4M7 11H4v9h16v-9h-3%22/%3E%3C/svg%3E");
}

button[data-chm-action="return"] {
  --action-ink: #82420a;
  --action-bg: #fff3dc;
  --action-border: #e8c38d;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 10h11a5 5 0 0 1 0 10h-4M9 5l-5 5 5 5%22/%3E%3C/svg%3E");
}

button[data-chm-action="danger"] {
  --action-ink: #9c272e;
  --action-bg: #fdecee;
  --action-border: #eab2b5;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13m-8 4v5m4-5v5%22/%3E%3C/svg%3E");
}

button[data-chm-action="cancel"] {
  --action-ink: #9c272e;
  --action-bg: #fdecee;
  --action-border: #eab2b5;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m6 6 12 12M18 6 6 18%22/%3E%3C/svg%3E");
}

button[data-chm-action="columns"] {
  --action-ink: #405166;
  --action-bg: #f0f4f8;
  --action-border: #becad7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 5h16v14H4zM10 5v14m5-14v14%22/%3E%3C/svg%3E");
}

button[data-chm-action="settings"] {
  --action-ink: #405166;
  --action-bg: #f0f4f8;
  --action-border: #becad7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 6h16M4 12h16M4 18h16M8 4v4m8 2v4m-6 2v4%22/%3E%3C/svg%3E");
}

button[data-chm-action="info"] {
  --action-ink: #405166;
  --action-bg: #f0f4f8;
  --action-border: #becad7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 11v6m0-10h.01M22 12a10 10 0 1 1-20 0 10 10 0 0 1 20 0Z%22/%3E%3C/svg%3E");
}

button[data-chm-action="reset"] {
  --action-ink: #405166;
  --action-bg: #f0f4f8;
  --action-border: #becad7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 9a8 8 0 1 1 0 6M4 4v5h5%22/%3E%3C/svg%3E");
}

button[data-chm-action="close"] {
  --action-ink: #405166;
  --action-bg: #f0f4f8;
  --action-border: #becad7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m6 6 12 12M18 6 6 18%22/%3E%3C/svg%3E");
}


.invoiceToolbar #invoiceCreate {
  --action-bg: #166048;
  --action-ink: #fff;
  --action-border: #166048;
}
.invoiceToolbar button[data-chm-action],
.invoiceDetails .invoiceActions button[data-chm-action],
.invoiceSide button[data-chm-action] {
  min-height: 40px;
  line-height: 1.3;
  color: var(--action-ink);
  border-color: var(--action-border);
}
.invoiceDetails .invoiceActions {
  gap: 8px;
}
.invoiceDetails .invoiceActions button[data-chm-action] {
  white-space: normal;
  text-align: start;
}
.invoiceMore > summary {
  min-height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.financeExpenseDetails {
  margin-bottom: 24px;
}
.financeExpenseDetails .financeExpenseTotal {
  margin-bottom: 0;
}

.invoiceTableWrap {
  container-type: inline-size;
}
.invoiceDetails {
  width: min(100%, calc(100cqw - 20px));
  position: sticky;
  left: 8px;
}

.invoiceDetails .invoiceActions button[data-chm-action] {
  background: var(--action-bg);
  border: 1px solid var(--action-border);
}
.invoiceDetails .invoiceActions button[data-chm-action]:not(:disabled):hover {
  background: color-mix(in srgb, var(--action-bg) 93%, var(--action-ink));
  border-color: var(--action-ink);
}
.invoiceDates[hidden] {
  display: none;
}

.webPublishLayout {
  display: grid;
  grid-template-columns: minmax(160px, 215px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.webGroupTree {
  border: 1px solid #cad9cf;
  border-radius: 10px;
  padding: 10px;
  background: #f2f7f3;
}
.webGroupTree details > div {
  margin: 4px 0 6px 8px;
  padding-left: 8px;
  border-left: 1px solid #cad9cf;
}
.webGroupTree summary { cursor: pointer; padding: 7px 4px; }
.webGroupTree button {
  display: block;
  width: 100%;
  text-align: start;
  margin-bottom: 4px;
  white-space: normal;
}
.webGroupTree button[aria-pressed="true"] {
  background: #205740;
  color: white;
}
.webPublishToolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.webPublishCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
  gap: 10px;
}
.webPublishCard {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #cad9cf;
  border-radius: 10px;
  padding: 10px;
  background: #fafdfe;
  overflow-wrap: anywhere;
}
.webPublishCard h3, .webPublishCard p { margin: 0; }
.webPublishCard input:not([type="checkbox"]) { min-width: 0; width: 100%; }
.webPublishCard img, .webNoImage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 115px;
  object-fit: contain;
  border-radius: 7px;
  background: #eef3ee;
}
.webBranchTick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.webBranchTick input { width: auto; margin: 0; }
.webBranchTick small { display: block; color: #335b46; }
@media (max-width: 650px) {
  .webPublishLayout { grid-template-columns: 1fr; }
  .webGroupTree { max-height: 210px; overflow: auto; }
  .webPublishCards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
}
[hidden] { display: none !important; }
#webGroupPicker summary{white-space:normal}
#webGroupPicker .saleGroupPanel{position:static;min-width:0;width:100%;box-shadow:none;padding:6px}
#webGroupChoices{max-height:340px;overflow:auto}
#webGroupChoices label{white-space:normal;cursor:pointer}
#webGroupPicker .saleGroupActions{flex-wrap:wrap;gap:5px}
#webGroupPicker .saleGroupActions button{width:auto}
#webGroupPicker,#webGroupPicker .saleGroupPanel,#webGroupChoices{box-sizing:border-box;min-width:0;max-width:100%}
#webGroupChoices{overflow-x:hidden}
#webGroupChoices summary{display:list-item;white-space:normal;overflow-wrap:anywhere}
#webGroupChoices label{display:inline-flex;align-items:baseline;max-width:100%;gap:4px;flex-wrap:wrap;overflow-wrap:anywhere}
#webGroupChoices label input[type=checkbox]{appearance:auto;width:14px!important;height:14px;min-width:14px;flex:0 0 14px;margin:0 2px 0 0;padding:0;vertical-align:middle}
#webGroupChoices label small{white-space:nowrap}
#webGroupChoices .groupChildren{margin-left:5px;padding-left:6px}
@media(min-width:850px){#publishPanel .webPublishLayout{grid-template-columns:minmax(220px,250px) minmax(0,1fr)}}
#webGroupChoices label{display:inline;line-height:1.45}
.chm-branding{display:flex;align-items:center;gap:8px;margin-bottom:5px}.chm-branding[hidden]{display:none}.chm-branding img{max-width:62px;max-height:48px;object-fit:contain}.chm-branding small{display:block;overflow-wrap:anywhere}
.chm-sale-picker[hidden]{display:none!important}.chm-sale-picker{border:1px solid #c4d0c4;border-radius:7px;padding:8px;background:#fff}.chm-picker-row{display:flex;align-items:center;gap:6px;justify-content:space-between}.chm-picker-row input{min-width:0;cursor:pointer}.chm-picker-row button{flex:none;white-space:nowrap}.chm-sale-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center;margin-top:4px}.chm-sale-days button{min-width:0;padding:3px}.chm-sale-days button[aria-pressed=true]{background:#295441;color:#fff}.chm-sale-picker label{min-width:0}

#webGroupUnits { margin: 12px 0; }
.webUnitChecks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.webUnitChecks input { width: auto; }
.webUnitPrices { margin: 0; padding-inline-start: 1.2em; }
#webPublishIssues { margin: 10px 0; padding: 12px; color: #872316; background: #fff1eb; border: 1px solid #d38e7f; }
#webPublishIssues ul { max-height: 240px; overflow: auto; margin-bottom: 0; padding-inline-start: 1.4em; }
