/* ============================================================
   SKIWAY Order Desk — mobile-first customer order dashboard
   ============================================================ */

:root {
  --ink: #162722;
  --ink-2: #3a4c46;
  --muted: #5f7069;
  --muted-2: #63736c;
  --line: #e7ece8;
  --line-soft: #f0f3f0;
  --surface: #ffffff;
  --canvas: #f5f7f3;
  --forest: #0b3b34;
  --forest-deep: #072d29;
  --mint: #c9f6df;
  --green: #0d8a58;
  --green-bg: #e2f7ec;
  --blue: #2f5fc9;
  --blue-bg: #eaf0ff;
  --amber: #a26708;
  --amber-bg: #fff2d9;
  --danger: #d84c58;
  --shadow-card: 0 10px 28px rgba(11, 59, 52, 0.055), 0 1px 3px rgba(11, 59, 52, 0.025);
  --shadow-float: 0 22px 48px rgba(7, 42, 35, 0.18);
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 12% -8%, rgba(24, 137, 105, 0.17), transparent 60%),
    radial-gradient(ellipse 65% 45% at 100% 4%, rgba(190, 242, 216, 0.5), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 105%, rgba(158, 201, 178, 0.26), transparent 65%),
    #edf2ed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid #5cc59a;
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--canvas);
  isolation: isolate;
}

/* ------------------------------------------------------------
   Masthead
   ------------------------------------------------------------ */
.masthead {
  position: relative;
  z-index: 2;
  padding: calc(14px + env(safe-area-inset-top)) 18px 18px;
  color: #fff;
  border-radius: 0 0 30px 30px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(190, 242, 216, 0.16), transparent 55%),
    radial-gradient(90% 75% at -10% 100%, rgba(23, 169, 116, 0.24), transparent 58%),
    linear-gradient(137deg, #0c4038 0%, #082d2d 56%, #0b373d 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.masthead-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.masthead-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse at 82% 4%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 82% 4%, #000 0%, transparent 68%);
}

.masthead-orbit {
  position: absolute;
  top: -205px;
  right: -145px;
  z-index: 0;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(200, 245, 223, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.masthead-orbit::before,
.masthead-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(200, 245, 223, 0.075);
}

.masthead-orbit::before {
  inset: 42px;
}

.masthead-orbit::after {
  inset: 110px;
  background: radial-gradient(circle, rgba(201, 246, 223, 0.08), transparent 68%);
}

.topbar,
.hero,
.filter-card {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  padding: 2px 0;
  text-decoration: none;
}

.brand-logo-full {
  display: block;
  width: auto;
  height: 52px;
  max-width: 120px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.16));
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: rgba(232, 255, 245, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.live-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8ef0c0;
  box-shadow: 0 0 0 3px rgba(142, 240, 192, 0.13);
  animation: livePulse 2.4s ease-in-out infinite;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.icon-button:active {
  background: rgba(255, 255, 255, 0.14);
}

.icon-button .icon {
  font-size: 16px;
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 5px;
  height: 5px;
  border: 1px solid #0b3734;
  border-radius: 50%;
  background: #ffb069;
}

.hero {
  margin-top: 20px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: rgba(207, 246, 228, 0.58);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 1.6px;
}

.eyebrow > span {
  width: 18px;
  height: 1px;
  background: rgba(200, 245, 223, 0.58);
}

.hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(29px, 8.8vw, 36px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1.2px;
}

.hero h1 em {
  color: var(--mint);
  font-style: normal;
}

.hero-sub {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  letter-spacing: 0.25px;
}

.date-badge {
  flex: none;
  width: 62px;
  padding: 10px 6px 9px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.date-badge strong {
  display: block;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}

.date-badge > span {
  display: block;
  margin-top: 4px;
  color: var(--mint);
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: 1.7px;
}

.date-badge small {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  color: rgba(255, 255, 255, 0.52);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 8px;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}

/* Filter card */
.filter-card {
  margin-top: 18px;
  padding: 10px 12px 11px;
  color: var(--ink);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.2), inset 0 1px 0 #fff;
}

.filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 6px;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filter-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--forest);
  border-radius: 8px;
  background: #edf7f1;
}

.filter-icon .icon {
  font-size: 13px;
}

.filter-title strong {
  display: block;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: 0.1px;
}

.filter-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 1.2px;
}

.clear-button {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 2px;
  position: relative;
  padding: 6px 4px 6px 8px;
  color: var(--danger);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  transition: background 0.18s ease;
}

.clear-button .icon {
  font-size: 11px;
  stroke-width: 2;
}

.clear-button:active {
  background: #fff0f0;
}

.clear-button::after {
  content: "";
  position: absolute;
  inset: -8px -4px;
}

.customer-picker {
  position: relative;
}

.customer-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
  border: 1px solid #e6ece7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbf8, #f4f8f4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.customer-trigger[aria-expanded="true"] {
  border-color: #b9dccb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(24, 169, 116, 0.08);
}

.customer-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #d6fbe7;
  border-radius: 10px;
  background: linear-gradient(145deg, #0e463e, #1c826a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.customer-copy {
  flex: 1;
  min-width: 0;
}

.customer-name {
  display: -webkit-box;
  overflow: hidden;
  color: #20332d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.1px;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.customer-code {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.select-chevron {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  color: #7a8982;
  transition: transform 0.22s ease;
}

.select-chevron .icon {
  font-size: 13px;
  stroke-width: 2;
}

.customer-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
}

.customer-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 60;
  max-height: 302px;
  padding: 6px;
  overflow: auto;
  border: 1px solid #e3eae4;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(7, 42, 35, 0.2);
  animation: menuIn 0.18s ease-out;
  overscroll-behavior: contain;
}

.customer-menu[hidden] {
  display: none;
}

.customer-menu-head {
  padding: 8px 9px 6px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.customer-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 8px;
  text-align: left;
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  background: transparent;
  transition: background 0.16s ease;
}

.customer-option + .customer-option {
  margin-top: 1px;
}

.customer-option:hover,
.customer-option.is-focused {
  background: #f3f8f4;
}

.customer-option[aria-selected="true"] {
  background: #eaf7ef;
}

.customer-option-copy {
  flex: 1;
  min-width: 0;
}

.customer-option-name {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-option-code {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.customer-option-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  color: #d6fbe7;
  border-radius: 50%;
  background: var(--forest);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.customer-option-check .icon {
  font-size: 11px;
  stroke-width: 2.4;
}

.customer-option[aria-selected="true"] .customer-option-check {
  opacity: 1;
  transform: none;
}

.menu-foot {
  margin-top: 4px;
  padding: 8px 9px 5px;
  color: var(--muted-2);
  border-top: 1px solid var(--line-soft);
  font-size: 7.5px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

/* ------------------------------------------------------------
   Main content
   ------------------------------------------------------------ */
.main-content {
  padding: 18px 16px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  color: var(--forest);
  border: 1px solid rgba(11, 59, 52, 0.1);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

.currency-chip .icon {
  font-size: 10px;
}

.overview-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e8ede8;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.overview-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: 3px;
  background: linear-gradient(90deg, #0b3b34 0%, #1aa974 48%, #a7ecc9 100%);
}

.ledger-head,
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29% 29%;
  align-items: center;
}

.ledger-head {
  padding: 13px 14px 6px;
}

.ledger-head span {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

.ledger-head span:not(:first-child) {
  padding-left: 8px;
  text-align: right;
}

.ledger-row {
  min-height: 53px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
}

.ledger-row.is-primary {
  border-top-color: #e1eee7;
  background: linear-gradient(90deg, #f1f9f4 0%, rgba(241, 249, 244, 0.3) 67%, rgba(241, 249, 244, 0) 100%);
}

.ledger-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  min-width: 0;
}

.ledger-label strong {
  color: #354740;
  font-size: 9.5px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.3px;
}

.ledger-label small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.2;
}

.ledger-row.is-primary .ledger-label strong {
  color: var(--forest);
}

.ledger-value {
  overflow: hidden;
  padding-left: 4px;
  color: #1f332d;
  font-size: clamp(10px, 3.1vw, 12.2px);
  font-weight: 700;
  letter-spacing: -0.25px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}

.ledger-row.is-primary .ledger-value {
  color: var(--forest);
  font-size: clamp(10.5px, 3.35vw, 13.4px);
  font-weight: 800;
}

.ledger-value.is-zero {
  color: var(--muted-2);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Tabs
   ------------------------------------------------------------ */
.tabbar-shell {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 40;
  margin: 16px -16px 0;
  padding: 8px 16px 8px;
  background: linear-gradient(180deg, rgba(245, 247, 243, 0.98) 0%, rgba(245, 247, 243, 0.93) 72%, rgba(245, 247, 243, 0) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #e6ece7;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(7, 42, 35, 0.07);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 51px;
  padding: 7px 2px 6px;
  color: var(--muted);
  border: 0;
  border-radius: 13px;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.tab:active {
  transform: scale(0.98);
}

.tab-icon {
  display: grid;
  place-items: center;
  height: 17px;
}

.tab-icon .icon {
  font-size: 16px;
  stroke-width: 1.7;
}

.tab-label {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(7.2px, 2.1vw, 8.8px);
  font-weight: 750;
  letter-spacing: 0.22px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-count {
  position: absolute;
  top: 5px;
  right: 6px;
  min-width: 15px;
  padding: 1.5px 3.5px;
  color: var(--muted);
  border-radius: 99px;
  background: #f0f4f1;
  font-size: 6.5px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tab.is-active {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(11, 59, 52, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab.is-active .tab-icon {
  color: var(--mint);
}

.tab.is-active .tab-count {
  color: #e5fff1;
  background: rgba(255, 255, 255, 0.15);
}

/* ------------------------------------------------------------
   Panels and shared headings
   ------------------------------------------------------------ */
.panels {
  position: relative;
}

.panel {
  padding-top: 14px;
  outline: none;
  animation: panelIn 0.34s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.panel[hidden] {
  display: none;
}

.panel:focus-visible {
  border-radius: 18px;
  outline: 2px solid #8fd7b8;
  outline-offset: 6px;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 10px;
}

.panel-kicker {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  color: #0b6b4a;
  border-radius: 99px;
  background: #e2f5ea;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: 3px;
  font-variant-numeric: tabular-nums;
}

.panel-side {
  flex: none;
  padding-bottom: 1px;
  text-align: right;
}

.panel-side small {
  display: block;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.panel-side strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   Field labels
   ------------------------------------------------------------ */
.field-label {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 6.9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-label-inline {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

/* ------------------------------------------------------------
   Status pills
   ------------------------------------------------------------ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status.green {
  color: #087a4b;
  background: var(--green-bg);
}

.status.blue {
  color: #2855c7;
  background: var(--blue-bg);
}

.status.amber {
  color: #966007;
  background: var(--amber-bg);
}

.status.gray {
  color: #586a62;
  background: #eff2f0;
}

/* ------------------------------------------------------------
   Pedido em andamento
   ------------------------------------------------------------ */
.currency-group + .currency-group {
  margin-top: 25px;
}

.group-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 9px;
}

.group-field {
  color: var(--muted-2);
  font-size: 6.6px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.currency-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--forest);
  border: 1px solid #cfeadd;
  border-radius: 8px;
  background: #e4f4eb;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
}

.currency-badge.usd {
  color: #2855b4;
  border-color: #dbe5ff;
  background: #edf2ff;
}

.group-count {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.group-total {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.group-total strong {
  margin-left: 4px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}

.order-card {
  position: relative;
  padding: 13px 14px 12px;
  border: 1px solid #e8ede8;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.order-card + .order-card {
  margin-top: 9px;
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-ident {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.order-index {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--muted-2);
  border-radius: 6px;
  background: #f1f5f1;
  font-size: 7.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.order-copy {
  min-width: 0;
}

.order-copy > .field-label {
  margin-bottom: 2px;
}

.order-no {
  overflow: hidden;
  margin: 0;
  color: #1a2b26;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.05px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
  margin-top: 5px;
}

.order-status-row .field-label {
  flex: none;
  font-size: 6.4px;
  letter-spacing: 0.2px;
}

.order-amount {
  flex: none;
  text-align: right;
}

.order-amount .field-label {
  text-align: right;
  font-size: 6.6px;
}

.order-amount strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.35px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.order-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed #ebefeb;
}

.order-metric {
  min-width: 0;
}

.order-metric + .order-metric {
  padding-left: 9px;
  border-left: 1px solid #edf1ed;
}

.order-metric span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7.6px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-metric b {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.order-metric b.is-zero {
  color: var(--muted-2);
  font-weight: 600;
}

/* ------------------------------------------------------------
   PRE PL
   ------------------------------------------------------------ */
.pl-group {
  overflow: hidden;
  border: 1px solid #e8ede8;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.pl-group + .pl-group {
  margin-top: 9px;
}

.pl-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 13px;
  text-align: left;
  color: inherit;
  border: 0;
  background: transparent;
}

.pl-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--forest);
  border-radius: 11px;
  background: #eef7f1;
}

.pl-mark .icon {
  font-size: 16px;
}

.pl-main {
  flex: 1;
  min-width: 0;
}

.pl-main > .field-label {
  margin-bottom: 2px;
}

.pl-main h3 {
  overflow: hidden;
  margin: 0;
  color: #1c2e28;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin-top: 4px;
}

.pl-sub .field-label {
  flex: none;
  font-size: 6.3px;
}

.pl-sub-text {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.pl-amount {
  flex: none;
  text-align: right;
}

.pl-amount small {
  display: block;
  color: var(--muted-2);
  font-size: 6.8px;
  font-weight: 700;
  letter-spacing: 0.7px;
}

.pl-amount .field-label {
  text-align: right;
  font-size: 6.4px;
}

.pl-amount strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -0.25px;
  font-variant-numeric: tabular-nums;
}

.pl-chevron {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: 1px;
  color: var(--muted);
  transition: transform 0.22s ease;
}

.pl-chevron .icon {
  font-size: 12px;
  stroke-width: 2;
}

.pl-group.is-open .pl-chevron {
  transform: rotate(180deg);
}

.pl-body {
  border-top: 1px solid #edf1ed;
  background: #fbfcfa;
}

.pl-body[hidden] {
  display: none;
}

.pl-child {
  padding: 13px;
}

.pl-child + .pl-child {
  border-top: 1px dashed #e7ede8;
}

.pl-child-head {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-width: 0;
}

.pl-child-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.pl-child-title .field-label {
  font-size: 6.4px;
}

.pl-child-index {
  display: grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  border-radius: 5px;
  background: #f0f4f0;
  font-size: 7px;
  font-weight: 750;
}

.pl-child-no {
  overflow: hidden;
  min-width: 0;
  color: #24362f;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-child-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  gap: 1px;
  margin-left: auto;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pl-child-amount .field-label {
  font-size: 6.4px;
  text-align: right;
}

.pl-child-amount-value {
  display: block;
}

.pl-child-amount-value small {
  margin-right: 3px;
  color: var(--muted-2);
  font-size: 6.8px;
  font-weight: 700;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 11px 0 0;
}

.meta-grid > div {
  min-width: 0;
}

.meta-grid .span-2 {
  grid-column: 1 / -1;
}

.meta-grid dt {
  margin: 0 0 3px;
  color: var(--muted-2);
  font-size: 7.7px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.meta-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 550;
  line-height: 1.35;
}

.pl-empty {
  padding: 13px;
  color: var(--muted);
  font-size: 9px;
}

/* ------------------------------------------------------------
   EMBARQUES
   ------------------------------------------------------------ */
.shipment-card {
  padding: 13px;
  border: 1px solid #e8ede8;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.shipment-card + .shipment-card {
  margin-top: 9px;
}

.shipment-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 41px;
  height: 45px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(155deg, #12493f, #082f2d);
  box-shadow: 0 6px 14px rgba(8, 47, 45, 0.16);
}

.date-stamp strong {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

.date-stamp span {
  margin-top: 3px;
  color: var(--mint);
  font-size: 6.5px;
  font-weight: 750;
  letter-spacing: 1.1px;
}

.shipment-ident {
  flex: 1;
  min-width: 0;
}

.shipment-ident .field-label {
  margin-bottom: 2px;
  font-size: 6.4px;
}

.shipment-ident h3 {
  overflow: hidden;
  margin: 0;
  color: #1b2d27;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-ident p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 8.2px;
  line-height: 1.25;
}

.shipment-ident p i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #b7c2bc;
}

.shipment-currency-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  gap: 3px;
}

.shipment-currency-block .field-label {
  font-size: 6.2px;
  text-align: right;
}

.shipment-currency {
  flex: none;
  padding: 4px 7px;
  color: var(--forest);
  border: 1px solid #d1eadd;
  border-radius: 7px;
  background: #ecf8f1;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.shipment-currency.usd {
  color: #2855b4;
  border-color: #dbe5ff;
  background: #edf2ff;
}

.shipment-money {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

.money-block .field-label {
  font-size: 6.5px;
  letter-spacing: 0.25px;
}

.money-block strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.money-block strong span {
  margin-right: 3px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 2px;
}

.money-due {
  text-align: right;
}

.money-due strong {
  font-size: 12.5px;
  color: #43564f;
  font-weight: 700;
}

.progress {
  margin-top: 11px;
}

.progress-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
}

.progress-paid,
.progress-percent {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.progress-paid .field-label,
.progress-percent .field-label {
  flex: none;
  font-size: 6.2px;
}

.progress-paid b {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.progress-percent strong {
  color: var(--green);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf2ee;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f8e5c, #6fdeaa);
  transition: width 0.5s ease;
}

.shipment-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 11px;
}

.shipment-meta > div {
  display: block;
  min-width: 0;
  color: var(--muted-2);
  font-size: 8px;
}

.shipment-meta .field-label {
  margin-bottom: 2px;
  font-size: 6.2px;
  white-space: normal;
}

.shipment-meta b {
  display: block;
  color: var(--ink-2);
  font-size: 9.2px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #edf1ed;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 6px 8px;
  color: var(--ink-2);
  border: 1px solid #e5ebe6;
  border-radius: 8px;
  background: #f8faf7;
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.15px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.doc-chip:active {
  border-color: #cfe3d7;
  background: #eff7f1;
}

.doc-chip .icon {
  flex: none;
  color: #7f9189;
  font-size: 10px;
}

.doc-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   PAGAMENTO
   ------------------------------------------------------------ */
.payment-card {
  overflow: hidden;
  border: 1px solid #e8ede8;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
}

.payment-row + .payment-row {
  border-top: 1px solid var(--line-soft);
}

.payment-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 38px;
  padding: 4px 0 4px;
  text-align: center;
  border-radius: 10px;
  background: #f4f7f3;
}

.payment-date .field-label {
  margin-bottom: 1px;
  font-size: 5.8px;
  letter-spacing: 0.2px;
  text-align: center;
}

.payment-date strong {
  display: block;
  color: #33463e;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.payment-date span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.payment-info {
  flex: 1;
  min-width: 0;
}

.payment-info > .field-label {
  margin-bottom: 1px;
  font-size: 6.2px;
}

.payment-instr {
  overflow: hidden;
  color: #1e302a;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-sub {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 7.8px;
  line-height: 1.25;
}

.payment-field {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
}

.payment-field .field-label {
  flex: none;
  font-size: 5.9px;
}

.payment-field b {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 7.6px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  color: var(--forest);
  border-radius: 5px;
  background: #e9f6ef;
  font-size: 6.8px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.currency-tag.usd {
  color: #2855b4;
  background: #edf2ff;
}

.payment-amount {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  max-width: 44%;
  text-align: right;
}

.payment-amount > .field-label {
  margin-bottom: 1px;
  font-size: 5.9px;
}

.payment-amount strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.25px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.payment-amount .amount-ccy {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 6.8px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.payment-amount small {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 7.2px;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.payment-amount .field-label {
  font-size: 5.8px;
}

/* ------------------------------------------------------------
   Footer + toast + misc
   ------------------------------------------------------------ */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 28px 18px calc(32px + env(safe-area-inset-bottom));
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.9px;
}

.footer-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 15px;
}

.footer-mark img {
  display: block;
  width: 25px;
  height: 15px;
  object-fit: contain;
}

.footer-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #aab7b0;
}

.toast {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  max-width: calc(100vw - 40px);
  padding: 10px 15px;
  color: #f1fcf7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  background: rgba(8, 42, 38, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 120;
  padding: 12px 16px;
  color: #fff;
  border-radius: 12px;
  background: #8d3038;
  font-size: 12px;
  text-align: center;
}

/* ------------------------------------------------------------
   Responsive fine-tuning
   ------------------------------------------------------------ */
@media (max-width: 359px) {
  .masthead {
    padding-right: 15px;
    padding-left: 15px;
  }

  .main-content {
    padding-right: 13px;
    padding-left: 13px;
  }

  .tabbar-shell {
    margin-right: -13px;
    margin-left: -13px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .date-badge {
    width: 56px;
  }

  .ledger-head,
  .ledger-row {
    grid-template-columns: minmax(0, 1fr) 28% 28%;
    padding-right: 11px;
    padding-left: 11px;
  }

  .customer-name {
    font-size: 10.5px;
    -webkit-line-clamp: 3;
  }

  .customer-trigger {
    min-height: 54px;
  }

  .ledger-label strong {
    font-size: 8.8px;
  }

  .ledger-label small {
    font-size: 7.2px;
  }

  .ledger-value {
    font-size: 9.6px;
  }

  .ledger-row.is-primary .ledger-value {
    font-size: 10.2px;
  }

  .tab {
    padding-right: 0;
    padding-left: 0;
  }

  .tab-label {
    font-size: 7.3px;
    letter-spacing: 0.1px;
  }

  .tab-count {
    right: 3px;
    font-size: 6.5px;
  }

  .order-no {
    font-size: 10.5px;
    white-space: nowrap;
  }

  .shipment-ident h3 {
    font-size: 11.5px;
  }

  .order-amount strong {
    font-size: 14px;
  }

  .order-metric b {
    font-size: 9.7px;
  }

  .order-metric span {
    font-size: 6.7px;
  }

  .shipment-money {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .money-due {
    text-align: left;
  }
}

@media (min-width: 640px) {
  body {
    padding: 28px 20px 40px;
  }

  .app-shell {
    min-height: calc(100dvh - 68px);
    overflow: clip;
    border-radius: 36px;
    box-shadow:
      0 44px 100px rgba(7, 42, 35, 0.2),
      0 8px 24px rgba(7, 42, 35, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .masthead {
    border-radius: 36px 36px 30px 30px;
  }

  .app-footer {
    padding-bottom: 36px;
  }
}

@media (min-width: 1000px) {
  body::before {
    content: "SKIWAY  ·  ORDER DESK";
    position: fixed;
    top: 50%;
    left: 32px;
    color: rgba(20, 63, 53, 0.22);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3.2px;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left top;
    pointer-events: none;
  }

  body::after {
    content: "CUSTOMER ORDER VIEW / 2026";
    position: fixed;
    top: 50%;
    right: 32px;
    color: rgba(20, 63, 53, 0.2);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3.2px;
    transform: rotate(90deg) translateX(50%);
    transform-origin: right top;
    pointer-events: none;
  }
}

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

@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(142, 240, 192, 0.13);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(142, 240, 192, 0.04);
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
