:root {
  --navy: #13223a;
  --navy-2: #233854;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eef4ff;
  --text: #1b2638;
  --muted: #6f7c90;
  --subtle: #98a3b3;
  --line: #e5eaf1;
  --line-dark: #d5dce7;
  --bg: #f5f7fb;
  --white: #fff;
  --green: #128263;
  --green-soft: #eaf8f3;
  --orange: #c66a17;
  --orange-soft: #fff3e6;
  --red: #c93648;
  --red-soft: #fff0f2;
  --shadow-sm: 0 1px 3px rgba(24, 39, 62, .04);
  --shadow: 0 8px 24px rgba(27, 45, 76, .07);
  --shadow-lg: 0 24px 70px rgba(24, 44, 76, .15);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 70px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}
.topbar-inner {
  max-width: 1540px;
  height: 100%;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 46px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(145deg, #1e55d5, #347af5);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}
.brand b, .brand small, .account-copy b, .account-copy small { display: block; }
.brand b { font-size: 15px; letter-spacing: .2px; }
.brand small { margin-top: 1px; color: var(--subtle); font-size: 10px; letter-spacing: .5px; }
.topbar nav { display: flex; align-self: stretch; gap: 4px; }
.topbar nav a {
  position: relative;
  min-width: 108px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color .18s, background .18s;
}
.topbar nav a::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}
.topbar nav a:hover { color: var(--blue); background: #f8faff; }
.topbar nav a.active { color: var(--blue); }
.topbar nav a.active::after { background: var(--blue); }
.nav-icon { font-size: 16px; line-height: 1; }
.account {
  margin-left: auto;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}
.account-copy { min-width: 76px; }
.account-copy b { font-size: 13px; }
.account-copy small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.logout-button {
  margin-left: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.logout-button:hover { color: var(--red); border-color: #efbbc2; background: var(--red-soft); }

.main { max-width: 1540px; margin: auto; padding: 30px 32px 56px; }
.page-head {
  min-height: 70px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-head h1 { margin: 4px 0 5px; color: var(--navy); font-size: 28px; line-height: 1.2; letter-spacing: -.5px; }
.page-head p, .section-title p, .card-heading p, .form-card > p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }

.button {
  min-height: 40px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .72; transform: none; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(37, 99, 235, .2); }
.button.primary:hover { background: var(--blue-dark); box-shadow: 0 7px 17px rgba(37, 99, 235, .26); }
.button.secondary { color: #31445f; background: #eef2f7; border-color: #e3e8ef; }
.button.secondary:hover { background: #e6ebf2; }
.button.ghost { color: var(--muted); background: #fff; border-color: var(--line-dark); }
.button.ghost:hover { color: var(--blue); border-color: #a9c1f7; }
.button.wide { width: 100%; min-height: 44px; }
.button-icon span { font-size: 18px; font-weight: 400; }
.link-button { padding: 3px; border: 0; background: none; color: var(--blue); cursor: pointer; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.batch-bar {
  margin-bottom: 14px;
  padding: 11px 16px;
  border: 1px solid #dce6f7;
  border-radius: 10px;
  background: linear-gradient(90deg, #f4f8ff, #fafcff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}
.batch-status, .batch-meta { display: flex; align-items: center; gap: 8px; }
.batch-status b { color: var(--navy); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #24a779; box-shadow: 0 0 0 4px rgba(36, 167, 121, .12); }
.batch-meta { min-width: 0; overflow: hidden; }
.batch-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-meta i { width: 1px; height: 14px; background: var(--line-dark); flex: 0 0 auto; }
.batch-meta form { flex: 0 0 auto; }
.batch-delete-button { padding: 5px 8px; border: 1px solid #efc1c7; border-radius: 6px; background: #fff7f8; color: var(--red); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.batch-delete-button:hover { border-color: #e38d99; background: var(--red-soft); }
.batch-manage-link { padding: 5px 8px; border: 1px solid #bfd0f2; border-radius: 6px; background: #fff; color: var(--blue); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.batch-manage-link:hover { border-color: #7ea2ed; background: var(--blue-soft); }

.batch-overview .duplicate-stat { border-color: #f0c7a3; background: #fffaf5; }
.batch-overview .duplicate-stat b { color: var(--orange); }
.batch-management-card { overflow: hidden; }
.batch-toolbar { min-height: 65px; padding: 13px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fafbfc; }
.batch-toolbar > div { display: flex; align-items: center; gap: 16px; }
.check-all-label { display: flex; align-items: center; gap: 7px; color: var(--navy); font-weight: 700; cursor: pointer; }
.check-all-label input, .checkbox-cell input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.selection-status { color: var(--muted); font-size: 11px; }
.selection-status b { color: var(--blue); }
.batch-toolbar-actions { display: flex; gap: 8px !important; }
.danger-button { color: #fff; background: var(--red); border-color: var(--red); }
.danger-button:hover:not(:disabled) { background: #ad2939; border-color: #ad2939; }
.danger-button:disabled { color: #9da5b1; background: #edf0f4; border-color: #e0e4e9; box-shadow: none; }
.batch-table-wrap { overflow-x: auto; }
.batch-table { min-width: 1060px; }
.batch-table th { position: static; }
.batch-table td { height: 72px; }
.checkbox-cell { width: 44px; text-align: center; }
.latest-label, .duplicate-label { margin-left: 6px; padding: 2px 6px; border-radius: 999px; display: inline-flex; font-size: 9px; font-weight: 700; }
.latest-label { background: var(--green-soft); color: var(--green); }
.duplicate-label { margin: 4px 0 0; background: var(--orange-soft); color: var(--orange); }
.duplicate-batch { background: #fffdf9; }
.duplicate-batch:hover { background: #fff9f1; }
.cutoff-date { color: var(--navy); font-size: 13px; }
.source-file { max-width: 200px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-row-actions { display: flex; gap: 7px; }
.batch-row-actions a, .row-delete-button { padding: 5px 8px; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.batch-row-actions a { color: var(--blue); }
.row-delete-button { color: var(--red); }
.batch-row-actions a:hover { background: var(--blue-soft); border-color: #a9c1f7; }
.row-delete-button:hover { background: var(--red-soft); border-color: #efbbc2; }
.delete-confirm-dialog { width: min(440px, calc(100vw - 30px)); padding: 27px; border: 0; border-radius: 15px; text-align: center; color: var(--text); box-shadow: 0 25px 70px rgba(20, 35, 60, .26); }
.delete-confirm-dialog::backdrop { background: rgba(15, 28, 48, .52); backdrop-filter: blur(3px); }
.delete-dialog-icon { width: 48px; height: 48px; margin: 0 auto 13px; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red); font-size: 21px; font-weight: 900; }
.delete-confirm-dialog h2 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.delete-confirm-dialog > p { margin: 0; color: var(--muted); line-height: 1.7; }
.delete-confirm-dialog > p b { color: var(--red); }
.delete-warning { margin: 15px 0 4px; padding: 11px; border-radius: 8px; background: #fff8ed; color: #8b5b1f; font-size: 11px; line-height: 1.55; }
.delete-confirm-dialog .dialog-actions { margin: 14px -27px -27px; position: static; }

.filters { margin-bottom: 16px; padding: 15px 17px; }
.filters form { display: flex; align-items: flex-end; gap: 12px; }
.filters label { min-width: 205px; }
.filters .search-label { flex: 1; }
.field-label { display: flex; align-items: center; gap: 5px; color: #455267; font-size: 12px; font-weight: 700; }
.field-label em { color: var(--red); font-style: normal; }
.optional { padding: 1px 6px; border-radius: 999px; background: #f0f2f5; color: var(--muted); font-size: 10px; font-weight: 500; }
.filters input, .filters select, .form-card input, .form-card textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.filters input:focus, .filters select:focus, .form-card input:focus, .form-card textarea:focus {
  border-color: #7da2f2;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.filters input::placeholder, .form-card input::placeholder, .form-card textarea::placeholder { color: #a5adba; }
.filter-actions { display: flex; gap: 8px; }

.metrics { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card {
  min-width: 0;
  padding: 18px 19px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.metric-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.metric-card.blue { --accent: #3478f6; --accent-bg: #edf4ff; }
.metric-card.indigo { --accent: #6d5ce8; --accent-bg: #f1efff; }
.metric-card.teal { --accent: #0f9c91; --accent-bg: #e9f8f6; }
.metric-card.orange { --accent: #e1832c; --accent-bg: #fff3e8; }
.metric-card.green { --accent: #1a9c70; --accent-bg: #e9f8f2; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font-style: normal; font-weight: 800; }
.metric-card > b { margin: 8px 0 6px; display: block; color: var(--navy); font-size: 26px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card > b em { margin-left: 4px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 500; }
.metric-card small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.metric-card small strong { color: #49566b; font-weight: 700; }
.danger-text { color: var(--red) !important; }
.money { color: var(--blue); }
.two-month-summary { margin-bottom: 16px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.summary-title { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.summary-title h2 { margin: 3px 0 0; color: var(--navy); font-size: 16px; }
.summary-title > span { color: var(--muted); font-size: 10px; }
.month-comparison { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px; }
.month-comparison article { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.month-comparison article.current-month { border-color: #cddcfb; background: #f7f9ff; }
.month-comparison article.previous-month { background: #fafbfc; }
.month-comparison article > div span, .month-comparison article > div b { display: block; }
.month-comparison article > div span { color: var(--muted); font-size: 10px; font-weight: 700; }
.month-comparison article > div b { margin-top: 3px; color: var(--navy); font-size: 14px; }
.month-comparison dl { margin: 0; display: flex; gap: 28px; }
.month-comparison dl > div { min-width: 90px; }
.month-comparison dt { color: var(--muted); font-size: 10px; }
.month-comparison dd { margin: 3px 0 0; color: var(--navy); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.comparison-arrow { align-self: center; padding: 4px 8px; border-radius: 999px; background: #f0f3f7; color: var(--muted); font-size: 9px; }
.period-result { margin-top: 10px; padding: 11px 14px; border: 1px solid #d9e4fb; border-radius: 9px; display: flex; align-items: center; justify-content: space-between; background: #f5f8ff; }
.period-result span { color: var(--muted); font-size: 11px; font-weight: 700; }
.period-result b { color: var(--blue); font-size: 18px; font-variant-numeric: tabular-nums; }

.table-card { overflow: visible; }
.section-title {
  min-height: 70px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-title h2, .form-card h2, .rules h2 { margin: 0; color: var(--navy); font-size: 17px; }
.title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.count-badge { min-width: 25px; padding: 2px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; text-align: center; }
.badge, .tag { padding: 4px 9px; border-radius: 999px; display: inline-flex; align-items: center; background: #f0f3f7; color: #566378; font-size: 11px; font-style: normal; font-weight: 700; }
.tag { padding: 3px 8px; }
.tag.blue { background: #eaf1ff; color: #225fd4; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.warn { margin-top: 7px; background: var(--orange-soft); color: var(--orange); }
.table-wrap { overflow: auto; max-height: calc(100vh - 325px); min-height: 180px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fc;
  color: #67748a;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  letter-spacing: .2px;
}
th[rowspan] { vertical-align: middle; }
.month-group { text-align: center; font-size: 10px; letter-spacing: 1px; }
.month-group.current { background: #edf4ff; color: #2864d7; }
.month-group.previous { background: #f1f3f6; color: #657187; }
td { padding: 13px 14px; border-bottom: 1px solid #edf0f4; color: #303c50; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
td small { max-width: 230px; margin-top: 3px; display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.order-no { color: #23344e; font-size: 12px; }
.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.negative-value { color: var(--red); }
.negative-value b { color: var(--red); }
.empty { padding: 55px !important; color: var(--muted); text-align: center !important; }
.pagination { min-height: 60px; padding: 12px 17px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.pagination > div { display: flex; gap: 7px; }
.pagination a, .pagination .disabled { padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); text-decoration: none; }
.pagination a:hover { background: var(--blue-soft); border-color: #bfd0f5; }
.pagination .disabled { color: #b0b7c2; background: #fafbfc; }
.page-summary { color: var(--muted); font-size: 12px; }

.two-column { display: grid; grid-template-columns: minmax(510px, 1.05fr) minmax(380px, .95fr); gap: 18px; align-items: start; }
.form-card, .rules { padding: 23px; }
.form-card { display: flex; flex-direction: column; gap: 17px; }
.form-card label { font-weight: 600; }
.form-card label small { margin-top: 5px; display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.card-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.card-heading h2 { margin-bottom: 3px; }
.heading-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 15px; font-weight: 800; }
.heading-icon.soft { background: var(--blue-soft); color: var(--blue); }
.file-field {
  min-height: 100px;
  padding: 15px;
  border: 1px dashed #b9c7da;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: #fbfcff;
  cursor: pointer;
  transition: border .15s, background .15s, box-shadow .15s;
  position: relative;
}
.file-field:hover { border-color: #7ea2ed; background: #f7faff; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .05); }
.file-field.has-file { border-style: solid; border-color: #79c9af; background: #f7fdfb; }
.file-field input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.file-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; background: #e9f1ff; color: var(--blue); font-size: 17px; font-weight: 900; }
.file-icon.secondary { background: #edf8f6; color: #158475; }
.file-copy { min-width: 0; flex: 1; }
.file-copy b, .file-copy small, .file-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy b { color: var(--navy); }
.file-copy small { margin: 3px 0 5px !important; }
.file-copy strong { color: var(--blue); font-size: 11px; font-weight: 600; }
.has-file .file-copy strong { color: var(--green); }
.file-button { padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; color: #506078; font-size: 11px; white-space: nowrap; }
.file-field.mini { min-height: 76px; padding: 11px 13px; }
.file-field.mini .file-icon { width: 36px; height: 36px; }
.form-footer { padding-top: 3px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.form-footer > span { color: var(--muted); font-size: 11px; }
.rules ol { margin: 19px 0 14px; padding: 0; list-style: none; counter-reset: rule; }
.rules li { min-height: 53px; padding: 0 0 16px 44px; position: relative; counter-increment: rule; }
.rules li::before { content: counter(rule); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; }
.rules li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 29px; bottom: 2px; width: 1px; background: #dce5f5; }
.rules li b, .rules li span { display: block; }
.rules li span { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice { padding: 13px 14px; border: 1px solid #d8e4fb; border-radius: 9px; display: flex; gap: 9px; background: #f4f8ff; color: #405776; line-height: 1.55; }
.notice b { flex: 0 0 auto; color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.users-layout { grid-template-columns: minmax(400px, .76fr) minmax(600px, 1.24fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.compact-form { gap: 14px; }
.security-note { padding: 8px 12px; border: 1px solid #d8e5fb; border-radius: 8px; background: #f4f8ff; color: #456180; font-size: 12px; }
.permission-overview { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.permission-overview article { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: 1fr auto; align-items: center; background: #fff; box-shadow: var(--shadow-sm); }
.permission-overview span { color: var(--muted); font-size: 11px; font-weight: 700; }
.permission-overview b { grid-row: 1 / span 2; grid-column: 2; color: var(--navy); font-size: 23px; }
.permission-overview small { color: var(--subtle); font-size: 10px; }
.permission-help { padding: 11px 12px; border-radius: 8px; display: flex; gap: 8px; background: #f4f8ff; color: var(--muted); font-size: 11px; }
.permission-help b { color: var(--blue); flex: 0 0 auto; }
.identity-guide { margin-bottom: 16px; padding: 15px 17px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 13px; border-color: #d9e6fb; background: linear-gradient(90deg, #f5f9ff, #fff); }
.identity-guide-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #1aad19; color: #fff; font-size: 18px; font-weight: 800; }
.identity-guide b { color: var(--navy); font-size: 13px; }
.identity-guide p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.identity-guide > span { padding: 5px 8px; border-radius: 6px; background: #fff3dd; color: #a56308; font-size: 10px; font-weight: 700; white-space: nowrap; }

.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #edf3ff, #e2ecff); color: var(--blue); font-weight: 800; }
.admin-label { padding: 1px 5px; border-radius: 4px; background: #f0edff; color: #6954c7; font-size: 9px; font-style: normal; }

.permission-list-card { min-width: 0; }
.people-toolbar { padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(180px, 1fr) 130px auto auto; gap: 8px; background: #fafbfc; }
.people-toolbar input, .people-toolbar select { min-width: 0; height: 36px; padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; color: var(--text); outline: none; }
.people-toolbar input:focus, .people-toolbar select:focus { border-color: #7da2f2; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.permission-list { padding: 0 18px; }
.permission-user { min-height: 88px; padding: 14px 1px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px minmax(145px, .8fr) minmax(260px, 1.2fr) auto 78px; align-items: center; gap: 12px; }
.permission-user:last-child { border-bottom: 0; }
.permission-user.super-user { margin: 8px -8px 0; padding-left: 9px; padding-right: 9px; border: 1px solid #dce6fa; border-radius: 10px; background: linear-gradient(90deg, #f5f8ff, #fbfcff); }
.permission-identity { min-width: 0; }
.permission-identity > div { display: flex; align-items: center; gap: 6px; }
.permission-identity b { overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.permission-identity span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.permission-identity small { display: block; margin-top: 3px; overflow: hidden; color: #708099; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.permission-scopes { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.scope-chip { padding: 3px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.scope-chip.enabled { background: var(--green-soft); color: var(--green); }
.scope-chip.disabled { background: #f1f3f6; color: #969fab; text-decoration: line-through; }
.scope-chip.full { background: #ecefff; color: #6355c5; }
.scope-chip.wecom { background: #e8f8e7; color: #168316; }
.scope-chip.pending { background: #fff4df; color: #a56610; }
.shop-summary { max-width: 100px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.edit-permission-button { padding: 7px 9px; border: 1px solid #bcd0f8; border-radius: 7px; background: #f5f8ff; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.edit-permission-button:hover { border-color: #7ea2ed; background: var(--blue-soft); }
.protected-label { color: #8b79d1; font-size: 10px; text-align: center; }

.permission-dialog { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 16px; color: var(--text); background: #fff; box-shadow: 0 28px 80px rgba(14, 30, 55, .25); overflow: auto; }
.permission-dialog::backdrop { background: rgba(15, 28, 48, .54); backdrop-filter: blur(3px); }
.dialog-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; position: sticky; top: 0; z-index: 2; background: #fff; }
.dialog-head h2 { margin: 4px 0 4px; color: var(--navy); font-size: 21px; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 11px; }
.dialog-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8fa; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--red); background: var(--red-soft); }
.dialog-body { padding: 0 24px; }
.dialog-section { padding: 19px 0; border-bottom: 1px solid var(--line); }
.dialog-section:last-child { border-bottom: 0; }
.dialog-section h3 { margin: 0 0 13px; color: var(--navy-2); font-size: 13px; }
.dialog-section label { font-weight: 600; }
.dialog-section input:not([type="checkbox"]), .dialog-section textarea { width: 100%; min-height: 40px; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line-dark); border-radius: 8px; outline: none; }
.dialog-section input:focus, .dialog-section textarea:focus { border-color: #7da2f2; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.dialog-section label > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.identity-status { margin-top: 11px; padding: 10px 12px; border: 1px dashed #e1c994; border-radius: 8px; display: flex; justify-content: space-between; gap: 12px; background: #fffaf0; color: #8b671f; font-size: 10px; }
.identity-status.bound { border-color: #a9dfba; background: #f1fbf3; color: #27743b; }
.identity-status b { flex: 0 0 auto; }
.identity-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.permission-switches { margin-bottom: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.permission-switch { min-height: 65px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; display: grid; grid-template-columns: 37px 1fr; align-items: center; gap: 9px; background: #fafbfc; cursor: pointer; }
.permission-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { width: 36px; height: 20px; border-radius: 999px; position: relative; background: #c9d0da; transition: background .18s; }
.switch-control::after { content: ""; width: 16px; height: 16px; border-radius: 50%; position: absolute; left: 2px; top: 2px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .18s; }
.permission-switch input:checked + .switch-control { background: var(--blue); }
.permission-switch input:checked + .switch-control::after { transform: translateX(16px); }
.permission-switch b, .permission-switch small { display: block; }
.permission-switch b { color: var(--navy); font-size: 12px; }
.permission-switch small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.4; }
.status-switch { max-width: 330px; }
.dialog-actions { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; z-index: 2; background: #fff; }

.alert { max-width: 1476px; margin: 0 auto 16px; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; display: flex; align-items: center; gap: 9px; box-shadow: var(--shadow-sm); }
.alert.success { border-color: #c5eadc; background: var(--green-soft); color: #176b54; }
.alert.error { border-color: #f1c7cc; background: var(--red-soft); color: #9f3040; }
.alert-icon { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.7); font-weight: 900; }
.alert-close { margin-left: auto; padding: 0 4px; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; opacity: .6; }
.empty-state { padding: 72px 20px; text-align: center; }
.empty-state > div { width: 60px; height: 60px; margin: auto; border-radius: 17px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 24px; font-weight: 800; }
.empty-state h2 { margin: 17px 0 7px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }

.login-main { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 12% 18%, #dfeaff 0, transparent 31%), radial-gradient(circle at 90% 88%, #e8effc 0, transparent 27%), #f5f7fb; }
.login-card { width: min(940px, 100%); min-height: 570px; border: 1px solid rgba(255,255,255,.8); border-radius: 22px; overflow: hidden; display: grid; grid-template-columns: 1.08fr .92fr; background: #fff; box-shadow: var(--shadow-lg); }
.login-visual { padding: 44px 49px; position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: linear-gradient(145deg, #122d58, #164ea8); color: #fff; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-visual::before { width: 360px; height: 360px; right: -210px; top: -110px; }
.login-visual::after { width: 260px; height: 260px; left: -150px; bottom: -120px; }
.login-brand { position: absolute; top: 38px; left: 49px; display: flex; align-items: center; gap: 10px; color: #dbe8ff; font-size: 12px; font-weight: 600; }
.visual-icon { width: 35px; height: 35px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; font-size: 15px; font-weight: 800; }
.login-copy { position: relative; z-index: 1; }
.login-kicker { color: #91baff; font-size: 10px; font-weight: 800; letter-spacing: 1.8px; }
.login-visual h1 { margin: 13px 0 17px; font-size: 34px; line-height: 1.35; letter-spacing: .3px; }
.login-visual p { max-width: 390px; color: #c8d9f4; line-height: 1.8; }
.feature-list { margin-top: 27px; display: flex; flex-wrap: wrap; gap: 9px 15px; color: #d9e7fb; font-size: 11px; }
.feature-list span::first-letter { color: #6ee7b7; }
.formula { margin-top: 30px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; position: relative; z-index: 1; background: rgba(4, 20, 49, .18); color: #cbdcf5; font: 11px Consolas, monospace; }
.login-form { padding: 62px 47px; display: flex; flex-direction: column; justify-content: center; gap: 19px; }
.login-form h2 { margin: 7px 0 5px; color: var(--navy); font-size: 27px; }
.login-form p { margin: 0; color: var(--muted); }
.login-form label { font-weight: 600; }
.input-with-icon { position: relative; display: block; }
.input-with-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8b99ad; font-size: 11px; font-style: normal; z-index: 1; }
.login-form input { width: 100%; height: 46px; margin-top: 7px; padding: 11px 13px 11px 39px; border: 1px solid var(--line-dark); border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
.login-form input:focus { border-color: #7da2f2; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-button { margin-top: 2px; height: 46px; }
.hint { color: var(--subtle); text-align: center; font-size: 11px; }

@media (max-width: 1100px) {
  .topbar-inner { gap: 22px; padding: 0 20px; }
  .topbar nav a { min-width: auto; padding: 0 12px; }
  .account-copy { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .permission-overview { grid-template-columns: 1fr 1fr; }
  .two-column, .users-layout { grid-template-columns: 1fr; }
  .table-wrap { max-height: none; }
  .month-comparison article { align-items: flex-start; flex-direction: column; }
  .month-comparison dl { width: 100%; justify-content: space-between; }
  .identity-guide { grid-template-columns: 40px 1fr; }
  .identity-guide > span { grid-column: 2; justify-self: start; }
}
@media (max-width: 760px) {
  .topbar { height: auto; }
  .topbar-inner { min-height: 64px; padding: 0 14px; flex-wrap: wrap; gap: 0; }
  .brand { height: 64px; }
  .brand small { display: none; }
  .topbar nav { width: 100%; height: 47px; order: 3; justify-content: space-around; border-top: 1px solid var(--line); }
  .topbar nav a { flex: 1; }
  .topbar nav a::after { left: 25%; right: 25%; }
  .account { padding-left: 0; border: 0; }
  .account-avatar { display: none; }
  .main { padding: 22px 14px 45px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 24px; }
  .batch-bar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .batch-meta { max-width: 100%; }
  .batch-toolbar { align-items: stretch; flex-direction: column; }
  .batch-toolbar > div { justify-content: space-between; }
  .filters form { flex-direction: column; align-items: stretch; }
  .filters label { min-width: 0; }
  .filter-actions .button { flex: 1; }
  .security-note { display: none; }
  .login-main { padding: 16px; }
  .login-card { min-height: auto; grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { padding: 48px 30px; }
}
@media (max-width: 520px) {
  .brand b { font-size: 13px; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar nav a { gap: 4px; padding: 0 5px; font-size: 12px; }
  .page-head { flex-direction: column; }
  .page-head > .button { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .month-comparison { grid-template-columns: 1fr; }
  .comparison-arrow { justify-self: center; }
  .month-comparison article { flex-direction: row; }
  .month-comparison dl { width: auto; gap: 15px; }
  .month-comparison dl > div { min-width: 65px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .file-button { display: none; }
  .file-field { min-height: 92px; }
  .user-item { grid-template-columns: 38px minmax(130px, 1fr) auto; }
  .user-item > .tag { grid-column: 2; width: max-content; }
  .user-actions { grid-column: 3; grid-row: 1 / span 2; }
  .action-panel { right: -2px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .permission-overview { grid-template-columns: 1fr 1fr; }
  .identity-guide { grid-template-columns: 36px 1fr; }
  .identity-guide-mark { width: 36px; height: 36px; }
  .identity-guide > span { grid-column: 1 / -1; }
  .people-toolbar { grid-template-columns: 1fr 105px; }
  .people-toolbar .button { width: 100%; }
  .permission-user { grid-template-columns: 38px minmax(120px, 1fr) auto; }
  .permission-user .permission-scopes { grid-column: 2 / span 2; }
  .permission-user > .tag { grid-column: 2; width: max-content; }
  .permission-user .edit-permission-button, .protected-label { grid-column: 3; grid-row: 1 / span 2; }
  .permission-switches { grid-template-columns: 1fr; }
  .identity-status { align-items: flex-start; flex-direction: column; }
  .identity-status span { white-space: normal; }
  .dialog-head, .dialog-body, .dialog-actions { padding-left: 17px; padding-right: 17px; }
  .batch-toolbar-actions .button { flex: 1; }
}
