/* === ChinaCargoTrade Design System === */
:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --sidebar-width: 340px;
  --header-height: 60px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* Header */
.header { background: #fff; border-bottom: 1px solid var(--border); height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 100; }
.header-logo { font-weight: 700; font-size: 18px; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.header-logo img { height: 28px; }
.header-nav { display: flex; gap: 4px; }
.header-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; display: flex; align-items: center; gap: 6px; transition: .15s; }
.header-nav a:hover, .header-nav a.active { background: var(--primary-light); color: var(--primary); }
.header-user { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.header-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.header-user .name { font-size: 13px; font-weight: 500; }
.header-user .id-badge { font-size: 11px; color: var(--text-muted); }

/* Layout */
.page { display: flex; min-height: calc(100vh - var(--header-height)); }
.main { flex: 1; padding: 24px; max-width: calc(100vw - var(--sidebar-width)); }
.sidebar { width: var(--sidebar-width); background: #fff; border-left: 1px solid var(--border); padding: 20px; position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); overflow-y: auto; }
.page-full .main { max-width: 900px; margin: 0 auto; }
.page-full .sidebar { display: none; }

/* Breadcrumbs */
.breadcrumbs { display: flex; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; }

/* Quick Actions Grid */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.quick-action { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); transition: .15s; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.quick-action:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.quick-action .qa-icon { font-size: 24px; }
.quick-action .qa-title { font-weight: 600; font-size: 14px; }
.quick-action .qa-subtitle { font-size: 12px; color: var(--text-secondary); }
.quick-action .qa-badge { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.quick-action .qa-badge.new { background: #fef3c7; color: #92400e; }

/* Wizard Progress */
.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 24px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.wizard-step { flex: 1; padding: 14px 16px; text-decoration: none; color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 8px; position: relative; background: #fff; transition: .15s; border-right: 1px solid var(--border); }
.wizard-step:last-child { border-right: none; }
.wizard-step:hover { background: var(--bg); }
.wizard-step.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.wizard-step.done { color: var(--primary); }
.wizard-step .step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.wizard-step.active .step-num { background: var(--primary); color: #fff; }
.wizard-step.done .step-num { background: var(--primary); color: #fff; }
.wizard-arrow { color: var(--border); font-size: 18px; padding: 14px 4px; background: #fff; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab { padding: 12px 20px; font-size: 14px; cursor: pointer; border: none; background: none; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab .count { background: var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11px; margin-left: 6px; }

/* Product Method Tabs */
.method-tabs { display: flex; gap: 0; margin-bottom: 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.method-tab { flex: 1; padding: 12px 16px; text-align: center; cursor: pointer; font-size: 13px; border: none; background: #fff; color: var(--text-secondary); transition: .15s; border-right: 1px solid var(--border); }
.method-tab:last-child { border-right: none; }
.method-tab:hover { background: var(--bg); }
.method-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: .15s; outline: none; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,.1); }
.form-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; border-bottom: 2px solid var(--border); }
table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
table tr:hover td { background: #f8fafc; }

/* Price Summary (sidebar) */
.price-block { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.price-block:last-child { border-bottom: none; }
.price-block-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text-secondary); }
.price-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.price-row .label { color: var(--text-secondary); }
.price-row .value { font-weight: 500; font-variant-numeric: tabular-nums; }
.price-row.total { font-size: 16px; font-weight: 700; padding-top: 10px; border-top: 2px solid var(--border); margin-top: 6px; }
.price-row .help-icon { cursor: help; color: var(--text-muted); }
.commission-badge { display: inline-block; background: var(--primary-light); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 4px; }

/* Currency */
.currency-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); padding: 4px 0; }

/* Alert / Callout */
.alert { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: var(--radius); padding: 14px 16px; font-size: 13px; color: #065f46; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert .alert-icon { font-size: 18px; flex-shrink: 0; }

/* Empty State */
.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Progress Bar */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

/* Commission Tiers */
.tiers { display: flex; gap: 4px; margin-top: 8px; }
.tier { flex: 1; text-align: center; padding: 4px; border-radius: 4px; font-size: 11px; background: var(--bg); color: var(--text-muted); }
.tier.current { background: var(--primary); color: #fff; font-weight: 600; }
.tier.next { border: 1px dashed var(--primary); }

/* File Upload Zone */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; transition: .15s; color: var(--text-muted); }
.upload-zone:hover { border-color: var(--primary); color: var(--primary); }
.upload-zone .upload-icon { font-size: 32px; }

/* Toggle Switch */
.toggle-group { display: flex; gap: 0; margin-bottom: 12px; }
.toggle-btn { flex: 1; padding: 10px; text-align: center; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; transition: .15s; }
.toggle-btn:first-child { border-radius: 8px 0 0 8px; }
.toggle-btn:last-child { border-radius: 0 8px 8px 0; }
.toggle-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Manager Card */
.manager-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.manager-name { font-weight: 600; font-size: 14px; }
.manager-phone { color: var(--primary); font-size: 14px; text-decoration: none; }
.manager-links { display: flex; gap: 8px; margin-top: 8px; }
.manager-links a { padding: 6px 10px; border-radius: 6px; font-size: 12px; text-decoration: none; background: var(--bg); color: var(--text); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 40px; }
.footer a { color: var(--text-secondary); }

/* Order Status Timeline */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.status-new { background: #dbeafe; color: #1d4ed8; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-purchasing { background: #e0e7ff; color: #4338ca; }
.status-shipping { background: #d1fae5; color: #065f46; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-draft { background: #f1f5f9; color: #64748b; }

/* Delivery type icons */
.delivery-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.delivery-badge.avia { color: #6366f1; }
.delivery-badge.fast { color: #059669; }
.delivery-badge.slow { color: #d97706; }

/* Notification dot */
.notify-dot { position: relative; }
.notify-dot::after { content: ''; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--text); }
.pagination a:hover { background: var(--bg); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Search box */
.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input { flex: 1; }

/* Address Card */
.address-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: .15s; }
.address-card:hover { border-color: var(--primary); }
.address-card.selected { border-color: var(--primary); background: var(--primary-light); }
