/* 河南工程学院培训学院业务管理平台 —— 全部本地样式，无任何外部依赖 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --main: #1a5490;
  --main-d: #123c69;
  --main-l: #e8f1fa;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --txt: #1f2937;
  --txt2: #5b6673;
  --txt3: #8b949e;
  --red: #d93026;
  --red-l: #fdeceb;
  --green: #0f9d58;
  --green-l: #e8f6ee;
  --orange: #e07b1a;
  --orange-l: #fdf1e3;
  --purple: #6b4fbb;
  --r: 10px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; font-size: 16px; }
a { color: var(--main); text-decoration: none; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #1a5490 0%, #123c69 100%); }
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 34px 28px 28px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .badge { width: 54px; height: 54px; border-radius: 13px; background: var(--main); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.login-logo h1 { font-size: 18px; font-weight: 600; color: var(--txt); letter-spacing: .5px; }
.login-logo p { font-size: 13px; color: var(--txt3); margin-top: 5px; }
.fld { margin-bottom: 15px; }
.fld label { display: block; font-size: 13px; color: var(--txt2); margin-bottom: 6px; }
.fld input, .fld select, .fld textarea {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
  background: #fff; color: var(--txt); outline: none; transition: border-color .15s;
}
.fld textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--main); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--txt); cursor: pointer; font-size: 14px; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--main); color: var(--main); }
.btn:active { transform: translateY(1px); }
.btn-p { background: var(--main); border-color: var(--main); color: #fff; }
.btn-p:hover { background: var(--main-d); border-color: var(--main-d); color: #fff; }
.btn-d { background: var(--red); border-color: var(--red); color: #fff; }
.btn-d:hover { background: #b8241c; border-color: #b8241c; color: #fff; }
.btn-g { background: var(--green); border-color: var(--green); color: #fff; }
.btn-g:hover { background: #0b7c44; border-color: #0b7c44; color: #fff; }
.btn-lg { width: 100%; height: 46px; font-size: 16px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 6px; min-width: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.login-copy { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--txt3); font-size: 12px; letter-spacing: .3px; line-height: 1.8; }
.login-copy .lc-org { font-weight: 600; color: var(--txt2); }
.login-copy .lc-en { font-size: 11px; opacity: .9; }
.login-copy .lc-cr { font-size: 11px; opacity: .75; }
.err { background: var(--red-l); color: var(--red); padding: 9px 12px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; display: none; }
.err.show { display: block; }

/* ============ 主框架 ============ */
.app { display: flex; min-height: 100vh; }
.side {
  width: 210px; background: var(--main-d); color: #cdd9e6; position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; z-index: 40;
}
.side-hd { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-hd h1 { font-size: 15px; color: #fff; font-weight: 600; line-height: 1.4; }
.side-hd p { font-size: 11.5px; color: #8fa8c4; margin-top: 3px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #cdd9e6;
  font-size: 14px; cursor: pointer; border-left: 3px solid transparent; transition: all .12s;
}
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.on { background: rgba(255,255,255,.13); color: #fff; border-left-color: #64a8f0; }
.side-nav a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.side-nav .grp { padding: 12px 16px 5px; font-size: 11px; color: #7c93ad; letter-spacing: 1px; }
.side-ft { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 11.5px; color: #7c93ad; }

.main { flex: 1; margin-left: 210px; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 18px; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.top h2 { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--txt2); cursor: pointer; padding: 5px 8px; border-radius: 7px; }
.top .who:hover { background: var(--bg); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--main); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.burger { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; }
.burger:hover { background: var(--bg); }
.page { flex: 1; padding: 16px 18px 40px; max-width: 1500px; width: 100%; }

/* ============ 卡片与通用 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.card-hd { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-hd h3 { font-size: 15px; font-weight: 600; flex: 1; min-width: 120px; display: flex; align-items: center; gap: 7px; }
.card-bd { padding: 14px 16px; }
.card-bd.p0 { padding: 0; }
.muted { color: var(--txt3); font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--txt3); font-size: 13.5px; }
.empty svg { width: 40px; height: 40px; opacity: .3; margin-bottom: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mb10 { margin-bottom: 10px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px; }
.kpi .lb { font-size: 12.5px; color: var(--txt3); display: flex; align-items: center; gap: 5px; }
.kpi .vl { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -.3px; }
.kpi .sub { font-size: 12px; color: var(--txt3); margin-top: 3px; }
.kpi.acc-b { border-left: 3px solid var(--main); }
.kpi.acc-g { border-left: 3px solid var(--green); }
.kpi.acc-r { border-left: 3px solid var(--red); }
.kpi.acc-o { border-left: 3px solid var(--orange); }
.kpi.acc-p { border-left: 3px solid var(--purple); }

/* 今天要处理 */
.todo-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 16px; border-bottom: 1px solid #f0f3f7;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fafbfd; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--main); margin-top: 7px; flex: none; }
.todo-dot.od { background: var(--red); }
.todo-main { flex: 1; min-width: 0; }
.todo-t { font-size: 14px; color: var(--txt); font-weight: 500; }
.todo-s { font-size: 12.5px; color: var(--txt3); margin-top: 2px; word-break: break-all; }
.todo-r { display: flex; align-items: center; gap: 8px; flex: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; white-space: nowrap; line-height: 1.7; }
.tag-r { background: var(--red-l); color: var(--red); }
.tag-b { background: var(--main-l); color: var(--main); }
.tag-g { background: var(--green-l); color: var(--green); }
.tag-o { background: var(--orange-l); color: var(--orange); }
.tag-n { background: #eef1f5; color: var(--txt2); }
.notice { background: var(--orange-l); border: 1px solid #f6dcbb; color: #8a4d05; padding: 10px 14px; border-radius: var(--r); font-size: 13px; margin-bottom: 14px; display: flex; gap: 9px; align-items: flex-start; }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* 工具条 */
.bar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.bar input[type=text], .bar select {
  height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: #fff;
  outline: none; font-size: 14px; color: var(--txt);
}
.bar input[type=text] { min-width: 180px; flex: 1; max-width: 320px; }
.bar input:focus, .bar select:focus { border-color: var(--main); }

/* 表格 */
.tw { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th {
  background: #f7f9fc; color: var(--txt2); font-weight: 500; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: #fafbfd; }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tb .ops { white-space: nowrap; text-align: right; }
.lk { color: var(--main); cursor: pointer; }
.lk:hover { text-decoration: underline; }
.money { font-variant-numeric: tabular-nums; }
.money.in { color: var(--green); }
.money.out { color: var(--red); }
.od-txt { color: var(--red); }

/* 移动端卡片列表 */
.mlist { display: none; }
.mcard { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 14px; }
.mcard:last-child { border-bottom: none; }
.mcard .m-t { font-size: 14.5px; font-weight: 500; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mcard .m-r { font-size: 12.5px; color: var(--txt2); display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.mcard .m-r span:first-child { color: var(--txt3); flex: none; }
.mcard .m-ops { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 900px; }
.modal-hd { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-hd h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-hd .x { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 7px; cursor: pointer; color: var(--txt3); }
.modal-hd .x:hover { background: var(--bg); color: var(--txt); }
.modal-bd { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fafbfd; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.f2 .full { grid-column: 1 / -1; }
.req::after { content: ' *'; color: var(--red); }

/* Toast */
.toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 11px 20px; border-radius: 9px; font-size: 14px; z-index: 200; opacity: 0; transition: opacity .2s, top .2s; pointer-events: none; max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; top: 32px; }
.toast.ok { background: #0f9d58; } .toast.no { background: #d93026; }

/* 进度条 */
.pbar { height: 6px; background: #edf1f6; border-radius: 4px; overflow: hidden; min-width: 60px; }
.pbar i { display: block; height: 100%; background: var(--main); border-radius: 4px; }
.pbar i.full { background: var(--green); }

/* 详情 */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--txt3); white-space: nowrap; }
.dl dd { color: var(--txt); word-break: break-all; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 14px; font-size: 14px; color: var(--txt2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--main); border-bottom-color: var(--main); font-weight: 500; }
.sec-t { font-size: 13px; color: var(--txt3); margin: 14px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }

/* 看板 */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { min-width: 236px; flex: 1; background: #eef1f6; border-radius: var(--r); padding: 10px; }
.kcol h4 { font-size: 13px; color: var(--txt2); margin-bottom: 9px; display: flex; justify-content: space-between; }
.kitem { background: #fff; border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; border: 1px solid var(--line); }
.kitem:hover { border-color: var(--main); }
.kitem .kt { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.kitem .ks { font-size: 12px; color: var(--txt3); }

/* 图表 */
.chart-wrap { overflow-x: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--txt2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }

/* ============ 移动端 ============ */
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .22s; width: 250px; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .side.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .burger { display: flex; }
  .page { padding: 12px 12px 90px; }
  .tw { display: none; }
  .mlist { display: block; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .vl { font-size: 19px; }
  .f2 { grid-template-columns: 1fr; }
  .modal { max-height: 94vh; border-radius: 12px 12px 0 0; align-self: flex-end; max-width: 100%; }
  .mask { padding: 0; align-items: flex-end; }
  .btn { height: 44px; min-height: 44px; }
  .btn-sm { height: 36px; }
  .top { padding: 0 12px; }
  .todo-item { flex-wrap: wrap; }
  .todo-r { width: 100%; padding-left: 19px; }
  .grid2 { grid-template-columns: 1fr; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; display: none; }
  .backdrop.show { display: block; }
  body { padding-bottom: env(safe-area-inset-bottom); }
}
@media (min-width: 861px) { .backdrop { display: none !important; } }
@media print {
  .side, .top, .bar, .btn, .todo-r { display: none !important; }
  .main { margin-left: 0; } .card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ============ 选项就地新增 ============ */
.opt-add { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.opt-add input { flex: 1; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }

/* ============ 费用明细子表 ============ */
.cost-head, .cost-row { display: grid; grid-template-columns: 96px minmax(280px, 2.5fr) 60px 52px 80px 132px 96px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.cost-head { font-size: 12px; color: var(--txt3); padding: 0 2px; }
.cost-row input, .cost-row select { height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: #fff; width: 100%; font-size: 14px; }
.cost-row .ct-amt { text-align: right; font-weight: 600; }
.cost-row .ct-label { font-size: 14px; }
.cost-row .ct-label::placeholder { color: #9aa3af; }
.cost-row .ct-label:not(:placeholder-shown) { background: #eef4ff; border-color: #9ec1ff; color: #16365f; font-weight: 500; }
.cost-add { margin-top: 4px; display: flex; gap: 8px; }

/* ============ 班主任·培训耗材与物资 ============ */
.sup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--main); color: var(--main); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; transition: .15s; }
.chip:hover { background: var(--main); color: #fff; }
.chip i { font-style: normal; opacity: .65; font-size: 11.5px; }
.sup-head, .sup-row { display: grid; grid-template-columns: minmax(140px, 2fr) 64px 90px 92px minmax(120px, 1.5fr) 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.sup-head { font-size: 12px; color: var(--txt3); padding: 0 2px; }
.sup-row input { height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: #fff; width: 100%; font-size: 14px; }
.sup-row .sp-amt { text-align: right; font-weight: 600; }
.sup-other { font-size: 13px; color: var(--txt2); background: #f6f8fb; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; margin-bottom: 6px; }
.sup-total { text-align: right; font-size: 14px; margin-top: 8px; }
.sup-total b { color: var(--main); }
.duties { margin: 0; padding-left: 20px; }
.duties li { margin: 5px 0; line-height: 1.5; }

/* ============ 日历 ============ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 76px; padding: 5px 6px; font-size: 12px; }
.cal-cell.cal-empty { background: #fafbfd; }
.cal-cell.cal-wk { min-height: 0; background: #f7f9fc; color: var(--txt2); text-align: center; font-weight: 500; padding: 7px 0; }
.cal-cell.cal-today { background: #fff8e9; }
.cal-d { color: var(--txt3); margin-bottom: 3px; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; }
.cal-chip { display: block; border-radius: 5px; padding: 2px 6px; font-size: 11.5px; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.cal-run { background: var(--main); }
.cal-chip.cal-up { background: var(--orange); }
.cal-chip.cal-end { background: #9aa6b2; }
.cal-more { font-size: 11px; color: var(--txt3); }
.cal-lg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--txt2); margin-right: 10px; }
.cal-lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-lg i.cal-run { background: var(--main); } .cal-lg i.cal-up { background: var(--orange); } .cal-lg i.cal-end { background: #9aa6b2; }
@media (max-width: 860px) {
  .cost-head { display: none; }
  .cost-row { grid-template-columns: 1fr 1fr; background: #fafbfd; padding: 8px; border-radius: 8px; }
  .cost-row .ct-amt { grid-column: 1 / -1; text-align: left; }
  .cost-row .ct-date { grid-column: 1 / -1; }
  .cost-row .ct-label { grid-column: 1 / -1; }
  .sup-head { display: none; }
  .sup-row { grid-template-columns: 1fr 1fr; background: #fafbfd; padding: 8px; border-radius: 8px; }
  .sup-row .sp-amt { grid-column: 1 / -1; text-align: left; }
  .sup-row .sp-note { grid-column: 1 / -1; }
  .cal-cell { min-height: 58px; }
  .cal-chip { font-size: 10.5px; padding: 1px 4px; }
}

/* ============ 日历悬停提示 ============ */
.cal-tip { position: fixed; z-index: 320; display: none; background: #1f2937; color: #fff; padding: 10px 13px; border-radius: 9px; font-size: 13px; line-height: 1.75; max-width: 290px; box-shadow: 0 10px 30px rgba(0,0,0,.28); pointer-events: none; }
.cal-tip .ct-h { font-weight: 600; font-size: 14px; margin-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.16); padding-bottom: 4px; }
.cal-tip .ct-r { display: flex; gap: 8px; }
.cal-tip .ct-r span { color: #9aa3af; min-width: 62px; flex: none; }
.cal-tip .ct-r em { color: #ffd479; font-style: normal; }

/* ============ 关联追溯 / 关联记录面板 ============ */
.rel-box { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.rel-h { font-size: 12.5px; color: var(--txt3); margin-bottom: 6px; font-weight: 600; }
.rel-row { display: flex; gap: 10px; padding: 4px 0; align-items: flex-start; }
.rel-k { min-width: 64px; flex: none; color: var(--txt3); font-size: 13px; padding-top: 3px; }
.rel-v { flex: 1; font-size: 13.5px; line-height: 1.7; }
.rel-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f8; border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; margin: 2px 6px 2px 0; font-size: 13px; }
