/* =============================================================
   工地记工系统 · 样式表
   纯手写 CSS，无外部依赖，工地弱网环境下也能正常显示
   ============================================================= */

:root {
  --navy:        #17324d;
  --navy-2:      #23486e;
  --navy-3:      #2f5c8a;
  --accent:      #f0a020;
  --accent-2:    #ffb547;
  --ok:          #16a34a;
  --warn:        #d97706;
  --danger:      #dc2626;
  --info:        #0284c7;
  --primary:     #4f46e5;
  --muted:       #94a3b8;

  --bg:          #f1f5f9;
  --card:        #ffffff;
  --line:        #e2e8f0;
  --line-2:      #cbd5e1;
  --text:        #1e293b;
  --text-2:      #475569;
  --text-3:      #64748b;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --sh:    0 1px 3px rgba(15,23,42,.08);
  --sh-md: 0 4px 16px rgba(15,23,42,.10);
  --sh-lg: 0 12px 40px rgba(15,23,42,.16);
  --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 .8em; }

/* ---------------- 布局 ---------------- */
.admin-body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--navy);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--navy);
  font-weight: 800; font-size: 18px;
  border-radius: 9px;
}
.brand-text strong { display: block; color: #fff; font-size: 15px; }
.brand-text small { color: #7d94ad; font-size: 11px; letter-spacing: .4px; }

.menu { padding: 10px 8px; flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  color: #b6c6d6;
  border-radius: var(--r-sm);
  margin-bottom: 2px;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.menu-item.active { background: var(--navy-3); color: #fff; font-weight: 500; }
.menu-icon { width: 18px; text-align: center; opacity: .9; font-size: 15px; }
.sidebar-foot { padding: 10px 8px 16px; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 17px; margin: 0; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: #fff; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-2); font-size: 16px;
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.icon-btn .dot {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: grid; place-items: center; padding: 0 4px;
}
.menu-toggle { display: none; }

.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-2); color: #fff;
  display: grid; place-items: center; font-weight: 600;
}
.user-meta strong { display: block; font-size: 13px; line-height: 1.2; }
.user-meta small { color: var(--text-3); font-size: 11px; }
.logout { color: var(--text-3); font-size: 12px; padding-left: 8px; border-left: 1px solid var(--line); }

.content { padding: 18px 20px 40px; flex: 1; }

/* ---------------- 消息 ---------------- */
.flash-wrap { padding: 14px 20px 0; }
.flash-wrap.center { max-width: 460px; margin: 0 auto; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--r);
  margin-bottom: 8px; border: 1px solid; font-size: 13.5px;
  box-shadow: var(--sh);
}
.flash > span { font-weight: 700; flex: none; }
.flash > div { flex: 1; }
.flash-close {
  background: none; border: 0; cursor: pointer; color: inherit;
  opacity: .5; font-size: 17px; line-height: 1; padding: 0 2px;
}
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px;
}
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* ---------------- 统计卡 ---------------- */
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -18px; top: -18px;
  width: 78px; height: 78px; border-radius: 50%;
  background: currentColor; opacity: .07;
}
.stat-label { color: var(--text-3); font-size: 12.5px; margin-bottom: 6px; }
.stat-value { font-size: 25px; font-weight: 700; line-height: 1.15; letter-spacing: -.4px; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat.c-navy   { color: var(--navy); }
.stat.c-accent { color: #b45309; }
.stat.c-ok     { color: var(--ok); }
.stat.c-danger { color: var(--danger); }
.stat.c-info   { color: var(--info); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl th {
  background: #f8fafc;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  position: sticky; top: 0;
  z-index: 1;
}
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.wrap { white-space: normal; min-width: 160px; }
table.tbl tfoot td { background: #f8fafc; font-weight: 600; }
.tbl-empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.tbl-empty .big { font-size: 34px; opacity: .35; display: block; margin-bottom: 8px; }

.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.pos { color: var(--ok); }
.money.neg { color: var(--danger); }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-ok     { background: #dcfce7; color: #15803d; }
.badge-warn   { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info   { background: #dbeafe; color: #1d4ed8; }
.badge-muted  { background: #f1f5f9; color: #64748b; }
.badge-primary{ background: #e0e7ff; color: #4338ca; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  transition: all .14s;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #3d2a05; font-weight: 600; }
.btn-accent:hover { background: var(--accent-2); }
.btn-ok     { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; }
.btn-danger { background: #fff; border-color: #fca5a5; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-item.span-2 { grid-column: 1 / -1; }
.form-item label, .form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=month], input[type=search], input[type=tel], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .14s, box-shadow .14s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2394a3b8' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 28px;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(47,92,138,.13);
}
input[readonly] { background: #f8fafc; color: var(--text-3); }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--navy); cursor: pointer; }

.switch-group { display: flex; gap: 18px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }

/* 筛选栏 */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 14px; box-shadow: var(--sh);
}
.filters .f-item { min-width: 130px; }
.filters .f-item label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.filters .f-item input, .filters .f-item select { font-size: 13px; padding: 6px 10px; }
.filters .spacer { margin-left: auto; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 5px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination .pg {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px; background: #fff;
}
.pagination .pg:hover { background: #f8fafc; text-decoration: none; }
.pagination .pg.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.pagination .pg.disabled { opacity: .4; pointer-events: none; }
.pagination .dots { align-self: center; padding: 0 3px; color: var(--text-3); }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; height: 240px; position: relative; }
.chart canvas { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 4px 0; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* 纯 CSS 条形图（无需 JS） */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-name { width: 110px; flex: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 20px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--navy-3), var(--navy-2)); border-radius: 4px; transition: width .5s; }
.bar-value { width: 96px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------- 描述列表 ---------------- */
.desc { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; }
.desc-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.desc-item dt { color: var(--text-3); font-size: 12.5px; margin-bottom: 2px; }
.desc-item dd { margin: 0; font-size: 14px; font-weight: 500; }
.desc.span-2 { grid-column: 1 / -1; }

/* ---------------- 工资单 ---------------- */
.salary-sheet {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 28px; max-width: 860px; margin: 0 auto;
}
.sheet-head { text-align: center; border-bottom: 2px solid var(--navy); padding-bottom: 14px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0 0 4px; font-size: 20px; }
.sheet-head .sub { color: var(--text-3); font-size: 13px; }
.sheet-total { margin-top: 18px; padding: 14px 18px; background: #f8fafc; border-radius: var(--r); display: flex; justify-content: space-between; align-items: center; }
.sheet-total .amt { font-size: 26px; font-weight: 700; color: var(--navy); }

/* ---------------- 登录 / 空白页 ---------------- */
.blank-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1d4265 55%, #27567f 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: var(--r-lg);
  padding: 34px 30px; box-shadow: var(--sh-lg);
}
.login-box h1 { text-align: center; margin-bottom: 4px; font-size: 21px; }
.login-box .logo { text-align: center; font-size: 40px; margin-bottom: 6px; }
.login-box .tip { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 22px; }
.login-box .form-item { margin-bottom: 14px; }
.login-box .btn { padding: 10px; font-size: 15px; }
.login-box .foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-3); }

/* ---------------- 工人端 ---------------- */
.portal-body { background: #f4f6f8; padding-bottom: 62px; }
.p-topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  padding: 13px 16px; padding-top: calc(13px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
}
.p-topbar strong { font-size: 16px; }
.p-user { font-size: 13px; opacity: .85; }
.p-content { padding: 14px 12px 20px; }
.p-flash { padding: 12px 12px 0; }

.p-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.p-tab {
  flex: 1; text-align: center; padding: 7px 2px 6px;
  color: var(--text-3); font-size: 10.5px; text-decoration: none;
}
.p-tab-icon { display: block; font-size: 19px; margin-bottom: 1px; }
.p-tab.active { color: var(--navy); font-weight: 600; }
.p-tab:hover { text-decoration: none; }

.p-card {
  background: #fff; border-radius: var(--r);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.p-card-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.p-card-title .more { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }

.p-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff; border-radius: var(--r-lg);
  padding: 20px 18px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(23,50,77,.25);
}
.p-hero .hello { font-size: 13px; opacity: .85; }
.p-hero .name { font-size: 19px; font-weight: 600; margin: 2px 0 14px; }
.p-hero-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; text-align: center; }
.p-hero-grid .v { font-size: 19px; font-weight: 700; }
.p-hero-grid .l { font-size: 11px; opacity: .8; margin-top: 1px; }

.p-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 12px; }
.p-stat {
  background: #fff; border-radius: var(--r); padding: 13px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.p-stat .l { font-size: 11.5px; color: var(--text-3); }
.p-stat .v { font-size: 19px; font-weight: 700; margin-top: 2px; }
.p-stat .v.accent { color: var(--accent); }
.p-stat .v.ok { color: var(--ok); }
.p-stat .v.warn { color: var(--warn); }

.p-list { display: flex; flex-direction: column; }
.p-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; color: inherit;
}
.p-item:last-child { border-bottom: 0; }
.p-item .info { flex: 1; min-width: 0; }
.p-item .t { font-size: 13.5px; font-weight: 500; }
.p-item .s { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.p-item .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-item:active { background: #f8fafc; }

.p-btn {
  display: block; width: 100%; padding: 13px;
  background: var(--accent); color: #3d2a05;
  border: 0; border-radius: var(--r);
  font-size: 16px; font-weight: 700; text-align: center;
  cursor: pointer; font-family: inherit;
}
.p-btn:active { opacity: .85; }
.p-btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--line-2); }

.p-cal { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.p-cal .dow { text-align: center; font-size: 11px; color: var(--text-3); padding: 4px 0; font-weight: 600; }
.p-cal .day {
  aspect-ratio: 1; border-radius: var(--r-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px; background: #f8fafc; color: var(--text-2);
  border: 1px solid transparent;
}
.p-cal .day.blank { background: transparent; }
.p-cal .day.has { background: #e0f2fe; color: #075985; font-weight: 600; }
.p-cal .day.today { border-color: var(--accent); }
.p-cal .day .amt { font-size: 9.5px; opacity: .85; }
.p-cal .day.reject { background: #fee2e2; color: #b91c1c; }

/* ---------------- 工具类 ---------------- */
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12.5px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-num { font-variant-numeric: tabular-nums; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.link-danger { color: var(--danger); }
.link-ok { color: var(--ok); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.note {
  background: #f8fafc; border-left: 3px solid var(--navy-3);
  padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px; color: var(--text-2); margin-bottom: 14px;
}
.note.warn { background: #fffbeb; border-left-color: var(--warn); }
.note.ok { background: #f0fdf4; border-left-color: var(--ok); }
.alert-inline {
  display: inline-block; padding: 3px 9px; border-radius: var(--r-sm);
  background: #fef3c7; color: #b45309; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kv-inline { display: inline; }
.kv-inline b { font-size: 17px; }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; color: var(--text-2); font-size: 13.5px;
  border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none;
}
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tab .cnt { font-size: 11px; background: var(--danger); color: #fff; border-radius: 9px; padding: 0 5px; margin-left: 4px; }

/* 模态框 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-backdrop.show { display: grid; }
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%;
  max-width: 460px; box-shadow: var(--sh-lg); overflow: hidden;
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; }
.modal-head .x { margin-left: auto; cursor: pointer; border: 0; background: none; font-size: 20px; color: var(--text-3); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* 批量操作条 */
.bulk-bar {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: var(--r);
  display: none; align-items: center; gap: 12px;
  box-shadow: var(--sh-md); margin-top: 12px;
}
.bulk-bar.show { display: flex; }
.bulk-bar .count { font-size: 13px; }

/* 响应式 */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--sh-lg); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 30px; }
  .flash-wrap { padding: 12px 12px 0; }
  .user-meta { display: none; }
}
@media (max-width: 620px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .desc { grid-template-columns: 1fr; }
  .stat-value { font-size: 21px; }
  .topbar { padding: 0 12px; }
  .page-title { font-size: 15.5px; }
  table.tbl th, table.tbl td { padding: 8px 9px; font-size: 12.5px; }
  .salary-sheet { padding: 18px 14px; }
}

@media print {
  .sidebar, .topbar, .btn, .filters, .pagination, .bulk-bar, .flash-wrap { display: none !important; }
  .main { margin-left: 0; }
  .card, .salary-sheet { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}
