/* ============================================================
   Ezylife Mobile — Components
   Requires tokens.css. Every screen composes these classes.
   Phone-first; design width 390px. No JS required for layout.
   Interactive behaviour (tab routing, sheet open/close, filter
   selection) is documented in README §6 — add it in your stack.
   ============================================================ */

/* ---- App shell ------------------------------------------------ */
.ezm-screen {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--canvas); color: var(--ink);
  font-family: var(--body);
  overflow: hidden;
}
.ezm-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ezm-pad   { padding-left: 20px; padding-right: 20px; }
.ezm-vspace { height: 22px; }

/* ---- Type helpers --------------------------------------------- */
.ezm-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-faint); }
.ezm-h1 { font-family: var(--display); font-weight: 500; font-size: 30px;
  line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.ezm-brand { font-family: var(--body); font-size: 11px; color: var(--ink-faint); letter-spacing: .02em; }
.ezm-model { font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 1.1; color: var(--ink); }
.ezm-price { font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--gold); }
.ezm-meta  { font-family: var(--body); font-size: 12px; color: var(--ink-soft); }
.ezm-faint { color: var(--ink-faint); }
.ezm-ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* size utilities (px) */
.t-11{font-size:11px}.t-12{font-size:12px}.t-13{font-size:13px}.t-14{font-size:14px}
.t-15{font-size:15px}.t-16{font-size:16px}.t-17{font-size:17px}.t-18{font-size:18px}
.t-19{font-size:19px}.t-21{font-size:21px}.t-24{font-size:24px}.t-26{font-size:26px}
.t-30{font-size:30px}.t-40{font-size:40px}

/* ---- Header (sticky, clears the notch) ------------------------ */
.ezm-header { flex-shrink: 0; position: relative; z-index: 5; background: var(--canvas);
  padding: var(--safe-top) 20px 14px; border-bottom: 1px solid transparent; }
.ezm-header.is-scrolled { border-bottom-color: var(--line); }
.ezm-header__supplier { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.ezm-header__supplier::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.ezm-header__supplier span { font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--teal); }
.ezm-header__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ezm-header__lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ezm-header .ezm-kicker { margin-bottom: 7px; }

/* round header / back button */
.ezm-hbtn { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; padding: 0;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: center; }
.ezm-hbtn.is-solid { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.ezm-back { width: 38px; height: 38px; margin-bottom: 2px; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- Bottom tab bar ------------------------------------------- */
.ezm-tabbar { flex-shrink: 0; position: relative; z-index: 6; background: var(--tabbar);
  border-top: 1px solid var(--line); display: flex; padding: 9px 8px var(--safe-bottom);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ezm-tab { flex: 1; background: none; border: none; padding: 4px 0; display: flex;
  flex-direction: column; align-items: center; gap: 5px; position: relative; color: var(--ink-faint); }
.ezm-tab.is-active { color: var(--accent); }
.ezm-tab__label { font-family: var(--body); font-size: 10px; font-weight: 500; white-space: nowrap; }
.ezm-tab.is-active .ezm-tab__label { font-weight: 600; }
.ezm-tab__ico { position: relative; }
.ezm-tab__badge { position: absolute; top: -3px; right: -7px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 999px; background: var(--alert); color: #fff; font-family: var(--body);
  font-size: 9.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ---- Icon sizing ---------------------------------------------- */
.ezm-ico { display: block; flex-shrink: 0; }   /* set width/height inline or via size class */
.i-13{width:13px;height:13px}.i-15{width:15px;height:15px}.i-16{width:16px;height:16px}
.i-17{width:17px;height:17px}.i-18{width:18px;height:18px}.i-20{width:20px;height:20px}
.i-22{width:22px;height:22px}.i-23{width:23px;height:23px}.i-26{width:26px;height:26px}.i-28{width:28px;height:28px}

/* ---- Photo placeholder ---------------------------------------
   In production replace with <img style="object-fit:cover"> at the
   same aspect-ratio. Set ratio/radius inline, e.g.
   <div class="ezm-photo" style="aspect-ratio:4/5;border-radius:14px"> */
.ezm-photo { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 14px;
  background: var(--photo); overflow: hidden; border: 1px solid var(--line);
  background-image: repeating-linear-gradient(135deg, var(--photo-line) 0 1px, transparent 1px 13px); }
.ezm-photo__c { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 7px; }
.ezm-photo__ring { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--photo-mark);
  display: flex; align-items: center; justify-content: center; }
.ezm-photo__ring::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--photo-mark); }
.ezm-photo__brand { font-family: var(--display); font-size: 11px; color: var(--ink-soft); letter-spacing: .02em; }
.ezm-photo__code { position: absolute; left: 7px; bottom: 6px; font-family: var(--mono); font-size: 8px;
  letter-spacing: .14em; color: var(--photo-mark); }
.ezm-photo.is-big { border-radius: 16px; }
.ezm-photo.is-big .ezm-photo__c { gap: 12px; }
.ezm-photo.is-big .ezm-photo__ring { width: 34px; height: 34px; }
.ezm-photo.is-big .ezm-photo__ring::after { width: 5px; height: 5px; }
.ezm-photo.is-big .ezm-photo__brand { font-size: 15px; }
.ezm-photo.is-big .ezm-photo__code { left: 12px; bottom: 10px; font-size: 9.5px; }

/* ---- Status pill ---------------------------------------------- */
.ezm-tag { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: var(--body); font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .04em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  color: var(--ink-soft); border: 1px solid var(--line-2); background: transparent; }
.ezm-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ezm-tag.no-dot::before { display: none; }
.ezm-tag.is-gold  { color: var(--gold);      border-color: var(--gold-line);  background: var(--gold-soft); }
.ezm-tag.is-teal  { color: var(--teal);      border-color: var(--teal-line);  background: var(--teal-soft); }
.ezm-tag.is-alert { color: var(--alert-ink); border-color: var(--alert-line); background: var(--alert-soft); }
.ezm-tag.is-mute  { color: var(--ink-soft);  border-color: var(--line-2);     background: transparent; }
/* overlay-on-photo variant (status chip top-left of a tile) */
.ezm-tag.is-glass { background: rgba(247,242,234,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---- Section head (inside scroll body) ------------------------ */
.ezm-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 20px; margin-bottom: 13px; }
.ezm-sechead__title { font-family: var(--display); font-size: 19px; font-weight: 500; color: var(--ink); letter-spacing: -.005em; }
.ezm-sechead__count { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

/* ---- Cards & grouped lists ------------------------------------ */
.ezm-card { margin: 0 20px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.ezm-card.r18 { border-radius: 18px; }
.ezm-list__row { padding: 15px 16px; }
.ezm-list__row:not(:last-child) { border-bottom: 1px solid var(--line); }
.ezm-rowflex { display: flex; align-items: center; gap: 13px; }
.ezm-hair { height: 1px; background: var(--line); }

/* item thumb row (thumb + name block + trailing) */
.ezm-itemrow { display: flex; align-items: center; gap: 13px; }
.ezm-itemrow__thumb { flex-shrink: 0; }
.ezm-itemrow__body { flex: 1; min-width: 0; }

/* avatar (client / supplier initial) */
.ezm-avatar { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--panel); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--display); font-size: 17px; color: var(--ink); }
.ezm-avatar.tone-gold { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold); }
.ezm-avatar.tone-teal { border-color: var(--teal-line); background: var(--teal-soft); color: var(--teal); }

/* unread dot on avatar */
.ezm-dot-unread { position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--canvas); }

/* ---- Metric grids --------------------------------------------- */
.ezm-statgrid { margin: 0 20px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); }
.ezm-stat { padding: 17px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ezm-stat:nth-child(2n) { border-right: none; }
.ezm-stat:nth-last-child(-n+2) { border-bottom: none; }
.ezm-stat__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 11px; line-height: 1.2; }
.ezm-stat__value { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: .9; color: var(--ink); }
.ezm-stat__value.tone-gold { color: var(--gold); }
.ezm-stat__value.tone-teal { color: var(--teal); }
.ezm-stat__value.tone-alert { color: var(--alert-ink); }
.ezm-stat__sub { font-family: var(--body); font-size: 11.5px; color: var(--ink-soft); margin-top: 7px; }

/* 3-up small stat boxes (supplier dashboard) */
.ezm-stat3grid { margin: 0 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ezm-statbox { padding: 15px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ezm-statbox__value { font-family: var(--display); font-size: 26px; font-weight: 500; line-height: .9; color: var(--ink); }
.ezm-statbox__label { font-family: var(--body); font-size: 11.5px; color: var(--ink-soft); margin-top: 7px; }

/* earnings highlight (supplier) */
.ezm-earn { margin: 6px 20px 18px; padding: 20px; border-radius: 18px; border: 1px solid var(--teal-line); background: var(--teal-soft); }
.ezm-earn__label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.ezm-earn__value { font-family: var(--display); font-size: 40px; font-weight: 500; color: var(--ink); line-height: .9; }
.ezm-earn__sub { font-family: var(--body); font-size: 13px; color: var(--ink-soft); margin-top: 12px; }

/* ---- Segmented control ---------------------------------------- */
.ezm-seg { display: flex; padding: 3px; gap: 2px; background: var(--panel); border-radius: 11px; border: 1px solid var(--line); }
.ezm-seg__btn { flex: 1; padding: 8px 6px; border: none; border-radius: 8px; white-space: nowrap;
  background: transparent; color: var(--ink-soft); font-family: var(--body); font-size: 12.5px; font-weight: 500; letter-spacing: .01em; }
.ezm-seg__btn.is-active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---- Filter chips (horizontal scroll) ------------------------- */
.ezm-chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 2px; scrollbar-width: none; }
.ezm-chip { flex-shrink: 0; padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: .01em;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line-2); }
.ezm-chip.is-active { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

/* ---- Buttons -------------------------------------------------- */
.ezm-bigbtn { width: 100%; height: 54px; border-radius: 14px; border: none; background: var(--accent); color: var(--on-accent);
  font-family: var(--body); font-size: 16px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 9px; }
.ezm-bigbtn.is-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.ezm-bigbtn.is-soft  { background: var(--panel-2); color: var(--ink); }
/* inline solid action (smaller) */
.ezm-btn { height: 40px; padding: 0 16px; border-radius: 11px; border: none; background: var(--accent); color: var(--on-accent);
  font-family: var(--body); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ezm-btn.is-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); font-weight: 500; }

/* ---- Form fields ---------------------------------------------- */
.ezm-field__label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; padding-left: 2px; }
.ezm-field__input { height: 52px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--panel);
  display: flex; align-items: center; padding: 0 15px; gap: 8px; width: 100%; }
.ezm-field__input .val { flex: 1; text-align: left; font-family: var(--body); font-size: 16px; color: var(--ink); border: none; background: none; }
.ezm-field__input .val.is-placeholder { color: var(--ink-faint); }
.ezm-field__hint { font-family: var(--body); font-size: 11.5px; color: var(--ink-faint); margin-top: 7px; padding-left: 2px; }
.ezm-group-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal); margin: 4px 2px 14px; }
/* price field (emphasised) */
.ezm-price-field { height: 56px; border-radius: 13px; border: 1px solid var(--teal-line); background: var(--panel);
  display: flex; align-items: center; padding: 0 16px; gap: 8px; }
.ezm-price-field .cur { font-family: var(--display); font-size: 18px; color: var(--ink-faint); }
.ezm-price-field .amt { flex: 1; font-family: var(--display); font-size: 24px; font-weight: 500; color: var(--ink); }
/* selectable token chips (includes / quick replies) */
.ezm-tokrow { display: flex; gap: 8px; flex-wrap: wrap; }
.ezm-tok { padding: 9px 14px; border-radius: 999px; font-family: var(--body); font-size: 13.5px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.ezm-tok.is-on { border-color: var(--teal-line); background: var(--teal-soft); color: var(--teal); }
/* photo upload tiles (add form) */
.ezm-addphoto { width: 96px; height: 116px; border-radius: 14px; flex-shrink: 0;
  border: 1.5px dashed var(--teal-line); background: var(--teal-soft); color: var(--teal);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.ezm-addphoto span { font-family: var(--body); font-size: 12px; font-weight: 600; }

/* ---- Sticky footer action bar --------------------------------- */
.ezm-footbar { flex-shrink: 0; padding: 12px 20px var(--safe-bottom); border-top: 1px solid var(--line);
  background: var(--canvas); display: flex; gap: 12px; align-items: center; }

/* ---- Bottom sheet --------------------------------------------- */
.ezm-sheet { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.ezm-sheet.is-open { pointer-events: auto; }
.ezm-sheet__scrim { position: absolute; inset: 0; background: rgba(58,50,43,.42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity .28s ease; }
.ezm-sheet.is-open .ezm-sheet__scrim { opacity: 1; }
.ezm-sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%;
  display: flex; flex-direction: column; background: var(--sheet);
  border-top-left-radius: 26px; border-top-right-radius: 26px; border: 1px solid var(--line); border-bottom: none;
  transform: translateY(101%); transition: transform .32s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -20px 50px rgba(58,50,43,.22); }
.ezm-sheet.is-open .ezm-sheet__panel { transform: translateY(0); }
.ezm-sheet.is-peek .ezm-sheet__panel { max-height: 64%; }
.ezm-sheet__grip { display: flex; justify-content: center; padding-top: 10px; flex-shrink: 0; }
.ezm-sheet__grip::before { content: ""; width: 38px; height: 5px; border-radius: 999px; background: var(--line-2); }
.ezm-sheet__scroll { flex: 1; overflow-y: auto; padding: 18px; }

/* ---- Loading skeleton ----------------------------------------- */
.ezm-skel { background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%);
  background-size: 220% 100%; animation: ezm-shimmer 1.4s ease-in-out infinite; border-radius: 6px; }
@keyframes ezm-shimmer { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .ezm-skel { animation: none; } }
.ezm-skelcard { display: flex; flex-direction: column; gap: 9px; }
.ezm-skelcard .ph { aspect-ratio: 1/1; border-radius: 14px; }

/* ---- Empty / error states ------------------------------------- */
.ezm-state { padding: 56px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.ezm-state__icon { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.ezm-state__icon.is-alert { border-color: var(--alert-line); color: var(--alert-ink); }
.ezm-state__title { font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--ink); }
.ezm-state__body { font-family: var(--body); font-size: 14px; color: var(--ink-soft); line-height: 1.5; max-width: 260px; }


/* ---- design-system dropdown (replaces native selects) ---- */
.ezm-dd { position: relative; }
.ezm-dd__btn { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 40px 0 13px; font-size: 15px; color: var(--ink); font-family: var(--body); text-align: left; position: relative; cursor: pointer; }
.ezm-dd__btn.is-empty { color: var(--ink-faint); }
.ezm-dd__btn::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint); transform: translateY(-70%) rotate(45deg); transition: transform .18s ease; }
.ezm-dd.is-open .ezm-dd__btn::after { transform: translateY(-30%) rotate(-135deg); }
.ezm-dd__list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.16); max-height: 260px; overflow-y: auto; padding: 6px; display: none; }
.ezm-dd.is-open .ezm-dd__list { display: block; }
.ezm-dd__opt { padding: 11px 12px; border-radius: 9px; font-size: 14.5px; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; min-height: 42px; }
.ezm-dd__opt.is-active { background: rgba(0,0,0,.05); }
.ezm-dd__opt.is-selected::after { content: "✓"; color: var(--gold); font-weight: 700; flex-shrink: 0; }
