/* Visual hierarchy for the management, staff and sign-in screens.
   Kept separate from app.css so business and print layouts remain untouched. */
@media screen {
  :root {
    --navy: #152f49;
    --blue: #1769d4;
    --blue-soft: #eaf3ff;
    --ink: #152b40;
    --muted: #596d82;
    --line: #dce6ef;
    --background: #f3f6fa;
    --surface: #fff;
    --success: #147456;
  }

  body { line-height: 1.5; }
  .app-shell { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar {
    padding: 20px 14px 18px;
    background: linear-gradient(180deg, #193b58 0%, #122b43 100%);
    border-right: 1px solid #10263b;
  }
  .brand { gap: 11px; padding: 3px 6px 18px; }
  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ff9a43, #ee6530);
    box-shadow: 0 8px 20px rgba(7, 22, 38, .22);
  }
  .brand strong { font-size: 17px; letter-spacing: .01em; }
  .brand span { color: #bdcede; }
  .sidebar nav { gap: 3px; margin-top: 14px; padding: 0 5px 8px 0; }
  .mobile-nav-toggle { display: none; }
  .nav-section-label {
    padding: 13px 10px 5px;
    color: #89a8c3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    user-select: none;
  }
  .nav-section-label:first-child { padding-top: 2px; }
  .sidebar .nav-item {
    min-height: 43px;
    padding: 8px 10px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    border-radius: 10px;
    color: #e1eaf2;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
  }
  .sidebar .nav-item > span,
  .sidebar .nav-group-title > span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(225, 238, 249, .09);
    color: #a8c7df;
    font-size: 12px;
    font-weight: 800;
  }
  .sidebar .nav-item:not(.active):not(.muted):hover,
  .sidebar .nav-group-title:hover { background: rgba(207, 229, 248, .12); color: #fff; }
  .sidebar .nav-item.active {
    background: #f5d072;
    color: #152b40;
    box-shadow: inset 4px 0 0 #e6a83b, 0 5px 14px rgba(5, 18, 31, .15);
  }
  .sidebar .nav-item.active > span { background: rgba(20, 44, 66, .10); color: #152b40; }
  .sidebar .nav-group-title { min-height: 43px; padding: 8px 10px; grid-template-columns: 34px minmax(0, 1fr) auto; font-size: 13px; font-weight: 600; }
  .sidebar .nav-group-items { margin-left: 15px; }
  .side-note { margin-top: 12px; color: #a8bfd3; font-size: 11px; }

  .topbar {
    height: auto;
    min-height: 94px;
    padding: 18px clamp(20px, 2.6vw, 38px);
    gap: 18px;
    background: linear-gradient(180deg, #fff, #fbfdff);
    box-shadow: 0 3px 18px rgba(22, 49, 76, .04);
  }
  .topbar > div:first-child { min-width: 0; }
  .topbar > div:first-child::before {
    content: "纵泰办公 · 工作台";
    display: block;
    margin-bottom: 4px;
    color: #4678a7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
  }
  .topbar h1 { color: #122b43; font-size: clamp(21px, 2vw, 25px); line-height: 1.25; }
  .topbar p { margin-top: 5px; color: #5a7085; font-size: 13px; line-height: 1.45; }
  .topbar-actions { justify-content: flex-end; gap: 8px; }
  .office-identity { margin-right: 5px; color: #294b69; font-size: 12px; }
  .topbar-actions .button.secondary { min-width: 0; min-height: 34px; padding: 6px 11px; border: 1px solid #d9e5ef; background: #f4f8fc; color: #325b7d; font-size: 12px; }
  .topbar-actions .button.secondary:hover { background: #e9f2fb; border-color: #abc9e7; }
  #officeLogout, #staffLogout { color: #8a4439; background: #fff5f2; border-color: #f0d8d2; }

  .content { width: min(1580px, 100%); padding: 24px clamp(20px, 2.6vw, 38px) 52px; }
  .page-view { min-width: 0; }
  .dashboard-focus-header {
    position: relative;
    padding: 20px 24px;
    border: 1px solid #cddff0;
    border-left: 4px solid #4388c8;
    border-radius: 15px;
    background: linear-gradient(105deg, #eaf4ff 0%, #f7fbff 63%, #fff 100%);
    overflow: hidden;
  }
  .dashboard-focus-header::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    right: -60px;
    top: -110px;
    border: 32px solid rgba(71, 138, 207, .07);
    border-radius: 50%;
    pointer-events: none;
  }
  .dashboard-focus-eyebrow { color: #1769bb; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
  .dashboard-focus-header h2 { margin: 3px 0 5px; color: #163a5a; font-size: 22px; line-height: 1.3; }
  .dashboard-focus-header p { margin: 0; color: #58728a; font-size: 13px; }
  #dashboardPanel .dashboard-summary-grid { margin-top: 16px; }

  /* Keep the first screen scannable: scale space and type together, never the click targets. */
  #dashboardPanel .dashboard-focus-header { padding: 14px 18px; }
  #dashboardPanel .dashboard-focus-header::after { width: 150px; height: 150px; top: -82px; right: -42px; border-width: 22px; }
  #dashboardPanel .dashboard-focus-header h2 { font-size: 19px; margin: 2px 0 3px; }
  #dashboardPanel .dashboard-focus-header p { font-size: 12px; }
  #dashboardPanel .assistant-quick-panel { margin-top: 12px; padding: 12px 16px; }
  #dashboardPanel .assistant-quick-panel h2 { font-size: 15px; margin-bottom: 3px; }
  #dashboardPanel .assistant-quick-panel p { font-size: 12px; margin-bottom: 8px; }
  #dashboardPanel .assistant-quick-panel .assistant-prompts { gap: 7px; }
  #dashboardPanel .assistant-quick-panel .assistant-prompts button { padding: 6px 10px; font-size: 12px; }
  #dashboardPanel .dashboard-summary-grid { gap: 7px; margin-top: 9px; }

  .summary-grid, .legacy-summary-grid, .dashboard-summary-grid, .backup-summary-grid,
  .workflow-summary-grid, .approval-summary-grid, .staff-overview { gap: 7px; }
  /* Keep metric groups together instead of stretching a few cards across the whole page. */
  .summary-grid, .legacy-summary-grid, .backup-summary-grid, .workflow-summary-grid { max-width: 984px; }
  .dashboard-summary-grid { max-width: 1024px; }
  .approval-summary-grid { max-width: 928px; }
  .staff-overview { max-width: 744px; }
  .expense-summary-grid { max-width: 496px; }
  .project-seal-summary-grid, .document-seal-summary-grid { max-width: 744px; }
  .summary-grid[data-page="contracts"], .staff-contract-summary-grid { max-width: 1130px; }
  #projectsPanel .project-summary-grid, .staff-project-view .project-summary-grid { max-width: 1160px; }
  .summary-card, .dashboard-card, .staff-overview > div {
    border-color: #dce6ef;
    border-radius: 11px;
    box-shadow: 0 4px 14px rgba(21, 47, 73, .045);
  }
  .summary-card { min-width: 0; border-top: 2px solid #8bbce8; padding: 7px 9px; }
  .summary-card span, .dashboard-card span, .staff-overview span { color: #526b82; font-size: 11px; font-weight: 700; }
  .summary-card strong, .dashboard-card strong, .staff-overview strong {
    color: #132f49;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .summary-card strong { margin: 2px 0 1px; font-size: clamp(18px, 1.25vw, 20px); letter-spacing: -.025em; }
  /* Only non-zero attention figures turn red; zero and completed counts stay neutral. */
  .summary-card strong.metric-alert-value { color: #b4433d; }
  .summary-card small, .dashboard-card small { color: #718499; font-size: 10.5px; line-height: 1.3; }
  .dashboard-card { position: relative; min-height: 76px; padding: 8px 10px; border-top: 2px solid #91bce8; }
  .dashboard-card strong { margin: 2px 0 1px; font-size: clamp(19px, 1.3vw, 21px); letter-spacing: -.025em; }
  .dashboard-card:hover { border-color: #8fb7df; box-shadow: 0 10px 22px rgba(21, 73, 126, .11); transform: translateY(-2px); }
  .dashboard-card:first-child { border-color: #b7d6ef; border-top-color: #458ac8; background: linear-gradient(135deg, #eef7ff, #fff); }
  .dashboard-card:first-child span, .dashboard-card:first-child small { color: #476b8a; }
  .dashboard-card:first-child strong { color: #174c7d; }
  .dashboard-card.danger:not(.is-clear) { border-top-color: #cd7069; background: #fff7f6; }
  .dashboard-card.warning:not(.is-clear) { border-top-color: #d3a04c; background: #fffbf2; }
  .dashboard-card.danger.is-clear, .dashboard-card.warning.is-clear { border-top-color: #a8c4d6; background: #fbfdff; }
  .dashboard-card.danger.is-clear strong, .dashboard-card.warning.is-clear strong { color: #237557; }
  .dashboard-card.is-attention { border-top-color: #d5a049; background: #fffbf2; }
  .dashboard-card.is-attention strong { color: #755013; }
  #dashboardPanel .dashboard-card { min-height: 76px; padding: 8px 10px; border-radius: 10px; }
  #dashboardPanel .dashboard-card strong { margin: 2px 0 1px; font-size: clamp(19px, 1.3vw, 21px); }
  #dashboardPanel .dashboard-card small { padding-right: 22px; }
  #dashboardPanel .dashboard-card::after {
    content: "→";
    position: absolute;
    right: 10px;
    bottom: 8px;
    color: #477da9;
    font-size: 18px;
    line-height: 1;
    transition: transform .16s ease;
  }
  #dashboardPanel .dashboard-card:first-child::after { color: #4d87b7; }
  #dashboardPanel .dashboard-card:hover::after { transform: translateX(3px); }

  #projectsPanel .project-summary-grid { gap: 7px; margin-bottom: 10px; }
  #projectsPanel .project-summary-grid .summary-card { min-height: 76px; padding: 7px 9px; }
  #projectsPanel .project-summary-grid .summary-card strong {
    margin: 2px 0 1px;
    font-size: clamp(18px, 1.25vw, 20px);
    letter-spacing: -.02em;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  #projectsPanel .project-summary-grid .summary-card small { line-height: 1.35; }

  .panel { border-color: #dce6ef; border-radius: 14px; box-shadow: 0 5px 20px rgba(21, 47, 73, .045); }
  .panel-heading { padding: 19px 22px; background: linear-gradient(180deg, #fff, #fcfdff); }
  .panel-heading h2, .staff-grid h2, .staff-history h2 { color: #193b58; font-size: 18px; line-height: 1.3; }
  .panel-heading p { max-width: 760px; color: #667b90; font-size: 13px; line-height: 1.5; }
  .dashboard-approval-panel { border-top: 3px solid #9ebbd4; }
  .dashboard-approval-panel.has-work { border-top-color: #db9e44; }
  .dashboard-approval-panel.has-work > .panel-heading { background: linear-gradient(90deg, #fffaf0, #fff 52%); }
  .dashboard-approval-panel.has-work #dashboardOpenApprovals { border-color: #1769d4; background: #1769d4; color: #fff; box-shadow: 0 4px 12px rgba(23, 105, 212, .17); }
  .dashboard-approval-panel.has-work #dashboardOpenApprovals:hover { background: #0c57bb; border-color: #0c57bb; }
  .dashboard-task-panel { border-top: 3px solid #bacbd9; }
  .dashboard-task-panel.has-work { border-top-color: #e2b15b; }
  #dashboardPanel .panel-heading { border-bottom: 1px solid #e6edf3; }
  #dashboardPanel .dashboard-approval-open, #dashboardPanel .dashboard-follow-up { padding: 4px 9px; border: 1px solid #c9def0; border-radius: 7px; background: #f2f8ff; font-weight: 700; text-decoration: none; }
  #dashboardPanel .dashboard-approval-open:hover, #dashboardPanel .dashboard-follow-up:hover { border-color: #8ab9e1; background: #e4f1ff; }
  .dashboard-milestone-panel, .dashboard-owner-milestone-panel { border-top: 3px solid #b9cde1; }

  #businessReviewPanel { border-top: 3px solid #5d9fdb; }
  #businessReviewPanel .approval-list-heading { align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
  #businessReviewPanel .approval-list-heading > div:first-child { flex: 1 1 290px; min-width: 0; }
  #businessReviewPanel .approval-list-heading h2 { font-size: 18px; }
  #businessReviewPanel .approval-filters {
    flex: 1 1 620px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    padding: 8px;
    border: 1px solid #e0eaf3;
    border-radius: 10px;
    background: #f7faff;
  }
  #businessReviewPanel .business-review-filter-caption { padding: 0 4px; color: #5a7288; font-size: 12px; font-weight: 700; white-space: nowrap; }
  #businessReviewPanel .approval-filters select { flex: 0 1 146px; min-width: 130px; }
  #businessReviewPanel .approval-filters .table-search { flex: 1 1 210px; min-width: 185px; }
  #businessReviewPanel .approval-filters :is(select, input) { min-height: 38px; }
  #businessReviewPanel .approval-filters .business-review-reset { min-width: 0; min-height: 38px; padding: 6px 10px; border: 1px solid #b9d5ec; background: #eaf4ff; color: #245a88; font-size: 12px; white-space: nowrap; }
  #businessReviewPanel .approval-filters .business-review-reset:disabled { opacity: .58; }
  #businessReviewPanel .approval-table { min-width: 980px; table-layout: fixed; }
  #businessReviewPanel .approval-table :is(th, td) { padding: 11px 13px; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(1) { width: 8%; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(2) { width: 28%; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(3) { width: 11%; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(4) { width: 11%; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(5) { width: 15%; }
  #businessReviewPanel .approval-table :is(th, td):nth-child(6) { width: 27%; }
  #businessReviewPanel .approval-table th:last-child { text-align: right; }
  #businessReviewPanel .approval-table td:first-child { color: #345b78; font-weight: 700; }
  #businessReviewPanel .approval-table td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
  #businessReviewPanel .approval-table td:nth-child(2) strong { display: block; max-width: 100%; color: #1a3852; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  #businessReviewPanel .approval-table tbody tr:hover { background: #f1f8ff; box-shadow: inset 3px 0 0 #76afe2; }
  #businessReviewPanel .row-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; white-space: normal; }
  #businessReviewPanel .row-actions .detail-button {
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #cadced;
    border-radius: 7px;
    background: #fff;
    color: #245a88;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
  }
  #businessReviewPanel .row-actions .detail-button:hover { border-color: #7bb5e6; background: #eaf4ff; text-decoration: none; }
  #businessReviewPanel .row-actions .business-review-detail { border-color: #1769d4; background: #1769d4; color: #fff; }
  #businessReviewPanel .row-actions .business-review-detail:hover { border-color: #0c57bb; background: #0c57bb; }
  #businessReviewPanel .row-actions .business-review-action[data-action="approve"] { border-color: #a9d6be; background: #f0faf4; color: #176548; }
  #businessReviewPanel .row-actions .business-review-action[data-action="unlock"] { border-color: #ecd1a0; background: #fff8e8; color: #8b5b0d; }
  #businessReviewPanel .empty { height: 96px; }

  .business-review-detail-dialog { width: min(900px, calc(100vw - 32px)); }
  .business-review-detail-content { width: 100%; max-width: none; max-height: 68vh; padding: 18px 22px 22px; background: #fff; white-space: normal; }
  .business-review-detail-note { margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; background: #f0f6fc; color: #49647c; font-size: 12px; line-height: 1.5; }
  .business-review-correction-note { margin: 10px 0 0; padding: 9px 12px; border-left: 3px solid #dfab63; border-radius: 6px; background: #fff9ef; color: #684a26; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
  .business-review-detail-section { margin-top: 13px; }
  .business-review-detail-section h3 { margin: 0 0 8px; color: #193b58; font-size: 14px; }
  .business-review-detail-section dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
  .business-review-detail-field { min-width: 0; padding: 9px 11px; border: 1px solid #e1eaf2; border-radius: 8px; background: #f9fbfd; }
  .business-review-detail-field dt { color: #60788d; font-size: 11px; }
  .business-review-detail-field dd { margin: 3px 0 0; color: #1d3851; font-size: 13px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
  .business-review-raw { margin-top: 18px; border-top: 1px solid #e2eaf1; padding-top: 12px; }
  .business-review-raw summary { color: #225f96; font-size: 12px; font-weight: 700; cursor: pointer; }
  .business-review-raw pre { max-height: 300px; overflow: auto; padding: 12px; border-radius: 8px; background: #f3f6fa; color: #3c5368; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

  .button { min-height: 39px; border-radius: 8px; transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
  .button.primary { background: #1769d4; box-shadow: 0 4px 12px rgba(23, 105, 212, .18); }
  .button.primary:not(:disabled):hover { background: #0c57bb; box-shadow: 0 6px 16px rgba(23, 105, 212, .24); }
  .button.secondary:not(:disabled):hover { background: #dceaf8; }
  .detail-button { min-height: 30px; padding: 3px 5px; border-radius: 5px; color: #1264bc; text-underline-offset: 3px; }
  .detail-button:hover { background: #edf5fd; text-decoration: underline; }

  .table-wrap { scrollbar-color: #bfd0df transparent; scrollbar-width: thin; }
  .table-wrap table th { padding: 12px 14px; background: #f3f7fb; color: #506a81; font-size: 12px; letter-spacing: .01em; white-space: nowrap; }
  .table-wrap table td { padding: 12px 14px; color: #243b50; font-size: 13px; line-height: 1.5; }
  .table-wrap table tbody tr:hover { background: #f1f7fd; }
  .table-wrap table tbody tr:focus-within { background: #eef5fc; }
  .table-wrap table td.number { color: #193b58; font-weight: 650; }
  #personnelPanel .personnel-sensitive { color: #506a81; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
  #personnelPanel .personnel-payroll-linked { display: block; margin-top: 5px; color: #39735c; font-size: 11px; white-space: nowrap; }
  #payrollContactDialog { width: min(980px, calc(100vw - 32px)); }
  #payrollContactDialog .payroll-contact-hint { margin: 0; padding: 16px 22px; line-height: 1.6; }
  #payrollContactDialog .payroll-contact-table-wrap { max-height: min(55vh, 520px); overflow: auto; }
  #payrollContactDialog .payroll-contact-warning { color: #a24728; font-weight: 650; }
  .table-wrap table .empty { color: #688198; font-size: 13px; }
  #settlementsPanel .settlement-table :is(th, td) { padding: 10px 6px; font-size: 12px; line-height: 1.4; vertical-align: middle; }
  #settlementsPanel .settlement-table td:nth-child(2),
  #settlementsPanel .settlement-table td:nth-child(6),
  #settlementsPanel .settlement-table td:nth-child(8) { font-size: 11.5px; white-space: nowrap; }
  #settlementsPanel .settlement-table td:first-child,
  #settlementsPanel .settlement-table td:nth-child(8) strong { color: #174b77; font-weight: 750; }
  #settlementsPanel .settlement-table td:nth-child(4) { line-height: 1.45; }
  #settlementsPanel .settlement-deductions { gap: 6px 8px; padding: 6px 7px; border-radius: 7px; background: #f5f9fc; }
  #settlementsPanel .settlement-deductions dt { color: #657d91; font-size: 10.5px; }
  #settlementsPanel .settlement-deductions dd { color: #28445c; font-size: 11.5px; }
  #settlementsPanel .settlement-row-actions { gap: 5px 4px; }
  #settlementsPanel .settlement-row-actions :is(.detail-button, .business-row-review) {
    min-height: 27px; justify-content: center; padding: 3px 2px; margin: 0;
    border-radius: 6px; font-size: 11px; line-height: 1.25; white-space: nowrap;
  }
  #settlementsPanel .settlement-row-actions .settlement-print,
  #settlementsPanel .settlement-row-actions .settlement-edit { border: 1px solid #cbdfee; background: #f5f9ff; text-decoration: none; }
  #settlementsPanel .settlement-row-actions .business-row-unlock { border: 1px solid #d1e3f2; background: #fff; }
  #paymentsPanel .payment-overview-table-wrap { max-height: none; }
  #paymentsPanel .payment-overview-table { width: 100%; min-width: 0; table-layout: fixed; }
  #paymentsPanel .payment-overview-table :is(th, td) { padding: 11px 7px; vertical-align: middle; }
  #paymentsPanel .payment-overview-table th:nth-child(1) { width: 7%; }
  #paymentsPanel .payment-overview-table th:nth-child(2) { width: 22%; }
  #paymentsPanel .payment-overview-table th:nth-child(3) { width: 7%; }
  #paymentsPanel .payment-overview-table th:nth-child(4) { width: 11%; }
  #paymentsPanel .payment-overview-table th:nth-child(5) { width: 23%; }
  #paymentsPanel .payment-overview-table th:nth-child(6) { width: 11%; }
  #paymentsPanel .payment-overview-table th:nth-child(7) { width: 12%; white-space: normal; }
  #paymentsPanel .payment-overview-table th:nth-child(8) { width: 7%; }
  #paymentsPanel .payment-overview-table td:nth-child(2) { overflow-wrap: anywhere; }
  #paymentsPanel .payment-overview-table td:nth-child(4),
  #paymentsPanel .payment-overview-table td:nth-child(6) { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #paymentsPanel .payment-receipts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 7px; padding: 7px; border-radius: 8px; background: #f2f7fb; }
  #paymentsPanel .payment-receipts > div { min-width: 0; }
  #paymentsPanel .payment-receipts :is(span, strong, small) { display: block; }
  #paymentsPanel .payment-receipts span { color: #60798e; font-size: 10px; }
  #paymentsPanel .payment-receipts strong { color: #26445f; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  #paymentsPanel .payment-receipts .row-count { margin-top: 1px; font-size: 10px; }
  #paymentsPanel .payment-recognized-total { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 5px; border-top: 1px solid #d9e6ef; }
  #paymentsPanel .payment-recognized-total strong { color: #126c52; font-size: 13px; }
  #paymentsPanel .payment-status-stack { display: grid; justify-items: start; gap: 5px; }
  #paymentsPanel .payment-status-stack small { color: #647d92; font-size: 10.5px; line-height: 1.3; }
  #paymentsPanel .payment-overview-detail { min-height: 30px; padding: 4px 8px; border: 1px solid #c8dcf0; background: #f3f8fe; font-size: 12px; white-space: nowrap; }
  #paymentsPanel .payment-overview-pagination { margin-top: 9px; padding: 10px 3px 0; background: transparent; }
  #expensesPanel .expense-data-notice { margin: 9px 22px 0; }
  #expensesPanel .expense-data-notice summary {
    width: max-content; max-width: 100%; padding: 4px 7px; border-radius: 6px;
    color: #4f6f89; font-size: 12px; font-weight: 700; cursor: pointer;
  }
  #expensesPanel .expense-data-notice summary:hover { background: #eef5fc; color: #215d91; }
  #expensesPanel .expense-data-notice p { margin: 6px 0 10px; padding: 9px 11px; border-left: 3px solid #a8c8e8; border-radius: 6px; background: #f3f8fd; color: #4b657c; font-size: 12px; line-height: 1.55; }
  #expensesPanel .expense-claim-table-wrap { max-height: none; }
  #expensesPanel .expense-claim-table { width: 100%; min-width: 0; table-layout: fixed; }
  #expensesPanel .expense-claim-table th { padding: 10px 6px; font-size: 12px; }
  #expensesPanel .expense-claim-table td { padding: 11px 6px; font-size: 13px; line-height: 1.45; vertical-align: middle; }
  #expensesPanel .expense-claim-table th:nth-child(1) { width: 7%; }
  #expensesPanel .expense-claim-table th:nth-child(2) { width: 8%; }
  #expensesPanel .expense-claim-table th:nth-child(3) { width: 6%; }
  #expensesPanel .expense-claim-table th:nth-child(4) { width: 9%; }
  #expensesPanel .expense-claim-table th:nth-child(5) { width: 9%; }
  #expensesPanel .expense-claim-table th:nth-child(6) { width: 18%; }
  #expensesPanel .expense-claim-table th:nth-child(7) { width: 5%; }
  #expensesPanel .expense-claim-table th:nth-child(8) { width: 9%; }
  #expensesPanel .expense-claim-table th:nth-child(9) { width: 7%; }
  #expensesPanel .expense-claim-table th:nth-child(10) { width: 9%; }
  #expensesPanel .expense-claim-table th:nth-child(11) { width: 13%; }
  #expensesPanel .expense-claim-table td:nth-child(2),
  #expensesPanel .expense-claim-table td:nth-child(8) { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #expensesPanel .expense-claim-table td:nth-child(4),
  #expensesPanel .expense-claim-table td:nth-child(5),
  #expensesPanel .expense-claim-table td:nth-child(6),
  #expensesPanel .expense-claim-table td:nth-child(10) { overflow-wrap: anywhere; }
  #expensesPanel .expense-claim-table td:nth-child(6) { color: #1d3f5b; font-weight: 650; }
  #expensesPanel .expense-claim-table td:nth-child(10) { color: #698096; font-size: 11.5px; }
  #expensesPanel .expense-claim-table .row-actions { flex-wrap: wrap; gap: 3px 5px; white-space: normal; }
  #expensesPanel .expense-claim-table .detail-button { min-height: 27px; padding: 3px 2px; font-size: 12px; white-space: nowrap; }
  #expenseLedgerPanel .expense-ledger-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  #expenseLedgerPanel .expense-ledger-actions { flex-wrap: nowrap; }
  #expenseLedgerPanel .expense-data-notice { margin: 9px 22px 0; }
  #expenseLedgerPanel .expense-data-notice summary { width: max-content; max-width: 100%; padding: 4px 7px; border-radius: 6px; color: #4f6f89; font-size: 12px; font-weight: 700; cursor: pointer; }
  #expenseLedgerPanel .expense-data-notice summary:hover { background: #eef5fc; color: #215d91; }
  #expenseLedgerPanel .expense-data-notice p { margin: 6px 0 10px; padding: 9px 11px; border-left: 3px solid #a8c8e8; border-radius: 6px; background: #f3f8fd; color: #4b657c; font-size: 12px; line-height: 1.55; }
  #expenseLedgerPanel .expense-ledger-table-wrap { max-height: none; }
  #expenseLedgerPanel .expense-ledger-table { width: 100%; min-width: 1080px; table-layout: fixed; }
  #expenseLedgerPanel .expense-ledger-table :is(th, td) { padding: 10px 8px; font-size: 13px; line-height: 1.45; vertical-align: middle; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(1) { width: 8%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(2) { width: 9%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(3) { width: 8%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(4) { width: 20%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(5) { width: 13%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(6) { width: 21%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(7) { width: 15%; }
  #expenseLedgerPanel .expense-ledger-table th:nth-child(8) { width: 6%; }
  #expenseLedgerPanel .expense-ledger-table td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #expenseLedgerPanel .expense-ledger-table td:nth-child(4) { color: #1d3f5b; font-weight: 600; }
  #expenseLedgerPanel .expense-ledger-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; padding: 7px 8px; border-radius: 8px; background: #f2f7fb; }
  #expenseLedgerPanel .expense-ledger-amounts > div { min-width: 0; }
  #expenseLedgerPanel .expense-ledger-amounts span { display: block; color: #617b91; font-size: 10px; }
  #expenseLedgerPanel .expense-ledger-amounts strong { display: block; color: #2a4c66; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #expenseLedgerPanel .expense-ledger-registered strong { color: #0b63ce; font-weight: 800; }
  #expenseLedgerPanel .expense-ledger-settled strong { color: #008a64; font-weight: 800; }
  #expenseLedgerPanel .expense-ledger-balance { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 6px; padding-top: 4px; border-top: 1px solid #d8e5ef; }
  #expenseLedgerPanel .expense-ledger-balance strong { color: #c51948; font-size: 14px; font-weight: 800; }
  #expenseLedgerPanel .expense-ledger-balance small { grid-column: 1 / -1; color: #687f93; font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
  #expenseLedgerPanel .expense-ledger-balance small b { color: #8034bd; font-size: 11px; font-weight: 800; }
  #expenseLedgerPanel #expenseLedgerFilteredAmount { border-left: 3px solid #0b63ce; background: #eaf3ff; color: #365b82; }
  #expenseLedgerPanel #expenseLedgerFilteredAmount strong { color: #0b63ce; font-size: 15px; font-weight: 800; }
  #expenseLedgerPanel .expense-ledger-filter-outstanding { border-left: 3px solid #c51948; background: #fff0f4; color: #8b4256; }
  #expenseLedgerPanel .expense-ledger-filter-outstanding strong { color: #c51948; font-size: 15px; font-weight: 800; }
  #expenseLedgerPanel .expense-ledger-settlement { display: grid; justify-items: start; gap: 4px; }
  #expenseLedgerPanel .expense-ledger-settlement small { color: #687f93; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
  #expenseLedgerPanel .expense-ledger-settlement small strong { color: #294861; font-weight: 600; }
  #expenseLedgerPanel .expense-ledger-usage { display: grid; gap: 3px; min-width: 0; padding: 8px; border-radius: 8px; background: #f8f5fd; }
  #expenseLedgerPanel .expense-ledger-usage span { color: #72588c; font-size: 10px; }
  #expenseLedgerPanel .expense-ledger-usage strong { color: #714a8e; font-size: 13px; font-variant-numeric: tabular-nums; }
  #expenseLedgerPanel .expense-ledger-usage small { color: #5f6e7f; font-size: 11px; overflow-wrap: anywhere; }
  #expenseLedgerPanel .expense-ledger-table td:last-child { text-align: center; }
  #expenseLedgerPanel .expense-ledger-table td:last-child :is(.detail-button, .business-row-review, .business-row-unlock) { display: block; width: max-content; max-width: 100%; margin: 3px auto; white-space: nowrap; }
  #expenseLedgerPanel .expense-ledger-table td:last-child .detail-button { min-height: 28px; padding: 3px 4px; font-size: 12px; }
  #expenseLedgerDialog .expense-number-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; margin-top: -5px; padding: 7px 9px; border: 1px solid #dce6f0; border-radius: 7px; background: #f7faff; }
  #expenseLedgerDialog .expense-number-suggestions > span { color: #365c7e; font-size: 11px; font-weight: 700; }
  #expenseLedgerDialog .expense-number-suggestions small { color: #697d8e; font-size: 11px; }
  #expenseLedgerDialog .expense-number-suggestions button { padding: 4px 7px; border: 1px solid #bdd4e9; border-radius: 6px; background: #fff; color: #185a94; font-size: 11px; font-weight: 700; cursor: pointer; }
  #expenseLedgerDialog .expense-number-suggestions button:hover,
  #expenseLedgerDialog .expense-number-suggestions button:focus-visible { border-color: #1769d4; background: #eaf3ff; outline: none; }
  #expenseLedgerDialog .expense-number-disclaimer { color: #785d31; background: #fff9ed; }
  #documentSealsPanel > .seal-panel { max-width: 1120px; }
  #documentSealsPanel .document-seal-table-wrap { max-height: none; }
  #documentSealsPanel .document-seal-table { min-width: 1080px; }
  #documentSealsPanel .document-seal-table :is(th, td) { padding: 10px 8px; font-size: 13px; line-height: 1.5; white-space: normal; }
  #documentSealsPanel .document-seal-table th:nth-child(1) { width: 7%; }
  #documentSealsPanel .document-seal-table th:nth-child(2) { width: 10%; }
  #documentSealsPanel .document-seal-table th:nth-child(3) { width: 16%; }
  #documentSealsPanel .document-seal-table th:nth-child(4) { width: 14%; }
  #documentSealsPanel .document-seal-table th:nth-child(5) { width: 11%; }
  #documentSealsPanel .document-seal-table th:nth-child(6) { width: 12%; }
  #documentSealsPanel .document-seal-table th:nth-child(7) { width: 8%; }
  #documentSealsPanel .document-seal-table th:nth-child(8) { width: 6%; }
  #documentSealsPanel .document-seal-table th:nth-child(9) { width: 5%; }
  #documentSealsPanel .document-seal-table th:nth-child(10) { width: 11%; }
  #documentSealsPanel .document-seal-table td:nth-child(1),
  #documentSealsPanel .document-seal-table td:nth-child(2) { white-space: nowrap; }
  #documentSealsPanel .document-seal-table .source-stack small,
  #documentSealsPanel .document-seal-table .status { font-size: 12px; }
  #documentSealsPanel .document-seal-table .detail-button { font-size: 13px; }
  #documentSealsPanel .document-seal-table td:last-child { white-space: nowrap; overflow-wrap: normal; }
  #documentSealsPanel .document-seal-table .business-row-review { margin-left: 4px; padding: 2px 6px; }
  #documentSealsPanel .document-seal-table .business-row-unlock { display: block; width: max-content; max-width: 100%; margin: 4px 0 0; }
  #financePanel .finance-table :is(th, td) { padding: 8px 6px; line-height: 1.35; }
  #financePanel .finance-table td { vertical-align: middle; }
  #financePanel .finance-table td:nth-child(3) { max-width: none; white-space: normal; line-height: 1.4; }
  #financePanel .finance-table .finance-row-action-cell { white-space: normal; overflow-wrap: normal; }
  #financePanel .finance-row-action-cell .detail-button { min-height: 24px; padding: 2px 3px; font-size: 11px; white-space: nowrap; }
  #financePanel .finance-row-action-cell .business-row-review { margin-left: 4px; padding: 2px 5px; font-size: 11px; }
  #financePanel .finance-row-action-cell .business-row-unlock { display: block; width: max-content; max-width: 100%; margin: 2px 0 0; }
  .status { padding: 5px 9px; font-size: 11px; }
  .search-box, .table-search, .approval-filters select, .approval-filters input { border-color: #cfdce8; background: #fff; }
  .search-box input { font-size: 14px; }
  .search-box:focus-within { border-color: #4388d0; box-shadow: 0 0 0 3px rgba(23, 105, 212, .12); }
  .pagination { background: #fbfdff; border-top: 1px solid #edf1f5; }
  .finance-totals { gap: 12px; }
  .finance-totals { max-width: 1028px; }
  .finance-totals span { min-height: 82px; padding: 13px 15px; border: 1px solid #dbe7f0; border-left: 3px solid #83b6df; border-radius: 10px; background: #f8fbff; color: #526b82; font-size: 12px; font-weight: 700; }
  .finance-totals span:first-child { border-left-color: #56aa80; }
  .finance-totals span:nth-child(2) { border-left-color: #d78a7a; }
  .finance-totals span:last-child { border-left-color: #307ac2; background: #eef6ff; }
  .finance-totals strong { margin-top: 8px; color: #193b58; font-size: 20px; font-variant-numeric: tabular-nums; }
  #financePanel .finance-totals span:first-child strong { color: #116b51; }
  #financePanel .finance-totals span:nth-child(2) strong { color: #a84742; }
  #financePanel .finance-totals span:last-child strong { color: #14598e; }
  #financePanel .finance-category-section { background: #fbfdff; }
  #financePanel .finance-category-toggle {
    display: flex; align-items: center; gap: 10px; min-height: 44px;
    padding: 9px 22px; color: #244760; cursor: pointer; list-style: none;
  }
  #financePanel .finance-category-toggle::-webkit-details-marker { display: none; }
  #financePanel .finance-category-toggle:hover { background: #f1f7fd; }
  #financePanel .finance-category-title { font-size: 13px; font-weight: 750; }
  #financePanel .finance-category-count { padding: 2px 7px; border-radius: 999px; background: #e9f3fc; color: #245c87; font-size: 11px; font-weight: 700; }
  #financePanel .finance-category-note { color: #6b8194; font-size: 11px; }
  #financePanel .finance-category-state { margin-left: auto; color: #b4232d; font-size: 12px; font-weight: 700; }
  #financePanel .finance-category-state::before { content: "展开分类"; }
  #financePanel .finance-category-section[open] .finance-category-state::before { content: "收起分类"; }
  #financePanel .category-breakdown { padding: 2px 22px 14px; }
  #financePanel .category-breakdown span { font-size: 12px; }
  .finance-filters { background: #f8fbff; border-bottom: 1px solid #e5edf5; }
  #financePanel .finance-filters { gap: 8px; padding-block: 11px; }
  #financePanel .finance-search-group { order: -1; flex: 1 1 225px; min-width: 205px; margin-left: 0; }
  #financePanel .finance-search-group .search-box { max-width: none; }
  #financePanel #financeTypeFilter { width: 118px; }
  #financePanel #financeCategoryFilter,
  #financePanel #financeExpenseCategoryFilter { width: 148px; }
  #financePanel .finance-date-range input { width: 120px; }
  #financePanel .finance-row-action-cell .detail-button { min-height: 28px; padding: 3px 5px; font-size: 12px; }
  .migration-note { padding: 11px 13px; border-left: 3px solid #a8c8e8; color: #4b657c; font-size: 12px; line-height: 1.65; }
  .invoice-list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 0 22px 12px; }
  .invoice-list-toolbar h3 { margin: 0; color: #173b5c; font-size: 15px; }
  .invoice-list-toolbar .table-search { width: min(100%, 380px); min-width: 220px; }
  .invoice-date-range { flex: 1 1 480px; min-width: 320px; display: grid; gap: 4px; }
  .invoice-date-range-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: #4b657c; }
  .invoice-date-range-controls input { width: 132px; min-height: 34px; padding: 5px 7px; border: 1px solid #cfdce8; border-radius: 7px; background: #fff; color: #173b5c; font: inherit; }
  .invoice-date-range-controls .button { min-height: 34px; padding: 5px 10px; font-size: 12px; }
  .invoice-date-total { min-height: 18px; color: #4b657c; font-size: 12px; }
  .invoice-date-total strong { color: #095ab6; font-size: 15px; }
  @media (max-width: 680px) {
    .invoice-date-range { min-width: 0; width: 100%; }
    .invoice-date-range-controls input { flex: 1 1 120px; min-width: 120px; }
  }
  .ui-table-pagination { border-top: 1px solid #e4ebf2; background: #fbfdff; }
  .ui-table-pagination[hidden], table tbody tr[hidden] { display: none !important; }

  dialog { border: 1px solid #d7e2ed; border-radius: 16px; box-shadow: 0 24px 70px rgba(14, 37, 58, .28); }
  dialog::backdrop { background: rgba(9, 29, 47, .52); }
  .dialog-heading { align-items: center; padding: 18px 22px; background: #f8fbff; }
  .dialog-heading h2 { color: #173b5c; font-size: 19px; }
  .dialog-heading button { min-width: 36px; min-height: 36px; border-radius: 8px; }
  .dialog-heading button:hover { background: #e9f1f8; color: #234f75; }
  .dialog-heading > div:first-child { margin-right: auto; }
  .dialog-heading .ui-dialog-lookup-button {
    align-self: center; flex: 0 0 auto; min-height: 34px; margin: 0 10px; padding: 5px 11px;
    border: 1px solid #bed6ed; border-radius: 7px; background: #edf5fc;
    color: #195992; font-size: 12px; font-weight: 700; white-space: nowrap;
  }
  .ui-dialog-draft-tray {
    position: fixed; right: 22px; bottom: 20px; z-index: 30;
    display: grid; gap: 8px; width: min(330px, calc(100vw - 32px)); padding: 13px;
    border: 1px solid #9ec4e8; border-radius: 11px; background: #fff;
    box-shadow: 0 10px 30px rgba(14, 48, 80, .2); color: #214b70; font-size: 12px;
  }
  .ui-dialog-draft-tray[hidden] { display: none !important; }
  .ui-dialog-draft-resume {
    padding: 9px 11px; border: 1px solid #b8d3ee; border-radius: 7px;
    background: #eaf4ff; color: #12579a; text-align: left; font-size: 12px; font-weight: 700;
    cursor: pointer;
  }
  .ui-dialog-draft-resume:hover { background: #d9ecff; }
  @media (max-width: 600px) {
    .dialog-heading .ui-dialog-lookup-button { max-width: 120px; white-space: normal; line-height: 1.25; }
    .ui-dialog-draft-tray { right: 12px; bottom: 12px; }
  }
  .dialog-actions { background: #fbfdff; }
  dialog.ui-adjustable-dialog .ui-dialog-resize-handle { display: none; }
  #expenseLedgerDialog { width: min(780px, calc(100vw - 64px)); max-height: calc(100vh - 80px); }
  #expenseLedgerDialog .ui-dialog-operation-hint { display: block; margin-top: 5px; color: #62809b; font-size: 11px; font-weight: 400; }
  @media (pointer: fine) and (min-width: 700px) {
    dialog.ui-adjustable-dialog .dialog-heading { cursor: grab; touch-action: none; user-select: none; }
    dialog.ui-adjustable-dialog.ui-dialog-dragging .dialog-heading { cursor: grabbing; }
    dialog.ui-adjustable-dialog .dialog-heading button { cursor: pointer; }
    dialog.ui-adjustable-dialog .ui-dialog-resize-handle {
      position: absolute; right: 2px; bottom: 2px; z-index: 3;
      display: block; width: 18px; height: 18px; padding: 0; border: 0;
      border-radius: 0 0 9px 0; background: repeating-linear-gradient(135deg, transparent 0 4px, #7799b5 4px 6px, transparent 6px 9px);
      cursor: nwse-resize; touch-action: none;
    }
    dialog.ui-adjustable-dialog .ui-dialog-resize-handle:hover { background-color: #e6f1fa; }
    #expenseLedgerDialog.ui-adjustable-dialog .ui-dialog-resize-handle {
      right: 3px; bottom: 3px; width: 26px; height: 26px;
      border: 1px solid #adc8df; border-radius: 6px 0 8px 0;
      background-color: #eaf4fc;
    }
  }
  @media (max-width: 699px) {
    #expenseLedgerDialog { width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
    #expenseLedgerDialog .ui-dialog-operation-hint { display: none; }
  }
  dialog.ui-adjustable-dialog.ui-dialog-sized > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  dialog.ui-adjustable-dialog.ui-dialog-sized > form > .form-grid { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow-y: auto; }
  dialog.ui-adjustable-dialog.ui-dialog-sized > form > .dialog-actions { flex: 0 0 auto; }
  dialog.ui-adjustable-dialog.ui-dialog-sized > .detail-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .form-grid label { gap: 7px; color: #38536c; font-size: 13px; }
  .form-grid input:not([type="checkbox"]):not([type="radio"]),
  .form-grid select, .form-grid textarea { min-height: 42px; border-radius: 8px; border-color: #cbd9e6; }
  .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #4388d0; box-shadow: 0 0 0 3px rgba(23, 105, 212, .13); }

  .assistant-messages { background: #f6f9fc; }
  .assistant-message { box-shadow: 0 3px 12px rgba(16, 44, 70, .035); }
  .assistant-message.question { background: #e4f0ff; }
  #aiPanel .assistant-prompts { gap: 8px; }
  #aiPanel .assistant-prompts button {
    --prompt-ink: #245a90; --prompt-wash: #edf5fd; --prompt-line: #bad4ed;
    border-color: var(--prompt-line); background: var(--prompt-wash); color: var(--prompt-ink);
    font-weight: 700;
  }
  #aiPanel .assistant-prompts button:hover,
  #aiPanel .assistant-prompts button:focus-visible { background: #fff; box-shadow: inset 0 0 0 1px var(--prompt-ink); }
  #aiPanel .assistant-prompts button[data-ai-tone="settlement"] { --prompt-ink: #126a66; --prompt-wash: #edf8f6; --prompt-line: #a8d8d1; }
  #aiPanel .assistant-prompts button[data-ai-tone="invoice"] { --prompt-ink: #655099; --prompt-wash: #f5f2fb; --prompt-line: #d0c3eb; }
  #aiPanel .assistant-prompts button[data-ai-tone="payment"] { --prompt-ink: #9a5818; --prompt-wash: #fff7eb; --prompt-line: #ecd2a9; }
  #aiPanel .assistant-prompts button[data-ai-tone="finance"] { --prompt-ink: #365b91; --prompt-wash: #f0f4fd; --prompt-line: #bbcae8; }
  #aiPanel .assistant-prompts button[data-ai-tone="period"] { --prompt-ink: #2e6876; --prompt-wash: #eef8fa; --prompt-line: #b4d8df; }
  #aiPanel .assistant-prompts button[data-ai-tone="expense"] { --prompt-ink: #874d68; --prompt-wash: #fbf1f6; --prompt-line: #e4bed0; }
  #aiPanel .assistant-prompts button[data-ai-tone="balance"] { --prompt-ink: #2d704d; --prompt-wash: #eef9f2; --prompt-line: #b2dec1; }
  #aiPanel .assistant-prompts button[data-ai-tone="record"] { --prompt-ink: #596284; --prompt-wash: #f2f4fa; --prompt-line: #c6cee1; }
  #aiPanel .assistant-message.answer .assistant-answer-figure {
    padding: 0 2px; border-bottom: 2px solid currentColor; border-radius: 2px;
    background: #edf4fc; color: #245a90; font-weight: 800; font-variant-numeric: tabular-nums;
  }
  #aiPanel .assistant-message.answer .assistant-answer-figure-income { background: #eaf7f1; color: #126b50; }
  #aiPanel .assistant-message.answer .assistant-answer-figure-expense { background: #fff0ed; color: #a34237; }
  #aiPanel .assistant-message.answer .assistant-answer-figure-transfer { background: #f1f0fc; color: #5d50a0; }
  #aiPanel .assistant-message.answer .assistant-answer-figure-balance { background: #fff5e5; color: #8d540e; }
  #aiPanel .assistant-message.answer .assistant-answer-keyword { font-weight: 800; }
  #aiPanel .assistant-message.answer .assistant-answer-keyword-income { color: #126b50; }
  #aiPanel .assistant-message.answer .assistant-answer-keyword-expense { color: #a34237; }
  #aiPanel .assistant-message.answer .assistant-answer-keyword-transfer { color: #5d50a0; }
  #aiPanel .assistant-message.answer .assistant-answer-keyword-balance { color: #8d540e; }
  #aiPanel .assistant-sources a {
    display: inline-flex; align-items: center; gap: 5px; min-height: 29px; padding: 2px 9px;
    border: 1px solid #a9cce9; border-radius: 7px; background: #edf6ff;
    color: #155a92; font-weight: 700; text-decoration: none;
  }
  #aiPanel .assistant-sources a::before { content: "›"; font-size: 20px; line-height: 1; }
  #aiPanel .assistant-sources a:hover { background: #dfefff; text-decoration: underline; }
  #aiPanel .assistant-feedback button { font-weight: 700; }
  #aiPanel .assistant-feedback button[data-feedback-type="helpful"] { border-color: #acd7bf; background: #edf8f1; color: #246747; }
  #aiPanel .assistant-feedback button[data-feedback-type="inaccurate"] { border-color: #ebc0b8; background: #fff2ee; color: #a44338; }
  #aiPanel .assistant-feedback button[data-feedback-type="missing-link"] { border-color: #d3c5e9; background: #f6f2fb; color: #684f92; }
  #aiPanel .assistant-feedback button:hover { filter: brightness(.96); }
  .assistant-form textarea { border-color: #b9cee1; }
  .assistant-form textarea:focus { outline: 0; border-color: #4388d0; box-shadow: 0 0 0 3px rgba(23, 105, 212, .13); }

  .staff-page { background: var(--background); }
  .staff-shell { max-width: 1580px; padding: 24px clamp(20px, 2.6vw, 38px) 52px; }
  .staff-history { border-top: 3px solid #72a9db; }
  .staff-overview > div { padding: 9px; background: #f6faff; }
  .staff-overview > div:first-child { background: #eaf4ff; border-color: #bfd8f2; }
  .staff-overview strong { margin-top: 2px; font-size: clamp(18px, 1.25vw, 20px); }

  .auth-page { background: radial-gradient(circle at 20% 12%, #dcecff 0, transparent 30%), linear-gradient(145deg, #f3f7fc, #eaf1f8); }
  .auth-card { width: min(100%, 440px); padding: 34px; border-color: #d5e3f0; border-radius: 20px; box-shadow: 0 22px 60px rgba(24, 54, 86, .12); }
  .auth-mark { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(145deg, #f98a3a, #eb6230); font-size: 22px; box-shadow: 0 7px 16px rgba(232, 101, 49, .18); }
  .auth-card h1 { margin-top: 17px; color: #142f49; font-size: 25px; }
  .auth-card > p { color: #667f95; line-height: 1.6; }
  .auth-form { gap: 15px; margin-top: 23px; }
  .auth-form label { color: #34536f; font-size: 13px; }
  .auth-form input, .auth-form select { min-height: 46px; border-color: #c7d7e6; border-radius: 9px; }
  .auth-form input:focus, .auth-form select:focus { outline: 0; border-color: #4388d0; box-shadow: 0 0 0 3px rgba(23, 105, 212, .13); }
  .auth-form .button.primary { min-height: 44px; margin-top: 2px; }

  :is(button, a, summary, input, select, textarea):focus-visible { outline: 3px solid #6eade9; outline-offset: 2px; }
}

@media screen {
  #depositsPanel .deposit-table-wrap { max-height: none; overflow-x: hidden; }
  #depositsPanel .deposit-table { min-width: 0; width: 100%; table-layout: fixed; }
  #depositsPanel .deposit-table :is(th, td) { vertical-align: middle; padding: 9px 4px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  #depositsPanel .deposit-table th { color: #1769d4; font-size: 12px; font-weight: 800; line-height: 1.3; }
  #depositsPanel .deposit-table td { font-size: 11px; line-height: 1.4; }
  #depositsPanel .deposit-project { min-width: 0; font-weight: 650; }
  #depositsPanel .deposit-row-actions { text-align: center; }
  #depositsPanel .deposit-row-actions .detail-button { display: block; max-width: 100%; margin: 2px auto; padding: 2px 3px; font-size: 10px; }
  #depositsPanel .deposit-amount { color: #1769d4; }
  #depositsPanel .deposit-settled { color: #14845d; }
  #depositsPanel .deposit-outstanding { color: #c5233c; }
}

@media screen and (min-width: 1380px) {
  .summary-card, .dashboard-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 6px;
  }
  .summary-card span, .dashboard-card span { grid-column: 1; grid-row: 1; }
  .summary-card strong, .dashboard-card strong,
  #dashboardPanel .dashboard-card strong { grid-column: 2; grid-row: 1; margin: 0; }
  .summary-card small, .dashboard-card small { grid-column: 1 / -1; grid-row: 2; margin-top: 2px; }

  .summary-grid[data-page="contracts"] { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
  .summary-grid[data-page="contracts"] .summary-card,
  #projectsPanel .project-summary-grid .summary-card,
  .staff-contract-view .summary-card,
  .staff-project-view .summary-card { display: block; }
  .summary-grid[data-page="contracts"] .summary-card { padding: 7px 9px; }
  .summary-grid[data-page="contracts"] .summary-card strong {
    margin: 2px 0 1px;
    font-size: clamp(17px, 1.2vw, 19px);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
  }
}

@media screen and (min-width: 1480px) {
  #projectsPanel .project-summary-grid,
  .staff-project-view .project-summary-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  #projectsPanel .project-summary-grid .summary-card strong,
  .staff-project-view .project-summary-grid .summary-card strong {
    font-size: clamp(16px, 1.15vw, 18px);
    letter-spacing: -.04em;
  }
}

@media screen and (max-width: 980px) and (min-width: 681px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; }
  .sidebar .brand { justify-content: flex-start; padding: 2px 3px 15px; }
  .sidebar .brand > div:last-child { display: block; }
  .sidebar .brand strong { font-size: 14px; }
  .sidebar .brand span { font-size: 10px; }
  .sidebar .brand-mark { width: 38px; height: 38px; font-size: 20px; }
  .sidebar .nav-item, .sidebar .nav-item.active { display: grid; padding: 8px; grid-template-columns: 31px minmax(0, 1fr) auto; text-align: left; font-size: 12px; }
  .sidebar .nav-item > span, .sidebar .nav-item.active > span { display: grid; margin: 0; font-size: 11px; }
  .sidebar .nav-group-title { grid-template-columns: 31px minmax(0, 1fr) auto; padding: 8px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar-actions { justify-content: flex-start; }
}

@media screen and (max-width: 1160px) {
  #paymentsPanel .payment-overview-table { min-width: 940px; }
  #expensesPanel .expense-claim-table { min-width: 1060px; }
  #expenseLedgerPanel .expense-ledger-heading { grid-template-columns: minmax(0, 1fr); }
  #expenseLedgerPanel .expense-ledger-actions { justify-content: flex-start; flex-wrap: wrap; margin-left: 0; }
  #expenseLedgerPanel .expense-ledger-table { min-width: 1080px; }
}

@media screen and (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { position: relative; z-index: 20; padding: 10px 12px; overflow-x: auto; overflow-y: hidden; }
  .sidebar.ui-mobile-nav-ready { overflow: visible; }
  .sidebar .nav-section-label { display: none; }
  .sidebar.ui-mobile-nav-ready .mobile-nav-toggle {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(218, 235, 250, .22);
    border-radius: 9px;
    background: #ffdc64;
    color: #18324b;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .mobile-nav-toggle > span:first-child { font-size: 18px; line-height: 1; }
  .mobile-nav-toggle strong { font-weight: 800; }
  .mobile-nav-chevron { margin-left: auto; font-size: 17px; transition: transform .16s ease; }
  .sidebar.mobile-nav-open .mobile-nav-chevron { transform: rotate(180deg); }
  .sidebar.ui-mobile-nav-ready nav {
    position: absolute;
    top: calc(100% - 2px);
    left: 12px;
    right: 12px;
    z-index: 25;
    display: none;
    width: auto;
    max-height: min(70vh, 560px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #476883;
    border-radius: 0 0 12px 12px;
    background: #17344f;
    box-shadow: 0 18px 30px rgba(6, 25, 43, .25);
  }
  .sidebar.ui-mobile-nav-ready.mobile-nav-open nav { display: grid; }
  .sidebar.ui-mobile-nav-ready .nav-item, .sidebar.ui-mobile-nav-ready .nav-item:not(.active), .sidebar.ui-mobile-nav-ready .nav-item.active {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 7px 11px;
    text-align: left;
    white-space: normal;
    font-size: 12px;
  }
  .sidebar.ui-mobile-nav-ready .nav-item > span, .sidebar.ui-mobile-nav-ready .nav-item.active > span { display: inline-grid; width: 23px; height: 23px; margin: 0; font-size: 11px; }
  .sidebar.ui-mobile-nav-ready .nav-group { grid-column: 1 / -1; }
  .sidebar.ui-mobile-nav-ready .nav-group-title { display: flex; width: 100%; gap: 5px; min-height: 40px; padding: 7px 10px; white-space: nowrap; }
  .sidebar.ui-mobile-nav-ready .nav-group-title > span { width: 23px; height: 23px; }
  .topbar { min-height: 0; padding: 16px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar-actions { justify-content: flex-start; }
  .topbar h1 { font-size: 21px; }
  .content, .staff-shell { padding: 16px 14px 38px; }
  .dashboard-focus-header { padding: 17px 18px; }
  .dashboard-focus-header h2 { font-size: 18px; }
  .dashboard-card { min-height: 76px; padding: 8px 9px; }
  .dashboard-card strong, .summary-card strong, .staff-overview strong { font-size: clamp(18px, 4.5vw, 20px); }
  #dashboardPanel .dashboard-card { min-height: 76px; padding: 8px 9px; }
  #dashboardPanel .dashboard-card strong { font-size: clamp(18px, 4.5vw, 20px); }
  #projectsPanel .project-summary-grid { gap: 8px; }
  #projectsPanel .project-summary-grid .summary-card { min-height: 76px; padding: 8px; }
  #projectsPanel .project-summary-grid .summary-card strong { font-size: clamp(18px, 4.4vw, 20px); }
  #businessReviewPanel .approval-list-heading { align-items: stretch; }
  #businessReviewPanel .approval-filters { justify-content: flex-start; }
  #businessReviewPanel .business-review-filter-caption { width: 100%; }
  #businessReviewPanel .approval-filters :is(select, input) { flex: 1 1 100%; width: 100%; }
  .business-review-detail-content { padding: 14px; }
  .business-review-detail-section dl { grid-template-columns: 1fr; }
  .panel-heading { padding: 16px; }
  .table-wrap table th, .table-wrap table td { padding: 10px 12px; }
  .auth-card { padding: 26px 22px; }
  #expensesPanel .expense-data-notice { margin-inline: 16px; }
  #expenseLedgerPanel .expense-data-notice { margin-inline: 16px; }
}

@media screen and (max-width: 760px) {
  #financePanel .finance-category-toggle { flex-wrap: wrap; gap: 5px 8px; padding-inline: 16px; }
  #financePanel .finance-category-note { flex-basis: 100%; order: 3; }
  #financePanel .category-breakdown { padding-inline: 16px; }
  #financePanel .finance-search-group { flex: 0 0 auto; width: 100%; min-width: 0; }
  #financePanel #financeTypeFilter,
  #financePanel #financeCategoryFilter,
  #financePanel #financeExpenseCategoryFilter { width: 100%; }
  #financePanel .finance-date-range input { flex: 1 1 0; width: auto; }
}

@media screen and (prefers-reduced-motion: reduce) {
  .sidebar .nav-item, .button, .dashboard-card { transition: none; }
  .dashboard-card:hover { transform: none; }
}

/* 项目综合档案：控制阅读宽度、压缩核对卡片，并保留清晰的操作层级。 */
#projectDetailPanel { max-width: 1220px; margin-inline: auto; }
#projectDetailPanel .project-detail-toolbar {
  padding: 12px 14px;
  border: 1px solid #dbe6f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 63, 96, .05);
}
#projectDetailPanel .project-back-button { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; white-space: nowrap; font-size: 12px; }
#projectDetailPanel .project-detail-actions { flex: 1 1 620px; align-items: center; gap: 7px; }
#projectDetailPanel .project-detail-actions .button,
#projectDetailPanel .project-detail-shortcuts .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
#projectDetailPanel .project-detail-shortcuts,
#projectDetailPanel .project-detail-jumpnav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
#projectDetailPanel .project-detail-shortcuts { margin-top: 9px; padding: 9px 13px; border: 1px solid #dfe9f1; border-radius: 10px; background: #f8fbfe; }
#projectDetailPanel .project-detail-shortcuts > span,
#projectDetailPanel .project-detail-jumpnav > span { margin-right: 4px; color: #587087; font-size: 11px; font-weight: 700; white-space: nowrap; }
#projectDetailPanel .project-detail-shortcuts .button { background: #fff; }
#projectDetailPanel .project-detail-jumpnav { position: sticky; top: 0; z-index: 5; margin-top: 9px; padding: 7px 13px; border: 1px solid #d7e4ef; border-radius: 10px; background: rgba(255, 255, 255, .97); box-shadow: 0 5px 16px rgba(20, 54, 84, .07); }
#projectDetailPanel .project-detail-jumpnav button { min-height: 30px; padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #315b7c; font-size: 11px; font-weight: 700; cursor: pointer; }
#projectDetailPanel .project-detail-jumpnav button:hover,
#projectDetailPanel .project-detail-jumpnav button:focus-visible { border-color: #b9d6ee; background: #edf6ff; outline: none; }
#projectDetailPanel #projectOverviewCard,
#projectDetailPanel #projectLinkCheckPanel,
#projectDetailPanel #projectBusinessRecords,
#projectDetailPanel #projectMilestonePanel,
#projectDetailPanel #projectDocumentPanel { scroll-margin-top: 62px; }
#projectDetailPanel .project-overview-card { margin-top: 10px; }
#projectDetailPanel .project-overview-heading { padding: 17px 18px; }
#projectDetailPanel .project-overview-heading h2 { margin: 7px 0 4px; font-size: 20px; }
#projectDetailPanel .project-detail-metrics { padding: 14px 18px; gap: 8px; }
#projectDetailPanel .project-detail-metrics article { padding: 10px 11px; }
#projectDetailPanel .project-detail-metrics strong { margin: 6px 0 3px; font-size: 17px; }
#projectDetailPanel .project-match-note { margin: 0 18px 16px; }
#projectDetailPanel .project-workflow-actions-panel { margin-top: 12px; padding: 15px 18px; }
#projectDetailPanel .project-workflow-actions-panel .panel-heading { padding: 0 0 10px; }
#projectDetailPanel .project-workflow-actions-panel p { margin-bottom: 0; }
#projectDetailPanel .project-workflow-actions { gap: 7px; }
#projectDetailPanel .project-workflow-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
#projectDetailPanel .project-link-check-panel,
#projectDetailPanel .project-detail-section { margin-top: 12px; }
#projectDetailPanel .project-link-check-panel .panel-heading,
#projectDetailPanel .project-detail-section .panel-heading { padding: 14px 18px; }
#projectDetailPanel .portfolio-check-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 225px)); justify-content: start; gap: 10px; padding: 14px 18px 12px; }
#projectDetailPanel .portfolio-check-card { min-height: 116px; padding: 10px 11px; border-radius: 9px; }
#projectDetailPanel .portfolio-check-card > div { gap: 6px; }
#projectDetailPanel .portfolio-check-card > div strong { font-size: 13px; }
#projectDetailPanel .portfolio-check-card .status { flex: 0 0 auto; padding: 4px 6px; font-size: 10px; }
#projectDetailPanel .portfolio-check-card b { margin: 7px 0 3px; font-size: 20px; line-height: 1.1; }
#projectDetailPanel .portfolio-check-card small { font-size: 11px; line-height: 1.35; }
#projectDetailPanel .portfolio-check-card p { margin-top: 6px; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
#projectDetailPanel .source-stack .portfolio-association-basis { width: fit-content; max-width: 100%; padding: 3px 6px; border-radius: 5px; background: #fff5e3; color: #805313; font-size: 11px; line-height: 1.4; white-space: normal; }
#projectDetailPanel .portfolio-alert-list { padding: 0 18px 14px; }
#projectDetailPanel .portfolio-review-register { margin: 0 18px 16px; padding: 11px 12px; }
#projectDetailPanel .project-detail-section .empty { height: 72px; }

/* 综合档案按业务区块着色；状态徽标仍沿用原有审核/匹配语义。 */
@media screen {
#projectDetailPanel .portfolio-colored-section { --portfolio-accent: #315e85; --portfolio-tint: #f1f6fa; }
#projectDetailPanel .portfolio-color-contract { --portfolio-accent: #1b5b9b; --portfolio-tint: #edf5ff; }
#projectDetailPanel .portfolio-color-settlement { --portfolio-accent: #126a66; --portfolio-tint: #edf8f6; }
#projectDetailPanel .portfolio-color-invoice { --portfolio-accent: #655099; --portfolio-tint: #f5f2fb; }
#projectDetailPanel .portfolio-color-cost { --portfolio-accent: #895915; --portfolio-tint: #fff8eb; }
#projectDetailPanel .portfolio-color-expense { --portfolio-accent: #814b78; --portfolio-tint: #faf2f8; }
#projectDetailPanel .portfolio-color-seal { --portfolio-accent: #2d704d; --portfolio-tint: #f0f9f3; }
#projectDetailPanel .portfolio-color-application { --portfolio-accent: #266d82; --portfolio-tint: #eef8fa; }
#projectDetailPanel .portfolio-color-milestone { --portfolio-accent: #865e22; --portfolio-tint: #fbf7ed; }
#projectDetailPanel .portfolio-color-document { --portfolio-accent: #4c5e9b; --portfolio-tint: #f1f3fc; }
#projectDetailPanel .portfolio-color-handling { --portfolio-accent: #a44545; --portfolio-tint: #fcf2f1; }
#projectDetailPanel .portfolio-color-audit { --portfolio-accent: #4b6378; --portfolio-tint: #f2f6f9; }
#projectDetailPanel .portfolio-colored-section .panel-heading {
  background: linear-gradient(90deg, var(--portfolio-tint), #fff 65%);
  box-shadow: inset 4px 0 0 var(--portfolio-accent);
}
#projectDetailPanel .portfolio-colored-section .panel-heading h2 { color: var(--portfolio-accent); }
#projectDetailPanel .portfolio-colored-section table th {
  background: var(--portfolio-tint);
  color: var(--portfolio-accent);
  font-size: 12px;
}
#projectDetailPanel .portfolio-colored-section table td { font-size: 13px; line-height: 1.45; }
#projectDetailPanel .portfolio-colored-section table td:first-child strong,
#projectDetailPanel .portfolio-color-seal table td:nth-child(2) strong { color: var(--portfolio-accent); }
#projectDetailPanel .portfolio-colored-section table td.number { color: var(--portfolio-accent); font-weight: 700; }
#projectDetailPanel .portfolio-color-contract table :is(th, td):nth-child(5),
#projectDetailPanel .portfolio-color-invoice table :is(th, td):nth-child(6) { color: #146d55; }
#projectDetailPanel .portfolio-color-contract table th:nth-child(6),
#projectDetailPanel .portfolio-color-contract table td.portfolio-amount-due { color: #a63f3b; }
#projectDetailPanel .portfolio-color-settlement table :is(th, td):is(:nth-child(5), :nth-child(6)),
#projectDetailPanel .portfolio-color-invoice table :is(th, td):nth-child(5) { color: #895915; }
}

/* 综合档案只用少量语义色：标题深蓝，操作蓝，确认绿，待核琥珀，问题红。 */
#projectDetailPanel .project-detail-toolbar .button.secondary { color: #245d98; }
#projectDetailPanel .project-detail-shortcuts > span,
#projectDetailPanel .project-detail-jumpnav > span { color: #536b80; }
#projectDetailPanel .project-detail-shortcuts .button,
#projectDetailPanel .project-detail-jumpnav button { color: #185ca5; font-weight: 700; }
#projectDetailPanel .project-detail-jumpnav button:hover,
#projectDetailPanel .project-detail-jumpnav button:focus-visible { color: #0e478a; }
#projectDetailPanel .project-overview-heading { background: linear-gradient(110deg, #f5f9ff, #fff 72%); }
#projectDetailPanel .project-overview-heading h2 { color: #173b60; font-weight: 750; }
#projectDetailPanel .project-overview-heading p { color: #586d80; }
#projectDetailPanel .project-manager-chip { color: #245785; font-weight: 700; }
#projectDetailPanel .project-match-note { color: #52677b; }
#projectDetailPanel .project-workflow-actions-panel .panel-heading h2,
#projectDetailPanel .project-link-check-panel .panel-heading h2 { color: #173b60; font-weight: 750; }
#projectDetailPanel .project-workflow-actions-panel .panel-heading p,
#projectDetailPanel .project-link-check-panel .panel-heading p { color: #60758a; }
#projectDetailPanel .project-workflow-actions button { color: #185b99; background: #f2f7fd; }
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="invoice"] { color: #65418f; border-color: #ddcff0; background: #f7f3fc; }
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="payment"],
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="settlement"] { color: #116b62; border-color: #c9e3dd; background: #f0faf7; }
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="cost"],
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="expense"] { color: #855915; border-color: #eadaba; background: #fffaef; }
#projectDetailPanel .project-workflow-actions button[data-project-workflow-action="archive"] { color: #4f5598; border-color: #d5d9f0; background: #f4f5fc; }
#projectDetailPanel .project-link-check-panel > .panel-heading { background: #f7faff; }
#projectDetailPanel .project-link-check-panel > .panel-heading .step-badge { color: #895a13; background: #fff2da; }
#projectDetailPanel .portfolio-check-card { border-left: 3px solid #c4d1dd; }
#projectDetailPanel .portfolio-check-card > div strong { color: #234665; }
#projectDetailPanel .portfolio-check-card b { color: #51677b; font-variant-numeric: tabular-nums; }
#projectDetailPanel .portfolio-check-card small { color: #5d7285; }
#projectDetailPanel .portfolio-check-card p { color: #687a8b; }
#projectDetailPanel .portfolio-check-card.association-confirmed { border-left-color: #2d9875; background: #fbfefd; }
#projectDetailPanel .portfolio-check-card.association-confirmed b { color: #147052; }
#projectDetailPanel .portfolio-check-card.association-pending { border-left-color: #d99a34; background: #fffdf8; }
#projectDetailPanel .portfolio-check-card.association-pending b { color: #955a0c; }
#projectDetailPanel .portfolio-alert strong { font-size: 12px; }
#projectDetailPanel .portfolio-review-register-main strong { color: #244d73; font-size: 13px; }
#projectDetailPanel .portfolio-review-register-main strong[data-tone="confirmed"] { color: #147052; }
#projectDetailPanel .portfolio-review-register-main strong[data-tone="pending"] { color: #955a0c; }
#projectDetailPanel .portfolio-review-register-main strong[data-tone="warning"] { color: #b13f3b; }
#projectDetailPanel .portfolio-review-register-main strong[data-tone="active"] { color: #185ca5; }

@media (max-width: 760px) {
  #projectDetailPanel .project-detail-toolbar { align-items: stretch; flex-direction: column; }
  #projectDetailPanel .project-detail-actions { flex-basis: auto; justify-content: flex-start; }
  #projectDetailPanel .project-detail-jumpnav { flex-wrap: nowrap; overflow-x: auto; }
}
@media (max-width: 680px) {
  #projectDetailPanel .portfolio-check-grid { grid-template-columns: minmax(0, 330px); padding-inline: 14px; }
  #projectDetailPanel .project-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
  #projectDetailPanel .project-overview-heading,
  #projectDetailPanel .project-link-check-panel .panel-heading,
  #projectDetailPanel .project-detail-section .panel-heading { padding-inline: 14px; }
}

/* 成本票：完整展示每页记录，操作项固定为两行，桌面宽度内不横向溢出。 */
#costInvoicesPanel .cost-invoice-table-wrap { max-height: none; overflow: visible; }
#costInvoicesPanel .cost-invoice-table { width: 100%; min-width: 0; table-layout: fixed; }
#costInvoicesPanel .cost-invoice-table :is(th, td) {
  padding: 8px 3px;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
#costInvoicesPanel .cost-invoice-table td.number { font-size: 10.5px; white-space: normal; }
#costInvoicesPanel .cost-invoice-table td:nth-child(5),
#costInvoicesPanel .cost-invoice-table td:nth-child(8) { white-space: normal; }
#costInvoicesPanel .cost-invoice-table .cost-invoice-clamp { display: block; overflow: visible; -webkit-line-clamp: unset; }
#costInvoicesPanel .cost-invoice-table td:last-child { overflow-wrap: normal; }
#costInvoicesPanel .cost-invoice-table td:last-child .detail-button { min-height: 24px; padding: 2px 1px; font-size: 11px; white-space: nowrap; }
#costInvoicesPanel .cost-invoice-table td:last-child .business-row-review { margin-left: 4px; padding: 2px 5px; font-size: 10px; }
#costInvoicesPanel .cost-invoice-table td:last-child .business-row-unlock { display: block; width: max-content; max-width: 100%; margin: 2px 0 0; }

@media (max-width: 1100px) {
  #costInvoicesPanel .cost-invoice-table-wrap { overflow-x: auto; }
  #costInvoicesPanel .cost-invoice-table { min-width: 1050px; }
}

/* 财务台账三账户按账户字段精确汇总；红色只标识金额，不代表银行已对账余额。 */
@media screen {
  #financePanel .finance-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(390px, 1fr);
    align-items: stretch;
    gap: 10px;
    padding: 16px 22px 8px;
  }
  #financePanel .finance-summary-row .finance-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: none;
    padding: 0;
  }
  #financePanel .finance-account-balances {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  #financePanel .finance-account-card {
    min-width: 0;
    min-height: 82px;
    padding: 11px 9px;
    border: 1px solid #dbe6f0;
    border-top: 3px solid var(--account-accent, #4387ba);
    border-radius: 10px;
    background: #f8fbff;
    box-shadow: 0 2px 7px rgba(24, 63, 98, .05);
  }
  #financePanel .finance-account-card-2 { --account-accent: #279785; background: #f5fcfa; }
  #financePanel .finance-account-card-3 { --account-accent: #7b72b8; background: #faf9ff; }
  #financePanel .finance-account-card span {
    display: block;
    color: var(--account-accent, #27628f);
    font-size: 11px;
    font-weight: 750;
  }
  #financePanel .finance-account-card strong.finance-account-amount {
    display: block;
    margin: 7px 0 3px;
    color: #b3342e;
    font-size: clamp(15px, 1.15vw, 18px);
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  #financePanel .finance-account-card strong.finance-account-pending {
    display: block;
    margin: 7px 0 3px;
    color: #6f8294;
    font-size: 14px;
    font-weight: 650;
  }
  #financePanel .finance-account-card small { display: block; color: #667c90; font-size: 10px; font-weight: 500; }
  #financePanel .finance-balance-note { margin: 0; padding: 0 22px 11px; color: #687e90; font-size: 11px; line-height: 1.4; }
}
@media screen and (max-width: 1320px) {
  #financePanel .finance-summary-row { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 680px) {
  #financePanel .finance-summary-row { padding-inline: 16px; }
  #financePanel .finance-summary-row .finance-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #financePanel .finance-balance-note { padding-inline: 16px; }
}
@media screen and (max-width: 520px) {
  #financePanel .finance-account-balances { grid-template-columns: minmax(0, 1fr); }
  #financePanel .finance-account-card { min-height: 68px; }
}

/* 发票税金为公式结果；历史记录不因打开弹窗而自动改写。 */
@media screen {
  #invoiceEntryForm input[name="taxAmount"][readonly] {
    color: #aa342e;
    background: #fff8f6;
    border-color: #edc9c3;
    font-weight: 800;
    cursor: default;
  }
  #invoiceTaxCalculationNote {
    margin-top: -3px;
    padding: 8px 11px;
    color: #385c77;
    background: #f1f7fc;
    border-left: 3px solid #6ea4cf;
    border-radius: 6px;
  }
}

/* 业务列表的视觉层级：编号、金额、状态与操作各有辨识度，不改变表格数据或状态语义。 */
@media screen {
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) {
    --ledger-accent: #225c8d;
    --ledger-tint: #edf5fc;
  }
  :is(#paymentsPanel, #settlementsPanel) { --ledger-accent: #176b62; --ledger-tint: #edf8f5; }
  :is(#invoicesPanel, #invoiceApplicationsPanel) { --ledger-accent: #665096; --ledger-tint: #f4f1fb; }
  :is(#expensesPanel, #expenseLedgerPanel, #costInvoicesPanel) { --ledger-accent: #825819; --ledger-tint: #fff7e9; }
  :is(#sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel) { --ledger-accent: #27644d; --ledger-tint: #eff8f2; }
  #credentialsPanel { --ledger-accent: #674f8b; --ledger-tint: #f5f1fb; }

  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .panel-heading h2 {
    color: var(--ledger-accent);
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table thead th {
    background: var(--ledger-tint);
    color: var(--ledger-accent);
    border-bottom: 2px solid var(--ledger-accent);
    font-weight: 750;
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table tbody td:first-child:not(.empty):not([colspan]) {
    color: var(--ledger-accent);
    font-weight: 700;
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table tbody td:first-child strong {
    color: inherit;
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table tbody .contract-name {
    color: #203d58;
    font-weight: 650;
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table tbody .detail-button {
    border: 1px solid #c8ddec;
    background: #f2f8ff;
    color: #185888;
    font-weight: 700;
  }
  :is(#contractsPanel, #paymentsPanel, #settlementsPanel, #financePanel, #invoicesPanel,
      #invoiceApplicationsPanel, #expensesPanel, #expenseLedgerPanel, #costInvoicesPanel,
      #sealsPanel, #documentSealApplicationsPanel, #documentSealsPanel, #credentialsPanel,
      #projectsPanel, #personnelPanel) .table-wrap table tbody .detail-button:hover {
    border-color: #7eacd3;
    background: #e2f0ff;
  }

  #invoicesPanel .invoice-list-toolbar h3 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #604989;
    font-size: 16px;
    font-weight: 800;
  }
  #invoicesPanel .invoice-list-toolbar h3::before {
    content: "";
    width: 8px;
    height: 18px;
    border-radius: 3px;
    background: #795fac;
  }
  #invoicesPanel .invoice-totals span { border: 1px solid #e0e7f0; }
  #invoicesPanel .invoice-totals span:nth-child(1) strong { color: #604989; }
  #invoicesPanel .invoice-totals span:nth-child(2) strong { color: #805714; }
  #invoicesPanel .invoice-totals span:nth-child(3) strong { color: #126b50; }
  #invoicesPanel .invoice-totals span:nth-child(4) strong { color: #a24639; }
  #invoicesPanel .invoice-table tbody td:nth-child(3) { color: #225c8d; font-weight: 750; }
  #invoicesPanel .invoice-table tbody td:nth-child(4),
  #invoicesPanel .invoice-table tbody td:nth-child(5) { color: #486781; font-weight: 650; }
  #invoicesPanel .invoice-table tbody td:nth-child(9) { color: #604989; }
  #invoicesPanel .invoice-table tbody td:nth-child(10) { color: #805714; }
  #invoicesPanel .invoice-table tbody td:nth-child(11),
  #invoicesPanel .invoice-table tbody td:nth-child(11) strong { color: #126b50; }
  #invoicesPanel .invoice-table tbody td:nth-child(12) { color: #a24639; }
  #invoicesPanel .invoice-table tbody td.number { font-weight: 750; }
  #invoicesPanel .invoice-table tbody .row-actions .detail-button { min-height: 24px; padding: 2px 4px; font-size: 10.5px; }

  #contractsPanel table tbody td.number { color: #225c8d; font-weight: 750; }
  #paymentsPanel .payment-overview-table tbody .payment-recognized-total strong { color: #126b50; }
  #paymentsPanel .payment-overview-table tbody td:nth-child(6),
  #paymentsPanel .payment-overview-table tbody td:nth-child(6) strong { color: #805714; font-weight: 750; }
  #paymentsPanel .payment-table tbody td.number,
  #settlementsPanel .settlement-table tbody td:nth-child(8),
  #settlementsPanel .settlement-table tbody td:nth-child(8) strong { color: #126b50; font-weight: 750; }
  #settlementsPanel .settlement-table tbody td:nth-child(6) { color: #225c8d; }
  #financePanel .finance-table tbody .finance-entry-income td.number { color: #126b50; }
  #financePanel .finance-table tbody .finance-entry-expense td.number { color: #a24639; }
  #financePanel .finance-table tbody .finance-entry-transfer td.number { color: #225c8d; }
  #financePanel .finance-table tbody tr td.number strong { color: inherit; }
  #expensesPanel .expense-claim-table tbody td.number,
  #costInvoicesPanel .cost-invoice-table tbody td:nth-child(6) { color: #805714; font-weight: 750; }
  #costInvoicesPanel .cost-invoice-table tbody td:nth-child(7) { color: #126b50; font-weight: 750; }

  .staff-page :is(#staffRelatedSection, #staffProjects, #staffBusinessSection,
      #staffExpenseSection, #staffInvoiceSection, #staffInvoiceApplications,
      #staffApplicationsSection, #staffDocumentSealApplications, #staffPersonnel) {
    --staff-ledger-accent: #225c8d;
    --staff-ledger-tint: #edf5fc;
  }
  .staff-page :is(#staffBusinessSection, #staffExpenseSection) {
    --staff-ledger-accent: #176b62;
    --staff-ledger-tint: #edf8f5;
  }
  .staff-page :is(#staffInvoiceSection, #staffInvoiceApplications) {
    --staff-ledger-accent: #665096;
    --staff-ledger-tint: #f4f1fb;
  }
  .staff-page :is(#staffRelatedSection, #staffProjects, #staffBusinessSection,
      #staffExpenseSection, #staffInvoiceSection, #staffInvoiceApplications,
      #staffApplicationsSection, #staffDocumentSealApplications, #staffPersonnel)
      .table-wrap table thead th {
    background: var(--staff-ledger-tint);
    color: var(--staff-ledger-accent);
    border-bottom: 2px solid var(--staff-ledger-accent);
    font-weight: 750;
  }
  .staff-page :is(#staffRelatedSection, #staffProjects, #staffBusinessSection,
      #staffExpenseSection, #staffInvoiceSection, #staffInvoiceApplications,
      #staffApplicationsSection, #staffDocumentSealApplications, #staffPersonnel)
      .table-wrap table tbody td:first-child:not(.empty):not([colspan]) {
    color: var(--staff-ledger-accent);
    font-weight: 700;
  }
  .staff-page #staffBusinessTable table tbody td:nth-child(2),
  .staff-page :is(#staffExpenseSection, #staffInvoiceSection, #staffInvoiceApplications)
      .table-wrap table tbody td:nth-child(2) {
    color: var(--staff-ledger-accent);
    font-weight: 700;
  }
  .staff-page #staffPaymentOverview .staff-payment-table tbody td:nth-child(4) { color: #126b50; font-weight: 750; }
  .staff-page #staffPaymentOverview .staff-payment-table tbody td:nth-child(5) { color: #805714; font-weight: 750; }
}

@media screen and (max-width: 480px) {
  #dashboardPanel .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboardPanel .dashboard-card:first-child,
  #dashboardPanel .dashboard-card[data-dashboard-filter="pending"] { grid-column: 1 / -1; }
  #dashboardPanel .dashboard-approval-summary #dashboardOpenApprovals { flex: 1 1 100%; }
}

/* 屏幕业务表格列标题统一缩小四分之一并改为红色；打印表格和数据行不变。 */
@media screen {
  body .table-wrap table thead th {
    color: #c62828 !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }
}

/* 大块统计卡片沿用收入分类的展开方式；业务表格和筛选栏不参与折叠。 */
@media screen {
  .ui-summary-disclosure {
    margin: 12px 0 16px;
    border: 1px solid #dce6ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(21, 47, 73, .035);
    overflow: hidden;
  }
  .ui-summary-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 16px;
    list-style: none;
    cursor: pointer;
  }
  .ui-summary-toggle::-webkit-details-marker { display: none; }
  .ui-summary-toggle::marker { content: ""; }
  .ui-summary-toggle:hover { background: #f1f7fd; }
  .ui-summary-toggle:focus-visible { outline: 2px solid #1769d4; outline-offset: -3px; }
  .ui-summary-title { color: #193b58; font-size: 13px; font-weight: 750; }
  .ui-summary-count { padding: 2px 7px; border-radius: 999px; background: #e9f3fc; color: #245c87; font-size: 11px; font-weight: 700; }
  .ui-summary-state { margin-left: auto; color: #b4232d; font-size: 12px; font-weight: 750; white-space: nowrap; }
  .ui-summary-disclosure > :is(.summary-grid, .legacy-summary-grid, .backup-summary-grid,
      .workflow-summary-grid, .approval-summary-grid, .dashboard-summary-grid,
      .project-detail-metrics, .staff-overview) {
    box-sizing: border-box;
    margin: 0 !important;
    padding: 12px 16px 16px;
  }
  #financePanel .ui-finance-summary-disclosure {
    margin: 0;
    border: 0;
    border-bottom: 1px solid #dce6ef;
    border-radius: 0;
    box-shadow: none;
  }
  #financePanel .ui-finance-summary-disclosure .finance-summary-row { padding-top: 12px; }
  #financePanel .ui-finance-summary-disclosure .finance-balance-note { padding-bottom: 14px; }
  #projectOverviewCard .ui-summary-disclosure { margin: 0; border-inline: 0; border-radius: 0; box-shadow: none; }
  #approvalPanel .approval-process-disclosure > .approval-process-panel { border-top: 1px solid #dce6ef; }
  #approvalPanel .approval-process-disclosure:not([open]) .approval-process-state-open,
  #approvalPanel .approval-process-disclosure[open] .approval-process-state-closed { display: none; }
  #workflowPanel .workflow-map-disclosure > .workflow-map-panel { border-top: 1px solid #dce6ef; }
  #workflowPanel .workflow-map-disclosure:not([open]) .workflow-map-state-open,
  #workflowPanel .workflow-map-disclosure[open] .workflow-map-state-closed { display: none; }
  #paymentsPanel .payment-overview-disclosure { margin: 0 0 12px; }
  #paymentsPanel .payment-overview-disclosure .reconciliation-heading { padding: 16px 16px 0; }
  #paymentsPanel .payment-overview-disclosure .reconciliation-totals { margin: 0; padding: 0 16px 16px; }
  #paymentsPanel .payment-overview-disclosure:not([open]) .payment-overview-state-open,
  #paymentsPanel .payment-overview-disclosure[open] .payment-overview-state-closed { display: none; }
  #paymentsPanel .payment-overview-search-toolbar { justify-content: flex-end; }
  #invoicesPanel .invoice-pending-section { margin-top: 18px; }

  /* Keep the dashboard focused on actionable panels; the AI assistant remains available in its own page. */
  #dashboardPanel .dashboard-focus-header,
  #dashboardPanel #dashboardAiQuick { display: none !important; }

  #aiPanel .assistant-form label {
    color: #c52232;
    font-size: 18px;
    font-weight: 800;
  }

  /* The six primary navigation categories can be expanded independently. */
  .sidebar .nav-category > .nav-group-title {
    grid-template-columns: minmax(0, 1fr) auto;
    color: #60e89b;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .02em;
  }
  .sidebar .nav-category > .nav-group-title::after {
    margin-left: auto;
    color: #60e89b;
  }
  .sidebar .nav-category > .nav-group-title:hover,
  .sidebar .nav-category > .nav-group-title:focus-visible {
    color: #95ffbf;
  }
  .sidebar .nav-category > .nav-group-items { margin-left: 7px; }
  .sidebar .nav-category:not(:has(.nav-item:not(.hidden))) { display: none; }
}
