* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #1a1b1e;
  font-size: 14px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* 侧边栏 */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.logo {
  padding: 24px 20px;
  font-size: 20px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, #c63f68, #e8879e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar nav {
  flex: 1;
  padding: 16px 0;
}
.sidebar nav a {
  display: block;
  padding: 12px 24px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: .2s;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}
.sidebar nav a.active {
  color: #fff;
  background: rgba(198,63,104,.2);
  border-left-color: #c63f68;
}
/* 订单管理子菜单 */
.nav-group-title { position: relative; }
.nav-group-title .arrow { float: right; font-size: 10px; opacity: .6; margin-top: 4px; }
.nav-submenu { display: block; }
.nav-sub {
  display: block;
  padding: 8px 24px 8px 44px !important;
  font-size: 12.5px !important;
  color: rgba(255,255,255,.55) !important;
  border-left: 3px solid transparent !important;
}
.nav-sub:hover {
  color: #fff !important;
  background: rgba(255,255,255,.04) !important;
}
.nav-sub.active {
  color: #fff !important;
  background: rgba(198,63,104,.15) !important;
  border-left-color: #c63f68 !important;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.logout {
  color: rgba(255,255,255,.5);
  font-size: 13px;
}
.logout:hover { color: #e8879e; }

/* 主内容 */
.main {
  margin-left: 220px;
  min-height: 100vh;
  padding: 0;
}
.topbar {
  background: #fff;
  padding: 16px 28px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.admin-name { color: #888; font-size: 13px; }

/* 内容区 */
.main > .alert,
.main > .stats-grid,
.main > .row-2col,
.main > .card,
.main > .filter-bar,
.main > .stats-row {
  margin: 20px 28px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: #fff;
}
.stat-label { font-size: 13px; color: rgba(255,255,255,.9); margin-bottom: 8px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; }
.stat-blue { background: #3b82f6; }
.stat-green { background: #22c55e; }
.stat-purple { background: #8b5cf6; }
.stat-orange { background: #f97316; }
.stat-teal { background: #06b6d4; }
.stat-pink { background: #ec4899; }
.stat-gold { background: #f59e0b; }
.stat-red { background: #ef4444; }
.stat-dark { background: #475569; }
.stat-cyan { background: #0ea5e9; }

/* 两列 */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 16px; font-weight: 700; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  background: #f8f9fa;
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e8e8e8;
  white-space: nowrap;
}
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.table tbody tr:hover { background: #fafafa; }
.table-footer td {
  background: #f8f9fa;
  font-weight: 700;
  border-top: 2px solid #e8e8e8;
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #e0f2fe; color: #0891b2; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: .2s;
  text-align: center;
}
.btn-primary { background: linear-gradient(135deg, #c63f68, #e8879e); color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: #0891b2; color: #fff; }
.btn-info:hover { background: #0e7490; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: #fff; color: #555; border: 1px solid #ddd; }
.btn-outline:hover { border-color: #c63f68; color: #c63f68; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-form select, .filter-form input {
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.filter-form select:focus { border-color: #c63f68; }

/* 迷你统计 */
.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.mini-stat {
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fff;
  min-width: 140px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.mini-stat span { font-size: 12px; color: rgba(255,255,255,.9); font-weight: 500; }
.mini-stat strong { font-size: 24px; font-weight: 800; }

/* 统计卡片颜色 - 扁平饱和风格 */
.stat-blue { background: #3b82f6; }
.stat-green { background: #22c55e; }
.stat-orange { background: #f97316; }
.stat-purple { background: #8b5cf6; }
.stat-red { background: #ef4444; }
.stat-gold { background: #f59e0b; }
.stat-dark { background: #475569; }
.stat-pink { background: #ec4899; }
.stat-teal { background: #06b6d4; }
.stat-cyan { background: #0ea5e9; }

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.form-full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: #444; }
.form-group .required { color: #ef4444; }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: .2s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #c63f68;
  box-shadow: 0 0 0 3px rgba(198,63,104,.1);
}
.input-readonly { background: #f5f5f5; color: #c63f68; font-weight: 700; }
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* 提示 */
.alert {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

/* 操作列 */
.actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }

/* 文字颜色 */
.text-primary { color: #c63f68; }
.text-green { color: #16a34a; }
.text-orange { color: #f59e0b; }
.text-red { color: #dc2626; }
.text-muted { color: #999; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }

/* 信息框 */
.info-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px 20px;
  line-height: 2;
  color: #555;
}

/* 登录页 */
.login-body {
  background: linear-gradient(135deg, #1a1a2e 0%, #c63f68 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #c63f68, #e8879e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.login-sub {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 28px;
}
.login-box .form-group { margin-bottom: 16px; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .logo, .sidebar nav a span, .sidebar-footer { display: none; }
  .sidebar nav a { padding: 14px; text-align: center; font-size: 18px; }
  .main { margin-left: 60px; }
  .row-2col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main > * { margin: 12px 14px !important; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; }
}

/* 列表操作区内的行内 POST 表单（保持按钮横向排列） */
.actions .inline-form { display: inline-block; margin: 0 2px 0 0; }
.actions .inline-form button { cursor: pointer; }

/* ===== 应结算页 ===== */
.settle-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px;
  background:linear-gradient(135deg,#0ea5e9,#06b6d4); border-radius:14px; padding:22px 26px; margin-bottom:16px; color:#fff; }
.settle-title { font-size:18px; font-weight:700; }
.settle-sub { font-size:13px; opacity:.9; margin-top:6px; }
.settle-big { text-align:right; }
.settle-big-label { font-size:12px; opacity:.9; letter-spacing:1px; }
.settle-big-value { font-size:34px; font-weight:800; line-height:1.2; }
.settle-formula { background:#f0f9ff; border:1px solid #bae6fd; color:#0369a1; border-radius:10px;
  padding:12px 16px; font-size:13px; margin-bottom:16px; }
.settle-formula strong { font-size:15px; }
.stat-foot { font-size:12px; color:#94a3b8; margin-top:4px; }
.unit { font-size:11px; color:#94a3b8; }
.empty-hint { padding:50px 20px; text-align:center; color:#94a3b8; font-size:14px; }
.settle-note { background:#fafafa; border:1px solid #eee; border-radius:10px; padding:16px 20px;
  font-size:13px; color:#555; margin-top:16px; }
.settle-note ul { margin:8px 0 0; padding-left:20px; }
.settle-note li { margin:4px 0; line-height:1.7; }
.settle-tip { background:#fffbeb; border:1px solid #fde68a; color:#92400e; border-radius:8px;
  padding:10px 14px; font-size:12.5px; margin-top:12px; line-height:1.7; }
.mode-switch { display:inline-flex; border:1px solid #cbd5e1; border-radius:8px; overflow:hidden; }
.mode-btn { background:#fff; border:0; padding:6px 14px; font-size:13px; cursor:pointer; color:#475569; }
.mode-btn + .mode-btn { border-left:1px solid #cbd5e1; }
.mode-btn.active { background:#0ea5e9; color:#fff; font-weight:600; }
.mode-btn:hover:not(.active) { background:#f1f5f9; }
.mode-switch { display:inline-flex; border:1px solid #cbd5e1; border-radius:8px; overflow:hidden; }
.mode-btn { background:#fff; border:0; padding:6px 14px; font-size:13px; cursor:pointer; color:#475569; }
.mode-btn + .mode-btn { border-left:1px solid #cbd5e1; }
.mode-btn.active { background:#0ea5e9; color:#fff; font-weight:600; }
.mode-btn:hover:not(.active) { background:#f1f5f9; }

/* ===== 回收站 / 操作日志 ===== */
.modal-mask { position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:999;
  align-items:center; justify-content:center; padding:20px; }
.modal-box { background:#fff; border-radius:14px; padding:24px 26px; max-width:440px; width:100%;
  box-shadow:0 20px 50px rgba(0,0,0,.25); }
.modal-box h3 { margin:0 0 12px; font-size:17px; }
.modal-box p { margin:8px 0; font-size:13.5px; color:#475569; line-height:1.7; }
.modal-box code { background:#f1f5f9; padding:2px 6px; border-radius:4px; color:#0f172a; }

.pager { display:flex; align-items:center; gap:8px; padding:16px 0 4px; justify-content:center; flex-wrap:wrap; }
.pager-info { font-size:13px; color:#64748b; margin:0 6px; }

.row-warn { background:#fff7f7; }
.row-warn:hover { background:#fef2f2 !important; }

/* ===== 应结算页：勾选重算 ===== */
.pick-bar { display: flex; gap: 8px; align-items: center; }
.pick-row.is-off { opacity: .42; }
.pick-foot td { padding: 12px 16px; }
.pick-label { margin-right: 20px; color: #64748b; }
.pick-item { margin-right: 20px; color: #475569; }
.pick-item strong { font-size: 15px; }
.pick-total { padding-left: 16px; border-left: 2px solid #cbd5e1; }
.pick-total strong { font-size: 17px; }
