:root {
  --ink: #17312a;
  --muted: #6f7d75;
  --green: #285f48;
  --green-dark: #1f513d;
  --green-soft: #e8f0ea;
  --pink: #ba4b57;
  --pink-soft: #fbecee;
  --cream: #fbf7ef;
  --paper: #fffdf9;
  --line: #e4ddd1;
  --shadow: 0 12px 28px rgba(32, 61, 48, .07);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 82px; }
html, body { max-width: 100%; overflow-x: clip; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-icon { display: block; width: 100%; height: 100%; object-fit: contain; }

.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 7px max(18px, calc((100vw - 760px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255, 253, 249, .98); box-shadow: 0 2px 12px rgba(36, 61, 49, .04); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 18px; }
.brand-mark img { display: block; width: 30px; height: 30px; object-fit: contain; }
.brand > span:last-child { display: flex; min-width: 0; align-items: baseline; white-space: nowrap; }
.brand strong, .brand small { display: inline; white-space: nowrap; }
.brand strong { color: var(--green); font-size: 14px; }
.brand small { color: var(--muted); font-size: 10px; }
.brand small::before { content: "·"; margin: 0 5px; }

.page-shell { width: min(100%, 760px); min-height: calc(100vh - 52px); margin: 0 auto; padding: 25px 18px calc(112px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.page-head > div { min-width: 0; }
.page-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font: 500 31px/1.05 Georgia, "Times New Roman", serif; letter-spacing: -.035em; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.page-intro { margin: -7px 0 0; line-height: 1.5; }

.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 15px; border-radius: 14px; font-size: 13px; font-weight: 750; cursor: pointer; }
.primary-button { gap: 6px; }
.primary-button .app-icon { width: 17px; height: 17px; stroke-width: 2.2; }
.primary-button { border: 1px solid var(--green); color: #fff; background: var(--green); box-shadow: 0 7px 16px rgba(40, 95, 72, .15); white-space: nowrap; }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { border: 1px solid #d8e4da; color: var(--green); background: #f2f8f3; }
.danger-button { border: 1px solid var(--pink); color: #fff; background: var(--pink); }
.secondary-button .app-icon { width: 17px; height: 17px; margin-right: 5px; stroke-width: 2; }
.primary-button .app-icon { width: 17px; height: 17px; margin-right: 2px; stroke-width: 2.1; }
.primary-button:disabled, .secondary-button:disabled { border-color: #dfe4df; color: #9aa69f; background: #f1f3f0; box-shadow: none; cursor: not-allowed; }
.secondary-link, .text-button, .danger-link { border: 0; color: var(--green); background: transparent; font-weight: 700; cursor: pointer; }
.secondary-link { font-size: 12px; }
.text-button { padding: 8px 0; font-size: 12px; }
.danger-link { padding: 0; color: var(--pink); font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.metric-grid article { min-width: 0; padding: 14px 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 12px rgba(46, 62, 53, .025); }
.metric-grid span { display: block; color: var(--muted); font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.metric-grid strong { display: block; margin-top: 6px; font-size: 18px; line-height: 1.1; overflow-wrap: anywhere; }
.dashboard-metrics article { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 46px; padding: 9px 10px; }
.dashboard-metrics { grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr) minmax(0, .85fr); }
.dashboard-metrics span, .dashboard-metrics strong { display: inline; margin: 0; overflow-wrap: normal; white-space: nowrap; }
.dashboard-metrics span { font-size: 11px; font-weight: 650; }
.dashboard-metrics strong { flex: 0 0 auto; font-size: 16px; }
.green { color: var(--green); }

.section-block { margin-top: 27px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-head h2, .form-section h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.section-head a { flex: 0 0 auto; color: var(--green); font-size: 12px; font-weight: 750; }
.icon-text-link { display: inline-flex; align-items: center; gap: 4px; }
.icon-text-link .app-icon { width: 15px; height: 15px; stroke-width: 2.1; }
.section-caption { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.status-grid a { display: flex; min-width: 0; min-height: 44px; align-items: center; justify-content: center; gap: 5px; padding: 6px 5px; border-right: 1px solid var(--line); text-align: center; white-space: nowrap; }
.status-grid a:last-child { border-right: 0; }
.status-grid strong { flex: 0 0 auto; color: var(--green); font-size: 16px; }
.status-grid span { min-width: 0; color: var(--muted); font-size: 10px; }

.watch-section { margin-top: 20px; }
.watch-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 7px; }
.watch-alert { display: flex; min-width: 0; min-height: 46px; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border: 1px solid #d5e2d8; border-radius: 15px; background: var(--paper); }
.watch-alert:hover { border-color: #a9c5b0; background: var(--green-soft); }
.watch-alert:focus-visible { outline: 3px solid rgba(40, 95, 72, .25); outline-offset: 2px; }
.watch-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.watch-icon .app-icon { width: 16px; height: 16px; stroke-width: 2; }
.watch-copy { display: flex; min-width: 0; align-items: baseline; gap: 3px; white-space: nowrap; }
.watch-copy strong, .watch-copy small { display: inline; }
.watch-copy strong { flex: 0 0 auto; font-size: 15px; line-height: 1; }
.watch-copy small { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; overflow-wrap: normal; }
.watch-arrow { width: 14px; height: 14px; color: var(--muted); stroke-width: 2.2; }
.watch-alert.is-urgent { border-color: #efc8cd; }
.watch-alert.is-urgent .watch-icon { color: var(--pink); background: var(--pink-soft); }

.order-list { display: grid; gap: 9px; }
.swipe-card { position: relative; min-width: 0; overflow: hidden; border-radius: 17px; background: var(--pink); }
.swipe-actions { position: absolute; inset: 0 0 0 auto; z-index: 1; display: flex; width: 96px; background: var(--pink); }
.swipe-actions form { display: flex; width: 100%; margin: 0; }
.swipe-delete { display: grid; width: 100%; place-content: center; gap: 4px; border: 0; color: #fff; background: transparent; cursor: pointer; text-align: center; }
.swipe-delete .app-icon { width: 21px; height: 21px; margin: 0 auto; stroke-width: 1.9; }
.swipe-delete small { font-size: 10px; font-weight: 800; }
.swipe-surface { position: relative; z-index: 2; touch-action: pan-y; transition: transform .18s ease; }
.swipe-surface:focus-visible { z-index: 3; outline: 3px solid rgba(40, 95, 72, .35); outline-offset: -3px; }
.order-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 14px rgba(46, 62, 53, .025); }
.order-card:hover { border-color: #cdded1; }
.interactive-order-card { grid-template-columns: minmax(0, 1fr) auto; }
.order-card-link { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; min-width: 0; }
.order-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 18px; font-weight: 800; }
.order-icon .app-icon { width: 22px; height: 22px; stroke-width: 1.85; }
.order-main { min-width: 0; }
.order-main strong, .order-main small { display: block; overflow-wrap: anywhere; }
.order-main strong { font-size: 14px; line-height: 1.25; }
.order-main small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.order-status-badge { display: inline-flex; align-items: baseline; gap: 5px; width: fit-content; max-width: 100%; margin-top: 6px; padding: 4px 7px; border: 1px solid #86ad91; border-radius: 8px; color: var(--green-dark); background: #deede1; line-height: 1.15; }
.order-status-label { flex: 0 0 auto; color: #527463; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.order-main .order-status-badge strong { display: inline; color: var(--green-dark); font-size: 11px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.order-customer-link { color: var(--ink); font-weight: 750; }
.order-customer-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.price { color: var(--green); font-size: 14px; white-space: nowrap; }
.price-pending { max-width: 105px; color: var(--pink); font-size: 11px; line-height: 1.2; text-align: right; white-space: normal; }
.order-actions { display: grid; justify-items: end; gap: 6px; min-width: 0; }
.order-actions form { margin: 0; }
.contact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.contact-action { display: grid; width: 40px; height: 40px; padding: 2px; place-items: center; border: 0; border-radius: 13px; background: transparent; touch-action: manipulation; }
.contact-action .brand-icon { width: 36px; height: 36px; }
.contact-action:hover { background: var(--green-soft); }
.contact-action:focus-visible { outline: 3px solid rgba(40, 95, 72, .25); outline-offset: 2px; }
.quick-status-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; max-width: 116px; padding: 5px 9px; border: 1px solid #cfe0d3; border-radius: 10px; color: var(--green); background: #f2f8f3; cursor: pointer; font-size: 10px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.quick-status-button .app-icon { flex: 0 0 auto; width: 13px; height: 13px; stroke-width: 2.2; }
.quick-status-button > span { display: grid; gap: 1px; text-align: left; }
.quick-status-button small { color: #668073; font-size: 8px; font-weight: 700; line-height: 1; }
.quick-status-button strong { font-size: 10px; font-weight: 850; line-height: 1.15; }
.quick-status-button:hover { border-color: #a9c5b0; background: var(--green-soft); }
.quick-status-button:focus-visible { outline: 3px solid rgba(40, 95, 72, .25); outline-offset: 2px; }
.compact-order-card { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 7px; min-height: 0; padding: 10px 11px; }
.compact-order-summary { display: grid; gap: 5px; min-width: 0; color: inherit; }
.compact-order-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.compact-order-name { min-width: 0; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.compact-order-heading .price { flex: 0 0 auto; margin: 0; text-align: right; }
.compact-order-heading .price-pending { max-width: none; white-space: nowrap; }
.compact-order-progress { display: flex; min-width: 0; align-items: center; gap: 6px; color: var(--green-dark); white-space: nowrap; }
.compact-order-progress .order-status-badge { flex: 0 0 auto; margin: 0; padding: 3px 6px; }
.compact-order-progress .order-status-badge strong { font-size: 10px; overflow-wrap: normal; }
.compact-order-footer { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.compact-order-location { min-width: 0; color: var(--muted); font-size: 10px; font-weight: 700; overflow-wrap: anywhere; }
.compact-order-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.compact-order-actions .contact-actions { gap: 3px; }
.compact-order-actions form { margin: 0; }
.compact-order-actions .contact-action { width: 40px; height: 40px; }
.compact-order-actions .quick-status-button { min-height: 40px; max-width: none; padding: 7px 9px; white-space: nowrap; }
.compact-order-actions .quick-status-button strong { font-size: 10px; white-space: nowrap; }
.next-action-card { gap: 1px; padding: 5px 10px; }
.next-action-card .compact-order-summary { gap: 1px; }
.next-action-card .compact-order-progress .order-status-badge { padding-top: 1px; padding-bottom: 1px; }
.next-action-card .compact-order-footer { gap: 6px; margin-top: -4px; }
.empty-state { display: grid; justify-items: start; gap: 7px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.empty-state span, .hint { color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.compact-empty { padding: 17px; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 7px; margin-bottom: 16px; scrollbar-width: thin; }
.filter-row a { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); font-size: 12px; white-space: nowrap; }
.filter-row a.selected { border-color: var(--green); color: #fff; background: var(--green); }
.active-alert-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -7px 0 14px; padding: 9px 11px; border: 1px solid #d5e2d8; border-radius: 13px; background: var(--green-soft); font-size: 11px; }
.active-alert-filter span { min-width: 0; overflow-wrap: anywhere; }
.active-alert-filter a { flex: 0 0 auto; color: var(--green); font-weight: 800; }
.swipe-hint { margin: -7px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.order-form { display: grid; gap: 15px; padding-bottom: 84px; }
.order-total-dock { position: fixed; bottom: calc(68px + env(safe-area-inset-bottom)); left: 50%; z-index: 29; width: min(calc(100% - 28px), 732px); transform: translateX(-50%); pointer-events: none; }
.order-total-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px 10px 15px; border: 1px solid #cbdccf; border-radius: 18px; background: rgba(255, 253, 249, .98); box-shadow: 0 -5px 22px rgba(36, 61, 49, .14); backdrop-filter: blur(14px); pointer-events: auto; }
.order-total-summary { display: grid; min-width: 0; }
.order-total-summary small { color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.2; }
.order-total-summary strong { color: var(--green-dark); font-size: 19px; font-weight: 900; line-height: 1.15; white-space: nowrap; }
.order-total-summary em { overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.order-total-submit { flex: 0 0 auto; min-width: 126px; min-height: 46px; padding: 10px 16px; }
.form-section { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 4px 15px rgba(46, 62, 53, .025); }
.form-section-head { margin-bottom: 14px; }
.form-section-head a { font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.form-section > label, .form-grid > label, .form-item { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.pending-price-note { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f0cbd0; border-radius: 12px; color: #93434d; background: var(--pink-soft); font-size: 11px; font-weight: 700; line-height: 1.4; }
.form-grid > label > span, .form-section > label > span { overflow-wrap: anywhere; }
label small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
input, select, textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: #fff; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: #8db59a; box-shadow: 0 0 0 3px rgba(141, 181, 154, .18); }
textarea { min-height: 70px; resize: vertical; }
.quantity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.quantity-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; min-width: 0; padding: 11px; border: 1px solid #eee7dc; border-radius: 14px; background: #fffefa; font-size: 11px; font-weight: 700; }
.quantity-card > span:first-child { grid-column: 1 / -1; overflow-wrap: anywhere; }
.quantity-card > small { grid-column: 1; align-self: center; }
.quantity-stepper { display: grid; grid-column: 2; grid-row: 2; grid-template-columns: 44px 50px 44px; align-items: stretch; overflow: hidden; border: 1px solid #d8e4da; border-radius: 12px; background: #fff; }
.quantity-stepper button { min-width: 44px; min-height: 44px; padding: 0; border: 0; color: var(--green); background: #f2f8f3; cursor: pointer; font-size: 21px; font-weight: 800; }
.quantity-stepper button:disabled { color: #aab7b0; background: #f7f8f6; cursor: default; }
.quantity-stepper input { width: 50px !important; min-height: 44px !important; padding: 5px 2px !important; border: 0; border-right: 1px solid #d8e4da; border-left: 1px solid #d8e4da; border-radius: 0; text-align: center; -moz-appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.quantity-stepper input:focus { position: relative; z-index: 1; border-color: #8db59a; box-shadow: inset 0 0 0 2px rgba(141, 181, 154, .25); }
.payment-controls-grid { align-items: start; }
.delivery-control, .adjustment-control { padding: 12px; border: 1px solid #eee7dc; border-radius: 14px; background: #fffefa; }
.delivery-control output { color: var(--green-dark); font-size: 21px; font-weight: 900; line-height: 1.1; }
.delivery-slider { min-height: 32px; padding: 0; border: 0; accent-color: var(--green); cursor: pointer; }
.delivery-slider:focus { border: 0; box-shadow: none; }
.delivery-shortcuts { display: flex; gap: 8px; }
.delivery-shortcuts button { min-width: 64px; min-height: 44px; padding: 7px 12px; border: 1px solid #cfe0d3; border-radius: 11px; color: var(--green); background: #f2f8f3; cursor: pointer; font-size: 13px; font-weight: 800; }
.delivery-shortcuts button.is-selected { border-color: var(--green); color: #fff; background: var(--green); }
.delivery-control.is-disabled { opacity: .72; }
.delivery-control.is-disabled .delivery-slider, .delivery-control.is-disabled .delivery-shortcuts button { cursor: default; }
.adjustment-stepper { display: grid; grid-template-columns: minmax(58px, auto) minmax(72px, 1fr) minmax(58px, auto); align-items: stretch; overflow: hidden; border: 1px solid #d8e4da; border-radius: 12px; }
.adjustment-stepper > button { min-height: 44px; padding: 5px 9px; border: 0; color: var(--green); background: #f2f8f3; cursor: pointer; font-size: 13px; font-weight: 850; }
.adjustment-input-wrap { position: relative; min-width: 0; border-right: 1px solid #d8e4da; border-left: 1px solid #d8e4da; background: #fff; }
.adjustment-input-wrap input { min-height: 44px; padding: 7px 24px 7px 6px; border: 0; border-radius: 0; text-align: center; -moz-appearance: textfield; }
.adjustment-input-wrap input::-webkit-inner-spin-button, .adjustment-input-wrap input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.adjustment-input-wrap > span { position: absolute; top: 50%; right: 8px; color: var(--muted); font-size: 12px; transform: translateY(-50%); pointer-events: none; }
.adjustment-control [data-adjustment-label] { color: var(--green); font-weight: 750; }
.quantity-stepper button:focus-visible, .delivery-shortcuts button:focus-visible, .adjustment-stepper > button:focus-visible { position: relative; z-index: 2; outline: 3px solid rgba(40, 95, 72, .25); outline-offset: -3px; }
.line-items-disclosure { margin-top: 18px; border-top: 1px solid #eee7dc; }
.line-items-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0 3px; cursor: pointer; list-style: none; }
.line-items-disclosure > summary::-webkit-details-marker { display: none; }
.disclosure-title { display: grid; gap: 4px; min-width: 0; }
.disclosure-title strong { font-size: 14px; }
.disclosure-title small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
.disclosure-action { flex: 0 1 auto; min-width: 0; color: var(--green); font-size: 11px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; text-align: right; }
.disclosure-closed, .disclosure-open { align-items: center; justify-content: flex-end; gap: 4px; }
.disclosure-closed { display: inline-flex; }
.disclosure-open { display: none; }
.disclosure-action .app-icon { flex: 0 0 auto; width: 15px; height: 15px; stroke-width: 2.1; }
.line-items-disclosure[open] .disclosure-closed { display: none; }
.line-items-disclosure[open] .disclosure-open { display: inline-flex; }
.line-items-disclosure .quantity-grid { margin-top: 12px; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 8px !important; margin: 4px 0 13px; font-weight: 600 !important; line-height: 1.35; }
.check-row input { width: auto; margin-top: 2px; }
.wide-button { width: 100%; }
.error { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #efc9ce; border-radius: 13px; color: #9b303a; background: var(--pink-soft); font-size: 13px; line-height: 1.4; }

.receipt-history-section[hidden] { display: none; }
.receipt-history-list { display: grid; gap: 8px; }
.receipt-history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border: 1px solid #eee7dc; border-radius: 13px; background: #fffefa; }
.receipt-history-item > div { min-width: 0; }
.receipt-history-item strong, .receipt-history-item small { display: block; overflow-wrap: anywhere; }
.receipt-history-item strong { font-size: 12px; }
.receipt-history-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.receipt-history-open { flex: 0 0 auto; min-height: 38px; padding: 0 13px; font-size: 11px; }

.receipt-layer { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; padding: 14px; background: rgba(23, 49, 42, .36); backdrop-filter: blur(4px); }
.receipt-layer[hidden] { display: none; }
.receipt-dialog { width: min(100%, 500px); max-height: min(88vh, 720px); overflow-y: auto; padding: 19px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 23px; background: var(--paper); box-shadow: 0 25px 60px rgba(23, 49, 42, .25); }
.receipt-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.receipt-dialog-head h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.receipt-close { flex: 0 0 auto; margin: -4px -4px 0 0; }
.receipt-close .app-icon { width: 18px; height: 18px; }
.receipt-feedback { min-height: 18px; margin: 10px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.receipt-feedback.is-error { color: #9b303a; font-weight: 700; }
.receipt-preview { padding: 16px; border: 1px solid #dce9de; border-radius: 16px; color: var(--ink); background: #f7fbf6; font-size: 14px; line-height: 1.45; }
.receipt-preview p, .receipt-preview div { margin: 0; }
.receipt-preview-gap { height: 12px; }
.receipt-preview-title, .receipt-preview-total { color: var(--green-dark); font-weight: 900; }
.receipt-preview-line { margin-top: 5px !important; }
.receipt-preview-thanks { margin-top: 12px !important; color: var(--muted); font-style: italic; }
.receipt-raw-details { margin-top: 10px; color: var(--muted); font-size: 11px; }
.receipt-raw-details summary { cursor: pointer; font-weight: 700; }
.receipt-raw-details pre { max-height: 170px; overflow: auto; margin: 8px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.receipt-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 9px; margin-top: 14px; }
.receipt-actions button { width: 100%; }

.customer-picker, .address-autocomplete { position: relative; margin-bottom: 14px; }
.customer-picker > label, .address-autocomplete > label { display: grid; gap: 5px; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.picker-input-row { display: flex; align-items: stretch; gap: 7px; }
.picker-input-row input { flex: 1 1 auto; min-width: 0; }
.picker-clear { flex: 0 0 auto; padding: 0 10px; border: 1px solid #d8e4da; border-radius: 11px; color: var(--green); background: #f2f8f3; cursor: pointer; font-size: 11px; font-weight: 750; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.picker-suggestions, .address-suggestions { max-height: 230px; overflow-y: auto; margin-top: 7px; border: 1px solid #dce7de; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.picker-option, .address-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid #f0ece5; color: var(--ink); background: #fff; cursor: pointer; text-align: left; }
.picker-option:last-child, .address-option:last-child { border-bottom: 0; }
.picker-option:hover, .address-option:hover { background: #f5faf6; }
.picker-option-main, .address-option > span:first-child { min-width: 0; }
.picker-option-main strong, .picker-option-main small, .address-option strong, .address-option small { display: block; overflow-wrap: anywhere; }
.picker-option-main strong, .address-option strong { font-size: 12px; }
.picker-option-main small, .address-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.picker-option-arrow { flex: 0 0 auto; color: var(--green); font-size: 10px; font-weight: 800; white-space: nowrap; }
.picker-empty { margin: 0; padding: 13px; color: var(--muted); font-size: 11px; }
.address-autocomplete > input:not([type="hidden"]) { display: block; }
.customer-fields { margin-bottom: 14px; }

.finance-glance, .finance-highlight { padding: 17px; border: 1px solid #dce9de; border-radius: 19px; background: linear-gradient(135deg, #f3f8f1 0%, #eaf3eb 100%); }
.finance-page-head { align-items: center; }
.period-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid #d8e4da; border-radius: 14px; background: #edf4ee; }
.period-switch a { min-width: 75px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 750; text-align: center; }
.period-switch a.active { color: #fff; background: var(--green); box-shadow: 0 4px 10px rgba(40, 95, 72, .16); }
.finance-glance .section-head, .finance-highlight .section-head { margin-bottom: 15px; }
.finance-glance-top, .finance-highlight-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.finance-glance-top span, .finance-highlight-top span { display: block; color: var(--muted); font-size: 11px; }
.finance-glance-top strong { display: block; margin-top: 4px; color: var(--green); font-size: 24px; }
.finance-glance-rate, .finance-highlight-top > span { text-align: right; }
.finance-glance-rate strong { display: block; color: var(--green); font-size: 19px; }
.finance-glance-rate span { margin-top: 3px; }
.progress-track { height: 8px; overflow: hidden; margin-top: 15px; border-radius: 999px; background: rgba(40, 95, 72, .13); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.finance-glance-foot, .finance-highlight-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.dashboard-finance { margin-top: 14px; padding: 11px 13px; border-radius: 16px; }
.dashboard-finance .section-head { margin-bottom: 5px; }
.dashboard-finance .finance-glance-top { align-items: center; }
.dashboard-finance .finance-glance-top > div:first-child, .dashboard-finance .finance-glance-rate { display: flex; align-items: baseline; gap: 5px; }
.dashboard-finance .finance-glance-top > div:first-child strong { order: -1; margin: 0; font-size: 19px; }
.dashboard-finance .finance-glance-rate strong { font-size: 16px; }
.dashboard-finance .finance-glance-rate span { margin: 0; }
.dashboard-finance .progress-track { height: 4px; margin-top: 6px; }
.dashboard-finance .finance-glance-foot { margin-top: 5px; }
.dashboard-progress, .next-actions-section { margin-top: 15px; }
.dashboard-progress .section-head { margin-bottom: 7px; }
.finance-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-highlight-top .eyebrow { margin-bottom: 4px; }
.finance-highlight-top > div > strong { color: var(--green); font-size: 29px; letter-spacing: -.04em; }
.expense-breakdown { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.expense-breakdown-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.expense-breakdown-row > div:first-child span { overflow-wrap: anywhere; }
.expense-breakdown-row > div:first-child strong { color: var(--green); white-space: nowrap; }
.expense-bar { height: 7px; overflow: hidden; margin-top: 7px; border-radius: 999px; background: #edf0eb; }
.expense-bar span { display: block; height: 100%; border-radius: inherit; background: #d18b91; }
.expense-breakdown-row > small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.expense-form { display: grid; gap: 13px; }
.expense-list { display: grid; gap: 9px; }
.expense-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.expense-card-main { min-width: 0; }
.expense-card-main strong, .expense-card-main small { display: block; overflow-wrap: anywhere; }
.expense-card-main strong { font-size: 13px; }
.expense-card-main small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.expense-card-side { display: grid; justify-items: end; gap: 6px; flex: 0 0 auto; }

.search-form { margin-bottom: 14px; }
.search-field { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; gap: 8px !important; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.search-field > .app-icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.search-field input { padding: 11px 0; border: 0; box-shadow: none; }
.customer-list { display: grid; gap: 9px; }
.customer-card { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 14px rgba(46, 62, 53, .025); }
.customer-card:hover { border-color: #cdded1; }
.customer-avatar { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 850; }
.customer-avatar.large { flex-basis: 52px; width: 52px; height: 52px; border-radius: 17px; font-size: 15px; }
.customer-main { min-width: 0; flex: 1 1 auto; }
.customer-main strong, .customer-main small { display: block; overflow-wrap: anywhere; }
.customer-main strong { font-size: 13px; }
.customer-main small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.customer-total { flex: 0 0 auto; text-align: right; }
.customer-total strong, .customer-total small { display: block; }
.customer-total strong { color: var(--green); font-size: 14px; white-space: nowrap; }
.customer-total small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.customer-profile { padding: 17px; border: 1px solid #dce9de; border-radius: 19px; background: #f3f8f1; }
.customer-profile-top { display: flex; align-items: center; gap: 12px; }
.customer-profile-top > div { min-width: 0; }
.customer-profile-top strong, .customer-profile-top small { display: block; overflow-wrap: anywhere; }
.customer-profile-top strong { font-size: 14px; }
.customer-profile-top small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.profile-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #dce9de; color: var(--muted); font-size: 11px; line-height: 1.45; }
.profile-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #dce9de; }
.profile-actions form { margin: 0; }
.profile-actions .secondary-button, .profile-actions .danger-button { min-height: 40px; font-size: 12px; }
.customer-metrics { margin-top: 13px; }

.tour-day { padding: 16px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255, 253, 249, .58); }
.tour-day + .tour-day { margin-top: 16px; }
.tour-day-head { margin-bottom: 14px; }
.tour-group { margin: 15px 0 7px; }
.tour-group + .tour-group { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.tour-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 9px; color: var(--green); font-size: 14px; }
.tour-group h3 span { overflow-wrap: anywhere; }
.tour-group h3 small { color: var(--muted); font-size: 10px; font-weight: 500; text-align: right; }
.tour-stop-list { display: grid; gap: 10px; }
.tour-stop-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 14px rgba(46, 62, 53, .025); }
.tour-stop-main { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px 11px; min-width: 0; padding: 13px; }
.tour-stop-main:hover { background: #fffefa; }
.tour-stop-main:focus-visible { outline: 3px solid rgba(40, 95, 72, .25); outline-offset: -3px; }
.tour-stop-details { min-width: 0; }
.tour-stop-details strong, .tour-stop-details small { display: block; overflow-wrap: anywhere; }
.tour-stop-details strong { font-size: 14px; line-height: 1.25; }
.tour-stop-details small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.tour-stop-details .tour-address-missing { color: var(--pink); font-weight: 700; }
.tour-operation-badge { justify-self: end; padding: 5px 8px; border: 1px solid #86ad91; border-radius: 9px; color: var(--green-dark); background: #deede1; font-size: 10px; font-weight: 850; line-height: 1.2; text-align: center; white-space: nowrap; }
.tour-operation-badge.is-return { border-color: #e3b7bc; color: #93434d; background: var(--pink-soft); }
.tour-operation-badge.is-combined { border-color: #c9bfae; color: var(--ink); background: linear-gradient(135deg, var(--green-soft), var(--pink-soft)); }
.tour-order-link { display: inline-flex; grid-column: 2 / -1; align-items: center; justify-content: flex-end; gap: 4px; color: var(--green); font-size: 10px; font-weight: 800; }
.tour-order-link .app-icon { width: 14px; height: 14px; stroke-width: 2.2; }
.tour-stop-actions { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #eee7dc; }
.tour-action { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 1px; border: 0; border-radius: 14px; background: transparent; touch-action: manipulation; }
.tour-action .brand-icon { width: 42px; height: 42px; }
.tour-action:hover { background: var(--green-soft); }
.tour-action:focus-visible { outline: 3px solid rgba(40, 95, 72, .25); outline-offset: 2px; }

.confirm-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(23, 49, 42, .34); backdrop-filter: blur(4px); }
.confirm-layer[hidden] { display: none; }
.confirm-dialog { width: min(100%, 370px); padding: 22px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 23px; background: var(--paper); box-shadow: 0 25px 60px rgba(23, 49, 42, .25); }
.confirm-icon { display: grid; width: 38px; height: 38px; margin-bottom: 13px; place-items: center; border-radius: 13px; color: var(--pink); background: var(--pink-soft); font-size: 19px; font-weight: 900; }
.confirm-icon .app-icon { width: 21px; height: 21px; stroke-width: 2; }
.confirm-dialog h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.confirm-dialog > p:not(.eyebrow) { margin: 9px 0 19px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.confirm-actions button { width: 100%; }

.toast-region { position: fixed; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 14px; z-index: 55; display: flex; justify-content: center; pointer-events: none; }
.app-toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: min(100%, 410px); min-height: 50px; padding: 9px 9px 9px 12px; border: 1px solid #cfe0d3; border-radius: 16px; color: var(--ink); background: rgba(255, 253, 249, .98); box-shadow: 0 14px 34px rgba(23, 49, 42, .18); pointer-events: auto; animation: toast-in .22s ease-out both; backdrop-filter: blur(10px); }
.app-toast.is-leaving { animation: toast-out .2s ease-in both; }
.toast-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); }
.toast-icon .app-icon { width: 18px; height: 18px; stroke-width: 2.2; }
.toast-message { min-width: 0; font-size: 12px; font-weight: 780; line-height: 1.3; overflow-wrap: anywhere; }
.toast-close { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.toast-close:hover { background: var(--green-soft); }
.toast-close .app-icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(.98); } }

.login-card { width: min(100%, 410px); margin: 11vh auto 0; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.login-logo { display: block; width: min(100%, 190px); height: auto; margin: 0 auto 14px; }
.login-card h1 { margin: 0; font: 500 31px/1.1 Georgia, "Times New Roman", serif; }
.lead { color: var(--muted); line-height: 1.45; }
.stack-form { display: grid; gap: 14px; margin-top: 24px; }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255, 253, 249, .98); box-shadow: 0 -4px 16px rgba(36, 61, 49, .06); backdrop-filter: blur(12px); }
.bottom-nav a { position: relative; display: flex; min-width: 0; min-height: 68px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 7px 1px 6px; color: var(--muted); font-size: clamp(11.5px, 3.2vw, 12.5px); line-height: 1; text-align: center; white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bottom-nav a::before { position: absolute; top: 0; width: 24px; height: 3px; border-radius: 0 0 999px 999px; background: transparent; content: ""; }
.bottom-nav a .app-icon { width: 21px; height: 21px; stroke-width: 1.75; }
.bottom-nav a.active { color: var(--green); font-weight: 800; background: linear-gradient(180deg, rgba(232, 240, 234, .72), rgba(255, 253, 249, 0) 78%); }
.bottom-nav a.active::before { background: var(--green); }
.bottom-nav a.active .app-icon { stroke-width: 2.2; }
.bottom-nav a:focus-visible { outline: 3px solid rgba(40, 95, 72, .28); outline-offset: -4px; }

@media (max-width: 560px) {
  .app-header { padding-right: 14px; padding-left: 14px; }
  .page-shell { padding-right: 14px; padding-left: 14px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 29px; }
  .metric-grid { gap: 7px; }
  .metric-grid article { padding: 12px 9px; }
  .metric-grid strong { font-size: 16px; }
  .dashboard-metrics article { padding: 8px 7px; }
  .dashboard-metrics span { font-size: 10px; }
  .dashboard-metrics strong { font-size: 14px; }
  .finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interactive-order-card, .order-card-full.interactive-order-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .interactive-order-card .order-card-link { grid-template-columns: 38px minmax(0, 1fr); }
  .interactive-order-card .order-icon { width: 38px; height: 38px; font-size: 16px; }
  .compact-order-card, .order-card-full.compact-order-card { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .tour-day { padding: 13px; }
  .tour-stop-main { grid-template-columns: 38px minmax(0, 1fr); }
  .tour-stop-main .order-icon { width: 38px; height: 38px; }
  .tour-operation-badge { grid-column: 2; justify-self: start; }
  .tour-order-link { grid-column: 2; }
  .tour-stop-actions { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .quantity-grid { grid-template-columns: 1fr; }
  .quantity-card { align-items: center; }
  .finance-glance-foot, .finance-highlight-foot { flex-wrap: wrap; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .profile-actions .secondary-button, .profile-actions .danger-button { width: 100%; }
}

/* Safari/Chrome iOS zoome automatiquement les champs dont la taille est
   inférieure à 16 px. Garder 16 px au toucher évite que la page reste
   agrandie après la saisie, sans désactiver le zoom manuel d'accessibilité. */
@media (max-width: 767px) {
  input, select, textarea { font-size: 16px !important; }
}

@media (max-width: 370px) {
  .brand small { display: none; }
  .primary-button { padding-right: 11px; padding-left: 11px; }
  .form-section { padding: 14px; }
  .confirm-actions { grid-template-columns: 1fr; }
  .finance-page-head { flex-wrap: wrap; }
  .period-switch { width: 100%; }
  .order-total-bar { gap: 8px; padding-left: 12px; }
  .order-total-submit { min-width: 108px; padding-right: 11px; padding-left: 11px; }
  .quantity-stepper { grid-template-columns: 42px 46px 42px; }
  .quantity-stepper button { min-width: 42px; }
  .quantity-stepper input { width: 46px !important; }
  .adjustment-stepper { grid-template-columns: 56px minmax(66px, 1fr) 56px; }
  .watch-alert { gap: 3px; padding-right: 3px; padding-left: 3px; }
  .watch-icon { flex-basis: 24px; width: 24px; height: 24px; }
  .watch-icon .app-icon { width: 14px; height: 14px; }
  .watch-copy { gap: 2px; }
  .watch-copy strong { font-size: 13px; }
  .watch-copy small { font-size: 9px; }
  .compact-order-card { padding-right: 8px; padding-left: 8px; }
  .next-action-card { padding-top: 5px; padding-bottom: 5px; }
  .compact-order-progress { gap: 4px; }
  .compact-order-actions { gap: 3px; }
  .compact-order-actions .quick-status-button { padding-right: 7px; padding-left: 7px; }
}
