/* ===== ERP System — Global Styles (Modern Minimal — Linear / Vercel) ===== */

:root {
  /* Palette — modern-minimal direction */
  --bg:       oklch(99% 0.002 240);
  --surface:  oklch(100% 0 0);
  --fg:       oklch(18% 0.012 250);
  --muted:    oklch(54% 0.012 250);
  --border:   oklch(92% 0.005 250);
  --accent:   oklch(58% 0.18 255);

  /* Semantic colors */
  --success:  oklch(52% 0.14 155);
  --warn:     oklch(72% 0.14 85);
  --danger:   oklch(58% 0.18 25);
  --info:     oklch(58% 0.18 255);

  /* Tinted backgrounds for pills */
  --success-bg: oklch(95% 0.04 155);
  --warn-bg:    oklch(97% 0.06 85);
  --danger-bg:  oklch(96% 0.05 25);
  --info-bg:    oklch(95% 0.04 255);
  --accent-bg:  oklch(94% 0.04 255);

  /* Edited cell highlight */
  --edited-bg:  oklch(93% 0.06 255);

  /* Fonts */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;

  /* Top nav height */
  --nav-height: 56px;
  --subnav-height: 44px;
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== Tabular numerics ===== */
.num, [data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ===== Top Nav (Role Tabs) ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-sm);
}

.top-nav-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: var(--space-xl);
  white-space: nowrap;
  user-select: none;
}

.role-tabs {
  display: flex;
  gap: 0;
  list-style: none;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.role-tabs::-webkit-scrollbar { display: none; }

.role-tab {
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.role-tab:hover { color: var(--fg); }
.role-tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: var(--space-xs);
  margin-left: auto;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--muted); color: var(--fg); }
.lang-btn.active {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
}

/* ===== Sub Nav (Section Tabs) ===== */
.sub-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--subnav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-xs);
}

.sub-tab {
  padding: var(--space-xs) var(--space-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border: none;
}
.sub-tab:hover { color: var(--fg); background: var(--bg); }
.sub-tab.active { color: var(--fg); background: var(--border); }

/* ===== Main Content ===== */
.main-content {
  padding: var(--space-xl);
  max-width: 1400px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: var(--space-xs);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  background: var(--bg);
  border-color: var(--fg);
  color: var(--fg);
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
.btn-primary:hover {
  opacity: 1;
  filter: brightness(0.92);
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

.btn-success {
  background: var(--surface);
  color: var(--success);
  border-color: var(--success);
}
.btn-success:hover {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.btn-info {
  background: var(--surface);
  color: var(--info);
  border-color: var(--info);
}
.btn-info:hover {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info);
}

.btn-warn {
  background: var(--surface);
  color: var(--warn);
  border-color: var(--warn);
}
.btn-warn:hover {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn);
}

.btn-danger {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-sm {
  font-size: 12px;
  padding: var(--space-xs) var(--space-md);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}
.btn-ghost:hover {
  background: oklch(58% 0.18 255 / 0.08);
  border-color: transparent;
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Status Pills ===== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warn    { background: var(--warn-bg); color: var(--warn); }
.pill-danger  { background: var(--danger-bg); color: var(--danger); }
.pill-info    { background: var(--info-bg); color: var(--info); }
.pill-muted   { background: var(--border); color: var(--muted); }
.pill-accent  { background: var(--accent-bg); color: var(--accent); }

/* ===== Tables ===== */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.data-table tr:hover td { background: oklch(99% 0.003 250); }

.data-table .row-danger { background: oklch(97% 0.03 25) !important; }
.data-table .row-danger:hover td { background: oklch(96% 0.04 25) !important; }

.data-table .cell-edited {
  background: var(--edited-bg);
}

.data-table .cell-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
}

.filter-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  flex-shrink: 0;
}

.filter-input, .filter-select {
  font-size: 13px;
  font-family: var(--font-body);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--fg);
  min-width: 140px;
  align-self: center;
}
.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Cards ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-lg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-lg);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: var(--space-xs);
}

.stat-change {
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: var(--space-xs);
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.02 240 / 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-xl);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: var(--space-xs);
}
.modal-close:hover { color: var(--fg); }

/* ===== Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.form-input, .form-select, .form-textarea {
  font-size: 13px;
  font-family: var(--font-body);
  padding: var(--space-sm) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--fg);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea { resize: vertical; min-height: 60px; }

.form-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 9px;
  background: var(--danger);
  color: white;
}

/* ===== Launch Cards (Index) ===== */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.launch-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-xl);
  text-decoration: none;
  color: var(--fg);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.launch-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px oklch(20% 0.02 240 / 0.08);
}

.launch-card-role {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.launch-card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.launch-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.launch-card-screens {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: auto;
}

.launch-screen-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s;
}
.launch-screen-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Section Divider ===== */
.section { margin-bottom: var(--space-2xl); }
.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

/* ===== Notification Center ===== */
.notif-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-time {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-left: auto;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main-content { padding: var(--space-lg); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 13px; }
  .top-nav { padding: 0 var(--space-md); }
  .top-nav-brand { display: none; }
  .main-content { padding: var(--space-md); }
  .page-header { flex-direction: column; gap: var(--space-md); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-input, .filter-select { min-width: 0; width: 100%; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .launch-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .role-tab { padding: var(--space-xs) var(--space-md); font-size: 12px; }
  .stats-row { grid-template-columns: 1fr; }
}

/* ===== Shipping Flow Diagram ===== */
.ship-flow {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-lg) var(--space-xl);
}

.ship-flow-track {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: var(--space-sm) 0;
}

.ship-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  min-width: 80px;
}

.ship-flow-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ship-flow-num {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.ship-flow-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.ship-flow-desc {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-align: center;
  white-space: nowrap;
}

.ship-flow-line {
  flex: 1;
  min-width: 32px;
  max-width: 80px;
  height: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ship-flow-arrow {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 10px;
}

/* Flow step hover effect */
.ship-flow-step:hover .ship-flow-circle {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* ===== Pagination ===== */
.data-table-wrap > .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-md);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 var(--space-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--fg);
  background: var(--bg);
}
.page-btn.active {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-size-select {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px var(--space-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}
.page-size-select:focus {
  outline: none;
  border-color: var(--accent);
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.pagination-jump input {
  width: 48px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px var(--space-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--fg);
  text-align: center;
}
.pagination-jump input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Vertical Order Cards (千牛-style expandable) ===== */
.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}
.order-card:hover { border-color: oklch(80% 0.01 250); }
.order-card.expanded { border-color: var(--accent); }

.order-card-header {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-lg);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.order-card-header:hover { background: oklch(99% 0.003 250); }
.order-card-header .addr {
  display: inline-flex;
  align-items: center;
  max-width: 25ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
  color: var(--muted);
}

.order-chevron {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.order-card.expanded .order-chevron { transform: rotate(90deg); color: var(--accent); }

.order-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.order-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.order-skus {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-customer {
  font-size: 12px;
  color: var(--fg);
  white-space: nowrap;
}

.order-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  white-space: nowrap;
}

.order-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.order-source {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px var(--space-xs);
  border-radius: var(--radius-xs);
  background: var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* Order card body (expanded) */
.order-card-body {
  display: none;
  border-top: 1px solid var(--border);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}
.order-card.expanded .order-card-body { display: block; }

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.order-detail-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.order-detail-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.order-detail-value {
  font-size: 13px;
  line-height: 1.6;
}

.order-detail-value.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* SKU table inside expanded card */
.sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sku-table th {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border);
}
.sku-table td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.sku-table tr:last-child td { border-bottom: none; }

/* Order actions bar */
.order-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
}
.btn-danger-ghost:hover {
  background: oklch(91% 0.2 20);
  border-color: var(--danger);
}

.btn-warn-ghost {
  background: transparent;
  color: var(--warn);
  border: 1px solid var(--border);
}
.btn-warn-ghost:hover {
  background: oklch(91% 0.2 80);
  border-color: var(--warn);
}

/* Note / remark */
.order-remark {
  font-size: 12px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xs);
  background: var(--bg);
  border-left: 2px solid var(--border);
  margin-top: var(--space-sm);
}
.order-remark.buyer { border-left-color: var(--info); }
.order-remark.seller { border-left-color: var(--accent); }
.order-remark-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ===== Address parse preview ===== */
.address-parse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
}
.address-parse-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.address-parse-field label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.address-parse-field .val {
  font-size: 13px;
  font-weight: 500;
}

/* ===== Reports / Charts ===== */
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  height: 200px;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.chart-bar {
  flex: 1;
  min-width: 24px;
  max-width: 48px;
  background: var(--accent);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  position: relative;
  transition: opacity 0.15s;
  cursor: default;
}
.chart-bar:hover { opacity: 0.85; }
.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}
.chart-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

/* Legend */
.chart-legend {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ===== Cross-border badge ===== */
.badge-cross {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px var(--space-xs);
  border-radius: var(--radius-xs);
  background: var(--accent-bg);
  color: var(--accent);
  white-space: nowrap;
}

/* SKU checkbox */
.sku-table .sku-check,
.sku-table .sku-check-all {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.sku-table thead th:first-child,
.sku-table tbody td:first-child {
  text-align: center;
  padding: 6px 4px;
}

/* ===== Auto-tag input (supplier buyers) ===== */
.auto-tag-input-wrap {
  position: relative;
  width: 100%;
}
.auto-tag-input-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: text;
  transition: border-color 0.15s;
}
.auto-tag-input-inner:focus-within {
  border-color: var(--accent);
}
.auto-tag-selected {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.auto-tag-textinput {
  flex: 1 1 auto;
  min-width: 120px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--fg);
  line-height: 24px;
  padding: 0 4px;
}
.auto-tag-textinput::placeholder {
  color: var(--muted);
}
.auto-tag-dropdown {
  display: none;
  position: absolute;
  z-index: 1000;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 180px;
  overflow-y: auto;
}

/* ===== Product Country Tabs ===== */
.product-country-tabs {
  display: flex;
  gap: 0;
  margin-top: var(--space-md);
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.country-tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.country-tab-btn:hover {
  color: var(--fg);
}

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

.product-country-content {
  min-height: 0;
}

.product-country-panel {
  padding: var(--space-md) 0 var(--space-sm);
}

.product-country-panel-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--fg);
}

/* ===== Print ===== */
@media print {
  .top-nav, .sub-nav, .lang-switcher, .btn, .filter-bar { display: none !important; }
  .main-content { padding: 0; max-width: none; }
}
