/* ── 야채 도매 관리 앱 ── */

/* ── Design Tokens (Light - White+Green) ── */
:root {
  --primary: #2ECC71;
  --primary-dark: #27AE60;
  --primary-light: rgba(46,204,113,0.08);
  --green: #2ECC71;
  --green-dark: #27AE60;
  --yellow: #F1C40F;
  --yellow-dark: #D4AC0D;
  --red: #E74C3C;
  --red-dark: #C0392B;
  --orange: #E67E22;
  --bg: #F5F6FA;
  --card-bg: #FFFFFF;
  --text-primary: #2C3E50;
  --text-secondary: #7F8C8D;
  --border: #E0E0E0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
  --nav-height: 64px;
  --popup-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --chip-bg: rgba(46,204,113,0.06);
  --chip-border: rgba(46,204,113,0.2);
  --icon-color: #7F8C8D;
  color-scheme: light;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --primary: #2ECC71;
  --primary-dark: #27AE60;
  --primary-light: rgba(46,204,113,0.12);
  --green: #2ECC71;
  --green-dark: #27AE60;
  --yellow: #F1C40F;
  --yellow-dark: #D4AC0D;
  --red: #E74C3C;
  --red-dark: #C0392B;
  --orange: #E67E22;
  --bg: #1A1A2E;
  --card-bg: #25253E;
  --text-primary: #E8E8F0;
  --text-secondary: #9595A8;
  --border: #3A3A52;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --popup-bg: #25253E;
  --input-bg: #1A1A2E;
  --chip-bg: rgba(46,204,113,0.12);
  --chip-border: rgba(46,204,113,0.3);
  --icon-color: #9595A8;
  color-scheme: dark;
}

/* ── Reset ── */
html, body {
  overflow: hidden;
  height: 100%;
}

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

body {
  font-family: -apple-system, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-height) + 32px);
}

/* ── Login Screen ── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-screen.hidden { display: none; }
.login-box {
  width: 280px;
  text-align: center;
}
.login-icon { margin-bottom: 16px; }
.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  letter-spacing: 4px;
}
.login-input:focus {
  border-color: var(--primary);
}
.login-error {
  min-height: 20px;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}
.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.login-btn:active {
  background: var(--primary-dark);
}

/* ── Sales (수주) ── */
.customer-bar-wrap {
  padding: 0 16px;
  margin-bottom: 8px;
}
.customer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.customer-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.customer-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.customer-chip.add-chip {
  border-style: dashed;
  color: var(--primary);
  font-weight: 800;
}

.sales-product-chip {
  display: inline-block;
  padding: 8px 12px;
  margin: 4px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sales-product-chip.in-queue {
  border-color: var(--primary);
  background: var(--primary-light);
}
.sales-product-chip .chip-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sales-product-grid {
  padding: 4px 12px;
  max-height: 340px;
  overflow-y: auto;
}
.sales-chips-wrap {
  padding: 4px 0;
}

/* 수주 큐 */
.sales-queue { padding: 8px 16px; }
.sales-queue-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 16px;
  font-size: 14px;
}
.sales-queue-header {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
  color: var(--text-primary);
}
.sales-queue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 -8px;
}
.sales-queue-row {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sq-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--primary);
  color: #fff;
}
.sq-name { font-weight: 800; font-size: 13px; }
.sq-remove-top {
  background: none; border: none;
  color: rgba(255,255,255,0.7); font-size: 14px;
  cursor: pointer; padding: 0 2px;
}
.sq-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
}
.sq-locked { opacity: 0.5; }
.sq-top-locked { background: var(--text-secondary) !important; }
.sq-controls { display: flex; align-items: center; gap: 6px; }
.sq-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.sq-qty-input {
  width: 48px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  padding: 4px 2px;
  outline: none;
  -webkit-appearance: none;
}
.sq-qty-input:focus {
  border-color: var(--primary);
}
.sq-unit { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.sq-remove {
  background: none; border: none;
  color: var(--red); font-size: 16px; font-weight: 700; cursor: pointer;
  padding: 4px 8px;
}
.sq-memo { padding: 0 8px 6px; }
.sq-memo-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 6px;
  outline: none;
}
.sq-memo-input:focus {
  border-color: var(--primary);
  color: var(--text-primary);
}
.sq-memo-input::placeholder { color: var(--text-secondary); opacity: 0.6; }

/* ── 순서 이동 버튼 ── */
.sq-move-btn {
  width: 22px; height: 22px;
  border: none;
  border-radius: 4px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.sq-move-btn:active { background: rgba(255,255,255,0.7); }
.sq-move-ph { width: 22px; flex-shrink: 0; }

.btn-save-sales {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px;
  padding: 14px;
  border: none; border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-save-sales:active { background: var(--primary-dark); }

/* 오늘 수주 현황 */
.sales-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px 16px;
  font-size: 14px;
}
.sales-today-header {
  font-size: 15px; font-weight: 800;
  padding: 12px 16px 4px;
  color: var(--text-primary);
}
.sales-today-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sales-customer-tile {
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--primary);
  color: #fff;
}
.sct-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sct-badge {
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.sct-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border);
}
.sct-btn {
  flex: 1;
  min-width: 60px;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.sct-btn:active { background: var(--bg); }
.sct-btn-del { color: var(--red); border-color: rgba(231,76,60,0.3); }
.sct-btn-order { background: var(--primary); color: #fff; border-color: var(--primary); }
.sct-btn-order:active { background: var(--primary-dark); }

/* ── 발주 바구니 ── */
.basket-header {
  font-size: 15px; font-weight: 800;
  padding: 16px 0 8px;
  color: var(--text-primary);
  border-top: 2px solid var(--primary);
  margin-top: 16px;
}
.basket-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.basket-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  position: relative;
  width: 140px;
  height: 80px;
  gap: 6px;
  box-sizing: border-box;
}
.basket-chip-name {
  font-size: 17px;
  line-height: 1.3;
}
.basket-chip-qty {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}
.basket-chip-del {
  position: absolute;
  top: -4px; right: -4px;
  background: rgba(0,0,0,0.35); border: none;
  color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; padding: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  line-height: 18px;
  text-align: center;
}
.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.summary-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 80px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
}
.summary-chip-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}
.summary-chip-qty {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--primary);
}
.basket-actions {
  display: flex;
  gap: 8px;
}
.basket-btn-clear {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.basket-btn-order {
  flex: 2;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.basket-btn-order:active { background: var(--primary-dark); }
.sct-items { padding: 4px 0; }
.sct-item-wrap {
  border-bottom: 1px solid var(--border);
}
.sct-item-wrap:last-child { border-bottom: none; }
.sct-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
}
.sct-item-check {
  gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sct-cb {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.sct-item-done {
  opacity: 0.5;
  text-decoration: line-through;
}
.sct-memo {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  padding: 0 12px 4px;
  margin-top: -4px;
}
.sct-done-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  vertical-align: middle;
}
.sct-qty { font-weight: 800; }


/* ── 발주 미리보기 테스트모드 ── */
.sms-preview-testmode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.sms-preview-testmode-row.testmode-on {
  background: #FEF9E7;
  border-color: var(--yellow);
}

.testmode-badge {
  display: inline-block;
  background: var(--yellow);
  color: #7D6608;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  animation: testBadgePulse 1.5s infinite;
}

@keyframes testBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

[data-theme="dark"] .sms-preview-testmode-row.testmode-on {
  background: #3D3500;
}

/* ── 발주 미리보기 그리드 ── */
.sms-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sms-preview-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
}
.sms-edit-area {
  width: 100%;
  min-height: 140px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  resize: vertical;
  outline: none;
}
.sms-edit-area:focus {
  border-color: var(--primary);
}

@media (min-width: 600px) {
  .sms-preview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 800px) {
  .sms-preview-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 최근 탭 ── */
.cho-recent {
  color: var(--primary) !important;
  font-weight: 800 !important;
}
.cho-recent.active {
  background: var(--primary) !important;
  color: #fff !important;
}

/* ── 즐겨찾기 (발주) ── */
.fav-section {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
}
.fav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 4px;
  white-space: nowrap;
}
.fav-chip {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* ── Pull-to-refresh ── */
.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--primary-light);
  z-index: 999;
  transform: translateY(-100%);
  opacity: 0;
  transition: opacity 0.2s;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card-bg);
  display: flex;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  z-index: 1000;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 0;
}

.nav-btn .nav-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
}

.nav-btn.active .nav-icon {
  color: var(--primary);
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn:active {
  background: var(--chip-bg);
}

/* ── Tab Sections ── */
.tab-section {
  display: none;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 40px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-section.active {
  display: block;
}

/* ── Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 4px 0;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
}

.header-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.header-btn:active {
  background: var(--green-dark);
}

/* ── Veggie Grid ── */
.veggie-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.veggie-item {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.veggie-item:active {
  transform: scale(0.96);
}

.veggie-item.selected {
  border-color: var(--green);
  background: var(--chip-bg);
}

.veggie-item .veggie-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 4px;
}

.veggie-item .veggie-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.veggie-item .veggie-vendor {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-dark);
}

/* ── Order Card ── */
.order-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 5px solid var(--green);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.order-card .card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-card .supplier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--chip-bg);
  border-radius: 8px;
  margin-bottom: 14px;
}

.supplier-row .label {
  font-size: 13px;
  color: var(--text-secondary);
}

.supplier-row .value {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-dark);
}

.order-card .field-group {
  margin-bottom: 14px;
}

.field-group .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Stepper ── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.stepper button {
  width: 52px;
  height: 52px;
  border: none;
  background: var(--card-bg);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.stepper button:active {
  background: var(--green);
  color: white;
}

.stepper .stepper-value {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 60px;
  padding: 0 4px;
}

.stepper .stepper-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-right: 14px;
}

/* ── Price Reference ── */
.price-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(245,158,11,0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--yellow-dark);
  font-weight: 700;
}

.price-ref .price-icon {
  font-size: 16px;
}

/* ── Send Button ── */
.order-action-row {
  display: flex;
  align-items: stretch;
  margin-top: 12px;
}

.btn-send {
  flex: 1;
  margin-right: 30px;
  padding: 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-send:active {
  background: var(--green-dark);
}

.btn-send:disabled {
  background: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-clear-queue {
  flex: 0 0 auto;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-clear-queue:active {
  background: var(--border);
}

/* ── Order Queue (발주 목록) ── */
.order-queue {
  margin-top: 16px;
}

.order-queue-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-secondary);
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

/* ── Vendor Tiles (업체별 타일) ── */
.vendor-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vendor-tile {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid var(--border);
}

.vendor-tile .vt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--green);
  color: white;
}

.vendor-tile .vt-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-tile .vt-badge {
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.vendor-tile .vt-items {
  padding: 8px 10px;
}

.vendor-tile .vt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--bg);
}

.vendor-tile .vt-row:last-child {
  border-bottom: none;
}

.vendor-tile .vt-product {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
}

.vendor-tile .vt-product-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-tile .vt-qty {
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  white-space: nowrap;
  margin-left: 4px;
}

.vendor-tile .vt-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  margin-left: 2px;
}

.vendor-tile .vt-footer {
  padding: 6px 10px 8px;
  border-top: 1px solid var(--bg);
}

.vendor-tile .vt-send {
  width: 100%;
  padding: 7px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.vendor-tile .vt-send:active {
  background: var(--green-dark);
}

/* ── Popup / Modal ── */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: flex-end;
  justify-content: center;
}

.popup-overlay.open {
  display: flex;
}

.popup-overlay.popup-center {
  align-items: center;
  padding: 16px;
}

.popup-overlay.popup-center .popup-content {
  border-radius: 16px;
  width: 100%;
  max-height: calc(100vh - 16px);
  box-sizing: border-box;
}

.popup-overlay.popup-full {
  padding: 12px;
  align-items: center;
}

.popup-overlay.popup-full .popup-content {
  border-radius: 16px;
  width: 100%;
  max-height: calc(100vh - 24px);
  height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popup-content {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  box-sizing: border-box;
  animation: popupSlide 0.3s ease-out;
}

@keyframes popupSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 480px) {
  .sq-qty-input {
    width: 36px;
    font-size: 13px;
    padding: 3px 1px;
  }
}

@media (max-width: 480px) {
  .popup-overlay {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .popup-content,
  .popup-overlay.popup-center .popup-content {
    border-radius: 0 !important;
    max-height: 100vh !important;
    height: 100vh;
    width: 100% !important;
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.popup-title {
  font-size: 20px;
  font-weight: 800;
}

.popup-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matrix-search-wrap {
  margin-bottom: 12px;
}

.matrix-search-wrap input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}

.matrix-search-wrap input:focus {
  border-color: var(--green);
  outline: none;
}

/* 업체 선택 드롭다운 */
.vendor-select-dropdown {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--popup-bg);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  z-index: 2100;
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.vendor-select-dropdown .dropdown-cho-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.vendor-select-dropdown .dropdown-cho-tab {
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--popup-bg);
  cursor: pointer;
}

.vendor-select-dropdown .dropdown-cho-tab.active {
  background: var(--green);
  color: #FFFFFF;
  border-color: var(--green);
}

.vendor-select-dropdown .dropdown-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

.vendor-select-dropdown .dropdown-title {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
}

.vendor-select-dropdown .dropdown-item {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.vendor-select-dropdown .dropdown-item:active,
.vendor-select-dropdown .dropdown-item:hover {
  background: var(--primary-light);
}

.vendor-select-dropdown .dropdown-item.current {
  color: var(--green-dark);
  background: var(--primary-light);
}

.vendor-select-dropdown .dropdown-item.dimmed {
  opacity: 0.45;
}

.dropdown-item-name {
  font-weight: 700;
}

.dropdown-item-unit {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.dropdown-item-vendor {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
}

.vendor-select-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 2099;
}

/* ── 미배정 품목 바 ── */
.match-unmatched-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: rgba(239,68,68,0.06);
  border: 1.5px solid rgba(239,68,68,0.2);
  border-radius: 8px;
}

.match-unmatched-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
  margin-right: 4px;
}

/* ── 업체 카드 ── */
.match-card-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 600px) {
  .match-card-container { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .match-card-container { grid-template-columns: repeat(4, 1fr); }
}

.match-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.match-card-header {
  background: var(--green);
  color: #FFFFFF;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-card-header .card-count {
  background: rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 13px;
}

.match-card-header.unmatched-header {
  background: var(--red);
}

@media (max-width: 480px) {
  .match-card-header {
    padding: 8px 10px;
    font-size: 12px;
  }
  .match-card-header .card-count {
    font-size: 10px;
    padding: 1px 7px;
  }
}

.match-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

.match-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  background: var(--chip-bg);
  border: 1.5px solid var(--chip-border);
  border-radius: 6px;
  cursor: pointer;
  min-height: 36px;
}

.match-card-chip .chip-name {
  font-size: 13px;
  font-weight: 700;
}

.match-card-chip .chip-unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.match-card-chip:active {
  background: var(--chip-border);
}

.match-card-chip.unmatched-chip {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
}

.match-card-chip.unmatched-chip:active {
  background: rgba(239,68,68,0.18);
}

.match-card-empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 4px 0;
}

.match-card-chip.add-chip {
  background: rgba(0,0,0,0.04);
  border: 1.5px dashed var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  padding: 6px 14px;
}

.match-card-chip.add-chip:active {
  background: var(--primary-light);
  border-color: var(--green);
  color: var(--green-dark);
}

/* ── Matrix Table (기존) ── */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.matrix-table th {
  background: var(--bg);
  padding: 10px 6px;
  font-weight: 800;
  text-align: center;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
}

.matrix-table td {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.matrix-table td.matched {
  background: var(--primary-light);
  color: var(--green-dark);
  font-weight: 800;
}

.matrix-table .product-cell {
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.3s;
  z-index: 3000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Stub Screen ── */
.stub-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: var(--text-secondary);
  text-align: center;
}

.stub-screen .stub-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.stub-screen .stub-text {
  font-size: 16px;
  font-weight: 700;
}

/* ── Settings Popup ── */
.settings-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.settings-input:focus {
  border-color: var(--green);
}

.settings-save-btn {
  width: 100%;
  padding: 14px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.settings-save-btn:active {
  background: var(--green-dark);
}

/* ── Manage Popup ── */
/* ── Theme Toggle ── */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.theme-toggle-label {
  font-size: 14px;
  font-weight: 700;
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.theme-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-track {
  background: var(--primary);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-toggle-btn.active .theme-toggle-track {
  background: var(--primary);
}

.theme-toggle-btn.active .theme-toggle-thumb {
  transform: translateX(20px);
}

.manage-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.manage-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: var(--bg);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.manage-tab.active {
  background: var(--green);
  color: white;
}

.manage-panel {
  display: none;
}

.manage-panel.active {
  display: block;
}

.manage-form {
  margin-bottom: 16px;
}

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}

.manage-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}

.manage-item-info .mi-icon {
  font-size: 24px;
}

.manage-item-info .mi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.manage-item-edit {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.manage-item-edit:active {
  background: var(--primary-light);
}

.manage-item-delete {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.manage-item-delete:active {
  background: rgba(239,68,68,0.1);
}

/* 인쇄 설정 거래처 체크리스트 */
#print-customer-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.print-customer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.print-customer-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ── Today Date ── */
.today-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Sales Date Bar ── */
.sales-date-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 12px;
}

.sales-date-prev,
.sales-date-next {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  width: 38px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 2;
  font-size: 14px;
}

.sales-date-prev:active,
.sales-date-next:active {
  background: var(--border);
}

.sales-date-picker {
  flex: 1;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-primary);
  text-align: center;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sales-date-picker:focus {
  border-color: var(--green);
}

.sales-date-picker.sales-date-past {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--primary-light);
}

.sales-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  font-size: 18px;
}

.sales-date-today-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  height: 42px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sales-date-today-btn:active {
  background: var(--green-dark);
}

/* ── Product Search ── */
.search-box {
  margin-bottom: 12px;
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
  background: var(--card-bg);
}

.search-input:focus {
  border-color: var(--green);
}

/* ── 경매 시세 탭 ── */
.auction-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.auc-half {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.auc-date-btn {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auc-date-picker {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  outline: none;
}
.auc-search-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
}
.auc-search-input:focus {
  border-color: var(--green);
}
.auc-search-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.auc-status {
  text-align: center;
  padding: 24px 16px;
  font-size: 14px;
  font-weight: 600;
}
.auc-loading { color: var(--text-secondary); }
.auc-error { color: var(--red); white-space: pre-line; }
.auc-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px;
  font-size: 14px;
}

.auc-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── 출처 탭 ── */
.auc-source-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.auc-source-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.auc-source-btn + .auc-source-btn {
  border-left: 2px solid var(--border);
}
.auc-source-btn.active-garak {
  background: #2E7D32;
  color: #fff;
}
.auc-source-btn.active-kamis {
  background: #1565C0;
  color: #fff;
}
.auc-source-btn .auc-src-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.8;
  margin-top: 1px;
}

.auc-group {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.auc-group-title {
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 800;
}

.auc-table {
  width: 100%;
}
.auc-thead {
  display: flex;
  padding: 6px 8px;
  border-bottom: 2px solid var(--border);
  background: var(--input-bg);
}
.auc-th {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-align: center;
}
.auc-row {
  display: flex;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.auc-row:last-child { border-bottom: none; }
.auc-td {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

.auc-th-kind, .auc-td-kind { flex: 2; text-align: left; }
.auc-th-rank, .auc-td-rank { flex: 1.2; }
.auc-th-unit, .auc-td-unit { flex: 1.2; font-size: 11px; }
.auc-th-price, .auc-td-price { flex: 1.8; font-weight: 800; }
.auc-th-prev, .auc-td-prev { flex: 1.8; color: var(--text-secondary); }
.auc-th-change, .auc-td-change { flex: 1.2; }

.auc-td-price { color: var(--text-primary); }
.auc-no-data { color: var(--text-secondary); font-weight: 600; }

.auc-up { color: var(--red); font-size: 11px; font-weight: 800; }

/* ── 편집 잠금 오버레이 ── */
.lock-content {
  position: relative;
}
.lock-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 50;
  border-radius: 8px;
}
.lock-blocked-content > .lock-overlay {
  display: block;
}
.lock-unlocked > .lock-overlay {
  display: none;
}

/* ── 편집 잠금 배너 (헤더 인라인) ── */
.lock-banner {
  padding: 8px 14px;
  border-radius: 10px;
  text-align: center;
}
.lock-blocked {
  background: #FFEBEE;
  border: 2px solid #E74C3C;
}
.lock-ready {
  background: #E8F5E9;
  border: 2px solid var(--green);
}
.lock-working {
  background: #E3F2FD;
  border: 2px solid #3498DB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lock-icon { font-size: 16px; }
.lock-force-btn {
  padding: 4px 10px;
  border: 1px solid #C62828;
  border-radius: 6px;
  background: #fff;
  color: #C62828;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 8px;
}
.lock-text { font-size: 13px; font-weight: 800; color: #C62828; }
.lock-sub { font-size: 10px; color: var(--text-secondary); margin-top: 1px; }
.lock-start-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.lock-end-btn {
  padding: 6px 16px;
  border: 2px solid #3498DB;
  border-radius: 8px;
  background: #fff;
  color: #3498DB;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.lock-working-text {
  font-size: 13px;
  font-weight: 800;
  color: #1565C0;
}

/* ── 커스텀 다이얼로그 ── */
.yw-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yw-dialog {
  background: var(--card-bg);
  border-radius: 16px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
}
.yw-dialog-title {
  padding: 18px 20px 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}
.yw-dialog-body {
  padding: 8px 20px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}
.yw-dialog-body input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  margin-top: 8px;
}
.yw-dialog-body input:focus {
  border-color: var(--green);
}
.yw-dialog-actions {
  display: flex;
  border-top: 1px solid var(--border);
}
.yw-dialog-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.yw-dialog-actions button + button {
  border-left: 1px solid var(--border);
}
.yw-dialog-actions .yw-btn-cancel {
  color: var(--text-secondary);
}
.yw-dialog-actions .yw-btn-confirm {
  color: var(--green);
}
.yw-dialog-actions .yw-btn-danger {
  color: #E74C3C;
}

/* ── 알림(리마인더) 말풍선 ── */
.reminder-bubble {
  position: fixed;
  right: 14px;
  /* 플로팅 설정 버튼(48px) 바로 위에 세로로 쌓음 */
  bottom: calc(var(--nav-height) + 72px);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 15px;
  /* 활성 상태 — 빨강 + 노란 테두리로 강조 */
  background: var(--red);
  color: #fff;
  border: 2.5px solid var(--yellow);
  border-radius: 24px;
  box-shadow: 0 4px 14px rgba(231,76,60,0.5);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  animation: reminder-pulse 1.8s ease-in-out infinite;
}
.reminder-bubble .rb-icon { display: flex; align-items: center; }
.reminder-bubble .rb-icon svg { width: 19px; height: 19px; display: block; }
.reminder-bubble .rb-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.reminder-bubble .rb-count {
  background: #fff;
  color: var(--red);
  border-radius: 11px;
  min-width: 22px;
  text-align: center;
  padding: 1px 7px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}
@keyframes reminder-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
/* 활성 알림 없을 때 — 무채색(설정 버튼과 동일 톤), 강조 없음 */
.reminder-bubble.idle {
  background: var(--card-bg);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  padding: 9px 11px;
  animation: none;
}

.reminder-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.reminder-panel {
  background: var(--card-bg);
  color: var(--text-primary);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.reminder-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}
.reminder-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}
.reminder-list {
  overflow-y: auto;
  padding: 10px 14px;
  flex: 1;
}
.reminder-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 0;
  font-size: 14px;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.reminder-item:last-child { border-bottom: none; }
.reminder-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px 10px 12px;
  transition: background 0.12s;
}
.reminder-item-body:active { background: var(--chip-bg); }
.rib-content { flex: 1; min-width: 0; }
.rib-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.reminder-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 5px;
}
.reminder-tag.today { background: var(--primary-light); color: var(--primary-dark); }
.reminder-tag.overdue { background: rgba(231,76,60,0.12); color: var(--red); }
.reminder-tag.future { background: var(--bg); color: var(--text-secondary); }
.reminder-item-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}
.reminder-edit-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  opacity: 0.7;
}
.reminder-item.editing .reminder-item-body {
  border-color: var(--primary);
  background: var(--primary-light);
}
.reminder-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.reminder-done {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.reminder-done:active { background: var(--primary-dark); }
.reminder-del {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.reminder-add {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.reminder-add-text {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
  background: var(--input-bg, var(--card-bg));
  color: var(--text-primary);
  box-sizing: border-box;
  resize: vertical;
}
.reminder-add-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.reminder-add-date {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  background: var(--input-bg, var(--card-bg));
  color: var(--text-primary);
  box-sizing: border-box;
}
.reminder-add-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.reminder-add-btn:active { background: var(--primary-dark); }
.reminder-cancel-btn {
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.reminder-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.reminder-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
}
.reminder-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}
.reminder-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  padding: 12px 4px 4px;
}

/* ── 자동완성 ── */
.auc-half { position: relative; }
.auc-suggest {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--card-bg);
  border: 2px solid var(--green);
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.auc-suggest-item {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.auc-suggest-item:last-child { border-bottom: none; }
.auc-suggest-item:active {
  background: var(--green);
  color: #fff;
}

/* ── 수집 버튼 ── */
.auc-refresh-btn {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}
.auc-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 행 터치 ── */
.auc-row-touch { cursor: pointer; }
.auc-row-touch:active { background: #F0F0F0; }
.auc-expand-hidden { display: none; }

/* ── 확장 영역 (등급 상세) ── */
.auc-expand {
  padding: 8px 10px 10px;
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

/* 가격 범위 바 */
.auc-price-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.auc-bar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.auc-bar-track {
  flex: 1;
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  position: relative;
}
.auc-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}
.auc-bar-avg {
  position: absolute;
  top: -16px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
  white-space: nowrap;
}

/* 추이 테이블 */
.auc-trend-area {
  margin-top: 4px;
}
.auc-trend-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.auc-trend-table {
  font-size: 13px;
  color: var(--text-primary);
}
.auc-trend-head {
  display: flex;
  font-weight: 800;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  margin-bottom: 2px;
}
.auc-trend-head span {
  flex: 1;
  text-align: center;
}
.auc-trend-row {
  display: flex;
  padding: 2px 0;
}
.auc-trend-row span {
  flex: 1;
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
}
.auc-trend-loading, .auc-trend-empty {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── 경매 기록 테이블 ── */
.auc-records-table { font-size: 13px; color: var(--text-primary); }
.auc-records-head {
  display: flex;
  font-weight: 800;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}
.auc-records-head span { text-align: center; cursor: pointer; user-select: none; }
.auc-records-head span:active { opacity: 0.6; }
.auc-records-row {
  display: flex;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.auc-records-row span { text-align: center; font-weight: 600; color: var(--text-primary); }
.auc-rec-col-price { flex: 1.4; font-size: 14px; }
.auc-rec-col-unit { flex: 0.9; font-size: 11px; }
.auc-rec-col-qty { flex: 0.6; }
.auc-rec-col-origin { flex: 2; font-size: 12px; }
.auc-rec-col-corp { flex: 1.2; font-size: 12px; }
.auc-rec-price { font-weight: 800 !important; color: var(--text-primary); }
.auc-type-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
}
.auc-type-auction { background: #E8F5E9; color: #2E7D32; }
.auc-type-medi { background: #FFF3E0; color: #E65100; }
[data-theme="dark"] .auc-type-auction { background: rgba(46,125,50,0.3); color: #81C784; }
[data-theme="dark"] .auc-type-medi { background: rgba(230,81,0,0.3); color: #FFB74D; }
/* ── 페이징 ── */
.auc-paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 4px;
}
.auc-page-btn {
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}
.auc-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.auc-page-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.auc-records-empty {
  text-align: center; padding: 10px; color: var(--text-secondary); font-size: 13px;
}
.auc-records-empty-sub {
  display: block; font-size: 11px; margin-top: 3px; opacity: 0.7;
}

/* 넓은 화면: 품종 그룹 2열 */
.auc-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .auc-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1024px) {
  .auc-detail-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.auc-down { color: #3498DB; font-size: 11px; font-weight: 800; }
.auc-flat { color: var(--text-secondary); font-size: 11px; }

/* ── 품목 태그 (가로 wrap) ── */
.auc-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.auc-kind-btn {
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  white-space: nowrap;
}
.auc-kind-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

/* ── 등급 태그 ── */
.auc-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.auc-rank-btn {
  padding: 5px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.auc-rank-btn.active {
  border-color: #3498DB;
  background: #3498DB;
  color: #fff;
}

.auc-detail {
  min-width: 0;
}

@media (max-width: 480px) {
  .auc-kind-btn { font-size: 11px; padding: 5px 8px; }
  .auc-rank-btn { font-size: 11px; padding: 4px 10px; }
  .auc-th { font-size: 10px; }
  .auc-td { font-size: 11px; }
  .auc-td-price { font-size: 12px; }
  .auc-up, .auc-down { font-size: 10px; }
  .auc-group-title { font-size: 13px; padding: 6px 10px; }
  .auc-thead { padding: 4px 6px; }
  .auc-row { padding: 6px 6px; }
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.search-result-item:active {
  transform: scale(0.98);
}

.search-result-item.selected {
  border-color: var(--green);
  background: var(--chip-bg);
}

.search-result-item .sr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-result-item .sr-name {
  font-size: 16px;
  font-weight: 800;
}

.search-result-item .sr-vendor {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
}

.search-result-item .sr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.search-result-item .sr-stepper {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.search-result-item .sr-minus,
.search-result-item .sr-plus {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-item .sr-minus:active,
.search-result-item .sr-plus:active {
  background: var(--green);
  color: white;
}

.search-result-item .sr-qty {
  width: 44px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 4px 2px;
  background: var(--card-bg);
  -moz-appearance: textfield;
}
.search-result-item .sr-qty::-webkit-inner-spin-button,
.search-result-item .sr-qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.search-result-item .sr-add {
  padding: 8px 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.search-result-item .sr-add:active {
  background: var(--green-dark);
}

.search-result-item.in-queue {
  border-color: var(--green);
  background: rgba(46,204,113,0.04);
}

/* ── Order History ── */
.history-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.history-dates-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-more-btn,
.history-less-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.history-less-btn {
  border-style: solid;
  font-size: 13px;
  padding: 8px;
  color: var(--text-secondary);
}

.history-date-col {
  flex: 1 1 calc(50% - 4px);
  min-width: calc(50% - 4px);
  max-width: calc(50% - 4px);
}

.history-date {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 0;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.history-date:active {
  background: var(--bg);
}

.history-date-label {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
}

.history-date-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 8px;
}

.history-toggle {
  font-size: 14px;
  color: var(--text-secondary);
}

.history-items {
  background: var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.history-vendor-group {
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}

.history-vendor-name {
  font-size: 12px;
  font-weight: 800;
  color: white;
  background: var(--green);
  padding: 5px 10px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.history-row:last-child {
  border-bottom: none;
}

.history-product-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-qty {
  font-size: 14px;
  color: var(--green-dark);
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.history-status-dot {
  flex-shrink: 0;
  font-size: 10px;
}

.history-status-dot.pending {
  color: var(--orange);
}

.history-status-dot.done {
  color: var(--text-secondary);
}

.history-legend {
  display: inline;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 10px;
}

.history-legend span {
  margin-right: 6px;
}

/* ── Today Orders (입고 처리) ── */
.today-orders-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.receiving-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.receiving-item.status-received {
  opacity: 0.6;
}

.ri-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ri-info .ri-name {
  font-size: 15px;
  font-weight: 800;
}

.ri-info .ri-detail {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ri-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-dark);
  margin-right: 10px;
}

.btn-receive {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-receive.pending {
  background: var(--yellow);
  color: var(--text-primary);
}

.btn-receive.pending:active {
  background: var(--yellow-dark);
}

.btn-receive.received {
  background: var(--border);
  color: var(--text-secondary);
  cursor: default;
}

.receive-price-input {
  width: 80px;
  padding: 4px 6px;
  border: 2px solid var(--green);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  text-align: right;
}

.btn-receive-confirm {
  padding: 4px 8px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.btn-receive-skip {
  padding: 4px 6px;
  background: var(--border);
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Date Filter ── */
.date-filter {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.date-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: var(--bg);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.date-btn.active {
  background: var(--green);
  color: white;
}

/* ── Receiving Section Titles ── */
.receiving-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receiving-section-title .badge {
  background: var(--yellow);
  color: var(--text-primary);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}

.receiving-section-title .badge-done {
  background: var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}

/* ── Receiving Card ── */
.recv-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.recv-card.done {
  opacity: 0.5;
}

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

.recv-name {
  font-size: 15px;
  font-weight: 800;
}

.recv-detail {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.recv-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-dark);
  white-space: nowrap;
}

.recv-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.recv-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Receiving Inline Form ── */
.recv-price-input {
  padding: 8px 10px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  text-align: right;
  background: var(--input-bg);
  color: var(--text-primary);
}
.recv-price-input:focus { border-color: var(--primary-dark); }
.recv-price-input::-webkit-inner-spin-button,
.recv-price-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.recv-price-input { -moz-appearance: textfield; }

.recv-form-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-confirm { background: var(--primary); color: white; }
.btn-confirm:active { background: var(--primary-dark); }
.btn-skip { background: var(--yellow); color: white; }
.btn-missing { background: var(--red); color: white; }
.btn-cancel { background: var(--text-secondary); color: white; }
.cv-item-missing { background: rgba(231,76,60,0.06); }

/* ── Vendor Summary ── */
.summary-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.summary-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-tile {
  flex: 1 1 calc(33.333% - 7px);
  min-width: calc(33.333% - 7px);
  max-width: calc(33.333% - 7px);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: center;
}

.summary-tile .st-vendor {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.summary-tile .st-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.summary-tile .st-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-dark);
  margin-top: 4px;
}

@media (min-width: 600px) {
  .summary-tile {
    flex: 1 1 calc(25% - 8px);
    min-width: calc(25% - 8px);
    max-width: calc(25% - 8px);
  }
}

/* ── Vendor Edit in Matrix ── */
.vendor-select {
  padding: 6px 4px;
  border: 2px solid var(--green);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Chosung Tabs (초성 탭) ── */
.chosung-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.chosung-tab {
  padding: 6px 0;
  min-width: 32px;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.chosung-tab.active {
  background: var(--green);
  color: white;
}

.chosung-tab:active {
  opacity: 0.7;
}

/* ── Product Grid (전체 품목) ── */
.product-grid-toggle {
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 4px;
}

.product-filter-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 0 4px;
}
.pf-tab {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pf-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.product-chip {
  padding: 8px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.product-chip:active {
  transform: scale(0.96);
}

.product-chip.in-queue {
  border-color: var(--green);
  background: var(--chip-bg);
  color: var(--green-dark);
}

.product-chip .chip-unit {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-left: 2px;
}

.product-chip.expanded {
  border-color: var(--green);
  background: rgba(46,204,113,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-stepper {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.chip-stepper button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-stepper button:active {
  background: var(--green);
  color: white;
}

.chip-stepper .chip-qty {
  width: 40px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  background: var(--card-bg);
  -moz-appearance: textfield;
}
.chip-stepper .chip-qty::-webkit-inner-spin-button,
.chip-stepper .chip-qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chip-add-btn {
  padding: 6px 10px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip-add-btn:active {
  background: var(--green-dark);
}

/* ── Manage Form Inline ── */
.manage-form-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.manage-form-row .settings-input {
  margin-bottom: 0;
  flex: 1;
}

.manage-form-row select.settings-input {
  flex: 0 0 80px;
  min-width: 80px;
}

.manage-form-row .settings-save-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 16px;
  white-space: nowrap;
}

/* ── Product Manage List (multi-column) ── */
#manage-product-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

#manage-product-list .chosung-tabs {
  grid-column: 1 / -1;
}

#manage-product-list .manage-item {
  padding: 4px 6px;
  gap: 2px;
  border-radius: 6px;
}

#manage-product-list .manage-item-info {
  font-size: 13px;
  gap: 4px;
}

#manage-product-list .manage-item-info .mi-sub {
  font-size: 10px;
}

#manage-product-list .manage-item-edit,
#manage-product-list .manage-item-delete {
  font-size: 11px;
  padding: 4px 5px;
}

#manage-product-list .settings-input {
  font-size: 12px;
  padding: 6px 8px;
}

@media (min-width: 600px) {
  #manage-product-list { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 800px) {
  #manage-product-list { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) {
  #manage-product-list { grid-template-columns: repeat(5, 1fr); }
}

/* ── Vendor Manage List (multi-column) ── */
#manage-vendor-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

#manage-vendor-list .manage-item {
  padding: 4px 6px;
  gap: 2px;
  border-radius: 6px;
}

#manage-vendor-list .manage-item-info {
  font-size: 14px;
  gap: 4px;
}

#manage-vendor-list .manage-item-info .mi-sub {
  font-size: 11px;
}

#manage-vendor-list .manage-item-edit,
#manage-vendor-list .manage-item-delete {
  font-size: 12px;
  padding: 4px 6px;
}

#manage-vendor-list .settings-input {
  font-size: 13px;
  padding: 8px;
}

@media (min-width: 600px) {
  #manage-vendor-list { grid-template-columns: repeat(3, 1fr); }
}

/* ── Customer Manage List (multi-column) ── */
#manage-customer-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

#manage-customer-list .manage-item {
  padding: 4px 6px;
  gap: 2px;
  border-radius: 6px;
}

#manage-customer-list .manage-item-info {
  font-size: 14px;
  gap: 4px;
}

#manage-customer-list .manage-item-info .mi-sub {
  font-size: 11px;
}

#manage-customer-list .manage-item-edit,
#manage-customer-list .manage-item-delete {
  font-size: 12px;
  padding: 4px 6px;
}

#manage-customer-list .settings-input {
  font-size: 13px;
  padding: 8px;
}

@media (min-width: 600px) {
  #manage-customer-list { grid-template-columns: repeat(3, 1fr); }
}

/* ── Vendor Tile Save-only ── */
.vt-footer-btns {
  display: flex;
  gap: 6px;
}

.vendor-tile .vt-save-only {
  flex: 1;
  padding: 7px;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.vendor-tile .vt-save-only:active {
  background: var(--bg);
}

.vendor-tile .vt-send {
  flex: 1;
}

/* ── Floating Settings Button ── */
.floating-settings-btn {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px);
  right: 14px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border);
  font-size: 22px;
  cursor: pointer;
  color: var(--icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-settings-btn:active {
  background: var(--bg);
}

/* ── Past Receiving ── */
.past-date-group {
  margin-bottom: 6px;
}

.past-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.past-date-header:active {
  background: var(--bg);
}

.past-toggle {
  font-size: 14px;
  color: var(--text-secondary);
}

.past-date-items {
  padding: 8px 0;
}

/* ── Receiving Sub Title ── */
.recv-sub-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Receiving Button Group ── */
.recv-btn-group {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.recv-btn-group button {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
}

.recv-edit-btn {
  color: var(--green-dark);
}

.recv-undo-btn {
  color: var(--red);
}

/* ── Price Stats ── */
.stats-range-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.stats-range-btn {
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.stats-range-btn.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.stats-range-btn:active {
  opacity: 0.8;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.stats-table th,
.stats-table td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}

.stats-table th {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
  background: var(--bg);
}

/* ── Stats Date Range ── */
.stats-date-range {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.stats-date-input {
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  background: var(--card-bg);
}

.stats-date-input:focus {
  border-color: var(--green);
}

/* ── Vendor Summary Grid (입고 업체별 합계) ── */
.vendor-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vendor-summary-card {
  flex: 1 1 calc(50% - 5px);
  min-width: calc(50% - 5px);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}


.vs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--bg);
  font-size: 13px;
}

.vs-row:last-child {
  border-bottom: none;
}

.vs-product {
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-price {
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 8px;
  font-size: 12px;
}

.vs-total {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  border-top: 2px solid var(--bg);
  text-align: right;
}

/* ── Stats Card Grid (가격 통계 카드) ── */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-card {
  flex: 0 0 calc(50% - 5px);
  max-width: calc(50% - 5px);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.sc-name {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
}

.sc-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sc-count {
  float: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sc-avg {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 6px;
}

.sc-range {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.sc-min {
  color: var(--primary);
}

.sc-max {
  color: var(--red);
}

.sc-date {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Pending Grid (미입고 업체별 카드) ── */
.pending-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pending-vendor-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pending-vendor-card .recv-card {
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.pending-vendor-card .recv-card:last-child { border-bottom: none; }
.pv-header {
  background: var(--orange);
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

/* ── Completed Grid (입고완료 업체별 카드) ── */
.completed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.completed-vendor-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cv-header {
  background: var(--text-secondary);
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.cv-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg);
}

.cv-item:last-child {
  border-bottom: none;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cv-name {
  font-size: 14px;
  font-weight: 700;
}

.cv-qty {
  font-size: 13px;
  font-weight: 800;
  color: var(--green-dark);
  margin-left: 4px;
}

.cv-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 8px;
}

.cv-total {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  border-top: 2px solid var(--bg);
  text-align: right;
}

.cv-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  justify-content: flex-end;
}

.cc-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
}

.cc-btn:active {
  opacity: 0.7;
}

.cc-edit {
  background: var(--green);
  color: white;
}

.cc-del {
  background: var(--red);
  color: white;
}

@media (min-width: 600px) {
  .vendor-tiles,
  .sales-today-tiles,
  .basket-tiles {
    grid-template-columns: repeat(3, 1fr);
  }
  .sales-queue-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .vendor-summary-card {
    flex: 1 1 calc(33.333% - 7px);
    min-width: calc(33.333% - 7px);
  }
  .pending-grid,
  .completed-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-card {
    flex: 0 0 calc(33.333% - 7px);
    max-width: calc(33.333% - 7px);
  }
}

@media (min-width: 800px) {
  .vendor-tiles,
  .sales-today-tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  .sales-queue-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .pending-grid,
  .completed-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1000px) {
  .vendor-tiles,
  .sales-today-tiles {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .vendor-tiles,
  .sales-today-tiles {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ══ 가격 상세 팝업 ══ */
.price-detail-content {
  max-width: 500px;
  margin: 0 auto;
}
.pd-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.pd-avg {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.pd-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}
.pd-list {
  max-height: 50vh;
  min-height: 80px;
  overflow-y: auto;
}
.pd-list .vs-table td,
.pd-list .vs-table th {
  padding: 10px 8px;
}

/* ══ 중복 클릭 방지 ══ */
.btn-loading {
  pointer-events: none;
  position: relative;
  color: var(--text-secondary) !important;
  background: var(--bg-section) !important;
  border-color: var(--border) !important;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ══ 통계 서브탭 ══ */
.stats-sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
  padding: 0 12px;
}
.stats-sub-tab {
  flex: 1;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s, border-color 0.2s;
}
.stats-sub-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.stats-sub-panel {
  padding: 0 12px 12px;
}

/* ══ 업체 선택 버튼 ══ */
.vendor-select-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.vendor-select-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.vendor-select-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ══ 업체별 통계 카드 ══ */
.vendor-stats-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}
.vs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}
.vs-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.vs-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.vs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vs-table thead {
  background: var(--bg-section);
}
.vs-table th {
  padding: 8px 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.vs-table th:not(:first-child) {
  text-align: right;
}
.vs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.vs-td-name {
  font-weight: 700;
}
.vs-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vs-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding-top: 10px;
}
.vs-pending {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #E67E22;
  text-align: right;
}

/* ══ 거래처별 수주 - 뷰 토글 ══ */
.cust-view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.cust-view-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}
.cust-view-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ══ 날짜별 뷰 ══ */
.cust-date-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 10px;
}
.cust-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}
.cust-date-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.cust-date-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.cust-date-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.cust-date-row:last-child {
  border-bottom: none;
}
.cust-date-cname {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.cust-date-items {
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.cust-date-item b {
  font-weight: 800;
}
.cust-date-sep {
  color: var(--text-secondary);
  opacity: 0.4;
}

/* ═══ 발송 현황 팝업 ═══ */
.sms-sec-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sms-count {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 8px;
}
.sms-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 18px 0;
  font-size: 14px;
}
.sms-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sms-item-main {
  flex: 1;
  min-width: 0;
}
.sms-item-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.sms-vendor {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sms-phone {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex: 0 0 auto;
}
.sms-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 4.5em;
  overflow: hidden;
}
.sms-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
}
.sms-delayed {
  border-color: rgba(231, 76, 60, 0.5);
  background: rgba(231, 76, 60, 0.06);
}
.sms-delayed .sms-meta {
  color: var(--red);
  font-weight: 700;
}
.sms-sent {
  opacity: 0.92;
}
.sms-cancel-btn {
  flex: 0 0 auto;
  align-self: center;
  padding: 8px 12px;
  border: 1px solid rgba(231, 76, 60, 0.4);
  background: var(--card-bg);
  color: var(--red);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.sms-cancel-btn:active {
  background: rgba(231, 76, 60, 0.1);
}

/* 발송완료 — 날짜 그룹 + 컴팩트 카드 */
.sms-day {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 12px 2px 6px;
}
.sms-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.sms-day-count {
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0.75;
}
.sms-sent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
}
.sms-sent-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 7px 11px;
  min-width: 0;
}
.sms-sent-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.sms-sent-head .sms-vendor {
  font-size: 14px;
  flex: 0 1 auto;
}
.sms-sent-head .sms-phone {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sms-time {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}
.sms-sent-msg {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  opacity: 0.9;
  /* 최대 4줄까지 표시 후 말줄임 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  max-height: calc(1.45em * 4);
}
