/* ============================================================
   公安蓝主题 —— 工资查询系统
   设计规范：深蓝主色 + 深色侧边栏 + 政务风扁平
   ============================================================ */

:root {
  /* --- 公安蓝主色系 --- */
  --brand: #1B4B8C;             /* 主公安蓝 */
  --brand-dark: #0F3765;        /* 按下态深公安蓝 */
  --brand-hover: #2A5FA6;       /* hover 态 */
  --brand-light: #E6EEF8;       /* 浅色背景（badge、hover 底） */
  --brand-soft: #CFDEEF;        /* 更浅的蓝，用于表格强调条 */

  /* --- 通用 --- */
  --bg: #F0F4F9;                /* 内容区背景：冷灰白 */
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7785;
  --line: #dde4ee;

  /* --- 语义色（保持不变，避免主题覆盖操作警示） --- */
  --ok: #12805c;
  --danger: #c0392b;

  /* --- 深色侧边栏 --- */
  --sidebar-bg: #0F2C59;
  --sidebar-bg-deep: #0A1F42;
  --sidebar-text: #B3C4DE;      /* 默认菜单项文字：柔和浅蓝灰 */
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #1B4B8C;    /* 激活项 = 主公安蓝 */
  --sidebar-border: rgba(255, 255, 255, 0.12);

  /* --- 顶栏（无侧边栏时：员工工资页） --- */
  --topbar-bg: #1B4B8C;
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; color: var(--brand-hover); }

/* ============================================================
   顶部导航（无侧边栏场景：员工工资页）
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  background: var(--topbar-bg);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(15, 44, 89, 0.25);
}
.brand { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.brand:hover { text-decoration: none; color: #fff; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.nav a { color: rgba(255,255,255,0.85); }
.nav a:hover { color: #fff; }
.nav .who { color: rgba(255,255,255,0.7); }
.btn-link {
  border: none; background: none; color: rgba(255,255,255,0.85);
  cursor: pointer; font-size: 13px; padding: 0;
}
.btn-link:hover { color: #fff; }

.inline-form { display: inline; }

/* ============================================================
   内容容器
   ============================================================ */
.container { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }

.footer {
  text-align: center; color: var(--muted); font-size: 12px; padding: 24px;
}

/* ============================================================
   后台管理：左侧菜单
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 220px;
  width: 220px;
  background: var(--sidebar-bg);
  border-right: none;
  border-top: 3px solid var(--brand);   /* 顶栏一条主蓝，政务风点缀 */
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  box-shadow: 2px 0 8px rgba(15, 44, 89, 0.15);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  flex: 0 0 auto;
  letter-spacing: 0.5px;
}
.sidebar-brand::before {
  content: "";
  width: 6px; height: 22px;
  background: #FFD700;                   /* 金色小竖条，政务风标志 */
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-brand:hover { text-decoration: none; color: #fff; }

.side-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
}
.side-nav a {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px 0 18px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  border-left: 3px solid transparent;
  position: relative;
}
.side-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.side-nav a.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
  border-left-color: #FFD700;          /* 激活项左侧金色指示条 */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.sidebar-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px 20px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-deep);
}
.sidebar-foot .who {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; color: #fff;
}
.sidebar-foot .muted { color: rgba(255,255,255,0.65); font-size: 11px; }
.sidebar-foot .btn-link { color: rgba(255,255,255,0.75); font-size: 12px; }
.sidebar-foot .btn-link:hover { color: #ffd700; }

.main-area { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.main-area .container { width: 100%; }

/* ============================================================
   排版
   ============================================================ */
h1, h2, h3 { margin: 0 0 12px; font-weight: 600; color: var(--text); }
h2 { font-size: 22px; }
h3 { font-size: 16px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-light);
}
.page-head h2 { margin: 0; color: var(--brand); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 44, 89, 0.06);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--brand-light); border-color: var(--brand-soft); color: var(--brand); text-decoration: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-danger {
  color: var(--danger);
  border-color: #f0c8c2;
  background: #fdf3f2;
}
.btn-danger:hover { background: #fbe7e5; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; border-color: var(--line); color: var(--text); }
.btn-block { width: 100%; }

/* 表格操作列按钮 —— 强制固定样式，不被主题覆盖（经验教训） */
.table-actions .btn {
  height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px;
}

/* ============================================================
   表单
   ============================================================ */
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="file"], select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input.tiny { width: 64px; }
input.input-sm { height: 28px; width: 150px; font-size: 12px; padding: 0 8px; }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row input[type="text"], .form-row select { flex: 0 1 180px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.check input { height: auto; }

/* ============================================================
   表格
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600; font-size: 12px;
}
.table tbody tr:hover { background: var(--brand-light); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .total-row td { font-weight: 600; border-top: 2px solid var(--brand); color: var(--brand-dark); }

/* ============================================================
   标签 / 状态
   ============================================================ */
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; background: var(--brand-light); color: var(--brand); font-size: 12px; margin: 2px 4px 2px 0; }
.tag-ok { background: #e6f4ee; color: var(--ok); }
.tag-draft { background: #fff4e5; color: #a15c00; }

/* ============================================================
   统计 / 工作台卡片
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
  border-left: 4px solid var(--brand);   /* 左侧蓝条，公安蓝标志性元素 */
}
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.meta-grid { display: flex; gap: 28px; flex-wrap: wrap; }
.meta-grid > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.meta-grid .muted { font-size: 12px; }

.net-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--brand-light);
  border: 1px solid var(--brand-soft);
  border-left: 4px solid var(--brand);
}
.net-card strong { font-size: 24px; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ============================================================
   登录页
   ============================================================ */
.login-wrap { display: flex; justify-content: center; padding-top: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 22px; color: var(--brand); }
.login-card .form { max-width: none; }

/* ============================================================
   提示 / 进度
   ============================================================ */
.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fdf1f0; color: var(--danger); border: 1px solid #f2cfca; }
.alert-success { background: #e6f4ee; color: var(--ok); border: 1px solid #b6dcc5; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.steps li { margin-bottom: 6px; }

.error-list { margin: 0; padding-left: 20px; color: var(--danger); font-size: 13px; max-height: 320px; overflow: auto; }
.progress { width: 100%; height: 14px; background: #eef2f7; border-radius: 10px; overflow: hidden; margin: 12px 0 8px; }
.progress-bar { height: 100%; width: 0; background: var(--brand); border-radius: 10px; transition: width .3s ease; }
.progress-bar-failed { background: var(--danger); }

/* ============================================================
   打印工资条
   ============================================================ */
.print-toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.slip { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; max-width: 720px; margin: 0 auto; }
.slip-title { text-align: center; font-size: 20px; margin-bottom: 18px; color: var(--brand); }
.slip-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 13px; margin-bottom: 16px; }
.slip-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.slip-table th, .slip-table td { border: 1px solid #d8dee6; padding: 8px 10px; }
.slip-table th { background: var(--brand-light); color: var(--brand-dark); }
.slip-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.slip-net td { font-weight: 700; font-size: 15px; color: var(--brand); }
.slip-sign { display: flex; justify-content: space-between; margin-top: 28px; font-size: 13px; color: var(--muted); }

@media print {
  .topbar, .sidebar, .footer, .no-print { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .slip { border: none; padding: 0; }
  @page { margin: 15mm; }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 880px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    border-right: none;
    border-top: 3px solid var(--brand);
    box-shadow: none;
  }
  .sidebar-brand { height: 52px; }
  .side-nav { flex-direction: row; gap: 4px; overflow-x: auto; padding: 8px 10px; }
  .side-nav a { white-space: nowrap; padding: 8px 12px; height: 36px; border-left: none; border-radius: 4px; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 16px; }
  .sidebar-foot .who { flex-direction: row; gap: 8px; align-items: center; }
}

@media (max-width: 620px) {
  .table { font-size: 12px; }
  .table th, .table td { padding: 7px 6px; }
  .container { padding: 16px 12px 48px; }
  .topbar { height: auto; padding: 10px 14px; }
}
