* { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f0f4f8;
    color: #1a2332;
    min-height: 100vh;
  }
  .app { display: flex; height: 100vh; }

  .sidebar { width: 320px; min-width: 320px; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden; }
  .sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid #e2e8f0; }
  .sidebar-header h1 { font-size: 18px; font-weight: 700; color: #0b3550; letter-spacing: 0.5px; }
  .sidebar-header p { font-size: 13px; color: #7c8ba0; margin-top: 2px; }
  .btn-new { display: block; width: 100%; margin-top: 14px; padding: 10px 0; background: #1a73e8; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }
  .btn-new:hover { background: #1557b0; }
  .sidebar-list { flex: 1; overflow-y: auto; padding: 8px 0; }
  .order-card { padding: 14px 20px; border-left: 3px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
  .order-card:hover { background: #f7f9fc; }
  .order-card.active { background: #eaf3ff; border-left-color: #1a73e8; }
  .order-card .ref { font-size: 14px; font-weight: 600; color: #1a2332; }
  .order-card .customer { font-size: 12px; color: #5f6b7a; margin-top: 2px; }
  .order-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
  .order-card .status-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
  .order-card .service-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
  .order-card .service-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #eef2ff; color: #4338ca; }
  .order-card .date { font-size: 11px; color: #9ca3af; }
  .empty-orders { text-align: center; padding: 40px 20px; color: #9ca3af; font-size: 14px; }
  .status-tag.s0 { background: #e2e8f0; color: #5f6b7a; }
  .status-tag.s1 { background: #dbeafe; color: #1a73e8; }
  .status-tag.s2 { background: #fef3c7; color: #b45309; }
  .status-tag.s3 { background: #e0f2fe; color: #0369a1; }
  .status-tag.s4 { background: #dcfce7; color: #15803d; }
  .status-tag.s5 { background: #dbeafe; color: #1a73e8; }
  .status-tag.s6 { background: #e0f2fe; color: #0369a1; }
  .status-tag.s7 { background: #dcfce7; color: #15803d; }
  .status-tag.s8 { background: #dbeafe; color: #1a73e8; }
  .status-tag.s9 { background: #dcfce7; color: #15803d; }
  .status-tag.s10{ background: #dbeafe; color: #1a73e8; }
  .status-tag.s11{ background: #e0f2fe; color: #0369a1; }
  .status-tag.s12{ background: #1e40af; color: #fff; }
  .status-tag.s13{ background: #dbeafe; color: #1a73e8; }
  .status-tag.s14{ background: #dbeafe; color: #1a73e8; }
  .status-tag.s15{ background: #e0f2fe; color: #0369a1; }
  .status-tag.s16{ background: #9333ea; color: #fff; }
  .status-tag.s17{ background: #f59e0b; color: #fff; }
  .status-tag.s18{ background: #059669; color: #fff; }

  .main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 28px 40px 40px; }
  .main-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
  .main-header h2 { font-size: 22px; font-weight: 700; color: #0b3550; }
  .main-header .sub { font-size: 13px; color: #7c8ba0; margin-top: 4px; }
  .main-header .badge { font-size: 12px; padding: 4px 14px; border-radius: 20px; font-weight: 600; }

  .info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; background: #fff; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .info-item .label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
  .info-item .value { font-size: 14px; font-weight: 600; color: #1a2332; margin-top: 2px; }

  .service-section, .detail-card { background: #fff; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .service-section .sec-title, .detail-card .sec-title { font-size: 12px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 8px; }
  .service-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .service-tag-item { padding: 4px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; background: #eef2ff; color: #4338ca; }
  .service-tag-item.other { background: #fef3c7; color: #92400e; }
  .bd-row { display: flex; gap: 8px; margin-bottom: 6px; padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
  .bd-row:last-child { border-bottom: none; margin-bottom: 0; }
  .bd-row .bd-label { font-size: 12px; color: #9ca3af; min-width: 90px; flex-shrink: 0; }
  .bd-row .bd-value { font-size: 13px; color: #1a2332; font-weight: 500; }
  .bd-highlight { color: #059669; font-weight: 700; }

  .timeline { position: relative; padding-left: 40px; background: #fff; border-radius: 12px; padding: 28px 28px 28px 60px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .timeline-title { font-size: 16px; font-weight: 700; color: #0b3550; margin-bottom: 24px; }
  .timeline::before { content: ''; position: absolute; left: 34px; top: 72px; bottom: 40px; width: 2px; background: #e2e8f0; }
  .tl-step { position: relative; padding: 0 0 28px 28px; min-height: 56px; cursor: pointer; transition: background .15s; border-radius: 8px; margin: 0 -12px; padding: 0 12px 28px 40px; }
  .tl-step:hover { background: #f8faff; }
  .tl-step:last-child { padding-bottom: 0; }
  .tl-step .dot { position: absolute; left: 4px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #e2e8f0; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 1; transition: all .3s; }
  .tl-step.done .dot { background: #059669; border-color: #059669; color: #fff; }
  .tl-step.active .dot { background: #1a73e8; border-color: #1a73e8; color: #fff; box-shadow: 0 0 0 4px rgba(26,115,232,.2); animation: pulse-dot 2s infinite; }
  @keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 4px rgba(26,115,232,.2)}50%{box-shadow:0 0 0 8px rgba(26,115,232,.1)} }
  .tl-step .step-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .tl-step .step-name { font-size: 15px; font-weight: 600; color: #1a2332; }
  .tl-step.done .step-name { color: #059669; }
  .tl-step.active .step-name { color: #1a73e8; }
  .tl-step .step-date { font-size: 12px; color: #9ca3af; }
  .tl-step .step-notes { font-size: 13px; color: #5f6b7a; margin-top: 4px; line-height: 1.5; }
  .tl-step.done .step-date { color: #059669; }
  .tl-step.active .step-date { color: #1a73e8; font-weight: 600; }
  .tl-step .edit-hint { display: none; font-size: 11px; color: #1a73e8; font-weight: 500; margin-left: 8px; opacity: 0.7; }
  .tl-step:hover .edit-hint { display: inline; }
  .tl-step .detail-badge { font-size: 10px; color: #1a73e8; background: #eaf3ff; padding: 1px 6px; border-radius: 4px; font-weight: 500; }

  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; justify-content: center; align-items: center; }
  .modal-overlay.show { display: flex; }
  .modal { background: #fff; border-radius: 14px; width: 560px; max-width: 92vw; padding: 28px 32px; box-shadow: 0 8px 30px rgba(0,0,0,.15); max-height: 85vh; overflow-y: auto; }
  .modal h3 { font-size: 18px; font-weight: 700; color: #0b3550; margin-bottom: 16px; }
  .modal .step-indicator { font-size: 13px; color: #7c8ba0; margin-bottom: 16px; padding: 6px 12px; background: #f3f4f6; border-radius: 8px; display: inline-block; }
  .modal .section-divider { font-size: 13px; font-weight: 700; color: #0b3550; padding: 10px 0 8px; margin-top: 6px; border-top: 1px solid #e2e8f0; }
  .modal .section-divider:first-of-type { border-top: none; padding-top: 0; }
  .form-group { margin-bottom: 14px; }
  .form-group label { display: block; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 4px; }
  .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #1a2332; outline: none; transition: border .2s; }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
  .form-group input:read-only { background: #f3f4f6; color: #374151; cursor: default; }
  .form-group textarea { resize: vertical; min-height: 60px; }
  .form-row { display: flex; gap: 12px; }
  .form-row .form-group { flex: 1; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
  .modal-actions .btn-left { margin-right: auto; }
  .btn-primary { background: #1a73e8; color: #fff; }
  .btn-primary:hover { background: #1557b0; }
  .btn-secondary { background: #f3f4f6; color: #374151; }
  .btn-secondary:hover { background: #e5e7eb; }
  .btn-danger { background: #fee2e2; color: #dc2626; }
  .btn-export { background: #059669; color: #fff; }
  .btn-export:hover { background: #047857; }
  .checkbox-group { margin: 6px 0 4px; }
  .checkbox-group label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: #374151; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: background .15s; margin-right: 4px; }
  .checkbox-group label:hover { background: #f3f4f6; }
  .checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1a73e8; cursor: pointer; flex-shrink: 0; }
  .btn-danger:hover { background: #fecaca; }

  .trade-term-group { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
  .trade-term-group label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: #374151; padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: background .15s; user-select: none; border: 1px solid #d1d5db; background: #fff; }
  .trade-term-group label:hover { background: #f3f4f6; }
  .trade-term-group input[type="radio"] { width: 16px; height: 16px; accent-color: #1a73e8; cursor: pointer; flex-shrink: 0; }

  .service-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin: 8px 0 4px; }
  .service-checkbox-grid label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #374151; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: background .15s; user-select: none; }
  .service-checkbox-grid label:hover { background: #f3f4f6; }
  .service-checkbox-grid input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1a73e8; cursor: pointer; flex-shrink: 0; }
  .other-service-input.hidden { display: none; }
  .sidebar-backup { display: flex; gap: 8px; padding: 8px 16px; border-bottom: 1px solid #e2e8f0; }
  .btn-backup { flex:1; margin-left:14px; border:1px solid #1a73e8; background:#fff; color:#1a73e8; padding:6px 0; border-radius:6px; font-size:11px; font-weight:600; cursor:pointer; transition:all .15s; }
  .btn-backup:hover { background:#1a73e8; color:#fff; }
  .btn-restore { flex:1; border:1px solid #9333ea; background:#fff; color:#9333ea; padding:6px 0; border-radius:6px; font-size:11px; font-weight:600; cursor:pointer; transition:all .15s; }
  .btn-restore:hover { background:#9333ea; color:#fff; }
  .sidebar-export { padding: 8px 16px; border-bottom: 1px solid #e2e8f0; }
  .btn-export-sm { width:100%; padding:7px 0; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; border:1px solid #059669; background:#fff; color:#059669; transition:all .15s; }
  .btn-export-sm:hover { background:#059669; color:#fff; }
  .sidebar-search { padding: 10px 16px; border-bottom: 1px solid #e2e8f0; }
  .sidebar-search input { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; outline: none; transition: border .2s; box-sizing: border-box; }
  .sidebar-search input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
  .login-header { text-align: center; padding: 30px 20px 10px; }

  
  .detail-layout { display: flex; gap: 24px; align-items: flex-start; }
  .timeline-col { flex: 1; min-width: 0; }
  .detail-col { width: 380px; min-width: 380px; flex-shrink: 0; }
  .detail-col .detail-card { margin-bottom: 0; }
  .detail-col .detail-card:not(:last-child) { margin-bottom: 12px; }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; background: #fff; border-radius: 12px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .detail-layout { display: flex; gap: 24px; align-items: flex-start; }
  .timeline-left-col { flex: 1; min-width: 0; }
  .detail-right-col { width: 380px; min-width: 380px; flex-shrink: 0; }
  .detail-right-col .detail-card { margin-bottom: 0; }
  .quick-actions .qa-title { width: 100%; font-size: 12px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px; }
  .qa-btn { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151; transition: all .15s; }
  .qa-btn:hover { background: #1a73e8; color: #fff; border-color: #1a73e8; }
  .qa-btn.complete-btn:hover { background: #059669; border-color: #059669; }
  .parallel-label { font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 500; margin-left: 2px; }
  .customs-label { background: #e0f2fe; color: #0369a1; }
  .bl-label { background: #eef2ff; color: #4338ca; }

  .sidebar-list::-webkit-scrollbar { width: 4px; }
  .sidebar-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
  .main::-webkit-scrollbar { width: 6px; }
  .main::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
