/* ============================================================
   LuckyShop 交付质检工作台 - Design System
   Style: business-international / clean enterprise admin
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  /* Primary */
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-light: #dbeafe;
  --c-primary-50: #eff6ff;

  /* Neutral */
  --c-bg: #f1f5f9;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-text: #1e293b;
  --c-text-sub: #64748b;
  --c-text-light: #94a3b8;
  --c-text-white: #ffffff;

  /* Status */
  --c-success: #16a34a;
  --c-success-light: #dcfce7;
  --c-warning: #d97706;
  --c-warning-light: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-light: #fee2e2;
  --c-info: #0891b2;
  --c-info-light: #cffafe;
  --c-purple: #7c3aed;
  --c-purple-light: #ede9fe;

  /* Typography */
  --font-body: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Consolas", "Courier New", monospace;
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 32px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-full: 9999px;

  /* Shadow */
  --sh-sm: 0 1px 2px rgba(0,0,0,.05);
  --sh-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --sh-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --sh-card: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Layout */
  --sidebar-w: 220px;
  --sidebar-collapsed: 60px;
  --topbar-h: 56px;
  --content-max: 1400px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 300ms;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: var(--fs-base); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--dur) var(--ease);
  overflow: hidden;
}
.app-sidebar .brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar .brand svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--c-primary); }
.app-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.app-nav .nav-group-label {
  font-size: var(--fs-xs);
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 12px 4px;
  white-space: nowrap;
}
.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: #94a3b8;
  font-size: var(--fs-base);
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  position: relative;
}
.app-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.app-nav a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.app-nav a.active { background: var(--c-primary); color: #fff; font-weight: 600; }
.app-nav a .nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--c-danger);
  color: #fff;
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-weight: 600;
}
.app-nav a.active .nav-badge { background: rgba(255,255,255,.25); }
.app-sidebar .sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: var(--fs-xs);
  color: #64748b;
  white-space: nowrap;
}

/* Main area */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-topbar .page-title { font-size: var(--fs-lg); font-weight: 700; color: var(--c-text); }
.app-topbar .topbar-spacer { flex: 1; }
.app-topbar .topbar-info { display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); color: var(--c-text-sub); }
.app-topbar .role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.app-topbar .role-tag.delivery { background: var(--c-primary-light); color: var(--c-primary); }
.app-topbar .role-tag.qc { background: var(--c-success-light); color: var(--c-success); }
.app-topbar .role-tag.production { background: var(--c-warning-light); color: var(--c-warning); }
.app-topbar .mobile-menu-btn { display: none; }

/* Content */
.app-content { flex: 1; padding: 24px; max-width: none; min-width:0; width: 100%; }
.page-section { margin-bottom: var(--sp-6); }

/* ---- Components ---- */

/* Card */
.card {
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  border: 1px solid var(--c-border-light);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-light);
}
.card-header h3 { font-size: var(--fs-lg); font-weight: 600; }
.card-header .header-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }
.card-body.flush { padding: 0 20px 20px; }

/* KPI Card */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.kpi-card {
  background: var(--c-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-light);
  padding: 18px 20px;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.kpi-card .kpi-label { font-size: var(--fs-xs); color: var(--c-text-sub); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-card .kpi-value { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; }
.kpi-card .kpi-sub { font-size: var(--fs-xs); color: var(--c-text-light); margin-top: 4px; }
.kpi-card .kpi-icon { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.kpi-card .kpi-icon svg { width: 18px; height: 18px; }
.kpi-card.kpi-danger .kpi-value { color: var(--c-danger); }
.kpi-card.kpi-warning .kpi-value { color: var(--c-warning); }
.kpi-card.kpi-success .kpi-value { color: var(--c-success); }
.kpi-card.kpi-primary .kpi-value { color: var(--c-primary); }

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-outline { border-color: var(--c-border); color: var(--c-text-sub); background: var(--c-surface); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-ghost { color: var(--c-text-sub); }
.btn-ghost:hover { background: var(--c-surface-2); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn-lg { padding: 10px 24px; font-size: var(--fs-lg); }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Input */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--dur-fast) var(--ease);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }
.input-sm { padding: 5px 10px; font-size: var(--fs-xs); }
.textarea { resize: vertical; min-height: 80px; }
.input-group { display: flex; align-items: center; gap: 0; }
.input-group .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input-group-prepend { padding: 8px 12px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-sm) 0 0 var(--r-sm); color: var(--c-text-sub); }
label.form-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
label.form-label .req { color: var(--c-danger); }
.form-row { margin-bottom: 16px; }
.form-hint { font-size: var(--fs-xs); color: var(--c-text-light); margin-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--c-text-sub);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border-light); vertical-align: middle; }
table.data-table tbody tr { transition: background var(--dur-fast) var(--ease); }
table.data-table tbody tr:hover { background: var(--c-surface-2); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table .cell-strong { font-weight: 600; }
table.data-table .cell-mono { font-family: var(--font-mono); font-size: var(--fs-xs); }
table.data-table .cell-link { color: var(--c-primary); cursor: pointer; font-weight: 500; }
table.data-table .cell-link:hover { text-decoration: underline; }

/* Tag / Status */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag-success { background: var(--c-success-light); color: var(--c-success); }
.tag-warning { background: var(--c-warning-light); color: var(--c-warning); }
.tag-danger { background: var(--c-danger-light); color: var(--c-danger); }
.tag-info { background: var(--c-primary-light); color: var(--c-primary); }
.tag-neutral { background: var(--c-border); color: var(--c-text-sub); }
.tag-purple { background: var(--c-purple-light); color: var(--c-purple); }
.tag-outline { background: transparent; border: 1px solid currentColor; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filter-bar .filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .filter-item label { font-size: var(--fs-xs); color: var(--c-text-sub); font-weight: 600; }
.filter-bar .filter-actions { margin-left: auto; display: flex; gap: 8px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn var(--dur) var(--ease);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--dur) var(--ease);
}
.modal.modal-lg { max-width: 960px; }
.modal.modal-sm { max-width: 480px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-size: var(--fs-lg); font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--c-border); }
.modal-close { font-size: 20px; color: var(--c-text-light); padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--c-text); }

/* Drawer (right side) */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 199;
  animation: fadeIn var(--dur) var(--ease);
}
.drawer-overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 540px; max-width: 100%;
  background: var(--c-surface);
  z-index: 200;
  box-shadow: -4px 0 16px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  animation: slideInRight var(--dur) var(--ease);
}
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 8px; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--c-border); margin-bottom: 20px; }
.tabs .tab {
  padding: 8px 20px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--c-text-sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.tabs .tab:hover { color: var(--c-text); }
.tabs .tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.tabs .tab .tab-count { font-size: var(--fs-xs); background: var(--c-border); color: var(--c-text-sub); padding: 1px 7px; border-radius: var(--r-full); margin-left: 6px; }
.tabs .tab.active .tab-count { background: var(--c-primary-light); color: var(--c-primary); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-text-light); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: .5; }
.empty-state .empty-title { font-size: var(--fs-lg); font-weight: 600; color: var(--c-text-sub); margin-bottom: 4px; }
.empty-state .empty-desc { font-size: var(--fs-sm); }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  min-width: 280px;
  animation: slideInRight var(--dur) var(--ease);
  border-left: 4px solid var(--c-primary);
}
.toast.toast-success { border-left-color: var(--c-success); }
.toast.toast-error { border-left-color: var(--c-danger); }
.toast.toast-warning { border-left-color: var(--c-warning); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.toast-success svg { color: var(--c-success); }
.toast.toast-error svg { color: var(--c-danger); }
.toast.toast-warning svg { color: var(--c-warning); }

/* Checkbox */
.checkbox-wrap { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-wrap input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; }

/* Progress bar */
.progress { height: 8px; background: var(--c-border); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--r-full); transition: width var(--dur-slow) var(--ease); }
.progress-bar.success { background: var(--c-success); }
.progress-bar.warning { background: var(--c-warning); }
.progress-bar.danger { background: var(--c-danger); }
.progress-bar.info { background: var(--c-primary); }

/* Badge dot */
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.badge-dot.success { background: var(--c-success); }
.badge-dot.warning { background: var(--c-warning); }
.badge-dot.danger { background: var(--c-danger); }
.badge-dot.info { background: var(--c-primary); }
.badge-dot.neutral { background: var(--c-text-light); }

/* Stat row */
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-row .stat-item { }
.stat-row .stat-item .stat-label { font-size: var(--fs-xs); color: var(--c-text-sub); }
.stat-row .stat-item .stat-value { font-size: var(--fs-lg); font-weight: 700; }

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--c-border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .timeline-dot { position: absolute; left: -24px; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--c-surface); box-shadow: 0 0 0 1px var(--c-border); }
.timeline-item .timeline-dot.success { background: var(--c-success); }
.timeline-item .timeline-dot.warning { background: var(--c-warning); }
.timeline-item .timeline-dot.danger { background: var(--c-danger); }
.timeline-item .timeline-dot.info { background: var(--c-primary); }
.timeline-item .timeline-time { font-size: var(--fs-xs); color: var(--c-text-light); }
.timeline-item .timeline-content { font-size: var(--fs-sm); margin-top: 2px; }

/* Photo upload / thumb */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.photo-thumb { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); border: 1px solid var(--c-border); overflow: hidden; position: relative; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.photo-upload-btn {
  width: 100%; aspect-ratio: 1; border: 2px dashed var(--c-border); border-radius: var(--r-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--c-text-light); cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.photo-upload-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.photo-upload-btn svg { width: 24px; height: 24px; }

/* Checklist */
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border: 1px solid var(--c-border-light); border-radius: var(--r-sm); margin-bottom: 8px;
  transition: all var(--dur-fast) var(--ease);
}
.checklist-item:hover { border-color: var(--c-primary); }
.checklist-item.pass { background: var(--c-success-light); border-color: var(--c-success); }
.checklist-item.fail { background: var(--c-danger-light); border-color: var(--c-danger); }
.checklist-item .check-info { flex: 1; min-width: 0; }
.checklist-item .check-name { font-weight: 600; font-size: var(--fs-base); }
.checklist-item .check-pos { font-size: var(--fs-xs); color: var(--c-text-sub); margin-top: 2px; }
.checklist-item .check-std { font-size: var(--fs-xs); color: var(--c-text-sub); margin-top: 4px; }
.checklist-item .check-actions { display: flex; gap: 4px; flex-shrink: 0; }
.checklist-item .check-actions .btn { padding: 4px 8px; font-size: var(--fs-xs); }

/* Drag handle */
.drag-handle { cursor: grab; color: var(--c-text-light); padding: 0 4px; }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 16px; height: 16px; }

/* Chart container */
.chart-container { width: 100; }
.chart-container canvas { max-width: 100%; }

/* Responsive */
.mobile-overlay { display: none; }

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .app-content { padding: 16px; }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 0 12px; }
  .app-topbar .mobile-menu-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--c-text); }
  .app-topbar .mobile-menu-btn svg { width: 20px; height: 20px; }
  .app-content { padding: 12px; }
  .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 12px 16px; }
  .filter-bar { gap: 8px; }
  .filter-bar .filter-actions { width: 100%; }
  .modal { max-width: 100%; border-radius: var(--r-md); }
  .drawer { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .kpi-card { padding: 12px 14px; }
  .kpi-card .kpi-value { font-size: var(--fs-xl); }
  .stat-row { gap: 12px; }
  .mobile-overlay {
    display: block;
    position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 99;
  }
  .mobile-overlay.hidden { display: none; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table { font-size: var(--fs-xs); }
  table.data-table th, table.data-table td { padding: 8px; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes staggerReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.stagger > * { animation: staggerReveal var(--dur-slow) var(--ease) backwards; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }
.stagger > *:nth-child(7) { animation-delay: 300ms; }
.stagger > *:nth-child(8) { animation-delay: 350ms; }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sub { color: var(--c-text-sub); }
.text-light { color: var(--c-text-light); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-primary { color: var(--c-primary); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-2xl { font-size: var(--fs-2xl); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.whitespace-nowrap { white-space: nowrap; }


.app-main{min-width:0}.app-content>.card,.app-content>.filter-bar,.app-content>.tabs{width:100%;box-sizing:border-box}.app-content svg,.unified-order-detail svg,.modal svg{width:18px;height:18px;flex-shrink:0}.app-content .data-table{width:100%;table-layout:auto}.app-content .data-table td{white-space:normal;overflow-wrap:anywhere}.app-content .data-table th{white-space:normal}.filter-bar{min-width:0;flex-wrap:wrap}.std-layout{grid-template-columns:230px minmax(0,1fr);gap:20px;display:grid;align-items:start}.group-nav{display:flex;flex-direction:column;gap:8px;padding:14px}.group-nav button{text-align:left;white-space:normal;padding:12px}.group-nav button.active{background:#eaf1ff;color:#2563eb;border-color:#2563eb}.group-check-table td{white-space:pre-wrap!important}.group-check-table th:nth-child(1){width:50px}.group-check-table th:nth-child(2){width:140px}.group-check-table th:nth-child(3){width:14%}.group-check-table th:nth-child(4){width:32%}.group-check-table th:nth-child(7){width:100px}.group-versions{margin-top:18px;padding:20px}.qc-group-confirm{margin-top:12px;padding:10px;background:#fff8e8;border:1px solid #ead4a6;border-radius:8px}.qc-group-confirm select{width:100%;margin-top:8px}.qc-missing-button{margin-left:14px;color:#b42318;border-color:#e9a1a1;background:#fff2ef}.qc-missing-unit{color:#b42318;background:#fff2ef;padding:18px;border-radius:8px;margin-top:16px}.modal-overlay{z-index:1600}.erp-photo-overlay{z-index:1700}.toast-container{z-index:1800}.waiting-order-table{min-width:1240px!important}.waiting-order-table th{min-width:0!important}.waiting-order-table th:nth-child(3){width:16%}.waiting-order-table th:nth-child(1){width:10%}@media(max-width:1050px){.waiting-order-table{min-width:1200px!important}}@media(max-width:780px){.std-layout{grid-template-columns:1fr}.group-nav{flex-direction:row;flex-wrap:wrap}}

.group-check-table th:nth-child(6){white-space:nowrap;width:52px}.waiting-order-table th:nth-child(n+4):nth-child(-n+8){width:64px;white-space:nowrap!important}
