:root {
  --bg: #f5f8ff;
  --ink: #071b4f;
  --muted: #65749a;
  --line: #dce6f7;
  --panel: #fff;
  --deep: #022a99;
  --deep-2: #003bc0;
  --blue: #0f56d9;
  --blue-soft: #eef4ff;
  --lime: #b7f800;
  --lime-2: #9ee600;
  --green: #09935f;
  --amber: #c17600;
  --red: #d33f49;
  --shadow: 0 10px 28px rgba(4, 38, 116, .07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15, 86, 217, .14); }
button.ghost { color: var(--deep); background: var(--blue-soft); }
button.danger { background: var(--red); }
button.mini {
  padding: 5px 9px;
  color: var(--blue);
  background: #f3f7ff;
  border: 1px solid var(--line);
  font-size: 12px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(2, 42, 153, .08);
}
textarea { min-height: 76px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #e9eef8;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  vertical-align: top;
}
th {
  color: #405482;
  background: #f5f8ff;
  font-weight: 900;
}
tr:last-child td { border-bottom: 0; }
.hidden { display: none !important; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(183, 248, 0, .18), transparent 28%),
    linear-gradient(135deg, #022a99 0%, #053bb8 48%, #f5f8ff 48%);
}
.login-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 70px rgba(2, 42, 153, .18);
}
.login-card h1, .login-card h2 { margin-top: 6px; color: var(--deep); }
.eyebrow { color: var(--deep); font-weight: 900; }
.form { display: grid; gap: 12px; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 14px;
  color: #fff;
  background: linear-gradient(180deg, #0232aa 0%, #022a99 58%, #011d73 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .08);
  overflow-y: auto;
}
.sidebar::after {
  content: "张三\A财务BP";
  white-space: pre;
  margin: auto 8px 0;
  padding: 12px 0 0 44px;
  min-height: 38px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.brand {
  display: grid;
  gap: 22px;
  margin: 0 6px 22px;
}
.brand b {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}
.brand span {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  line-height: 1.8;
}
.brand span::before {
  content: "当前公司\A";
  white-space: pre;
  display: block;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
}
.sidebar button {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0 14px 0 42px;
  color: rgba(255, 255, 255, .9);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
}
.sidebar button::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
  opacity: .9;
}
.sidebar button::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: .55;
}
.sidebar button:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, .08);
}
.sidebar button.active {
  color: #04245f;
  background: linear-gradient(90deg, var(--lime) 0%, var(--lime-2) 100%);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 12px 24px rgba(183, 248, 0, .24);
}
.sidebar button.danger {
  margin-top: 10px;
  color: #ffdce1;
}

main {
  min-width: 0;
  padding: 0;
  background: var(--bg);
}
.topbar {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 0 26px;
  margin: 0;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(8, 39, 108, .04);
}
.topbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}
.topbar::after {
  content: "通知  帮助  导出";
  color: #15336f;
  font-size: 13px;
  font-weight: 800;
}
.page {
  display: grid;
  gap: 16px;
  padding: 22px 24px;
}

.panel, .card, .metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.panel h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
}
.panel p { margin: 0; color: var(--ink); line-height: 1.85; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }

.metric {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  padding: 22px 24px;
}
.metric::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 32px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(183, 248, 0, .34), rgba(15, 86, 217, .08)),
    var(--blue-soft);
}
.metric span, .metric small { color: #405482; }
.metric span { font-weight: 900; }
.metric strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.tags {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.tag, .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}
.tag { color: var(--deep); background: #eaf2ff; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pick { color: var(--deep); background: #f3f7ff; border: 1px solid var(--line); }
.pick.active { color: #04245f; background: var(--lime); border-color: var(--lime); }
.status.good { color: var(--green); background: #e5f7ee; }
.status.warn { color: var(--amber); background: #fff1df; }
.status.risk { color: var(--red); background: #ffe8ec; }
.toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

.dash-filters {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}
.segmented, .filter-controls, .quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip, .filter-pill, .quick-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #193a7c;
  font-weight: 900;
}
.chip {
  min-width: 72px;
  padding: 8px 16px;
  text-align: center;
}
.chip.active {
  color: #04245f;
  background: var(--lime);
  border-color: var(--lime);
}
.filter-controls { justify-content: flex-end; }
.filter-pill {
  min-width: 136px;
  padding: 9px 14px;
  color: #28457f;
  background: #fff;
}
.filter-pill.search { min-width: 260px; color: #7a88a8; }

.flow-panel h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(88px, 1fr));
  gap: 14px;
  align-items: center;
  overflow-x: auto;
}
.flow-step {
  position: relative;
  min-width: 88px;
  color: var(--deep);
  text-align: center;
  font-weight: 900;
}
.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  top: 15px;
  color: var(--blue);
}
.flow-step strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 16px;
}

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}
.dash-main, .dash-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
.activity-list {
  display: grid;
  gap: 13px;
}
.activity-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 10px;
  align-items: center;
  color: #405482;
  font-size: 13px;
}
.activity-item b {
  color: var(--ink);
  font-size: 12px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.quick-card {
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 10px 6px;
  color: #254477;
  background: #f7faff;
  text-align: center;
}
.quick-card::before {
  content: "";
  width: 24px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(180deg, #5f8df8 0%, #2f6df0 100%);
}

.split-box {
  display: grid;
  gap: 10px;
  min-width: 360px;
}
.split-box .grid {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}
.split-box input {
  min-width: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 8px;
  color: #04245f;
  background: var(--lime);
  opacity: 0;
  transform: translateY(8px);
  transition: .18s;
  font-weight: 900;
  pointer-events: none;
  box-shadow: 0 14px 32px rgba(2, 42, 153, .18);
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .app { grid-template-columns: 220px 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app, .login-card, .grid, .grid-3, .grid-4, .dash-filters { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topbar { align-items: stretch; flex-direction: column; padding: 18px; }
  .filter-controls { justify-content: flex-start; }
  .page { padding: 16px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
