/* ==========================================================================
   采供云 · UI 主题（Element UI 设计语言）
   在 Bootstrap 5 之上做视觉层覆盖，不改动任何业务标记与表单字段。
   ========================================================================== */

:root {
  --brand: #2f6bff;
  --brand-600: #1d4ed8;
  --brand-50: #eef4ff;
  --violet: #7c5cfc;
  --cyan: #06b6d4;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e9eef6;
  --line-strong: #dfe7f3;
  --surface: #ffffff;
  --bg: #f4f6fb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -18px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* 兼容 base.html 旧变量 */
  --primary-color: #0f172a;
  --secondary-color: #2f6bff;
  --accent-color: #7c5cfc;
  --surface-color: #ffffff;
  --bg-color: #f4f6fb;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e9eef6;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .16s ease; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 600; }
code {
  background: rgba(47, 107, 255, .07);
  color: var(--brand-600);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .88em;
  font-weight: 500;
}
::selection { background: rgba(47, 107, 255, .18); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================ 应用骨架 ============================ */
.app-shell { min-height: 100vh; }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  z-index: 1030;
  color: #cbd5e1;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(47, 107, 255, .24) 0%, transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #101b30 100%);
  border-right: 1px solid rgba(148, 163, 184, .08);
}
.app-sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px; color: #fff;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(135deg, #3b82f6, #7c5cfc);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 10px 22px -8px rgba(59, 130, 246, .8), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-text b { display: block; font-size: 16px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.brand-text small {
  display: block; color: #6b7c99; font-size: 9.5px; letter-spacing: .14em; margin-top: 2px;
}

.side-org {
  display: flex; align-items: center; gap: 9px;
  margin: 0 12px 8px; padding: 9px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, .07);
  border: 1px solid rgba(148, 163, 184, .1);
  color: #e2e8f0;
}
.side-org:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.org-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(135deg, #2563eb, #7c5cfc); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.org-meta { min-width: 0; flex: 1; }
.org-meta b {
  display: block; color: #e2e8f0; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 128px;
}
.org-meta small { display: block; color: #6b7c99; font-size: 10px; margin-top: 1px; }
.side-org > i { color: #5a6b87; font-size: 11px; }

.side-nav {
  flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 12px;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.2) transparent;
}
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .18); border-radius: 4px; }
.side-group {
  padding: 11px 22px 5px;
  font-size: 10px; font-weight: 600; letter-spacing: .14em;
  color: #5a6b87; text-transform: uppercase;
}
.side-item {
  display: flex; align-items: center; gap: 11px;
  height: 36px; margin: 2px 12px; padding: 0 12px;
  border-radius: 9px; color: #a9b6ca; font-size: 13.5px;
  position: relative; transition: background .16s ease, color .16s ease;
}
.side-item i { font-size: 16px; width: 18px; text-align: center; color: #7d8da6; transition: color .16s; }
.side-item:hover { background: rgba(148, 163, 184, .08); color: #fff; }
.side-item:hover i { color: #c7d2fe; }
.side-item.active {
  background: linear-gradient(90deg, rgba(47, 107, 255, .26), rgba(47, 107, 255, .08));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .18);
}
.side-item.active i { color: #93b4ff; }
.side-item.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0; background: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, .8);
}

.side-foot { flex: 0 0 auto; padding: 12px; border-top: 1px solid rgba(148, 163, 184, .1); }
.side-help {
  display: none;
  border-radius: 11px; padding: 12px; margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(47, 107, 255, .16), rgba(124, 92, 252, .12));
  border: 1px solid rgba(96, 165, 250, .16);
}
@media (min-height: 1050px) { .side-help { display: block; } }
.side-help-title { color: #e2e8f0; font-size: 12.5px; font-weight: 600; }
.side-help-desc { color: #8ea1bd; font-size: 11px; margin-top: 2px; line-height: 1.5; }
.side-help-link { color: #93c5fd; font-size: 11.5px; margin-top: 8px; display: inline-flex; gap: 4px; }
.side-help-link:hover { color: #bfdbfe; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px; color: inherit; }
.side-user:hover { background: rgba(148,163,184,.08); color: inherit; }
.side-user-name { color: #e2e8f0; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.side-user-role { color: #7186a3; font-size: 10.5px; }

.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #3b5bdb; font-weight: 700; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e0e7ff;
}
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }

.app-main { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }

/* ============================ 顶栏 ============================ */
.app-topbar {
  height: 64px; position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.crumb .sep { color: #cbd5e1; }
.crumb b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.top-search { position: relative; width: 280px; margin-left: 8px; }
.top-search i { position: absolute; left: 13px; top: 10px; color: var(--faint); font-size: 13px; }
.top-search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  border: 1px solid transparent; border-radius: 9px; background: #f5f7fc;
  font-size: 12.5px; color: var(--ink); outline: none;
}
.top-search input::placeholder { color: var(--faint); }
.top-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; border: none; border-radius: 9px; background: transparent;
  color: #64748b; display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; position: relative;
}
.icon-btn:hover { background: #f1f5fb; color: var(--ink); }
.icon-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }
.top-divider { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px;
  border-radius: 10px; color: inherit;
}
.user-chip:hover { background: #f5f7fc; color: inherit; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.user-role { font-size: 10.5px; color: var(--faint); }
.mobile-brand { display: none; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 14px; }

.app-content { padding: 26px 28px 44px; max-width: none; width: 100%; }
.messages-container { margin-bottom: 16px; }

/* ============================ 标题 / 页面 ============================ */
.page-title {
  font-size: 23px; font-weight: 700; color: var(--ink);
  letter-spacing: -.02em; display: flex; align-items: center; gap: 9px;
  margin-bottom: 0; line-height: 1.3;
}
.page-title i { color: var(--brand); font-size: 20px; }
.app-content h1.page-title { margin-top: 0; }
.app-content > .d-flex:first-child { gap: 16px; }
.text-muted { color: var(--muted) !important; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 13.5px; color: var(--ink);
  padding: 14px 18px;
}
.card-header i { color: var(--brand); }
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0 !important; }
.card-footer { background: #fff; border-top: 1px solid var(--line); padding: 13px 18px; }
.app-content > .card, .app-content .card.mb-3 { margin-bottom: 16px; }

/* 旧版统计卡片（card.text-center） */
.card.text-center { border-radius: var(--radius); }
.card.text-center .card-body { padding: 18px 14px; }
.card.text-center .card-body .fs-4,
.card.text-center .card-body .h5,
.card.text-center .card-body .display-6 {
  font-weight: 700; color: var(--ink); letter-spacing: -.02em;
}
.card.text-center .card-body .small.text-muted { color: var(--faint) !important; font-weight: 500; }

/* ============================ 工作台 ============================ */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: 24px 26px; margin-bottom: 16px; color: #fff;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(124,92,252,.55), transparent 58%),
    radial-gradient(60% 80% at 0% 100%, rgba(6,182,212,.25), transparent 60%),
    linear-gradient(120deg, #101c34 0%, #17356e 55%, #2f6bff 140%);
  box-shadow: 0 20px 40px -28px rgba(23, 53, 110, .9);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -110px; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(124,92,252,.5), transparent 68%);
}
.hero-body { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #93b4ff; font-weight: 600; }
.hero-title { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; color: #fff; }
.hero-sub { color: #b9c8e6; font-size: 12.5px; margin-top: 5px; }
.hero-metrics { display: flex; gap: 34px; }
.hero-metric .k { font-size: 11px; color: #93a9cf; }
.hero-metric .v { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; color: #fff; }
.hero-metric .v small { font-size: 11.5px; color: #b9c8e6; font-weight: 500; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; }
.hero-actions .btn { border-radius: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; color: inherit; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tone-primary, .tone-blue { background: #eef4ff; color: #2f6bff; }
.tone-warning, .tone-amber { background: #fff7e8; color: #d97706; }
.tone-danger, .tone-rose { background: #fff0f2; color: #e11d48; }
.tone-success, .tone-green { background: #eaf9f0; color: #16a34a; }
.tone-info, .tone-cyan { background: #e7f8fb; color: #0e7490; }
.tone-violet { background: #f3efff; color: #7c5cfc; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-foot { margin-top: 7px; color: var(--faint); font-size: 11.5px; }
.stat-arrow { color: #cbd5e1; font-size: 12px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-row {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: 10px; color: inherit; background: #fff;
  transition: all .16s ease;
}
.todo-row:hover { border-color: #c7d7ff; background: #fbfdff; color: inherit; }
.todo-row .todo-ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.todo-row .todo-title { font-size: 12.5px; color: var(--muted); }
.todo-row .todo-num { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.todo-row .todo-arrow { margin-left: auto; color: #cbd5e1; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-item {
  display: flex; align-items: center; gap: 9px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 12.5px;
  background: #fff; transition: all .16s ease;
}
.quick-item:hover { border-color: var(--brand-50); background: #fbfdff; color: var(--ink); transform: translateY(-1px); }
.quick-item i { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #eef4ff; color: var(--brand); font-size: 14px; }
.quick-item small { display: block; color: var(--faint); font-size: 10.5px; margin-top: 1px; }

/* ============================ 表单 ============================ */
.form-label { font-size: 12.5px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 13px; color: var(--ink); padding: .45rem .7rem; min-height: 38px;
  background-color: #fff;
}
.form-control-sm, .form-select-sm { min-height: 32px; padding: .3rem .6rem; font-size: 12.5px; border-radius: 7px; }
.form-control:hover, .form-select:hover { border-color: #c3d2ee; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
.form-control::placeholder { color: var(--faint); }
textarea.form-control { min-height: 80px; }
.input-group-text { background: #f8fafd; border-color: var(--line-strong); color: var(--faint); border-radius: 8px; }
.input-group > .form-control, .input-group > .form-select { border-radius: 8px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-text { font-size: 11.5px; color: var(--faint); }
.form-section-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 4px 0 14px; display: flex; align-items: center; gap: 7px; }
.form-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--brand); }

/* ============================ 按钮 ============================ */
.btn {
  border-radius: 8px; font-weight: 500; font-size: 13px; padding: .45rem .9rem;
  transition: all .16s ease;
}
.btn-sm { padding: .32rem .68rem; font-size: 12.5px; border-radius: 7px; }
.btn-lg { font-size: 14px; padding: .6rem 1.2rem; border-radius: 9px; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 6px 14px -8px rgba(47, 107, 255, .85);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background: #245ae6 !important; border-color: #245ae6 !important; color: #fff;
}
.btn-outline-primary { color: var(--brand); border-color: #cddcff; background: #fff; }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -10px rgba(47,107,255,.9); }
.btn-outline-secondary { color: #475569; border-color: var(--line-strong); background: #fff; }
.btn-outline-secondary:hover { background: #f5f8fd; border-color: #c3d2ee; color: var(--ink); }
.btn-outline-success { color: #15803d; border-color: #bbf7d0; background: #fff; }
.btn-outline-success:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-outline-danger { color: #be123c; border-color: #fecdd3; background: #fff; }
.btn-outline-danger:hover { background: #e11d48; border-color: #e11d48; color: #fff; }
.btn-outline-warning { color: #b45309; border-color: #fde68a; background: #fff; }
.btn-outline-warning:hover { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-outline-info { color: #0e7490; border-color: #a5f3fc; background: #fff; }
.btn-light { background: #f5f7fc; border-color: #eef2f8; color: #475569; }
.btn-light:hover { background: #eef2f8; color: var(--ink); }
.btn-secondary { background: #64748b; border-color: #64748b; }
.btn-danger { background: #e11d48; border-color: #e11d48; }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-link { color: var(--brand); text-decoration: none; }
.btn-group-sm > .btn, .btn-sm { line-height: 1.4; }
td .btn + .btn { margin-left: 4px; }

/* ============================ 表格 ============================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  margin-bottom: 0;
  font-size: 12.5px;
  vertical-align: middle;
}
.table > :not(caption) > * > * {
  padding: 9px 10px;
  border-bottom-color: #f1f5fb;
  background-color: transparent;
  box-shadow: none;
}
.table > thead > tr > th {
  background: #f8fafd;
  color: #64748b; font-weight: 600; font-size: 11.5px;
  letter-spacing: .02em; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  padding: 8px 10px;
}
.table > tbody > tr > td { color: var(--text); }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f8fbff; background-color: #f8fbff; }
.table-responsive { border-radius: var(--radius); }
.table .fw-bold, .table .fw-semibold { color: var(--ink); }
.table td .small, .table td small { color: var(--faint); }
.table a:not(.btn) { color: var(--brand); font-weight: 500; }
.table a:not(.btn):hover { color: var(--brand-600); }
.table-light > :not(caption) > * > * { background: #f8fafd; }

/* ============================ 标签 / 徽章 ============================ */
.badge {
  font-weight: 500; font-size: 11.5px; padding: 4px 8px;
  border-radius: 6px; letter-spacing: .01em; vertical-align: 1px;
}
.badge.bg-primary { background: #eef4ff !important; color: #1d4ed8 !important; }
.badge.bg-success { background: #e9f9ef !important; color: #15803d !important; }
.badge.bg-warning { background: #fff7e6 !important; color: #b45309 !important; }
.badge.bg-danger { background: #ffeff2 !important; color: #be123c !important; }
.badge.bg-info { background: #e7f8fb !important; color: #0e7490 !important; }
.badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-light { background: #f8fafc !important; color: #64748b !important; border: 1px solid var(--line); }
.badge.bg-dark { background: #eef2f8 !important; color: #334155 !important; }
.badge.bg-primary-subtle { background: #eef4ff !important; color: #1d4ed8 !important; }
.badge.bg-success-subtle { background: #e9f9ef !important; color: #15803d !important; }
.badge.bg-warning-subtle { background: #fff7e6 !important; color: #b45309 !important; }
.badge.bg-danger-subtle { background: #ffeff2 !important; color: #be123c !important; }
.badge.bg-info-subtle { background: #e7f8fb !important; color: #0e7490 !important; }
.badge.bg-secondary-subtle { background: #f1f5f9 !important; color: #475569 !important; }
.status-badge { font-size: 11.5px; padding: 4px 8px; border-radius: 6px; }

/* ============================ 提示 / 弹窗 ============================ */
.alert {
  border: 1px solid transparent; border-radius: 10px;
  font-size: 12.5px; padding: 11px 14px; color: var(--text);
}
.alert-primary, .alert-info {
  background: #f4f8ff; border-color: #e0ebff; color: #1e40af;
}
.alert-success { background: #f4fcf7; border-color: #d9f2e3; color: #15803d; }
.alert-warning { background: #fffbf2; border-color: #ffedd0; color: #b45309; }
.alert-danger { background: #fff7f8; border-color: #ffe0e5; color: #be123c; }
.alert .btn-close { padding: 14px; font-size: 10px; }
.alert a { font-weight: 600; }

.modal-content { border: none; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line); padding: 18px 22px; }
.modal-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.modal-body { padding: 20px 22px; font-size: 13px; }
.modal-footer { border-top: 1px solid var(--line); padding: 13px 22px; }
.modal-backdrop.show { opacity: .45; }
.dropdown-menu {
  border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-md);
  padding: 6px; font-size: 12.5px;
}
.dropdown-item { border-radius: 7px; padding: 8px 11px; color: #475569; }
.dropdown-item:hover, .dropdown-item:focus { background: #f5f8fd; color: var(--ink); }
.dropdown-item i { color: var(--faint); margin-right: 6px; }
.dropdown-divider { border-color: var(--line); }

/* ============================ 其他既有组件 ============================ */
.empty-state { text-align: center; padding: 44px 20px; color: var(--faint); }
.empty-state i { font-size: 40px; opacity: .35; display: block; margin-bottom: 10px; }
.empty-state h5 { font-size: 14px; color: #475569; font-weight: 500; }
.empty-state p { font-size: 12px; margin: 0; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.info-item { padding: 4px 0; }
.info-item .label { font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.info-item .value { font-weight: 500; color: var(--ink); }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-actions .btn { flex: 1; min-width: 100px; }

.clickable-item { cursor: pointer; transition: background-color .15s ease; }
.clickable-item:hover { background-color: #f8fbff; }

/* 订单 / 发货 / 财务页内联的旧卡片 */
.card.border-primary, .card.border-success, .card.border-warning,
.card.border-danger, .card.border-info { border-width: 1px !important; }

/* 页头操作按钮组 */
.app-content .d-flex.justify-content-between.align-items-center.mb-3,
.app-content .d-flex.justify-content-between.align-items-center.mb-4 { gap: 14px; flex-wrap: wrap; }

/* ============================ 宽表：横向滚动 + 操作列吸附 ============================ */
.app-content .table-responsive { overflow-x: auto; scrollbar-width: thin; }
.app-content .table-responsive .table th,
.app-content .table-responsive .table td { white-space: nowrap; }
.app-content .table-responsive .table th:last-child,
.app-content .table-responsive .table td:last-child {
  position: sticky; right: 0; z-index: 2;
  background: #fff !important;
  box-shadow: -12px 0 16px -16px rgba(15, 23, 42, .45);
}
.app-content .table-responsive .table thead th:last-child { background: #f8fafd !important; }
.app-content .table-responsive .table tbody tr:hover td:last-child { background: #f8fbff !important; }

/* ============================ 登录 ============================ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 54px 60px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 90% at 100% 0%, rgba(124,92,252,.5), transparent 55%),
    radial-gradient(70% 70% at 0% 100%, rgba(6,182,212,.32), transparent 55%),
    linear-gradient(140deg, #0b1220 0%, #132a55 55%, #1e4bb8 120%);
}
.login-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(80% 60% at 50% 40%, #000, transparent 90%);
}
.login-brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.login-brand-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: .02em; color: #fff; line-height: 1.2; }
.login-brand-sub { display: block; font-size: 9.5px; letter-spacing: .14em; color: #7f96bd; margin-top: 2px; }
.login-hero { margin-top: auto; position: relative; z-index: 1; padding-bottom: 20px; }
.login-eyebrow { font-size: 10.5px; letter-spacing: .18em; color: #8fb0f0; font-weight: 600; text-transform: uppercase; }
.login-title { font-size: 40px; line-height: 1.22; font-weight: 700; letter-spacing: -.02em; margin-top: 14px; color: #fff; }
.login-title span { background: linear-gradient(90deg, #93c5fd, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: #a9bce0; font-size: 13.5px; margin-top: 14px; max-width: 430px; line-height: 1.8; }
.login-points { display: flex; gap: 28px; margin-top: 34px; }
.login-point .n { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.login-point .k { font-size: 11px; color: #8ea6cf; margin-top: 2px; }
.login-copy { position: relative; z-index: 1; font-size: 11px; color: #6b82a8; }
.login-card-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-card { width: 360px; max-width: 100%; }
.login-card h1 { font-size: 23px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.login-card .hint { color: var(--muted); font-size: 13px; margin-top: 7px; }
.login-form { margin-top: 26px; }
.login-field { position: relative; margin-bottom: 16px; }
.login-field > i {
  position: absolute; left: 14px; top: 13px; z-index: 2;
  color: var(--faint); font-size: 15px; pointer-events: none;
}
.login-field .form-control {
  height: 44px; border-radius: 10px; background: #f8fafd;
  border-color: #e6edf8; padding-left: 40px; font-size: 13.5px;
}
.login-field .form-control:focus { background: #fff; box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.login-card .btn-login {
  width: 100%; height: 44px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--brand); border-color: var(--brand); color: #fff; margin-top: 4px;
  box-shadow: 0 10px 22px -12px rgba(47,107,255,.9);
}
.login-card .btn-login:hover { background: #245ae6; border-color: #245ae6; }
.login-card .alert { font-size: 12px; margin-bottom: 14px; }
.login-foot { margin-top: 22px; text-align: center; color: var(--faint); font-size: 11.5px; }
.login-help { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 18px; font-size: 12px; color: var(--faint); }

/* ============================ 移动端 ============================ */
.m-small-hide { }
@media (max-width: 991.98px) {
  .app-sidebar { display: none; }
  .app-main { margin-left: 0; }
  .app-topbar {
    height: 58px; padding: 0 14px; gap: 10px;
    background: rgba(255,255,255,.95);
  }
  .mobile-brand { display: flex; }
  .crumb, .top-search, .top-actions > .dropdown,
  .top-actions > .icon-btn[title="帮助"], .top-divider { display: none; }
  .top-actions { gap: 2px; }
  .icon-btn[title="消息"] { display: none; }
  .user-chip { padding: 2px; }
  .user-chip .user-name, .user-chip .user-role { display: none; }
  .app-content { padding: 16px 14px 86px; }
  .app-content > .d-flex:first-child { gap: 10px; }
  .page-title { font-size: 19px; }
  .stat-grid, .dash-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .hero-body { align-items: flex-start; }
  .hero-title { font-size: 20px; }
  .hero-metrics { gap: 24px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  .table > :not(caption) > * > * { padding: 10px 10px; }
  .mobile-nav { display: block; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-card-wrap { min-height: 100vh; padding: 64px 24px 40px; align-items: flex-start; }
}

/* 底部导航（保持旧 class，重绘外观） */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav .nav { display: flex; height: 62px; }
.mobile-nav .nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #94a3b8; font-size: 10px; padding: 0;
}
.mobile-nav .nav-link i { font-size: 19px; line-height: 1; }
.mobile-nav .nav-link.active { color: var(--brand); font-weight: 600; }

/* 工作流 / 待办等旧组件轻量适配 */
.workflow-steps { padding-bottom: 4px; }
.next-action-card { border-radius: 10px; }
.tips-card .tips-list { line-height: 1.8; }


/* ============================ 个人中心页适配 ============================ */
.profile-header {
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(124,92,252,.45), transparent 60%),
    linear-gradient(120deg, #101c34 0%, #17356e 60%, #2f6bff 140%) !important;
  border-radius: var(--radius-lg) !important;
  margin: 0 0 20px 0 !important;
  padding: 38px 20px !important;
  box-shadow: 0 20px 40px -30px rgba(23, 53, 110, .9);
}
.profile-avatar {
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.stats-row {
  margin: 0 auto 20px !important;
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 18px 10px !important;
}
.stats-row .stat-item:not(:last-child) { border-right-color: var(--line) !important; }
.stats-row .stat-value { color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.stats-row .stat-label { color: var(--faint) !important; }
.menu-section { border: 1px solid var(--line); border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; }


/* 发货清单宽表：窄屏隐藏低优先级列，保留状态与操作 */
@media (max-width: 1600px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3),
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(10), .shipment-table td:nth-child(10),
  .shipment-table th:nth-child(14), .shipment-table td:nth-child(14) { display: none; }
}

/* 发货清单：压缩来源/操作列，避免横向溢出 */
.shipment-table { font-size: 12px; }
.shipment-table > :not(caption) > * > * { padding: 8px 7px; }
.shipment-table td:nth-child(4) .small { display: none; }
.shipment-table th:last-child,
.shipment-table td:last-child {
  white-space: normal !important;
  min-width: 96px;
  max-width: 120px;
}
.shipment-table td:last-child .btn { margin-bottom: 2px; padding: .22rem .42rem; }

/* 发货清单操作列：只保留图标，避免竖排 */
.shipment-table td:last-child .btn { font-size: 0; padding: .28rem .4rem; }
.shipment-table td:last-child .btn i { font-size: 12px; }

.shipment-table td:last-child .btn { padding: .2rem .34rem; }
.shipment-table td:last-child .btn + .btn { margin-left: 2px; }
.shipment-table td:last-child .btn i { font-size: 13px; }

@media (max-width: 991.98px) {
  .mobile-nav { display: block; }
}

/* 旧统计页的渐变图标改为浅色语义底 */
.stat-card .stat-icon.bg-warning-gradient { background: #fff7e8 !important; color: #d97706 !important; }
.stat-card .stat-icon.bg-success-gradient { background: #eaf9f0 !important; color: #16a34a !important; }
.stat-card .stat-icon.bg-danger-gradient { background: #fff0f2 !important; color: #e11d48 !important; }
.stat-card .stat-icon.bg-info-gradient { background: #e7f8fb !important; color: #0e7490 !important; }

/* 独立空状态卡片 */
.app-content > .empty-state {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* 收入统计页头统一为品牌色 */
.income-header {
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(124,92,252,.45), transparent 60%),
    linear-gradient(120deg, #101c34 0%, #17356e 60%, #2f6bff 140%) !important;
  border-radius: var(--radius-lg) !important;
  margin: 0 0 16px 0 !important;
  padding: 28px 28px !important;
}
.income-header h1 { color: #fff; font-size: 22px !important; }
.income-header .back-link { color: #a9bce0 !important; }
.main-stats-card {
  margin: 0 auto 20px !important;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
}

/* 移动端用户入口 */
.mobile-user { display: none !important; }
@media (max-width: 991.98px) {
  .mobile-user { display: inline-flex !important; margin-left: auto; }
  .mobile-user .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
}

/* 发货单付款宽表：窄屏隐藏开票细节与发货单数，保留付款动作 */
@media (max-width: 1600px) {
  .payable-table th:nth-child(7), .payable-table td:nth-child(7),
  .payable-table th:nth-child(8), .payable-table td:nth-child(8),
  .payable-table th:nth-child(12), .payable-table td:nth-child(12) { display: none; }
}

/* 移动端登录品牌 */
.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.login-mobile-brand b { display: block; font-size: 16px; color: var(--ink); line-height: 1.2; }
.login-mobile-brand small { display: block; font-size: 9px; letter-spacing: .14em; color: var(--faint); margin-top: 2px; }
@media (max-width: 991.98px) {
  .login-mobile-brand { display: flex; }
}

/* 宽屏下发货清单恢复完整信息，并放大操作图标 */
@media (min-width: 1601px) {
  .shipment-table { font-size: 13px; }
  .shipment-table > :not(caption) > * > * { padding: 9px 9px; }
  .shipment-table td:nth-child(4) .small { display: block; }
  .shipment-table th:last-child,
  .shipment-table td:last-child {
    min-width: 150px;
    max-width: 180px;
    white-space: normal !important;
  }
  .shipment-table td:last-child .btn { padding: .3rem .45rem; }
  .shipment-table td:last-child .btn i { font-size: 16px; }
  .shipment-table td:last-child .btn + .btn { margin-left: 4px; }
  .shipment-table td:last-child .btn { margin-bottom: 3px; }
}

/* 1601–2000 宽度：再隐藏商品数与创建时间，确保表格完整放下 */
@media (min-width: 1601px) {
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(14), .shipment-table td:nth-child(14) { display: none; }
}

/* 1920 及以上：放宽内容区，发货清单展示完整列 */
@media (min-width: 1920px) {
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(14), .shipment-table td:nth-child(14) { display: table-cell; }
}
@media (min-width: 1920px) {
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 146px; max-width: 146px; }
}

/* 发货清单 KPI 与 Tab */
.ship-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ship-stat {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.ship-stat-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.ship-stat-icon.blue { background: #eef4ff; color: #2f6bff; }
.ship-stat-icon.green { background: #eaf9f0; color: #16a34a; }
.ship-stat-icon.amber { background: #fff7e8; color: #d97706; }
.ship-stat-icon.violet { background: #f3efff; color: #7c5cfc; }
.ship-stat-k { font-size: 12px; color: var(--muted); }
.ship-stat-v { font-size: 21px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ship-stat-f { font-size: 11px; color: var(--faint); margin-top: 3px; }
.ship-tabs { border-bottom: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; width: max-content; gap: 2px; }
.ship-tabs .nav-link { border: none; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 500; padding: 7px 14px; }
.ship-tabs .nav-link.active { background: #eef4ff; color: #1d4ed8; font-weight: 600; }
.ship-tabs .nav-link:hover { color: var(--ink); }
@media (max-width: 768px) {
  .ship-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .ship-stat { padding: 13px; gap: 9px; }
  .ship-stat-icon { width: 32px; height: 32px; font-size: 15px; }
  .ship-stat-v { font-size: 17px; }
  .ship-tabs { width: 100%; overflow-x: auto; }
}

/* 超宽屏：操作按钮显示文字，避免只剩小图标 */
@media (min-width: 2200px) {
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 280px; max-width: 280px; }
  .shipment-table td:last-child .btn { font-size: 12.5px; padding: .32rem .55rem; white-space: nowrap; }
  .shipment-table td:last-child .btn i { font-size: 13px; }
  .shipment-table td:last-child .btn + .btn { margin-left: 4px; }
  .shipment-table td:last-child .action-label { display: inline; }
}
.shipment-table .action-label { display: none; }

/* ============================================================
   发货清单：按表格容器宽度自动适配（容器查询）
   ============================================================ */
.shipment-table-wrap { container-type: inline-size; }
.shipment-table .action-label { display: none; }
.shipment-table td:last-child .btn { white-space: nowrap; }

/* 窄容器：保留最关键列，图标按钮 */
@container (max-width: 1199px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3),
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(7), .shipment-table td:nth-child(7),
  .shipment-table th:nth-child(9), .shipment-table td:nth-child(9),
  .shipment-table th:nth-child(10), .shipment-table td:nth-child(10),
  .shipment-table th:nth-child(14), .shipment-table td:nth-child(14) { display: none !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 150px !important; max-width: 150px !important; }
}
/* 1200–1399 */
@container (min-width: 1200px) and (max-width: 1399px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3),
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(9), .shipment-table td:nth-child(9),
  .shipment-table th:nth-child(10), .shipment-table td:nth-child(10),
  .shipment-table th:nth-child(14), .shipment-table td:nth-child(14) { display: none !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 150px !important; max-width: 150px !important; }
}
/* 1400–1459：空间不足，仍隐藏差异；开始显示文字 */
@container (min-width: 1400px) and (max-width: 1459px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3),
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(9), .shipment-table td:nth-child(9),
  .shipment-table th:nth-child(10), .shipment-table td:nth-child(10) { display: none !important; }
  .shipment-table .action-label { display: inline !important; }
  .shipment-table td:last-child .btn { font-size: 12px !important; padding: .3rem .45rem !important; }
  .shipment-table td:last-child .btn i { font-size: 12px !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 190px !important; max-width: 190px !important; }
}
/* 1460–1649：隐藏供应商、商品数、收款金额 */
@container (min-width: 1460px) and (max-width: 1649px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3),
  .shipment-table th:nth-child(6), .shipment-table td:nth-child(6),
  .shipment-table th:nth-child(10), .shipment-table td:nth-child(10) { display: none !important; }
  .shipment-table .action-label { display: inline !important; }
  .shipment-table td:last-child .btn { font-size: 12px !important; padding: .3rem .45rem !important; }
  .shipment-table td:last-child .btn i { font-size: 12px !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 190px !important; max-width: 190px !important; }
}
/* 1650–1749：只隐藏供应商 */
@container (min-width: 1650px) and (max-width: 1749px) {
  .shipment-table th:nth-child(3), .shipment-table td:nth-child(3) { display: none !important; }
  .shipment-table .action-label { display: inline !important; }
  .shipment-table td:last-child .btn { font-size: 12px !important; padding: .3rem .45rem !important; }
  .shipment-table td:last-child .btn i { font-size: 12px !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 200px !important; max-width: 200px !important; }
}
/* 1750+：全部列 + 文字按钮 */
@container (min-width: 1750px) {
  .shipment-table .action-label { display: inline !important; }
  .shipment-table td:last-child .btn { font-size: 12.5px !important; padding: .32rem .55rem !important; }
  .shipment-table td:last-child .btn i { font-size: 13px !important; }
  .shipment-table th:last-child, .shipment-table td:last-child { min-width: 240px !important; max-width: 240px !important; }
}
