/* SG_X_LessonTracker 全局样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f7; color: #1f2329; font-size: 14px;
}
.boot-splash { padding: 60px; text-align: center; color: #8a8f99; }

/* 布局 */
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: #1f2937; color: #fff; padding: 0 20px; height: 48px;
}
.topbar .brand { font-weight: 700; font-size: 15px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: #cbd2dc; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 13px;
}
.topbar nav a.active, .topbar nav a:hover { background: #374151; color: #fff; }
.topbar .who { font-size: 12px; color: #9ca3af; }
.topbar .who button {
  margin-left: 10px; background: #374151; color: #fff; border: none;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.main { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* 通用组件 */
.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.btn {
  display: inline-block; background: #2563eb; color: #fff; border: none; cursor: pointer;
  padding: 7px 16px; border-radius: 7px; font-size: 13px; text-decoration: none;
}
.btn:hover { background: #1d4ed8; }
.btn.gray { background: #6b7280; }
.btn.gray:hover { background: #4b5563; }
.btn.red { background: #dc2626; }
.btn.red:hover { background: #b91c1c; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f3; font-size: 13px;
}
table.list th { color: #6b7280; font-weight: 600; background: #f9fafb; }
table.list tr:hover td { background: #f8fafc; }

/* 排班表 instructor 只读回退：对齐 Univer 观感（细网格线、不断词、每教练一行） */
table.ro-grid { table-layout: fixed; }
table.ro-grid th, table.ro-grid td {
  text-align: center; padding: 2px 6px; font-size: 12px; line-height: 1.35;
  border: 1px solid #e5e7eb; white-space: nowrap; overflow: hidden;
}
table.ro-grid tbody tr:hover td { background: inherit; }

input[type=text], input[type=password], input[type=date], input[type=number],
input[type=month], input.input, select.input, select {
  border: 1px solid #d1d5db; border-radius: 7px; padding: 7px 10px; font-size: 13px; outline: none;
}
input:focus, select:focus { border-color: #2563eb; }

/* 周课表格网（紧凑：一屏≈一周，纵向看全一天 24 行，便于截屏） */
table.bd-table { min-width: 1100px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
table.bd-table th, table.bd-table td {
  padding: 1px 5px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.bd-table th:not(.bd-time-col), table.bd-table td:not(.bd-time-col) { width: 150px; }  /* 列宽：一屏≈7天 */
table.bd-table tbody tr, table.bd-table td { height: 18px; }  /* 行高统一 */
table.bd-table th { font-size: 11px; line-height: 1.25; padding: 2px 5px; }
.bd-time-col {
  position: sticky; left: 0; background: #f9fafb; z-index: 2;
  width: 52px; text-align: center; overflow: visible; font-size: 11px;
}
.bd-cell { cursor: pointer; border: 1px solid #f3f4f6; line-height: 1.15; position: relative; }
.bd-dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px;
  border-radius: 50%; background: #DC2626;
  pointer-events: none; z-index: 1; }
.bd-dot.ring { background: transparent; border: 2px solid #DC2626; }
.bd-dot.unassigned { background: #16A34A; }  /* 待指派教练：绿色实心（区别于进度未填的红实心） */
.bd-mark { position: absolute; bottom: 2px; right: 2px; width: 9px; height: 9px;
  border-radius: 50%; background: #F59E0B; pointer-events: none; z-index: 1; }  /* 有事件/备注：右下角橙点，与红圆点同尺寸 */
/* 进度 tab 折叠层 */
.prog-sec-hd { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0 4px; user-select: none; }
.prog-sec-bd { border-top: 1px dashed #e5e7eb; padding-top: 6px; margin-bottom: 4px; }
.bd-coach { font-size: 9px; opacity: .7; line-height: 1; }
/* 场地外教学同时段多教练并存：格内左右并排（td 保持 table-cell 保住 rowspan，flex 在内层 div），列宽随条数外扩 */
.bd-multi { padding: 1px 3px; cursor: pointer; position: relative; }
.bd-multi-row { display: flex; height: 100%; }
.bd-multi-row .bd-multi { flex: 1 1 0; min-width: 0; border-right: 1px dashed rgba(0,0,0,.15); }
.bd-multi-row .bd-multi:last-child { border-right: none; }
/* 店内拼课：同格 pair_seq 0/1 两条独立 booking，纵向全宽堆叠、虚线分隔，块首学员小标 */
.bd-multi-stack { display: flex; flex-direction: column; height: 100%; }
.bd-multi-stack .bd-multi { flex: 1 1 0; min-height: 0; border-bottom: 1px dashed rgba(0,0,0,.15); }
.bd-multi-stack .bd-multi:last-child { border-bottom: none; }
.bd-duty-cell { border: 1px solid #f3f4f6; font-weight: 600; text-align: center; }
/* 快录弹窗上课人 chips：默认灰、选中蓝 */
.bp-chip { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 10px;
  font-size: 12px; cursor: pointer; background: #F3F4F6; border: 1px solid #E5E7EB; }
.bp-chip.on { background: #DBEAFE; border-color: #3B82F6; }
/* 快录弹窗（约课编辑对话框）：横向 Tab + 统一框体 */
.bp-tab { display: flex; gap: 2px; border-bottom: 1px solid #E5E7EB; margin-bottom: 12px; }
.bp-tab button { padding: 6px 16px; border: none; background: none; font-size: 13px;
  color: #8a8f99; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.bp-tab button.on { color: #111827; border-bottom-color: #3B82F6; font-weight: 600; }
.bp-label { display: block; font-size: 12px; color: #8a8f99; margin: 0 0 4px; }
.bp-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: nowrap; }
#bd-popover .input, #bd-popover select.input {
  height: 36px; padding: 6px 10px; font-size: 13px; border-radius: 6px; }
#bd-popover .btn { height: 30px; }
/* 截屏模式：工具栏等已由 JS 隐藏，这里压缩格网周边留白 */
#bd-grid table { margin: 0; }
#bd-toolbar .input, #bd-toolbar .btn { padding: 3px 8px; font-size: 12px; }

/* 日视图信息卡：左=主信息（学员+手机+课程/教练），右=上课人列表（姓名+鞋码+上次→本次水平） */
table.bd-day-table tbody tr, table.bd-day-table td { height: auto; }
table.bd-day-table td { white-space: normal; vertical-align: top; }
table.bd-day-table th:not(.bd-time-col),
table.bd-day-table td:not(.bd-time-col) { width: auto; min-width: 200px; }
.bd-cell-day { padding: 3px 6px; font-size: 12px; line-height: 1.3; }
.bd-day-card { display: flex; gap: 8px; align-items: flex-start; }
.bd-day-main { flex: 1 1 50%; min-width: 0; }
.bd-day-stu { font-size: 13px; font-weight: 700; color: #111827; line-height: 1.3; }
.bd-day-stu .ph { font-size: 11px; font-weight: 400; color: #374151; margin-left: 8px; }
.bd-day-course { font-size: 11px; font-weight: 600; color: #374151; margin-top: 2px; }
.bd-day-atts { flex: 1 1 50%; min-width: 0; border-left: 1px solid rgba(0,0,0,.12); padding-left: 8px; }
.bd-day-att { font-size: 11px; line-height: 1.4; color: #111827; }
.bd-day-att .shoe { font-size: 10px; margin-left: 3px; }
.bd-day-prog { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-day-prog.cur { color: #1d4ed8; }
/* 日视图场外地教学列收起开关 */
.bd-day-bar { display: flex; gap: 14px; margin-bottom: 6px; font-size: 12px; color: #374151; }
.bd-venue-tg { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.msg.err { background: #fee2e2; color: #b91c1c; }
.msg.ok { background: #dcfce7; color: #15803d; }
.muted { color: #8a8f99; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 登录页 */
.login-wrap { max-width: 380px; margin: 10vh auto; }
.login-wrap .card h2 { text-align: center; }
.login-wrap input { width: 100%; margin-bottom: 12px; padding: 10px 12px; }
.login-wrap .btn { width: 100%; padding: 10px; }

/* 颜色点 */
.color-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -1px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15);
}

/* 双店排班区块 */
.store-section { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.store-head {
  padding: 8px 12px; background: #F9FAFB; border-bottom: 1px solid #e5e7eb;
  cursor: pointer; user-select: none; gap: 8px;
}
.store-head:hover { background: #F3F4F6; }
.store-head .fold-toggle { display: inline-block; width: 14px; color: #6B7280; }
.store-body { padding: 8px; }
.msg { white-space: normal; line-height: 1.6; }
.store-head .store-stats { font-size: 12px; margin-left: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-head b { flex-shrink: 0; }

/* 看板备注双列：左固定约课 / 右备注 */
.bn-wrap { display: flex; gap: 12px; align-items: flex-start; }
.bn-col { flex: 1; min-width: 0; background: #fff; border-radius: 10px;
  padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bn-head { font-weight: 600; font-size: 13px; margin-bottom: 6px;
  display: flex; align-items: center; }
.bn-add { margin-left: auto; cursor: pointer; color: #2563eb; font-size: 16px;
  padding: 0 4px; line-height: 1; user-select: none; }
.bn-add:hover { color: #1d4ed8; }
.bn-item { display: flex; align-items: center; gap: 6px; padding: 5px 2px;
  border-bottom: 1px dashed #f3f4f6; font-size: 13px; }
.bn-item:last-child { border-bottom: none; }
.bn-cb { flex-shrink: 0; cursor: pointer; }
.bn-text { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-all; }
.bn-item.done { opacity: .45; }
.bn-item.done .bn-text { text-decoration: line-through; }
.bn-item.overdue { color: #DC2626; font-weight: 600; }
.bn-item.overdue .bn-dl { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
.bn-ico { cursor: pointer; color: #9CA3AF; font-size: 13px; padding: 0 3px;
  user-select: none; flex-shrink: 0; }
.bn-ico:hover { color: #2563eb; }
.bn-ico.del:hover { color: #DC2626; }
.bn-dl { font-size: 11px; color: #8a8f99; border: 1px solid #e5e7eb;
  border-radius: 4px; padding: 0 4px; margin-left: 6px; font-weight: 400; }
.bn-dl-in { border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 6px;
  font-size: 12px; flex-shrink: 0; }
.bn-edit { background: #F8FAFC; border-radius: 6px; padding: 6px; }
.bn-in { height: 30px; font-size: 13px; min-width: 0; }
.bn-tag { font-size: 10px; color: #8a8f99; border: 1px solid #e5e7eb;
  border-radius: 4px; padding: 0 3px; margin-left: 4px; }

/* 一键约课对话框 */
.rb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.rb-pop { width: 560px; max-width: 94vw; max-height: 84vh; overflow-y: auto; }
.rb-pop h2 { font-size: 15px; }
.rb-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.rb-lb { flex: none; font-size: 12px; color: #6b7280; width: 30px; }
.rb-hints { margin: -4px 0 8px 36px; }
.rb-hint { padding: 5px 10px; border-bottom: 1px solid #f3f4f6; cursor: pointer; font-size: 13px; }
.rb-hint:hover { background: #f8fafc; }
.rb-dates { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto;
  border: 1px solid #eef0f3; border-radius: 6px; padding: 6px 8px; }
.rb-date { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.rb-date.past { opacity: .55; }
.rb-clash { color: #b91c1c; font-size: 11px; }
