:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #262a30;
  background: #f4f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #272b31;
  --muted: #858a93;
  --line: #e4e6e9;
  --surface: #ffffff;
  --blue: #2463dc;
  --red: #c9333b;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: #f4f5f7; font-size: 13px; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid #1d56c2;
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; background: #fff; color: #174aa8; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #f2f4f6; }
.login-panel { width: min(100%, 480px); padding: 39px 42px 42px; border: 1px solid #e1e4e8; border-radius: 8px; background: #fff; box-shadow: 0 18px 55px rgb(27 36 48 / 9%); }
.login-brand { display: flex; align-items: center; gap: 15px; }
.login-mark { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: #2463dc; font-size: 22px; font-weight: 700; }
.login-eyebrow { margin: 0 0 5px; color: #77808c; font-size: 12px; }
.login-panel h1 { margin: 0; font-size: 19px; font-weight: 650; line-height: 26px; }
.login-rule { height: 1px; margin: 28px 0 24px; background: #e8eaed; }
.login-panel label { display: block; margin: 17px 0 7px; font-size: 12px; font-weight: 650; }
.login-panel > input, .password-field input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid #d6dbe1; border-radius: 6px; background: #fff; }
.confirm-password-field { margin-top: 17px; }
.confirm-password-field label { margin-top: 0; }
.confirm-password-field input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid #d6dbe1; border-radius: 6px; background: #fff; }
.login-help { margin: 8px 0 0; color: #69717b; font-size: 12px; line-height: 18px; }
.password-field { position: relative; }
.password-field input { padding-right: 47px; }
.password-toggle { position: absolute; top: 5px; right: 5px; width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #737b86; }
.password-toggle:hover { background: #f1f3f5; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-submit { width: 100%; height: 46px; margin-top: 25px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 6px; color: #fff; background: var(--blue); font-weight: 650; }
.login-submit:hover { background: #1f57c2; }
.login-submit span:last-child { font-size: 20px; line-height: 1; }
.login-submit:disabled { opacity: .7; cursor: wait; }
.login-error { margin: 10px 0 0; color: var(--red); font-size: 12px; line-height: 18px; }

.app-shell { width: 100%; }
.page-header { min-height: 57px; max-width: 1280px; margin: 0 auto; padding: 17px 40px 10px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-header h1 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.logout-button { height: 29px; padding: 0 9px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; color: #646a74; font-size: 12px; }
.main-content { max-width: 1280px; margin: 0 auto; padding: 0 39px 34px; }

.search-toolbar { min-height: 65px; padding: 11px 12px; display: grid; grid-template-columns: minmax(210px, 1fr) 135px 132px 157px 174px auto; align-items: center; gap: 9px; border: 1px solid #e7e9ec; border-radius: 9px; background: #fff; }
.search-field { position: relative; min-width: 0; height: 41px; display: flex; align-items: center; padding: 0 11px; border: 1px solid #d9dde2; border-radius: 9px; background: #fff; }
.search-field:focus-within { border-color: #8aa7e5; box-shadow: 0 0 0 2px rgb(36 99 220 / 10%); }
.search-field svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: #888e98; stroke-width: 1.7; }
.search-field input { width: 100%; min-width: 0; height: 100%; padding: 0 8px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-field input::placeholder { color: #9298a1; opacity: 1; }
.search-field input:focus-visible { outline: 0; }
.clear-search { flex: 0 0 22px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #edf0f3; color: #707780; font-size: 17px; line-height: 1; }
.select-field select { width: 100%; height: 38px; padding: 0 9px; border: 1px solid #d9dde2; border-radius: 8px; background: #fff; font-size: 12px; }
.amount-filter { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: #626973; font-size: 12px; }
.amount-filter input { width: 87px; height: 36px; padding: 0 10px; border: 1px solid #d9dde2; border-radius: 8px; background: #fff; }
.amount-filter input::placeholder { color: #727883; }
.amount-filter input:disabled { color: #9ba1aa; background: #f5f6f7; cursor: not-allowed; }
.amount-help { min-height: 18px; margin: 5px 2px 0; color: #79808a; font-size: 11px; }

.quick-filters { padding: 8px 0 0; }
.filter-row { min-height: 39px; display: flex; align-items: center; gap: 9px; }
.filter-label { width: 26px; flex: 0 0 26px; color: #676d76; font-size: 12px; white-space: nowrap; }
.filter-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-chip { min-height: 30px; padding: 0 13px; border: 1px solid #dfe2e6; border-radius: 18px; background: #fff; color: #343941; font-size: 12px; white-space: nowrap; }
.filter-chip:hover { border-color: #91a9dc; background: #f7f9fd; }
.filter-chip.selected { border-color: var(--blue); background: var(--blue); color: #fff; }
.summary { min-height: 37px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; color: #575d66; font-size: 13px; }
.summary strong { color: #242930; font-size: 15px; font-weight: 700; }
.summary-divider { color: #a0a5ad; }
.summary-unit { color: #777e88; font-size: 11px; }

.results-panel { overflow: hidden; border: 1px solid #e7e9ec; border-radius: 8px; background: #fff; }
.table-scroll { width: 100%; overflow-x: auto; }
.results-table { width: 100%; min-width: 1120px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.results-table .col-owner { width: 15%; }
.results-table .col-address { width: 23%; }
.results-table .col-phone { width: 12%; }
.results-table .col-creditor { width: 18%; }
.results-table .col-amount { width: 17%; }
.results-table .col-maturity { width: 15%; }
.results-table thead th { height: 41px; padding: 0 10px; border-bottom: 1px solid #e0e3e7; color: #606671; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.sort-button { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; font-weight: inherit; white-space: nowrap; }
.sort-button span { padding-left: 3px; color: #838993; font-size: 13px; }
.result-row { cursor: pointer; }
.result-row:hover { background: #f9fafc; }
.result-row:focus-visible { position: relative; outline-offset: -3px; }
.result-row > td { padding: 10px; border-bottom: 1px solid #e2e4e7; vertical-align: top; }
.result-row:last-child > td { border-bottom: 0; }
.owner-cell strong, .address-cell strong { display: block; color: #272b31; font-size: 13px; font-weight: 650; line-height: 19px; }
.address-cell > span { display: block; margin-top: 3px; color: #7d838d; font-size: 11px; line-height: 17px; }
.phone-cell { color: #737983; font-size: 11px; overflow-wrap: anywhere; }
.not-recorded { color: #808691; font-size: 11px; }
.lien-line { min-height: 41px; padding: 1px 0 5px; border-bottom: 1px dashed #e8eaed; }
.lien-line + .lien-line { padding-top: 6px; }
.lien-line:last-child { border-bottom: 0; }
.lien-name { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 600; line-height: 17px; }
.lien-name > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.priority { width: 17px; height: 17px; flex: 0 0 17px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: #28313c; font-size: 10px; line-height: 17px; }
.lien-tags { display: flex; gap: 9px; padding-left: 24px; margin-top: 1px; font-size: 10px; line-height: 15px; }
.lender-blue { color: #2c62c4; }
.lender-red { color: #c84049; }
.lender-gray { color: #777d86; }
.amount-column { text-align: right !important; }
.amount-cell { min-height: 33px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.amount-total { max-width: 100%; color: #c6333b; font-size: 12px; font-weight: 700; line-height: 18px; overflow-wrap: anywhere; }
.amount-single { color: #333941; font-size: 13px; font-weight: 500; line-height: 18px; }
.amount-breakdown { color: #747a84; font-size: 11px; white-space: nowrap; }
.amount-lines { display: flex; flex-direction: column; align-items: flex-end; }
.amount-lien { min-height: 41px; padding-top: 2px; color: #343941; font-size: 12px; line-height: 17px; }
.amount-grand-total { margin-top: 1px; }
.maturity-line { min-height: 39px; display: flex; align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; gap: 2px 5px; padding: 2px 0 5px; border-bottom: 1px dashed #e8eaed; color: #373c43; font-size: 12px; line-height: 18px; white-space: normal; }
.maturity-line + .maturity-line { padding-top: 6px; }
.maturity-line:last-child { border-bottom: 0; }
.countdown { display: inline-block; flex: 0 0 auto; padding: 1px 5px; border-radius: 11px; color: #ce4149; background: #fff0f1; font-size: 10px; line-height: 16px; }
.countdown.expired { color: #fff; background: #c9333b; }
.empty-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #7a8089; }
.empty-state strong { color: #343941; font-size: 14px; }
.empty-icon { font-size: 29px; line-height: 31px; }
.empty-state button { margin-top: 3px; padding: 7px 12px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; }
.pagination { min-height: 52px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e7e9ec; color: #68707b; font-size: 11px; }
.pagination-actions { display: flex; align-items: center; gap: 7px; }
.page-size-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-size-label select { height: 30px; padding: 0 7px; border: 1px solid #d9dde2; border-radius: 5px; background: #fff; font-size: 11px; }
.page-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d9dde2; border-radius: 5px; background: #fff; color: #3c434d; font-size: 20px; line-height: 1; }
.page-button:disabled { color: #a6abb2; background: #f6f7f8; cursor: not-allowed; }
.footnote { margin: 10px 0 0; color: #777d86; font-size: 11px; line-height: 17px; }

.detail-backdrop { position: fixed; z-index: 30; inset: 0; display: flex; justify-content: flex-end; background: rgb(28 34 43 / 28%); }
.detail-panel { width: min(630px, 100%); height: 100%; overflow-y: auto; padding: 22px 24px 30px; background: #fff; box-shadow: -8px 0 25px rgb(22 30 42 / 12%); }
.detail-header { position: sticky; z-index: 1; top: -22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 0 15px; border-bottom: 1px solid #e7e9ec; background: #fff; }
.detail-eyebrow { margin: 0 0 5px; color: #858b95; font-size: 11px; }
.detail-header h2 { margin: 0; font-size: 19px; font-weight: 650; line-height: 26px; overflow-wrap: anywhere; }
.icon-button { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid #e0e3e7; border-radius: 6px; background: #fff; color: #545b65; font-size: 22px; line-height: 1; }
.detail-content { padding-top: 4px; }
.detail-section { padding: 18px 0; border-bottom: 1px solid #e7e9ec; }
.detail-section h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 13px; font-size: 14px; }
.detail-section h3 span { color: #737a84; font-size: 12px; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; margin: 0; }
.detail-grid > div { min-width: 0; }
.detail-grid dt { margin-bottom: 4px; color: #818791; font-size: 11px; }
.detail-grid dd { margin: 0; color: #30353c; font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.building-list { margin-top: 17px; }
.building-list h4 { margin: 0 0 7px; color: #575e68; font-size: 12px; }
.building-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 120px; gap: 8px; padding: 8px 0; border-top: 1px solid #eceef0; font-size: 11px; }
.building-row strong { font-weight: 600; }
.building-row span:last-child { color: #7b818a; text-align: right; }
.detail-note { margin: -3px 0 12px; color: #777e87; font-size: 11px; line-height: 17px; }
.detail-liens { display: grid; gap: 10px; }
.detail-lien { padding: 13px; border: 1px solid #e5e7ea; border-radius: 7px; }
.document-entry { padding: 13px; border: 1px solid #e5e7ea; border-radius: 7px; }
.document-entry > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.document-entry > div:first-child strong { font-size: 12px; }
.document-entry > div:first-child span { color: #777e87; font-size: 10px; }
.document-entry .detail-grid { padding-top: 13px; margin-top: 12px; border-top: 1px solid #eef0f2; }
.detail-lien-heading { display: flex; align-items: flex-start; gap: 8px; }
.detail-lien-heading > div { min-width: 0; display: grid; gap: 4px; }
.detail-lien-heading > div strong { font-size: 12px; line-height: 17px; overflow-wrap: anywhere; }
.detail-lien-heading > div span { color: #7d838c; font-size: 10px; }
.detail-lien-heading > b { margin-left: auto; color: #c6333b; font-size: 13px; white-space: nowrap; }
.detail-lien .detail-grid { padding-top: 13px; margin-top: 12px; border-top: 1px solid #eef0f2; }
.review-note { margin-top: 17px; padding: 12px 13px; border: 1px solid #e4e6e9; border-radius: 7px; background: #f8f9fa; }
.review-note strong { font-size: 12px; }
.review-note p { margin: 6px 0; color: #535a64; font-size: 12px; line-height: 18px; }
.review-note span { color: #7e848e; font-size: 10px; line-height: 16px; }
.detail-open { overflow: hidden; }

@media (max-width: 1050px) {
  .main-content { padding-right: 24px; padding-left: 24px; }
  .page-header { padding-right: 24px; padding-left: 24px; }
  .search-toolbar { grid-template-columns: minmax(220px, 1fr) 145px 152px; }
  .amount-filter { grid-column: 1 / -1; justify-self: end; }
  .amount-filter input { width: 92px; }
  .summary { min-height: 39px; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .page-header { min-height: 57px; padding: 13px 16px 9px; align-items: flex-start; }
  .page-header h1 { flex: 0 0 auto; padding-top: 5px; font-size: 14px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .main-content { padding: 0 12px 24px; }
  .search-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 9px; border-radius: 8px; }
  .search-field { grid-column: 1 / -1; height: 42px; }
  .search-field input { font-size: 14px; }
  .search-field input::placeholder { overflow: hidden; text-overflow: ellipsis; }
  .select-field select { height: 40px; font-size: 13px; }
  .amount-filter { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-end; }
  .amount-filter input { width: 83px; height: 39px; }
  .quick-filters { padding-top: 6px; }
  .filter-row { align-items: flex-start; gap: 7px; padding: 4px 0; }
  .filter-label { width: 25px; flex-basis: 25px; padding-top: 8px; }
  .filter-options { gap: 5px; }
  .filter-chip { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .summary { min-height: 40px; flex-wrap: wrap; gap: 4px; font-size: 12px; }
  .summary strong { font-size: 14px; }
  .results-panel { border-radius: 9px; }
  .table-scroll { overflow: visible; }
  .results-table { display: block; min-width: 0; }
  .results-table colgroup, .results-table thead { display: none; }
  .results-table tbody { display: grid; gap: 8px; padding: 8px; }
  .result-row { display: grid; grid-template-columns: 1fr; border: 1px solid #e3e6e9; border-radius: 7px; background: #fff; }
  .result-row:hover { background: #fff; }
  .result-row > td { display: block; min-width: 0; padding: 8px 10px; border-bottom: 0; }
  .result-row > td::before { display: block; margin-bottom: 4px; color: #838993; content: attr(data-label); font-size: 10px; line-height: 14px; }
  .result-row > .owner-cell::before { display: none; }
  .owner-cell { padding-bottom: 5px !important; }
  .owner-cell strong { font-size: 14px; }
  .address-cell { padding-top: 4px !important; }
  .address-cell strong { overflow-wrap: anywhere; }
  .phone-cell { display: flex !important; align-items: center; gap: 8px; color: #565d67; }
  .phone-cell::before { flex: 0 0 auto; margin: 0 !important; }
  .lien-line { min-height: 0; padding: 3px 0 7px; }
  .lien-line + .lien-line { padding-top: 8px; }
  .amount-column { text-align: left !important; }
  .amount-cell { align-items: flex-start; }
  .amount-lines { align-items: flex-start; }
  .amount-lien { min-height: 24px; padding-top: 3px; }
  .maturity-line { min-height: 0; flex-wrap: wrap; justify-content: flex-start; padding: 2px 0 6px; white-space: normal; }
  .maturity-line + .maturity-line { padding-top: 7px; }
  .footnote { margin: 8px 2px 0; font-size: 11px; }
  .detail-panel { padding: 14px 15px 24px; }
  .detail-header { top: -14px; padding-top: 14px; }
  .detail-grid { grid-template-columns: 1fr; gap: 12px; }
  .detail-section h3 { align-items: flex-start; flex-direction: column; gap: 4px; }
  .building-row { grid-template-columns: minmax(0, 1fr) 68px; }
  .building-row span:last-child { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 380px) {
  .page-header { padding-right: 12px; padding-left: 12px; }
  .main-content { padding-right: 9px; padding-left: 9px; }
}

@media (max-width: 520px) {
  .login-screen { padding: 16px; }
  .login-panel { padding: 31px 24px 28px; }
  .login-brand { align-items: flex-start; }
  .login-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .login-panel h1 { font-size: 17px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: no-preference) {
  .detail-panel { animation: enter-detail 170ms ease-out; }
  @keyframes enter-detail { from { transform: translateX(14px); opacity: .96; } to { transform: translateX(0); opacity: 1; } }
}
