/* AU RÊVE — 전체 스타일
 * Revolut Light / Fintech Design System
 * UI 수정 시 이 파일만 편집
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@700&family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

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

/* ─── DESIGN TOKENS ─── */
:root {
  /* Backgrounds */
  --bg:             #f5f5f7;
  --surface:        #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f9f9fb;

  /* Legacy aliases (used in JS inline styles) */
  --cream:          #f5f5f7;
  --sand:           #ebebeb;
  --white:          #ffffff;

  /* Text */
  --text-primary:   #0d0d14;
  --text-secondary: #8e8ea0;
  --text-muted:     #b8b8cc;

  /* Legacy aliases */
  --charcoal:       #0d0d14;
  --soft-black:     #0d0d14;
  --muted:          #8e8ea0;
  --taupe:          #b8b8cc;

  /* Borders */
  --border:         #ebebeb;
  --border-strong:  #d4d4e0;

  /* Accent */
  --accent:         #4f6ef7;
  --accent-end:     #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #4f6ef7 0%, #8b5cf6 100%);
  --accent-bg:      #f0f0ff;
  --accent-glow:    rgba(79, 110, 247, 0.18);

  /* Semantic */
  --success:        #0aaa7a;
  --success-bg:     #e6f7f2;
  --danger:         #e04444;
  --danger-bg:      #fde8e8;
  --warning:        #f59e0b;
  --warning-bg:     #fef3cd;

  /* Channel colors */
  --ch-musinsa:     #ff4a6e;
  --ch-musinsa-bg:  #fff0f3;
  --ch-cafe24:      #4f6ef7;
  --ch-cafe24-bg:   #eef1ff;
  --ch-direct:      #8b5cf6;
  --ch-direct-bg:   #f3eeff;

  /* Shadows */
  --shadow-card:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-hover:   0 6px 20px rgba(0,0,0,0.10);
  --shadow-modal:   0 24px 64px rgba(0,0,0,0.14);

  /* Radius */
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      20px;
  --radius-pill:    100px;
}

/* ─── BASE ─── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── LAYOUT ─── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  line-height: 1;
}

.sidebar-brand .brand-sub {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: 5px;
}

.nav-group { padding-top: 6px; flex-shrink: 0; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 20px 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 20px 7px 17px;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--surface-subtle);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  opacity: 0.7;
  flex-shrink: 0;
}
.nav-item.active .nav-icon { opacity: 1; }

/* ─── MAIN CONTENT ─── */
.main {
  margin-left: 220px;
  flex: 1;
  padding: 32px 36px;
  max-width: calc(100vw - 220px);
  min-height: 100vh;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.18s ease; }

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

/* ─── PAGE HEADER ─── */
.page-header { margin-bottom: 24px; }

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ─── METRICS GRID ─── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.metric-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-link { cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.metric-link:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }

.metric-value.positive { color: var(--success); }
.metric-value.negative { color: var(--danger); }

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

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

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

thead { position: sticky; top: 0; z-index: 1; }

th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--surface-subtle); }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-musinsa { background: var(--ch-musinsa-bg); color: var(--ch-musinsa); }
.badge-cafe24  { background: var(--ch-cafe24-bg);  color: var(--ch-cafe24);  }
.badge-direct  { background: var(--ch-direct-bg);  color: var(--ch-direct);  }
.badge-sponsor { background: #f3eeff; color: #7c3aed; }
.badge-sale    { background: var(--success-bg); color: var(--success); }
.badge-cancel  { background: var(--danger-bg);  color: var(--danger);  }
.badge-pending { background: var(--warning-bg); color: var(--warning); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(79,110,247,0.28);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79,110,247,0.36);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.btn-outline:hover {
  background: var(--surface-subtle);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224,68,68,0.12);
}
.btn-danger:hover { background: #fbd5d5; }

.btn-sm { padding: 5px 11px; font-size: 11.5px; }

/* ─── FORMS ─── */
.form-grid   { display: grid; gap: 12px; margin-bottom: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--surface-subtle);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── UPLOAD ZONE ─── */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-subtle);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.upload-icon { font-size: 26px; margin-bottom: 10px; color: var(--text-secondary); }
.upload-text { font-size: 13px; color: var(--text-secondary); }
.upload-sub  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}

.channel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.channel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.channel-card:nth-child(1)::before { background: var(--ch-musinsa); }
.channel-card:nth-child(2)::before { background: var(--ch-cafe24); }
.channel-card:nth-child(3)::before { background: var(--ch-direct); }

.channel-name {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.channel-sales {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.channel-profit {
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
  font-weight: 500;
}

.channel-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── PROFIT PREVIEW ─── */
.profit-preview {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
  display: none;
}

.profit-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}

.profit-row .lbl { color: var(--text-secondary); }
.profit-row .val { font-weight: 500; font-variant-numeric: tabular-nums; }
.profit-divider { border-top: 1px solid var(--border); margin: 6px 0; }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── SUB TABS (자사몰 등 카드 내부 탭) ─── */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sub-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.sub-tab:hover:not(.active) { color: var(--text-primary); }

.sub-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  background: var(--surface-subtle);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}

.sub-tab.active .sub-tab-badge {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ─── INVENTORY SPECIFIC ─── */
.stock-low { color: var(--danger); font-weight: 500; }
.stock-ok  { color: var(--text-primary); }

.inline-input {
  width: 70px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 12px;
  text-align: right;
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* ─── CHART BARS ─── */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-row { display: flex; align-items: center; gap: 10px; }

.bar-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  width: 100px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface-subtle);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  min-width: 2px;
}

.bar-fill         { background: linear-gradient(90deg, var(--accent), var(--accent-end)); }
.bar-fill.musinsa { background: linear-gradient(90deg, #ff4a6e, #ff7a96); }
.bar-fill.cafe24  { background: linear-gradient(90deg, var(--accent), #6d8cf9); }
.bar-fill.direct  { background: linear-gradient(90deg, var(--accent-end), #a78bfa); }

.bar-val {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  width: 90px;
  font-variant-numeric: tabular-nums;
}

/* ─── MONTHLY CHART ─── */
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 16px;
}

.month-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.month-bar {
  width: 100%;
  background: var(--accent-gradient);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s cubic-bezier(.4,0,.2,1);
  min-height: 2px;
}

.month-label {
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── EXPENSE CATEGORY ─── */
.expense-category {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 500;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── ALERTS ─── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info    { background: var(--accent-bg);  color: var(--accent); }

/* ─── SORTABLE HEADERS ─── */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text-primary); }
th.sortable::after { content: ' ⇅'; font-size: 9px; color: var(--text-muted); }
th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
th.sort-desc::after { content: ' ↓'; color: var(--accent); }
th.sort-asc, th.sort-desc { color: var(--accent); }

/* ─── INVENTORY EXPAND ─── */
.inv-row { cursor: pointer; }
.inv-row:hover td { background: var(--surface-subtle); }
.inv-detail-row { display: none; background: var(--surface-subtle); }
.inv-detail-row.open { display: table-row; }
.inv-detail-inner { padding: 4px 0; display: block; }
.inv-product-img {
  width: 150px;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--border);
}
.inv-product-img-placeholder {
  width: 150px;
  height: 190px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}
.inv-history { flex: 1; }
.inv-history-title {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}
.inv-history-table { width: 100%; font-size: 12px; border-collapse: collapse; margin-bottom: 14px; }
.inv-history-table th { text-align: left; padding: 5px 10px; font-size: 10px; color: var(--text-secondary); border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.inv-history-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.inv-add-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inv-add-form input,
.inv-add-form select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.inv-add-form input:focus,
.inv-add-form select:focus {
  border-color: var(--accent);
}
.inv-expand-btn {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: 6px;
  display: inline-block;
  transition: transform 0.2s;
}
.inv-expand-btn.open { transform: rotate(90deg); }

/* ─── SORT BUTTONS ─── */
.sort-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 400;
  background: var(--surface);
  cursor: pointer;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  transition: all 0.12s;
}

.sort-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.sort-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(79,110,247,0.25);
}

/* ─── MEMO CELL ─── */
.memo-cell { cursor: pointer; }
.memo-cell:hover { color: var(--text-primary); }
.memo-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  outline: none;
}

/* ─── NUMBER FORMATTING ─── */
td[style*="text-align:right"],
th[style*="text-align:right"] {
  font-variant-numeric: tabular-nums;
}

/* ─── SCROLLBAR STYLING ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SELECT OVERRIDES ─── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e8ea0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px !important;
  cursor: pointer;
}

/* ─── CHANNEL DOT HELPER ─── */
.ch-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}
.ch-dot-musinsa { background: var(--ch-musinsa); }
.ch-dot-cafe24  { background: var(--ch-cafe24);  }
.ch-dot-direct  { background: var(--ch-direct);  }

/* ─── INLINE SELECTS (inside tables) ─── */
td select {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 3px 24px 3px 8px;
  background-color: var(--surface-subtle);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
}
td select:focus { border-color: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .main { padding: 24px 20px; }
  .metric-value { font-size: 18px; }
}

@media (max-width: 900px) {
  .sidebar { width: 180px; }
  .main { margin-left: 180px; padding: 20px; max-width: calc(100vw - 180px); }
  .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ─── MOBILE (hamburger + sidebar + layout) ─── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.mobile-header .brand-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.06em;
}
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 160;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    max-width: 100vw;
    padding: 72px 16px 24px;
  }

  .page-header { flex-wrap: wrap; gap: 6px; }
  .page-title { font-size: 18px; }
  .page-sub { font-size: 12px; }

  .metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metric-card { padding: 14px 12px; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: 16px; }

  .channel-grid { grid-template-columns: 1fr; }
  .channel-card { padding: 16px; }
  .channel-sales { font-size: 20px; }

  .dash-bottom-grid { grid-template-columns: 1fr; }

  .form-grid-4 { grid-template-columns: 1fr; }

  .section-title { font-size: 14px; }

  .card { padding: 16px; }

  table { font-size: 12px; }
  th, td { padding: 8px 10px; }

  .tab-bar { flex-wrap: wrap; gap: 4px; }
  .tab-btn { font-size: 12px; padding: 6px 12px; }

  .btn { font-size: 12px; padding: 7px 14px; }

  .modal-content { width: 95vw; max-height: 90vh; margin: 5vh auto; padding: 20px 16px; }
}

/* ─── STOCKTAKE & ADJUSTMENTS ─── */
.stocktake-input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  background: var(--surface);
  font-family: inherit;
}
.stocktake-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.15);
}
.adj-reason-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.adj-reason-badge.negative {
  background: rgba(224, 68, 68, 0.08);
  color: var(--danger);
}
.adj-reason-badge.positive {
  background: rgba(10, 170, 122, 0.08);
  color: var(--success);
}
