/* ─────────────────────────────────────────────────────────────
   띠링 — Design System
   Mobile-first · Pretendard · Premium & Simple
───────────────────────────────────────────────────────────── */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Background */
  --bg:         #F4F3EF;
  --surface:    #FFFFFF;
  --surface-2:  #F9F8F5;

  /* Border */
  --border:     #E6E4DC;
  --border-2:   #EFEDE6;

  /* Text */
  --text:       #111111;
  --text-2:     #555550;
  --text-3:     #888885;

  /* Brand */
  --brand:      #1A3326;
  --brand-mid:  #2D5543;
  --brand-bg:   #EBF4EE;

  /* Accent (CTA) */
  --accent:     #E8521C;
  --accent-bg:  #FDF1EC;

  /* Status */
  --s-pending:  #F59E0B;
  --s-pending-bg: #FFFBEB;
  --s-paid:     #16A34A;
  --s-paid-bg:  #F0FDF4;
  --s-ship:     #2563EB;
  --s-ship-bg:  #EFF6FF;
  --s-done:     #7C3AED;
  --s-done-bg:  #F5F3FF;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 999px;

  /* Layout */
  --header-h: 56px;
  --tab-h:    48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);

  /* Font */
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font-family: var(--font); border: none; background: none; cursor: pointer; }
input, textarea { font-family: var(--font); }
a { color: inherit; text-decoration: none; }

/* ── App Shell ────────────────────────────────────────────── */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ───────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-h);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes bell-ring {
  0%   { transform: rotate(0deg); }
  5%   { transform: rotate(18deg); }
  15%  { transform: rotate(-16deg); }
  25%  { transform: rotate(13deg); }
  35%  { transform: rotate(-10deg); }
  45%  { transform: rotate(7deg); }
  55%  { transform: rotate(-4deg); }
  65%  { transform: rotate(2deg); }
  75%  { transform: rotate(-1deg); }
  85%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
.brand-ring {
  display: flex;
  align-items: center;
  line-height: 1;
  transform-origin: top center;
}
.brand-ring.bell-ringing {
  animation: bell-ring 0.8s ease-in-out;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Icon Button ──────────────────────────────────────────── */
.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover   { background: var(--surface-2); }
.icon-btn:active  { background: var(--border); }
.excel-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-full);
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tab Bar ──────────────────────────────────────────────── */
#tab-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tabs-scroll {
  display: flex;
  overflow-x: auto;
  padding: 0 12px;
  gap: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  height: var(--tab-h);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover  { color: var(--text); }
.tab.active {
  color: var(--brand);
  font-weight: 700;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 14px; right: 14px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}
.tab-dot {
  display: none;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.tab-dot.visible { display: inline-block; }

/* ── Main ─────────────────────────────────────────────────── */
#main {
  flex: 1;
  padding-bottom: calc(24px + var(--safe-bot));
}

/* ── Stats Bar ────────────────────────────────────────────── */
.stats-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: 90;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  gap: 0;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stat:active { opacity: .6; }
.stat-active .stat-n {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  min-width: 28px;
  text-align: center;
  display: inline-block;
}
.stat-active .stat-n.green  { background: var(--s-paid);    color: #fff; }
.stat-active .stat-n.blue   { background: var(--s-ship);    color: #fff; }
.stat-active .stat-n.orange { background: var(--s-pending); color: #fff; }
.stat-active .stat-l { color: var(--text); font-weight: 700; }
.stat-n {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  transition: opacity .1s;
}
.stat-n.green  { color: var(--s-paid); }
.stat-n.blue   { color: var(--s-ship); }
.stat-n.orange { color: var(--s-pending); white-space: nowrap; letter-spacing: -0.5px; }
.stat-l {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}
/* 오늘 입금액: 99,999,999원까지 수용 */
.stats-bar .stat:last-child { flex: 2; }

/* ── List Header ──────────────────────────────────────────── */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.list-header #lh-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lh-count {
  font-size: 12px;
  color: var(--text-3);
}

/* ── Batch Bar ────────────────────────────────────────────── */
.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 12px;
  padding: 14px 16px;
  background: var(--brand-bg);
  border: 1px solid #C6DECE;
  border-radius: var(--r-lg);
  gap: 12px;
}
.batch-hint {
  font-size: 13px;
  color: var(--brand-mid);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Order List ───────────────────────────────────────────── */
#order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

/* ── Order Card ───────────────────────────────────────────── */
.order-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s;
}
.order-card:hover { box-shadow: var(--shadow-md); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 0;
  gap: 10px;
}
.card-customer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  cursor: pointer;
}
.card-customer:active { opacity: .7; }
.customer-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cust-phone-suffix {
  font-weight: 400;
  opacity: 0.65;
}
.cp-edit-hint {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--text);
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}
.cp-edit-form {
  margin-bottom: 4px;
}
.cust-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  letter-spacing: -0.5px;
}
.cust-phone {
  font-size: 13px;
  color: var(--text-2);
}
.repeat-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-mid);
  background: var(--brand-bg);
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.card-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-full);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.status-badge.s-pending_payment  { background: var(--s-pending-bg); color: #B45309; }
.status-badge.s-payment_confirmed { background: var(--s-paid-bg);   color: #15803D; }
.status-badge.s-shipping_pending  { background: var(--s-ship-bg);   color: #1D4ED8; }
.status-badge.s-shipping_confirmed{ background: #E0F2FE;            color: #0369A1; }
.status-badge.s-delivered         { background: var(--s-done-bg);   color: #6D28D9; }

.card-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 16px 0;
}
.amount-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.amount-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.payer-chip {
  font-size: 12px;
  color: var(--text-3);
  margin-left: 2px;
}

.card-address {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 6px 16px 0;
  color: var(--text-2);
}
.card-address svg { flex-shrink: 0; margin-top: 2px; color: var(--text-3); }
.addr-text {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* addr-recipient removed — detail in edit modal */

/* ── Card Items ───────────────────────────────────────────── */
.card-items {
  margin: 8px 16px 0;
  border: 1px solid var(--text);
  border-radius: var(--r-md);
  overflow: hidden;
}
.items-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background: var(--text);
}
.items-summary-row:active { opacity: 0.85; }
.items-text {
  font-size: 14px;
  color: #ffffff;
  font-weight: 500;
}
.expand-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}
.expand-toggle svg {
  transition: transform .2s;
}
.expand-toggle.open svg {
  transform: rotate(180deg);
}
.items-detail {
  display: none;
  border-top: 1px solid var(--text);
  background: var(--surface-2);
}
.items-detail.open { display: block; }
.item-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-2);
}
.item-row:last-child { border-bottom: none; }
.item-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.item-qty {
  font-size: 13px;
  color: var(--text-2);
  text-align: right;
  min-width: 44px;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  min-width: 76px;
  font-variant-numeric: tabular-nums;
}
.item-row-edit {
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
}
.item-select {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  padding: 0 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  -webkit-appearance: none;
}
.item-qty-input {
  width: 52px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  text-align: right;
  padding: 0 6px;
  font-family: var(--font);
  flex-shrink: 0;
}
.card-divider {
  height: 1px;
  background: var(--text);
  margin: 8px 16px 0;
}

/* ── SMS Raw ──────────────────────────────────────────────── */
.card-sms-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 16px 0;
  padding: 8px 12px;
  background: none;
  border: 1px dashed var(--text-2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  width: calc(100% - 32px);
  text-align: left;
  transition: border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.card-sms-toggle:hover { border-color: var(--text-2); color: var(--text); }
.sms-raw-box {
  display: none;
  margin: 4px 16px 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--font);
}
.sms-raw-box.open { display: block; }

/* ── Card Actions ─────────────────────────────────────────── */
.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
}
.card-actions .spacer { flex: 1; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  gap: 10px;
}
.empty-icon {
  color: var(--text-3);
  margin-bottom: 4px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
}
.empty-sub {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.btn:active { opacity: .8; }

.btn-primary {
  background: var(--text);
  color: #fff;
}
.btn-primary:hover { background: #333333; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-text { /* inline link-style */
  padding: 0;
  height: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  background: none;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-count {
  background: rgba(255,255,255,0.2);
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-size: 12px;
}

/* ── Overlay ──────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer ───────────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 85vw);
  height: 100dvh;
  background: var(--surface);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-item:hover  { background: var(--surface-2); }
.drawer-item:active { background: var(--border); }
.drawer-item svg { color: var(--text-2); flex-shrink: 0; }
.drawer-item span:first-of-type { flex: 1; }
.drawer-chip {
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.drawer-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}
.drawer-footer {
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bot));
  border-top: 1px solid var(--border);
}
.drawer-cs-tel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
}
.drawer-cs-tel:active { opacity: 0.7; }
.drawer-cs-label {
  font-size: 12px;
  color: var(--text-2);
}
.drawer-cs-num {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.drawer-guide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drawer-guide-btn:active { background: var(--surface-2); }
.drawer-account-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.drawer-account-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drawer-account-btn:active { background: var(--surface-2); }
.drawer-logout-btn { color: #e53e3e; border-color: #fed7d7; }
.drawer-logout-btn:active { background: #fff5f5; }

/* ── Login Screen ────────────────────────────────────────── */
.login-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  padding-bottom: calc(40px + var(--safe-bot));
  overflow-y: auto;
}
.login-screen.active { display: flex; }
.login-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero */
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 0;
}
.login-brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.login-hero-sub {
  font-size: 15px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Form */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}
.login-input {
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 1px;
}
.login-input:focus { border-color: var(--text); background: var(--surface); }
.login-input::placeholder { color: var(--text-3); font-weight: 400; letter-spacing: 0; font-size: 16px; }

/* PIN boxes */
.pin-boxes {
  display: flex;
  gap: 8px;
  width: 100%;
}
.pin-box {
  flex: 1 1 0;
  min-width: 0;
  height: 58px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 24px;
  font-family: var(--font);
  text-align: center;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-text-security: disc;
  text-security: disc;
}
.pin-box:focus { border-color: var(--text); background: var(--surface); }
.pin-box.filled { border-color: var(--text); background: var(--surface); }
.pin-box.pin-disabled { opacity: 0.35; pointer-events: none; cursor: not-allowed; }

/* Remember */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  user-select: none;
  align-self: flex-start;
}
.login-remember input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--text);
  cursor: pointer;
}

.login-error {
  font-size: 13px;
  color: #e03131;
  min-height: 18px;
  text-align: center;
}
.login-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
}
.login-cs {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  text-align: center;
}
.login-cs:active { color: var(--text-2); }
.login-cs strong { color: var(--text-2); }

/* ── Guide Modal ─────────────────────────────────────────── */
.guide-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 900;
  align-items: flex-end;
  justify-content: center;
}
.guide-overlay.active { display: flex; }
.guide-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.change-pin-sheet { max-height: fit-content; }
.change-pin-body {
  padding: 28px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.change-pin-label {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 12px;
  text-align: center;
}
.change-pin-body .pin-boxes { width: 100%; max-width: 280px; }
.change-pin-body #change-pin-error {
  font-size: 13px;
  color: #e53e3e;
  min-height: 18px;
  text-align: center;
}
.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.guide-title {
  font-size: 17px;
  font-weight: 700;
}
.guide-body {
  overflow-y: auto;
  padding: 20px 20px 36px;
  -webkit-overflow-scrolling: touch;
}
.guide-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.guide-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.guide-step-content {
  flex: 1;
  padding-bottom: 4px;
}
.guide-step-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.guide-step-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.guide-step-desc strong {
  color: var(--text);
  font-weight: 600;
}
.guide-connector {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 4px 0 4px 13px;
}

/* ── Side Panel ───────────────────────────────────────────── */
.side-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 100vw);
  height: 100dvh;
  background: var(--surface);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.side-panel.open { transform: translateX(0); }
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  flex-shrink: 0;
}
.panel-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── Modals ───────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;        /* 비활성 시 시트가 화면 밖으로 삐져나오지 않도록 클리핑 */
  visibility: hidden;      /* 완전히 숨김 — 접근성 + 모바일 터치 차단 */
  transition: visibility 0s 0.3s; /* 닫힐 때 슬라이드 완료 후 숨김 */
}
.modal.active {
  pointer-events: all;
  visibility: visible;
  transition: visibility 0s 0s; /* 열릴 때 즉시 표시 */
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  max-height: 92vh; /* fallback */
  max-height: 92dvh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  padding-bottom: var(--safe-bot);
  will-change: transform;
  position: relative;
}
.modal.active .modal-sheet { transform: translateY(0); }
.modal-sheet-full { max-height: 96dvh; }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  margin: 10px auto 0;
  flex-shrink: 0;
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-footer .btn { flex: 1; }

/* ── Modal: Center Dialog ─────────────────────────────────── */
.modal-center {
  align-items: center;
  overflow: visible; /* 다이얼로그는 클리핑 불필요 */
}
.modal-dialog {
  width: min(320px, 90vw);
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 24px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: scale(.92);
  opacity: 0;
  transition: transform .25s, opacity .25s;
  will-change: transform, opacity;
}
.modal-center.active .modal-dialog {
  transform: scale(1);
  opacity: 1;
}
.dialog-icon { font-size: 36px; margin-bottom: 12px; }
.dialog-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.dialog-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 20px;
}
.dialog-actions {
  display: flex;
  gap: 8px;
}
.dialog-actions .btn { flex: 1; }

/* ── Form Elements ────────────────────────────────────────── */
.form-field {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus {
  border-color: var(--brand);
  background: var(--surface);
}
.textarea {
  width: 100%;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  line-height: 1.6;
}
.textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
}
.char-row {
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}
.char-max { color: var(--text-3); }

.form-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.section-hint {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ── Checkbox Filters ─────────────────────────────────────── */
.filter-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.check-row:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-bg);
}
.check-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.check-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tier-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.tier-diamond { background: #EDE9FE; color: #6D28D9; }
.tier-gold    { background: #FFFBEB; color: #92400E; }
.tier-first   { background: #F0FDF4; color: #166534; }
.tier-waiting { background: #FFF7ED; color: #C2410C; }
.tier-desc {
  font-size: 12px;
  color: var(--text-3);
}
.opt-out-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.recipient-box {
  padding: 12px;
  background: var(--brand-bg);
  border: 1px solid #C6DECE;
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--brand-mid);
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ── SMS Settings Tabs ───────────────────────────────────── */
.sms-settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  gap: 0;
}
.sms-settings-tab {
  flex: 1;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.sms-settings-tab.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
}
.sms-settings-panel { display: none; }
.sms-settings-panel.active { display: block; }

/* SMS 설정: 변수 힌트 */
.tpl-var-hint { font-size: 12px; color: var(--text-3); }
.tpl-var-hint code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--brand);
  font-family: monospace;
}

/* SMS 미리보기 오버레이 */
.sms-preview-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--surface);
  flex-direction: column;
  border-radius: inherit;
}
.sms-preview-overlay.active { display: flex; }
.sms-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sms-preview-title { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.sms-preview-hint { font-size: 12px; color: var(--text-3); flex: 1; }
.sms-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  background: #e9e9e9;
  -webkit-overflow-scrolling: touch;
}
.sms-bubble-wrap { display: flex; justify-content: flex-start; }
.sms-bubble {
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.sms-preview-text {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ── SMS Filter Chips ─────────────────────────────────────── */
.sms-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sms-filter-row::-webkit-scrollbar { display: none; }
.sms-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.sms-chip:has(input:checked) {
  background: var(--brand-bg);
  border-color: var(--brand);
  color: var(--brand);
}
.sms-chip input[type="checkbox"] { display: none; }
.sms-recipient-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-mid);
  padding: 8px 12px;
  background: var(--brand-bg);
  border-radius: var(--r-md);
  margin-bottom: 4px;
}

/* ── Customer Filter Chips ────────────────────────────────── */
.filter-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ── Product List ─────────────────────────────────────────── */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.product-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .15s;
}
.product-item.active-product {
  border-color: var(--brand);
  background: var(--brand-bg);
}
.product-active-toggle {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: var(--r-full);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.product-active-toggle.on { background: var(--brand); }
.product-active-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: var(--shadow-xs);
}
.product-active-toggle.on::after { transform: translateX(16px); }
.product-info { flex: 1; min-width: 0; }
.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 1px;
}
.product-edit-btn, .product-delete-btn {
  padding: 6px;
  color: var(--text-3);
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.product-edit-btn:hover { color: var(--brand); background: var(--brand-bg); }
.product-delete-btn:hover { color: #DC2626; background: #FEF2F2; }

/* ── Delivery Unit Blocks (주문수정 모달) ───────────────────── */
.delivery-units-section {
  margin-bottom: 4px;
}
.delivery-unit {
  background: var(--surface);
  border: 1px solid var(--text);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.delivery-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--text);
  border-bottom: 1px solid var(--text);
}
.delivery-unit-product {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}
.delivery-unit-price {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
}
.delivery-unit-body {
  padding: 12px 14px 8px;
}
.delivery-inline-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.delivery-inline-row .form-field { flex: 1; margin-bottom: 0; }
.form-input-sm { height: 38px; font-size: 14px; }
.form-section-divider {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
  margin-bottom: 14px;
}

/* ── Product Edit Form (inline) ───────────────────────────── */
.product-edit-form {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-edit-row {
  display: flex;
  gap: 8px;
}
.product-edit-row .form-input { height: 38px; font-size: 14px; }
.product-edit-row .btn { height: 38px; font-size: 13px; }

/* ── Delivery Batches ─────────────────────────────────────── */
.batch-item {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.batch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.batch-date {
  font-size: 15px;
  font-weight: 700;
}
.batch-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.batch-status.ready { background: var(--s-ship-bg); color: var(--s-ship); }
.batch-status.done  { background: var(--s-paid-bg);  color: var(--s-paid); }
.batch-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.batch-actions-row {
  display: flex;
  gap: 8px;
}
.batch-summary-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.batch-summary-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
}
.batch-summary-chip.chip-shipping {
  background: var(--s-ship-bg);
  color: var(--s-ship);
}
.batch-summary-chip.chip-delivered {
  background: var(--s-paid-bg);
  color: var(--s-paid);
}
.batch-stats {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}
.batch-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  gap: 3px;
  transition: background 0.15s;
}
.batch-stat-item:active { opacity: 0.75; }
.batch-stat-n {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.batch-stat-l {
  font-size: 11px;
  color: var(--text-2);
}
.batch-stat-item.stat-ship {
  background: var(--s-ship-bg);
  border-color: color-mix(in srgb, var(--s-ship) 35%, transparent);
}
.batch-stat-item.stat-ship .batch-stat-n { color: var(--s-ship); }
.batch-stat-item.stat-done {
  background: var(--s-paid-bg);
  border-color: color-mix(in srgb, var(--s-paid) 35%, transparent);
}
.batch-stat-item.stat-done .batch-stat-n { color: var(--s-paid); }
.batch-order-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.batch-order-row:last-child { border-bottom: none; }
.batch-order-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.batch-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.batch-order-name {
  font-size: 15px;
  font-weight: 700;
}
.batch-order-track {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.batch-order-track:hover { text-decoration: underline; }
.batch-order-addr, .batch-order-items, .batch-order-tracking {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 2px;
}

/* ── Customer Panel Body ──────────────────────────────────── */
.cust-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.cust-avatar {
  width: 56px; height: 56px;
  background: var(--brand-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}
.cust-info-main .cust-name-big {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}
.cust-info-main .cust-phone-main {
  font-size: 14px;
  color: var(--text-2);
}
.cust-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.cust-stat {
  flex: 1;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
}
.cust-stat-n {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.cust-stat-l {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.cust-tier {
  display: inline-flex;
  margin-bottom: 20px;
}
.cust-order-history {
  margin-bottom: 20px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.cust-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 14px;
}
.cust-order-item:last-child { border-bottom: none; }
.co-date { color: var(--text-3); font-size: 12px; }
.co-amount { font-weight: 700; }
.co-status { font-size: 12px; }

/* ── Search ───────────────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.search-box svg { color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
.search-input::placeholder { color: var(--text-3); }

/* ── Customer List Item ───────────────────────────────────── */
.customer-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.customer-list-item:last-child { border-bottom: none; }
.customer-list-item:active { opacity: .7; }
.cli-avatar {
  width: 40px; height: 40px;
  background: var(--brand-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}
.cli-info { flex: 1; min-width: 0; }
.cli-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.cli-phone {
  font-size: 13px;
  color: var(--text-2);
}
.cli-meta {
  text-align: right;
  flex-shrink: 0;
}
.cli-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.cli-tier {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Toast ────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bot));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(17,17,17,.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--r-full);
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
  opacity: 0;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Skeleton Loader ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-2) 25%, var(--border) 50%, var(--border-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 140px;
  border-radius: var(--r-lg);
}

/* ── Opt-out badge ────────────────────────────────────────── */
.opt-out-badge {
  font-size: 11px;
  background: #FEF2F2;
  color: #DC2626;
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-weight: 600;
}

/* ── Responsive — Tablet/PC ───────────────────────────────── */
@media (min-width: 640px) {
  #order-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px;
  }
  .batch-bar { margin: 0 20px 12px; }
  .list-header { padding: 16px 20px 8px; }
  .modal-sheet { border-radius: var(--r-xl); margin: 20px; width: calc(100% - 40px); }
}

@media (min-width: 1024px) {
  #app { max-width: 1280px; margin: 0 auto; }
  #app-header { border-radius: 0; }
  #order-list {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 24px;
  }
  .batch-bar { margin: 0 24px 12px; }
  .list-header { padding: 20px 24px 10px; }
  .drawer {
    width: 360px;
  }
  .side-panel {
    width: 440px;
  }
  .modal-sheet {
    margin: auto;
    border-radius: var(--r-xl);
    width: 100%;
  }
}

/* ── Misc ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.text-muted { color: var(--text-3); }
.text-sm    { font-size: 13px; }
.fw-700     { font-weight: 700; }
