/* 留学管家 ERP 统一视觉（四端共用，各自独立部署目录） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --brand: #1e3a8a; --brand-2: #2563eb; --bg: #eef2f6; --card: #fff;
  --text: #1e293b; --muted: #64748b; --line: #e2e8f0;
  --ok: #15803d; --warn: #d97706; --danger: #b91c1c; --purple: #7e22ce;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  min-height: 100vh; padding-bottom: 24px;
}
a { color: var(--brand-2); }
.hide { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.right { margin-left: auto; }
.center { text-align: center; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 34px 28px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .12); }
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg,#1e3a8a,#2563eb);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.login-card h1 { font-size: 21px; letter-spacing: 1px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.login-card .portal { display: inline-block; font-size: 11px; color: var(--brand);
  background: #eff6ff; padding: 2px 8px; border-radius: 999px; margin-bottom: 14px; }
.login-card .tip { margin-top: 18px; font-size: 12px; color: var(--muted); background: #f8fafc;
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px; line-height: 1.7; }

/* 顶栏 */
.topbar { background: var(--brand); color: #fff; padding: 12px 16px; display: flex; align-items: center;
  gap: 10px; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(15,23,42,.15); }
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .who { margin-left: auto; font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 10px; }
.topbar button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.topbar button:hover { background: rgba(255,255,255,.24); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 14px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.tabs .tab { padding: 7px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; cursor: pointer; white-space: nowrap; color: #475569; }
.tabs .tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 卡片 */
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.card h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: #0f172a; }
.card h3 .right { font-size: 12px; font-weight: 400; color: var(--brand-2); cursor: pointer; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer;
  transition: .15s; }
.kpi:hover { border-color: #93c5fd; box-shadow: 0 3px 10px rgba(37,99,235,.09); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 700; color: var(--brand); margin-top: 2px; word-break: break-all; }
.kpi.full { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }

/* 列表 */
.list-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f8fafc; }
.avatar { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg,#2563eb,#1e3a8a);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .name { font-weight: 600; font-size: 14px; }
.list-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .side { font-size: 12px; color: var(--muted); text-align: right; flex: 0 0 auto; }

/* 标签 */
.badge { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.b-new { background: #e0f2fe; color: #0284c7; }
.b-follow { background: #fef3c7; color: #b45309; }
.b-jw { background: #f3e8ff; color: var(--purple); }
.b-ret { background: #e0e7ff; color: #4338ca; }
.b-sign { background: #dcfce7; color: var(--ok); }
.b-lost { background: #fee2e2; color: var(--danger); }
.b-done { background: #f1f5f9; color: #475569; }
.b-urgent { background: #fee2e2; color: var(--danger); }
.b-flag { background: #fff7ed; color: #c2410c; }

/* 表单 */
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; }
.fld label .req { color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { min-height: 70px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.check input { width: 16px; height: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.btn { border: none; border-radius: 8px; padding: 9px 16px; font-size: 13px; background: var(--brand-2);
  color: #fff; cursor: pointer; font-family: inherit; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand-2); border: 1px solid var(--brand-2); }
.btn.gray { background: #f1f5f9; color: #475569; border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 11px; }

/* 详情 */
.section { border-top: 1px solid #f1f5f9; padding: 12px 0; }
.section:first-of-type { border-top: none; }
.section .st { font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .5px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-word; }
.biz-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.pill { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 12px; cursor: pointer; }
.pill.on { border-color: var(--brand-2); background: #eff6ff; color: var(--brand-2); font-weight: 600; }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center;
  justify-content: center; z-index: 90; padding: 16px; }
.mask.on { display: flex; }
.sheet { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh;
  overflow-y: auto; padding: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.28); }
.sheet h2 { font-size: 16px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.sheet .close { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.sheet .foot { display: flex; gap: 10px; margin-top: 8px; position: sticky; bottom: -18px; background: #fff;
  padding: 12px 0 4px; }

/* 表格 */
table.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tb th, table.tb td { border-bottom: 1px solid #f1f5f9; padding: 8px 6px; text-align: right; }
table.tb th { color: var(--muted); font-weight: 500; background: #f8fafc; }
table.tb td:first-child, table.tb th:first-child { text-align: left; }
table.tb tbody tr:hover { background: #f8fafc; }

/* 条形图 */
.barchart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 96px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { background: #eff3f8; border-radius: 6px; height: 16px; overflow: hidden; display: flex; }
.bar-fill { background: linear-gradient(90deg,#2563eb,#60a5fa); height: 100%; }
.bar-fill.alt { background: linear-gradient(90deg,#15803d,#4ade80); }
.bar-track.stack { flex-direction: column; gap: 2px; padding: 2px 0; height: 24px; }
.bar-track.stack > div { min-width: 2px; }
.bar-track.stack .bar-fill { height: 9px; border-radius: 4px; }
.bar-val { text-align: right; color: var(--muted); }

/* 待办 */
.todo { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; align-items: flex-start; }
.todo .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: #94a3b8; flex: 0 0 auto; }
.todo.pin .dot { background: #7c3aed; } .todo.red .dot { background: var(--danger); }
.todo.yellow .dot { background: var(--warn); }
.todo .t { font-size: 13px; font-weight: 600; }
.todo .s { font-size: 12px; color: var(--muted); }
.todo .due { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.todo.red .due { color: var(--danger); font-weight: 600; }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(15,23,42,.92);
  color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 120; display: none; max-width: 86vw; }
.empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 30px 10px; }
.loading { text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }
.alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px;
  padding: 10px 12px; font-size: 12px; line-height: 1.7; }

/* 遮罩式详情页 */
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail-head .name { font-size: 18px; font-weight: 700; }
.chip { display: inline-block; background: #f1f5f9; color: #475569; border-radius: 6px;
  padding: 1px 7px; font-size: 11px; margin-right: 4px; }
