:root {
  --brand: #ea580c;
  --brand-600: #c2410c;
  --brand-soft: #fff1e6;
  --accent: #0f766e;
  --bg: #fdf9f5;
  --panel: #ffffff;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --line: #f0e7dd;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #0284c7;
  --sidebar: #dcebfd;
  --sidebar-2: #c7ddfa;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(124, 45, 18, 0.05);
  --shadow: 0 4px 16px rgba(124, 45, 18, 0.08);
  --shadow-lg: 0 18px 48px rgba(124, 45, 18, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------------- 滚动条：始终可见（不受系统「自动隐藏滚动条」影响） ---------------- */
html { scrollbar-color: #9db3cf #e7eef8; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; }
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #e7eef8; border-left: 1px solid #dbe5f2; }
::-webkit-scrollbar-thumb {
  background: #9db3cf; border-radius: 8px; border: 2px solid #e7eef8; min-height: 40px;
}
::-webkit-scrollbar-thumb:hover { background: #7e96b8; }
::-webkit-scrollbar-corner { background: #e7eef8; }

/* ---------------- 登录 ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: linear-gradient(135deg, #0c3b3a 0%, #0f766e 42%, #ea580c 100%);
}
.auth-art {
  padding: 56px 60px;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-art::after {
  content: "";
  position: absolute;
  width: 620px; height: 620px;
  right: -220px; bottom: -260px;
  background: radial-gradient(circle at 30% 30%, rgba(253,186,116,.45), transparent 62%);
  border-radius: 50%;
}
.auth-art h1 { font-size: 34px; margin: 0 0 14px; line-height: 1.25; letter-spacing: .5px; }
.auth-art p { color: #ccfbf1; margin: 0; font-size: 15px; line-height: 1.9; }
.auth-badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: #fed7aa; margin-bottom: 26px;
}
.auth-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #fdba74; box-shadow: 0 0 0 4px rgba(253,186,116,.3); }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; max-width: 460px; }
.auth-feat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: 14px 16px; font-size: 13px; color: #cbd5e1;
  backdrop-filter: blur(6px);
}
.auth-feat b { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.auth-foot { font-size: 12px; color: rgba(255,255,255,.62); position: relative; z-index: 2; }

.auth-side {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 18px; padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.auth-logo { width: 56px; height: 56px; border-radius: 15px; object-fit: cover; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(234,88,12,.22); display: block; }
.auth-hint {
  margin-top: 22px; padding: 14px 16px; border-radius: 10px;
  background: #f8fafc; border: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.9;
}
.auth-hint code { background: #fff1e6; color: var(--brand-600); padding: 1px 6px; border-radius: 5px; }

/* ---------------- 布局 ---------------- */
.app-root { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px; flex: 0 0 228px;
  background: linear-gradient(180deg, #e8f2fe 0%, #d6e7fc 48%, #c3dbf8 100%);
  color: #2f4d75;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  border-right: 1px solid #dbe7f7;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 16px;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, .35);
  flex: 0 0 34px;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-size: 14.5px; font-weight: 600; color: #14386b; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #6b8cb8; margin-top: 2px; }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.nav-label { font-size: 11px; color: #7d9bc4; padding: 14px 10px 8px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  color: #3f5a80; font-size: 13.5px; margin-bottom: 2px;
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-2); color: #1d4ed8; }
.nav-item.active { background: linear-gradient(90deg, #f97316, #ea580c); color: #fff; box-shadow: 0 4px 14px rgba(234, 88, 12, .32); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600;
}
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(30, 58, 138, .1); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.user-chip:hover { background: var(--sidebar-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#fb923c,#ea580c); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.user-name { font-size: 13px; color: #14386b; }
.user-role { font-size: 11px; color: #6b8cb8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 16.5px; margin: 0; font-weight: 600; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: #f8fafc; }
.menu-btn { display: none; }

.content { padding: 22px; flex: 1; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 19px; }
.page-head .desc { color: var(--muted); font-size: 12.5px; }
.spacer { flex: 1; }

/* ---------------- 卡片 / 栅格 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  min-width: 0;
}
.grid > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.order-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .order-tools { width: 100%; }
  .order-tools .date-in { flex: 0 0 auto; }
  .order-tools input[type="search"] { flex: 1 1 100%; width: 100% !important; }
}
.card-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 8px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.card-b { padding: 18px; }
.card-b.tight { padding: 10px 12px; }

.grid { display: grid; gap: 16px; align-items: start; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c2-1 { grid-template-columns: 2fr 1fr; }
.grid.c1-2 { grid-template-columns: 1fr 2fr; }

.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 650; margin-top: 8px; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .t { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat .t b { color: var(--ok); font-weight: 600; }
.stat.accent { background: linear-gradient(135deg, #f97316, #ea580c); border: none; color: #fff; }
.stat.accent .k, .stat.accent .t { color: #ffe4cc; }
.stat.accent .v small { color: #ffe4cc; }
.stat.accent .t b { color: #fef08a; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 列表卡片内独立竖向滚动：表头吸顶，上方标题/搜索栏保持不动 */
.table-wrap.scroll-y {
  max-height: calc(100vh - 290px);
  min-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
}
.table-wrap.scroll-y thead th { position: sticky; top: 0; z-index: 4; }
.table-wrap.scroll-y tfoot td { position: sticky; bottom: 0; z-index: 4; background: #fff; }
/* 班级表列多，禁止折行，避免日期/时间被压成两行 */
.cls-table table { min-width: 1080px; }
/* 资料体检弹窗：表格紧凑些，避免横向滚动 */
.audit-table table { min-width: 660px; }
.audit-table td, .audit-table th { padding: 9px 8px; }
.cls-table th, .cls-table td { white-space: nowrap; padding: 10px 6px; }
.cls-table .t-sub { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cls-table td .btn.sm { padding: 5px 9px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 11px 14px; background: #fdf8f3; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-size: 12.5px;
}
td { padding: 12px 14px; border-bottom: 1px solid #f1f3f9; vertical-align: middle; }
tbody tr:hover { background: #fffaf5; }
tbody tr:last-child td { border-bottom: none; }
.t-main { font-weight: 550; }
.t-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.t-right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 42px 16px; font-size: 13px; }
.t-check { width: 36px; padding-right: 0 !important; }
.t-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
tbody tr[data-row] { cursor: pointer; }
.date-in {
  padding: 6px 8px; font-size: 12.5px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; flex: 0 0 auto;
}
/* 比全局 input[type=date]{width:100%} 更具体，才能真正压窄 */
input[type="date"].date-in { width: 126px; min-width: 0; }
.date-sep { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
/* 起止日期成组，始终排在同一行 */
.date-range { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* 分页条 */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.pg-info { font-size: 12.5px; color: var(--muted); }
.pg-size { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pg-size select { width: auto; padding: 5px 8px; font-size: 12.5px; }
/* 表格汇总行 */
tfoot td { background: #fafbfe; font-weight: 650; color: #334155; border-top: 1px solid var(--line); }
/* 订单管理：列多，保持单行不竖排，超出就在表格内部横滑 */
#orderArea table { min-width: 700px; }
#orderArea table th, #orderArea table td { white-space: nowrap; padding: 9px 6px; }
#orderArea table td .t-sub { white-space: nowrap; }
#orderArea .btn.sm { padding: 4px 8px; font-size: 11.5px; }
#orderArea .pill { padding: 2px 7px; font-size: 11.5px; }
.selbar {
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
background: var(--brand-soft); border: 1px solid #ffd9b8; color: #9a3412;
border-radius: 10px; padding: 9px 14px; margin-bottom: 12px; font-size: 13px;
}
.selbar[hidden] { display: none; }

/* ---------------- 标签 ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 550;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.pill.ok { background: #dcfce7; color: #15803d; }
.pill.warn { background: #fef3c7; color: #b45309; }
.pill.bad { background: #fee2e2; color: #b91c1c; }
.pill.info { background: #e0f2fe; color: #0369a1; }
.pill.brand { background: var(--brand-soft); color: var(--brand-600); }
.pill.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(234,88,12,.28); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.danger { color: var(--bad); border-color: #fecaca; background: #fff5f5; }
.btn.danger:hover { background: #fee2e2; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
td .btn-row { flex-wrap: nowrap; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #dfe3ee; border-radius: 9px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { resize: vertical; min-height: 78px; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---------------- 模态框 ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(3px); display: grid; place-items: center;
  padding: 20px; z-index: 100; animation: fade .16s ease;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h.modal-drag { cursor: move; user-select: none; touch-action: none; }
.modal-h.modal-drag h3 { pointer-events: none; }
.modal.dragging { animation: none; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); }
body.modal-no-select { user-select: none; }
.modal-h h3 { margin: 0; font-size: 15.5px; }
.modal-x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; border: none; background: none; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px) } }

/* ---------------- Toast ---------------- */
.toast-host {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow); animation: drop .2s ease;
  max-width: 90vw;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px) } }

/* ---------------- 课表 ---------------- */
/* 排课月历 */
.mo-card { padding: 0; overflow: hidden; }
.mo-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #f5f7fc; border-bottom: 1px solid #eef1f7; }
.mo-h { padding: 9px 10px; font-size: 12.5px; font-weight: 600; color: #475467; text-align: center; }
.mo-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mo-cell { min-height: 112px; border-right: 1px solid #f0f3f9; border-bottom: 1px solid #f0f3f9; padding: 7px 7px 9px; min-width: 0; background: #fff; }
.mo-cell:nth-child(7n) { border-right: 0; }
.mo-cell.out { background: #fbfcfe; }
.mo-cell.out .mo-d span { color: #c0c6d4; }
.mo-cell.today { background: #fff8f1; }
.mo-d { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.mo-d span { font-size: 12.5px; font-weight: 600; color: #344054; }
.mo-d i { font-style: normal; font-size: 10px; background: var(--brand); color: #fff; border-radius: 4px; padding: 0 3px; }
.mo-d b { margin-left: auto; font-weight: 500; font-size: 10.5px; color: #98a2b3; }
.mo-list { display: flex; flex-direction: column; gap: 4px; }
.mo-chip { display: flex; align-items: center; gap: 4px; border-left: 3px solid #4f46e5; background: #f5f7fd; border-radius: 5px; padding: 3px 5px; font-size: 11px; cursor: pointer; min-width: 0; }
.mo-chip:hover { background: #eef2fb; }
.mo-chip .t { color: #667085; flex: 0 0 auto; }
.mo-chip .n { color: #344054; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-chip.finished { opacity: .78; }
.mo-chip.cancelled { opacity: .5; text-decoration: line-through; }
.mo-chip .dot.ok { width: 5px; height: 5px; border-radius: 50%; background: #12b76a; margin-left: auto; flex: 0 0 auto; }
.mo-chip.ghost { background: #fbfcfe; border-left-style: dashed; border-left-color: #cbd5e1; color: #98a2b3; }
.mo-chip.ghost .n { color: #98a2b3; }
.mo-d b.pend { color: #d97706; }
.mo-more { font-size: 10.5px; color: var(--brand); }
@media (max-width: 780px) {
  .mo-cell { min-height: 76px; padding: 5px; }
  .mo-chip .n { display: none; }
  .mo-d b { display: none; }
}
.week-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.week-grid {
  display: grid; grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 10px; overflow-x: auto; padding-bottom: 6px;
}
.day-col {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 11px;
  min-height: 150px; display: flex; flex-direction: column;
}
.day-head {
  padding: 10px 10px 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 6px;
}
.day-head .dw { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.day-head .dd { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.day-col.today { border-color: #c7d2fe; background: #f8f9ff; }
.day-col.today .dw { color: var(--brand); }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.lesson-card {
  border-radius: 9px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  cursor: pointer; transition: all .15s;
}
.lesson-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.lesson-card .lt { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.lesson-card .ln { font-size: 12.5px; font-weight: 600; margin: 3px 0 2px; line-height: 1.35; }
.lesson-card .lm { font-size: 11px; color: var(--muted); }
.lesson-card.finished { opacity: .92; background: #f8fafc; }
.lesson-card.cancelled { opacity: .55; }
.lesson-card.cancelled .ln { text-decoration: line-through; }

/* ---------------- 点名 ---------------- */
.att-list { display: flex; flex-direction: column; }
.att-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid #f1f3f9;
}
.att-row:last-child { border-bottom: none; }
.att-name { font-weight: 550; min-width: 74px; }
.att-bal { font-size: 12px; color: var(--muted); min-width: 68px; }
.att-opts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.att-opt {
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  transition: all .12s;
}
.att-opt:hover { border-color: #cbd5e1; }
.att-opt.on.present { background: #dcfce7; border-color: #86efac; color: #15803d; font-weight: 600; }
.att-opt.on.late { background: #fef3c7; border-color: #fcd34d; color: #b45309; font-weight: 600; }
.att-opt.on.early { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; font-weight: 600; }
.att-opt.on.leave { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; font-weight: 600; }
.att-opt.on.absent { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 600; }
.att-opt.on.makeup { background: #cffafe; border-color: #67e8f9; color: #0e7490; font-weight: 600; }

/* ---------------- 时间轴 ---------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 16px 20px; border-left: 2px solid #eef1f8;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 2px;
  width: 8px; height: 8px; border-radius: 50%; background: #c7d2fe;
  box-shadow: 0 0 0 3px #fff;
}
.timeline .tl-t { font-size: 12.5px; font-weight: 600; }
.timeline .tl-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.timeline .tl-amt { float: right; font-weight: 600; font-size: 13px; }
.tl-amt.pos { color: var(--ok); }
.tl-amt.neg { color: var(--bad); }

/* ---------------- 可搜索下拉 ---------------- */
.ss { position: relative; }
.ss-input {
  width: 100%; padding: 9px 34px 9px 12px; border: 1px solid #dfe3ee; border-radius: 9px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ss-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.ss-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #98a2b3; font-size: 12px; pointer-events: none;
}
.ss-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; padding: 4px;
}
.ss-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.ss-item:hover, .ss-item.on { background: var(--brand-soft); color: var(--brand-600); }
.ss-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 表格上方的搜索/筛选条 */
.list-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.list-tools input, .list-tools select { width: auto; min-width: 150px; }
.list-tools .count { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ---------------- 工具 ---------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 130px; }
.filters .search-box { flex: 1 1 220px; min-width: 0; }
.filters .search-box input { width: 100%; }
@media (max-width: 640px) {
  .filters .search-box { flex: 1 1 100%; }
  .filters input, .filters select { min-width: 0; flex: 1 1 auto; }
  .date-in { flex: 0 1 44%; }
  .selbar { font-size: 12.5px; padding: 8px 10px; }
}
.search-box { position: relative; }
.search-box input { padding-left: 32px; min-width: 200px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 15px; cursor: pointer; border: none; background: none;
  color: var(--muted); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.progress { height: 6px; background: #eef1f8; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }

.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f4f6fb; }
.mini-item:last-child { border-bottom: none; }
.mini-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }

.notice-item { padding: 14px 0; border-bottom: 1px solid #f4f6fb; }
.notice-item:last-child { border-bottom: none; }
.notice-item h4 { margin: 0 0 4px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.notice-item p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.notice-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }

.skeleton {
  background: linear-gradient(90deg, #f1f3f9 25%, #e8ebf4 37%, #f1f3f9 63%);
  background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px;
}
@keyframes sk { from { background-position: 100% 50% } to { background-position: 0 50% } }

/* ---------------- 移动端 ---------------- */
.nav-mask { display: none; }
@media (max-width: 1080px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .grid.c2-1, .grid.c1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-side { min-height: 100vh; padding: 24px 18px; }

  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 260px; flex-basis: 260px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-mask.show {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45);
    z-index: 35; animation: fade .15s;
  }
  .menu-btn { display: grid; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; height: 56px; }
  .grid.c2 { grid-template-columns: 1fr; }
  .grid.c2-1, .grid.c1-2, .grid.c3 { grid-template-columns: 1fr; }
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .table-wrap table.wide { min-width: 760px; }
  .table-wrap table.wide .t-sub { white-space: nowrap; }
  .page-head h2 { font-size: 17px; }
  .stat .v { font-size: 22px; }
  .modal { max-width: 100%; max-height: 92vh; }
  .att-row { flex-wrap: wrap; gap: 8px; padding: 11px 13px; }
  .att-opts { width: 100%; margin-left: 0; }
  .att-opt { flex: 1; text-align: center; padding: 7px 4px; font-size: 12px; }
  .week-grid { grid-template-columns: repeat(7, 148px); }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .filters input, .filters select, .search-box input { min-width: 0; width: 100%; }
  .filters { gap: 8px; }
  .filters > * { flex: 1 1 140px; }
}
@media (max-width: 360px) {
  .auth-card { padding: 26px 20px; }
  .topbar h1 { font-size: 15px; }
  .grid.c4 { grid-template-columns: 1fr; }
}
