/* Compact workspace surfaces; keep the geometric brand in the accents. */
.app { --side-w: 244px; font-size: 14px; }
.app > div { min-width: 0; }
.app .sidenav { padding: 24px 16px; gap: 20px; }
.app .brand__name { font-size: 21px; }
.app .nav-item { font-size: 14px; padding: 11px 14px; border-radius: 12px; }
.app .nav-item__count { font-size: 10px; }
.app .sidenav__label { padding: 0 14px 8px; font-size: 10px; }
.appbar { min-height: 78px; background: #fffdf9; border-bottom: 1px solid #e1ddd9; }
.appbar__title { font-size: 22px; line-height: 1.25; }
.appbar__sub { margin-top: 4px; font-size: 12px; }
.app-main { max-width: 1600px; margin: 0 auto; width: 100%; padding: 28px 28px 52px; }
.app-main .stack-6 { gap: 28px; }
.app-main .stack-4 { gap: 20px; }
.app-main .grid { gap: 18px; }
.app .card { background: #fff; border-color: #d9d6d3; border-radius: 18px; box-shadow: 0 3px 0 #ebe6dd; padding: 22px; }
.app .card:hover { transform: none; }
.app .card--pad-sm { padding: 16px; }
.app .card__head { gap: 12px; align-items: flex-start; margin-bottom: 18px !important; }
.app .card__head > div { min-width: 0; }
.app .card__title { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.app .stat { padding: 18px 20px; gap: 7px; border: 1px solid #d9d6d3; border-radius: 16px; box-shadow: 0 3px 0 #ebe6dd !important; }
.app .stat:hover, .app .metric:hover { transform: none; }
.app .stat__icon { width: 34px; height: 34px; border-width: 1px; border-radius: 10px; margin-bottom: 4px; }
.app .stat__value { font-size: clamp(23px, 2.4vw, 31px); line-height: 1.2; overflow-wrap: anywhere; }
.app .stat__label { font-size: 13px; }
.app .metric { padding: 18px; border: 1px solid #d9d6d3; border-radius: 14px; box-shadow: 0 3px 0 #ebe6dd !important; }
.app .metric__value { font-size: 27px; }
.app .banner { padding: 13px 16px; font-size: 13px; line-height: 1.6; box-shadow: none; border-width: 1px; border-color: #ddd7cf; border-radius: 12px; }
.app .banner > svg { flex: 0 0 18px; margin-top: 2px; }
.app .badge { font-size: 10px; letter-spacing: .03em; padding: 5px 9px; border-width: 1px; white-space: nowrap; }
.app .btn { min-height: 42px; padding: 9px 16px; font-size: 13px; border-radius: 11px; box-shadow: 2px 2px 0 var(--ink); }
.app .btn--sm { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.app .btn--ghost { border-color: transparent; box-shadow: none; }
.app .icon-btn { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; border-width: 1px; }
.app .icon-btn:hover { transform: none; background: var(--primary-soft); }
.app .toolbar { margin: 0; gap: 12px; }
.app .toolbar__actions { gap: 10px; min-width: 0; }
.app .toolbar .field--pill { min-width: 180px; }
.app .field__control { height: 44px; min-height: 44px; padding: 10px 14px; font-size: 13px; border-radius: 11px; }
.app .field--pill .field__control { border-radius: 12px; }
.app .pill-select { min-width: 0; max-width: 100%; border-radius: 10px; height: 42px; box-shadow: none; border-color: #d9d6d3; font-size: 12px; padding: 8px 32px 8px 12px; }
.filter-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 12px; }
[data-customer-filter] { width: 100%; background: #fff; border: 1px solid #d9d6d3; border-radius: 11px; }
.app .segmented { padding: 3px; border-radius: 12px; border-width: 1px; box-shadow: none; overflow-x: auto; }
.app .segmented__item { border-radius: 9px; font-size: 12px; padding: 9px 12px; white-space: nowrap; }
.data-card { border: 1px solid #d9d6d3; border-radius: 14px; box-shadow: 0 3px 0 #ebe6dd; max-width: 100%; }
.table-wrap { overflow: auto; max-height: 920px; }
.data-table { font-size: 13px; min-width: 980px; }
.data-table--items { min-width: 960px; table-layout: fixed; }
.data-table--items th:nth-child(1) { width: 22%; }
.data-table--items th:nth-child(2) { width: 13%; }
.data-table--items th:nth-child(3) { width: 9%; }
.data-table--items th:nth-child(4) { width: 5%; }
.data-table--items th:nth-child(5) { width: 15%; }
.data-table--items th:nth-child(6) { width: 12%; }
.data-table--items th:nth-child(7) { width: 10%; }
.data-table--items th:nth-child(8) { width: 14%; }
.data-table--invoices { min-width: 1120px; }
.data-table th { position: sticky; top: 0; z-index: 2; }
.data-table thead th { padding: 13px 16px; font-size: 10px; letter-spacing: .06em; border-bottom: 1px solid #ded6d5; background: #faf0f3; }
.data-table tbody td { padding: 14px 16px; border-bottom: 1px solid #eee9e5; line-height: 1.5; }
.data-table tbody td:first-child { min-width: 225px; max-width: 285px; }
.data-table--items tbody td { min-width: 0 !important; max-width: none !important; padding: 14px 10px; overflow-wrap: anywhere; }
.data-table--items thead th { padding-inline: 10px; }
.data-table .t-xs { margin-top: 3px; font-size: 11px; overflow-wrap: anywhere; }
.data-table .num .t-xs { white-space: normal; max-width: 150px; }
.data-table .row-actions { gap: 5px; }
.data-table .row-actions .icon-btn { width: 32px; height: 32px; border: 1px solid #ddd7d5; box-shadow: none; background: #fff; }
.data-table td:last-child, .data-table th:last-child { position: sticky; right: 0; background: #fff; border-left: 1px solid #eee9e5; z-index: 1; }
.data-table th:last-child { background: #faf0f3; z-index: 3; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 0; font-size: 12px; color: var(--slate-600); }
.pagination__controls { display: flex; align-items: center; gap: 10px; }
.pagination button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #d9d6d3; border-radius: 9px; background: #fff; }
.pagination button:hover:not(:disabled) { background: var(--primary-soft); }
.pagination button:disabled { opacity: .35; cursor: default; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading h3 { font-size: 19px; }
.section-heading a { font-size: 12px; color: var(--primary); font-weight: 700; white-space: nowrap; }
.customer-welcome { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.customer-welcome h2 { font-size: clamp(26px, 3vw, 34px); }
.customer-welcome p { font-size: 14px; }
.customer-updated { font-size: 12px; color: var(--slate-500); margin-top: 8px; }
.order-grid, .batch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.order-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; text-align: left; border: 1px solid #d9d6d3; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #ebe6dd; transition: border-color .15s; }
.order-card:hover { border-color: var(--primary); }
.order-card__head { display: flex; align-items: flex-start; gap: 12px; }
.order-card__head > div { min-width: 0; flex: 1; }
.order-card__head .icon-bubble { width: 40px; height: 40px; border-width: 1px; border-radius: 12px; flex: 0 0 40px; }
.order-card h3 { font-size: 15px; line-height: 1.45; font-weight: 700; overflow-wrap: anywhere; }
.order-card__meta { color: var(--slate-500); font-size: 12px; margin-top: 4px; }
.order-card__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid #eee9e5; }
.order-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.order-card__amount { font-size: 13px; font-weight: 700; }
.batch-progress { display: flex; flex-direction: column; gap: 15px; }
.batch-progress .progress { height: 7px; border: 0; background: #f1ece8; }
.batch-progress__footer { display: flex; justify-content: space-between; gap: 12px; color: var(--slate-500); font-size: 12px; }
.batch-progress__footer a { display: flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; }
.app .list-item { padding: 14px 16px; flex-wrap: wrap; }
.app .list-item__body { min-width: 140px; }
.app .list-item__title { font-size: 14px; }
.app .list-item__meta { font-size: 11px; }
.app .list-item__trail { margin-left: auto; }
.app .icon-bubble { border-width: 1px; }
.app .progress--thin { height: 7px; border-width: 1px; }
.app .timeline__title { font-size: 13px; line-height: 1.5; }
.app .timeline__meta { font-size: 11px; margin-top: 3px; }
.app .timeline { gap: 16px; }
.app .empty { border-width: 1px; padding: 40px 20px; }
.app .snackbar-host { bottom: 24px; }
.app .snackbar { font-size: 13px; border-radius: 12px; border-width: 1px; }
dialog.sheet { display: none; width: min(720px, calc(100vw - 36px)); max-height: calc(100dvh - 40px); border: 1px solid #d9d6d3; border-radius: 20px; box-shadow: 0 24px 70px #18213140; }
dialog.sheet[open] { display: flex; flex-direction: column; }
.sheet__head { flex: 0 0 auto; padding: 20px 24px; border-bottom: 1px solid #e8dbdf; }
.sheet__head .icon-btn { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; }
.sheet__body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding: 24px; }
.sheet__foot { flex: 0 0 auto; padding: 16px 24px; border-top: 1px solid #e4dfd9; background: #fff; }
.sheet .field__control { height: 44px; min-height: 44px; font-size: 14px; border-radius: 11px; }
.sheet textarea.field__control { height: auto; min-height: 100px; }
.sheet .field__label { font-size: 11px; letter-spacing: .04em; }
.sheet .field__helper { font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .field { min-width: 0; }
.form-grid > :not(.field), .form-grid [data-field="item_name"], .form-grid [data-field="variant"], .form-grid [data-field="note"], .form-grid [data-field="notes"] { grid-column: 1 / -1; }
.sheet .btn { min-height: 40px; font-size: 13px; padding: 9px 16px; border-radius: 11px; box-shadow: 2px 2px 0 var(--ink); }
.sheet .btn--ghost { box-shadow: none; }
.sheet .card { border-width: 1px; box-shadow: none !important; }
.sheet .row-between { align-items: flex-start; gap: 14px; }
.sheet .row-between > span:last-child { overflow-wrap: anywhere; max-width: 65%; }
.sheet .stepper__label { font-size: 10px; }
.admin-account { padding: 16px; background: linear-gradient(145deg, #fff 55%, #fff0f5); border: 1px solid #e6dce1; border-radius: 18px; box-shadow: 0 4px 14px #18213106; }
.admin-account__profile { display: flex; align-items: center; gap: 11px; padding-bottom: 15px; }
.admin-account__avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid #efc8d8; border-radius: 13px; color: var(--primary); background: #ffe6ef; }
.admin-account__name { font-size: 14px; font-weight: 800; line-height: 1.5; }
.admin-account__role { font-size: 11px; color: var(--slate-500); margin-top: 2px; }
.admin-account__presence { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #25846b; box-shadow: 0 0 0 3px #e4f5ec; }
.admin-account__actions { display: grid; gap: 5px; border-top: 1px solid #eee5e9; padding-top: 10px; }
.admin-account__button { display: flex; align-items: center; gap: 10px; min-height: 37px; padding: 9px 10px; text-align: left; font-size: 11px; font-weight: 600; color: var(--slate-600); border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; }
.admin-account__button svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-account__button:hover { background: #fff; border-color: #eadce2; }
.admin-account__button--logout { color: #ad315f; }
.admin-account__button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.item-money { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-variant-numeric: tabular-nums; }
.item-money__amount { font-weight: 750; font-size: 14px; color: var(--ink); white-space: nowrap; line-height: 1.4; }
.item-money__payment { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; font-size: 10px; line-height: 1.4; color: var(--slate-500); }
.item-money__payment--recorded { color: #346d61; }
.item-money__payment--recorded > span:first-child { color: var(--slate-500); }
.item-money__method { display: inline-flex; padding: 2px 6px; border-radius: 5px; background: #f3f5f7; border: 1px solid #e7ebef; color: #506074; font-size: 9px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.sheet .status-choice { cursor: pointer; gap: 14px; padding: 13px 15px; border: 1px solid #e0dce0; border-radius: 13px; box-shadow: none; background: #fff; transition: border-color .15s, background .15s; }
.sheet .status-choice:hover { transform: none; border-color: #d298af; background: #fffafb; }
.sheet .status-choice:has(input:checked) { border-color: var(--primary); background: #fff3f7; box-shadow: inset 0 0 0 1px var(--primary); }
.sheet .status-choice:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; border: none; }
.choice-icon svg { flex-shrink: 0; }
.sheet .status-choice .list-item__body { flex: 1; min-width: 0; }
.sheet .status-choice .list-item__title { font-size: 14px; }
.sheet .status-choice .list-item__meta { font-size: 11px; line-height: 1.5; margin-top: 3px; }
.sheet .status-choice input[type="radio"] { width: 17px; height: 17px; flex-shrink: 0; margin: 0; accent-color: var(--primary); }
@media (max-width: 1259px) {
  .table-desktop-only { display: none; }
  .table-mobile-only { display: flex; }
}
@media (min-width: 761px) and (max-width: 1259px) {
  .table-mobile-only { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (min-width: 1024px) { #mobileMenu, #mobileLogout { display: none; } }
@media (max-width: 1023px) {
  .app-main { padding: 22px 20px 112px; }
  .app .snackbar-host { bottom: 100px; }
}
@media (max-width: 760px) {
  .order-grid, .batch-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .toolbar__actions { width: 100%; }
  .app .toolbar__actions .segmented { flex: 1; }
  .app .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .appbar #shellBadge { display: none; }
  .app .card__head { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .app-main { padding: 20px 16px 112px; }
  .appbar { padding: 14px 16px; }
  .appbar__title { font-size: 20px; }
  .appbar__sub { max-width: 260px; }
  .app .card { padding: 18px; }
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .app .metric { padding: 14px 10px; }
  .app .metric__value { font-size: 23px; }
  .app .metric__label { font-size: 10px; line-height: 1.4; margin-top: 5px; }
  .pagination { flex-wrap: wrap; }
  .order-card { padding: 16px; }
  .app .list-item__trail { max-width: 100%; }
  dialog.sheet { width: calc(100vw - 16px); max-width: none; margin: auto; max-height: calc(100dvh - 24px); border-radius: 18px; }
  .sheet__head, .sheet__body, .sheet__foot { padding: 18px; }
  .sheet .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet .stepper { gap: 3px; }
  .sheet .stepper__step { padding-top: 36px; }
  .sheet .stepper__step::before { width: 28px; height: 28px; }
}

/* Give forms a real scroll area on iOS, and avoid input-focus zoom. */
@media(max-width:700px){
  dialog.sheet{height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);width:calc(100vw - 16px);margin:auto;}
  .sheet__head{padding:16px;gap:12px;}
  .sheet__title{font-size:22px;line-height:1.25;}
  .sheet__head .t-sm{font-size:13px;line-height:1.5;}
  .sheet__body{flex:1 1 auto;min-height:0;padding:16px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  .sheet .field__control,.sheet .search-select__trigger{font-size:16px;min-height:46px;}
  .sheet__foot{padding:12px 16px max(12px,env(safe-area-inset-bottom));gap:10px;}
  .sheet .btn{min-height:44px;font-size:14px;}
}
