:root {
  --ink: #13241f;
  --ink-soft: #2a3f38;
  --sea: #1b6b5c;
  --sea-deep: #0f4a3f;
  --sea-soft: #d8ebe5;
  --brand: #c8161d;
  --brand-deep: #a01218;
  --brand-soft: rgba(200, 22, 29, 0.08);
  --brand-glow: rgba(200, 22, 29, 0.14);
  --sand: #f3f1ea;
  --mist: #e7eef1;
  --paper: #f7f8f6;
  --surface: #f4f7fb;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --line: rgba(19, 36, 31, 0.10);
  --warn: #b45309;
  --danger: #b42318;
  --ok: #157a4b;
  --shadow: 0 1px 2px rgba(19, 36, 31, 0.05), 0 12px 28px rgba(19, 36, 31, 0.06);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --font-display: "Fraunces", "Noto Serif SC", serif;
  --font-body: "Manrope", "Noto Sans SC", sans-serif;
  --sidebar-width: 16rem;
  --app-content-max: 1320px;
  --report-table-max-h: min(52vh, 480px);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body.app-body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--surface);
  background-image:
    radial-gradient(920px 520px at 10% 12%, rgba(200, 22, 29, 0.06), transparent 58%),
    radial-gradient(780px 480px at 92% 82%, rgba(27, 107, 92, 0.08), transparent 55%),
    linear-gradient(155deg, #f8fafc 0%, #eef3f8 45%, #f5f7fa 100%);
  background-attachment: fixed;
}

body.app-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(19, 36, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 36, 31, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 38%, black 18%, transparent 78%);
}

a { color: var(--sea-deep); }
a:hover { color: var(--sea); }

.app-shell {
  position: relative;
  z-index: 1;
}

.app-shell.has-sidebar {
  min-height: 100vh;
}

/* —— 侧栏导航 —— */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 1rem 0.85rem 1.1rem;
  background: var(--surface-elevated);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
}

.sidebar-brand {
  padding: 0.15rem 0.45rem 0.85rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.85rem;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(19, 36, 31, 0.12));
}

.brand-logo--sidebar {
  width: auto;
  max-width: 100%;
  max-height: 3.25rem;
  margin: 0 auto;
}

.brand-logo--mobile {
  max-height: 2rem;
  max-width: 10rem;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sidebar-group-label {
  margin: 0.65rem 0.55rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7a74;
}

.sidebar-link {
  display: block;
  padding: 0.48rem 0.65rem;
  border-radius: 0.65rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 550;
  border-left: 3px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.sidebar-link.is-nested {
  margin-left: 0.35rem;
  padding-left: 0.85rem;
  font-size: 0.86rem;
}

.sidebar-link:hover {
  background: rgba(216, 235, 229, 0.45);
  color: var(--sea-deep);
}

.sidebar-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-left-color: var(--brand);
  font-weight: 650;
}

.sidebar-footer {
  margin-top: 0.75rem;
  padding: 0.85rem 0.65rem 0.15rem;
  border-top: 1px solid var(--line);
}

.sidebar-footer-card {
  padding: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 36, 31, 0.06);
  box-shadow: var(--shadow-soft);
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.app-main-content {
  padding-top: 0;
  width: 100%;
  max-width: var(--app-content-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1025;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  margin: 0 -1.25rem 1.25rem;
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.88rem;
}

.app-topbar-home {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.app-topbar-home:hover {
  color: var(--sea-deep);
}

.app-topbar-sep {
  color: rgba(19, 36, 31, 0.28);
  user-select: none;
}

.app-topbar-current {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.user-chip--compact {
  padding: 0.22rem 0.62rem;
  font-size: 0.78rem;
}

.app-topbar-role {
  font-size: 0.78rem;
  font-weight: 600;
}

.app-mobile-bar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.app-mobile-center {
  min-width: 0;
  text-align: center;
}

.app-mobile-crumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
  font-size: 0.84rem;
  line-height: 1.2;
}

.app-mobile-home-label {
  color: #6a7a74;
  font-weight: 600;
}

.app-mobile-sep {
  color: rgba(19, 36, 31, 0.28);
}

.app-mobile-module {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-mobile-home {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
}

.app-mobile-title {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(19, 36, 31, 0.35);
}

body.sidebar-open {
  overflow: hidden;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin-right: 0.55rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, var(--sea), var(--sea-deep));
  color: #fff;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(15, 74, 63, 0.25);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea-deep);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn {
  border-radius: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.btn-primary {
  --bs-btn-bg: var(--sea);
  --bs-btn-border-color: var(--sea);
  --bs-btn-hover-bg: var(--sea-deep);
  --bs-btn-hover-border-color: var(--sea-deep);
  --bs-btn-active-bg: var(--sea-deep);
  --bs-btn-active-border-color: var(--sea-deep);
  box-shadow: 0 8px 18px rgba(27, 107, 92, 0.22);
}

.btn-success {
  --bs-btn-bg: var(--ok);
  --bs-btn-border-color: var(--ok);
}

.btn-outline-primary {
  --bs-btn-color: var(--sea-deep);
  --bs-btn-border-color: rgba(27, 107, 92, 0.35);
  --bs-btn-hover-bg: var(--sea);
  --bs-btn-hover-border-color: var(--sea);
}

.btn-outline-secondary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: var(--ink-soft);
  --bs-btn-hover-color: var(--ink);
}

.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-deep);
  --bs-btn-hover-border-color: var(--brand-deep);
  --bs-btn-active-bg: var(--brand-deep);
  --bs-btn-active-border-color: var(--brand-deep);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 8px 18px var(--brand-glow);
}

.btn-brand:hover,
.btn-brand:focus {
  color: #fff;
}

.btn-filter {
  --bs-btn-color: var(--sea-deep);
  --bs-btn-bg: rgba(216, 235, 229, 0.55);
  --bs-btn-border-color: rgba(27, 107, 92, 0.35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--sea);
  --bs-btn-hover-border-color: var(--sea);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--sea-deep);
  --bs-btn-active-border-color: var(--sea-deep);
  font-weight: 650;
  min-width: 4.25rem;
  box-shadow: none;
}

.btn-filter:hover,
.btn-filter:focus {
  color: #fff;
}

.btn-step {
  --bs-btn-color: var(--sea-deep);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(27, 107, 92, 0.4);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--sea);
  --bs-btn-hover-border-color: var(--sea);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--sea-deep);
  --bs-btn-active-border-color: var(--sea-deep);
  font-weight: 650;
  box-shadow: none;
}

.btn-step:hover,
.btn-step:focus {
  color: #fff;
}

.btn-step.is-active,
.btn-step.active {
  color: #fff;
  background: var(--sea);
  border-color: var(--sea);
}

.units-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.units-subnav-link {
  padding: 0.42rem 0.85rem;
  border-radius: 0.55rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.units-subnav-link:hover {
  background: rgba(216, 235, 229, 0.45);
  color: var(--sea-deep);
}

.units-subnav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.card,
.panel {
  border: 1px solid rgba(19, 36, 31, 0.06) !important;
  border-radius: var(--radius) !important;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.page-header h1,
.page-title {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.page-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sea);
  margin-bottom: 0.35rem;
}

.page-hint {
  font-size: 0.88rem;
  color: #5b6b65;
  margin-top: 0.25rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.detail-back-link:hover {
  color: var(--sea-deep);
}

.detail-page-header {
  flex: 1;
  min-width: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.detail-page-flags {
  flex-shrink: 0;
  align-self: flex-start;
}

.detail-page-header .page-title {
  margin-bottom: 0.15rem;
}

.detail-page-meta:empty {
  display: none;
}

.detail-shell-card {
  border: 1px solid rgba(19, 36, 31, 0.06) !important;
  background: rgba(255, 255, 255, 0.94);
}

.tab-subheader {
  padding: 0.35rem 0 0.15rem;
  border-top: 1px dashed rgba(19, 36, 31, 0.08);
  margin-top: 0.35rem;
}

.create-panel .card,
.create-panel-card {
  border-color: rgba(200, 22, 29, 0.1) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(200, 22, 29, 0.02));
}

.create-panel form.border,
form.create-inline-form {
  border-color: rgba(19, 36, 31, 0.08) !important;
  background: rgba(255, 255, 255, 0.72);
}

.form-control,
.form-select {
  border-radius: 0.7rem;
  border-color: rgba(19, 36, 31, 0.12);
  padding: 0.55rem 0.8rem;
  background: rgba(255,255,255,0.92);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(27, 107, 92, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(27, 107, 92, 0.12);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink-soft);
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6b65;
  font-weight: 700;
  border-bottom-width: 1px;
  background: rgba(238, 243, 248, 0.88);
}

.table-compact > :not(caption) > * > * {
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
}

/* 表格人名列：姓名单行显示，列宽随内容收缩 */
.table .col-person,
.table .cell-person-name {
  white-space: nowrap;
  width: 1%;
}

.cb-wrap .cb-input:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 0.15rem rgba(27, 107, 92, 0.15);
}

/* 下拉展开时抬升层级，避免被下方 Tab/表格遮挡 */
.cb-wrap.cb-open {
  position: relative;
  z-index: 1080;
}

.card:has(.cb-wrap.cb-open) {
  position: relative;
  z-index: 1080;
  overflow: visible;
}

.cb-menu {
  top: 100%;
  z-index: 1081;
  display: none;
  flex-direction: column;
  max-height: 260px;
  overflow: hidden;
}

.cb-menu.is-open {
  display: flex;
}

.cb-menu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 220px;
  overflow-y: auto;
}

.cb-menu-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.cb-menu-footer .cb-create {
  border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
  font-weight: 650;
}

.cb-menu .list-group-item.active {
  background: rgba(27, 107, 92, 0.12);
  color: var(--sea-deep);
  border-color: var(--line);
}

.preview-frame {
  min-height: calc(100vh - 120px);
  background: #f8f9fa;
}

.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.badge.text-bg-success {
  background: rgba(21, 122, 75, 0.12) !important;
  color: var(--ok) !important;
}

.badge.text-bg-secondary {
  background: rgba(19, 36, 31, 0.08) !important;
  color: var(--ink-soft) !important;
}

.alert {
  border: 0;
  border-radius: 0.9rem;
}

.home-hero {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  animation: rise 0.55s ease both;
}

.home-kpi-card {
  height: 100%;
  border: 1px solid rgba(19, 36, 31, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.home-kpi-card .home-kpi-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #6a7a74;
}

.home-kpi-card .home-kpi-val {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 650;
  line-height: 1.15;
  margin-top: 0.15rem;
  color: var(--ink);
}

.home-kpi-card--accent {
  border-color: rgba(200, 22, 29, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(200, 22, 29, 0.03));
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  margin: 0;
}

.home-kpi-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.home-kpi-clickable:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.08);
}

.home-kpi-clickable:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.table-scroll-sticky {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.report-table-viewport {
  max-height: var(--report-table-max-h);
}

.table-scroll-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-elevated, #fff);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.table-scroll-sticky tfoot td,
.table-scroll-sticky tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #f8f9fa;
  box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.08);
}

.report-pager .btn {
  min-width: 4.5rem;
}

.tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform .22s ease, box-shadow .22s ease;
}

.tile-link:hover {
  transform: translateY(-3px);
  color: inherit;
}

.tile-link .card {
  height: 100%;
  transition: border-color .22s ease;
}

.tile-link:hover .card {
  border-color: rgba(200, 22, 29, 0.18) !important;
  box-shadow: var(--shadow-soft);
}

.tile-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a7a74;
}

.tile-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 0.35rem;
}

/* Login — modern tech (light) */
body.login-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f4f7fb;
  overflow-x: hidden;
}

body.login-body::before {
  display: none;
}

.login-stage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(920px 520px at 10% 12%, rgba(200, 22, 29, 0.08), transparent 58%),
    radial-gradient(780px 480px at 92% 82%, rgba(27, 107, 92, 0.1), transparent 55%),
    linear-gradient(155deg, #f8fafc 0%, #eef3f8 45%, #f5f7fa 100%);
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(19, 36, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 36, 31, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 42%, black 22%, transparent 80%);
}

.login-bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.65;
  animation: login-orb 16s ease-in-out infinite alternate;
}

.login-bg-orb--1 {
  width: 22rem;
  height: 22rem;
  top: 8%;
  left: 6%;
  background: rgba(200, 22, 29, 0.12);
}

.login-bg-orb--2 {
  width: 26rem;
  height: 26rem;
  right: 8%;
  bottom: 10%;
  background: rgba(27, 107, 92, 0.14);
  animation-delay: -6s;
}

.login-bg-orb--3 {
  width: 14rem;
  height: 14rem;
  top: 42%;
  left: 46%;
  background: rgba(88, 140, 255, 0.08);
  animation-delay: -11s;
}

.login-brand,
.login-panel-wrap {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  animation: fade-in 0.7s ease both;
}

.login-brand-inner {
  width: min(100%, 34rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.login-brand-logo {
  display: inline-flex;
  align-self: flex-start;
  text-decoration: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.login-brand-logo:hover {
  transform: translateY(-2px);
  opacity: 0.96;
}

.brand-logo--login {
  display: block;
  width: min(100%, 13.5rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(19, 36, 31, 0.08));
}

.login-brand-meta {
  max-width: 32rem;
}

.login-brand-kicker,
.login-panel-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sea);
}

.login-brand-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.login-brand-copy {
  margin: 0;
  max-width: 30rem;
  color: #5f716b;
  font-size: 0.98rem;
  line-height: 1.7;
}

.login-brand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.login-brand-tags li {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 36, 31, 0.08);
  box-shadow: 0 1px 2px rgba(19, 36, 31, 0.04);
}

.login-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  animation: slide-in 0.55s ease both;
}

.login-panel {
  width: min(100%, 420px);
  padding: clamp(1.6rem, 3vw, 2rem);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 36, 31, 0.08);
  box-shadow:
    0 24px 60px rgba(19, 36, 31, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(18px);
}

.login-panel-head {
  margin-bottom: 1.5rem;
}

.login-panel-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.5vw, 1.95rem);
  color: var(--ink);
}

.login-panel-hint {
  margin: 0;
  color: #5f716b;
  font-size: 0.92rem;
}

.login-alert {
  margin-bottom: 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.login-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.login-input {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(19, 36, 31, 0.12);
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input::placeholder {
  color: #9aa8a3;
}

.login-input:focus {
  outline: none;
  border-color: rgba(27, 107, 92, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 107, 92, 0.12);
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #d01820 0%, #a81218 52%, #8f0f14 100%);
  box-shadow: 0 12px 28px rgba(200, 22, 29, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 16px 34px rgba(200, 22, 29, 0.34);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.login-footnote {
  margin: 1.15rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #8a9893;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes login-orb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(18px, -22px) scale(1.08); }
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-18px, 22px) scale(1.06); }
}

/* 办公室一页纸 · 生命周期示意 */
.lifecycle-phase {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem 0.35rem;
}

.lifecycle-step {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  flex: 1 1 11.5rem;
  min-width: 10.5rem;
  padding: 0.85rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lifecycle-step.is-lock {
  border-color: rgba(180, 83, 9, 0.35);
  background: linear-gradient(180deg, #fffaf3, #fff);
}

.lifecycle-no {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--sea);
}

.lifecycle-step.is-lock .lifecycle-no {
  background: var(--warn);
}

.lifecycle-title {
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
}

.lifecycle-desc {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #5f716b;
  line-height: 1.45;
}

.lifecycle-arrow {
  display: flex;
  align-items: center;
  color: var(--sea);
  font-weight: 600;
  padding: 0 0.1rem;
  user-select: none;
}

.lifecycle-side {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px dashed rgba(27, 107, 92, 0.35);
  background: rgba(216, 235, 229, 0.35);
}

.lifecycle-side-title {
  font-weight: 650;
  margin-bottom: 0.5rem;
  color: var(--sea-deep);
}

.lifecycle-side-list {
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.lifecycle-side-list li + li {
  margin-top: 0.35rem;
}

@media (max-width: 768px) {
  .lifecycle-arrow {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-105%);
    transition: transform .24s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .app-main-content {
    padding-top: 0.75rem;
    padding-inline: 1rem;
  }

  .app-topbar {
    margin-inline: -1rem;
    padding-inline: 1rem;
  }
}

@media (max-width: 900px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding-top: 2rem;
    padding-bottom: 0.5rem;
  }

  .login-brand-inner {
    align-items: center;
    text-align: center;
  }

  .login-brand-logo {
    align-self: center;
  }

  .login-brand-copy {
    margin-inline: auto;
  }

  .login-brand-tags {
    justify-content: center;
  }

  .brand-logo--login {
    width: min(100%, 11rem);
  }

  .login-panel-wrap {
    padding-top: 0.75rem;
    padding-bottom: 2rem;
  }
}

.dc-kpi-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--sea-deep);
  margin-top: 0.25rem;
}

.filter-bar,
.dc-filters {
  border: 1px solid rgba(19, 36, 31, 0.06) !important;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.filter-bar .form-label,
.dc-filters .form-label {
  font-weight: 500;
}

.app-body .nav-pills.report-subtabs {
  gap: 0.15rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
}

.app-body .nav-pills.report-subtabs .nav-link {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0.35rem 0.35rem 0 0;
  margin-bottom: -1px;
  background: transparent;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.app-body .nav-pills.report-subtabs .nav-link:hover {
  color: var(--sea-deep);
  background: rgba(216, 235, 229, 0.35);
}

.app-body .nav-pills.report-subtabs .nav-link.active {
  color: var(--sea-deep);
  background: rgba(216, 235, 229, 0.45);
  border-bottom-color: var(--sea);
  box-shadow: none;
  font-weight: 650;
}

.tab-subheader .page-kicker {
  color: #6a7a74;
}

.project-combobox-menu {
  position: fixed;
  z-index: 1080;
  display: block;
  margin: 0;
  padding: 0.25rem 0;
  background: #fff;
  border: 1px solid rgba(19, 36, 31, 0.12);
  border-radius: 0.55rem;
  box-shadow: 0 8px 24px rgba(19, 36, 31, 0.12);
}

/* —— 库存管理 · 左侧列表滚动 —— */
.inv-list-scroll {
  max-height: min(42vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.2rem;
}

@media (min-width: 992px) {
  .inv-list-scroll {
    max-height: min(52vh, 520px);
  }
}

@media (min-width: 1400px) {
  .inv-list-scroll {
    max-height: min(58vh, 600px);
  }
}

/* —— 库存列表选中高亮 —— */
#list .list-group-item.active {
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.45) !important;
  color: var(--bs-body-color);
  box-shadow: inset 3px 0 0 #0d6efd;
}

#list .list-group-item.active .text-secondary {
  color: rgba(13, 110, 253, 0.75) !important;
}

/* —— 项目列表滚动区 —— */
.pm-table-scroll {
  max-height: var(--report-table-max-h);
  overflow: auto;
}

/* —— 模块页 Tab（用户管理、经营看板等） —— */
.app-body .nav-tabs {
  border-bottom-color: var(--line);
}

.app-body .nav-tabs .nav-link {
  color: var(--ink-soft);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0.35rem 0.35rem 0 0;
}

.app-body .nav-tabs .nav-link:hover {
  color: var(--ink);
  border-color: transparent;
  background: rgba(200, 22, 29, 0.04);
}

.app-body .nav-tabs .nav-link.active {
  color: var(--brand);
  background: transparent;
  border-bottom-color: var(--brand);
  font-weight: 650;
}

/* —— 项目详情 Tab 双行标题 —— */
.pm-detail-tabs {
  border-bottom: 1px solid var(--line);
  gap: 0.15rem;
}

.pm-detail-tabs .nav-link {
  padding: 0.45rem 0.6rem;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  min-width: 4.25rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0.35rem 0.35rem 0 0;
  color: var(--ink-soft);
  background: transparent;
  margin-bottom: -1px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.pm-detail-tabs .nav-link:hover {
  color: var(--ink);
  background: rgba(200, 22, 29, 0.04);
}

.pm-detail-tabs .nav-link.active {
  color: var(--brand);
  background: transparent;
  border-bottom-color: var(--brand);
  font-weight: 650;
}

.pm-tab-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}

.pm-tab-main {
  font-size: 0.82rem;
  font-weight: 600;
}

.pm-tab-sub {
  font-size: 0.68rem;
  opacity: 0.72;
  font-weight: 500;
}

/* 项目详情 · 收入/支出合同列表与明细行选中 */
.contract-row-selected,
.table-hover > tbody > tr.contract-row-selected {
  background-color: rgba(27, 107, 92, 0.13) !important;
  box-shadow: inset 3px 0 0 var(--sea-deep);
}

.contract-item-row {
  cursor: pointer;
}

.contract-item-row-selected,
.table-hover > tbody > tr.contract-item-row-selected {
  background-color: rgba(27, 107, 92, 0.15) !important;
  box-shadow: inset 3px 0 0 var(--sea-deep);
}

.contract-list-summary td,
.contract-items-summary td {
  border-top: 2px solid var(--line);
  background: rgba(243, 241, 234, 0.85);
}

/* —— 大屏 / 宽屏自适应（J8 · 9/12 反馈） —— */
@media (min-width: 1400px) {
  :root {
    --app-content-max: min(1560px, calc(100vw - var(--sidebar-width) - 2rem));
    --report-table-max-h: min(58vh, 560px);
  }

  .dc-kpi-val {
    font-size: 1.45rem;
  }
}

@media (min-width: 1680px) {
  :root {
    --app-content-max: min(1720px, calc(100vw - var(--sidebar-width) - 2.5rem));
    --report-table-max-h: min(62vh, 680px);
  }

  .pm-detail-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  .pm-detail-tabs .nav-link {
    min-width: 4.75rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --app-content-max: min(1880px, calc(100vw - var(--sidebar-width) - 3rem));
    --report-table-max-h: min(68vh, 820px);
  }

  .dc-kpi-val {
    font-size: 1.55rem;
  }

  .table-compact > :not(caption) > * > * {
    padding: 0.5rem 0.75rem;
  }
}
