/* Moienapp for Business pages. Built on the admin tokens and components
   (panel, stat, pill, segs, kvs, fld, dialog) so they match the rest. */

#bz {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#bz > .grid {
  margin: 0;
}
.bz-skel {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: bzSkel 1.2s ease-in-out infinite;
}
@keyframes bzSkel {
  to {
    background-position: -200% 0;
  }
}

/* Switch thumb (the base .sw has none). */
.sw {
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: background 0.18s ease;
}
.sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(14, 26, 44, 0.25);
  transition: transform 0.18s ease;
}
.sw.on::after {
  transform: translateX(18px);
}
.sw:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Tables */
#bz table td.r,
#bz table th.r,
#bzDialog td.r,
#bzDialog th.r {
  text-align: right;
}
#bz td.num {
  white-space: nowrap;
}
#bz tbody tr[data-open] {
  cursor: pointer;
}
#bz tbody tr[data-open]:hover td {
  background: var(--surface-2);
}
.bz-co {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bz-co .av {
  flex: none;
}
.bz-co b {
  display: block;
  white-space: nowrap;
}
.bz-co small {
  color: var(--muted);
  font-size: 12px;
}
.bz-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.bz-chev {
  color: var(--muted);
  font-size: 18px;
}

/* Usage meter */
.bz-meter {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
  min-width: 90px;
}
.bz-meter i {
  display: block;
  height: 100%;
}
.bz-meter .m-red {
  background: var(--good);
}
.bz-meter .m-held {
  background: var(--gold);
}
.bz-meter .m-alloc {
  background: var(--sky);
  opacity: 0.45;
}
.bz-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.bz-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* Overview: needs-attention list */
.bz-attn .row .tic2 {
  font-weight: 800;
}
.bz-attn .row .tic2.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.bz-attn .row .tic2.sky {
  background: var(--sky-soft);
  color: var(--sky);
}
.bz-attn .row .tic2.good {
  background: var(--good-soft);
  color: var(--good);
}
.bz-act .row .tx span {
  white-space: normal;
}

/* Subscriptions: package cards */
.bz-plans {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.bz-plan {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.bz-plan.feat {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 10%, transparent), var(--shadow);
}
.bz-plan .ph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bz-plan .price {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}
.bz-plan .price small {
  display: block;
  margin: 6px 0 0 !important;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}
.bz-plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
}
.bz-plan li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.bz-plan li::before {
  content: "✓";
  color: var(--good);
  font-weight: 800;
  flex: none;
}
.bz-plan .pf {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.bz-plan .pf b {
  color: var(--ink);
}

/* Inline money input */
.bz-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bz-inline input {
  flex: 1 1 110px;
  min-width: 0;
  width: auto;
}
.bz-inline select {
  flex: 1 1 160px;
  min-width: 0;
}
.bz-inline .btn {
  flex: none;
}

/* Dialog sheet */
#bzDialog dialog {
  max-width: min(640px, 94vw);
}
#bzDialog dialog.narrow {
  max-width: min(480px, 94vw);
}
.bz-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bz-sec + .bz-sec {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.bz-sec > h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.bz-mini {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.bz-mini div {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bz-mini span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.bz-mini b {
  font-family: var(--display);
  font-size: 18px;
}
.bz-toggles {
  display: grid;
  gap: 10px;
}
.bz-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bz-toggle b {
  display: block;
  font-size: 14px;
}
.bz-toggle span {
  font-size: 12.5px;
  color: var(--muted);
}
.bz-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bz-lines td,
.bz-lines th {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.bz-lines th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.bz-lines tfoot td {
  border: 0;
  padding: 5px 0;
  color: var(--muted);
}
.bz-lines tfoot tr:last-child td {
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  padding-top: 10px;
}
.bz-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

/* Settings form groups */
.bz-rules .fld input {
  max-width: 100%;
}
.bz-suffix {
  position: relative;
}
.bz-suffix {
  display: block;
  width: 100%;
}
.bz-suffix input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 76px !important;
}
.bz-suffix em {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.bz-toolbar-r {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  min-width: 0;
}
.bz-toolbar-r .search {
  margin-left: 0;
  flex: 0 1 240px;
}
@media (max-width: 640px) {
  .bz-toolbar-r {
    flex-wrap: wrap;
    width: 100%;
  }
  .bz-toolbar-r .search {
    flex: 1 1 100%;
  }
}

@media (max-width: 760px) {
  .bz-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #bz .g2,
  #bz .g3 {
    grid-template-columns: minmax(0, 1fr);
  }
  #bzDialog .form {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bz-skel {
    animation: none;
  }
  .sw,
  .sw::after {
    transition: none;
  }
}

/* Advisory: session rows */
.bz-sess {
  align-items: flex-start !important;
}
.bz-day {
  flex: none;
  width: 46px;
  padding: 6px 0;
  border-radius: 10px;
  background: var(--sky-soft);
  color: var(--sky);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
}
.bz-day b {
  display: block;
  font-family: var(--display);
  font-size: 19px;
}
.bz-sess.past .bz-day {
  background: var(--surface-2);
  color: var(--muted);
}
.bz-sess .tx span {
  white-space: normal;
}

/* Invoice line editor */
.bz-lines-ed {
  display: grid;
  gap: 8px;
}
.bz-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto 34px;
  gap: 8px;
  align-items: center;
}
.bz-line input:not([type="checkbox"]) {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.bz-vat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.bz-line .iconbtn {
  width: 34px;
  height: 34px;
  font-size: 18px;
}
@media (max-width: 560px) {
  .bz-line {
    grid-template-columns: minmax(0, 1fr) 96px 34px;
  }
  .bz-vat {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
.btn-primary.danger,
.btn-primary.btn-line {
  color: #fff;
  border-color: var(--red);
}

/* Number boxes with a unit: no spinner arrows over the unit. */
.bz-suffix input[type="number"],
.bz-line input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.bz-suffix input[type="number"]::-webkit-inner-spin-button,
.bz-suffix input[type="number"]::-webkit-outer-spin-button,
.bz-line input[type="number"]::-webkit-inner-spin-button,
.bz-line input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
