* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2554c7;
  --primary-dark: #1e429f;
  --primary-light: #eef3ff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --border: #e2e8f0;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── 品牌头条：所有页面共用，建立统一识别 ── */
.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand-bar .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.brand-bar .name { font-size: 15px; font-weight: 600; color: var(--ink); }
.brand-bar .sub { font-size: 12px; color: var(--ink-faint); margin-left: 2px; }

/* ── 居中窄栏页面（登录/表单/状态查询） ── */
.page {
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.page-head { text-align: center; margin-bottom: 28px; }
.page-head h1 { font-size: 19px; font-weight: 700; color: var(--ink); }
.page-head p { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field input::placeholder { color: var(--ink-faint); }

button.primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { background: var(--ink-faint); cursor: not-allowed; }

.msg { margin-top: 14px; font-size: 13px; text-align: center; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pending  { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg);  color: var(--danger); }

a.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
}
a.pdf-link:hover { text-decoration: underline; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--ink-faint); }
.info-row .v { color: var(--ink); font-weight: 500; text-align: right; }

/* ── 宽屏后台页面 ── */
.admin-page { max-width: 1040px; margin: 0 auto; padding: 24px 24px 60px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.admin-header h1 { font-size: 20px; font-weight: 700; }
.toolbar-actions { display: flex; gap: 8px; }
.btn-ghost {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all .15s ease;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1.5px solid transparent; border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s ease;
}
.stat-card.active { border-color: var(--primary); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-card .label { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }

.search-row { margin-bottom: 16px; position: relative; }
.search-row input {
  width: 100%; padding: 10px 14px 10px 38px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; background: #fff;
}
.search-row input:focus { outline: none; border-color: var(--primary); }
.search-row::before {
  content: '⌕'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: 16px;
}

.table-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; font-size: 13.5px; }
th {
  background: #f8fafc; color: var(--ink-faint); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

.op-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.op-btns button, .op-btns a.btn-view {
  padding: 5px 12px; border: none; border-radius: 7px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; color: #fff; text-decoration: none; display: inline-block;
}
.btn-approve { background: var(--success); }
.btn-approve:hover { background: #15803d; }
.btn-reject { background: var(--danger); }
.btn-reject:hover { background: #b91c1c; }
.btn-delete { background: transparent; color: var(--ink-faint); border: 1.5px solid var(--border) !important; }
.btn-delete:hover { color: var(--danger); border-color: var(--danger) !important; }
.btn-view { background: var(--primary); }
.btn-view:hover { background: var(--primary-dark); }

.empty {
  text-align: center; padding: 56px 20px; color: var(--ink-faint); font-size: 13.5px;
}
.empty .icon { font-size: 32px; margin-bottom: 10px; opacity: .5; }

.reject-reason { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }

.footer-note {
  text-align: center; font-size: 12px; color: var(--ink-faint); margin-top: 28px;
}

/* ── 响应式：手机上表格横向滚动、统计卡片改2列、后台头部纵向堆叠 ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  .admin-page { padding: 16px 14px 48px; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn-ghost { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  table { min-width: 640px; }
}

@media (max-width: 480px) {
  .page { padding: 24px 16px 48px; }
  .card { padding: 22px 18px; }
  .brand-bar { padding: 14px 16px; }
}

/* ══════════════════════════════════════════════════════════
   小程序风格外壳：员工端手机页面用（顶部导航栏 + 底部Tab栏 + 单元格列表 + 底部固定按钮）
   ══════════════════════════════════════════════════════════ */

.mp-body { background: #f7f7f7; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
.mp-body.no-tabbar { padding-bottom: 24px; }

.mp-navbar {
  position: sticky; top: 0; z-index: 10;
  height: 50px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.mp-navbar .mp-back {
  position: absolute; left: 6px; top: 0; bottom: 0;
  display: flex; align-items: center;
  padding: 0 10px;
  font-size: 22px; color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mp-navbar .mp-back:active { opacity: .5; }
.mp-navbar .mp-title { font-size: 16px; font-weight: 600; color: var(--ink); }

.mp-content { max-width: 720px; margin: 0 auto; padding: 14px 14px 20px; }

.mp-cell-list {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
a.mp-cell, .mp-cell {
  display: block;
  padding: 13px 14px;
  border-bottom: 1px solid #f1f1f1;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.mp-cell-list > *:last-child { border-bottom: none; }
a.mp-cell:active, .mp-cell:active { background: #f7f7f7; }
.mp-cell-row { display: flex; align-items: center; justify-content: space-between; }
.mp-cell-row .chevron { color: #c8c9cc; font-size: 15px; margin-left: 8px; flex-shrink: 0; }

.mp-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mp-tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 0 6px;
  text-decoration: none;
  color: #9ca3af;
  font-size: 11px;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
}
.mp-tabbar a .mp-ic { font-size: 22px; line-height: 1; }
.mp-tabbar a.active { color: var(--primary); font-weight: 600; }

.mp-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}

button.primary:active { opacity: .8; }

.mp-empty {
  text-align: center; padding: 60px 20px; color: var(--ink-faint); font-size: 13.5px;
}
.mp-empty .icon { font-size: 36px; margin-bottom: 12px; opacity: .4; }
