.icon-button,
.account-trigger,
.whatsapp-float,
.chat-emblem,
.name-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button,
.account-trigger {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--ink);
  background: var(--surface);
  min-height: 2.5rem;
}
.icon-button {
  position: relative;
  width: 2.5rem;
  flex: none;
  font-size: 1.1rem;
}
.icon-button:hover,
.account-trigger:hover {
  background: var(--paper);
  color: var(--action);
}
.icon-button:focus-visible,
.account-trigger:focus-visible,
.whatsapp-float:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}
.account-trigger {
  gap: 0.55rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.87rem;
  font-weight: 600;
}
.name-avatar,
.chat-emblem {
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  flex: none;
  font-weight: 650;
  font-size: 0.78rem;
}
.name-avatar {
  background: var(--tint);
  color: var(--action);
}
.account-name {
  max-width: 12rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.account-trigger .bi-chevron-down {
  font-size: 0.72rem;
}
#accountMenu,
#notificationMenu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 6px 24px #20151b18;
  padding: 0.3rem;
  color: var(--ink);
}
#accountMenu {
  min-width: 14rem;
}
.account-summary {
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--line);
}
.account-summary strong,
.account-summary small,
.notification-entry small {
  display: block;
}
.account-summary small,
.notification-entry small {
  color: var(--muted);
  font-size: 0.77rem;
}
#accountMenu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.35rem;
  color: var(--ink);
}
#accountMenu .dropdown-item:hover,
#accountMenu .dropdown-item:focus,
.notification-entry:hover {
  background: var(--paper);
}
.profile-form {
  display: grid;
  gap: 1rem;
}
.profile-form input {
  margin-top: 0.3rem;
}
.profile-form p:empty {
  display: none;
}
#unreadCount {
  position: absolute;
  right: -0.32rem;
  top: -0.32rem;
  border-radius: 100px;
  padding: 0.1rem 0.3rem;
  font-size: 0.63rem;
  line-height: 1.2;
  color: white;
  background: #ac1823;
  font-weight: 700;
}
#notificationMenu {
  width: min(21rem, calc(100vw - 1.5rem));
  max-height: 65vh;
  overflow: auto;
}
#notificationMenu header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  gap: 0.5rem;
}
#notificationMenu h2 {
  font-size: 1rem;
  margin: 0;
}
#readAll,
#backTop {
  background: none;
  color: var(--action);
  border: 0;
  font-size: 0.8rem;
}
#readAll:disabled {
  color: var(--muted);
}
#notificationList,
.pending-files,
.message-list {
  margin: 0;
  list-style: none;
  padding: 0;
}
.notification-entry {
  width: 100%;
  text-align: start;
  background: none;
  color: var(--ink);
  border: 0;
  padding: 0.65rem;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.85rem;
}
.notification-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  flex: none;
}
.notification-entry[data-unread="true"] .notification-dot {
  background: var(--action);
}
.inbox-empty {
  color: var(--muted);
  padding: 0.85rem;
}
.dashboard-tools {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.dashboard-tools input,
#userSearch {
  max-width: 22rem;
}
#requestRows td:last-child {
  white-space: nowrap;
}
#requestRows .icon-button {
  vertical-align: middle;
  color: var(--action);
  width: 2.2rem;
  min-height: 2rem;
}
.whatsapp-float {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 1000;
  background: #176942;
  color: white;
  border: 2px solid var(--surface);
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: 0 3px 12px #14161226;
}
.whatsapp-float:hover {
  background: #115334;
  color: white;
}
footer.container {
  padding-inline-end: max(5rem, 7vw);
}
.chat-dialog .modal-dialog {
  max-width: 30rem;
  margin: clamp(0.5rem, 4vh, 2rem) auto;
}
.chat-dialog .modal-content {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
.chat-dialog .modal-header {
  gap: 0.6rem;
  padding: 0.75rem 1rem;
}
.chat-dialog #editorTitle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}
.chat-dialog #editorTitle strong,
.chat-dialog #editorTitle small {
  display: block;
}
.chat-dialog #editorTitle strong {
  font-size: 0.96rem;
  font-weight: 650;
}
.chat-dialog #editorTitle small,
.chat-day,
.message-by time {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}
.chat-emblem {
  width: 2.3rem;
  height: 2.3rem;
  background: var(--tint);
  color: var(--action);
  font-size: 1.05rem;
}
.chat-tools {
  display: flex;
}
.chat-tools .icon-button,
.chat-compose .icon-button {
  border: 0;
  background: transparent;
  width: 2rem;
  min-height: 2.1rem;
}
.chat-dialog .modal-header .btn-close {
  margin: 0;
  padding: 0.4rem;
  font-size: 0.79rem;
}
.chat-dialog #editorBody {
  padding: 0;
  min-height: 0;
}
.conversation {
  display: flex;
  flex-direction: column;
  height: min(70vh, 36rem);
  height: min(70dvh, 36rem);
  background: var(--paper);
}
.chat-search {
  padding: 0.45rem 0.8rem;
}
.message-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1;
  padding: 0.6rem 0.75rem;
}
.chat-day {
  text-align: center;
  margin: 0.4rem 0 1rem;
}
.chat-day span {
  display: inline-block;
  border-radius: 1rem;
  padding: 0.27rem 0.7rem;
  background: var(--surface);
}
.chat-line {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.3rem 0 1.1rem;
}
.chat-line .name-avatar {
  width: 1.7rem;
  height: 1.7rem;
  background: var(--line);
  color: var(--ink);
  font-size: 0.64rem;
}
.chat-line.outgoing {
  flex-direction: row-reverse;
}
.chat-line.outgoing .name-avatar {
  background: var(--tint);
  color: var(--action);
}
.chat-message {
  max-width: 86%;
  min-width: 0;
}
.message-by {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  margin: 0 0 0.3rem;
  font-size: 0.77rem;
}
.outgoing .message-by {
  flex-direction: row-reverse;
}
.bubble {
  background: var(--surface);
  border-radius: 0 0.6rem 0.6rem 0.6rem;
  padding: 0.58rem 0.75rem;
  width: fit-content;
  font-size: 0.91rem;
  line-height: 1.45;
}
.outgoing .bubble {
  background: var(--tint);
  border-radius: 0.6rem 0 0.6rem 0.6rem;
  margin-inline-start: auto;
}
.bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-file {
  display: block;
  color: var(--action);
  text-decoration: none;
}
.chat-file + .chat-file,
.bubble p + .chat-file {
  margin-block-start: 0.45rem;
}
.chat-file img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.35rem;
  margin-bottom: 0.35rem;
}
.chat-file > span {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
}
.chat-file > span > span {
  overflow-wrap: anywhere;
}
.chat-feedback {
  margin: 0;
  padding: 0.25rem 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.chat-feedback:empty {
  display: none;
}
.chat-compose {
  background: var(--surface);
  padding: 0.6rem 0.65rem;
  border-top: 1px solid var(--line);
}
.compose-row,
.compose-field {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.compose-field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.22rem 0.3rem;
}
.compose-field:focus-within {
  border-color: var(--action);
}
.compose-field textarea {
  flex: 1;
  width: 0;
  min-width: 0;
  background: none;
  color: var(--ink);
  border: 0;
  padding: 0.35rem;
  font: inherit;
  font-size: 0.88rem;
  resize: none;
  max-height: 6rem;
}
.compose-field textarea:focus {
  outline: 0;
}
.chat-compose .send-chat {
  color: var(--action);
  font-size: 1.25rem;
}
.chat-compose .send-chat:disabled {
  opacity: 0.5;
}
.pending-files {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.pending-files li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
  background: var(--paper);
  border-radius: 0.35rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.74rem;
  max-width: 100%;
}
.pending-files li span {
  overflow-wrap: anywhere;
}
.pending-files .icon-button {
  width: 1.3rem;
  min-height: 1.3rem;
}
@media (max-width: 600px) {
  .account-name,
  .account-trigger .bi-chevron-down {
    display: none;
  }
  .account-trigger {
    border: 0;
    padding: 0;
  }
  .top-controls .compact-select {
    padding-inline: 4px;
  }
  .nav-shell {
    gap: 0.25rem;
  }
  .chat-dialog .modal-dialog {
    margin: 0.45rem;
  }
  .whatsapp-float {
    width: 2.8rem;
    height: 2.8rem;
    right: 0.8rem;
    bottom: 0.85rem;
  }
}
@media print {
  .whatsapp-float {
    display: none;
  }
}

@media (max-width: 600px) {
  .chat-dialog .modal-dialog {
    height: 100%;
    height: 100dvh;
    margin: 0;
    max-width: none;
  }
  .chat-dialog .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .chat-dialog #editorBody {
    display: flex;
    overflow: hidden;
  }
  .conversation {
    width: 100%;
    height: 100%;
  }
  .chat-compose {
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }
}

/* Keep the same reading order when controls flow from a column into a grid. */
.profile-form {
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}
.profile-wide,
.profile-form [role="status"] {
  grid-column: 1/-1;
}
.profile-form label,
.photo-editor form,
.qris-picker {
  min-width: 0;
}
.profile-form textarea {
  margin-top: 0.3rem;
}
.photo-grid,
.instrument-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: 0.85rem;
}
.photo-grid:not(:empty),
.instrument-photos {
  margin-block: 1rem;
}
.photo-grid figure,
.invoice-qr {
  margin: 0;
}
.photo-grid figure {
  min-width: 0;
}
.photo-grid a {
  display: block;
  background: var(--paper);
  border-radius: 0.5rem;
}
.photo-grid img,
.instrument-photos img {
  display: block;
  width: 100%;
  height: clamp(9rem, 19vw, 15rem);
  object-fit: contain;
  border-radius: 0.45rem;
}
.photo-grid figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.photo-grid figcaption:not(:empty) {
  padding-top: 0.4rem;
}
.photo-grid figcaption button {
  margin-inline-start: auto;
}
.photo-editor {
  border-block-start: 1px solid var(--line);
  margin-block: 0.9rem;
  padding-block: 0.75rem;
}
.photo-editor summary {
  font-weight: 600;
  color: var(--action);
  cursor: pointer;
  width: fit-content;
}
.photo-editor form,
.qris-picker {
  display: grid;
  gap: 0.5rem;
}
.photo-editor form {
  margin-top: 0.65rem;
  justify-items: start;
}
.photo-editor label,
.upload-label {
  display: block;
  width: 100%;
}
.upload-label input,
.photo-editor label input {
  margin-top: 0.25rem;
}
.image-hint,
.image-status {
  font-size: 0.82rem;
  color: var(--muted);
}
.image-status:empty {
  display: none;
}
.qris-picker {
  padding-block: 0.65rem;
}
.invoice-qr,
.qris-preview {
  margin-block: 0.8rem;
}
.invoice-qr img,
.qris-preview {
  display: block;
  max-width: 100%;
  width: 17rem;
  height: auto;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}
.qris-preview[hidden] {
  display: none;
}
.invoice-qr a {
  color: var(--action);
  display: inline-block;
  margin-top: 0.4rem;
}
.modal-header .modal-title,
.instrument-note,
.instrument-facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 575px) {
  .modal:not(.chat-dialog) .modal-dialog {
    margin: 0.5rem;
  }
  .modal:not(.chat-dialog) .modal-body {
    padding: 0.85rem;
  }
  .modal input[type="file"] {
    font-size: 0.87rem;
    max-width: 100%;
  }
  .invoice {
    padding: 0.8rem;
  }
  .invoice dl > div,
  .request-info > div {
    grid-template-columns: minmax(5.5rem, 2fr) minmax(0, 3fr);
    gap: 0.6rem;
  }
  .photo-editor form {
    justify-items: stretch;
  }
  .qris-preview,
  .invoice-qr img {
    margin-inline: auto;
  }
  .invoice-qr figcaption {
    text-align: center;
  }
}
@media print {
  .invoice-qr {
    break-inside: avoid;
  }
  .invoice-qr figcaption {
    display: none;
  }
  .invoice-qr img {
    width: 46mm;
  }
}

.item-mobile-label {
  display: none;
}
@media screen and (max-width: 575px) {
  .item-breakdown thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .item-breakdown tbody,
  .item-breakdown tbody tr {
    display: block;
  }
  .item-breakdown tbody tr {
    padding-block: 0.55rem;
    border-bottom: 1px solid var(--line);
  }
  .item-breakdown tbody th {
    display: block;
    overflow-wrap: anywhere;
  }
  .item-breakdown tbody :is(td, th) {
    border: 0;
    padding: 0.18rem 0;
  }
  .item-breakdown tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .item-mobile-label {
    display: inline;
    color: var(--muted);
    text-align: start;
  }
}

#networkStatus {
  position: fixed;
  inset: auto auto 1rem 1rem;
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 10px #0002;
}
#networkStatus[hidden],
[hidden].ops-bar {
  display: none;
}
#notice {
  z-index: 2200;
}
.ops-form {
  display: grid;
  gap: 0.8rem;
  margin-block: 0.8rem 1rem;
  max-width: 43rem;
}
.ops-form label {
  display: grid;
  gap: 0.25rem;
}
.ops-form label:has(input[type="checkbox"]) {
  display: block;
}
.ops-form button,
.order-actions button {
  justify-self: start;
  align-self: end;
}
.ops-bar,
.order-actions,
#tabs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.ops-bar {
  justify-content: space-between;
  margin-block: 1rem;
}
.order-actions .action-form:has(label),
.order-actions details {
  flex-basis: 100%;
}
.finance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.finance-cards .stat,
.review-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
}
.finance-cards strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 0.75rem;
}
#financePanel canvas {
  width: 100%;
  height: auto;
  background: var(--surface);
}
#financePanel h3,
#feedbackPanel h3 {
  margin-top: 1.5rem;
}
.chart-key span {
  border-bottom: 3px solid #ba2044;
}
.chart-key span:nth-child(2) {
  border-color: #4686be;
}
.chart-key span:nth-child(3) {
  border-color: #cd8421;
}
.stars {
  display: flex;
  gap: 0.35rem;
}
.stars label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
}
.stars label:has(:checked) {
  outline: 2px solid var(--action);
  color: var(--action);
}
.directory {
  min-width: 59rem;
}
.directory .name-column {
  width: 30%;
}
.directory .function-column {
  width: 24%;
}
.directory .price-column {
  width: 12%;
}
.directory .detail-column {
  width: 10%;
}
@media print {
  #networkStatus,
  .ops-bar {
    display: none !important;
  }
}
@media (min-width: 992px) {
  #stats:has(> :nth-child(5)) > * {
    width: 20%;
  }
}

.finance-plot {width:100%;margin:1rem 0;color:var(--bs-body-color)}
.finance-plot svg {display:block;width:100%;overflow:visible}
.finance-plot text {font:11px system-ui,sans-serif;fill:currentColor}
.finance-plot .axis-title {font-weight:650}
.chart-grid {stroke:currentColor;opacity:.14}
.chart-axis {fill:none;stroke:currentColor;opacity:.5}
.series-line {fill:none;stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round}
.series-dot {stroke:var(--bs-body-bg,#fff);stroke-width:1.2}
@media(prefers-reduced-motion:no-preference){
  .chart-reveal .series-line {stroke-dasharray:1;animation:finance-draw .72s ease-out both}
  .chart-reveal .series-dot {animation:finance-dot .55s ease-out both}
  @keyframes finance-draw {from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
  @keyframes finance-dot {from{opacity:.15}to{opacity:1}}
}
.rating-stars {display:flex;gap:.3rem}
.rating-stars label {display:grid;place-items:center;min-width:44px;min-height:48px;cursor:pointer}
.rating-stars span {color:var(--bs-secondary-color,#737079);font-size:2.55rem;line-height:1}
.rating-stars label:has(input:checked) span,.rating-stars label:has(~ label input:checked) span,.review-score {color:var(--brand,#bd2035)}
.rating-stars label:has(input:focus-visible) {outline:2px solid currentColor;border-radius:5px}
.survey-actions,.survey-toolbar,.survey-heading {display:flex;align-items:end;gap:.8rem;flex-wrap:wrap}
.survey-toolbar {margin-block:1rem 2rem}.survey-heading label,.survey-toolbar label {flex:1;min-width:0}
.survey-field,.survey-group {display:grid;gap:.8rem;padding:1rem 0;border:0;border-bottom:1px solid var(--bs-border-color,#ccc)}
.survey-option {display:block;margin:.45rem 0}.survey-actions {justify-content:space-between}
.billing-inline {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.billing-inline input {max-width:19rem}.billing-inline .icon-button {min-width:36px;min-height:36px}
.billing-review {padding:1rem;border:1px solid var(--bs-border-color);border-radius:.6rem}
.billing-review table {width:100%;min-width:33rem}.billing-review td,.billing-review th {padding:.5rem}
.billing-review .billing-inline input[type=number] {max-width:10rem}

.stat .review-score{font-size:clamp(.85rem,2.5vw,1.4rem);white-space:nowrap}
