/* ==========================================================================
   screens-admin.css — 一学 · 驾校约车 · PC 管理端各屏专属样式
   概览 / 教练与车辆 / 排班 / 学员 / 学时核算 / 考试安排 / 报表 / 设置。
   布局骨架（侧栏、顶栏、表格、抽屉、表单）在 admin.css，这里只补各屏说法。
   颜色 / 字号 / 间距 / 圆角一律取 tokens.css 的变量，本文件不写死数值。
   ========================================================================== */

/* ---------- 通用小件 ---------- */
.unit { font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-r); margin-left: var(--sp-2); }
.mono-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-style: normal; }
.text-brand { color: var(--c-brand-ink); }
.text-muted { color: var(--c-text-2); }
.text-right { text-align: right; }
.select {
  height: 32px; min-width: 132px; padding: 0 var(--sp-10); font-size: var(--fs-12); color: var(--c-text-1);
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-8); outline: 0;
}
.select:focus { border-color: var(--c-brand); }
.btn-row { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; }
.mt-8 { margin-top: var(--sp-8); }
.mt-14 { margin-top: var(--sp-14); }
.ml-auto { margin-left: auto; }

/* ---------- 概览 ---------- */
.insight-banner {
  display: flex; align-items: center; gap: var(--sp-10); margin-bottom: var(--sp-14);
  padding: var(--sp-10) var(--sp-14); border: 1px solid var(--c-brand-weak);
  border-radius: var(--r-10); background: var(--c-brand-soft); color: var(--c-brand-ink);
  font-size: var(--fs-12); line-height: 1.6;
}
.insight-banner__main { flex: 1; min-width: 0; }
.insight-banner__main b { font-weight: var(--fw-s); }
.insight-banner .btn { flex: 0 0 auto; }
.dash-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .8fr); gap: var(--sp-14); align-items: start; }
.dash-sub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-14); align-items: start; margin-top: var(--sp-14); }
.dash-main > .panel + .panel, .dash-sub > .panel + .panel { margin-top: 0; }
.trend-plot {
  display: flex; align-items: flex-end; gap: var(--sp-10); height: 164px; padding: var(--sp-10) var(--sp-4) 0;
  background-image: repeating-linear-gradient(to top, var(--c-line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.trend-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--sp-6); }
.trend-bar {
  width: 100%; max-width: 46px; min-height: 3px; border-radius: var(--r-6) var(--r-6) 0 0;
  background: var(--c-chart-1); transition: background var(--t-fast);
}
.trend-col:hover .trend-bar { background: var(--c-brand); }
.trend-val { font-size: var(--fs-10); color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.trend-x { font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }

/* 待办清单行（概览右侧 / 报表共用） */
.todo-row { display: flex; align-items: center; gap: var(--sp-10); width: 100%; padding: var(--sp-10) 0; border-top: 1px solid var(--c-line); text-align: left; }
.todo-row:hover { background: var(--c-fill); }
.todo-row:first-child { border-top: 0; padding-top: var(--sp-2); }
.todo-rank {
  width: 22px; height: 22px; border-radius: var(--r-6); flex: 0 0 auto;
  display: grid; place-items: center; font-size: var(--fs-11); font-weight: var(--fw-s);
  background: var(--c-fill); color: var(--c-text-2); font-variant-numeric: tabular-nums;
}
.todo-row:first-child .todo-rank { background: var(--c-danger-soft); color: var(--c-danger-ink); }
.todo-main { flex: 1; min-width: 0; }
.todo-name { font-size: var(--fs-12); font-weight: var(--fw-m); }
.todo-sub { display: block; margin-top: var(--sp-2); font-size: var(--fs-10); color: var(--c-text-2); }
.todo-sub .bar { display: block; }
.todo-num { flex: 0 0 auto; font-size: var(--fs-16); font-weight: var(--fw-s); color: var(--c-danger-ink); font-variant-numeric: tabular-nums; }

/* 教练负载横条 */
.load-row { display: flex; align-items: center; gap: var(--sp-10); width: 100%; padding: var(--sp-8) 0; border-top: 1px solid var(--c-line); text-align: left; }
.load-row:hover { background: var(--c-fill); }
.load-row:first-child { border-top: 0; }
.load-name { width: 72px; flex: 0 0 auto; font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load-bar { flex: 1; }
.load-bar .bar { display: block; }
.load-num { width: 78px; text-align: right; flex: 0 0 auto; font-size: var(--fs-11); color: var(--c-text-2); font-variant-numeric: tabular-nums; }

/* 今日练车流水 */
.today-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.today-row { display: flex; align-items: center; gap: var(--sp-10); width: 100%; padding: var(--sp-8); border-radius: var(--r-8); text-align: left; }
.today-row:hover { background: var(--c-fill); }
.today-row__main { flex: 1; min-width: 0; }
.today-row__no { font-size: var(--fs-12); font-weight: var(--fw-m); }
.today-row__meta { font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-2); }
.today-row__right { text-align: right; flex: 0 0 auto; }
.today-row__amt { font-size: var(--fs-12); font-weight: var(--fw-s); font-variant-numeric: tabular-nums; }

/* ---------- 教练与车辆 ---------- */
.seg-row { display: flex; align-items: center; gap: var(--sp-10); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--c-line); }
.coach-cell { display: flex; align-items: center; gap: var(--sp-10); min-width: 176px; }
.coach-cell__main { min-width: 0; }
.coach-cell__name { font-size: var(--fs-12); font-weight: var(--fw-m); }
.coach-cell__meta { font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-2); }
.veh-cell { display: flex; align-items: center; gap: var(--sp-8); min-width: 168px; }
.veh-plate {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: var(--fs-12); font-weight: var(--fw-m); color: var(--c-text-1);
  background: var(--c-fill); border-radius: var(--r-6); padding: var(--sp-2) var(--sp-8);
}
.veh-main { min-width: 0; }
.veh-main b { font-size: var(--fs-12); font-weight: var(--fw-m); }
.row-ops { display: flex; align-items: center; gap: var(--sp-4); }

/* 检查项小格（车辆抽屉） */
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-8); }
.check-item { padding: var(--sp-10); border-radius: var(--r-10); background: var(--c-fill); text-align: center; }
.check-item--bad { background: var(--c-danger-soft); }
.check-item__k { font-size: var(--fs-10); color: var(--c-text-2); }
.check-item__v { font-size: var(--fs-12); font-weight: var(--fw-m); margin-top: var(--sp-2); }
.check-item--bad .check-item__v { color: var(--c-danger-ink); }

/* ---------- 排班周视图 ---------- */
.sched-toolbar { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--c-line); }
.sched-wrap { overflow: auto; max-height: calc(100vh - var(--h-top) - 268px); min-height: 360px; }
table.sched { border-collapse: separate; border-spacing: 0; font-size: var(--fs-11); width: 100%; }
table.sched th, table.sched td { border-bottom: 1px solid var(--c-line); padding: 0; }
table.sched thead th {
  position: sticky; top: 0; z-index: 3; height: 42px; padding: 0 var(--sp-8);
  background: var(--c-fill); font-size: var(--fs-10); font-weight: var(--fw-m);
  color: var(--c-text-2); text-align: center; white-space: nowrap;
}
table.sched thead th:first-child {
  left: 0; z-index: 4; text-align: left; min-width: 148px; width: 148px;
  border-right: 1px solid var(--c-line);
}
table.sched tbody th {
  position: sticky; left: 0; z-index: 2; background: var(--c-card);
  height: 56px; padding: 0 var(--sp-10); text-align: left; white-space: nowrap;
  border-right: 1px solid var(--c-line); font-weight: var(--fw-r);
}
table.sched tbody th b { font-size: var(--fs-12); font-weight: var(--fw-m); }
table.sched tbody th span { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
table.sched td { height: 56px; min-width: 88px; text-align: center; }
.cell-slot {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 78px; height: 32px; border-radius: var(--r-8); font-size: var(--fs-10);
  border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-text-2);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.cell-slot:hover { border-color: var(--c-brand-weak); }
.cell-slot--free { border-color: var(--c-brand-weak); color: var(--c-brand-ink); background: var(--c-brand-soft); }
.cell-slot--busy { background: var(--c-fill); color: var(--c-text-1); border-color: var(--c-line-2); font-weight: var(--fw-m); }
.cell-slot--off { background: repeating-linear-gradient(45deg, var(--c-fill), var(--c-fill) 5px, var(--c-card) 5px, var(--c-card) 10px); color: var(--c-text-3); }
.cell-slot--past { background: transparent; color: var(--c-text-4); border-style: dashed; }
.cell-slot--none { background: transparent; border: 0; color: var(--c-text-4); }
.sched-legend { display: flex; align-items: center; gap: var(--sp-14); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-top: 1px solid var(--c-line); font-size: var(--fs-10); color: var(--c-text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: var(--r-99); display: inline-block; margin-right: var(--sp-4); }

/* ---------- 学员 ---------- */
.stu-filter { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--c-line); }
.stu-cell { display: flex; align-items: center; gap: var(--sp-10); min-width: 158px; }
.stu-cell__main { min-width: 0; }
.stu-cell__name { font-size: var(--fs-12); font-weight: var(--fw-m); }
.stu-cell__meta { font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-2); font-variant-numeric: tabular-nums; }
.hour-prog { display: flex; align-items: center; gap: var(--sp-8); min-width: 132px; }
.hour-prog .bar { flex: 1; }
.hour-prog__n { font-size: var(--fs-10); color: var(--c-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 学时核算 ---------- */
.hours-bar { display: flex; align-items: center; gap: var(--sp-10); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--c-line); }
.hours-bar__n { font-size: var(--fs-11); color: var(--c-text-2); }
.hours-bar__n b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-14); color: var(--c-brand-ink); }
.hour-who { display: flex; align-items: center; gap: var(--sp-8); min-width: 138px; }
.hour-time { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hour-time small { color: var(--c-text-2); font-size: var(--fs-10); }
.reject-box { display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-12); border-radius: var(--r-10); background: var(--c-danger-soft); }
.reject-box__k { font-size: var(--fs-11); font-weight: var(--fw-m); color: var(--c-danger-ink); }
.reject-reasons { display: flex; flex-wrap: wrap; gap: var(--sp-6); }
.reject-reason {
  height: 28px; padding: 0 var(--sp-10); border-radius: var(--r-99);
  background: var(--c-card); color: var(--c-text-2); font-size: var(--fs-11);
  border: 1px solid transparent;
}
.reject-reason.is-on { background: var(--c-danger); color: var(--c-on-brand); font-weight: var(--fw-m); }

/* ---------- 考试安排 ---------- */
.exam-tabs { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--c-line); }
.exam-who { display: flex; align-items: center; gap: var(--sp-8); min-width: 138px; }
.exam-date { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exam-date small { display: block; font-size: var(--fs-10); color: var(--c-text-2); }
.exam-slot-pick { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.exam-slot {
  display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start;
  padding: var(--sp-10) var(--sp-12); border-radius: var(--r-10);
  border: 1px solid var(--c-line); background: var(--c-card); text-align: left;
}
.exam-slot.is-on { border-color: var(--c-brand); background: var(--c-brand-soft); }
.exam-slot__d { font-size: var(--fs-12); font-weight: var(--fw-m); font-variant-numeric: tabular-nums; }
.exam-slot__s { font-size: var(--fs-10); color: var(--c-text-2); }

/* ---------- 报表 ---------- */
.reports-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: var(--sp-14); align-items: start; margin-top: var(--sp-14); }
.reports-grid > .panel + .panel { margin-top: 0; }
.reports-chart { display: flex; align-items: flex-end; gap: var(--sp-8); height: 210px; padding: var(--sp-10) var(--sp-2) 0; background-image: repeating-linear-gradient(to top, var(--c-line) 1px, transparent 1px); background-size: 100% 20%; }
.reports-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--sp-4); }
.reports-bar { width: 100%; max-width: 52px; min-height: 3px; border-radius: var(--r-6) var(--r-6) 0 0; background: var(--c-chart-1); }
.reports-col:hover .reports-bar { background: var(--c-brand); }
.reports-val { font-size: var(--fs-10); color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.reports-x { font-size: var(--fs-10); color: var(--c-text-2); white-space: nowrap; }
.rate-row { display: flex; align-items: center; gap: var(--sp-10); padding: var(--sp-8) 0; border-top: 1px solid var(--c-line); }
.rate-row:first-child { border-top: 0; }
.rate-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.rate-row__top { display: flex; align-items: baseline; gap: var(--sp-6); }
.rate-row__top b { font-size: var(--fs-12); }
.rate-row__top span { font-size: var(--fs-10); color: var(--c-text-2); }
.rate-row__pct { flex: 0 0 auto; font-size: var(--fs-13); font-weight: var(--fw-s); font-variant-numeric: tabular-nums; }
.rate-row .bar { display: block; }
.csv {
  font-size: var(--fs-11); line-height: 1.6; white-space: pre-wrap; word-break: break-all;
  background: var(--c-fill); border-radius: var(--r-10); padding: var(--sp-10) var(--sp-12); max-height: 320px; overflow: auto;
  font-variant-numeric: tabular-nums;
}
.export-note { display: flex; align-items: flex-start; gap: var(--sp-6); margin-top: var(--sp-10); font-size: var(--fs-11); color: var(--c-text-2); line-height: 1.6; }

/* ---------- 设置 ---------- */
.settings-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: var(--sp-14); align-items: start; width: 100%; max-width: var(--w-form); margin: 0 auto; }
.set-nav { padding: var(--sp-8); }
.set-nav__btn { display: flex; align-items: center; gap: var(--sp-8); width: 100%; min-height: 38px; padding: 0 var(--sp-10); border-radius: var(--r-8); font-size: var(--fs-12); color: var(--c-text-2); text-align: left; }
.set-nav__btn:hover { background: var(--c-fill); color: var(--c-text-1); }
.set-nav__btn.is-on { background: var(--c-brand-soft); color: var(--c-brand-ink); font-weight: var(--fw-m); }
.settings-body { min-width: 0; }
.set-form { max-width: 720px; }
.set-form .field { margin-bottom: var(--sp-14); }
.set-actions { display: flex; align-items: center; gap: var(--sp-8); padding-top: var(--sp-6); }
.settings-note { padding: var(--sp-12) var(--sp-14); background: var(--c-fill); border-radius: var(--r-10); font-size: var(--fs-11); color: var(--c-text-2); line-height: 1.7; }
.settings-note b { color: var(--c-text-1); }
.perm-desc { display: flex; flex-direction: column; gap: var(--sp-10); }
.perm-desc__item { padding-bottom: var(--sp-10); border-bottom: 1px solid var(--c-line); }
.perm-desc__item:last-child { border-bottom: 0; padding-bottom: 0; }
.perm-desc__name { font-size: var(--fs-12); font-weight: var(--fw-m); }
.perm-desc__text { font-size: var(--fs-10); color: var(--c-text-2); margin-top: var(--sp-2); line-height: 1.6; }
.matrix-wrap { overflow: auto; max-height: calc(100vh - var(--h-top) - 220px); }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-12); }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--c-line); padding: 0 var(--sp-10); }
table.matrix thead th {
  position: sticky; top: 0; z-index: 2; height: 54px; background: var(--c-fill);
  font-size: var(--fs-11); font-weight: var(--fw-s); color: var(--c-text-1); text-align: center; white-space: nowrap;
}
table.matrix thead th:first-child { text-align: left; }
table.matrix thead th span { display: block; font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-r); }
table.matrix td { height: 46px; text-align: center; white-space: nowrap; }
table.matrix td:first-child { text-align: left; }
table.matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--c-card); text-align: left; font-weight: var(--fw-r); font-size: var(--fs-12); color: var(--c-text-1); height: 46px; white-space: nowrap; }
table.matrix tbody tr:hover td, table.matrix tbody tr:hover th { background: var(--c-fill); }
.perm-cell { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.role-name { display: flex; flex-direction: column; gap: var(--sp-2); }
.role-name b { font-size: var(--fs-12); }
.role-name span { font-size: var(--fs-10); color: var(--c-text-2); font-weight: var(--fw-r); }

/* ---------- 窄屏 ---------- */
@media (max-width: 1279px) {
  .dash-main, .dash-sub, .reports-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .settings-layout { grid-template-columns: 1fr; }
  .set-nav { display: flex; gap: var(--sp-2); overflow-x: auto; }
  .set-nav__btn { width: auto; white-space: nowrap; }
  .reports-chart { height: 170px; }
}

/* ==========================================================================
   文字堆叠兜底
   「名称 + 说明」在后台表格与列表里大量写成成对的 <span>。父级 .grow 只负责
   横向撑开，两个 span 会挤成一行、互相压字，所以这里把它定成 flex 列。
   注意：**不要**用 [class$="__label"] 这类通配去批量改成 block——
   .kpi__label / .kpi__value 本身是 flex 行（图标 + 文字 + 右箭头），
   被改成 block 后箭头会掉到第二行。需要换行的地方逐个写明。
   ========================================================================== */
.grow { display: flex; flex-direction: column; min-width: 0; }
.coach-cell__main, .stu-cell__main, .veh-main,
.coach-cell__name, .coach-cell__meta,
.stu-cell__name, .stu-cell__meta,
.today-row__no, .today-row__meta,
.check-item__k, .check-item__v { display: block; }
