/* 文件说明：docs 目录通用样式表，支撑 docs/client 与 docs/warehouse 下所有页面的布局、控件与主题色。 */
:root { --brand:#2563eb; --brand-2:#0f172a; --muted:#64748b; --ring:#e5e7eb; }
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:#f8fafc;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#0f172a}
a{color:inherit;text-decoration:none}

.topbar{height:56px;background:#0b1220;color:#e5e7eb;display:flex;align-items:center;gap:12px;padding:0 14px;border-bottom:1px solid #111827;position:sticky;top:0;z-index:50}
.topbar .brand{display:flex;align-items:center;gap:10px;font-weight:600}
.topbar img{height:26px;width:auto;max-width:120px;object-fit:contain;display:block}
.topbar .right{margin-left:auto;display:flex;align-items:center;gap:10px}
.topbar .tag{font-size:12px;color:#93c5fd;background:#0b2a57;border:1px solid #1e3a8a;padding:1px 6px;border-radius:6px}

.tabbar{height:40px;background:#111827;color:#cbd5e1;display:flex;align-items:center;gap:6px;padding:0 10px;border-bottom:1px solid #1f2937;overflow-x:auto;position:sticky;top:56px;z-index:40}
.tab{display:flex;align-items:center;gap:6px;background:#0b1220;border:1px solid #1f2937;border-radius:8px;padding:4px 8px;cursor:pointer;white-space:nowrap}
.tab.active{background:#0e1726;border-color:#3b82f6;color:#fff}
.tab .x{opacity:.7;margin-left:2px}

.shell{display:grid;grid-template-columns:240px 1fr;height:calc(100vh - 96px);overflow:hidden}
.sidebar{background:#0b1220;color:#cbd5e1;border-right:1px solid #111827;padding:10px;display:flex;flex-direction:column;overflow:hidden}
.sidebar .menu{display:flex;flex-direction:column;gap:6px;overflow-y:auto;padding-right:4px}
.menu h4{padding:8px 10px;color:#93c5fd;font-size:12px;text-transform:uppercase}
.menu .item{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;cursor:pointer;color:#e5e7eb;font-weight:500}
.menu .item .menu-icon{width:28px;height:28px;border-radius:8px;background:#111c32;color:#93c5fd;display:inline-flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}
.menu .item .menu-title{display:inline-flex;align-items:center}
.menu .item:hover{background:#0e1726}
.menu .item.active{background:#0e1726;border:1px solid #1f2937}
.content{padding:16px;display:flex;flex-direction:column;height:100%;overflow:auto}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:20px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.btn{padding:.5rem .9rem;border-radius:10px;background:#2563eb;color:#fff;border:1px solid #1d4ed8;cursor:pointer;transition:all .15s ease}
.btn:hover{filter:brightness(.95)}
.btn.ghost{background:#fff;color:#0f172a;border:1px solid #cbd5e1}
.btn.outline{background:#fff;color:#2563eb;border:1px solid #2563eb}
.topbar .btn.ghost{background:transparent;color:#e5e7eb;border-color:#334155}
.input,select{width:100%;padding:.6rem;border:1px solid #e5e7eb;border-radius:10px;background:#fff}
textarea.input{resize:vertical}
.hint{color:#64748b;font-size:.85rem}
.error-text,.hint.error-text{color:#dc2626}
.grid{display:grid;gap:12px}
.grid.two{grid-template-columns:1fr 1fr}
.grid.three{grid-template-columns:repeat(3,1fr)}
.grid.two .span-2{grid-column:span 2}

/* 订单管理界面 */
.order-panel{display:flex;flex-direction:column;gap:16px}
.order-tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab-btn{border:1px solid #cbd5e1;border-radius:999px;padding:6px 14px;background:#f1f5f9;color:#0f172a;cursor:pointer}
.tab-btn.active{background:#2563eb;color:#fff;border-color:#1d4ed8}
.order-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:end}
.filter-inline{display:flex;gap:8px}
.filter-actions{display:flex;gap:8px;justify-content:flex-end}
.select-compact{max-width:120px}
.ops-filter-group select[id="dateField"]{min-width:220px;z-index:1000}
.order-body{display:grid;grid-template-columns:380px 1fr;gap:16px;min-height:360px}
.order-list{display:flex;flex-direction:column;gap:10px;overflow-y:auto}
.order-item{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#f8fafc;cursor:pointer}
.order-item.active{border-color:#2563eb;box-shadow:0 0 0 1px rgba(37,99,235,.2)}
.order-item-head{display:flex;justify-content:space-between;margin-bottom:6px;font-weight:600}
.order-item.has-unread{border-color:#fca5a5}
.order-code{display:inline-flex;align-items:center;gap:6px}
.indicator-label{display:inline-flex;align-items:center;gap:6px}
.unread-dot{display:inline-block;width:8px;height:8px;border-radius:999px;background:#ef4444;margin-right:0;vertical-align:middle;flex-shrink:0}
.order-item-body,.order-item-extra{display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:#475569}
.order-detail{min-height:300px;border:1px solid #e2e8f0;border-radius:12px;padding:16px;background:#fff}
.badge{padding:2px 8px;border-radius:999px;background:#e0f2fe;color:#0369a1;font-size:12px}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;font-size:14px}
.detail-grid strong{display:block;color:#475569;font-size:12px}
.detail-remark{margin-top:12px}
.detail-attachments ul{padding-left:18px}
.order-modal{position:fixed;inset:0;background:rgba(15,23,42,.5);display:flex;align-items:center;justify-content:center;padding:24px;z-index:200}
.order-modal.hidden{display:none}
.order-modal-content{width:min(900px,92vw);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:24px;box-shadow:0 24px 60px rgba(15,23,42,.35)}
.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.modal-actions{margin-top:16px;display:flex;justify-content:flex-end}
.mt-3{margin-top:12px}

/* 账单流水 */
.finance-panel{display:flex;flex-direction:column;gap:12px}
.finance-filters{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.finance-table-wrapper{overflow:auto}
.finance-table{width:100%;border-collapse:collapse;font-size:13px}
.finance-table th,.finance-table td{border:1px solid #e2e8f0;padding:8px;text-align:center}
.finance-table th{background:#f1f5f9}

/* 仓库订单处理 */
.ops-card{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;height:100%;max-height:100%}
.ops-head{display:flex;flex-direction:column;gap:16px;flex:0 0 auto}
.ops-tabs{display:flex;gap:8px;flex-wrap:wrap}
.ops-tab{border:1px solid #cbd5e1;border-radius:999px;padding:6px 16px;background:#f8fafc;color:#0f172a;cursor:pointer;transition:all .15s ease}
.ops-tab.active{background:#2563eb;color:#fff;border-color:#1d4ed8;box-shadow:0 8px 15px rgba(37,99,235,.12)}
.ops-filters{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:16px;align-items:end}
.ops-filter-group.date-range-group{grid-column:span 2}
.ops-filter-group.search-group{grid-column:span 2}
.ops-filter-group.mail-status-group .input{min-width:220px}
.ops-filter-group.mail-status-group{min-width:240px}
.ops-filter-group.search-group .search-control{max-width:none}
.ops-filter-group .ops-filter-row{flex-wrap:wrap}
.ops-filter-group .ops-filter-row > *{flex:1;min-width:140px}
.ops-filter-group.date-range-group .ops-filter-row select{flex:0 0 160px}
.ops-filter-group.date-range-group .ops-filter-row input[type="date"]{flex:1;min-width:160px}
.ops-filter-group.date-range-group .ops-filter-row .ops-filter-sep{flex:0 0 auto}
@media (max-width:1000px){
  .ops-filters{grid-template-columns:1fr}
  .ops-filter-group.date-range-group,
  .ops-filter-group.search-group{grid-column:span 1}
}
.ops-filter-group{display:flex;flex-direction:column;gap:6px}
.ops-filter-row{display:flex;gap:8px;align-items:center}
.ops-filter-row .input{flex:1}
.ops-filter-row .truck-select-trigger{flex:1}
.truck-filter-group{position:relative}
.truck-select-trigger{width:100%;padding:.6rem 1rem;border:1px solid #e5e7eb;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:14px;color:#0f172a;cursor:pointer;transition:all .15s ease}
.truck-select-trigger:hover{border-color:#d5dbe6;box-shadow:0 4px 12px rgba(15,23,42,.08)}
.truck-select-trigger.open{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.12)}
.truck-select-caret{color:#94a3b8;font-size:12px}
.truck-dropdown{position:absolute;top:calc(100% + 6px);left:0;width:min(360px,calc(100vw - 32px));max-height:420px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 18px 45px rgba(15,23,42,.2);display:flex;flex-direction:column;z-index:900}
.truck-dropdown.hidden{display:none}
.truck-dropdown-search{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid #f1f5f9}
.truck-dropdown-icon{color:#94a3b8;font-size:14px}
.truck-dropdown-search .input{margin:0}
.truck-dropdown .truck-option{display:flex;align-items:flex-start;gap:8px;padding:6px 12px;border-radius:10px;font-size:13px;color:#0f172a}
.truck-dropdown .truck-option input{margin-top:3px}
.truck-dropdown .truck-option:hover{background:#f8fafc}
.truck-dropdown .truck-option.select-all{border-bottom:1px solid #f1f5f9;border-radius:0;margin:0;padding:10px 12px}
.truck-dropdown .truck-option .truck-name{font-weight:600}
.truck-dropdown .truck-option .truck-code{color:#64748b;font-size:12px;margin-left:6px}
.truck-dropdown .truck-option .truck-contact{color:#94a3b8;font-size:12px;margin-top:2px}
.truck-dropdown-options{flex:1;max-height:260px;overflow:auto;padding:6px 8px;display:flex;flex-direction:column;gap:4px}
.truck-dropdown-options .hint{margin:8px 6px}
.truck-dropdown-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px;border-top:1px solid #f1f5f9}
.ops-filter-sep{color:#94a3b8}
.ops-filter-actions{display:flex;gap:10px;justify-content:flex-end}
.ops-toolbar{display:flex;align-items:center;justify-content:space-between}
.ops-toolbar-actions{display:flex;gap:10px;flex-wrap:wrap}
.export-dropdown{position:relative}
.export-toggle{display:inline-flex;align-items:center;gap:4px}
.export-toggle.loading{opacity:.7;cursor:progress}
.export-toggle .export-chevron{font-size:12px}
.export-menu{position:absolute;top:calc(100% + 6px);right:0;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 18px 40px rgba(15,23,42,.15);padding:6px;display:flex;flex-direction:column;min-width:220px;z-index:9}
.export-menu.hidden{display:none}
.export-menu button{border:none;background:none;text-align:left;padding:8px 10px;border-radius:8px;cursor:pointer;color:#0f172a;font-size:14px}
.export-menu button:hover{background:#f1f5f9}
.export-menu button:disabled{color:#94a3b8;cursor:not-allowed;background:transparent}
.export-menu .menu-divider{height:1px;background:#e2e8f0;margin:4px 0}
.ops-toolbar .btn.primary{background:#16a34a;border-color:#15803d}
.ops-toolbar .btn.primary:hover{filter:brightness(.95)}
.search-group .search-inline{flex-wrap:wrap}
.search-control{display:flex;align-items:center;gap:8px;flex:1}
.search-control .input{flex:1}
.search-buttons{display:flex;gap:6px}
.icon-btn.solid{background:#2563eb;border-color:#1d4ed8;color:#fff}
.icon-btn.solid:hover{filter:brightness(.95)}
.ops-foot{display:flex;justify-content:flex-end;margin-top:12px}
.order-create-form{display:flex;flex-direction:column;gap:12px}
.order-create-form label{display:flex;flex-direction:column;gap:6px;font-size:14px;color:#0f172a}
.order-create-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.order-create-grid.three{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.dimension-row{display:flex;flex-direction:column;gap:6px;font-size:14px;color:#0f172a}
.dimension-inputs{display:flex;align-items:center;gap:6px}
.dimension-inputs input{max-width:90px}
.order-create-actions{justify-content:space-between}
.split-builder{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
.split-builder-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:600;color:#0f172a}
.split-rows{display:flex;flex-direction:column;gap:10px}
.split-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.split-row .input{min-width:140px}
.split-row .split-count{max-width:120px}
.split-row .split-note{flex:1;min-width:200px}
.split-row .split-custom{flex:1;min-width:160px}
.ops-table-wrapper{position:relative;border:1px solid #e2e8f0;border-radius:12px;padding:0;overflow:auto;background:#fff;flex:1;min-height:0}
.ops-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px;min-width:960px}
.ops-table thead th{position:sticky;top:0;background:#f8fafc;border-bottom:1px solid #e2e8f0;z-index:2}
.ops-table th,.ops-table td{padding:10px 12px;border-right:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;background:#fff;position:relative;white-space:nowrap}
.ops-table th:last-child,.ops-table td:last-child{border-right:none}
.ops-table tbody tr:nth-child(even) td{background:#f8fafc}
.ops-table tbody tr:hover td{background:#eef2ff}
.ops-table td.text-right,.ops-table th.text-right{text-align:right}
.ops-select-header,.ops-select-cell{width:48px;min-width:48px;text-align:center;padding:6px 8px;position:sticky;left:0;z-index:5}
.ops-select-cell{background:#fff;z-index:4}
.ops-select-header{background:#f8fafc}
.ops-select-cell input[type=checkbox],.ops-select-header input[type=checkbox]{width:16px;height:16px;margin:0 auto;cursor:pointer}
.ops-table-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:14px;pointer-events:none}
.th-label{font-weight:600}
.col-resizer{position:absolute;right:0;top:0;bottom:0;width:6px;cursor:col-resize}
.col-resizer::after{content:'';position:absolute;right:2px;top:25%;bottom:25%;width:2px;background:transparent;transition:background .15s}
.col-resizer:hover::after{background:#cbd5e1}
.ops-table th.locked,.ops-table td.locked{position:sticky;z-index:3;background:#fff;box-shadow:2px 0 0 rgba(148,163,184,.25)}
.ops-table th.locked{z-index:4}
.ops-table th.actions-header,
.ops-table td.actions-cell{position:sticky;right:0;z-index:6;background:#fff;box-shadow:-2px 0 0 rgba(148,163,184,.25);min-width:130px;width:130px}
.ops-table td.actions-cell{border-left:1px solid #e2e8f0}
.actions-cell .btn{white-space:nowrap}
.btn.ghost.sm{padding:.3rem .6rem;font-size:.8rem;border-radius:8px}
.column-manager-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:180}
.column-manager-mask.hidden{display:none}
.column-manager{position:fixed;top:0;right:0;bottom:0;width:min(360px,90vw);background:#fff;box-shadow:-4px 0 24px rgba(15,23,42,.2);padding:24px;overflow:auto;z-index:181}
.column-manager.hidden{display:none}
.column-manager-content{display:flex;flex-direction:column;gap:18px}
.column-manager-header{display:flex;align-items:center;justify-content:space-between}
.column-manager-lock{display:flex;gap:12px;align-items:center}
.column-manager-lock label{font-weight:500;color:#475569}
.column-manager-list{display:flex;flex-direction:column;gap:10px}
.column-manager-row{display:flex;align-items:center;justify-content:space-between;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px}
.column-manager-row label{display:flex;align-items:center;gap:8px;font-weight:500}
.column-manager-row input[type="checkbox"]{transform:scale(1.05)}
.column-manager-actions{display:flex;gap:6px}
.status-pill{display:inline-flex;align-items:center;justify-content:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;letter-spacing:.01em}
.status-pill.state-submitted{background:#dbeafe;color:#1d4ed8}
.status-pill.state-pending{background:#fdf2f8;color:#be185d}
.status-pill.state-processing{background:#fff7ed;color:#ea580c}
.status-pill.state-picked{background:#ffedd5;color:#c2410c}
.status-pill.state-delivered{background:#dcfce7;color:#15803d}
.status-pill.state-completed{background:#bbf7d0;color:#166534}
.status-pill.state-cancelled{background:#f1f5f9;color:#64748b}
.status-pill.state-draft{background:#e0f2fe;color:#0369a1}
.status-pill.state-unknown{background:#e2e8f0;color:#475569}

/* 仓库订单详情 */
.detail-wrapper{display:flex;flex-direction:column;gap:20px;margin-top:20px}
.detail-header{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.detail-title h1{margin:0;font-size:24px;font-weight:700;color:#0f172a}
.order-code{font-weight:700;font-size:24px;color:#0f172a;margin-right:12px}
.status-tag{display:inline-flex;align-items:center;padding:4px 14px;border-radius:10px;border:1px solid transparent;font-size:13px;font-weight:600}
.detail-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
.status-tag.state-submitted{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.status-tag.state-pending{background:#fdf2f8;border-color:#fbcfe8;color:#be185d}
.status-tag.state-processing{background:#fff7ed;border-color:#fed7aa;color:#ea580c}
.status-tag.state-picked{background:#ffedd5;border-color:#fdba74;color:#c2410c}
.status-tag.state-delivered{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.status-tag.state-completed{background:#bbf7d0;border-color:#86efac;color:#166534}
.status-tag.state-cancelled{background:#f1f5f9;border-color:#e2e8f0;color:#64748b}
.status-tag.state-unknown{background:#e2e8f0;border-color:#cbd5e1;color:#475569}
.detail-card{display:flex;flex-direction:column;gap:24px}
.detail-section{display:flex;flex-direction:column;gap:12px}
.order-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.info-item{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}
.info-label{font-size:12px;color:#64748b}
.info-value{font-size:14px;font-weight:600;color:#0f172a}
.remark-box{border:1px solid #e2e8f0;border-radius:10px;padding:12px;background:#fff;min-height:60px;white-space:pre-wrap}
.message-board{border:1px solid #e2e8f0;border-radius:10px;background:#fff;padding:12px;display:flex;flex-direction:column;gap:12px;max-height:240px;overflow-y:auto}
.message-item{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0}
.message-item.from-warehouse{background:#eff6ff;border-color:#bfdbfe}
.message-item.from-client{background:#fefce8;border-color:#fde68a}
.message-meta{font-size:12px;color:#64748b}
.message-body{font-size:14px;color:#0f172a;white-space:pre-wrap;word-break:break-word}
.message-editor{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.message-editor textarea{min-height:80px}
.message-editor-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.attachments-box{display:flex;flex-direction:column;gap:12px}
.attachment-groups{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.attachment-groups li{display:flex;flex-wrap:wrap;gap:10px;align-items:center;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;background:#f8fafc}
.attachment-groups strong{min-width:120px;color:#0f172a}
.attachment-links{display:flex;flex-wrap:wrap;gap:10px}
.attachment-links a{color:#2563eb;font-weight:500}
.attachment-upload{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
.upload-controls{display:flex;flex-wrap:wrap;gap:10px}
.upload-controls .input{flex:1;min-width:200px}
.detail-container{min-height:calc(100vh - 56px);background:#f8fafc}
.required-list{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.required-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;background:#f8fafc}
.required-row strong{min-width:120px}
.required-row .input{flex:1;min-width:220px}
.required-links{display:flex;flex-wrap:wrap;gap:10px}
.required-links a{color:#2563eb;font-weight:500}
.action-field{display:flex;flex-direction:column;gap:6px;font-weight:600;color:#475569}
.action-field .input{font-weight:500;color:#0f172a}
.invoice-list{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.invoice-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.invoice-row .input{flex:1;min-width:160px}
.invoice-row .invoice-category{max-width:200px}
.invoice-row .invoice-amount{max-width:160px}

.fee-field-group{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}
.fee-field-group .action-field{flex:1;min-width:200px}

.billing-card{margin-bottom:20px}
.billing-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.billing-search{display:flex;gap:8px;align-items:center}
.billing-table-wrapper{overflow-x:auto}
.billing-summary{text-align:right;color:#666;margin-top:8px}
.bill-card{margin-bottom:20px}
.bill-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.bill-tab{padding:6px 12px;border:1px solid #d1d5db;border-radius:20px;background:#f3f4f6;color:#374151;cursor:pointer}
.bill-tab.active{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.bill-filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.bill-filters .input{min-width:180px}
.bill-filters .filter-dates{display:flex;align-items:center;gap:6px}
.bill-table-wrapper{overflow-x:auto}
.bill-actions{display:flex;gap:6px;flex-wrap:wrap}
.bill-modal-list{margin-top:10px;border-top:1px solid #e5e7eb;padding-top:10px}
.bill-modal-list table{width:100%;border-collapse:collapse}
.bill-modal-list th,.bill-modal-list td{padding:6px;border-bottom:1px solid #e5e7eb;text-align:left}
.bill-status-tag{padding:2px 8px;border-radius:12px;font-size:12px;display:inline-flex;align-items:center;gap:4px}
.bill-status-unbilled{background:#fef3c7;color:#92400e}
.bill-status-billed{background:#dbeafe;color:#1e40af}
.bill-status-paid{background:#d1fae5;color:#065f46}
.bill-status-disputed{background:#fee2e2;color:#991b1b}
.text-danger{color:#dc2626!important;}
.billing-section{margin-top:18px;border-top:1px solid #eee;padding-top:12px}
.billing-section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;gap:12px;flex-wrap:wrap}
.billing-customer-list{max-height:220px;overflow:auto;border:1px solid #e5e5e5;border-radius:8px;padding:8px;background:#fafafa}
.billing-customer-row{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:14px}
.billing-customer-row:last-child{margin-bottom:0}
.billing-customer-row .billing-customer-label{flex:1}
.billing-rule-list{display:flex;flex-direction:column;gap:10px}
.billing-rule-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.billing-rule-row .billing-rule-select{min-width:180px}
.billing-rule-row .billing-rule-amount{min-width:150px;flex:1}
.billing-modal-body{max-height:70vh;overflow:auto}
.danger-btn{color:#dc2626;border:1px solid #fecaca;background:#fff}
.danger-btn:hover{background:#fee2e2;color:#b91c1c}
.invoice-add{align-self:flex-start}
.attach-builder{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
.attach-builder-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.attach-rows{display:flex;flex-direction:column;gap:10px}
.attach-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.attach-row .input{flex:1;min-width:200px}
.file-name-hint{font-size:12px;color:#94a3b8}

/* 客户管理 */
.customer-card{display:flex;flex-direction:column;gap:16px}
.customer-toolbar{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;align-items:center}
.customer-toolbar .toolbar-left,
.customer-toolbar .toolbar-right{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.group-controls{display:flex;align-items:center;gap:8px}
.customer-table-wrapper{border:1px solid #e2e8f0;border-radius:12px;overflow:auto;background:#fff}
.customer-table{width:100%;border-collapse:separate;border-spacing:0;min-width:1080px}
.customer-table th,.customer-table td{padding:10px 12px;border-bottom:1px solid #e2e8f0;border-right:1px solid #e2e8f0;white-space:nowrap;background:#fff}
.customer-table th:last-child,.customer-table td:last-child{border-right:none}
.customer-table tr:nth-child(even) td{background:#f8fafc}
.customer-table tr:hover td{background:#eef2ff}
.customer-table th.number,.customer-table td.number{text-align:right}
.customer-table .sticky-col.left{position:sticky;left:0;z-index:4;background:#fff;box-shadow:2px 0 0 rgba(148,163,184,.18)}
.customer-table .sticky-col.right{position:sticky;right:0;z-index:4;background:#fff;box-shadow:-2px 0 0 rgba(148,163,184,.18)}
.customer-table .sticky-col.right.is-open{z-index:40}
.customer-table .customer-id{font-weight:600;color:#0f172a}
.customer-table .customer-name{font-size:13px;color:#475569}
.customer-table tr.inactive td{color:#94a3b8}
.customer-actions{position:relative}
.customer-actions .btn{white-space:nowrap}
.upload-inline{display:flex;align-items:center;gap:10px;margin-top:6px}
.upload-inline .hint{margin:0}
.action-menu{position:absolute;top:38px;right:0;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 18px 40px rgba(15,23,42,.18);display:flex;flex-direction:column;min-width:150px;padding:6px;z-index:8}
.action-menu.hidden{display:none}
.action-menu button{background:none;border:none;padding:8px 10px;text-align:left;border-radius:8px;cursor:pointer;color:#0f172a;font-size:14px}
.action-menu button:hover{background:#f1f5f9}
.amount-positive{color:#15803d}
.amount-negative{color:#dc2626}
.credit-cell .tag{margin-left:6px}
.status-chip{display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:600}
.status-chip.status-active{background:#dcfce7;color:#166534}
.status-chip.status-inactive{background:#fee2e2;color:#b91c1c}
.tag{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:500}
.tag-soft{background:#e0f2fe;color:#0369a1}
.tag-muted{background:#e2e8f0;color:#475569}
.customer-table-wrapper::-webkit-scrollbar{height:8px}
.customer-table-wrapper::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.customer-modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:flex-start;justify-content:center;padding:60px 16px;z-index:200}
.customer-modal.hidden{display:none}
.customer-modal-content{background:#fff;border-radius:16px;padding:24px;width:min(620px,92vw);max-height:82vh;overflow:auto;box-shadow:0 24px 60px rgba(15,23,42,.25);display:flex;flex-direction:column;gap:16px}
.modal-header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.modal-body{display:flex;flex-direction:column;gap:12px}
.modal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.modal-grid .span-2{grid-column:span 2}
.modal-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#475569}
.modal-grid label.checkbox{flex-direction:row;align-items:center}
.modal-actions{display:flex;justify-content:flex-end;gap:12px}

/* 账单流水（仓库端） */
.ledger-card{display:flex;flex-direction:column;gap:16px}
.ledger-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ledger-tabs{display:flex;flex-wrap:wrap;gap:8px}
.ledger-tab{padding:6px 16px;border-radius:999px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;cursor:pointer;font-size:14px}
.ledger-tab.active{background:#2563eb;color:#fff;border-color:#1d4ed8}
.ledger-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:end}
.filter-inline{display:flex;gap:8px;align-items:center}
.filter-actions{display:flex;gap:8px;justify-content:flex-end}
.ledger-table-wrapper{border:1px solid #e2e8f0;border-radius:12px;overflow:auto;background:#fff}
.ledger-table{width:100%;border-collapse:separate;border-spacing:0;min-width:1100px}
.ledger-table th,.ledger-table td{padding:10px 12px;border-bottom:1px solid #e2e8f0;border-right:1px solid #e2e8f0;white-space:nowrap;background:#fff}
.ledger-table th:last-child,.ledger-table td:last-child{border-right:none}
.ledger-table tr:nth-child(even) td{background:#f8fafc}
.ledger-table tr:hover td{background:#eef2ff}
.ledger-table th.number,.ledger-table td.number{text-align:right}
.ledger-action-col{width:120px}
.ledger-actions{position:relative}
.ledger-actions .btn{white-space:nowrap}
.ledger-actions.is-open{z-index:20}

/* --- 新增组件样式 --- */
.topbar .branch-select{width:200px;background:#0b1220;color:#cbd5e1;border-color:#1f2937}
.icon-btn{width:38px;height:38px;border-radius:999px;border:1px solid #1f2937;background:#111827;color:#e2e8f0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease}
.icon-btn:hover{border-color:#3b82f6;color:#fff}
.icon-btn.disabled{opacity:.35;cursor:not-allowed}
.icon-btn .icon-gear{font-size:18px;line-height:1}
.avatar-wrapper{position:relative}
.avatar-btn{width:40px;height:40px;border-radius:50%;border:1px solid #1f2937;background:#111c32;color:#93c5fd;font-weight:600;cursor:pointer}
.user-dropdown{position:absolute;top:48px;right:0;background:#0f172a;border:1px solid #1f2937;border-radius:12px;padding:12px;display:none;flex-direction:column;gap:8px;min-width:180px;box-shadow:0 12px 30px rgba(15,23,42,.6);z-index:20}
.user-dropdown.open{display:flex}
.user-dropdown-info{display:flex;flex-direction:column;color:#cbd5e1;font-size:14px}
.user-dropdown-info small{color:#64748b;font-size:12px}
.settings-wrapper{position:relative;display:flex;align-items:center}
.settings-wrapper .icon-btn.disabled{opacity:.4;cursor:not-allowed}
.settings-dropdown{min-width:180px}
.settings-dropdown .dropdown-item{width:100%}
.dropdown-item{border:none;background:#1f2937;color:#e2e8f0;border-radius:10px;padding:.5rem .8rem;cursor:pointer;text-align:left}
.dropdown-item.danger{background:#7f1d1d;color:#fee2e2}
.dropdown-item.danger:hover{background:#b91c1c;color:#fff}
.dropdown-item:hover{background:#374151}
.truck-filter-row{display:flex;gap:10px;align-items:center;margin-top:6px}
.truck-filter-list{border:1px solid #e5e7eb;border-radius:12px;padding:12px;max-height:360px;overflow:auto;background:#f8fafc;display:flex;flex-direction:column;gap:8px}
.truck-option{display:flex;align-items:center;gap:8px;font-size:14px}
.truck-option input{margin:0}
.truck-filter-body{display:flex;flex-direction:column;gap:12px}
.truck-picker-field .truck-input-wrap{display:flex;align-items:center;gap:10px;margin-top:6px}
.truck-picker-field .truck-input-wrap .input{flex:1}

.employee-card .table-wrapper{overflow:auto;border:1px solid #e2e8f0;border-radius:12px;margin-top:16px}
.employee-table{width:100%;border-collapse:separate;border-spacing:0}
.employee-table th,.employee-table td{padding:12px 14px;border-bottom:1px solid #e5e7eb;text-align:left;font-size:14px}
.employee-table th.actions,.employee-table td.actions{text-align:right}
.employee-table tbody tr:last-child td{border-bottom:none}
.employee-mail{font-weight:600}
.btn-compact{padding:.35rem .7rem;font-size:13px}
.badge-dark{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:#0f172a;color:#93c5fd;font-size:12px;margin-top:4px}
.employee-modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;z-index:200;padding:20px}
.employee-modal.hidden{display:none}
.employee-modal-content{background:#fff;border-radius:14px;padding:20px;max-width:620px;width:100%;max-height:90vh;overflow:auto}
.form-field{display:flex;flex-direction:column;gap:6px;font-size:14px}
.form-field span{font-weight:600;color:#0f172a}
.checkbox-field{flex-direction:row;align-items:center;font-weight:500}
.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;margin-top:6px}
.feature-check{display:flex;align-items:center;gap:8px;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:10px;padding:8px 10px;font-size:14px}
.feature-check input{margin:0}

.ticket-card{display:flex;flex-direction:column;gap:16px}
.ticket-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.ticket-filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ticket-body{display:grid;grid-template-columns:340px 1fr;gap:16px;min-height:420px}
.ticket-body.client{grid-template-columns:1fr}
.ticket-list{border:1px solid #e2e8f0;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:10px;overflow-y:auto;max-height:70vh;background:#fff}
.ticket-item{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#fff;cursor:pointer;display:flex;flex-direction:column;gap:6px}
.ticket-item.active{border-color:#2563eb;box-shadow:0 0 0 1px rgba(37,99,235,.2)}
.ticket-item-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.ticket-item-body,.ticket-item-foot{font-size:13px;color:#475569;display:flex;gap:10px;flex-wrap:wrap}
.ticket-placeholder{padding:30px;text-align:center;color:#94a3b8;font-size:14px;border:1px dashed #cbd5e1;border-radius:12px}
.ticket-detail{display:flex;flex-direction:column;gap:16px}
.ticket-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ticket-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:13px;color:#475569}
.ticket-content{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-size:14px}
.ticket-messages{display:flex;flex-direction:column;gap:12px;max-height:40vh;overflow:auto}
.ticket-message{border:1px solid #e2e8f0;border-radius:12px;padding:10px;background:#fff}
.ticket-message.client{border-color:#e2e8f0}
.ticket-message.warehouse{border-color:#2563eb}
.ticket-message-head{display:flex;justify-content:space-between;font-size:12px;color:#475569;margin-bottom:4px}
.ticket-message-body{font-size:14px;color:#0f172a;line-height:1.5}
.ticket-reply{display:flex;flex-direction:column;gap:8px}
.ticket-reply-actions{display:flex;align-items:center;gap:12px}
.status-open{background:#dbeafe;color:#1d4ed8}
.status-in_progress{background:#fef3c7;color:#b45309}
.status-resolved{background:#dcfce7;color:#15803d}
.status-closed{background:#f1f5f9;color:#475569}
.ticket-detail-modal{max-width:720px}

.setting-card{display:flex;flex-direction:column;gap:16px}
.setting-body{display:flex;flex-direction:column;gap:12px}
.card-actions{display:flex;flex-direction:column;gap:6px}
.card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.card-header h2{margin:0}
.fallback-hint{position:fixed;bottom:20px;right:20px;background:#0f172a;color:#fde68a;padding:12px 18px;border-radius:12px;border:1px solid #fbbf24;box-shadow:0 12px 30px rgba(15,23,42,.3);opacity:0;transform:translateY(10px);transition:all .25s ease;z-index:90;font-size:14px;max-width:320px}
.fallback-hint.visible{opacity:1;transform:translateY(0)}
.fallback-hint button{margin-left:12px}

.notification-layout{display:grid;grid-template-columns:380px minmax(0,1fr);gap:16px;align-items:flex-start}
@media (max-width:1200px){
  .notification-layout{grid-template-columns:1fr}
}
.notification-form-card textarea{min-height:160px}
.notification-form-card .notify-actions{flex-direction:row;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.notify-action-buttons{display:flex;gap:10px}
.notification-history-card .table-wrapper,
.client-notify-card .table-wrapper{border:1px solid #e2e8f0;border-radius:12px;overflow:auto}
.table-wrapper{overflow:auto}
.notification-table{width:100%;border-collapse:separate;border-spacing:0}
.notification-table th,.notification-table td{padding:12px 14px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top;font-size:14px}
.notification-table thead th{background:#f8fafc;font-weight:600;color:#0f172a}
.notification-table tbody tr:last-child td{border-bottom:none}
.notify-content{max-height:120px;overflow:auto;white-space:pre-wrap;line-height:1.5}
.badge.success{background:#dcfce7;color:#15803d}
.badge.neutral{background:#e0e7ff;color:#3730a3}
.badge.danger{background:#fee2e2;color:#b91c1c}
.notification-modal-content{background:#fff;border-radius:16px;padding:20px;max-width:520px;width:100%;max-height:90vh;overflow:auto}
.notify-modal-body{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.notify-modal-content{white-space:pre-wrap;line-height:1.6;font-size:15px;color:#0f172a;max-height:50vh;overflow:auto}
.notify-modal-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.link{color:#2563eb;text-decoration:none;font-weight:500}
.link:hover{text-decoration:underline}
