/* ==========================================================
   工时统计系统 · 后端管理控制台样式
   主题：现代化 SaaS 风格（靛蓝 → 紫 渐变 + 细腻阴影/动效）
   说明：保留了原有全部类名，仅做视觉与体验升级。
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --border: #e5e8f2;
  --border-strong: #d5dae8;
  --text: #26304a;
  --text-2: #565f78;
  --muted: #8e95ab;
  --primary: #4f6ef5;
  --primary-deep: #3e56d8;
  --primary-soft: #eef1fe;
  --green: #16b07d;
  --orange: #ef9336;
  --red: #ec5b5b;
  --purple: #8b5cf6;
  --cyan: #0ea5e9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(38, 48, 74, .05), 0 6px 18px rgba(38, 48, 74, .06);
  --shadow-md: 0 10px 30px rgba(38, 48, 74, .12);
  --shadow-lg: 0 22px 60px rgba(18, 24, 60, .2);
  --grad-main: linear-gradient(120deg, #5b7cfa, #8a5cf5);
  --grad-deep: linear-gradient(120deg, #242d63, #3f49c7 55%, #6d3fd8);
  --ease: .18s ease;
}

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

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 88% -8%, rgba(124, 92, 255, .10), transparent 60%),
    radial-gradient(900px 520px at -12% 32%, rgba(79, 109, 245, .08), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9cfdd; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab2c6; border: 2px solid transparent; background-clip: content-box; }

/* ---------- 登录页 ---------- */
#loginView {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 620px at 12% 8%, rgba(255, 255, 255, .16), transparent 58%),
    radial-gradient(720px 540px at 88% 92%, rgba(255, 255, 255, .12), transparent 60%),
    linear-gradient(135deg, #2f3f9e 0%, #4f54d8 45%, #7c46d8 100%);
}
.login-decor { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.login-decor-a { width: 340px; height: 340px; top: -120px; right: -90px; background: rgba(255, 255, 255, .10); }
.login-decor-b { width: 260px; height: 260px; bottom: -110px; left: -70px; background: rgba(255, 255, 255, .08); }
.login-card {
  position: relative;
  width: 412px; max-width: 100%;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 40px 38px 30px;
  box-shadow: 0 24px 70px rgba(15, 20, 55, .32);
  animation: riseIn .4s cubic-bezier(.22, .9, .3, 1.15);
}
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: var(--grad-main);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(91, 124, 250, .35);
}
.login-title { font-size: 25px; font-weight: 800; text-align: center; color: var(--text); letter-spacing: 1px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 26px; letter-spacing: .4px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }
.login-hint { font-size: 12px; color: #9aa0b3; text-align: center; margin-top: 18px; line-height: 1.8; }

/* ---------- 顶部导航 ---------- */
.topbar {
  height: 58px;
  background: var(--grad-deep);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(30, 40, 90, .18);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 800; letter-spacing: 1px; white-space: nowrap;
}
.brand .brand-ic {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; border-radius: 9px; background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.topbar-user { font-size: 13px; display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.topbar-user .tag { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #fff; font-weight: 500; }
.topbar-user b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.topbar-user button {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45);
  color: #fff; border-radius: 8px; padding: 5px 14px; cursor: pointer; font-size: 13px;
  transition: background var(--ease), transform var(--ease);
}
.topbar-user button:hover { background: rgba(255, 255, 255, .28); }

/* ---------- 布局 ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: 216px; background: rgba(255, 255, 255, .9);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  flex-shrink: 0;
  position: sticky; top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  backdrop-filter: blur(6px);
}
.side-group {
  font-size: 11px; font-weight: 600; color: #a2a8bd;
  padding: 14px 12px 6px; letter-spacing: 2px;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; cursor: pointer;
  color: #4b5268; font-size: 14px;
  transition: background var(--ease), color var(--ease), transform var(--ease);
}
.side-item:hover { background: var(--primary-soft); color: var(--primary-deep); }
.side-item.active {
  background: var(--grad-main); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(91, 124, 250, .35);
}
.side-item .side-ic { font-size: 16px; line-height: 1; filter: grayscale(.1); }
.side-item.active .side-ic { filter: none; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; overflow-x: auto; }

/* ---------- 页面标题 / 卡片 ---------- */
.page-title { font-size: 19px; font-weight: 800; margin-bottom: 14px; color: var(--text); letter-spacing: .4px; }
.page-title + .card { animation: riseIn .28s ease; }
.card {
  background: var(--surface);
  border: 1px solid rgba(229, 232, 242, .9);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  animation: riseIn .3s ease;
}

/* ---------- 工具条 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.toolbar select, .toolbar input,
.form-group select, .form-group input {
  height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px; color: var(--text);
  background: #fff; outline: none; transition: border-color var(--ease), box-shadow var(--ease);
}
.toolbar select { min-width: 120px; }
.toolbar select:focus, .toolbar input:focus,
.form-group select:focus, .form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 245, .13);
}
.toolbar input::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: #b4bac9; }

/* ---------- 统计卡片 ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stat-card {
  --accent: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px; min-width: 156px; flex: 1;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: riseIn .3s ease;
}
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--accent);
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 55%, transparent));
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); cursor: pointer; }
.stat-card .num {
  font-size: 27px; font-weight: 800; color: var(--accent);
  line-height: 1.2; letter-spacing: .5px;
}
.stat-card .lab { font-size: 13px; color: var(--muted); margin-top: 5px; }
.stat-card.green  { --accent: var(--green); }
.stat-card.orange { --accent: var(--orange); }
.stat-card.red    { --accent: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef0f6; white-space: nowrap; }
th {
  background: #f7f8fd; color: #6a7290; font-weight: 600;
  font-size: 12px; letter-spacing: .4px; position: sticky; top: 0;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: #f7f9ff; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px;
  background: var(--primary-soft); color: var(--primary-deep); font-weight: 500;
}
.tag-blue   { background: #e3f2fd; color: #1565c0; }
.tag-green  { background: #e6f7f0; color: #0e8a62; }
.tag-orange { background: #fff3e0; color: #d9730b; }
.tag-red    { background: #ffeaea; color: #cf3a3a; }
.tag-gray   { background: #eef1f5; color: #5d6678; }
.tag-purple { background: #f1e9ff; color: #7c3aed; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  height: 34px; padding: 0 15px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none;
  font-family: inherit; white-space: nowrap;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease, color .15s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: 0 4px 12px rgba(91, 124, 250, .32); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(91, 124, 250, .4); filter: brightness(1.04); }
.btn-success { background: linear-gradient(120deg, #1fbf8c, #12a06f); color: #fff; box-shadow: 0 4px 12px rgba(31, 191, 140, .28); }
.btn-success:hover { filter: brightness(1.05); }
.btn-danger { background: linear-gradient(120deg, #f4686b, #e14a4a); color: #fff; box-shadow: 0 4px 12px rgba(236, 91, 91, .26); }
.btn-danger:hover { filter: brightness(1.04); }
.btn-warn { background: linear-gradient(120deg, #f6a94f, #ee8a2c); color: #fff; box-shadow: 0 4px 12px rgba(239, 147, 54, .26); }
.btn-warn:hover { filter: brightness(1.05); }
.btn-gray { background: #f0f2f8; color: #4b5268; border: 1px solid var(--border-strong); }
.btn-gray:hover { background: #e6e9f2; }
.btn-block { width: 100%; height: 40px; font-size: 15px; letter-spacing: 6px; margin-top: 4px; border-radius: 10px; }
.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; margin: 0 2px; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; filter: grayscale(.2); }
.link-btn {
  color: var(--primary); background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 2px 4px; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%; height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13px; outline: none; background: #fff; color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-group textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13px; outline: none; background: #fff; color: var(--text);
  resize: vertical; min-height: 70px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-group input:disabled { background: #f5f6fa; color: #7b8298; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .btn { min-width: 76px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(19, 24, 48, .5); backdrop-filter: blur(3px); animation: fadeIn .18s ease; }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 560px; max-width: 100%;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: zoomIn .22s cubic-bezier(.22, .9, .3, 1.1);
}
.modal-head {
  padding: 15px 20px; font-size: 15px; font-weight: 700;
  border-bottom: 1px solid #f0f1f7;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(#fbfcff, #fff);
}
.modal-close {
  border: none; background: #f1f2f9; color: #6a7290;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; cursor: pointer; line-height: 1;
  transition: background var(--ease), color var(--ease);
}
.modal-close:hover { background: #e3e6f3; color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-lg { width: 900px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 74px; left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 41, 68, .88); color: #fff;
  padding: 10px 24px; border-radius: 12px; z-index: 300;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 20, 55, .28);
  backdrop-filter: blur(4px);
  animation: toastIn .25s cubic-bezier(.22, .9, .3, 1.1);
}
.toast.ok  { background: rgba(22, 176, 125, .93); }
.toast.err { background: rgba(225, 74, 74, .93); }

/* ---------- 勾选 chips ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow-y: auto; padding: 6px 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 4px 12px; cursor: pointer; font-size: 13px; user-select: none;
  background: #fff; transition: background var(--ease), border-color var(--ease);
}
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--grad-main); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(91, 124, 250, .3); }
.chip .hours { font-size: 11px; opacity: .8; }

/* ---------- 审批中心标签页 ---------- */
.ap-tab {
  min-width: 84px; border-radius: 20px !important;
  box-shadow: none !important;
}
.chip-x { font-style: normal; cursor: pointer; margin-left: 4px; opacity: .75; transition: opacity var(--ease); }
.chip-x:hover { opacity: 1; }

/* ---------- 工作台 · 快速入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.quick-card {
  position: relative;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  overflow: hidden;
}
.quick-card::after {
  content: "→";
  position: absolute; right: 16px; bottom: 14px;
  font-size: 16px; color: #c9cfdd; transition: color var(--ease), transform var(--ease);
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(79, 110, 245, .45); }
.quick-card:hover::after { color: var(--primary); transform: translateX(3px); }
.quick-card .ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(79, 110, 245, .08);
}
.quick-card .tt { font-size: 15px; font-weight: 700; margin: 12px 0 4px; }
.quick-card .ds { font-size: 12px; color: var(--muted); padding-right: 22px; }
.summary-line { font-size: 13px; color: var(--text-2); margin: 6px 0; }

/* ---------- 动效 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; position: static; height: auto;
    display: flex; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 10px 12px; gap: 6px; overflow: visible;
  }
  .side-group { display: none; }
  .side-item { margin: 0; }
  .main { padding: 16px 14px 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar-user b { display: none; }
}
@media (max-width: 520px) {
  .brand { font-size: 15px; }
  .stat-card { min-width: 130px; }
}
