/* 道地药材班学员管理系统 · 自定义样式
   说明：只做「品牌变量 + 本地化覆盖 + 表格/组件增强」，不引入构建工具。
   所有颜色统一走 CSS 变量，改一处即可全站生效。 */

:root{
  --brand:#14508c;
  --brand-d:#0f3c6b;
  --brand-l:#e8eff7;

  /* 覆盖 Bootstrap 主题色，使 .text-primary / 焦点环 / 勾选框 / 分页 统一为品牌色 */
  --bs-primary: var(--brand);
  --bs-primary-rgb: 20,80,140;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 20,80,140;
  --bs-link-hover-color: var(--brand-d);
  --bs-link-hover-color-rgb: 15,60,107;
}

/* ---------- 按钮 / 分页 / 表单控件：品牌色 ---------- */
.btn-primary{
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-d); --bs-btn-hover-border-color: var(--brand-d);
  --bs-btn-active-bg: var(--brand-d); --bs-btn-active-border-color: var(--brand-d);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: 20,80,140;
}
.btn-outline-primary{
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-color: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: 20,80,140;
}
.btn-link{ --bs-btn-color: var(--brand); --bs-btn-hover-color: var(--brand-d); }
.pagination{
  --bs-pagination-color: var(--brand);
  --bs-pagination-hover-color: var(--brand-d);
  --bs-pagination-focus-color: var(--brand-d);
  --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(20,80,140,.25);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);
}
.dropdown-menu{ --bs-dropdown-link-active-bg: var(--brand); }
.form-control:focus,.form-select:focus{
  border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(20,80,140,.22);
}
.form-check-input:checked{ background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus{ border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(20,80,140,.22); }

/* ---------- 基础 ---------- */
body{ background:#f6f7f9; font-size:14px; }
.navbar{ background:var(--brand); }
.navbar .nav-link{ color:#dbe7f5; padding:.35rem .7rem; border-radius:6px; }
.navbar .nav-link:hover{ background:rgba(255,255,255,.12); color:#fff; }
.navbar .nav-link.active{ background:rgba(255,255,255,.2); color:#fff; font-weight:500; }
.navbar .dropdown-toggle{ color:#dbe7f5; }
.navbar .dropdown-menu{ border:1px solid #e3e6ea; border-radius:10px; padding:.3rem; font-size:13px; }
.navbar .dropdown-item{ border-radius:6px; padding:.3rem .6rem; }
.navbar-brand{ color:#fff; font-weight:500; letter-spacing:.5px; }
.navbar-toggler{ border-color:rgba(255,255,255,.4); }
.navbar-toggler:focus{ box-shadow:0 0 0 .2rem rgba(255,255,255,.2); }
.card{ border:1px solid #e3e6ea; border-radius:10px; }
footer{ color:#9aa0a6; font-size:12px; }

/* ---------- 表格 ---------- */
.table-sm td,.table-sm th{ padding:.35rem .5rem; vertical-align:middle; }
.table thead th{ background:#f0f3f7; font-weight:500; white-space:nowrap; }
.num{ text-align:right; font-variant-numeric:tabular-nums; }
.tbl-wrap{ overflow-x:auto; }

/* 宽表：表头与首列固定（滚动时姓名列不丢）
   用法：外层容器加 .tbl-sticky，需要固定在左侧的单元格加 .col-pin 并在 style 里给 left 偏移 */
.tbl-sticky{ overflow:auto; max-height:calc(100vh - 235px); }
.tbl-sticky thead th{ position:sticky; top:0; z-index:3; }
.tbl-sticky .col-pin{ position:sticky; z-index:2; background:#fff; }
.tbl-sticky thead th.col-pin{ z-index:4; background:#f0f3f7; }
.tbl-sticky tbody tr.table-danger td.col-pin{ background:#f8d7da; }
.tbl-sticky tbody tr:hover td.col-pin{ background:#f5f7fa; }

th.rot{ writing-mode:vertical-rl; text-orientation:mixed; height:110px; font-size:12px;
        font-weight:400; letter-spacing:1px; }

/* ---------- 出勤标记 ---------- */
.badge-soft{ font-weight:400; padding:.25em .5em; border-radius:4px; }
.d0{ background:#fbe9e9; color:#a32d2d; }      /* 缺勤 0 */
.d1{ background:#fbf0dd; color:#854f0b; }      /* 1 天 */
.d2{ background:#e6f3e6; color:#2f6b2f; }      /* 2 天 */
.dn{ background:#f1f1f1; color:#888; }         /* 未登记 */
.cell-d{ display:inline-block; width:26px; line-height:22px; text-align:center;
         border-radius:4px; font-variant-numeric:tabular-nums; }
.ok{ color:#2f6b2f; } .warn{ color:#854f0b; } .bad{ color:#a32d2d; }

/* 出勤分布实时计数 */
.dist-chip{ display:inline-flex; align-items:center; gap:.35rem; font-size:12px;
            color:#5f6368; padding:.1rem .45rem; border-radius:999px; background:#fff;
            border:1px solid #e3e6ea; }

/* ---------- 提示 / 统计 ---------- */
.stat-num{ font-size:22px; font-weight:500; }
.stat-lb{ color:#6b7280; font-size:12px; }
.hint{ color:#6b7280; font-size:12px; }
.req:after{ content:" *"; color:#c0392b; }

/* 图表容器：固定高度，避免 Chart.js 撑高卡片或无限自适应 */
.chart-box{ position:relative; width:100%; height:250px; }
.chart-box-lg{ height:430px; }            /* 地域分布：28 个省份全量条形 */
@media (max-width: 575.98px){ .chart-box{ height:220px; } .chart-box-lg{ height:360px; } }

/* ---------- 提交按钮加载态 ---------- */
.btn.is-busy{ pointer-events:none; opacity:.75; }
.btn.is-busy:after{
  content:""; display:inline-block; width:.75em; height:.75em; margin-left:.5em;
  border:2px solid currentColor; border-right-color:transparent; border-radius:50%;
  vertical-align:-1px; animation:wbspin .7s linear infinite;
}
@keyframes wbspin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .btn.is-busy:after{ animation:none; } }

/* ---------- 无障碍 ---------- */
:focus-visible{ outline:2px solid var(--brand-d); outline-offset:1px; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px;
          overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ---------- 打印 ---------- */
@media print{
  .navbar,footer,.no-print,.toast-container,.btn,.pagination{ display:none !important; }
  body{ background:#fff; }
  .card{ border:0; }
  .tbl-sticky,.tbl-wrap{ overflow:visible; max-height:none; }
  .table thead th{ background:#f0f3f7 !important; }
  a[href]:after{ content:""; }
}
