:root {
  --ink: #18322d;
  --muted: #70807b;
  --line: #dfe7e2;
  --canvas: #f3f6f3;
  --card: #ffffff;
  --nav: #123b34;
  --nav-soft: #1b4a42;
  --jade: #18765f;
  --jade-soft: #e9f4ef;
  --orange: #dc7545;
  --orange-soft: #fff0e8;
  --amber: #b57a1c;
  --amber-soft: #fff6df;
  --red: #bc4f4f;
  --red-soft: #fcecec;
  --shadow: 0 12px 32px rgba(28, 62, 53, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 14px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 244px;
  display: flex;
  flex-direction: column;
  color: #e9f4ef;
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 255, 255, 0.1), transparent 21%),
    linear-gradient(168deg, #173f38 0%, #102f2a 100%);
  box-shadow: 8px 0 24px rgba(10, 40, 34, 0.08);
  transition: width 180ms ease, transform 180ms ease;
}

.sidebar-collapse {
  position: absolute;
  z-index: 4;
  top: 88px;
  right: -14px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0 1px 2px 0;
  color: #174c3f;
  font-size: 22px;
  line-height: 1;
  background: #ffffff;
  border: 1px solid #d7e3dd;
  border-radius: 50%;
  box-shadow: 0 7px 18px rgba(15, 54, 45, 0.16);
  transition: transform 180ms ease;
}

.sidebar-collapse:hover {
  color: white;
  background: var(--jade);
  border-color: var(--jade);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 76px;
}

body.sidebar-collapsed .sidebar-collapse {
  transform: rotate(180deg);
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding-right: 12px;
  padding-left: 12px;
}

body.sidebar-collapsed .brand > span:last-child,
body.sidebar-collapsed .nav-link > span:last-child,
body.sidebar-collapsed .sidebar-foot {
  display: none;
}

body.sidebar-collapsed .nav-group-title {
  height: 1px;
  margin: 13px 9px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  background: rgba(255, 255, 255, 0.12);
}

body.sidebar-collapsed .nav-scroll {
  padding-right: 9px;
  padding-left: 9px;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-link.active::before {
  left: -9px;
}

body.sidebar-collapsed .nav-icon {
  width: 32px;
  height: 32px;
}

.brand {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #153d35;
  font-size: 18px;
  font-weight: 800;
  background: #f2c892;
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-sub {
  margin-top: 3px;
  color: rgba(233, 244, 239, 0.58);
  font-size: 11px;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-group-title {
  padding: 12px 12px 7px;
  color: rgba(233, 244, 239, 0.45);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 3px 0;
  padding: 0 13px;
  color: rgba(245, 252, 248, 0.72);
  border-radius: 11px;
  transition: 160ms ease;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-link.active::before {
  position: absolute;
  left: -12px;
  width: 4px;
  height: 24px;
  content: "";
  background: #efb876;
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #f4cf9d;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.sidebar-foot {
  margin: 12px;
  padding: 13px;
  color: rgba(242, 248, 245, 0.72);
  font-size: 12px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.workspace {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(219, 229, 223, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-title {
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb {
  color: #8b9995;
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-switch,
.role-switch {
  height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  background: linear-gradient(145deg, #1e8069, #0e5d4a);
  border-radius: 50%;
}

.user-block {
  line-height: 1.25;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
}

.user-role {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.page {
  max-width: 1640px;
  margin: 0 auto;
  padding: 26px 30px 44px;
}

.scope-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 12px 16px;
  color: #285e50;
  background: #e7f3ee;
  border: 1px solid #c9e2d8;
  border-radius: 12px;
}

.scope-banner strong {
  flex: 0 0 auto;
}

.scope-banner span {
  color: #59726a;
  font-size: 12px;
  line-height: 1.6;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  color: var(--ink);
  font-weight: 650;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #bfcfc7;
  box-shadow: 0 7px 18px rgba(30, 70, 60, 0.08);
}

.btn-primary {
  color: white;
  background: var(--jade);
  border-color: var(--jade);
}

.btn-orange {
  color: white;
  background: var(--orange);
  border-color: var(--orange);
}

.btn-danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f2cccc;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  min-height: 31px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 15px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.card-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  padding: 0 22px 22px;
}

.hero-strip {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 18px;
  margin-bottom: 20px;
  padding: 26px 28px;
  color: white;
  background:
    radial-gradient(circle at 87% 20%, rgba(255, 216, 166, 0.24), transparent 22%),
    linear-gradient(120deg, #153f37, #1d6b59);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(17, 68, 57, 0.18);
}

.hero-strip::after {
  position: absolute;
  right: 8%;
  bottom: -68px;
  width: 210px;
  height: 210px;
  content: "";
  border: 34px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.hero-eyebrow {
  color: #f3c894;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-title {
  max-width: 650px;
  margin: 10px 0 8px;
  font-size: 25px;
  line-height: 1.35;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
}

.progress-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 75%;
  height: 100%;
  background: linear-gradient(90deg, #efad6d, #f5d8a5);
  border-radius: inherit;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 19px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(30, 67, 57, 0.055);
}

.metric::after {
  position: absolute;
  right: -17px;
  bottom: -25px;
  width: 78px;
  height: 78px;
  content: "";
  background: var(--jade-soft);
  border-radius: 50%;
}

.metric.orange::after {
  background: var(--orange-soft);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-family: "DIN Alternate", "Arial Narrow", Arial, sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.metric-foot {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--jade);
  font-size: 11px;
}

.metric-foot.down {
  color: var(--red);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.search {
  min-width: 230px;
  height: 38px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.search:focus,
.field:focus,
.table-input:focus {
  border-color: #69a491;
  box-shadow: 0 0 0 3px rgba(24, 118, 95, 0.1);
}

.filter-select {
  height: 38px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.filter-spacer {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.data-table th {
  padding: 12px 13px;
  color: #667771;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  background: #f5f8f6;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 13px;
  line-height: 1.55;
  border-bottom: 1px solid #edf1ee;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fbfcfb;
}

.data-table .num,
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.data-table .group-row td {
  padding: 10px 13px;
  color: #1c5e4d;
  font-size: 12px;
  font-weight: 750;
  background: #eef6f2;
}

.data-table .collapsible-group {
  cursor: pointer;
  outline: none;
  user-select: none;
}

.data-table .collapsible-group:hover td,
.data-table .collapsible-group:focus-visible td {
  color: #124b3d;
  background: #deeee7;
}

.data-table .collapsible-group:focus-visible td {
  box-shadow: inset 0 0 0 2px rgba(24, 118, 95, 0.25);
}

.data-table .collapsible-group td:last-child {
  position: relative;
}

.group-label {
  vertical-align: middle;
}

.group-row-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 9px;
  padding: 0 8px;
  color: #658078;
  font-size: 10px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  vertical-align: middle;
}

.group-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #31705f;
  font-size: 19px;
  line-height: 1;
  transform: translateY(-55%);
  transition: transform 160ms ease;
}

.collapsible-group.collapsed .group-chevron {
  transform: translateY(-48%) rotate(-90deg);
}

.animated-group-row td {
  overflow: hidden;
  transition:
    padding-top 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--row-slide-delay, 0ms),
    padding-bottom 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--row-slide-delay, 0ms),
    border-color 280ms ease var(--row-slide-delay, 0ms);
}

.row-slide-inner {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  transition:
    grid-template-rows 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--row-slide-delay, 0ms),
    opacity 280ms ease var(--row-slide-delay, 0ms),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--row-slide-delay, 0ms);
}

.row-slide-content {
  min-height: 0;
  overflow: hidden;
}

.group-collapsed-row {
  pointer-events: none;
}

.group-collapsed-row td {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-color: transparent !important;
  border-top-color: transparent !important;
}

.group-collapsed-row .row-slide-inner {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-16px);
}

.data-table .total-row td {
  font-weight: 750;
  background: #f8faf8;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #1d5f50;
  font-size: 12px;
  font-weight: 800;
  background: #e8f3ee;
  border-radius: 10px;
}

.person-name {
  font-weight: 700;
}

.person-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 9px;
  color: var(--jade);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--jade-soft);
  border-radius: 999px;
}

.badge::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.badge.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.danger {
  color: var(--red);
  background: var(--red-soft);
}

.badge.neutral {
  color: #687773;
  background: #eef1ef;
}

.badge.info {
  color: #476a9c;
  background: #edf2fb;
}

.status-list {
  display: grid;
  gap: 2px;
}

.status-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #edf1ee;
}

.status-item:last-child {
  border-bottom: 0;
}

.status-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #2d6a59;
  font-size: 11px;
  font-weight: 800;
  background: var(--jade-soft);
  border-radius: 9px;
}

.status-name {
  font-weight: 700;
}

.status-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-link {
  min-height: 90px;
  padding: 15px;
  background: #f7faf8;
  border: 1px solid #e6ede9;
  border-radius: 12px;
  transition: 160ms ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  background: white;
  border-color: #bcd3c9;
  box-shadow: 0 9px 20px rgba(28, 70, 59, 0.08);
}

.quick-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: var(--jade);
  border-radius: 9px;
}

.quick-title {
  font-weight: 700;
}

.quick-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 15px;
}

.store-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 9px 26px rgba(28, 63, 54, 0.06);
}

.store-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--jade);
}

.store-card.department::before {
  background: var(--orange);
}

.store-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.store-code {
  color: var(--muted);
  font-size: 11px;
}

.store-name {
  margin-top: 5px;
  font-size: 17px;
  font-weight: 760;
}

.store-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.store-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.store-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.store-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #edf2ef;
  border-radius: 11px;
}

.tab {
  min-height: 33px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 9px rgba(30, 65, 56, 0.08);
}

.subject-tree {
  display: grid;
  gap: 8px;
}

.subject-row {
  display: grid;
  grid-template-columns: 46px minmax(250px, 1.15fr) 150px minmax(220px, 1fr) 100px 82px;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 9px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.subject-row.parent {
  color: #194e42;
  font-weight: 750;
  background: #eef6f2;
}

.subject-row.is-disabled {
  color: #84958f;
  background: #f3f5f4;
  border-color: #e2e8e5;
}

.subject-select-cell,
.subject-select-head {
  display: flex;
  justify-content: center;
}

.subject-select-cell input,
.bulk-check-all input,
.unit-check input,
.switch-line input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.subject-identity small {
  display: block;
  grid-column: 2;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.subject-unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.subject-unit-list span {
  padding: 3px 7px;
  color: #2d6758;
  font-size: 11px;
  background: #e9f4ef;
  border-radius: 999px;
}

.subject-unit-list span.is-fixed-link {
  color: #255f73;
  background: #e8f4f7;
  box-shadow: inset 0 0 0 1px #cfe5ea;
}

.subject-unit-list em {
  color: #a36b27;
  font-size: 11px;
  font-style: normal;
}

.subject-bulk-panel {
  position: sticky;
  top: 76px;
  z-index: 8;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(28, 62, 52, 0.08);
}

.subject-bulk-title,
.subject-bulk-controls,
.bulk-unit-picker,
.unit-check,
.switch-line {
  display: flex;
  align-items: center;
}

.subject-bulk-title {
  width: 100%;
  justify-content: space-between;
  padding: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.subject-bulk-panel.is-open .subject-bulk-title {
  margin-bottom: 12px;
}

.subject-bulk-heading {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.subject-bulk-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.subject-bulk-heading small,
.subject-bulk-summary span {
  color: var(--muted);
  font-size: 11px;
}

.subject-bulk-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-bulk-summary i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #2a6758;
  font-style: normal;
  background: #edf5f1;
  border-radius: 8px;
}

.subject-bulk-summary i::before {
  content: "";
  width: 7px;
  height: 7px;
  display: block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.subject-bulk-title[aria-expanded="true"] .subject-bulk-summary i::before {
  transform: translateY(2px) rotate(225deg);
}

.subject-bulk-controls[hidden] {
  display: none !important;
}

.subject-bulk-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.subject-bulk-controls .bulk-check-all {
  grid-column: 1;
}

.subject-bulk-controls .bulk-unit-picker {
  grid-column: 2 / -1;
}

.subject-bulk-controls .field.compact,
.subject-bulk-controls > .btn {
  width: 100%;
  min-width: 0;
}

.bulk-check-all,
.unit-check,
.switch-line {
  flex-direction: row !important;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
}

.unit-check input,
.switch-line input,
.bulk-check-all input,
.subject-select-cell input {
  flex: 0 0 17px;
  margin: 0;
  padding: 0;
}

.bulk-unit-picker {
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 9px;
  background: #f3f7f5;
  border-radius: 9px;
}

.bulk-unit-picker > span {
  color: var(--muted);
  font-size: 11px;
}

.unit-check.is-disabled {
  color: #a5afab;
}

.unit-check.is-fixed-locked {
  color: #255f73;
  background: #e8f4f7;
  border-color: #cfe5ea;
}

.unit-check.is-fixed-locked::after {
  content: "固定数据";
  margin-left: auto;
  color: #4e7b89;
  font-size: 10px;
}

.field.compact {
  width: auto;
  min-width: 142px;
}

.dialog-unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dialog-unit-grid .unit-check {
  min-height: 38px;
  padding: 8px 10px;
  background: white;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
}

#subjectCreateDialog,
#subjectEditDialog {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

#subjectCreateDialog > form,
#subjectEditDialog > form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

#subjectCreateDialog .dialog-body,
#subjectEditDialog .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.form-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.subject-child {
  padding-left: 29px;
}

.rule-select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  color: var(--ink);
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notice {
  display: flex;
  gap: 11px;
  margin-bottom: 16px;
  padding: 13px 15px;
  color: #76531b;
  line-height: 1.65;
  background: var(--amber-soft);
  border: 1px solid #f2dfb8;
  border-radius: 12px;
}

.notice.green {
  color: #275f51;
  background: var(--jade-soft);
  border-color: #cae3d9;
}

.notice.red {
  color: #8d4242;
  background: var(--red-soft);
  border-color: #efcccc;
}

.accounting-head {
  position: sticky;
  z-index: 8;
  top: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 7px 22px rgba(30, 66, 56, 0.07);
  backdrop-filter: blur(15px);
}

.accounting-title {
  font-weight: 750;
}

.accounting-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sheet-table {
  min-width: 1380px;
}

.sheet-table-wrap {
  overflow: visible;
}

.sheet-table th {
  position: sticky;
  top: 143px;
  z-index: 5;
  text-align: center;
  background: #f5f8f6;
}

.sheet-table th:first-child,
.sheet-table th:nth-child(2),
.sheet-table td:first-child,
.sheet-table td:nth-child(2) {
  position: sticky;
  z-index: 3;
  background: white;
}

.sheet-table th:first-child,
.sheet-table th:nth-child(2) {
  z-index: 11;
}

.sheet-table th:first-child,
.sheet-table td:first-child {
  left: 0;
  width: 110px;
  min-width: 110px;
}

.sheet-table th:nth-child(2),
.sheet-table td:nth-child(2) {
  left: 110px;
  width: 170px;
  min-width: 170px;
  box-shadow: 6px 0 10px rgba(30, 66, 56, 0.045);
}

.sheet-table .group-row td:first-child,
.sheet-table .group-row td:nth-child(2),
.sheet-table .total-row td:first-child,
.sheet-table .total-row td:nth-child(2) {
  background: inherit;
}

.table-input {
  width: 108px;
  height: 34px;
  padding: 0 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: #fffdf8;
  border: 1px solid #e8d7bd;
  border-radius: 7px;
  outline: none;
}

.readonly-cell {
  color: #687a74;
  background: #f7f9f7;
}

.lock {
  margin-left: 4px;
  color: #8b9994;
  font-size: 10px;
}

.sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 13px 0;
  color: var(--muted);
  font-size: 11px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
}

.legend-edit {
  background: #d8ad6b;
}

.legend-fixed {
  background: #7396b8;
}

.legend-auto {
  background: #4c9a82;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 6px;
  margin: 12px 0 20px;
}

.workflow-step {
  position: relative;
  padding: 13px 12px;
  color: var(--muted);
  text-align: center;
  background: #f3f6f4;
  border-radius: 10px;
}

.workflow-step:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -8px;
  content: "›";
  color: #9eb0aa;
  font-size: 20px;
  transform: translateY(-53%);
}

.workflow-step.done {
  color: #266655;
  background: var(--jade-soft);
}

.workflow-step.current {
  color: white;
  font-weight: 700;
  background: var(--jade);
}

.review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 17px 19px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(28, 62, 53, 0.05);
}

.review-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.review-value {
  margin-top: 9px;
  font-size: 12px;
}

.review-actions {
  display: flex;
  gap: 8px;
}

.report-unit {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(100px, 0.8fr)) 90px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #edf1ee;
}

.report-unit.header {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: #f6f8f6;
}

.report-unit:last-child {
  border-bottom: 0;
}

/* 基于<table>的核算单位对比表，确保列对齐 */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #edf1ee;
}

.comparison-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: #f6f8f6;
  white-space: nowrap;
}

.comparison-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-table tbody tr:hover {
  background: #f8fbf9;
}

.detailed-comparison-table {
  min-width: 1120px;
}

.detailed-comparison-table th:not(:first-child),
.detailed-comparison-table td.num {
  text-align: right;
}

.summary-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 17px 19px;
  color: #234f44;
  background: linear-gradient(110deg, #eaf5f0, #f8fbf9);
  border: 1px solid #cfe5dc;
  border-radius: 15px;
}

.summary-entry-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 17px;
  font-weight: 800;
  background: var(--jade);
  border-radius: 12px;
}

.summary-entry h3 {
  margin: 0;
  font-size: 16px;
}

.summary-entry p {
  margin: 6px 0 0;
  color: #637a72;
  font-size: 12px;
  line-height: 1.6;
}

.summary-table {
  min-width: 1320px;
}

.summary-table th {
  text-align: center;
}

.summary-table th:first-child,
.summary-table th:nth-child(2),
.summary-table td:first-child,
.summary-table td:nth-child(2) {
  position: sticky;
  z-index: 2;
  background: #162b27;
}

.summary-table th:first-child,
.summary-table td:first-child {
  left: 0;
  min-width: 92px;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2) {
  left: 96px;
  min-width: 170px;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.12);
}

.summary-table .group-row td:first-child,
.summary-table .group-row td:nth-child(2),
.summary-table .total-row td:first-child,
.summary-table .total-row td:nth-child(2) {
  background: inherit;
}

.excel-source-note {
  color: var(--muted);
  font-size: 12px;
}

.six-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.accounting-report-card {
  margin-top: 18px;
  background: #13211e;
  border-color: rgba(134, 183, 175, 0.15);
}

.accounting-report-card .card-head {
  border-bottom: 1px solid rgba(134, 183, 175, 0.12);
}

.accounting-report-card .card-title {
  color: #e8f3f1;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

.accounting-report-card .card-subtitle {
  color: #9dbdb6;
}

.accounting-table-wrap {
  max-height: calc(100vh - 230px);
  overflow: auto;
  background: #162b27;
}

.excel-accounting-table {
  min-width: 1736px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: #162b27;
  color: #e8f3f1;
  font-size: 13px;
}

.excel-accounting-table col.col-sequence {
  width: 96px;
}

.excel-accounting-table col.col-subject {
  width: 220px;
}

.excel-accounting-table col.col-amount {
  width: 120px;
}

.excel-accounting-table col.col-percent {
  width: 92px;
}

.excel-accounting-table col.col-variance {
  width: 126px;
}

.excel-accounting-table col.col-achievement {
  width: 108px;
}

/* ===== 表头基础 ===== */
.excel-accounting-table th {
  padding: 10px 8px;
  color: #9dbdb6;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid rgba(134, 183, 175, 0.28);
  border-right: 1px solid rgba(134, 183, 175, 0.12);
  background: #1f3f39;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

.excel-accounting-table thead {
  position: sticky;
  top: 0;
  z-index: 12;
}

/* 分组表头行（6月 / 差异分析 / 7月） */
.excel-accounting-table .excel-group-head th {
  height: 44px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e8f3f1;
}

/* 子列表头行 */
.excel-accounting-table .excel-column-head th {
  height: 36px;
  font-size: 12px;
  font-weight: 500;
  color: #9dbdb6;
}

/* 占比列表头：斜体 + 更柔和 */
.excel-accounting-table .excel-column-head .percent-head {
  font-style: italic;
  font-weight: 400;
  color: #7ba59c;
}

/* 序号/科目列：rowspan 跨两行 */
.excel-accounting-table .sequence-col,
.excel-accounting-table .subject-col {
  position: sticky;
  z-index: 14;
  color: #e8f3f1;
  background: #1f3f39;
}

.excel-accounting-table .sequence-col {
  left: 0;
}

.excel-accounting-table .subject-col {
  left: 96px;
  border-right: 2px solid rgba(134, 183, 175, 0.28);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.15);
}

/* ===== 分组配色（匹配线上系统） ===== */
/* 6月组 */
.excel-accounting-table .head-month {
  color: #e8f3f1;
  background: #244a43;
}

/* 差异分析组 */
.excel-accounting-table .head-diff {
  color: #e8f3f1;
  background: #244a43;
  border-left: 2px solid rgba(134, 183, 175, 0.25);
}

/* 7月组：金色强调 */
.excel-accounting-table .head-next-month {
  color: #c9a06a;
  background: #1d3f39;
  border-left: 2px solid rgba(175, 136, 76, 0.4);
}

/* 子列表头配色 */
.excel-accounting-table .head-month-sub {
  background: #1f3f39;
  color: #9dbdb6;
}

.excel-accounting-table .head-diff-sub {
  background: #1f3f39;
  color: #9dbdb6;
}

.excel-accounting-table .head-next-month-sub,
.excel-accounting-table .next-month-th {
  background: #1d3f39;
  color: #c9a06a;
}

.excel-accounting-table .next-month-th:first-of-type {
  border-left: 2px solid rgba(175, 136, 76, 0.4);
}

/* ===== 表体 sticky 列 ===== */
.excel-accounting-table tbody td:first-child {
  position: sticky;
  z-index: 5;
  left: 0;
  background: #162b27;
}

.excel-accounting-table tbody td:nth-child(2) {
  position: sticky;
  z-index: 5;
  left: 96px;
  background: #162b27;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.12);
}

/* 分组行的序号列、科目列继承分组行背景 */
.excel-accounting-table tbody tr.group-row td:first-child,
.excel-accounting-table tbody tr.group-row td:nth-child(2) {
  background: #234a42;
}

/* 折叠时取消 sticky 定位并强制高度为 0 */
.excel-accounting-table tbody tr.group-collapsed-row td:first-child,
.excel-accounting-table tbody tr.group-collapsed-row td:nth-child(2) {
  position: static;
  height: 0 !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-color: transparent !important;
  border-bottom-color: transparent !important;
  border-right-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.excel-accounting-table .group-row td:first-child,
.excel-accounting-table .group-row td:nth-child(2),
.excel-accounting-table .subtotal-row td:first-child,
.excel-accounting-table .subtotal-row td:nth-child(2),
.excel-accounting-table .top-result-row td:first-child,
.excel-accounting-table .top-result-row td:nth-child(2) {
  background: inherit;
}

/* ===== 表体单元格 ===== */
.excel-accounting-table td {
  height: 36px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid rgba(134, 183, 175, 0.12);
  border-right: 1px solid rgba(134, 183, 175, 0.08);
  background-clip: padding-box;
  font-feature-settings: "tnum";
}

.excel-accounting-table tbody td.subject-code,
.excel-accounting-table tbody td.subject-name {
  text-align: left;
}

/* 折叠动画：解除固定最小高度 */
.excel-accounting-table .animated-group-row td {
  height: auto;
}

/* 表体区块分隔线：科目 | 6月 | 差异分析 | 7月 */
.excel-accounting-table tbody tr:not(.group-row) td:nth-child(2),
.excel-accounting-table tbody tr:not(.group-row) td:nth-child(8),
.excel-accounting-table tbody tr:not(.group-row) td:nth-child(11) {
  border-right: 2px solid rgba(134, 183, 175, 0.25);
}

/* 7月列：金色左边框 + 浅金背景 */
.excel-accounting-table tbody tr:not(.group-row) td.next-month-cell {
  border-left: 2px solid rgba(175, 136, 76, 0.2);
  background: rgba(175, 136, 76, 0.04);
  color: #c9a06a;
}

/* 斑马纹 */
.excel-accounting-table tbody tr:nth-child(even):not(.group-row):not(.subtotal-row):not(.top-result-row) td {
  background: rgba(134, 183, 175, 0.03);
}

.excel-accounting-table tbody tr:nth-child(even):not(.group-row):not(.subtotal-row):not(.top-result-row) td.next-month-cell {
  background: rgba(175, 136, 76, 0.06);
}

/* hover 高光 */
.excel-accounting-table tbody tr:hover:not(.group-row) td {
  background: rgba(134, 183, 175, 0.07);
}

.excel-accounting-table tbody tr:hover:not(.group-row) td.next-month-cell {
  background: rgba(175, 136, 76, 0.1);
}

.excel-accounting-table tbody tr:hover:not(.group-row) td:first-child,
.excel-accounting-table tbody tr:hover:not(.group-row) td:nth-child(2) {
  background: #1a3530;
}

/* ===== 科目列样式 ===== */
.excel-accounting-table .subject-code {
  color: #9dbdb6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.excel-accounting-table .subject-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e8f3f1;
}

.excel-accounting-table .subject-name.depth-2 {
  padding-left: 20px;
}

.excel-accounting-table .subject-name.depth-3 {
  padding-left: 36px;
}

.excel-accounting-table .subject-name.depth-4 {
  padding-left: 52px;
  font-weight: 400;
}

/* ===== 行类型 ===== */
/* 小计行（二级汇总） */
.excel-accounting-table .subtotal-row td {
  font-weight: 500;
  background: rgba(35, 74, 66, 0.5);
  color: #e8f3f1;
}

.excel-accounting-table .subtotal-row td.subject-code {
  color: #c9a06a;
}

/* 一级汇总行（收入总额/费用总额等） */
.excel-accounting-table .top-result-row td {
  color: #e8f3f1;
  font-weight: 600;
  background: #234a42;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

.excel-accounting-table .top-result-row td.subject-code {
  color: #c9a06a;
}

/* 占比单元格：柔和次要色 */
.excel-accounting-table .percent-cell {
  color: #7ba59c;
}

/* 分组行（可折叠的分类标题） */
.excel-accounting-table .group-row td {
  height: 40px;
  padding: 10px 12px;
  background: #234a42;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-weight: 600;
  font-size: 13px;
  color: #e8f3f1;
  border-bottom: 1px solid rgba(134, 183, 175, 0.28);
}

.excel-accounting-table .group-row td:nth-child(2) {
  color: #e8f3f1;
  font-size: 13px;
  text-align: left;
}

.excel-accounting-table .group-row td:first-child {
  color: #c9a06a;
}

/* ===== 正负色（匹配线上系统） ===== */
.excel-accounting-table .negative,
.negative {
  color: #d4866a !important;
}

.excel-accounting-table .positive,
.positive {
  color: #87b9a9 !important;
}

.subject-row[hidden] {
  display: none;
}

.subject-header {
  position: sticky;
  z-index: 3;
  top: 76px;
}

.subject-category {
  margin-top: 8px;
}

.subject-subtotal {
  font-weight: 730;
  background: #f8faf8;
}

.subject-identity {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
}

.subject-identity > span:not(.subject-sequence) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subject-row > .badge {
  justify-self: start;
}

.subject-identity.depth-2 {
  padding-left: 16px;
}

.subject-identity.depth-3 {
  padding-left: 30px;
}

.subject-identity.depth-4 {
  padding-left: 44px;
  font-weight: 400;
}

.subject-sequence {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 96px;
  flex: 0 0 96px;
  color: #61726c;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.subject-sequence b {
  font: inherit;
}

.subject-tree-toggle,
.subject-tree-toggle-placeholder {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.subject-tree-toggle {
  position: relative;
  padding: 0;
  border: 1px solid #d7e5df;
  border-radius: 7px;
  color: #356d60;
  background: #f5faf7;
  cursor: pointer;
}

.subject-tree-toggle::before {
  position: absolute;
  top: 6px;
  left: 7px;
  width: 6px;
  height: 6px;
  content: "";
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.subject-tree-toggle[aria-expanded="false"]::before {
  top: 7px;
  left: 6px;
  transform: rotate(-45deg);
}

.subject-tree-toggle:hover {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.subject-lock {
  color: var(--muted);
  font-size: 11px;
}

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

.report-unit-grid {
  margin-top: 18px;
}

.report-unit-card {
  padding-top: 20px;
}

.report-unit-card .card-title {
  margin-top: 6px;
}

.compact-kpis {
  grid-template-columns: 1fr 1fr;
  margin: 15px 0 14px;
}

.bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: #e8eeea;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--jade);
  border-radius: inherit;
}

.kpi-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi-box {
  padding: 16px;
  background: #f6f9f7;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kpi-box span {
  color: var(--muted);
  font-size: 11px;
}

.kpi-box strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 8px;
  width: 2px;
  content: "";
  background: #dbe6e0;
}

.timeline-item {
  position: relative;
  padding: 0 0 22px 8px;
}

.timeline-item::before {
  position: absolute;
  top: 5px;
  left: -21px;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--jade);
  border: 3px solid #d9eee6;
  border-radius: 50%;
}

.timeline-time {
  color: var(--muted);
  font-size: 11px;
}

.timeline-title {
  margin-top: 5px;
  font-weight: 700;
}

.timeline-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.form-item.full {
  grid-column: 1 / -1;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: #536660;
  font-size: 12px;
  font-weight: 650;
}

.field {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

textarea.field {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(12, 49, 41, 0.24);
}

dialog::backdrop {
  background: rgba(10, 35, 30, 0.5);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.dialog-title {
  font-size: 17px;
  font-weight: 750;
}

.dialog-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f2f5f3;
  border: 0;
  border-radius: 9px;
}

.dialog-body {
  padding: 20px 22px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px 20px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 17px;
  color: white;
  background: #173f37;
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(12, 47, 39, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(390px, 0.85fr);
  background: #eef3ef;
}

.login-branding {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 60px;
  color: white;
  background:
    radial-gradient(circle at 75% 15%, rgba(248, 196, 126, 0.26), transparent 22%),
    radial-gradient(circle at 24% 72%, rgba(116, 184, 158, 0.2), transparent 28%),
    linear-gradient(145deg, #173f37, #0e302a 68%, #122c29);
}

.login-branding::before,
.login-branding::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.login-branding::before {
  width: 420px;
  height: 420px;
  right: -180px;
  top: 9%;
}

.login-branding::after {
  width: 260px;
  height: 260px;
  right: -90px;
  top: 22%;
}

.login-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo .brand-mark {
  width: 44px;
  height: 44px;
}

.login-system-name {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.login-hero {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.login-hero .eyebrow {
  color: #efbf82;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.login-hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 1.17;
  letter-spacing: -0.045em;
}

.login-hero p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1.9;
}

.login-proof {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.proof-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.proof-item strong {
  display: block;
  color: #f4c88f;
  font-size: 20px;
}

.proof-item span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(410px, 100%);
  padding: 38px;
  background: white;
  border: 1px solid #dbe5df;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(27, 61, 52, 0.12);
}

.login-card h2 {
  margin: 0;
  font-size: 25px;
}

.login-card > p {
  margin: 10px 0 28px;
  color: var(--muted);
  line-height: 1.65;
}

.login-card .form-item {
  margin-bottom: 16px;
}

.login-field {
  height: 48px;
  padding: 0 14px;
}

.login-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  font-size: 15px;
}

.login-copyright {
  margin-top: 24px;
  color: #98a39f;
  font-size: 11px;
  text-align: center;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 1380px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .six-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 244px;
    transform: translateX(-104%);
    transition: 180ms ease;
  }

  .sidebar-collapse {
    display: none;
  }

  body.sidebar-collapsed .sidebar {
    width: 244px;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 18px 20px;
  }

  body.sidebar-collapsed .brand > span:last-child,
  body.sidebar-collapsed .nav-link > span:last-child,
  body.sidebar-collapsed .sidebar-foot {
    display: block;
  }

  body.sidebar-collapsed .nav-group-title {
    height: auto;
    margin: 0;
    padding: 12px 12px 7px;
    overflow: visible;
    color: rgba(233, 244, 239, 0.45);
    font-size: 11px;
    background: transparent;
  }

  body.sidebar-collapsed .nav-scroll {
    padding: 16px 12px;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 0 13px;
  }

  body.sidebar-collapsed .nav-link.active::before {
    left: -12px;
  }

  body.sidebar-collapsed .nav-icon {
    width: 27px;
    height: 27px;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    width: 100%;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .mobile-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgba(10, 34, 29, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: 180ms ease;
  }

  body.nav-open .mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .two-col,
  .three-col,
  .four-col {
    grid-template-columns: 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-branding {
    min-height: 380px;
    padding: 34px;
  }

  .login-proof {
    display: none;
  }

  .login-panel {
    padding: 28px 20px 44px;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 66px;
    padding: 0 15px;
  }

  .page {
    padding: 20px 15px 35px;
  }

  .scope-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .crumb,
  .role-switch,
  .user-block,
  .month-switch {
    display: none;
  }

  .page-title {
    font-size: 17px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .store-grid,
  .kpi-summary {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .metric {
    min-height: 110px;
  }

  .subject-row {
    grid-template-columns: 1fr;
  }

  .subject-header {
    display: none;
  }

  .subject-bulk-controls {
    grid-template-columns: 1fr;
  }

  .subject-bulk-controls .bulk-check-all,
  .subject-bulk-controls .bulk-unit-picker {
    grid-column: 1;
  }

  .dialog-unit-grid {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .workflow-step:not(:last-child)::after {
    display: none;
  }

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-actions {
    justify-content: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .report-unit {
    min-width: 760px;
  }

  .summary-entry {
    grid-template-columns: auto 1fr;
  }

  .summary-entry .btn {
    grid-column: 1 / -1;
  }

  .accounting-head {
    top: 66px;
    align-items: flex-start;
    flex-direction: column;
  }

  .sheet-table th {
    top: 176px;
  }

  .login-branding {
    min-height: 320px;
  }

  .login-hero h1 {
    font-size: 36px;
  }

  .login-hero p {
    font-size: 13px;
  }

  .login-card {
    padding: 27px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-group-row td,
  .row-slide-inner,
  .group-chevron {
    transition: none !important;
  }
}
