﻿:root {
  --ink: #18211e; --muted: #68736f; --line: #dce3df; --line-strong: #c6d0cb;
  --canvas: #f4f6f5; --surface: #fff; --surface-soft: #edf2ef; --forest: #173d31;
  --forest-2: #245744; --mint: #d7eadf; --mint-strong: #75ad91; --coral: #c95742;
  --coral-soft: #f8e5e1; --amber-soft: #faedda; --shadow: 0 14px 40px rgba(25,41,35,.12);
  --sidebar: 228px; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink); background: var(--canvas); font-synthesis: none; letter-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--surface); outline: 0; transition: border-color .16s, box-shadow .16s; }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; min-height: 82px; }
input:focus, textarea:focus, select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,87,68,.12); }
input[readonly] { color: #53645d; background: #eef3f0; cursor: default; }
input::placeholder, textarea::placeholder { color: #98a19d; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 5px; padding: 0 16px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .16s, transform .16s; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--forest); color: white; }
.btn-primary:hover { background: var(--forest-2); }
.btn-secondary { background: white; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-soft); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: var(--coral); color: white; }
.btn-danger-ghost { background: transparent; color: var(--coral); border-color: transparent; }
.btn-small { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; min-height: 46px; }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: white; }
.icon-button:hover { color: var(--forest); background: var(--surface-soft); }
.icon-button svg { width: 18px; height: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--forest-2); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px,.82fr) minmax(500px,1.18fr); background: white; }
.auth-brand { min-height: 100vh; padding: clamp(42px,7vw,92px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; color: white; background: var(--forest); }
.auth-brand::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(#fff 1px,transparent 1px),linear-gradient(90deg,#fff 1px,transparent 1px); background-size: 52px 52px; }
.auth-brand > * { position: relative; z-index: 1; }
.brand-mark { width: 38px; height: 38px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: white; background: var(--forest-2); }
.brand-mark svg { width: 21px; height: 21px; }
.brand-mark.large { width: 54px; height: 54px; margin-bottom: 42px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.brand-mark.large svg { width: 28px; height: 28px; }
.brand-kicker { margin: 0 0 12px; color: #a8ceb9; font-weight: 700; font-size: 14px; }
.auth-brand h1 { margin: 0; font-size: 56px; line-height: 1; font-weight: 800; }
.auth-brand-copy { margin: 22px 0 0; max-width: 340px; color: #d8e5df; font-size: 17px; line-height: 1.8; }
.auth-brand-meta { margin-top: 68px; display: flex; gap: 22px; color: #bdd4c8; font-size: 13px; }
.auth-brand-meta span { display: inline-flex; align-items: center; gap: 7px; }
.auth-brand-meta svg { width: 16px; height: 16px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 42px 24px; background: #fafbfa; }
.auth-card { width: min(100%,420px); }
.auth-heading h2 { margin: 0; font-size: 30px; }
.auth-tabs { height: 43px; margin: 34px 0 26px; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-weight: 700; }
.auth-tab.active { border-color: var(--forest); color: var(--forest); }
.auth-form { display: grid; gap: 18px; }
.auth-form label, .form-grid label { display: grid; gap: 7px; color: #47524e; font-size: 13px; font-weight: 700; }
.auth-form .btn { margin-top: 4px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 44px; }
.field-icon { position: absolute; right: 3px; top: 3px; width: 36px; height: 36px; border: 0; color: var(--muted); background: transparent; }
.field-icon svg { width: 17px; }
.link-button { justify-self: center; border: 0; color: var(--forest-2); background: transparent; font-size: 13px; font-weight: 700; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); color: #dce8e2; background: #112b23; display: flex; flex-direction: column; }
.sidebar-brand { height: 74px; padding: 0 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .brand-mark { background: #2c604b; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand > span:last-child { min-width: 0; }
.sidebar-brand strong { max-width: 158px; color: white; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.sidebar-brand small { margin-top: 1px; color: #90a9a0; font-size: 10px; }
.sidebar-nav { padding: 20px 12px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item { width: 100%; min-height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 5px; color: #a9bbb4; background: transparent; text-align: left; font-size: 14px; font-weight: 700; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: #285543; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item .nav-count { margin-left: auto; color: #86aa98; font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-section-label { margin: 30px 12px 10px; color: #6f8d80; font-size: 10px; font-weight: 800; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.account-button { width: 100%; padding: 8px; display: grid; grid-template-columns: 34px 1fr 16px; align-items: center; gap: 9px; border: 0; border-radius: 5px; color: white; background: transparent; text-align: left; }
.account-button:hover { background: rgba(255,255,255,.06); }
.account-button strong, .account-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button strong { font-size: 13px; }
.account-button small { margin-top: 2px; color: #839c91; font-size: 10px; }
.account-button > svg { width: 15px; color: #6d887c; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #16382d; background: #b8d9c7; font-size: 13px; font-weight: 800; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 20; top: 0; height: 74px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.search-box { width: min(520px,48vw); height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--canvas); }
.search-box svg { width: 17px; color: var(--muted); }
.search-box input { height: 36px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; color: #86908c; background: white; font: 10px inherit; white-space: nowrap; }
.topbar-actions { display: flex; gap: 9px; }
.main-content { width: min(1540px,100%); margin: 0 auto; padding: 30px; }
.page-heading { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.result-summary { margin: 0; color: var(--muted); font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(180px,1fr)); gap: 12px; }
.metric { min-width: 0; min-height: 132px; padding: 19px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.metric-dark { color: white; border-color: var(--forest); background: var(--forest); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-dark .metric-label { color: #b9d0c4; }
.metric-label svg { width: 18px; height: 18px; }
.metric strong { display: block; margin: 19px 0 8px; color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-dark strong { color: white; }
.metric small { display: block; color: #89938f; font-size: 11px; line-height: 1.55; }
.metric-dark small { color: #a8c3b6; }
.interactive-metric { cursor: pointer; outline: none; transition: border-color .16s, background .16s, box-shadow .16s, transform .16s; }
.interactive-metric:hover { border-color: #9bb8aa; background: #f7faf8; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24,47,38,.08); }
.interactive-metric:focus-visible { box-shadow: 0 0 0 3px rgba(45,112,78,.2); }
.interactive-metric.is-active { border-color: var(--forest); background: #edf6f1; box-shadow: inset 0 0 0 1px var(--forest), 0 7px 18px rgba(24,47,38,.08); }
.interactive-metric.is-active .metric-label, .interactive-metric.is-active strong { color: var(--forest); }
.interactive-metric.is-active.warning-metric { border-color: #b5761c; background: #fff8eb; box-shadow: inset 0 0 0 1px #b5761c, 0 7px 18px rgba(112,74,18,.08); }
.interactive-metric.is-active.warning-metric .metric-label, .interactive-metric.is-active.warning-metric strong { color: #8c5c12; }
.interactive-metric.is-active.danger-metric { border-color: var(--coral); background: #fff4f1; box-shadow: inset 0 0 0 1px var(--coral), 0 7px 18px rgba(120,52,41,.08); }
.interactive-metric.is-active.danger-metric .metric-label, .interactive-metric.is-active.danger-metric strong { color: #963f31; }
.ledger-section { margin-top: 22px; scroll-margin-top: 86px; }
.filterbar { min-height: 56px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.segmented { height: 36px; padding: 3px; display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 5px; background: #e9eeeb; }
.segmented button { min-width: 82px; padding: 0 13px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(22,44,35,.08); }
.filter-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.project-filter-select { height: 36px; padding-left: 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: white; font-size: 11px; font-weight: 700; white-space: nowrap; }
.project-filter-select select { width: 146px; height: 34px; padding: 0 30px 0 4px; border: 0; box-shadow: none; color: var(--ink); background-color: transparent; font-size: 12px; font-weight: 700; }
.filter-button { height: 36px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: white; font-size: 12px; font-weight: 700; }
.filter-button.active { color: var(--forest); border-color: #91b5a2; background: #edf6f1; }
.filter-button svg { width: 15px; }
.filter-actions .icon-button { width: 36px; height: 36px; flex-basis: 36px; }
.date-popover { position: absolute; z-index: 19; right: 30px; margin-top: -4px; padding: 13px; display: flex; align-items: end; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: var(--shadow); }
.date-popover label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.date-popover input { width: 145px; height: 34px; }
.date-popover > span { padding-bottom: 9px; color: var(--muted); font-size: 11px; }
.table-shell { min-height: 300px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: white; }
.project-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.project-table th { height: 45px; padding: 0 14px; color: #77817d; background: #f7f9f8; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 800; }
.project-table td { height: 74px; padding: 10px 14px; border-bottom: 1px solid #e8ecea; color: #414b47; font-size: 12px; vertical-align: middle; }
.project-table tr:last-child td { border-bottom: 0; }
.project-table tbody tr { cursor: pointer; transition: background .14s; }
.project-table tbody tr:hover { background: #f6f9f7; }
.project-table th:nth-child(1) { width: 28%; }
.project-table th:nth-child(2), .project-table th:nth-child(3) { width: 12%; }
.project-table th:nth-child(4) { width: 14%; }
.project-table th:nth-child(5) { width: 8%; }
.project-table th:nth-child(6) { width: 10%; }
.project-table th:nth-child(7) { width: 10%; }
.project-table th:nth-child(8) { width: 48px; }
.project-table.control-table th:nth-child(1) { width: 24%; }
.project-table.control-table th:nth-child(2) { width: 9%; }
.project-table.control-table th:nth-child(3) { width: 13%; }
.project-table.control-table th:nth-child(4) { width: 12%; }
.project-table.control-table th:nth-child(5) { width: 24%; }
.project-table.control-table th:nth-child(6) { width: 13%; }
.project-table.control-table th:nth-child(7) { width: 48px; }
.project-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.project-name > span:last-child { min-width: 0; flex: 1; }
.project-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--forest-2); background: var(--mint); }
.project-icon svg { width: 17px; }
.project-name strong, .project-name small { display: block; }
.project-name strong { color: var(--ink); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
.project-name small { margin-top: 5px; color: #89938f; font-size: 10px; }
.money { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payment-count { display: inline-flex; gap: 5px; color: var(--ink); font-weight: 700; }
.payment-count small { color: var(--muted); font-weight: 500; }
.progress-cell { display: grid; grid-template-columns: minmax(45px,1fr) 42px; align-items: center; gap: 8px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 3px; background: #dfe6e2; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--mint-strong); }
.progress-cell strong { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.document-state-summary { display: grid; justify-items: start; gap: 5px; }
.document-missing { display: block; color: #8a3f20; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.document-missing.normal { color: #39845c; }
.document-missing.backlog { color: #806124; }
.project-person strong,.project-person small { display: block; line-height: 1.5; }
.project-person strong { color: var(--ink); font-size: 11px; }
.project-person small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.status-badge { min-width: 66px; min-height: 25px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.status-badge.paid { color: #216242; background: #e2f1e8; }
.status-badge.paid::before { background: #39845c; }
.status-badge.unpaid { color: #9a5c0e; background: var(--amber-soft); }
.status-badge.unpaid::before { background: #c68022; }
.status-badge.review { color: #8a3f20; background: #f8e6dc; }
.status-badge.review::before { background: #bf6237; }
.status-badge.normal { color: #216242; background: #e2f1e8; }
.status-badge.normal::before { background: #39845c; }
.status-badge.backlog { color: #806124; background: #f8edcf; }
.status-badge.backlog::before { background: #c28a25; }
.status-badge.abnormal { color: #963f31; background: #f8e5e1; }
.status-badge.abnormal::before { background: #c05342; }
.pagination-bar { min-height: 48px; margin-top: 10px; padding: 0 6px 0 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; font-size: 11px; }
.pagination-bar > div { display: flex; gap: 4px; }
.pagination-bar .icon-button:disabled { opacity: .35; cursor: default; }
.detail-alert { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid #bf6237; background: #fff5ef; color: #7d351c; font-size: 12px; line-height: 1.7; }
.detail-alert.settlement-complete { border-left-color: #39845c; background: #edf6f1; color: #216242; }
.table-muted { color: var(--muted); font-size: 11px; }
.row-menu { width: 30px; height: 30px; border: 0; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; }
.row-menu:hover { color: var(--ink); background: #e7ece9; }
.row-menu svg { width: 16px; }
.empty-state { min-height: 340px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--forest-2); background: var(--surface-soft); }
.empty-icon svg { width: 24px; }
.empty-state h3 { margin: 16px 0 5px; font-size: 16px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.drawer-scrim, .sidebar-scrim { position: fixed; z-index: 39; inset: 0; border: 0; background: rgba(13,24,20,.42); }
.detail-drawer { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(700px,92vw); display: flex; flex-direction: column; background: var(--canvas); box-shadow: -16px 0 50px rgba(22,35,30,.16); transform: translateX(105%); transition: transform .22s; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 78px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); background: white; }
.drawer-header > div { min-width: 0; flex: 1; }
.drawer-header > .icon-button { flex: 0 0 auto; }
.drawer-header h2 { margin: 0; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 21px; }
.drawer-content { padding: 20px 22px 32px; overflow-y: auto; }
.detail-actions { margin-bottom: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tabs { margin-bottom: 18px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.detail-tabs button { min-width: 0; height: 39px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.detail-tabs button:hover { color: var(--forest); background: var(--surface-soft); }
.detail-tabs button.active { color: var(--forest); border-bottom-color: var(--forest-2); }
.detail-overview-strip { min-height: 68px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.detail-overview-strip span,.detail-overview-strip strong { display: block; }
.detail-overview-strip > div > span { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.detail-overview-strip > div > strong { font-size: 13px; }
.panel-command-row { min-height: 34px; margin-bottom: 12px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.detail-hero { padding: 20px; color: white; border-radius: 6px; background: var(--forest); }
.detail-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.detail-hero p { margin: 0; color: #c1d3ca; font-size: 12px; line-height: 1.7; }
.detail-hero .address { margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.detail-hero .address svg { width: 14px; }
.detail-money { margin-top: 22px; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.detail-money div { min-width: 0; }
.detail-money small, .info-item small { display: block; margin-bottom: 7px; color: #a9c2b6; font-size: 10px; }
.detail-money strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-progress { margin-top: 17px; display: grid; grid-template-columns: 1fr 45px; align-items: center; gap: 10px; }
.detail-progress .progress-track { background: rgba(255,255,255,.16); }
.detail-progress strong { color: #c5d8ce; font-size: 11px; }
.detail-section { margin-top: 22px; }
.detail-section.compact-top,.detail-hero.compact-top { margin-top: 0; }
.detail-section-heading { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-section h3 { margin: 0; font-size: 14px; }
.document-status-summary { min-width: 0; }
.document-status-summary small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.document-heading-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.info-grid { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.info-item { min-height: 76px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-item:nth-child(2n) { border-right: 0; }
.info-item:nth-last-child(-n+2) { border-bottom: 0; }
.info-item small { color: var(--muted); }
.info-item strong, .info-item p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.65; }
.payment-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.payment-item { min-height: 76px; padding: 13px 14px; display: grid; grid-template-columns: 86px 112px minmax(110px,1fr) 62px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.payment-item:last-child { border-bottom: 0; }
.payment-date { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.payment-amount { color: var(--ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.payment-destination { min-width: 0; }
.payment-destination strong, .payment-destination small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-destination strong { font-size: 12px; }
.payment-destination small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.payment-allocation-list { display: grid; gap: 5px; }
.payment-allocation-entry { display: grid; gap: 2px; padding: 2px 0 5px; border-bottom: 1px dashed #e4e9e6; }
.payment-allocation-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.payment-allocation-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.payment-allocation-entry strong { min-width: 0; }
.payment-allocation-entry b { flex: 0 0 auto; color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.payment-allocation-detail { margin-top: 0 !important; overflow: visible !important; color: var(--muted); line-height: 1.45; text-overflow: clip !important; white-space: normal !important; }
.payment-meta { display: block; margin-top: 7px !important; overflow: visible !important; text-overflow: clip !important; white-space: normal !important; line-height: 1.5; }
.payment-actions { display: flex; justify-content: flex-end; gap: 2px; }
.payment-actions button { width: 28px; height: 28px; border: 0; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; }
.payment-actions button:hover { color: var(--forest); background: var(--surface-soft); }
.payment-actions button.danger:hover { color: var(--coral); background: var(--coral-soft); }
.payment-actions svg { width: 14px; }
.empty-payments { padding: 34px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.record-list { display: grid; gap: 10px; }
.record-block { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.record-block.risk-record.active { border-left: 3px solid var(--coral); }
.record-block.risk-record.closed { border-left: 3px solid #79a88f; }
.record-block-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.record-block-heading > div:first-child { min-width: 0; }
.record-block-heading h4 { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.record-block-heading small,.record-kicker { color: var(--muted); font-size: 10px; line-height: 1.5; }
.record-kicker { display: block; font-weight: 700; }
.record-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.record-description,.risk-amounts p,.risk-closing p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.attachment-list { margin-top: 12px; border-top: 1px solid var(--line); }
.attachment-row { min-height: 42px; padding: 7px 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); }
.attachment-row:last-child { border-bottom: 0; }
.attachment-row > span { min-width: 0; display: flex; align-items: center; gap: 6px; }
.attachment-row > span:first-child { flex: 1; }
.attachment-row strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row small { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.attachment-row svg { width: 14px; height: 14px; }
.risk-type { display: inline-flex; padding: 3px 7px; border: 1px solid #efc9bf; border-radius: 3px; color: #88412f; background: #fff5f1; font-size: 9px; font-weight: 800; }
.risk-type.wage { color: #7b551b; border-color: #ead5a5; background: #fff9e9; }
.risk-type.other { color: #54635d; border-color: #d5ded9; background: #f4f7f5; }
.risk-amounts { margin-top: 11px; font-size: 11px; }
.risk-amounts strong { font-variant-numeric: tabular-nums; }
.risk-closing { margin-top: 11px; padding: 10px 12px; border-left: 3px solid #79a88f; background: #f1f7f4; }
.risk-closing strong,.risk-closing span { display: block; font-size: 11px; }
.risk-closing span { margin-top: 4px; color: var(--muted); }
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(14,25,21,.5); backdrop-filter: blur(2px); }
.modal { width: min(740px,calc(100vw - 32px)); max-height: calc(100vh - 36px); padding: 0; border: 0; border-radius: 7px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.small-modal { width: min(520px,calc(100vw - 32px)); }
.payment-modal { width: min(960px,calc(100vw - 32px)); }
.modal form { display: flex; max-height: calc(100vh - 36px); flex-direction: column; }
.modal-header { min-height: 73px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { min-height: 66px; padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #f8faf9; }
.form-sections { display: grid; gap: 24px; }
.form-sections section + section { padding-top: 22px; border-top: 1px solid var(--line); }
.form-sections h3 { margin: 0 0 15px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid > div:empty { display: block; }
.choice-strip { min-width: 0; margin: 0; padding: 3px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; border: 1px solid var(--line); border-radius: 5px; background: #eef2f0; }
.form-grid .choice-strip label { min-width: 0; display: block; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.choice-strip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice-strip span { min-height: 38px; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 3px; }
.choice-strip input:checked + span { color: var(--forest); border-color: #c9d8d1; background: white; box-shadow: 0 1px 4px rgba(22,44,35,.08); }
.choice-strip svg { width: 16px; height: 16px; }
.ocr-status { min-height: 38px; padding: 9px 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #d8e2dd; border-radius: 5px; color: var(--muted); background: #f5f8f6; font-size: 11px; line-height: 1.5; }
.ocr-status svg { width: 16px; height: 16px; flex: 0 0 16px; }
.ocr-status > span { min-width: 0; flex: 1; }
.ocr-status .btn { flex: 0 0 auto; white-space: nowrap; }
.ocr-status.success { color: #216242; border-color: #bcd8c8; background: #eaf5ee; }
.ocr-status.error { color: #8b5a19; border-color: #ead3ad; background: #fff7e8; }
.payment-form-body { display: grid; gap: 22px; }
.final-payment-field { margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; border: 1px solid #e4b89f; background: #fff8f4; }
.final-payment-field legend { padding: 0 6px; color: #7d351c; font-size: 12px; font-weight: 800; }
.final-payment-field label { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid #dfd6d0; background: #fff; font-weight: 700; }
.final-payment-field input { width: 16px; height: 16px; }
.final-payment-field p { grid-column: 1 / -1; margin: 0; color: #775a4e; font-size: 11px; line-height: 1.6; }
.allocation-editor { padding-top: 20px; border-top: 1px solid var(--line); }
.allocation-heading { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.allocation-heading h3 { margin: 0; font-size: 13px; }
.allocation-column-head,.payment-allocation-row { display: grid; grid-template-columns: minmax(135px,1.1fr) minmax(175px,1.35fr) 110px minmax(130px,1fr) minmax(130px,1fr) 34px; gap: 9px; align-items: center; }
.allocation-column-head { padding: 0 2px 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
#payment-allocation-rows { display: grid; gap: 8px; }
.payment-allocation-row input { min-width: 0; }
.allocation-remove { width: 34px; height: 38px; padding: 0; border: 0; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; }
.allocation-remove:hover { color: var(--coral); background: var(--coral-soft); }
.allocation-remove svg { width: 15px; }
.allocation-summary { margin-top: 14px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #f8faf9; }
.allocation-summary div { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.allocation-summary div:last-child { border-right: 0; }
.allocation-summary small,.allocation-summary strong { display: block; }
.allocation-summary small { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.allocation-summary strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.allocation-summary.over-limit div:last-child { background: var(--coral-soft); }
.allocation-summary.over-limit div:last-child strong { color: var(--coral); }
.allocation-error { margin: 8px 0 0; color: var(--coral); font-size: 10px; }
.account-summary { margin: 20px 20px 0; padding: 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.large-avatar { width: 42px; height: 42px; }
.account-summary strong, .account-summary small { display: block; }
.account-summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-footer { justify-content: space-between; }
.recovery-code { padding: 17px; border: 1px dashed #6d927f; border-radius: 5px; color: var(--forest); background: #edf6f1; font-family: Consolas,monospace; font-size: 22px; font-weight: 800; text-align: center; letter-spacing: 1px; }
.modal-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.confirm-modal { width: min(400px,calc(100vw - 32px)); padding: 26px; text-align: center; }
.confirm-icon { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--coral); background: var(--coral-soft); }
.confirm-icon svg { width: 22px; }
.confirm-modal h2 { margin: 15px 0 7px; font-size: 18px; }
.confirm-modal p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.confirm-actions { margin-top: 21px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast-region { position: fixed; z-index: 100; top: 18px; left: 50%; width: min(420px,calc(100vw - 28px)); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; display: flex; align-items: center; gap: 9px; border: 1px solid #2f5d49; border-radius: 5px; color: white; background: #183c30; box-shadow: 0 10px 30px rgba(20,41,33,.2); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { border-color: #d47562; background: #853e31; }
.toast svg { width: 17px; flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.loading-row td { text-align: center; color: var(--muted); }
@media (max-width:1180px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .project-table th:nth-child(5),.project-table td:nth-child(5),.project-table th:nth-child(6),.project-table td:nth-child(6) { display: none; }
  .project-table th:nth-child(1) { width: 28%; }
  .project-table th:nth-child(2),.project-table th:nth-child(3) { width: 15%; }
  .project-table th:nth-child(4) { width: 20%; }
  .project-table th:nth-child(7) { width: 14%; }
  .project-table.control-table th:nth-child(5),.project-table.control-table td:nth-child(5) { display: table-cell; }
  .project-table.control-table th:nth-child(1) { width: 26%; }
  .project-table.control-table th:nth-child(2) { width: 10%; }
  .project-table.control-table th:nth-child(3) { width: 14%; }
  .project-table.control-table th:nth-child(4) { width: 14%; }
  .project-table.control-table th:nth-child(5) { width: 27%; }
  .project-table.control-table th:nth-child(7) { width: 48px; }
}
@media (max-width:820px) {
  .mobile-only { display: inline-flex !important; }
  .sidebar { transform: translateX(-105%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { z-index: 29; }
  .workspace { margin-left: 0; }
  .topbar { height: 64px; padding: 0 16px; gap: 10px; }
  .search-box { width: 100%; }
  .search-box kbd { display: none; }
  .topbar-actions .btn { width: 40px; padding: 0; }
  .topbar-actions .btn span { display: none; }
  .main-content { padding: 22px 16px; }
  .page-heading h1 { font-size: 24px; }
  .date-popover { right: 16px; }
}
@media (max-width:680px) {
  .auth-shell { grid-template-columns: 1fr; background: #fafbfa; }
  .auth-brand { min-height: 214px; padding: 32px 24px; justify-content: flex-start; }
  .brand-mark.large { width: 42px; height: 42px; margin-bottom: 23px; }
  .auth-brand h1 { font-size: 38px; }
  .brand-kicker,.auth-brand-copy { display: none; }
  .auth-brand-meta { margin-top: 20px; gap: 15px; }
  .auth-panel { padding: 28px 20px 42px; align-items: flex-start; }
  .auth-heading h2 { font-size: 25px; }
  .auth-tabs { margin-top: 26px; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric { min-height: 116px; padding: 14px; }
  .metric strong { margin-top: 15px; font-size: 18px; }
  .metric-label span { font-size: 11px; }
  .page-heading { align-items: flex-start; }
  .result-summary { padding-top: 24px; white-space: nowrap; }
  .filterbar { align-items: flex-start; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button { min-width: 0; flex: 1; }
  #alert-tabs { overflow-x: auto; }
  #alert-tabs button { min-width: max-content; flex: 0 0 auto; }
  .filter-actions { width: 100%; margin-left: 0; }
  .project-filter-select { min-width: 0; flex: 1 1 210px; }
  .project-filter-select select { width: 100%; min-width: 0; }
  .filter-button { flex: 1; justify-content: center; }
  .date-popover { position: static; margin: 4px 0 10px; align-items: stretch; flex-direction: column; }
  .date-popover input { width: 100%; }
  .date-popover > span { display: none; }
  .project-table thead { display: none; }
  .project-table,.project-table tbody,.project-table tr,.project-table td { display: block; width: 100%; }
  .project-table tr { position: relative; padding: 14px; border-bottom: 1px solid var(--line); }
  .project-table tr:last-child { border-bottom: 0; }
  .project-table td { height: auto; padding: 0; border: 0; }
  .project-table td:nth-child(1) { padding-right: 130px; }
  .project-table td:nth-child(2) { margin-top: 16px; display: inline-block; width: 48%; }
  .project-table td:nth-child(2)::before { content: "合同金额"; display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
  .project-table td:nth-child(3) { margin-top: 16px; display: inline-block; width: 48%; }
  .project-table td:nth-child(3)::before { content: "累计回款"; display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
  .project-table td:nth-child(4) { margin-top: 13px; }
  .project-table td:nth-child(5),.project-table td:nth-child(6) { display: none; }
  .project-table.control-table td:nth-child(2)::before { content: "项目分类"; }
  .project-table.control-table td:nth-child(3)::before { content: "工期"; }
  .project-table.control-table td:nth-child(5) { margin-top: 12px; display: block; }
  .project-table.control-table td:nth-child(5)::before { content: "资料情况"; display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
  .project-table td:nth-child(7) { position: absolute; right: 48px; top: 20px; width: auto; }
  .project-table td:nth-child(8) { position: absolute; right: 12px; top: 17px; width: auto; }
  .project-table.control-table td:nth-child(7) { right: 12px; top: 17px; }
  .project-name small { max-width: 160px; }
  .drawer-content { padding: 16px 14px 28px; }
  .detail-drawer { width: 100vw; }
  .detail-money { grid-template-columns: 1fr 1fr; }
  .detail-money div:last-child { grid-column: span 2; }
  .detail-tabs button { padding: 0 3px; font-size: 10px; }
  .record-block-heading { align-items: stretch; flex-direction: column; }
  .record-actions { justify-content: flex-start; }
  .attachment-row { align-items: flex-start; }
  .attachment-row > span:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .attachment-row strong { max-width: 220px; white-space: normal; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item,.info-item:nth-child(2n),.info-item:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .info-item:last-child { border-bottom: 0; }
  .payment-item { grid-template-columns: 76px 1fr 54px; gap: 8px; }
  .payment-amount { grid-column: 2; grid-row: 1; }
  .payment-date { grid-column: 1; grid-row: 1; }
  .payment-destination { grid-column: 1 / 3; grid-row: 2; }
  .payment-actions { grid-column: 3; grid-row: 1 / 3; }
  .allocation-column-head { display: none; }
  .payment-allocation-row { grid-template-columns: minmax(0,1fr) 112px 34px; }
  .payment-allocation-row [data-allocation-destination] { grid-column: 1; }
  .payment-allocation-row [data-allocation-amount] { grid-column: 2; }
  .payment-allocation-row [data-allocation-advance] { grid-column: 1 / 3; grid-row: 2; }
  .payment-allocation-row [data-allocation-reference] { grid-column: 1 / 3; grid-row: 3; }
  .payment-allocation-row [data-allocation-note] { grid-column: 1 / 3; grid-row: 4; }
  .payment-allocation-row .allocation-remove { grid-column: 3; grid-row: 1 / 5; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .form-grid > div:empty { display: none; }
  .modal { max-height: calc(100vh - 16px); }
  .modal form { max-height: calc(100vh - 16px); }
  .modal-footer { padding: 10px 14px; }
  .modal-body { padding: 16px; }
  .account-footer { flex-wrap: wrap; }
}
@media (max-width:410px) {
  .summary-grid { grid-template-columns: 1fr; }
  .metric { min-height: 105px; }
  .topbar-actions { gap: 5px; }
  .topbar { padding: 0 10px; }
  .main-content { padding-left: 12px; padding-right: 12px; }
  .auth-brand-meta { flex-direction: column; gap: 8px; }
}

/* Unified operations platform */
.register-note, .upload-note { margin: -8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.module-launch-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.module-launch { min-height: 118px; padding: 18px; display: grid; grid-template-columns: 42px minmax(0,1fr) 20px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; text-align: left; }
.module-launch:hover { border-color: #9bb8aa; box-shadow: 0 8px 24px rgba(24, 47, 38, .08); }
.module-launch > span:nth-child(2) { min-width: 0; }
.module-launch strong, .module-launch small { display: block; }
.module-launch strong { margin-bottom: 7px; font-size: 14px; }
.module-launch small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.module-launch > svg { width: 17px; color: #8a9691; }
.launch-icon { width: 42px; height: 42px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.launch-icon svg { width: 20px; }
.launch-icon.green { color: #236846; background: #e1f0e7; }
.launch-icon.blue { color: #315f8a; background: #e5eef6; }
.launch-icon.amber { color: #946012; background: #faedda; }
.dashboard-note { margin-top: 18px; padding: 18px; display: flex; gap: 13px; border: 1px solid #c8d8d0; border-radius: 6px; color: #24483a; background: #eaf3ee; }
.dashboard-note > svg { width: 21px; flex: 0 0 auto; }
.dashboard-note strong { font-size: 13px; }
.dashboard-note p { margin: 5px 0 0; color: #63776e; font-size: 11px; line-height: 1.7; }
.warning-metric { border-top: 3px solid #c6882b; }
.danger-metric { border-top: 3px solid var(--coral); }
.compact-select { width: 160px; height: 36px; font-size: 12px; }
.credential-filter-actions { margin-left: auto; display: flex; gap: 8px; }
.credential-table, .user-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.credential-table th, .user-table th { height: 45px; padding: 0 14px; color: #77817d; background: #f7f9f8; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.credential-table td, .user-table td { height: 70px; padding: 10px 14px; border-bottom: 1px solid #e8ecea; color: #414b47; font-size: 12px; }
.credential-table tbody tr { cursor: pointer; }
.credential-table tbody tr:hover { background: #f6f9f7; }
.credential-table th:first-child { width: 22%; }
.credential-table th:nth-child(2) { width: 34%; }
.credential-table th:nth-child(3) { width: 12%; }
.credential-table th:nth-child(4) { width: 14%; }
.credential-table th:nth-child(5) { width: 14%; }
.credential-table th:last-child { width: 52px; }
.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.credential-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.credential-preview-item { min-width: 0; padding: 5px 7px; border: 1px solid #dce6e1; border-radius: 4px; background: #f4f8f6; line-height: 1.3; }
.credential-preview-item strong,.credential-preview-item small { display: block; overflow-wrap: anywhere; }
.credential-preview-item strong { color: var(--ink); font-size: 10px; }
.credential-preview-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.credential-preview-more { align-self: center; color: var(--muted); font-size: 10px; }
.credential-status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.credential-status.valid { color: #216242; background: #e2f1e8; }
.credential-status.warning { color: #8c5c12; background: #faedda; }
.credential-status.urgent, .credential-status.expired { color: #963f31; background: #f8e5e1; }
.document-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.document-row { min-height: 66px; padding: 11px 13px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.document-state { width: 32px; height: 32px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.document-row.complete .document-state { color: #2c7550; background: #e2f1e8; }
.document-row.missing .document-state { color: #a96a19; background: #faedda; }
.document-row.pending .document-state { color: #687570; background: #eef2f0; }
.document-state svg { width: 16px; }
.document-row strong, .document-row small { display: block; }
.document-row strong { font-size: 12px; }
.document-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.document-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.document-action-button { min-height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: white; text-decoration: none; font-size: 10px; font-weight: 700; }
.document-action-button:hover { color: var(--forest); border-color: #a9bdb3; background: var(--surface-soft); }
.document-action-button.danger { color: var(--coral); }
.document-action-button svg { width: 13px; height: 13px; }
.mini-action { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; text-decoration: none; }
.mini-action:hover { color: var(--forest); background: var(--surface-soft); }
.mini-action.danger:hover { color: var(--coral); background: var(--coral-soft); }
.mini-action svg { width: 15px; }
.credential-expiry { margin-top: 28px; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.credential-expiry small { grid-column: 1 / 3; margin-bottom: 7px; color: #a9c2b6; font-size: 10px; }
.credential-expiry strong { font-size: 25px; }
.credential-expiry span { color: #c1d3ca; font-size: 11px; }
.history-list { border: 1px solid var(--line); border-radius: 6px; background: white; }
.history-list > div:not(.empty-payments) { min-height: 58px; padding: 11px 13px; display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.history-list > div:last-child { border-bottom: 0; }
.history-list span, .history-list small { color: var(--muted); }
.related-credential-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.related-credential-list button { width: 100%; min-height: 58px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0,1fr) auto 18px; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; }
.related-credential-list button:last-child { border-bottom: 0; }
.related-credential-list button:hover { background: #f6f9f7; }
.related-credential-list strong,.related-credential-list small { display: block; }
.related-credential-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.related-credential-list button > svg { width: 15px; color: var(--muted); }
.owner-credential-count { display: inline-flex; min-height: 27px; padding: 0 9px; align-items: center; border-radius: 4px; color: #174332; background: #dceee5; font-size: 11px; font-weight: 800; }
.credential-owner-summary { margin-top: 24px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.credential-owner-summary small,.credential-owner-summary strong { display: block; }
.credential-owner-summary small { color: #a9c6b8; font-size: 10px; }
.credential-owner-summary strong { margin-top: 7px; color: white; font-size: 18px; overflow-wrap: anywhere; }
.owner-credential-list { display: grid; gap: 9px; }
.owner-credential-card { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.owner-credential-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.owner-credential-heading strong,.owner-credential-heading small { display: block; }
.owner-credential-heading strong { color: var(--ink); font-size: 13px; }
.owner-credential-heading small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.owner-credential-fields { margin-top: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.owner-credential-fields > div { min-width: 0; padding: 9px 10px; background: #f5f7f6; }
.owner-credential-fields small,.owner-credential-fields strong,.owner-credential-fields span { display: block; overflow-wrap: anywhere; }
.owner-credential-fields small { color: var(--muted); font-size: 9px; }
.owner-credential-fields strong { margin-top: 4px; color: var(--ink); font-size: 11px; }
.owner-credential-fields span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.owner-credential-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.role-guide { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.create-user-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin: 0 0 18px; }
.create-user-form label { min-width: 0; }
.create-user-form .btn { min-height: 42px; white-space: nowrap; }
.role-guide div { padding: 16px; border-right: 1px solid var(--line); }
.role-guide div:last-child { border-right: 0; }
.role-guide strong, .role-guide span { display: block; }
.role-guide strong { font-size: 13px; }
.role-guide span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.role-select { width: 130px; height: 34px; font-size: 12px; }
.company-settings-band { margin-bottom: 18px; padding: 18px 20px; display: grid; grid-template-columns: minmax(260px,.9fr) minmax(420px,1.35fr); align-items: end; gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f2f6f4; }
.company-settings-heading { display: flex; align-items: center; gap: 12px; }
.company-settings-heading > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--forest); }
.company-settings-heading svg { width: 18px; height: 18px; }
.company-settings-heading h2,.company-settings-heading p { margin: 0; }
.company-settings-heading h2 { font-size: 15px; }
.company-settings-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.company-settings-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; }
.company-settings-form label { min-width: 0; }
.company-settings-form .btn { min-height: 42px; white-space: nowrap; }
.dashboard-metrics.project-scoped { grid-template-columns: repeat(3,minmax(180px,1fr)); }
#users-module .table-shell, #alerts-module .table-shell { overflow-x: auto; }
.user-table { min-width: 980px; }
.user-table th:nth-child(1) { width: 18%; }
.user-table th:nth-child(2) { width: 14%; }
.user-table th:nth-child(3) { width: 17%; }
.user-table th:nth-child(4) { width: 25%; }
.user-table th:nth-child(5) { width: 15%; }
.user-table th:last-child { width: 90px; }
.scope-button { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #f7f9f8; text-align: left; }
.scope-button:hover { border-color: #91b5a2; background: #edf6f1; }
.scope-button strong, .scope-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-button strong { font-size: 11px; }
.scope-button small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.scope-all { color: var(--muted); font-size: 11px; }
.access-note { margin-top: 0; }
.project-access-list { max-height: 420px; margin-top: 14px; display: grid; gap: 6px; overflow-y: auto; }
.project-access-option { min-height: 54px; padding: 9px 11px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fafbfa; cursor: pointer; }
.project-access-option:hover { border-color: #9bb8aa; background: #f1f6f3; }
.project-access-option input { width: 16px; height: 16px; margin: 0; }
.project-access-option strong, .project-access-option small { display: block; }
.project-access-option strong { font-size: 12px; }
.project-access-option small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.alert-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
.alert-table th { height: 45px; padding: 0 12px; color: #77817d; background: #f7f9f8; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 800; }
.alert-table td { min-height: 66px; padding: 12px; border-bottom: 1px solid #e8ecea; color: #414b47; font-size: 11px; line-height: 1.55; vertical-align: middle; }
.alert-table tbody tr { cursor: pointer; }
.alert-table tbody tr:hover { background: #f8faf9; }
.alert-table th:first-child { width: 18%; }
.alert-table th:nth-child(2) { width: 14%; }
.alert-table th:nth-child(3) { width: 13%; }
.alert-table th:nth-child(4) { width: 11%; }
.alert-table th:nth-child(5) { width: 18%; }
.alert-table th:nth-child(6) { width: 20%; }
.alert-table th:last-child { width: 52px; }
.alert-reason { color: #963f31; font-weight: 700; }
.alert-reason.backlog { color: #806124; }

@media (max-width: 980px) {
  .module-launch-grid { grid-template-columns: 1fr; }
  .dashboard-metrics.project-scoped { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .company-settings-band { grid-template-columns: 1fr; align-items: stretch; }
}
@media (max-width: 680px) {
  .module-launch { min-height: 96px; }
  .role-guide { grid-template-columns: 1fr; }
  .role-guide div { border-right: 0; border-bottom: 1px solid var(--line); }
  .role-guide div:last-child { border-bottom: 0; }
  .company-settings-band { padding: 16px; }
  .company-settings-form { grid-template-columns: 1fr; }
  .create-user-form { grid-template-columns: 1fr; }
  .credential-filter-actions { width: 100%; margin-left: 0; }
  .credential-filter-actions .compact-select { min-width: 0; flex: 1; }
  .credential-table thead { display: none; }
  .credential-table, .credential-table tbody, .credential-table tr, .credential-table td { display: block; width: 100%; }
  .credential-table tr { position: relative; padding: 14px; border-bottom: 1px solid var(--line); }
  .credential-table td { height: auto; padding: 4px 0; border: 0; }
  .credential-table td:last-child { position: absolute; right: 10px; top: 14px; width: auto; }
  .credential-table td:nth-child(5) { position: absolute; right: 45px; top: 18px; width: auto; }
  .credential-table td:nth-child(1) { padding-right: 130px; }
  .credential-preview { padding-right: 30px; }
  .owner-credential-fields { grid-template-columns: 1fr; }
  .credential-owner-summary { gap: 12px; }
  .document-row { grid-template-columns: 34px minmax(0,1fr); }
  .document-row > .document-actions { grid-column: 2; justify-content: flex-start; }
  .history-list > div:not(.empty-payments) { grid-template-columns: 86px 1fr; }
  .history-list small { grid-column: 1 / 3; }
  .dashboard-metrics.project-scoped { grid-template-columns: 1fr; }
}

.policy-workflow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.policy-stage { min-width: 0; min-height: 62px; padding: 9px 12px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: white; text-align: left; }
.policy-stage:nth-child(3n) { border-right: 0; }
.policy-stage:nth-last-child(-n+3) { border-bottom: 0; }
.policy-stage:hover { background: #f3f7f5; }
.policy-stage.active { color: var(--forest); background: #e5f0ea; box-shadow: inset 3px 0 0 var(--forest-2); }
.policy-stage > span { color: var(--forest-2); font-size: 12px; font-weight: 800; }
.policy-stage:first-child > span { font-size: 11px; }
.policy-stage small { min-width: 0; color: inherit; font-size: 11px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.policy-filterbar { align-items: center; }
.policy-filter-note { max-width: 650px; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.policy-filter-note svg { width: 15px; height: 15px; flex: 0 0 auto; }
.policy-table-shell { overflow-x: auto; }
.policy-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.policy-table th { height: 45px; padding: 0 12px; color: #77817d; background: #f7f9f8; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 800; }
.policy-table td { min-height: 72px; padding: 12px; border-bottom: 1px solid #e8ecea; color: #414b47; font-size: 11px; line-height: 1.55; vertical-align: middle; overflow-wrap: anywhere; }
.policy-table tbody tr:last-child td { border-bottom: 0; }
.policy-table tbody tr:hover { background: #f8faf9; }
.policy-table th:nth-child(1) { width: 7%; }
.policy-table th:nth-child(2) { width: 22%; }
.policy-table th:nth-child(3) { width: 13%; }
.policy-table th:nth-child(4) { width: 24%; }
.policy-table th:nth-child(5) { width: 10%; }
.policy-table th:nth-child(6) { width: 9%; }
.policy-table th:nth-child(7) { width: 15%; }
.policy-table th:last-child,.policy-table td:last-child { position: sticky; right: 0; z-index: 2; background: white; box-shadow: -8px 0 12px -12px rgba(20,46,36,.45); }
.policy-table th:last-child { z-index: 3; background: #f7f9f8; }
.policy-table tbody tr:hover td:last-child { background: #f8faf9; }
.policy-code { display: inline-flex; min-width: 42px; min-height: 26px; padding: 0 7px; align-items: center; justify-content: center; border: 1px solid #b9c9c1; border-radius: 4px; color: var(--forest); background: #edf3f0; font-weight: 800; }
.policy-title strong,.policy-title small,.policy-file-meta strong,.policy-file-meta small { display: block; }
.policy-title strong { color: var(--ink); font-size: 12px; line-height: 1.55; }
.policy-title small,.policy-file-meta small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.policy-file-meta strong { color: var(--ink); font-size: 11px; }
.policy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.policy-action { min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--forest); background: white; font-size: 10px; font-weight: 700; }
.policy-action:hover { border-color: #91b5a2; background: #edf6f1; }
.policy-action.danger { color: var(--coral); }
.policy-stage-fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 5px; }
.policy-stage-fieldset legend { padding: 0 5px; color: #47524e; font-size: 13px; font-weight: 700; }
.policy-stage-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.policy-stage-options label { min-height: 38px; padding: 7px 9px; display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 4px; background: #fafbfa; cursor: pointer; }
.policy-stage-options input { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; }
.policy-stage-options span { min-width: 0; font-size: 10px; line-height: 1.35; }
#policy-reference-note { margin: 2px 0 0; }
#policy-file-help { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }

@media (max-width: 980px) {
  .policy-workflow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .policy-stage:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .policy-stage:nth-child(2n) { border-right: 0; }
  .policy-stage:last-child { border-bottom: 0; }
  .policy-filterbar { align-items: flex-start; flex-direction: column; }
  .policy-filterbar .filter-actions { width: 100%; margin-left: 0; }
}
@media (max-width: 680px) {
  .policy-workflow { grid-template-columns: 1fr; }
  .policy-stage:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .policy-stage:last-child { border-bottom: 0; }
  .policy-stage-options { grid-template-columns: 1fr 1fr; }
  .policy-filterbar .project-filter-select { width: 100%; }
  .policy-filterbar .project-filter-select select { width: 100%; }
}
