* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; background:#f0f4ff; color:#2c3d55; min-height:100vh; overflow:hidden; }

/* ===== 布局 ===== */
.app-layout { display:flex; height:100vh; }
.sidebar { width:200px; min-width:200px; background:linear-gradient(180deg,#fff 0%,#f8faff 100%); border-right:1px solid rgba(59,130,246,0.1); display:flex; flex-direction:column; overflow-y:auto; }
.sidebar-header { padding:20px 16px 12px; border-bottom:1px solid rgba(59,130,246,0.08); }
.sidebar-header h1 { font-size:16px; color:#2563eb; font-weight:700; text-align:center; }
.main-area { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.main-area header { background:#fff; padding:12px 24px; box-shadow:0 2px 8px rgba(59,130,246,0.05); border-bottom:1px solid rgba(59,130,246,0.1); display:flex; justify-content:space-between; align-items:center; flex-shrink:0; }
.main-area header h1 { font-size:17px; color:#1a2744; font-weight:700; }
.main-area main { flex:1; overflow-y:auto; padding:24px; max-width:none; }
.user-bar { display:flex; align-items:center; gap:14px; font-size:13px; color:#5c6b7d; }
.user-bar button { padding:6px 16px; border:1px solid rgba(59,130,246,0.2); border-radius:8px; background:#fff; cursor:pointer; font-size:13px; font-weight:500; color:#3b82f6; transition:all 0.2s; }
.user-bar button:hover { background:#eff6ff; border-color:#3b82f6; box-shadow:0 2px 8px rgba(59,130,246,0.12); }

/* ===== 侧边栏导航 ===== */
.tabs { display:flex; flex-direction:column; gap:2px; padding:12px 8px; }
.tab { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:12px 16px; border:none; border-radius:10px; background:transparent; color:#5c6b7d; font-size:14px; font-weight:500; cursor:pointer; transition:all 0.2s; text-align:left; }
.tab:hover { color:#3b82f6; background:rgba(59,130,246,0.05); }
.tab.active { color:#fff; background:linear-gradient(135deg,#3b82f6,#2563eb); font-weight:600; box-shadow:0 4px 12px rgba(59,130,246,0.25); }
.nav-badge, .alert-badge { min-width:20px; height:20px; padding:0 6px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; background:#facc15; color:#713f12; font-size:12px; font-weight:800; line-height:1; box-shadow:0 2px 8px rgba(250,204,21,0.35); flex-shrink:0; }
.tab.active .nav-badge, .tab.active .alert-badge { background:#fde047; color:#713f12; }
.tab-content { display:none; }
.tab-content.active { display:block; }

.card { background:#fff; border-radius:16px; padding:28px; margin-bottom:20px; box-shadow:0 2px 12px rgba(59,130,246,0.04),0 1px 3px rgba(0,0,0,0.03); border:1px solid rgba(59,130,246,0.08); }
.card h2 { font-size:18px; margin-bottom:20px; color:#1a2744; font-weight:700; }
.card h3 { font-size:15px; margin-bottom:10px; color:#2c3d55; }

.grid-form { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:16px; }
.grid-form label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:500; color:#3c4b60; }
.grid-form label input, .grid-form label select { padding:8px 12px; border:1px solid #c8d6e5; border-radius:8px; font-size:13px; font-family:inherit; transition:all 0.2s; background:#fff; }
.grid-form label input:hover, .grid-form label select:hover { border-color:#8395a7; }
.grid-form label input:focus, .grid-form label select:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.08); }
.supplier-form { align-items:end; margin-bottom:16px; }
.supplier-form button[type="submit"] { min-height:38px; }

input, select, textarea { padding:10px 14px; border:1px solid #c8d6e5; border-radius:10px; font-size:14px; font-family:inherit; background:#fff; color:#2c3d55; transition:all 0.2s; }
input:hover, select:hover { border-color:#8395a7; }
input:focus, select:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.08); }
select { cursor:pointer; }

button { font-family:inherit; }

.btn-primary { background:linear-gradient(135deg,#3b82f6,#2563eb); color:#fff; border:none; padding:10px 24px; border-radius:10px; cursor:pointer; font-size:14px; font-weight:600; transition:all 0.2s; box-shadow:0 4px 14px rgba(59,130,246,0.25); }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(59,130,246,0.35); }

.table-wrap { overflow-x:auto; border-radius:12px; border:1px solid rgba(59,130,246,0.08); }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:12px 16px; text-align:left; border-bottom:1px solid #e8edf5; }
th { background:#f4f8ff; font-weight:600; color:#3c4b60; white-space:nowrap; font-size:12px; text-transform:uppercase; letter-spacing:0.6px; }
tr:hover { background:#f0f5ff; }
tr:last-child td { border-bottom:none; }

.dashboard-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); gap:16px; }
.report-toolbar { display:flex; align-items:end; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.report-toolbar label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color:#3c4b60; }
.report-shell { background:linear-gradient(145deg,#ffffff 0%,#f8fbff 48%,#eef6ff 100%); }
.report-mode-header { display:grid; grid-template-columns:minmax(280px,1fr) auto minmax(280px,1fr); align-items:center; gap:18px; margin-bottom:18px; }
.report-mode-header h2 { margin-bottom:8px; }
.report-mode-header p { color:#64748b; font-size:13px; line-height:1.7; }
.report-mode-title-spacer { min-height:1px; }
.report-mode-switch { display:inline-flex; gap:6px; padding:6px; border:1px solid #dbeafe; border-radius:14px; background:rgba(255,255,255,.86); box-shadow:0 10px 24px rgba(37,99,235,.08); }
.report-mode-btn { border:none; border-radius:10px; padding:9px 16px; background:transparent; color:#3c4b60; font-size:13px; font-weight:800; cursor:pointer; transition:all .18s ease; }
.report-mode-btn:hover { background:#eff6ff; color:#2563eb; }
.report-mode-btn.active { background:linear-gradient(135deg,#2563eb,#0ea5e9); color:#fff; box-shadow:0 8px 18px rgba(37,99,235,.24); }
.report-mode-panel { display:none; }
.report-mode-panel.active { display:block; }
.preset-toolbar { justify-content:flex-end; align-items:end; gap:14px; }
.preset-toolbar-title { justify-self:center; margin:0; padding:12px 22px; border:1px solid #dbeafe; border-radius:999px; background:linear-gradient(135deg,#ffffff,#eff6ff); color:#0f172a; font-size:19px; line-height:1.35; letter-spacing:.2px; text-align:center; box-shadow:0 12px 26px rgba(37,99,235,.1); white-space:nowrap; }
.preset-report-board { padding:24px; border-radius:22px; background:linear-gradient(145deg,#0f172a 0%,#17325f 54%,#0f766e 145%); color:#fff; box-shadow:0 18px 48px rgba(15,23,42,.18); }
.preset-chart-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.preset-chart-card { min-height:290px; padding:18px; border:1px solid rgba(255,255,255,.18); border-radius:18px; background:rgba(255,255,255,.94); color:#1e293b; box-shadow:0 16px 30px rgba(15,23,42,.12); }
.preset-chart-card-wide { grid-column:1 / -1; width:min(980px, 100%); justify-self:center; }
.preset-chart-card h3 { margin:0; color:#172554; font-size:16px; }
.preset-chart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.preset-chart-tools { position:relative; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.preset-chart-menu-btn { width:30px; height:30px; border:none; border-radius:9px; background:#eef2ff; color:#4f46e5; font-size:18px; font-weight:900; line-height:1; cursor:pointer; box-shadow:0 8px 18px rgba(79,70,229,.12); }
.preset-chart-menu-btn:hover { background:#dbeafe; }
.preset-chart-menu { position:absolute; top:36px; right:0; z-index:20; min-width:128px; display:none; grid-template-columns:repeat(2, minmax(0,1fr)); gap:6px; padding:8px; border:1px solid #dbeafe; border-radius:14px; background:#fff; box-shadow:0 18px 38px rgba(15,23,42,.18); }
.preset-chart-tools.open .preset-chart-menu { display:grid; }
.preset-chart-tool, .preset-detail-btn { border:1px solid #dbeafe; border-radius:999px; padding:5px 9px; background:#fff; color:#2563eb; font-size:11px; font-weight:900; cursor:pointer; transition:all .18s ease; }
.preset-chart-tool:hover, .preset-detail-btn:hover { border-color:#60a5fa; background:#eff6ff; }
.preset-chart-tool.active { border-color:#2563eb; background:#2563eb; color:#fff; box-shadow:0 6px 14px rgba(37,99,235,.18); }
.preset-chart-body { min-height:250px; display:flex; align-items:center; justify-content:center; overflow:visible; }
.preset-loading, .preset-empty { width:100%; padding:28px 12px; text-align:center; color:#94a3b8; font-size:13px; font-weight:700; border:1px dashed #cbd5e1; border-radius:14px; background:#f8fafc; }
.preset-month-chart { width:100%; height:220px; display:grid; grid-template-columns:repeat(12,1fr); align-items:end; gap:8px; padding-top:24px; }
.preset-month-item { height:100%; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:6px; cursor:pointer; }
.preset-month-value { height:16px; font-size:10px; color:#64748b; font-weight:800; white-space:nowrap; }
.preset-month-bar { width:100%; max-width:24px; min-height:8px; border-radius:999px 999px 5px 5px; background:linear-gradient(180deg,#38bdf8,#2563eb); box-shadow:0 10px 16px rgba(37,99,235,.18); }
.preset-month-label { font-size:11px; color:#64748b; font-weight:800; white-space:nowrap; }
.preset-donut-wrap { width:100%; display:grid; grid-template-columns:190px minmax(0,1fr); gap:18px; align-items:center; }
.preset-donut { width:170px; height:170px; border-radius:50%; display:flex; align-items:center; justify-content:center; box-shadow:inset 0 0 0 22px rgba(255,255,255,.62),0 12px 22px rgba(15,23,42,.12); }
.preset-donut span { display:flex; align-items:center; justify-content:center; width:92px; height:92px; border-radius:50%; background:#fff; color:#172554; font-size:20px; font-weight:900; box-shadow:0 8px 18px rgba(15,23,42,.12); }
.preset-legend { display:flex; flex-direction:column; gap:9px; min-width:0; }
.preset-legend-row { display:grid; grid-template-columns:12px minmax(0,1fr) 54px; gap:8px; align-items:center; color:#334155; font-size:12px; font-weight:800; cursor:pointer; }
.preset-legend-row i { width:10px; height:10px; border-radius:999px; }
.preset-legend-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preset-legend-row strong { text-align:right; color:#0f172a; }
.preset-bar-list { width:100%; max-height:240px; overflow-y:auto; padding-right:4px; display:flex; flex-direction:column; gap:12px; }
.preset-bar-row { display:grid; grid-template-columns:minmax(78px,120px) minmax(0,1fr) 58px; gap:10px; align-items:center; cursor:pointer; }
.preset-bar-name { color:#334155; font-size:12px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preset-bar-track { height:15px; overflow:hidden; border-radius:999px; background:#e2e8f0; box-shadow:inset 0 1px 2px rgba(15,23,42,.08); }
.preset-bar-fill { height:100%; border-radius:999px; box-shadow:0 7px 12px rgba(37,99,235,.18); }
.preset-bar-row strong { color:#172554; font-size:12px; text-align:right; }
.preset-line-chart { width:100%; min-height:260px; padding:4px 6px 0; overflow:visible; }
.preset-line-svg { width:100%; height:260px; display:block; overflow:visible; shape-rendering:geometricPrecision; text-rendering:geometricPrecision; }
.preset-line-grid { stroke:#e2e8f0; stroke-width:1; }
.preset-line-path { fill:none; stroke:#2563eb; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.preset-line-area { fill:#2563eb; opacity:.12; }
.preset-line-dot { fill:#fff; stroke:#2563eb; stroke-width:3; cursor:pointer; }
.preset-line-label { fill:#0f172a; font-size:12px; font-weight:900; text-anchor:middle; dominant-baseline:hanging; }
.preset-line-value { fill:#0f172a; font-size:12px; font-weight:900; text-anchor:middle; paint-order:stroke; stroke:#fff; stroke-width:3px; stroke-linejoin:round; }
.preset-chart-table { width:100%; max-height:235px; overflow:auto; border:1px solid #e2e8f0; border-radius:12px; background:#fff; }
.preset-chart-table table { width:100%; border-collapse:collapse; font-size:12px; }
.preset-chart-table th, .preset-chart-table td { padding:9px 10px; border-bottom:1px solid #e2e8f0; text-align:left; white-space:nowrap; }
.preset-chart-table th { position:sticky; top:0; background:#f8fafc; color:#334155; z-index:1; }
.preset-chart-table tr { cursor:pointer; }
.preset-chart-table tr:hover, .preset-bar-row:hover, .preset-legend-row:hover, .preset-month-item:hover { filter:brightness(.97); }
.preset-detail-modal { position:fixed; inset:0; z-index:4200; display:flex; align-items:center; justify-content:center; padding:22px; background:rgba(15,23,42,.52); }
.preset-detail-panel { width:min(1080px, 96vw); max-height:88vh; display:flex; flex-direction:column; border-radius:18px; background:#fff; color:#1e293b; box-shadow:0 24px 70px rgba(15,23,42,.32); overflow:hidden; }
.preset-detail-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:18px 20px; border-bottom:1px solid #e2e8f0; background:linear-gradient(135deg,#f8fbff,#eef6ff); }
.preset-detail-header h3 { margin:0 0 4px; color:#0f172a; }
.preset-detail-header p { margin:0; color:#64748b; font-size:12px; font-weight:700; }
.preset-detail-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.preset-detail-actions button { border:1px solid #dbeafe; border-radius:9px; padding:7px 11px; background:#fff; color:#2563eb; font-size:12px; font-weight:900; cursor:pointer; }
.preset-detail-body { padding:16px 20px; overflow:auto; }
.preset-detail-table { width:100%; border-collapse:collapse; font-size:12px; }
.preset-detail-table th, .preset-detail-table td { padding:9px 10px; border-bottom:1px solid #e5e7eb; text-align:left; white-space:nowrap; }
.preset-detail-table th { background:#f8fafc; color:#334155; position:sticky; top:0; z-index:1; }
.preset-detail-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 20px; border-top:1px solid #e2e8f0; color:#64748b; font-size:12px; font-weight:800; }
.preset-detail-pagination button { border:1px solid #dbeafe; border-radius:9px; padding:7px 12px; background:#fff; color:#2563eb; font-size:12px; font-weight:900; cursor:pointer; }
.preset-detail-pagination button:disabled { opacity:.45; cursor:not-allowed; }
.audit-action-badge { display:inline-flex; align-items:center; padding:4px 9px; border-radius:999px; background:#eef6ff; color:#2563eb; font-size:12px; font-weight:900; white-space:nowrap; }
.audit-action-code { margin-top:4px; color:#94a3b8; font-size:11px; font-family:Consolas, monospace; }
.audit-detail-box { max-width:900px; }
.audit-detail-box summary { cursor:pointer; color:#0f172a; font-weight:800; list-style:none; }
.audit-detail-box summary::-webkit-details-marker { display:none; }
.audit-detail-box summary::before { content:'展开'; display:inline-flex; margin-right:8px; padding:2px 7px; border-radius:999px; background:#e0f2fe; color:#0369a1; font-size:11px; font-weight:900; }
.audit-detail-box[open] summary::before { content:'收起'; background:#fef3c7; color:#92400e; }
.audit-detail-content { margin-top:10px; padding:12px; border:1px solid #e2e8f0; border-radius:12px; background:#f8fafc; }
.audit-detail-title { margin:4px 0 8px; color:#334155; font-size:12px; font-weight:900; }
.audit-field-row, .audit-change-row { display:grid; grid-template-columns:110px minmax(120px,1fr); gap:10px; align-items:start; padding:7px 0; border-bottom:1px dashed #e2e8f0; color:#475569; font-size:12px; }
.audit-change-row { grid-template-columns:110px minmax(100px,1fr) 38px minmax(100px,1fr); }
.audit-field-row:last-child, .audit-change-row:last-child { border-bottom:none; }
.audit-field-row span, .audit-change-row span { color:#64748b; font-weight:800; }
.audit-field-row strong, .audit-change-row strong { color:#0f172a; font-weight:900; word-break:break-word; }
.audit-change-row em { color:#b91c1c; font-style:normal; word-break:break-word; }
.audit-change-row b { color:#64748b; font-size:11px; }
.audit-muted { color:#94a3b8; font-size:12px; }
.audit-legacy { display:flex; align-items:center; gap:8px; flex-wrap:wrap; color:#475569; font-size:12px; }
.audit-legacy strong { color:#92400e; }
.audit-legacy span { color:#94a3b8; }
@media print {
  body.printing-preset-detail > *:not(.preset-detail-modal) { display:none !important; }
  .preset-detail-modal { position:static; inset:auto; padding:0; background:#fff; }
  .preset-detail-panel { width:100%; max-height:none; box-shadow:none; border-radius:0; }
  .preset-detail-actions, .preset-detail-pagination { display:none; }
}
.report-summary-grid { grid-template-columns:repeat(4, minmax(160px, 1fr)); margin-bottom:18px; }
.report-card { cursor:pointer; position:relative; }
.report-card::after { content:"点击查看明细"; display:block; margin-top:6px; font-size:11px; color:#94a3b8; font-weight:600; }
.report-card:hover { border-color:rgba(59,130,246,0.35); }
.report-chart-panel { margin-top:16px; padding:18px; border:1px solid rgba(59,130,246,0.1); border-radius:14px; background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%); }
.report-chart-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.report-chart-head h3 { margin:0; }
.report-chart-head span { color:#64748b; font-size:13px; font-weight:600; }
.report-chart { display:flex; flex-direction:column; gap:14px; }
.custom-filter-panel { display:grid; grid-template-columns:1.05fr 1.65fr auto; gap:14px; align-items:stretch; margin-bottom:18px; padding:16px; border:1px solid #dbeafe; border-radius:18px; background:linear-gradient(135deg,#f8fbff 0%,#ffffff 45%,#eef6ff 100%); box-shadow:0 14px 34px rgba(37,99,235,.08); }
.custom-filter-card { padding:14px; border:1px solid #e0e7ff; border-radius:14px; background:rgba(255,255,255,.9); }
.custom-filter-card h3 { margin:0 0 12px; color:#172554; font-size:14px; }
.custom-filter-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.custom-filter-card:not(.custom-filter-card-wide) .custom-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.custom-filter-grid label { display:flex; flex-direction:column; gap:6px; color:#334155; font-size:12px; font-weight:900; }
.custom-filter-grid input, .custom-filter-grid select, .custom-filter-grid .multi-select-trigger { min-height:38px; border:1px solid #c8d6e5; border-radius:10px; background:#fff; color:#172554; font-size:13px; }
.custom-filter-grid input, .custom-filter-grid select { padding:8px 10px; }
.custom-filter-actions { display:flex; flex-direction:column; justify-content:flex-end; gap:10px; min-width:118px; }
.custom-filter-actions button { min-height:40px; border-radius:11px; font-weight:900; }
.custom-report-designer { display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; align-items:start; }
.custom-report-designer.custom-report-auto { grid-template-columns:1fr; }
.custom-report-options { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 16px; padding:12px 14px; border:1px solid #dbeafe; border-radius:14px; background:#f8fbff; color:#334155; font-size:13px; font-weight:800; }
.custom-report-options span { color:#172554; margin-right:4px; }
.custom-report-options label { display:inline-flex; align-items:center; gap:5px; }
.custom-widget-palette { position:sticky; top:12px; padding:16px; border:1px solid #dbeafe; border-radius:16px; background:linear-gradient(180deg,#fff,#f8fbff); box-shadow:0 12px 28px rgba(37,99,235,.08); }
.custom-widget-palette h3 { margin:0 0 6px; color:#172554; }
.custom-widget-palette p { margin:0 0 12px; color:#64748b; font-size:12px; font-weight:700; }
.custom-widget-palette button[data-widget] { width:100%; margin-bottom:8px; padding:10px 12px; border:1px solid #dbeafe; border-radius:12px; background:#fff; color:#2563eb; font-size:13px; font-weight:900; text-align:left; cursor:grab; }
.custom-widget-palette button[data-widget]:hover { border-color:#60a5fa; background:#eff6ff; }
.custom-layout-actions { margin-top:10px; }
.custom-report-canvas-wrap { min-width:0; }
.custom-canvas-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; color:#64748b; font-size:12px; font-weight:800; }
.custom-canvas-head h3 { margin:0; color:#172554; font-size:16px; }
.custom-report-canvas { min-height:360px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:16px; border:2px dashed #bfdbfe; border-radius:18px; background:linear-gradient(135deg,#f8fbff,#eef6ff); }
.custom-report-canvas.drag-over { border-color:#2563eb; background:#eff6ff; }
.custom-widget-card { min-height:260px; padding:16px; border:1px solid #dbeafe; border-radius:16px; background:#fff; box-shadow:0 14px 28px rgba(15,23,42,.08); color:#1e293b; }
.custom-widget-card.wide { grid-column:1 / -1; }
.custom-widget-card.dragging { opacity:.55; }
.custom-widget-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.custom-widget-head h4 { margin:0; color:#172554; font-size:15px; }
.custom-widget-actions { display:flex; gap:6px; }
.custom-widget-actions button { border:1px solid #dbeafe; border-radius:8px; background:#fff; color:#2563eb; font-size:12px; font-weight:900; cursor:pointer; padding:4px 8px; }
.custom-empty-canvas { grid-column:1 / -1; display:flex; align-items:center; justify-content:center; min-height:280px; color:#94a3b8; font-size:14px; font-weight:900; border-radius:14px; background:rgba(255,255,255,.72); }
.custom-single-report { min-height:280px; padding:18px; border:1px solid #dbeafe; border-radius:20px; background:linear-gradient(145deg,#ffffff 0%,#f8fbff 52%,#eef6ff 100%); box-shadow:0 16px 36px rgba(37,99,235,.08); }
.custom-report-placeholder { min-height:220px; display:flex; align-items:center; justify-content:center; border:1px dashed #bfdbfe; border-radius:16px; background:rgba(255,255,255,.78); color:#64748b; font-size:14px; font-weight:900; text-align:center; }
.single-report-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:16px; padding:16px; border:1px solid #dbeafe; border-radius:16px; background:#fff; }
.single-report-head h3 { margin:0 0 6px; color:#0f172a; font-size:18px; }
.single-report-head p { margin:0; color:#64748b; font-size:12px; font-weight:800; line-height:1.7; }
.single-report-head strong { flex-shrink:0; padding:8px 12px; border-radius:999px; background:#eff6ff; color:#2563eb; font-size:12px; font-weight:900; }
.single-report-summary { margin-bottom:16px; }
.single-report-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.single-report-section { min-width:0; padding:16px; border:1px solid #dbeafe; border-radius:16px; background:#fff; box-shadow:0 10px 24px rgba(15,23,42,.05); }
.single-report-section h4 { margin:0 0 12px; color:#172554; font-size:15px; }
.single-report-section .preset-chart-table { max-height:320px; }
@media (max-width: 900px) {
  .custom-filter-panel { grid-template-columns:1fr; }
  .custom-filter-grid, .custom-filter-card:not(.custom-filter-card-wide) .custom-filter-grid { grid-template-columns:1fr; }
  .custom-filter-actions { flex-direction:row; }
  .custom-report-designer { grid-template-columns:1fr; }
  .custom-widget-palette { position:static; }
  .custom-report-canvas { grid-template-columns:1fr; }
  .single-report-head { flex-direction:column; }
  .single-report-grid { grid-template-columns:1fr; }
}
.report-bar-row { display:grid; grid-template-columns:90px 1fr 110px; gap:12px; align-items:center; cursor:pointer; }
.report-bar-label { font-size:13px; font-weight:700; color:#334155; }
.report-bar-track { height:18px; border-radius:999px; background:#eef2ff; overflow:hidden; box-shadow:inset 0 1px 2px rgba(15,23,42,0.08); }
.report-bar-fill { height:100%; border-radius:999px; transition:width .25s ease; }
.report-bar-value { font-size:13px; font-weight:800; color:#1f2937; text-align:right; }
.report-history-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; margin-top:16px; }
.report-history-card { padding:18px; border:1px solid rgba(59,130,246,0.1); border-radius:14px; background:#fff; }
.report-history-card h3 { margin:0; }
.trend-controls { display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 12px; }
.trend-mode, .trend-value-toggle { height:32px; padding:0 12px; border:1px solid #dbeafe; border-radius:8px; background:#fff; color:#2563eb; font-size:12px; font-weight:800; cursor:pointer; transition:all .18s ease; }
.trend-mode:hover, .trend-value-toggle:hover { border-color:#93c5fd; background:#eff6ff; }
.trend-mode.active, .trend-value-toggle.active { border-color:#2563eb; background:#2563eb; color:#fff; box-shadow:0 5px 14px rgba(37,99,235,.18); }
.trend-chart { min-height:340px; margin-top:10px; }
.trend-chart-frame { width:100%; overflow:hidden; border:1px solid #e0e7ff; border-radius:12px; background:linear-gradient(180deg,#fff 0%,#f8fbff 100%); }
.trend-chart-svg { display:block; width:100%; height:auto; min-height:290px; }
.trend-grid-line { stroke:#e2e8f0; stroke-width:1; }
.trend-axis-line { stroke:#94a3b8; stroke-width:1.2; }
.trend-x-label, .trend-y-label { fill:#64748b; font-size:12px; font-weight:700; text-anchor:middle; }
.trend-y-label { text-anchor:end; }
.trend-line { fill:none; stroke:#2563eb; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.trend-area { fill:#3b82f6; fill-opacity:.14; stroke:none; }
.trend-point { fill:#fff; stroke:#2563eb; stroke-width:3; }
.trend-bar { filter:drop-shadow(0 7px 10px rgba(37,99,235,.12)); }
.trend-bar-expense { fill:#ef4444; }
.trend-bar-purchase { fill:#f59e0b; }
.trend-bar-loan { fill:#6366f1; }
.trend-bar-label { fill:#fff; font-size:10px; font-weight:900; text-anchor:middle; pointer-events:none; paint-order:stroke; stroke:rgba(15,23,42,.22); stroke-width:2px; stroke-linejoin:round; }
.trend-point-label { fill:#1e293b; font-size:12px; font-weight:800; text-anchor:middle; paint-order:stroke; stroke:#fff; stroke-width:4px; stroke-linejoin:round; }
.trend-legend { display:flex; gap:14px; margin-top:8px; color:#64748b; font-size:12px; font-weight:700; }
.trend-legend span { display:inline-flex; align-items:center; gap:6px; }
.trend-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.trend-total-dot { background:#2563eb; }
.trend-expense-dot { background:#ef4444; }
.trend-purchase-dot { background:#f59e0b; }
.trend-loan-dot { background:#6366f1; }
@media (max-width: 980px) { .report-history-grid { grid-template-columns:1fr; } }
@media (max-width: 980px) {
  .report-mode-header { grid-template-columns:1fr; justify-items:center; }
  .report-mode-title-spacer { display:none; }
  .report-mode-switch { width:100%; }
  .report-mode-btn { flex:1; }
  .preset-toolbar { justify-content:center; }
  .preset-toolbar-title { white-space:normal; }
  .preset-chart-grid { grid-template-columns:1fr; }
  .preset-donut-wrap { grid-template-columns:1fr; justify-items:center; }
  .preset-legend { width:100%; }
}
.report-table-wrap { margin-top:8px; }
.report-table-wrap td:last-child, .report-table-wrap th:last-child { text-align:right; }
.stat-card { background:#fff; border-radius:14px; padding:18px 14px; text-align:center; box-shadow:0 2px 10px rgba(59,130,246,0.04); border:1px solid rgba(59,130,246,0.06); transition:all 0.2s; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(59,130,246,0.1); }
.stat-card .stat-label { font-size:12px; color:#7c8ba0; display:block; margin-bottom:6px; font-weight:500; }
.stat-card .stat-value { font-size:24px; font-weight:700; }
.stat-sales .stat-value { color:#10b981; }
.stat-purchases .stat-value { color:#f59e0b; }
.stat-month-in .stat-value { color:#10b981; }
.stat-month-out .stat-value { color:#ef4444; }
.stat-receivable .stat-value { color:#3b82f6; }
.stat-payable .stat-value { color:#ef4444; }
.stat-alert .stat-value { color:#ef4444; }
.stat-pending .stat-value { color:#f59e0b; }

.finance-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px,1fr)); gap:16px; }
.finance-card { background:#fff; border-radius:14px; padding:18px 14px; text-align:center; border:1px solid rgba(59,130,246,0.08); box-shadow:0 2px 10px rgba(59,130,246,0.03); transition:all 0.2s; }
.finance-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(59,130,246,0.1); }
.finance-card .label { font-size:12px; color:#7c8ba0; display:block; font-weight:500; }
.finance-card .value { font-size:22px; font-weight:700; display:block; margin-top:6px; }
.finance-card.receivable .value { color:#3b82f6; }
.finance-card.collected .value { color:#10b981; }
.finance-card.payable .value { color:#ef4444; }
.finance-card.paid .value { color:#10b981; }
.finance-placeholder { display:flex; align-items:center; gap:18px; min-height:90px; padding:22px 24px; border:1px dashed rgba(59,130,246,0.35); border-radius:16px; background:linear-gradient(135deg, rgba(239,246,255,0.92), rgba(255,255,255,0.98)); color:#1e3a5f; }
.finance-placeholder-icon { width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center; background:#3b82f6; color:#fff; font-size:20px; font-weight:800; box-shadow:0 10px 20px rgba(59,130,246,0.22); flex:0 0 auto; }
.finance-placeholder-title { font-size:18px; font-weight:800; color:#102a4c; margin-bottom:6px; }
.finance-placeholder-desc { font-size:13px; line-height:1.7; color:#607089; }
.loan-boss-check { display:inline-flex; align-items:center; gap:4px; margin-right:8px; font-size:12px; color:#475569; font-weight:700; white-space:nowrap; }
.btn-loan-approve, .btn-loan-pay { background:#10b981; color:#fff; border:none; padding:6px 12px; border-radius:8px; cursor:pointer; font-weight:700; font-size:12px; }
.btn-loan-reject { background:#ef4444; color:#fff; border:none; padding:6px 12px; border-radius:8px; cursor:pointer; font-weight:700; font-size:12px; }
.btn-loan-approve:hover, .btn-loan-pay:hover, .btn-loan-reject:hover { filter:brightness(.96); }
.linked-purchase-note { margin-top:4px; color:#b45309; font-size:12px; font-weight:700; white-space:normal; }
.history-section { margin-top:22px; padding-top:18px; border-top:1px solid #e5e7eb; }
.history-filter-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:10px 0 14px; }
.history-filter-row label { display:flex; flex-direction:column; gap:6px; color:#3c4b60; font-size:13px; font-weight:700; }
.history-hint { margin:0 0 12px; color:#64748b; font-size:13px; font-weight:600; }
.section-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.section-title-row h2 { margin:0; }
.finance-sub-nav { margin:0 0 16px; }
.finance-section { padding-top:22px; }

.btn-pay, .btn-repay { background:#3b82f6; color:#fff; border:none; padding:5px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(59,130,246,0.2); }
.btn-pay:hover, .btn-repay:hover { background:#2563eb; transform:translateY(-1px); box-shadow:0 4px 10px rgba(59,130,246,0.3); }

.btn-del { background:#ef4444; color:#fff; border:none; padding:5px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(239,68,68,0.2); }
.btn-del:hover { background:#dc2626; transform:translateY(-1px); box-shadow:0 4px 10px rgba(239,68,68,0.3); }

.btn-approve, .btn-pr-approve { background:#10b981; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(16,185,129,0.2); }
.btn-approve:hover, .btn-pr-approve:hover { background:#059669; transform:translateY(-1px); box-shadow:0 4px 10px rgba(16,185,129,0.3); }
.btn-reject, .btn-pr-reject { background:#ef4444; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(239,68,68,0.2); }
.btn-reject:hover, .btn-pr-reject:hover { background:#dc2626; transform:translateY(-1px); box-shadow:0 4px 10px rgba(239,68,68,0.3); }

.btn-outbound { background:#f59e0b; color:#fff; border:none; padding:4px 12px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(245,158,11,0.2); }
.btn-outbound:hover { background:#d97706; transform:translateY(-1px); box-shadow:0 4px 10px rgba(245,158,11,0.3); }

.btn-secondary { background:#fff; color:#3c4b60; border:1px solid #c8d6e5; padding:5px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.2s; }
.btn-secondary:hover { background:#f4f8ff; border-color:#3b82f6; color:#3b82f6; }

.btn-report { background:#8b5cf6; color:#fff; border:none; padding:5px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(139,92,246,0.2); }
.btn-report:hover { background:#7c3aed; transform:translateY(-1px); box-shadow:0 4px 10px rgba(139,92,246,0.3); }

.btn-pay-expense { background:#10b981; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(16,185,129,0.2); }
.btn-pay-expense:hover { background:#059669; transform:translateY(-1px); box-shadow:0 4px 10px rgba(16,185,129,0.3); }

/* ===== V7 报销多行明细表单 ===== */
.expense-header-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.expense-header-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #3c4b60;
}
.expense-header-row label textarea {
  padding: 8px 12px;
  border: 1px solid #c8d6e5;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 52px;
}
.expense-header-row label textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}
.expense-header-row label input {
  padding: 8px 12px;
  border: 1px solid #c8d6e5;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.expense-items-section {
  margin-bottom: 16px;
}
.expense-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.expense-items-header h3 {
  font-size: 14px;
  color: #1a2744;
  font-weight: 600;
}
.expense-items-table-wrap {
  max-height: 360px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,0.1);
}
.expense-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.expense-items-table th {
  background: #f4f8ff;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3c4b60;
  text-align: left;
  border-bottom: 1px solid #e8edf5;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.expense-items-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
.expense-items-table input,
.expense-items-table select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #dde4f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.expense-items-table input:focus,
.expense-items-table select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.expense-summary-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 14px 0;
  border-top: 2px solid #e8edf5;
}
.expense-summary-right .summary-item.total {
  font-size: 18px;
  font-weight: 700;
  color: #1a2744;
}
.expense-summary-right .summary-item.total span {
  color: #ef4444;
}
.expense-invoice-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #dde4f0;
  cursor: pointer;
}
.expense-invoice-thumb:hover {
  border-color: #3b82f6;
  transform: scale(1.1);
  transition: all 0.2s;
}
.expense-upload-btn {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #c8d6e5;
  background: #fff;
  color: #3c4b60;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.expense-upload-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.expense-upload-btn.has-file {
  border-color: #10b981;
  color: #10b981;
}

/* 审批时间线 */
.expense-timeline {
  margin-top: 20px;
  padding: 16px;
  background: #fafcff;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,0.1);
}
.expense-timeline h3 {
  font-size: 15px;
  color: #1a2744;
  margin-bottom: 14px;
  font-weight: 600;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-left: 2px solid #c8d6e5;
  margin-left: 10px;
  padding-left: 18px;
  position: relative;
}
.timeline-item:last-child {
  border-left-color: transparent;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8d6e5;
}
.timeline-item.action-submit::before { background: #3b82f6; }
.timeline-item.action-approve::before { background: #10b981; }
.timeline-item.action-reject::before { background: #ef4444; }
.timeline-item.action-pay::before { background: #f59e0b; }
.timeline-item.action-resubmit::before { background: #8b5cf6; }
.timeline-item.action-withdraw::before { background: #7c8ba0; }
.timeline-item .tl-time {
  font-size: 11px;
  color: #7c8ba0;
  white-space: nowrap;
  min-width: 130px;
}
.timeline-item .tl-content {
  flex: 1;
  font-size: 13px;
  color: #3c4b60;
}
.timeline-item .tl-content .tl-action {
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-item .tl-content .tl-comment {
  font-size: 12px;
  color: #7c8ba0;
  margin-top: 2px;
}

/* 报销详情弹窗 */
.expense-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.expense-detail-table th {
  background: #f4f8ff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #3c4b60;
  text-align: left;
  border: 1px solid #e8edf5;
}
.expense-detail-table td {
  padding: 8px 10px;
  border: 1px solid #e8edf5;
}
.expense-detail-table .detail-invoice-thumb {
  max-width: 60px;
  max-height: 60px;
  cursor: pointer;
  border-radius: 4px;
}
.expense-detail-info {
  margin-bottom: 16px;
  padding: 12px;
  background: #fafcff;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,0.08);
}
.expense-detail-info .info-row {
  display: flex;
  gap: 24px;
  font-size: 13px;
  line-height: 2;
}
.expense-detail-info .info-row span {
  color: #3c4b60;
}
.expense-detail-info .info-row strong {
  color: #1a2744;
}

/* 状态标签扩展 */
.status-submitted { color: #3b82f6; font-weight: 600; }
.status-reviewing { color: #8b5cf6; font-weight: 600; }
.status-paid { color: #10b981; font-weight: 600; }
.status-withdrawn { color: #7c8ba0; font-weight: 600; }
.status-pending_payment { color: #f59e0b; font-weight: 600; }

.btn-resubmit { background:#8b5cf6; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(139,92,246,0.2); }
.btn-resubmit:hover { background:#7c3aed; transform:translateY(-1px); box-shadow:0 4px 10px rgba(139,92,246,0.3); }
.btn-detail { background:#3b82f6; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(59,130,246,0.2); }
.btn-detail:hover { background:#2563eb; transform:translateY(-1px); box-shadow:0 4px 10px rgba(59,130,246,0.3); }
.btn-withdraw { background:#7c8ba0; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; }
.btn-withdraw:hover { background:#5c6b7d; transform:translateY(-1px); }
.btn-edit, .btn-edit-warehouse { background:#f59e0b; color:#fff; border:none; padding:5px 14px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:500; transition:all 0.2s; box-shadow:0 2px 6px rgba(245,158,11,0.2); }
.btn-edit:hover, .btn-edit-warehouse:hover { background:#d97706; transform:translateY(-1px); box-shadow:0 4px 10px rgba(245,158,11,0.3); }

.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(15,23,42,0.25); display:flex; justify-content:center; align-items:center; z-index:1000; backdrop-filter:blur(3px); }
.modal, .modal-card { background:#fff; border-radius:18px; padding:36px; width:92%; max-width:1200px; max-height:90vh; overflow-y:auto; box-shadow:0 25px 60px -15px rgba(15,23,42,0.2); transform:scale(1); transition:all 0.2s ease; border:1px solid rgba(59,130,246,0.15); }
.pc-form-modal { max-width:1180px; }
.pc-form-modal .grid-form { margin-top:18px; }
.modal-close { position:absolute; top:14px; right:16px; width:32px; height:32px; border:none; border-radius:999px; background:#eef2ff; color:#2563eb; font-size:22px; font-weight:800; line-height:1; cursor:pointer; }
.modal-close:hover { background:#dbeafe; }
.modal h2, .modal-card h2 { font-size:21px; margin-bottom:10px; color:#1a2744; font-weight:700; }
.modal-body { display:flex; flex-direction:column; gap:18px; margin-top:22px; }
.modal-body label { display:flex; flex-direction:column; gap:6px; font-size:14px; font-weight:500; color:#3c4b60; }
.modal-body input, .modal-body select { padding:12px 16px; border:1px solid #c8d6e5; border-radius:10px; font-size:14px; background:#fff; color:#2c3d55; transition:all 0.2s; }
.modal-body input:hover, .modal-body select:hover { border-color:#8395a7; }
.modal-body input:focus, .modal-body select:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.08); }
.modal-body select { cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position:right 12px center; background-repeat:no-repeat; background-size:20px; padding-right:44px; }
.modal-actions { display:flex; gap:14px; margin-top:30px; justify-content:flex-end; }
.modal-actions button { padding:11px 28px; border-radius:10px; cursor:pointer; font-size:14px; font-weight:600; transition:all 0.2s; }
.modal-actions button:first-child { background:linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color:#fff; border:none; box-shadow:0 4px 14px rgba(59,130,246,0.3); }
.modal-actions button:first-child:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(59,130,246,0.4); }
.modal-actions .btn-secondary { background:#fff; color:#3c4b60; border:1px solid #c8d6e5; }
.modal-actions .btn-secondary:hover { background:#f4f8ff; border-color:#3b82f6; color:#3b82f6; }
.loan-detail-card { max-width:820px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.detail-grid > div { background:#f7fbff; border:1px solid #dbeafe; border-radius:14px; padding:12px 14px; }
.detail-grid label { display:block; color:#64748b; font-size:12px; margin-bottom:6px; }
.detail-grid p { margin:0; color:#0f172a; font-weight:700; word-break:break-word; }
.detail-history { margin-top:18px; background:#ffffff; border:1px solid #e2e8f0; border-radius:16px; padding:14px; }
.detail-history h4 { margin:0 0 10px; color:#1e3a8a; }
.detail-line { display:grid; grid-template-columns:88px 100px 1fr auto; gap:10px; align-items:center; padding:10px 0; border-top:1px solid #edf2f7; color:#475569; font-size:13px; }
.detail-line:first-of-type { border-top:0; }
.detail-line strong { color:#2563eb; }
.detail-line em { color:#64748b; font-style:normal; }
.muted { color:#94a3b8; }
@media (max-width: 720px) {
  .detail-grid { grid-template-columns:1fr; }
  .detail-line { grid-template-columns:1fr; gap:4px; }
}

.toast { position:fixed; top:50%; left:50%; right:auto; transform:translate(-50%,-50%); max-width:min(520px, calc(100vw - 40px)); padding:16px 28px; border-radius:14px; color:#fff; font-size:15px; font-weight:700; line-height:1.6; text-align:center; z-index:3000; animation:toastCenterIn 0.3s ease, toastCenterOut 0.3s ease 2.2s forwards; pointer-events:none; box-shadow:0 18px 45px rgba(15,23,42,0.22); }
.toast.success { background:linear-gradient(135deg, #10b981 0%, #059669 100%); }
.toast.error { background:linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.toast-center { top:50%; right:auto; left:50%; transform:translate(-50%,-50%); animation:toastCenterIn 0.3s ease, toastCenterOut 0.3s ease 2.2s forwards; }
@keyframes toastIn { 0%{opacity:0;transform:translateX(30px) scale(0.95)} 100%{opacity:1;transform:translateX(0) scale(1)} }
@keyframes toastOut { 0%{opacity:1;transform:translateX(0)} 100%{opacity:0;transform:translateX(30px) scale(0.95)} }
@keyframes toastCenterIn { 0%{opacity:0;transform:translate(-50%,-50%) scale(0.8)} 100%{opacity:1;transform:translate(-50%,-50%) scale(1)} }
@keyframes toastCenterOut { 0%{opacity:1;transform:translate(-50%,-50%) scale(1)} 100%{opacity:0;transform:translate(-50%,-50%) scale(0.8)} }

.alert-bar { padding:12px 18px; border-radius:10px; margin-bottom:14px; font-size:13px; font-weight:500; }
.alert-bar.warning { background:#fffbeb; color:#92400e; border:1px solid #fbbf24; }

.status-pending { color:#f59e0b; font-weight:600; }
.status-approved, .status-finance_approved { color:#10b981; font-weight:600; }
.status-rejected { color:#ef4444; font-weight:600; }
.status-completed { color:#3b82f6; font-weight:600; }
.status-draft { color:#7c8ba0; }
.danger { color:#ef4444; font-weight:600; }
.good { color:#10b981; }

.kanban-filters { display:flex; gap:16px; flex-wrap:wrap; align-items:flex-end; }
.kanban-filters label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:#3c4b60; font-weight:500; }
.kanban-table th, .kanban-table td { white-space:nowrap; }

.sub-tab-bar { display:flex; gap:6px; margin-bottom:20px; border-bottom:2px solid #c8d6e5; padding-bottom:0; }
.sub-tab { padding:9px 24px; border:none; border-radius:8px 8px 0 0; background:transparent; color:#5c6b7d; font-size:14px; font-weight:500; cursor:pointer; transition:all 0.2s; }
.sub-tab:hover { color:#3b82f6; background:rgba(59,130,246,0.04); }
.sub-tab.active { color:#2563eb; background:rgba(59,130,246,0.06); border-bottom:2px solid #3b82f6; margin-bottom:-2px; font-weight:600; }
.app-workflow-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:22px; align-items:start; }
.app-workflow-main { min-width:0; }
@media (max-width: 780px) {
  .app-workflow-layout { grid-template-columns:1fr; }
}

.wh-sub-nav { display:flex; gap:10px; margin-bottom:24px; flex-wrap:wrap; }
.wh-nav-btn { padding:11px 24px; border:1px solid #c8d6e5; border-radius:12px; background:#fff; color:#3c4b60; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; white-space:nowrap; }
.wh-nav-btn:hover { border-color:#3b82f6; color:#3b82f6; background:#eff6ff; transform:translateY(-2px); box-shadow:0 4px 14px rgba(59,130,246,0.15); }
.wh-nav-btn.active { border-color:#3b82f6; background:linear-gradient(135deg,#3b82f6,#2563eb); color:#fff; box-shadow:0 4px 16px rgba(59,130,246,0.3); }
.wh-nav-btn.active:hover { transform:none; }

.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.section-header h2 { margin-bottom:0 !important; }
.section-header-actions { display:flex; gap:10px; flex-wrap:wrap; }

.settings-section { margin-bottom:28px; }
.settings-form { display:flex; gap:10px; align-items:flex-end; }
.settings-form input { flex:1; }
.settings-time-grid { display:grid; grid-template-columns:minmax(180px, 1fr) minmax(180px, 1fr) auto; gap:14px; align-items:end; }
.settings-time-grid label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:700; color:#3c4b60; }
.settings-time-actions { display:flex; gap:10px; flex-wrap:wrap; }
.settings-time-status { margin-top:16px; display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; padding:14px; border:1px solid #dbeafe; border-radius:12px; background:#f8fbff; color:#334155; font-size:13px; }
.settings-time-status strong { color:#172554; }
.settings-time-note { margin-top:10px; color:#64748b; font-size:12px; line-height:1.7; }
@media (max-width: 900px) { .settings-time-grid { grid-template-columns:1fr; } }
.inline-form { display:flex; gap:10px; align-items:flex-end; margin-bottom:14px; }
.inline-form input { flex:1; }
.sub-card { border:1px solid rgba(59,130,246,0.1); border-radius:10px; padding:18px; margin-bottom:14px; background:#fafcff; }

.permission-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:10px; }
.permission-row { display:flex; align-items:center; gap:10px; padding:7px 0; font-size:13px; }
.permission-group { font-weight:600; color:#3c4b60; margin-top:10px; font-size:14px; }


.pr-progress { display:flex; align-items:center; gap:6px; margin:10px 0; }
.pr-progress .step-dot { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff; background:#c8d6e5; font-weight:600; }
.pr-progress .step-dot.done { background:#10b981; }
.pr-progress .step-dot.current { background:#3b82f6; box-shadow:0 0 0 4px rgba(59,130,246,0.2); }
.pr-progress .step-line { flex:1; height:2px; background:#c8d6e5; }
.pr-progress .step-line.done { background:#10b981; }

#prDetailModal .modal { max-width:640px; }
#prDetailModal table { margin-bottom:0; }

.movements-filters label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:#3c4b60; font-weight:500; }

.pagination-bar { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:16px; padding:8px 0; flex-wrap:wrap; font-size:13px; }
.pagination-bar .page-btn { min-width:32px; height:32px; padding:0 10px; border:1px solid #c8d6e5; border-radius:8px; background:#fff; color:#3c4b60; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.15s; display:inline-flex; align-items:center; justify-content:center; }
.pagination-bar .page-btn:hover { border-color:#3b82f6; color:#3b82f6; background:#eff6ff; }
.pagination-bar .page-btn.active { background:#3b82f6; color:#fff; border-color:#3b82f6; font-weight:600; box-shadow:0 2px 8px rgba(59,130,246,0.25); }
.pagination-bar .page-btn:disabled { opacity:0.3; cursor:default; pointer-events:none; }
.pagination-bar .page-info { font-size:13px; color:#7c8ba0; margin-left:10px; }
.pagination-row { display:none; }
.purchase-items-detail th,
.purchase-items-detail td { padding:8px 10px; border-bottom:1px solid #e6edf5; font-size:13px; text-align:left; }
.purchase-items-detail th { background:#f4f7fc; color:#1f2a44; font-weight:600; }
.detail-modal-overlay {
  z-index: 3200;
  padding: clamp(16px, 4vh, 40px) clamp(12px, 4vw, 48px);
  align-items: center;
  overflow: hidden;
}
.detail-modal-card {
  width: min(960px, calc(100vw - 32px));
  max-height: min(88vh, calc(100vh - 48px));
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
}
.pr-detail-card { max-width: 760px; }
.purchase-detail-card { max-width: 1040px; }
.detail-modal-card h2 {
  flex: 0 0 auto;
  margin-bottom: 16px;
}
.detail-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.detail-modal-footer {
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 14px;
  text-align: right;
  border-top: 1px solid rgba(109,93,252,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.96));
}
.pr-detail-table {
  width: 100%;
  min-width: 0;
}
.detail-modal-body .pr-detail-table,
.detail-modal-body .purchase-items-detail {
  table-layout: auto;
}
.detail-modal-body .pr-detail-table th,
.detail-modal-body .pr-detail-table td {
  word-break: break-word;
}
@media (max-width: 760px) {
  .detail-modal-overlay {
    padding: 10px;
    align-items: flex-start;
  }
  .detail-modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 18px;
    border-radius: 22px;
  }
  .detail-modal-body .pr-detail-table,
  .detail-modal-body .purchase-items-detail {
    min-width: 620px;
  }
}
.btn-save-purchase-items { background:#3b82f6; color:#fff; border:none; padding:6px 14px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:600; }
.btn-save-purchase-items:hover { background:#2563eb; }

.permission-modal-footer { display:flex; gap:10px; margin-top:18px; }
.permission-modal-footer button:not(.btn-secondary) { background:#3b82f6; color:#fff; border:none; padding:7px 18px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.2s; }
.permission-modal-footer button:not(.btn-secondary):hover { background:#2563eb; }
.permission-modal-footer .btn-secondary { background:#fff; color:#5c6b7d; border:1px solid #c8d6e5; padding:7px 18px; border-radius:8px; cursor:pointer; font-size:13px; transition:all 0.2s; }
.permission-modal-footer .btn-secondary:hover { background:#f4f8ff; border-color:#3b82f6; color:#3b82f6; }

/* ===== V6 入库单多商品行表格 ===== */
.inbound-header-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.inbound-header-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #3c4b60;
}
.inbound-header-row label input,
.inbound-header-row label select {
  padding: 8px 12px;
  border: 1px solid #c8d6e5;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.inbound-items-section {
  margin-bottom: 16px;
}
.inbound-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.inbound-items-header h3 {
  font-size: 14px;
  color: #1a2744;
  font-weight: 600;
}
.inbound-items-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,0.1);
}
.inbound-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.inbound-items-table th {
  background: #f4f8ff;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3c4b60;
  text-align: left;
  border-bottom: 1px solid #e8edf5;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.inbound-items-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
.inbound-items-table input,
.inbound-items-table select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #dde4f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.inbound-items-table input:focus,
.inbound-items-table select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.inbound-items-table .inbound-item-amount {
  display: block;
  text-align: right;
  font-weight: 600;
  color: #1a73e8;
  padding: 5px 8px;
  font-size: 13px;
}
.inbound-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  padding: 14px 0;
  border-top: 2px solid #e8edf5;
}
.inbound-summary-left label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #3c4b60;
  font-weight: 500;
}
.inbound-summary-left input {
  padding: 8px 12px;
  border: 1px solid #c8d6e5;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.inbound-summary-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}
.inbound-summary-right .summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #3c4b60;
  gap: 8px;
}
.inbound-summary-right .summary-item.total {
  font-size: 16px;
  font-weight: 700;
  color: #1a2744;
  padding-top: 6px;
  border-top: 1px dashed #c8d6e5;
}
.inbound-summary-right .summary-item input {
  padding: 5px 8px;
  border: 1px solid #c8d6e5;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  text-align: right;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}
.btn-danger-sm {
  background: #fff;
  color: #e74c3c;
  border: 1px solid #f5c6cb;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-danger-sm:hover {
  background: #fef2f2;
  border-color: #e74c3c;
}

/* ===== 多选下拉框 ===== */
.multi-select { position:relative; min-width:220px; }
.multi-select-trigger {
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 12px; border:1px solid #b9c8dc; border-radius:12px;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  cursor:pointer; font-size:13px; min-width:220px;
  gap:10px; box-shadow:0 6px 18px rgba(37,99,235,0.08);
}
.multi-select-trigger:hover { border-color:#3b82f6; box-shadow:0 8px 22px rgba(37,99,235,0.14); }
.multi-select-trigger .arrow { font-size:10px; color:#64748b; }
.multi-select-dropdown {
  display:none; position:absolute; top:100%; left:0;
  background:#fff; border:1px solid #d8e1ef; border-radius:16px;
  box-shadow:0 18px 45px rgba(15,23,42,0.16); z-index:100;
  max-height:390px; overflow:hidden;
  margin-top:8px; min-width:360px;
}
.multi-select-dropdown.open { display:block; }
.multi-select-item {
  display:flex; align-items:center; gap:8px; padding:9px 11px;
  font-size:13px; cursor:pointer; white-space:nowrap;
  border:1px solid transparent; border-radius:12px;
  color:#24324b; transition:all .16s ease;
}
.multi-select-item:hover { background:#f3f7ff; border-color:#dbe8ff; }
.multi-select-item:has(input:checked) {
  background:linear-gradient(135deg,#eaf2ff 0%,#f7fbff 100%);
  border-color:#93c5fd; color:#1d4ed8; font-weight:700;
  box-shadow:0 6px 16px rgba(37,99,235,0.12);
}
.multi-select-item input[type="checkbox"] {
  width:16px; height:16px; margin:0; cursor:pointer; accent-color:#2563eb;
}

/* Search bar */
.ms-search { padding:12px; border-bottom:1px solid #edf2f7; background:#f8fbff; }
.ms-search input {
  width:100%; padding:9px 12px; border:1px solid #d8e1ef; border-radius:10px;
  font-size:13px; outline:none; background:#fff;
}
.ms-search input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.12); }

/* All checkbox row */
.ms-all { margin:10px 12px 8px; padding:10px 12px; font-weight:700; justify-content:center; }
.ms-all:hover { background:#eff6ff; }

/* Divider */
.ms-divider { height:1px; background:#edf2f7; margin:0 12px; }

/* Grid layout for user checkboxes */
.ms-grid {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px; max-height:230px; overflow-y:auto;
  padding:12px; scrollbar-width:thin; scrollbar-color:#94a3b8 #f1f5f9;
}
.ms-grid .multi-select-item { min-width:0; justify-content:flex-start; overflow:hidden; text-overflow:ellipsis; }
.ms-grid .multi-select-item input { flex:0 0 auto; }
.ms-grid .multi-select-item.hidden { display:none; }

/* Footer with confirm button */
.ms-footer {
  padding:10px 12px; border-top:1px solid #edf2f7;
  display:flex; justify-content:flex-end; background:#f8fbff;
}

/* ===== 用户头像下拉菜单 ===== */
.user-bar-wrap { display:flex; align-items:center; gap:10px; position:relative; }
.user-bar-name { color:#3c4b60; font-size:13px; font-weight:500; }
.user-avatar { cursor:pointer; position:relative; }
.user-avatar:hover { opacity:0.85; }
.user-dropdown {
  display:none; position:absolute; top:100%; right:0;
  background:#fff; border:1px solid #e0e5ec; border-radius:10px;
  box-shadow:0 6px 24px rgba(0,0,0,0.12); z-index:200;
  min-width:140px; padding:6px 0; margin-top:8px;
}
.user-dropdown.open { display:block; }
.user-dropdown-item {
  padding:8px 16px; font-size:13px; cursor:pointer; color:#2c3d55;
  white-space:nowrap;
}
.user-dropdown-item:hover { background:#f0f4ff; }
.user-dropdown-divider { height:1px; background:#f0f0f0; margin:4px 0; }

/* Footer with confirm button */
.ms-footer {
  padding:8px 12px; border-top:1px solid #f0f0f0;
  display:flex; justify-content:flex-end;
}



/* Top-right user tools */
#userBar { margin-left:auto; position:relative; z-index:1900; }
.user-bar-wrap {
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  min-height:42px;
  padding:0 4px;
}
.todo-bell,
.topbar-more {
  border:0;
  background:transparent;
  color:#1f2a44;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  min-width:34px;
  border-radius:10px;
  position:relative;
  transition:background .18s ease, color .18s ease;
}
.todo-bell:hover,
.topbar-more:hover { background:#eef4ff; color:#2563eb; }
.todo-bell-icon { font-size:14px; line-height:1; }
.todo-badge {
  position:absolute;
  top:2px;
  right:0;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:10px;
  font-weight:800;
  line-height:16px;
  box-shadow:0 0 0 2px #fff;
}
.user-bar-name {
  color:#24324b;
  font-size:13px;
  font-weight:600;
  max-width:140px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.user-avatar {
  width:34px;
  height:34px;
  border-radius:999px;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#dbeafe;
  box-shadow:0 0 0 1px rgba(37,99,235,.12);
}
.topbar-avatar-img { width:34px; height:34px; border-radius:999px; object-fit:cover; display:block; }
.topbar-avatar-fallback {
  width:34px;
  height:34px;
  border-radius:999px;
  background:linear-gradient(135deg,#93c5fd,#3b82f6);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:800;
}
.topbar-more { font-size:20px; padding-bottom:2px; }
.user-dropdown { top:42px; right:0; }
@media (max-width: 720px) {
  .user-bar-name { display:none; }
  .user-bar-wrap { gap:6px; }
}

/* ===== Soft workspace theme override ===== */
:root {
  --xw-bg: #f7f1ff;
  --xw-bg-2: #eef7ff;
  --xw-ink: #20243a;
  --xw-muted: #778097;
  --xw-primary: #3b82f6;
  --xw-primary-2: #60a5fa;
  --xw-cyan: #4cc9f0;
  --xw-mint: #52d6b2;
  --xw-yellow: #ffd166;
  --xw-pink: #ff8fc7;
  --xw-card: rgba(255,255,255,.86);
  --xw-card-solid: #ffffff;
  --xw-border: rgba(109,93,252,.12);
  --xw-shadow: 0 24px 70px rgba(74,63,139,.14);
  --xw-shadow-soft: 0 14px 34px rgba(74,63,139,.10);
}

html {
  background:
    radial-gradient(circle at 8% 5%, rgba(255,143,199,.30), transparent 32%),
    radial-gradient(circle at 92% 0%, rgba(76,201,240,.28), transparent 30%),
    radial-gradient(circle at 78% 92%, rgba(82,214,178,.20), transparent 30%),
    linear-gradient(135deg, #fff7fb 0%, var(--xw-bg) 42%, var(--xw-bg-2) 100%);
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.92), transparent 20%),
    radial-gradient(circle at 70% 22%, rgba(255,255,255,.72), transparent 18%),
    transparent;
  color: var(--xw-ink);
  letter-spacing: .01em;
}

.app-layout {
  height: 100vh;
  padding: 26px;
  gap: 22px;
  background: transparent;
  box-sizing: border-box;
}

.sidebar {
  width: 218px;
  min-width: 218px;
  margin: 0;
  padding: 18px 12px;
  border: 1px solid rgba(255,255,255,.76);
  border-right: 1px solid rgba(255,255,255,.76);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.70));
  box-shadow: var(--xw-shadow);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.sidebar-header {
  padding: 12px 8px 18px;
  border-bottom: 0;
}

.sidebar-header h1 {
  position: relative;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-left: 0;
  color: var(--xw-ink);
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.sidebar-header h1::before {
  content: none;
}

.brand-logo {
  width: 154px;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: contain;
  object-position: center;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 24px rgba(20,184,166,.18);
  flex: 0 0 auto;
}

.sidebar-header h1 span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  gap: 8px;
  padding: 8px 2px;
}

.tab {
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 14px;
  color: #8a91a6;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.tab:hover {
  color: var(--xw-primary);
  background: rgba(109,93,252,.08);
  transform: translateX(2px);
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 58%, #38bdf8 100%);
  box-shadow: 0 16px 28px rgba(59,130,246,.28);
}

.nav-badge,
.alert-badge,
.todo-badge {
  background: linear-gradient(135deg, #ff6b8f, #ff9f7a);
  color: #fff;
  box-shadow: 0 7px 16px rgba(255,107,143,.26), 0 0 0 2px rgba(255,255,255,.86);
}

.tab.active .nav-badge,
.tab.active .alert-badge {
  background: rgba(255,255,255,.92);
  color: var(--xw-primary);
}

.main-area {
  min-width: 0;
  border-radius: 34px;
  background: rgba(255,255,255,.34);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.44);
  overflow: visible;
}

.main-area header {
  position: relative;
  z-index: 1800;
  margin: 0 0 18px;
  padding: 16px 22px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--xw-shadow-soft);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.main-area header h1 {
  color: var(--xw-ink);
  font-size: 21px;
  font-weight: 950;
  letter-spacing: .02em;
}

.main-area main {
  padding: 0 2px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(109,93,252,.38) transparent;
}

.card,
.report-shell,
.report-history-card,
.report-chart-panel,
.custom-single-report,
.single-report-section,
.single-report-head,
.custom-report-options,
.multi-select-dropdown,
.modal,
.modal-card {
  border: 1px solid rgba(255,255,255,.78);
  background: var(--xw-card);
  box-shadow: var(--xw-shadow-soft);
  backdrop-filter: blur(18px);
}

.card {
  position: relative;
  border-radius: 28px;
  padding: 26px;
  margin-bottom: 20px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 120px;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(109,93,252,.12), transparent 68%);
}

.card h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--xw-ink);
  font-size: 20px;
  font-weight: 950;
}

.card h2::before {
  content: "";
  width: 9px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--xw-primary), var(--xw-cyan));
  box-shadow: 0 7px 16px rgba(109,93,252,.20);
}

.card h3 {
  color: #343955;
  font-weight: 900;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.dashboard-grid .card,
.dashboard-grid > div,
.report-card {
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.68));
  box-shadow: 0 18px 38px rgba(74,63,139,.10);
}

input,
select,
textarea,
.grid-form label input,
.grid-form label select,
.custom-filter-grid input,
.custom-filter-grid select,
.custom-filter-grid .multi-select-trigger,
.multi-select-trigger,
.modal-body input,
.modal-body select {
  border-color: rgba(109,93,252,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  color: var(--xw-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

input:hover,
select:hover,
textarea:hover,
.multi-select-trigger:hover {
  border-color: rgba(109,93,252,.36);
}

input:focus,
select:focus,
textarea:focus,
.grid-form label input:focus,
.grid-form label select:focus,
.custom-filter-grid input:focus,
.custom-filter-grid select:focus,
.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--xw-primary);
  box-shadow: 0 0 0 4px rgba(109,93,252,.12);
}

.btn-primary,
.inline-form button[type="submit"],
.grid-form button[type="submit"],
.modal-actions button:first-child,
.wh-nav-btn.active,
.report-mode-btn.active,
.btn-report,
.btn-detail,
.btn-pay,
.btn-repay,
.btn-save-purchase-items {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--xw-primary), var(--xw-primary-2));
  color: #fff;
  box-shadow: 0 12px 24px rgba(109,93,252,.24);
}

.btn-primary:hover,
.inline-form button[type="submit"]:hover,
.grid-form button[type="submit"]:hover,
.modal-actions button:first-child:hover,
.btn-report:hover,
.btn-detail:hover,
.btn-pay:hover,
.btn-repay:hover,
.btn-save-purchase-items:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(109,93,252,.30);
}

.btn-secondary,
.wh-nav-btn,
.sub-tab,
.preset-chart-tool,
.preset-detail-btn,
.preset-chart-menu-btn,
.modal-actions .btn-secondary,
.user-bar button,
.todo-bell,
.topbar-more {
  border-radius: 14px;
  border-color: rgba(109,93,252,.15);
  background: rgba(255,255,255,.72);
  color: #555d75;
  box-shadow: 0 8px 18px rgba(74,63,139,.07);
}

.btn-secondary:hover,
.wh-nav-btn:hover,
.sub-tab:hover,
.preset-chart-tool:hover,
.preset-detail-btn:hover,
.preset-chart-menu-btn:hover,
.user-bar button:hover,
.todo-bell:hover,
.topbar-more:hover {
  border-color: rgba(109,93,252,.30);
  background: rgba(255,255,255,.95);
  color: var(--xw-primary);
}

.btn-approve,
.btn-pr-approve,
.btn-pay-expense,
.btn-loan-approve,
.btn-loan-pay {
  border-radius: 14px;
  background: linear-gradient(135deg, #38cfa8, #27b6d6);
  box-shadow: 0 10px 22px rgba(56,207,168,.22);
}

.btn-reject,
.btn-pr-reject,
.btn-loan-reject,
.btn-del,
.btn-danger-sm {
  border-radius: 14px;
  background: linear-gradient(135deg, #ff6b8f, #ff8a65);
  box-shadow: 0 10px 22px rgba(255,107,143,.22);
}

.btn-edit,
.btn-edit-warehouse,
.btn-outbound {
  border-radius: 14px;
  background: linear-gradient(135deg, #ffc45f, #ff9f43);
  box-shadow: 0 10px 22px rgba(255,159,67,.20);
}

.table-wrap,
.report-table-wrap,
.preset-chart-table,
.trend-chart-frame,
.expense-items-table-wrap,
.inbound-items-table-wrap {
  border: 1px solid rgba(109,93,252,.10);
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

table {
  color: #32384f;
}

th,
.preset-chart-table th,
.preset-detail-table th,
.expense-items-table th,
.inbound-items-table th,
.kanban-table th {
  background: linear-gradient(180deg, #fbfaff 0%, #f2f0ff 100%);
  color: #596078;
  font-weight: 900;
  border-bottom-color: rgba(109,93,252,.10);
}

td,
.preset-chart-table td,
.preset-detail-table td,
.expense-items-table td,
.inbound-items-table td {
  border-bottom-color: rgba(109,93,252,.08);
}

tr:hover td {
  background: rgba(109,93,252,.045);
}

.sub-tab-bar {
  gap: 8px;
  padding: 6px;
  border: 0;
  border-radius: 18px;
  background: rgba(255,255,255,.60);
  box-shadow: inset 0 0 0 1px rgba(109,93,252,.08);
}

.sub-tab {
  border: 0;
  border-radius: 14px;
  margin-bottom: 0;
  padding: 10px 18px;
}

.sub-tab.active {
  border: 0;
  margin-bottom: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--xw-primary), var(--xw-primary-2));
  box-shadow: 0 10px 22px rgba(109,93,252,.20);
}

.report-mode-header {
  display: flex;
  justify-content: center;
  grid-template-columns: none;
  padding: 6px 2px 22px;
  margin-bottom: 0;
}

.report-mode-switch {
  border: 1px solid rgba(109,93,252,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.70);
  box-shadow: 0 14px 32px rgba(74,63,139,.10);
}

.report-mode-btn {
  border-radius: 13px;
  color: #62697f;
}

.report-mode-title-spacer {
  display: none;
}

.preset-toolbar-title {
  display: block;
  width: 100%;
  box-sizing: border-box;
  justify-self: stretch;
  margin: 0 0 24px;
  padding: 14px 22px;
  border-radius: 999px;
  text-align: left;
  box-shadow: 0 18px 42px rgba(59,130,246,.10);
}

.preset-toolbar-title::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 24px;
  margin-right: 10px;
  border-radius: 999px;
  vertical-align: -5px;
  background: linear-gradient(180deg, var(--xw-primary), var(--xw-cyan));
  box-shadow: 0 8px 18px rgba(59,130,246,.22);
}

.preset-toolbar {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.preset-report-board {
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.70), transparent 26%),
    linear-gradient(145deg, rgba(255,255,255,.78), rgba(237,240,255,.68));
  color: var(--xw-ink);
  box-shadow: var(--xw-shadow);
}

.preset-chart-card {
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 18px 42px rgba(74,63,139,.11);
}

.preset-chart-card h3,
.single-report-section h4,
.single-report-head h3 {
  color: var(--xw-ink);
}

.preset-month-bar-fill,
.report-bar-fill {
  background: linear-gradient(180deg, var(--xw-primary), var(--xw-cyan));
}

.preset-line-chart svg,
.trend-chart-svg {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.user-avatar,
.topbar-avatar-fallback,
.topbar-avatar-img {
  width: 38px;
  height: 38px;
}

.user-avatar {
  border: 2px solid rgba(255,255,255,.92);
  background: linear-gradient(135deg, #fff06a, #ff8fc7);
  box-shadow: 0 12px 24px rgba(109,93,252,.15);
}

.topbar-avatar-fallback {
  background: linear-gradient(135deg, var(--xw-primary), var(--xw-cyan));
}

.user-dropdown {
  z-index: 2600;
  border: 1px solid rgba(109,93,252,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 22px 46px rgba(74,63,139,.16);
}

.user-dropdown-item:hover {
  background: rgba(109,93,252,.08);
  color: var(--xw-primary);
}

.modal-overlay {
  background: rgba(41,38,75,.24);
  backdrop-filter: blur(8px);
}

.modal,
.modal-card {
  border-radius: 28px;
}

.modal-close {
  background: rgba(109,93,252,.10);
  color: var(--xw-primary);
}

.multi-select-dropdown {
  border-radius: 22px;
}

.multi-select-item {
  border-radius: 14px;
}

.multi-select-item:hover,
.multi-select-item:has(input:checked) {
  background: rgba(109,93,252,.08);
  border-color: rgba(109,93,252,.18);
  color: var(--xw-primary);
}

@media (max-width: 900px) {
  .app-layout {
    padding: 12px;
    gap: 12px;
  }

  .sidebar {
    width: 74px;
    min-width: 74px;
    padding: 12px 8px;
    border-radius: 24px;
  }

  .sidebar-header {
    padding: 10px 0 12px;
  }

  .sidebar-header h1 {
    min-height: 42px;
    padding-left: 0;
    font-size: 0;
    justify-content: center;
  }

  .sidebar-header h1 span {
    display: none;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    object-position: center 42%;
  }

  .tab {
    justify-content: center;
    padding: 11px 8px;
    font-size: 0;
  }

  .tab .nav-badge,
  .tab .alert-badge {
    position: absolute;
    right: 6px;
    top: 4px;
    font-size: 10px;
  }

  .main-area header {
    padding: 13px 14px;
    border-radius: 22px;
  }

  .main-area header h1 {
    font-size: 17px;
  }

  .card {
    padding: 18px;
    border-radius: 24px;
  }
}

@media (max-width: 720px) {
  .app-layout {
    padding: 8px;
  }

  .main-area {
    border-radius: 24px;
  }

  .main-area header {
    margin-bottom: 12px;
  }

  .dashboard-grid,
  .single-report-grid {
    grid-template-columns: 1fr;
  }

  .report-mode-header {
    padding-bottom: 14px;
  }

  .report-mode-switch {
    width: 100%;
    overflow-x: auto;
  }

  .report-mode-btn {
    flex: 1 0 auto;
    white-space: nowrap;
  }

  .preset-toolbar-title {
    white-space: normal;
    border-radius: 22px;
    font-size: 17px;
  }
}
