:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --surface-soft: #f0eee6;
  --ink: #17251f;
  --muted: #6a746f;
  --line: #dedfd8;
  --primary: #174d3a;
  --primary-2: #246c52;
  --primary-soft: #e5f0e9;
  --red: #c73e34;
  --red-soft: #fae9e6;
  --gold: #b67c13;
  --gold-soft: #fff2cf;
  --blue: #2d6588;
  --blue-soft: #e7f2f8;
  --shadow: 0 12px 36px rgb(36 46 41 / 9%);
  --shadow-soft: 0 6px 18px rgb(36 46 41 / 7%);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --header-h: 72px;
  --nav-h: 78px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgb(244 200 90 / 14%) 0 110px, transparent 111px),
    radial-gradient(circle at 95% 14%, rgb(199 62 52 / 7%) 0 140px, transparent 141px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 14px;
  color: white;
  background: var(--primary);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; min-height: 100dvh; }
.app-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(247 244 236 / 88%);
  border-bottom: 1px solid rgb(222 223 216 / 72%);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #f8d66f;
  background: var(--primary);
  border-radius: 15px;
  font-size: 26px;
  box-shadow: var(--shadow-soft);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.25; letter-spacing: -.2px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.icon-button, .close-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:active, .close-button:active { transform: scale(.96); }

#main-content {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-h) + env(safe-area-inset-top) + 18px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 40px);
  outline: none;
}

.page-header { margin: 2px 2px 18px; }
.eyebrow { margin: 0 0 5px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-header h1 { margin: 0; font-size: clamp(27px, 8vw, 38px); line-height: 1.08; letter-spacing: -.8px; }
.page-header p:last-child { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 22px;
  color: white;
  background: linear-gradient(135deg, #174d3a, #23674e 72%, #2a785c);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 42px rgb(23 77 58 / 20%);
}
.hero::after {
  content: "✿";
  position: absolute;
  right: -18px;
  bottom: -52px;
  color: rgb(255 255 255 / 8%);
  font-size: 180px;
  line-height: 1;
}
.hero-label { margin: 0 0 7px; color: rgb(255 255 255 / 72%); font-size: 13px; font-weight: 700; }
.hero-value { position: relative; z-index: 1; margin: 0; font-size: clamp(30px, 9vw, 45px); line-height: 1; letter-spacing: -1.4px; }
.hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: rgb(255 255 255 / 86%); font-size: 13px; }
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.summary-card {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgb(222 223 216 / 82%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.summary-card.wide { grid-column: 1 / -1; }
.summary-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-icon.gold { color: var(--gold); background: var(--gold-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.summary-value { margin: 12px 0 3px; font-size: clamp(19px, 5.5vw, 26px); font-weight: 850; line-height: 1; letter-spacing: -.5px; overflow-wrap: anywhere; }
.summary-hint { color: var(--muted); font-size: 12px; }

.section { margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.25px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.text-button { min-height: 40px; padding: 8px 4px; color: var(--primary-2); background: none; border: 0; font-weight: 750; cursor: pointer; }

.order-list, .consignment-list { display: grid; gap: 10px; }
.order-card, .consignment-card {
  position: relative;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
button.order-card, button.consignment-card { cursor: pointer; }
.order-card:active, .consignment-card:active { transform: scale(.994); }
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-name { min-width: 0; margin: 0; font-size: 16px; font-weight: 820; line-height: 1.35; }
.order-sub { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 5px; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-paid { color: var(--primary-2); background: var(--primary-soft); }
.status-partial { color: var(--gold); background: var(--gold-soft); }
.status-unpaid { color: var(--red); background: var(--red-soft); }
.status-free { color: var(--blue); background: var(--blue-soft); }
.order-finance { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line); }
.order-finance span { display: block; color: var(--muted); font-size: 11px; }
.order-finance strong { display: block; margin-top: 3px; font-size: 14px; }
.order-finance > :last-child { text-align: right; }
.debt { color: var(--red); }
.paid-text { color: var(--primary-2); }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap svg { position: absolute; top: 50%; left: 14px; width: 20px; height: 20px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-input {
  width: 100%;
  min-height: 50px;
  padding: 12px 44px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  font-size: 16px;
}
.search-input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgb(36 108 82 / 12%); }
.clear-search { position: absolute; top: 50%; right: 6px; width: 40px; height: 40px; padding: 0; color: var(--muted); background: none; border: 0; transform: translateY(-50%); cursor: pointer; }

.filter-chips { display: flex; gap: 8px; margin: 0 -16px 16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip { min-height: 40px; padding: 8px 14px; white-space: nowrap; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 750; cursor: pointer; }
.chip.is-active { color: white; background: var(--primary); border-color: var(--primary); }

.result-count { margin: 0 2px 10px; color: var(--muted); font-size: 13px; }
.empty-state { padding: 34px 22px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--primary-2); background: var(--primary-soft); border-radius: 20px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); }
.empty-state p { max-width: 360px; margin: 0 auto 16px; line-height: 1.5; }

.product-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.product-list { display: grid; gap: 10px; }
.product-row { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.product-row-head, .product-row-meta { display: flex; justify-content: space-between; gap: 12px; }
.product-row-head strong { font-size: 15px; }
.product-row-head span { color: var(--primary-2); font-size: 14px; font-weight: 800; white-space: nowrap; }
.product-row-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.product-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.product-stats div { min-width: 0; }
.product-stats div:not(:last-child) { padding-right: 7px; border-right: 1px solid var(--line); }
.product-stats span, .product-stats strong { display: block; }
.product-stats span { color: var(--muted); font-size: 10px; }
.product-stats strong { margin-top: 3px; font-size: 14px; }
.product-stats .product-debt { color: var(--red); }
.product-stats .product-ok { color: var(--primary-2); }
.product-availability { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.product-availability strong { color: var(--primary); }
.product-actions { display: flex; gap: 7px; margin-top: 9px; }
.product-actions button { margin-top: 0; }
.product-edit { min-height: 38px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; color: var(--primary); background: var(--primary-soft); border: 1px solid #c8ded2; border-radius: 10px; font-size: 11px; font-weight: 750; cursor: pointer; }
.product-edit svg { width: 15px; height: 15px; }
.bar-track { height: 7px; margin-top: 12px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary-2), #5ca57e); border-radius: inherit; }
.catalog-note { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 18px; padding: 11px 12px; color: #53635b; background: var(--primary-soft); border-radius: 13px; font-size: 12px; line-height: 1.45; }
.catalog-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--primary-2); }
.product-delete { min-height: 38px; display: inline-flex; align-items: center; gap: 5px; margin-top: 11px; padding: 6px 9px; color: #93605a; background: transparent; border: 1px solid #ead7d2; border-radius: 10px; font-size: 11px; font-weight: 750; cursor: pointer; }
.product-delete svg { width: 15px; height: 15px; }

.consignment-card { display: flex; align-items: center; gap: 13px; }
.pot-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--gold); background: var(--gold-soft); border-radius: 14px; }
.pot-icon svg { width: 22px; height: 22px; }
.consignment-content { flex: 1; min-width: 0; }
.consignment-content strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consignment-content span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.quantity-badge { min-width: 40px; padding: 8px 10px; text-align: center; color: var(--primary); background: var(--primary-soft); border-radius: 12px; font-weight: 850; }

.fab {
  position: fixed;
  z-index: 45;
  right: 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 17px;
  color: white;
  background: var(--red);
  border: 0;
  border-radius: 17px;
  box-shadow: 0 12px 30px rgb(199 62 52 / 28%);
  font-weight: 800;
  cursor: pointer;
}
.fab svg { width: 21px; height: 21px; stroke-width: 2.3; }
.fab:active { transform: translateY(1px) scale(.98); }
.fab.is-hidden { display: none; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px env(safe-area-inset-bottom);
  background: rgb(255 253 248 / 94%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.nav-item { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px 2px; color: var(--muted); background: none; border: 0; border-radius: 12px; font-size: 10px; font-weight: 750; cursor: pointer; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.is-active { color: var(--primary); background: var(--primary-soft); }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgb(14 24 20 / 54%); backdrop-filter: blur(3px); animation: fade-in .16s ease-out; }
.sheet { width: 100%; max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: 0 -16px 50px rgb(0 0 0 / 18%); animation: sheet-up .2s ease-out; }
.sheet-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { margin: 0; font-size: 19px; }
.sheet-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet-footer { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.sheet-footer .button { flex: 1; }

.form-section { margin: 0 0 24px; padding: 0; border: 0; }
.form-section legend { width: 100%; margin-bottom: 12px; padding: 0; font-size: 15px; font-weight: 850; }
.form-grid { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label, .field-label { color: #49564f; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 16px;
}
.field textarea { min-height: 82px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgb(36 108 82 / 11%); }
.field small { color: var(--muted); line-height: 1.4; }
.check-card { min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 11px 12px; background: white; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.check-card input { position: absolute; opacity: 0; pointer-events: none; }
.check-card > span:first-of-type { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.check-card > span:first-of-type svg { width: 18px; height: 18px; opacity: 0; }
.check-card input:checked + span { color: white; background: var(--primary-2); border-color: var(--primary-2); }
.check-card input:checked + span svg { opacity: 1; }
.check-card input:focus-visible + span { box-shadow: 0 0 0 3px rgb(36 108 82 / 18%); }
.check-card strong, .check-card small { display: block; }
.check-card strong { font-size: 14px; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 38px; }
.input-suffix span { position: absolute; top: 50%; right: 12px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }

.line-items { display: grid; gap: 10px; }
.line-item { position: relative; padding: 13px; background: #faf9f4; border: 1px solid var(--line); border-radius: 16px; }
.line-item-number { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 800; }
.remove-item { position: absolute; top: 5px; right: 5px; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: var(--red); background: transparent; border: 0; border-radius: 11px; cursor: pointer; }
.remove-item svg { width: 18px; height: 18px; }
.item-total { margin: 9px 2px 0; text-align: right; color: var(--primary); font-size: 12px; font-weight: 800; }
.add-line-button { width: 100%; min-height: 46px; margin-top: 10px; color: var(--primary); background: var(--primary-soft); border: 1px dashed #93b4a3; border-radius: 14px; font-weight: 800; cursor: pointer; }

.finance-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 13px; background: var(--primary-soft); border-radius: 16px; }
.finance-preview div { min-width: 0; }
.finance-preview div:not(:last-child) { padding-right: 6px; border-right: 1px solid #cadfd2; }
.finance-preview span { display: block; color: var(--muted); font-size: 10px; }
.finance-preview strong { display: block; margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.finance-preview .is-debt { color: var(--red); }
.addition-preview { margin: 10px 2px 0; color: var(--muted); text-align: right; font-size: 13px; }
.addition-preview strong { color: var(--primary); }

.order-detail { display: grid; gap: 18px; }
.detail-finance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 15px; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-radius: 18px; }
.detail-finance div { min-width: 0; }
.detail-finance div:not(:last-child) { padding-right: 7px; border-right: 1px solid rgb(255 255 255 / 18%); }
.detail-finance span, .detail-finance strong { display: block; }
.detail-finance span { color: rgb(255 255 255 / 72%); font-size: 10px; }
.detail-finance strong { margin-top: 5px; color: white; font-size: clamp(12px, 3.3vw, 15px); overflow-wrap: anywhere; }
.detail-finance .debt { color: #ffd19d; }
.detail-finance .paid-text { color: #c7f3da; }
.settled-note { display: flex; align-items: center; gap: 7px; margin: -8px 0 0; padding: 10px 12px; color: var(--primary); background: var(--primary-soft); border-radius: 12px; font-size: 12px; font-weight: 750; }
.settled-note svg { width: 17px; height: 17px; }
.settle-button { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: -8px; color: var(--primary); background: transparent; border: 1px dashed #86ad99; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.settle-button svg { width: 17px; height: 17px; }
.detail-section { padding: 15px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.detail-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-section-head h3 { margin: 0; font-size: 16px; }
.detail-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.detail-section-head > strong { color: var(--primary-2); font-size: 17px; }
.fulfillment-overall { height: 9px; margin: 12px 0 14px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.fulfillment-overall span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #e5b64a); border-radius: inherit; }
.fulfillment-list { display: grid; gap: 12px; }
.fulfillment-row { padding-top: 11px; border-top: 1px dashed var(--line); }
.fulfillment-row:first-child { padding-top: 0; border-top: 0; }
.fulfillment-row-head, .fulfillment-row-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fulfillment-row-head strong { font-size: 13px; }
.fulfillment-row-head span { color: var(--red); font-size: 12px; font-weight: 800; }
.fulfillment-row-meta { margin-top: 4px; color: var(--muted); font-size: 11px; }
.fulfillment-row .bar-track { height: 5px; margin-top: 7px; }
.muted-copy { margin: 0; color: var(--muted); font-size: 13px; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-action { min-width: 0; min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 10px; text-align: left; border: 0; border-radius: 16px; cursor: pointer; }
.quick-action > svg { width: 23px; height: 23px; }
.quick-action span, .quick-action strong, .quick-action small { display: block; min-width: 0; }
.quick-action strong { font-size: 13px; }
.quick-action small { margin-top: 3px; color: inherit; opacity: .72; font-size: 9px; line-height: 1.25; }
.quick-action.pickup { color: var(--blue); background: var(--blue-soft); }
.quick-action.payment { color: var(--primary); background: var(--primary-soft); }
.quick-action.addition { color: var(--gold); background: var(--gold-soft); }

.timeline { position: relative; display: grid; gap: 0; margin-top: 12px; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 17px; width: 2px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 30px; gap: 10px; padding: 10px 0; }
.timeline-item.original { grid-template-columns: 36px minmax(0, 1fr); }
.timeline-icon { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 4px solid white; border-radius: 50%; }
.timeline-icon svg { width: 16px; height: 16px; }
.timeline-item.payment .timeline-icon { color: var(--primary); background: var(--primary-soft); }
.timeline-item.pickup .timeline-icon { color: var(--blue); background: var(--blue-soft); }
.timeline-item.addition .timeline-icon { color: var(--gold); background: var(--gold-soft); }
.timeline-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.timeline-title strong { font-size: 13px; }
.timeline-title time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.timeline-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-style: italic; }
.timeline-delete { width: 30px; height: 30px; display: grid; place-items: center; align-self: center; padding: 0; color: #9a746e; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.timeline-delete svg { width: 15px; height: 15px; }
.detail-tools { display: grid; gap: 8px; }
.detail-tools .button { text-decoration: none; }

.pickup-input-list { display: grid; gap: 9px; }
.pickup-input { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 12px; padding: 11px 12px; background: #faf9f4; border: 1px solid var(--line); border-radius: 14px; }
.pickup-input strong, .pickup-input small { display: block; }
.pickup-input strong { font-size: 13px; }
.pickup-input small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.pickup-input input { min-height: 44px; padding-right: 32px; text-align: right; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 14px; font-weight: 820; cursor: pointer; }
.button svg { width: 19px; height: 19px; }
.button-primary { color: white; background: var(--primary); }
.button-secondary { color: var(--primary); background: var(--primary-soft); }
.button-danger { color: var(--red); background: var(--red-soft); }
.button-outline { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.button:disabled { opacity: .45; cursor: not-allowed; }

.settings-list { display: grid; gap: 10px; }
.settings-action { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.settings-action > svg { width: 24px; height: 24px; color: var(--primary-2); }
.settings-action > span { flex: 1; }
.settings-action strong, .settings-action small { display: block; }
.settings-action small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.settings-action.danger > svg, .settings-action.danger strong { color: var(--red); }
.data-note { margin: 18px 2px 0; padding: 12px; color: var(--muted); background: var(--surface-soft); border-radius: 13px; font-size: 12px; line-height: 1.5; }

.confirm-message { margin: 0; color: var(--muted); line-height: 1.55; }
.loading-state { min-height: 60vh; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.loader { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.error-state code { display: block; max-width: 100%; margin: 12px 0; padding: 10px; overflow-x: auto; color: var(--red); background: var(--red-soft); border-radius: 10px; }
.login-page { min-height: calc(100vh - var(--header-h) - 40px); display: grid; place-items: center; padding: 24px 0; }
.login-card { width: min(100%, 430px); padding: 26px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.login-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 18px; color: #f8d66f; background: var(--primary); border-radius: 19px; font-size: 34px; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.7px; }
.login-card > p:not(.eyebrow) { margin: 8px 0 20px; color: var(--muted); line-height: 1.5; }
.login-error { margin: 0 0 14px; padding: 10px 12px; color: var(--red); background: var(--red-soft); border-radius: 12px; font-size: 13px; }
.user-list { display: grid; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 11px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.user-row > div { min-width: 0; }
.user-row strong, .user-row small { display: block; }
.user-row strong { font-size: 14px; }
.user-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.user-create { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.toast-region { position: fixed; z-index: 200; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); width: min(calc(100% - 32px), 430px); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 13px 16px; color: white; background: #26362f; border-radius: 14px; box-shadow: var(--shadow); font-size: 13px; font-weight: 720; animation: toast-in .18s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .7; } }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (min-width: 720px) {
  #main-content { padding-left: 24px; padding-right: 24px; }
  .app-header { padding-left: max(24px, calc((100vw - 1120px) / 2 + 24px)); padding-right: max(24px, calc((100vw - 1120px) / 2 + 24px)); }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card.wide { grid-column: auto; }
  .dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 22px; align-items: start; }
  .order-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-page .order-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consignment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { left: 50%; right: auto; bottom: 16px; width: min(560px, calc(100% - 32px)); height: 68px; padding: 6px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); transform: translateX(-50%); }
  .fab { right: max(24px, calc((100vw - 1120px) / 2 + 24px)); bottom: 30px; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .sheet { width: min(680px, 100%); max-height: min(88vh, 820px); border-radius: 24px; }
  .sheet.sheet-sm { width: min(500px, 100%); }
  .sheet-body { padding: 22px; }
  .sheet-header, .sheet-footer { padding-left: 22px; padding-right: 22px; }
}

@media (min-width: 1000px) {
  .orders-page .order-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .fab span { display: none; }
  .fab { width: 50px; justify-content: center; padding: 0; border-radius: 50%; }
  .status-pill { padding: 6px 7px; }
  .finance-preview { grid-template-columns: 1fr; }
  .finance-preview div:not(:last-child) { padding: 0 0 6px; border-right: 0; border-bottom: 1px solid #cadfd2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
