/* ===== 活体检测管理系统后台样式 ===== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #2c3e50;
  background: #f4f6f9;
}
a { color: #2980b9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 登录页 ========== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}
.login-box {
  width: 380px;
  background: #fff;
  padding: 32px 28px;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}
.login-box h1 { margin: 0 0 6px; font-size: 22px; text-align: center; color: #1e3c72; }
.login-box .sub { margin: 0 0 22px; text-align: center; color: #7f8c8d; font-size: 13px; }
.login-box label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 13px; }
.login-box input[type=text], .login-box input[type=password] {
  width: 100%; padding: 10px 12px; border: 1px solid #d5dbdb; border-radius: 5px; font-size: 14px;
}
.login-box input:focus { outline: none; border-color: #2980b9; box-shadow: 0 0 0 3px rgba(41,128,185,.12); }
.login-box button {
  width: 100%; margin-top: 22px; padding: 11px; background: #2980b9; color: #fff;
  border: 0; border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.login-box button:hover { background: #21618c; }
.login-box .err { margin-top: 14px; padding: 10px; background: #fdecea; color: #c0392b; border-radius: 5px; font-size: 13px; }
.login-box .locked { margin-top: 14px; padding: 10px; background: #fef9e7; color: #b7950b; border-radius: 5px; font-size: 13px; }

/* ========== 后台布局 ========== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #2c3e50;
  color: #ecf0f1;
  padding: 0;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 22px 18px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid #34495e;
  color: #fff;
}
.sidebar .brand small { display: block; font-weight: 400; color: #95a5a6; font-size: 11px; margin-top: 4px; }
.sidebar nav { padding: 12px 0; }
.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #bdc3c7;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar nav a:hover { background: #34495e; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #34495e; color: #fff; border-left-color: #3498db; }
.sidebar .foot { padding: 14px 20px; font-size: 11px; color: #7f8c8d; border-top: 1px solid #34495e; }

.main { flex: 1; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e8ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user-info { font-size: 13px; color: #555; }
.topbar .user-info a { margin-left: 14px; }
.content { padding: 22px 24px; flex: 1; }

/* ========== 卡片 / 统计 ========== */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #eee; }

.stat-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border-top: 3px solid #2980b9;
}
.stat-card.green { border-top-color: #27ae60; }
.stat-card.orange { border-top-color: #f39c12; }
.stat-card.red { border-top-color: #e74c3c; }
.stat-card.purple { border-top-color: #8e44ad; }
.stat-card .label { font-size: 12px; color: #7f8c8d; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: #2c3e50; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.chart-grid.full { grid-template-columns: 1fr; }
.chart-box { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.chart-box h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.chart-canvas-wrap { position: relative; height: 240px; }

/* ========== 表格 ========== */
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.table-toolbar .left, .table-toolbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table.data {
  width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef0f3; font-size: 13px; }
table.data th { background: #f7f9fb; font-weight: 600; color: #34495e; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfd; }
table.data td.code { font-family: Consolas, "Courier New", monospace; font-weight: 600; color: #2c3e50; }
table.data td.muted { color: #95a5a6; }
table.data td.wrap { word-break: break-all; max-width: 280px; }

/* ========== 标签 ========== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 11px; font-weight: 600; line-height: 18px; }
.tag.unused   { background: #eaf2f8; color: #2874a6; }
.tag.active   { background: #eafaf1; color: #1e8449; }
.tag.expired  { background: #fef5e7; color: #b9770e; }
.tag.disabled { background: #fdecea; color: #c0392b; }
.tag.info     { background: #eaf2f8; color: #2874a6; }
.tag.warning  { background: #fef5e7; color: #b9770e; }
.tag.error    { background: #fdecea; color: #c0392b; }
.tag.debug    { background: #eee; color: #555; }

/* ========== 表单元素 ========== */
input[type=text], input[type=password], input[type=number], select, textarea {
  padding: 8px 10px; border: 1px solid #d5dbdb; border-radius: 5px; font-size: 14px; font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2980b9; box-shadow: 0 0 0 2px rgba(41,128,185,.1); }
.btn {
  display: inline-block; padding: 8px 16px; background: #2980b9; color: #fff; border: 0;
  border-radius: 5px; font-size: 13px; cursor: pointer; font-weight: 500; text-decoration: none;
}
.btn:hover { background: #21618c; text-decoration: none; }
.btn.green { background: #27ae60; } .btn.green:hover { background: #1e8449; }
.btn.red   { background: #e74c3c; } .btn.red:hover { background: #c0392b; }
.btn.gray  { background: #95a5a6; } .btn.gray:hover { background: #7f8c8d; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
.form-row .hint { font-size: 12px; color: #95a5a6; margin-top: 4px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number],
.form-row select, .form-row textarea { width: 100%; max-width: 420px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

/* ========== 分页 ========== */
.pagination { display: flex; gap: 6px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 11px; border: 1px solid #d5dbdb; border-radius: 4px; background: #fff;
  font-size: 13px; color: #34495e;
}
.pagination a:hover { background: #2980b9; color: #fff; border-color: #2980b9; text-decoration: none; }
.pagination .current { background: #2980b9; color: #fff; border-color: #2980b9; }

/* ========== 消息提示 ========== */
.msg { padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; font-size: 13px; }
.msg.ok { background: #eafaf1; color: #1e8449; border: 1px solid #abebc6; }
.msg.err { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none;
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 8px; padding: 22px 24px; width: 480px; max-width: 92vw;
  max-height: 88vh; overflow: auto;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal .form-row input, .modal .form-row select { max-width: 100%; }

/* ========== 杂项 ========== */
.muted { color: #95a5a6; }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.checkbox-cell { width: 36px; text-align: center; }
.mono { font-family: Consolas, "Courier New", monospace; }
.nowrap { white-space: nowrap; }
hr.sep { border: 0; border-top: 1px solid #eee; margin: 14px 0; }
