/* ============================================================
   多商户提醒工作台 · 蓝白商业风 UI 原型
   共享样式 — 所有页面引用此文件
   图标规范: 全部线性 SVG (fill:none; stroke:currentColor; stroke-width:1.8)
   ============================================================ */

:root {
  --bg: #f3f6fb;            /* 页面底色 */
  --surface: #ffffff;       /* 卡片/面板 */
  --surface2: #f8fafd;      /* 次级面板/表头 */
  --ink: #1e2a3a;           /* 主文字 */
  --muted: #7b8794;         /* 次要文字 */
  --rule: #e4e9f2;          /* 边框 */
  --accent: #2563eb;        /* 主色 */
  --accent-dark: #1d4ed8;   /* 主色深 */
  --accent-light: #eff4ff;  /* 主色浅底 */
  --accent2: #0891b2;       /* 辅助色(青) */
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --warn: #d97706;
  --warn-bg: #fff7e8;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff4ff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 42, 58, .04), 0 4px 16px rgba(37, 99, 235, .06);
  --sidebar-w: 236px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--rule);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 20;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; border-bottom: 1px solid var(--rule);
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), #4f8ef7);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
}
.logo-mark svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.logo-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }

.nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.nav-group {
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .08em; padding: 14px 10px 6px;
  display: flex; align-items: center; gap: 6px;
}
.nav-group .badge-admin {
  font-size: 10px; color: var(--accent); background: var(--accent-light);
  border: 1px solid #d5e3fd; padding: 0 6px; border-radius: 99px; letter-spacing: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0; border-radius: 8px;
  color: #4b5563; font-size: 13.5px; font-weight: 500;
  position: relative; transition: background .15s;
}
.nav-item:hover { background: var(--surface2); color: var(--ink); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .count {
  margin-left: auto; font-size: 11px; background: var(--surface2);
  border: 1px solid var(--rule); color: var(--muted);
  padding: 0 7px; border-radius: 99px;
}
.nav-item.active .count { background: #fff; color: var(--accent); border-color: #d5e3fd; }

.sidebar-foot { border-top: 1px solid var(--rule); padding: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.user-card:hover { background: var(--surface2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #4f8ef7, var(--accent2));
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.user-meta { line-height: 1.3; min-width: 0; }
.user-meta .name { font-size: 13px; font-weight: 600; }
.user-meta .role { font-size: 11px; color: var(--muted); }

/* ---------- 主区 ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--ink); font-weight: 600; font-size: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--rule);
  border-radius: 8px; padding: 7px 12px; width: 240px; color: var(--muted);
}
.search-box input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; color: var(--ink); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--muted); display: grid; place-items: center;
  position: relative; cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: #c7d9fb; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}

.content { padding: 24px; max-width: 1440px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--rule);
}
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
}
.stat .s-icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none;
}
.stat .s-icon svg { width: 21px; height: 21px; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.s-blue  { background: var(--accent-light); color: var(--accent); }
.s-cyan  { background: #e6f7fb; color: var(--accent2); }
.s-green { background: var(--success-bg); color: var(--success); }
.s-amber { background: var(--warn-bg); color: var(--warn); }
.stat .s-label { font-size: 12.5px; color: var(--muted); }
.stat .s-value { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.stat .s-trend { font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.trend-up { color: var(--success); } .trend-down { color: var(--danger); } .trend-flat { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #c7d9fb; color: var(--accent); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #f3c6c6; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-link { border: 0; background: none; color: var(--accent); height: auto; padding: 2px 4px; font-size: 13px; }
.btn-link:hover { color: var(--accent-dark); text-decoration: none; }
.btn-link.danger { color: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
  background: var(--surface2); padding: 11px 16px; white-space: nowrap;
  border-bottom: 1px solid var(--rule);
}
.data td { padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #f9fbfe; }
.data .cell-main { font-weight: 600; color: var(--ink); }
.data .cell-sub { font-size: 12px; color: var(--muted); }
.data .ops { display: flex; gap: 4px; align-items: center; }

/* 状态徽标 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { color: var(--success); background: var(--success-bg); border-color: #c9efd8; }
.pill-warn    { color: var(--warn);    background: var(--warn-bg);    border-color: #f5e0bd; }
.pill-danger  { color: var(--danger);  background: var(--danger-bg);  border-color: #f6cdcd; }
.pill-info    { color: var(--info);    background: var(--info-bg);    border-color: #d5e3fd; }
.pill-muted   { color: var(--muted);   background: var(--surface2);   border-color: var(--rule); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 2px 9px; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--surface2); color: #4b5563; white-space: nowrap;
}
.tag svg { width: 13px; height: 13px; }
.tag-sms   { color: var(--accent); background: var(--accent-light); border-color: #d5e3fd; }
.tag-email { color: var(--accent2); background: #e6f7fb; border-color: #c8ecf3; }

/* 开关 */
.switch { width: 40px; height: 22px; border-radius: 99px; background: #d4dae3; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 20px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--rule); border-radius: 8px;
  padding: 9px 12px; font-size: 13.5px; color: var(--ink);
  background: var(--surface); outline: none; transition: border .15s, box-shadow .15s;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.input-group { position: relative; }
.input-group .prefix-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-group .input { padding-left: 36px; }
.textarea { min-height: 96px; resize: vertical; }
.input[readonly] { background: var(--surface2); color: var(--muted); }

.radio-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card {
  flex: 1; min-width: 150px; border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center;
  transition: all .15s; background: var(--surface);
}
.radio-card .rc-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.radio-card .rc-title { font-size: 13.5px; font-weight: 600; }
.radio-card .rc-sub { font-size: 11.5px; color: var(--muted); }
.radio-card.selected { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.radio-card .rc-check { margin-left: auto; color: var(--accent); display: none; }
.radio-card.selected .rc-check { display: block; }

/* ---------- 筛选栏 / 标签页 ---------- */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; background: var(--surface2); border: 1px solid var(--rule); padding: 4px; border-radius: 9px; }
.tab { padding: 6px 14px; font-size: 13px; border-radius: 6px; color: var(--muted); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tab svg { width: 15px; height: 15px; }
.tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(30,42,58,.08); font-weight: 600; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 20px; border-top: 1px solid var(--rule); }
.pager .total { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.pg { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 7px; font-size: 13px; color: #4b5563; background: var(--surface); cursor: pointer; }
.pg.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg:hover:not(.active) { border-color: #c7d9fb; color: var(--accent); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 9px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px;
  border: 1px solid;
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.notice-info { background: var(--info-bg); border-color: #d5e3fd; color: #1e40af; }
.notice-warn { background: var(--warn-bg); border-color: #f5e0bd; color: #92400e; }
.notice b { font-weight: 600; }

/* ---------- 模态框(静态展示) ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30,42,58,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 50; padding: 24px;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 640px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(30,42,58,.25);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .close { margin-left: auto; color: var(--muted); cursor: pointer; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--rule); background: var(--surface2); border-radius: 0 0 14px 14px; }

/* ---------- 其他 ---------- */
.list-plain { list-style: none; }
.list-plain li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--rule); font-size: 13px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .lp-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.list-plain .lp-main { min-width: 0; flex: 1; }
.list-plain .lp-title { font-weight: 600; font-size: 13px; }
.list-plain .lp-sub { color: var(--muted); font-size: 12px; }
.list-plain .lp-right { margin-left: auto; text-align: right; flex: none; }

.steps { display: flex; gap: 0; }
.step { flex: 1; text-align: center; position: relative; padding-top: 34px; font-size: 12.5px; color: var(--muted); }
.step::before {
  content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--rule); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.step::after {
  content: ""; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px);
  height: 1px; background: var(--rule);
}
.step:last-child::after { display: none; }
.step.done { color: var(--accent); }
.step.done::before { background: var(--accent); border-color: var(--accent); color: #fff; }

.progress { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #4f8ef7); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { font-weight: 500; }

.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* 模板卡 */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tpl-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tpl-card:hover { border-color: #c7d9fb; }
.tpl-card .tpl-head { display: flex; align-items: center; gap: 8px; }
.tpl-card .tpl-name { font-weight: 600; font-size: 14px; }
.tpl-card .tpl-body { font-size: 12.5px; color: #4b5563; background: var(--surface2); border: 1px dashed var(--rule); border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.tpl-card .tpl-body var { font-style: normal; color: var(--accent); font-weight: 600; background: var(--accent-light); padding: 0 4px; border-radius: 4px; }
.tpl-card .tpl-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.tpl-card .tpl-meta { font-size: 12px; color: var(--muted); margin-right: auto; }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stat-grid, .tpl-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
