:root {
  --ink: #17202a;
  --muted: #6d7785;
  --line: #e5e8ec;
  --canvas: #f4f5f3;
  --surface: #ffffff;
  --navy: #172a3a;
  --navy-soft: #223a4c;
  --teal: #1e776e;
  --teal-soft: #e3f1ee;
  --amber: #b67822;
  --amber-soft: #fbf1df;
  --red: #b84d4d;
  --red-soft: #f9e9e8;
  --blue: #4e6f8f;
  --blue-soft: #e8eef4;
  --shadow: 0 16px 45px rgba(23, 42, 58, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 0%, rgba(30, 119, 110, .08), transparent 28%),
    var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  color: #f3f6f6;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 38%),
    var(--navy);
  border-right: 1px solid rgba(255,255,255,.06);
}

.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 28px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; background: #e6f0ec; color: var(--navy); font-weight: 800; font-size: 18px;
  box-shadow: 0 7px 20px rgba(0,0,0,.16);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; letter-spacing: .04em; }
.brand span { margin-top: 3px; color: #9fadb6; font-size: 10px; letter-spacing: .16em; }

.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border: 0; border-radius: 11px;
  color: #aebbc3; background: transparent; text-align: left; transition: .2s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 0 #7bb3a9; }
.nav-icon { width: 22px; color: #8fb2ad; font-size: 17px; text-align: center; }

.sidebar-note {
  display: flex; gap: 11px; align-items: flex-start; margin-top: auto; padding: 14px;
  border: 1px solid rgba(150, 198, 188, .18); border-radius: 12px; background: rgba(87, 149, 139, .08);
}
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; font-weight: 600; }
.sidebar-note small { color: #8e9da6; margin-top: 4px; font-size: 11px; }
.pulse-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #78b8ac; box-shadow: 0 0 0 5px rgba(120,184,172,.1); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 16px 2px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #15332f; background: #9bc6be; font-weight: 700; }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; }.sidebar-footer span { margin-top: 2px; color: #8797a1; font-size: 10px; }
.sidebar-user-copy { min-width: 0; flex: 1; }.sidebar-user-copy strong, .sidebar-user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-action { flex: 0 0 auto; width: 27px; height: 27px; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; color: #aebbc3; background: rgba(255,255,255,.04); font-size: 10px; }
.sidebar-user-action:hover { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.09); }

.workspace { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 36px 22px; background: rgba(244,245,243,.9); border-bottom: 1px solid rgba(213,216,214,.75);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5;
}
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 27px; letter-spacing: -.02em; }
.topbar p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.reminder-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 800; }
.reminder-button strong { display: inline-grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 999px; color: #fff; background: #8b959c; font-size: 9px; }
.reminder-button.has-reminders { color: #8d5e20; border-color: #e5c58d; background: #fff8eb; }
.reminder-button.has-reminders strong { background: #b67822; }
.month-control { display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 11px; }
.month-control input { border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 600; }

main { padding: 28px 36px 50px; max-width: 1680px; margin: 0 auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.view-head h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 20px; }
.view-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.inline-actions, .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }

.btn {
  min-height: 38px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px;
  font-weight: 700; font-size: 12px; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }
.btn-primary { color: #fff; background: var(--teal); box-shadow: 0 7px 18px rgba(30,119,110,.16); }
.btn-primary:hover { background: #17665e; }
.btn-secondary { color: var(--navy); background: #e8edee; border-color: #dce2e3; }
.btn-ghost { color: var(--muted); background: #fff; border-color: var(--line); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-sm { min-height: 30px; padding: 6px 10px; font-size: 11px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f2f2; font-size: 23px; line-height: 1; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { position: relative; overflow: hidden; min-height: 142px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(23,42,58,.045); }
.kpi-card::after { content: ""; position: absolute; right: -30px; bottom: -45px; width: 120px; height: 120px; border-radius: 50%; background: var(--tint, #edf3f1); }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.kpi-value { position: relative; z-index: 1; margin-top: 13px; font-family: Georgia, serif; font-size: 36px; line-height: 1; }
.kpi-meta { position: relative; z-index: 1; margin-top: 13px; color: var(--muted); font-size: 11px; }
.kpi-meta strong { color: var(--teal); }
.kpi-icon { position: absolute; right: 18px; top: 18px; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--accent, var(--teal)); background: var(--tint, var(--teal-soft)); font-weight: 800; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(23,42,58,.04); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 14px; }.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px 21px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--dot); }

.data-table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); color: #7d8691; background: #fafafa; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.data-table td { padding: 12px 13px; border-bottom: 1px solid #edf0f1; vertical-align: middle; font-size: 12px; }
.data-table tbody tr { transition: background .15s; }.data-table tbody tr:hover { background: #f9fbfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.row-title { max-width: 360px; font-weight: 700; }.row-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.entity-link { border: 0; padding: 0; color: var(--ink); background: transparent; font-weight: 700; text-align: left; }.entity-link:hover { color: var(--teal); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-approved, .badge-active, .badge-completed { color: #247168; background: var(--teal-soft); }
.badge-configured { color: #247168; background: var(--teal-soft); }
.badge-pending_review, .badge-draft, .badge-in_progress, .badge-opening { color: #9b691d; background: var(--amber-soft); }
.badge-pending { color: #9b691d; background: var(--amber-soft); }
.badge-rejected, .badge-failed, .badge-frozen { color: var(--red); background: var(--red-soft); }
.badge-not_started, .badge-planned, .badge-exempt, .badge-dormant, .badge-closed, .badge-paused { color: #6c7780; background: #edf0f2; }
.badge-winding_down { color: #8d5e20; background: #f5ead8; }
.badge-problem_handling { color: #9b691d; background: var(--amber-soft); }
.level-badge { display: inline-grid; min-width: 34px; height: 26px; place-items: center; padding: 0 7px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 900; }

.progress { height: 7px; overflow: hidden; border-radius: 10px; background: #edf0ee; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.progress-label { display: flex; justify-content: space-between; margin: 9px 0 7px; color: var(--muted); font-size: 10px; }
.progress-label strong { color: var(--ink); }
.summary-block + .summary-block { margin-top: 23px; }
.summary-block h4 { margin: 0 0 12px; font-size: 12px; }
.rule-list { display: grid; gap: 9px; }
.rule-item { display: grid; grid-template-columns: 42px 1fr; gap: 9px; align-items: center; padding: 10px; border-radius: 10px; background: #f7f8f7; }
.rule-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.interface-callout { padding: 14px; border-radius: 11px; border: 1px dashed #b7ccc7; background: #f2f8f6; }
.interface-callout strong { display: block; color: #205f57; font-size: 12px; }.interface-callout p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.search-box { position: relative; min-width: 280px; }
.search-box input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; }
.search-box::before { content: "⌕"; position: absolute; left: 12px; top: 6px; color: #87919b; font-size: 20px; }
.select-control { min-height: 38px; padding: 8px 30px 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; outline: 0; font-size: 11px; }
.result-count { color: var(--muted); font-size: 11px; }
.card-list { display: grid; gap: 12px; }
.record-card { display: grid; grid-template-columns: minmax(230px, 1.25fr) minmax(160px, .7fr) minmax(280px, 1.25fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.record-card h3 { margin: 0; font-size: 13px; }.record-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.document-chip { padding: 8px; border: 1px dashed #d9dddf; border-radius: 8px; color: #7d8790; background: #fafbfb; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-chip.ready { color: #236a62; border-style: solid; border-color: #cfe3df; background: #edf7f4; }
.document-chip a { color: inherit; text-decoration: none; }
.document-chip small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.manual-complete-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 6px 10px; border: 1px solid #d9dddf; border-radius: 8px; color: #7d8790; background: #f7f8f8; font-size: 10px; font-weight: 800; white-space: nowrap; }
.manual-complete-toggle.is-ready { color: #236a62; border-color: #b9d8d2; background: #edf7f4; }
.manual-complete-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--teal); }
.manual-complete-toggle:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.tax-scope-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.tax-scope-tabs button { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.tax-scope-tabs button:hover { border-color: #9bbcb6; box-shadow: 0 7px 20px rgba(23,42,58,.06); }
.tax-scope-tabs button.active { color: #fff; border-color: var(--teal); background: var(--teal); box-shadow: 0 9px 24px rgba(30,119,110,.17); }
.tax-scope-tabs strong { font-size: 13px; }.tax-scope-tabs span { color: var(--muted); font-size: 10px; }.tax-scope-tabs button.active span { color: #d9efeb; }
.tax-ledger-table { min-width: 1180px; }
.finance-entity-table { min-width: 1720px; }
.finance-entity-panel { overflow: hidden; }
.table-scrollbar-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 18px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  scrollbar-color: #9aa7ae #eef1f2;
}
.table-scrollbar-top > div { height: 1px; }
.finance-entity-scroll { max-height: calc(100vh - 285px); }
.finance-entity-table th { position: sticky; top: 0; z-index: 2; }
.finance-entity-table th:first-child,
.finance-entity-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 72px;
  min-width: 72px;
  background: #fff;
}
.finance-entity-table th:nth-child(2),
.finance-entity-table td:nth-child(2) {
  position: sticky;
  left: 72px;
  z-index: 3;
  width: 260px;
  min-width: 260px;
  background: #fff;
  box-shadow: 8px 0 12px -12px rgba(23, 42, 58, .55);
}
.finance-entity-table th:last-child,
.finance-entity-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 84px;
  background: #fff;
  box-shadow: -8px 0 12px -12px rgba(23, 42, 58, .55);
}
.finance-entity-table th:first-child,
.finance-entity-table th:nth-child(2),
.finance-entity-table th:last-child { z-index: 4; background: #fafafa; }
.finance-entity-table tr.row-attention td:first-child,
.finance-entity-table tr.row-attention td:nth-child(2),
.finance-entity-table tr.row-attention td:last-child { background: #fffaf1; }
.finance-entity-table tbody tr:hover td:first-child,
.finance-entity-table tbody tr:hover td:nth-child(2),
.finance-entity-table tbody tr:hover td:last-child { background: #f9fbfa; }
.compact-field { min-width: 135px; gap: 4px; }
.compact-field span { font-size: 10px; }
.compact-field input { min-height: 34px; padding: 7px 9px; }
.row-attention { background: #fffaf1; }.row-attention:hover { background: #fff7e8 !important; }

.empty-state { padding: 55px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 15px; }
.loading-card { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--muted); }
.spinner { width: 17px; height: 17px; border: 2px solid #dbe1df; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-body { min-height: 100vh; color: var(--ink); background: var(--canvas); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); padding: 0; max-width: none; }
.auth-intro { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 48px clamp(44px, 7vw, 104px); overflow: hidden; color: #f6f9f8; background: linear-gradient(145deg, #112331 0%, #183546 62%, #1f5b57 145%); }
.auth-intro::before { content: ""; position: absolute; width: 540px; height: 540px; right: -230px; top: -170px; border: 1px solid rgba(142,197,187,.16); border-radius: 50%; box-shadow: 0 0 0 90px rgba(142,197,187,.035), 0 0 0 180px rgba(142,197,187,.025); }
.auth-intro::after { content: ""; position: absolute; left: 0; right: 0; bottom: 19%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; font-size: 15px; letter-spacing: .04em; }
.auth-brand .brand-mark { display: grid; }
.auth-intro-copy { position: relative; z-index: 1; max-width: 620px; margin: auto 0; }
.auth-intro-copy .eyebrow { color: #83c0b6; }
.auth-intro-copy h1 { max-width: 570px; margin: 18px 0 22px; font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(36px, 4.2vw, 62px); font-weight: 500; line-height: 1.22; letter-spacing: -.045em; }
.auth-intro-copy > p:last-child { max-width: 510px; margin: 0; color: #a9bac1; font-size: 14px; line-height: 1.8; }
.auth-security-note { position: relative; z-index: 1; max-width: 430px; padding-left: 16px; border-left: 2px solid #6eafa4; }
.auth-security-note span { color: #d8e8e5; font-size: 11px; font-weight: 800; letter-spacing: .08em; }.auth-security-note p { margin: 6px 0 0; color: #8fa3ad; font-size: 11px; }
.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 44px; background: radial-gradient(circle at 100% 0%, rgba(30,119,110,.09), transparent 35%), #f4f5f3; }
.auth-card { width: min(410px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 60px rgba(23,42,58,.1); }
.auth-card-head { margin-bottom: 28px; }.auth-kicker { color: var(--teal); font-size: 9px; font-weight: 900; letter-spacing: .17em; }.auth-card-head h2 { margin: 10px 0 8px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 29px; }.auth-card-head p { margin: 0; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 17px; }.auth-field { display: grid; gap: 8px; }.auth-field span { color: #43515c; font-size: 11px; font-weight: 800; }.auth-field input { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #dce1e3; border-radius: 9px; color: var(--ink); background: #fbfcfb; outline: 0; }.auth-field input:focus { border-color: #659d95; box-shadow: 0 0 0 3px rgba(30,119,110,.09); background: #fff; }
.auth-submit { width: 100%; min-height: 45px; margin-top: 5px; }.auth-submit:disabled { cursor: wait; opacity: .7; }
.auth-alert { margin: -8px 0 18px; padding: 11px 13px; border: 1px solid #efd0cd; border-radius: 9px; color: #9c3f3f; background: #fdf1f0; font-size: 11px; line-height: 1.55; }
.auth-alert.is-success { color: #236a62; border-color: #b9d8d2; background: #edf7f4; }
.auth-password-hint { margin: -2px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-footnote { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #969ea5; text-align: center; font-size: 10px; }
.sso-only-panel { padding: 22px; border: 1px solid #cfe1de; border-radius: 12px; background: #f1f7f5; text-align: center; }.sso-only-panel strong { display: block; margin: 12px 0 6px; color: #245d57; font-size: 13px; }.sso-only-panel p { margin: 0; color: var(--muted); font-size: 11px; }.sso-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; border-radius: 13px; color: #fff; background: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: .04em; }

@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .auth-panel { padding: 24px; }
  .auth-card { padding: 30px 25px; }
}

.modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.modal-wide { width: min(1080px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(13,28,38,.58); backdrop-filter: blur(3px); }
.modal-card { margin: 0; padding: 0; background: #fff; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 25px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 21px; }
.modal-body { max-height: calc(100vh - 190px); padding: 22px 25px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 25px; border-top: 1px solid var(--line); background: #fafafa; }
.reminder-intro { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.reminder-table { min-width: 900px; }
.reminder-row .expiry-indicator { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.audit-toolbar { align-items: flex-start; }
.audit-toolbar .filter-row { flex: 1; }
.audit-log-table { min-width: 1180px; }
.audit-log-table td:first-child { white-space: nowrap; }
.audit-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.audit-detail-hero { margin-bottom: 15px; }
.audit-detail-block { margin-top: 17px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.audit-detail-block h3 { margin: 0 0 12px; font-size: 13px; }
.audit-detail-block pre { max-height: 310px; margin: 0; padding: 14px; overflow: auto; border-radius: 9px; color: #dce8e5; background: #1d303b; font: 10px/1.65 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; word-break: break-all; }
.audit-change-table { min-width: 720px; }
.audit-change-table td { max-width: 360px; white-space: pre-wrap; word-break: break-word; }
.audit-error { margin-top: 15px; padding: 12px 14px; border: 1px solid #efc6c2; border-radius: 9px; color: #9f3434; background: #fff1ef; font-size: 11px; }
.reminder-overdue .expiry-indicator { color: #9f3434; background: #fde9e7; }
.reminder-due_30 .expiry-indicator { color: #a55c17; background: #fff0dc; }
.reminder-due_60 .expiry-indicator { color: #8a7217; background: #fff8d8; }
.form-section + .form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 13px; color: #30414d; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 7px; }.field.full { grid-column: 1 / -1; }
.field > span { color: #4d5963; font-size: 11px; font-weight: 700; }
.field .required { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid #dfe3e5; border-radius: 8px; color: var(--ink); background: #fff; outline: 0; }
.fixed-value { padding: 10px 11px; border: 1px solid #dfe3e5; border-radius: 8px; color: var(--teal); background: #f4f9f7; font-weight: 800; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #6fa49c; box-shadow: 0 0 0 3px rgba(30,119,110,.09); }
.field textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.check-row { display: flex; flex-wrap: wrap; gap: 9px; }
.check-card { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.check-card input { accent-color: var(--teal); }
.file-field { padding: 15px; border: 1px dashed #cbd3d3; border-radius: 10px; background: #fafbfa; }
.hint { color: var(--muted); font-size: 10px; line-height: 1.5; }

.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 22px; border-radius: 14px; color: #f7fbfa; background: linear-gradient(125deg, var(--navy), #244354); }
.detail-hero h3 { margin: 5px 0 7px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 22px; }.detail-hero p { margin: 0; color: #afc0c8; font-size: 11px; }
.detail-code { color: #8ec5bb; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.detail-hero-actions { display: flex; align-items: flex-start; gap: 8px; }
.detail-tabs { display: flex; gap: 6px; margin: 19px 0 14px; }
.detail-tab { padding: 8px 11px; border: 0; border-radius: 8px; color: var(--muted); background: #f0f2f2; font-size: 11px; font-weight: 700; }
.detail-tab.active { color: #fff; background: var(--teal); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.info-tile { min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.info-tile span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; }.info-tile strong { font-size: 12px; font-weight: 600; line-height: 1.5; }
.detail-section { margin-top: 17px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }.detail-section-head h3 { margin: 0; font-size: 13px; }
.mini-list { display: grid; gap: 8px; }.mini-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 9px; background: #f7f8f7; }
.mini-item strong { font-size: 11px; }.mini-item span { color: var(--muted); font-size: 10px; }

.network-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 20px 22px; }
.network-summary h2 { margin: 4px 0 5px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 20px; }
.network-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.relationship-kicker { color: var(--teal); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.network-summary-actions { display: grid; justify-items: end; gap: 10px; min-width: min(460px, 46vw); }
.network-search { width: 100%; min-width: min(430px, 44vw); }
.network-inline-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.network-inline-stats span { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: #f0f3f2; font-size: 9px; }.network-inline-stats strong { margin-right: 3px; color: var(--teal); font-size: 11px; }
.relationship-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.relationship-stats article { min-height: 76px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.relationship-stats span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.relationship-stats strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.company-group-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.company-group-cards button { min-height: 74px; padding: 11px 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; text-align: left; transition: transform .15s, border-color .15s, box-shadow .15s; }
.company-group-cards button:hover { transform: translateY(-1px); border-color: #9bbcb6; box-shadow: 0 7px 20px rgba(23,42,58,.07); }
.company-group-cards span, .company-group-cards strong, .company-group-cards small { display: block; }.company-group-cards span { color: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .08em; }.company-group-cards strong { margin-top: 5px; font-size: 12px; }.company-group-cards small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.network-panel { position: relative; overflow: hidden; background: #fff; }
.network-panel:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; background: #fff; }
.network-panel:fullscreen .network-canvas { height: calc(100vh - 72px); }
.network-panel:fullscreen .network-panel-head { min-height: 72px; background: #fff; }
.network-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.network-panel-head h3 { margin: 0; font-size: 14px; }.network-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.network-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 9px; }
.network-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin: 0 5px -1px 0; border-radius: 50%; background: var(--navy); }
.network-legend i { width: 1px; height: 15px; margin: 0 2px; background: var(--line); }
.network-legend .ownership-line::before { width: 17px; height: 2px; margin-bottom: 2px; border-radius: 2px; background: var(--teal); }
.network-toolbox { position: absolute; top: 79px; left: 14px; z-index: 3; display: flex; gap: 6px; }
.network-toolbox .btn { min-width: 34px; padding-inline: 9px; box-shadow: 0 5px 15px rgba(23,42,58,.08); }
.network-canvas { position: relative; height: clamp(540px, 67vh, 730px); overflow: hidden; cursor: grab; touch-action: none; background: linear-gradient(rgba(78,111,143,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(78,111,143,.045) 1px, transparent 1px), #fbfcfb; background-size: 28px 28px; }
.network-canvas.is-panning { cursor: grabbing; }
.network-canvas svg { display: block; width: 100%; height: 100%; overflow: hidden; user-select: none; }
.company-group rect { fill: color-mix(in srgb, var(--group-color) 7%, white); stroke: color-mix(in srgb, var(--group-color) 38%, white); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; transition: opacity .2s, stroke-width .2s; }
.company-group text { fill: var(--group-color); font-size: 12px; font-weight: 900; letter-spacing: .6px; }
.company-group.is-active rect { stroke-width: 3; stroke-dasharray: none; }.company-group.is-muted { opacity: .08; }
.network-edge { vector-effect: non-scaling-stroke; stroke-width: 1.35; opacity: .27; transition: opacity .18s, stroke-width .18s; }
.edge-company-relation { stroke: #5c9189; }
.network-edge.is-active { stroke-width: 2.35; opacity: .92; }.network-edge.is-muted { opacity: .025; }
.network-node { cursor: pointer; outline: none; opacity: .94; transition: opacity .2s; }
.network-node-visual { transform-box: fill-box; transform-origin: center; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.network-node circle { vector-effect: non-scaling-stroke; fill: var(--node-color, var(--navy)); stroke: color-mix(in srgb, var(--node-color, var(--navy)) 70%, #172a3a); stroke-width: 3; filter: drop-shadow(0 4px 6px rgba(23,42,58,.14)); }
.network-node-symbol { pointer-events: none; fill: #fff; font-size: 8px; font-weight: 900; }
.network-node-label { pointer-events: none; fill: #35414b; stroke: rgba(251,252,251,.97); stroke-width: 4px; paint-order: stroke; font-size: 8.5px; font-weight: 750; }
.network-node.is-hovered .network-node-visual { transform: scale(1.16); }.network-node.is-related, .network-node.is-selected { opacity: 1; }.network-node.is-selected .network-node-visual { transform: scale(1.12); }
.network-node.is-hovered .network-node-label, .network-node.is-selected .network-node-label { fill: var(--ink); font-size: 10px; font-weight: 900; }.network-node.is-muted { opacity: .075; }
.network-node.is-selected circle { stroke: #e9b863; stroke-width: 5; }
.company-focus-panel { position: absolute; top: 18px; right: 18px; z-index: 2; width: min(320px, calc(100% - 36px)); max-height: calc(100% - 75px); overflow: auto; padding: 16px; border: 1px solid rgba(204,214,215,.92); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.97); box-shadow: 0 15px 38px rgba(23,42,58,.16); backdrop-filter: blur(8px); }
.network-tooltip-role { display: block; margin-bottom: 5px; color: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.company-focus-panel > strong { display: block; font-size: 13px; line-height: 1.5; }.company-focus-panel > p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.company-relation-list { display: grid; gap: 7px; }.company-relation-list button { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 7px; align-items: center; width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f7f9f8; text-align: left; }.company-relation-list button:hover { border-color: #8fb7af; background: #eef6f4; }.company-relation-list span { color: var(--teal); font-size: 9px; font-weight: 900; }.company-relation-list strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.company-detail-button { width: 100%; margin-top: 12px; }
.network-hint { position: absolute; left: 16px; bottom: 14px; padding: 7px 10px; border: 1px solid rgba(220,225,225,.86); border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.88); font-size: 9px; pointer-events: none; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 10px; color: #fff; background: #243845; box-shadow: 0 13px 35px rgba(0,0,0,.2); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { background: #a74646; }.toast.success { background: #236b63; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1160px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .record-card { grid-template-columns: 1fr 1fr; }
  .relationship-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .company-group-cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 72px minmax(0,1fr); }
  .sidebar { padding: 20px 12px; }.brand { padding-left: 3px; }.brand > div:last-child, .nav-item span:last-child, .sidebar-note, .sidebar-footer > div:last-child { display: none; }
  .nav-item { justify-content: center; padding: 12px; }.nav-icon { width: auto; }.sidebar-footer { justify-content: center; }
  .topbar { align-items: flex-start; padding: 20px; }.top-actions { flex-direction: column; align-items: stretch; }.month-control { justify-content: space-between; }
  main { padding: 20px; }.form-grid, .form-grid.cols-3, .detail-grid { grid-template-columns: 1fr; }.record-card { grid-template-columns: 1fr; }
  .network-summary { align-items: stretch; flex-direction: column; }.network-summary-actions { min-width: 0; justify-items: stretch; }.network-search { min-width: 0; width: 100%; }.network-inline-stats { justify-content: flex-start; }
  .company-group-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .app-shell { display: block; }.sidebar { position: static; height: auto; padding: 12px; }.brand, .sidebar-note, .sidebar-footer { display: none; }.nav-list { grid-template-columns: repeat(9, 1fr); gap: 3px; }.nav-item { padding: 10px 4px; }.nav-item.active { box-shadow: inset 0 -3px 0 #7bb3a9; }
  .topbar { position: static; display: block; }.top-actions { margin-top: 15px; }.kpi-grid { grid-template-columns: 1fr; }.toolbar, .view-head { align-items: stretch; flex-direction: column; }.search-box { min-width: 0; width: 100%; }.filter-row { display: grid; grid-template-columns: 1fr 1fr; }.detail-hero { grid-template-columns: 1fr; }
  .relationship-stats, .company-group-cards { grid-template-columns: 1fr; }.network-panel-head { align-items: flex-start; flex-direction: column; }.network-legend { justify-content: flex-start; }.network-canvas { height: 610px; }
}
