/* Approved C workspace: scoped so inventory/admin screens keep their contracts and layout. */
.ledger-stage,.ledger-mobile,.asset-detail-scope {
  --primary:#11766c; --primary-hover:#095b54; --brand-weak:#e8f4f0;
  --bg-page:#f4f6f8; --text-primary:#192b3b; --text-secondary:#536677;
  --text-tertiary:#657785; --border:#e2e8ed; --border-light:#edf1f4;
  color:var(--text-primary); background:var(--bg-page);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
}
.ledger-stage button,.ledger-mobile button,.asset-detail-scope button {cursor:pointer;}
.ledger-stage button:disabled,.ledger-mobile button:disabled,.asset-detail-scope button:disabled {cursor:not-allowed;opacity:.45;}
.ledger-stage :focus-visible,.ledger-mobile :focus-visible,.asset-detail-scope :focus-visible {outline:3px solid #267fbe;outline-offset:2px;}
.ledger-stage .sidebar {width:184px;}
.ledger-stage .sidebar-brand {padding:0 18px;}
.ledger-stage .nav-item.active {background:var(--brand-weak);color:var(--primary-hover);border-radius:8px;}
.ledger-stage .page-header {padding:24px 28px 18px;background:var(--bg-page);border:0;flex-shrink:0;}
.ledger-stage .page-title {font-size:26px;line-height:1.3;letter-spacing:-.6px;}
.ledger-stage .page-subtitle {margin-top:6px;}
.ledger-stage .ledger-content {padding:0 28px 24px;display:flex;overflow:hidden;min-height:0;flex:1;}
.ledger-workspace {background:#fff;border:1px solid var(--border);border-radius:12px;min-width:0;min-height:0;width:100%;display:flex;flex-direction:column;overflow:hidden;}
.ledger-categories {display:flex;align-items:center;gap:5px;padding:12px 18px;border-bottom:1px solid var(--border);flex-wrap:wrap;flex-shrink:0;}
.ledger-categories>span {font-size:12px;color:var(--text-secondary);margin-right:8px;}
.category-option {display:inline-flex;align-items:center;justify-content:flex-start;gap:6px;min-height:40px;padding:7px 9px;border:1px solid transparent;background:transparent;border-radius:7px;color:var(--text-secondary);font-size:12px;white-space:nowrap;}
.category-option svg {width:17px;height:17px;flex-shrink:0;}
.category-option small {font-size:11px;}
.category-option.active {background:var(--brand-weak);border-color:#bbded5;color:var(--primary-hover);}
.category-option:hover {background:var(--brand-weak);}
.ledger-search {display:flex;gap:10px;padding:16px 18px 8px;flex-shrink:0;}
.ledger-search label {flex:1;display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:8px;padding:0 12px;background:#fafcfd;min-width:0;}
.ledger-search label svg {width:18px;height:18px;color:var(--text-tertiary);}
.ledger-search input {width:100%;border:0;background:transparent;min-height:44px;outline:none;color:var(--text-primary);font:inherit;}
.ledger-search .btn {min-height:44px;}
.ledger-list-head {display:flex;align-items:center;justify-content:space-between;padding:0 18px;gap:12px;flex-shrink:0;}
.ledger-list-head>span {font-size:11px;color:var(--text-tertiary);white-space:nowrap;}
.ledger-status {display:flex;gap:14px;overflow-x:auto;min-width:0;}
.ledger-status button {display:flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:10px 2px;background:transparent;border:0;border-bottom:2px solid transparent;color:var(--text-secondary);white-space:nowrap;font-size:13px;}
.ledger-status button small {background:#f1f5f7;padding:1px 4px;border-radius:3px;font-size:11px;}
.ledger-status button.active {color:var(--primary-hover);border-bottom-color:var(--primary);font-weight:600;}
.ledger-status button.active small {background:var(--brand-weak);}
.ledger-scroll {flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin:0 16px;}
.ledger-table {width:100%;border-collapse:separate;border-spacing:0;font-size:12px;}
.ledger-table th {position:sticky;top:0;z-index:2;background:#f6f8fa;text-align:left;padding:13px 12px;font-size:11px;color:var(--text-secondary);font-weight:500;border-bottom:1px solid var(--border);white-space:nowrap;}
.ledger-table td {padding:14px 12px;border-bottom:1px solid var(--border-light);max-width:230px;min-width:90px;overflow-wrap:anywhere;}
.ledger-table td:first-child {min-width:245px;}
.ledger-table tr:hover td {background:#f7fbfa;}
.ledger-table .ledger-operation {position:sticky;right:0;background:white;min-width:80px;box-shadow:-4px 0 7px -6px #536677;}
.ledger-table th.ledger-operation {z-index:3;background:#f6f8fa;}
.ledger-operation button {display:inline-flex;align-items:center;gap:4px;color:var(--primary-hover);min-height:36px;white-space:nowrap;}
.ledger-operation svg {width:14px;height:14px;flex-shrink:0;}
.ledger-asset-button {border:0;background:transparent;display:flex;align-items:center;gap:11px;padding:0;min-height:40px;text-align:left;color:var(--text-primary);width:100%;}
.ledger-thumb {display:grid;place-items:center;background:#f0f4f6;color:#78919e;width:36px;height:36px;border-radius:10px;flex-shrink:0;}
.ledger-thumb svg {width:21px;height:21px;}
.ledger-name {display:flex;flex-direction:column;gap:5px;min-width:0;}
.ledger-name strong {font-size:13px;font-weight:600;overflow-wrap:anywhere;}
.ledger-name small {font:11px/1.5 Consolas,"Microsoft YaHei",monospace;color:var(--text-secondary);}
.ledger-pagination {border-top:1px solid var(--border);padding:14px 16px;flex-shrink:0;}
.ledger-pagination .pagination {padding:0;border:0;}
.ledger-pagination .pg-btn.current {background:var(--brand-weak);border-color:#bbded5;color:var(--primary-hover);}
.ledger-notice,.detail-filter-note {font-size:12px;line-height:1.7;padding:10px 16px;color:#845513;background:#fff5df;}
.ledger-category-dialog {width:min(460px,calc(100% - 32px));max-height:80dvh;margin:auto;padding:0;border:1px solid var(--border);border-radius:16px;background:white;color:var(--text-primary);box-shadow:0 24px 80px #172c3b35;}
.ledger-category-dialog::backdrop {background:#17303d66;}
.ledger-dialog-head {padding:18px;display:flex;align-items:center;justify-content:space-between;}
.ledger-dialog-head h2 {font-size:18px;margin:0;}
.ledger-category-dialog>p {font-size:12px;color:var(--text-secondary);padding:0 18px;}
.ledger-category-options {display:grid;gap:5px;padding:12px;}
.ledger-category-options .category-option {min-height:48px;font-size:14px;}
.ledger-category-options small {margin-left:auto;}
.ledger-category-options svg {width:22px;height:22px;}
.ledger-sentinel {display:flex;align-items:center;justify-content:center;gap:8px;min-height:64px;font-size:12px;color:var(--text-secondary);padding:12px;}
/* Desktop details have their own bounded scroll container and a stationary pager. */
.asset-detail-scope .detail-modal {width:min(920px,calc(100vw - 48px));max-height:calc(100dvh - 64px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden;}
.asset-detail-scope .detail-modal-body {overflow:auto;min-height:0;padding:24px;overscroll-behavior:contain;}
.asset-detail-scope .modal-head,.asset-detail-scope .modal-foot {flex-shrink:0;}
.asset-detail-scope .detail-hero-name {font-size:25px;}
.asset-detail-scope .field-grid {background:white;border:1px solid var(--border);border-radius:12px;gap:0;padding:0 20px;}
.asset-detail-scope .field-item {padding:16px 8px;border-bottom:1px solid var(--border-light);}
.asset-detail-scope .detail-photo-title {margin-top:24px;}
.asset-detail-scope .w3-overlay-dialog {max-height:calc(100dvh - 48px);border-radius:12px;}
.asset-detail-scope .w3-edit-input,.asset-detail-scope .w3-edit-select {min-height:44px;font-size:16px;border-radius:8px;}
.asset-detail-scope .w3-edit-label {color:var(--text-secondary);font-size:13px;}
.asset-detail-scope .edit-identity {font-size:13px;padding:12px;background:#f4f7f8;border-radius:8px;margin-bottom:18px;}
.asset-detail-header {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:64px;padding:8px 18px;background:white;border-bottom:1px solid var(--border);flex-shrink:0;}
.asset-detail-header strong {font-size:17px;}
.asset-detail-header .detail-return {display:flex;align-items:center;gap:5px;min-height:44px;padding:0;border:0;background:transparent;font-size:12px;color:var(--text-secondary);}
.asset-detail-header svg {width:18px;height:18px;}
.asset-detail-header .btn-icon {width:44px;height:44px;}
.asset-detail-scope .detail-standalone-head {display:none;}
.asset-detail-scope .detail-standalone-app {flex-direction:column;max-width:1040px;margin:auto;background:var(--bg-page);}
.asset-detail-scope .detail-standalone-card {border:1px solid var(--border);border-radius:12px;background:white;padding:24px;}
.desktop-detail-footer {display:flex;align-items:center;justify-content:center;gap:20px;background:white;border-top:1px solid var(--border);padding:12px 20px;flex-shrink:0;}
.desktop-detail-footer>span {font-size:12px;color:var(--text-secondary);}
.asset-stepper {display:grid;grid-template-columns:44px 58px 44px;align-items:center;gap:4px;padding:0 3px;border:1px solid var(--border);border-radius:8px;background:#f3f7f6;flex-shrink:0;}
.asset-stepper button {display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;border-radius:7px;color:var(--primary-hover);}
.asset-stepper button:hover:not(:disabled) {background:var(--brand-weak);}
.asset-stepper svg {width:18px;height:18px;}
.compact-position {font-size:12px;font-weight:600;text-align:center;color:var(--text-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;}
.asset-ended {min-height:100dvh;display:grid;place-items:center;padding:24px;text-align:center;}
.asset-ended svg {width:44px;height:44px;color:var(--primary);}
.asset-ended h1 {font-size:24px;margin:20px 0;}
.asset-ended p {font-size:14px;color:var(--text-secondary);line-height:1.8;}
@media(max-width:1100px) and (min-width:769px) {
  .ledger-stage .sidebar {width:160px;}
  .ledger-stage .page-header {padding:18px;}
  .ledger-stage .ledger-content {padding:0 16px 16px;}
  .ledger-categories {padding:8px 12px;gap:2px;}
  .category-option {padding:5px;min-height:36px;}
  .ledger-list-head>span {display:none;}
}
@media(max-width:768px) {
  .ledger-mobile .mobile-header {background:white;padding:10px 18px 14px;padding-top:calc(10px + env(safe-area-inset-top));border-bottom:1px solid var(--border);}
  .ledger-mobile .mobile-title {color:var(--text-primary);font-size:19px;font-weight:700;}
  .ledger-mobile .mobile-title-row {min-height:32px;}
  .ledger-mobile .mobile-search-row {margin-top:8px;}
  .ledger-mobile .mobile-search {border:1px solid var(--border);border-radius:8px;background:#fafcfd;min-height:44px;}
  .ledger-mobile .mobile-search input {font-size:16px;}
  .ledger-mobile .scan-btn,.ledger-mobile .sync-btn {width:44px;min-width:44px;height:44px;border-radius:8px;background:var(--primary);color:white;}
  .ledger-mobile .mobile-content {padding:0 0 calc(80px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;}
  .ledger-mobile .ledger-workspace {border:0;border-radius:0;display:block;overflow:visible;background:transparent;}
  .ledger-mobile .ledger-scroll {margin:0;overflow:visible;scrollbar-gutter:auto;}
  .ledger-mobile-filters {display:flex;align-items:center;justify-content:space-between;gap:12px;background:white;padding:8px 18px;}
  .ledger-mobile-filters>span {font-size:12px;color:var(--text-secondary);}
  .category-trigger {display:flex;align-items:center;gap:8px;background:var(--brand-weak);border:1px solid #bbded5;border-radius:8px;padding:8px 12px;min-height:44px;color:var(--primary-hover);}
  .category-trigger svg {width:18px;height:18px;}
  .category-trigger strong {font-size:13px;font-weight:600;}
  .ledger-mobile .ledger-list-head {position:sticky;top:0;background:white;z-index:3;padding:0 18px;border-bottom:1px solid var(--border);}
  .ledger-mobile .ledger-status {width:100%;gap:20px;}
  .ledger-mobile .ledger-status button {font-size:13px;min-height:44px;}
  .ledger-cards {padding:14px 18px 0;display:flex;flex-direction:column;gap:12px;}
  .ledger-mobile-card {display:flex;flex-direction:column;gap:12px;width:100%;text-align:left;border:1px solid var(--border);border-radius:12px;background:white;padding:16px;color:var(--text-primary);}
  .ledger-card-main {display:flex;align-items:center;gap:10px;width:100%;min-width:0;}
  .ledger-card-main .ledger-name {flex:1;}
  .ledger-card-main .ledger-name strong {font-size:15px;}
  .ledger-card-main .ledger-name small {font-size:11px;}
  .ledger-card-main .status-badge {flex-shrink:0;font-size:11px;}
  .ledger-card-meta {font-size:12px;color:var(--text-secondary);padding-left:46px;}
  .ledger-mobile .mobile-nav {background:white;border-top:1px solid var(--border);}
  .ledger-mobile .mobile-nav .active {color:var(--primary-hover);}
  .ledger-mobile .ledger-category-dialog {position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:82dvh;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom);}
  .asset-detail-mobile .asset-detail-header {padding-top:calc(8px + env(safe-area-inset-top));}
  .asset-detail-mobile .mobile-content.no-nav {padding:0 18px 24px;overflow-y:auto;min-height:0;flex:1;overscroll-behavior:contain;}
  .detail-entry-note {margin:0 -18px 22px;padding:10px 18px;background:var(--brand-weak);color:var(--primary-hover);font-size:11px;}
  .asset-detail-mobile .m-detail-hero {padding:0 0 22px;background:transparent;border:0;}
  .asset-detail-mobile .m-detail-hero .name {font-size:23px;line-height:1.5;font-weight:700;}
  .asset-detail-mobile .m-detail-hero .code {font:12px/1.5 Consolas,monospace;color:var(--primary-hover);margin-top:10px;}
  .asset-detail-mobile .m-field-card {border:1px solid var(--border);border-radius:12px;padding:18px;margin-bottom:20px;background:white;}
  .asset-detail-mobile .w3-m-card-head {font-size:14px;color:var(--text-primary);margin-bottom:10px;}
  .asset-detail-mobile .m-field-item {display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--border-light);}
  .asset-detail-mobile .m-field-item:last-child {border:0;padding-bottom:0;}
  .asset-detail-mobile .m-field-label {font-size:12px;min-width:74px;color:var(--text-secondary);}
  .asset-detail-mobile .m-field-value {font-size:13px;text-align:right;overflow-wrap:anywhere;}
  .asset-detail-footer {display:flex;align-items:center;gap:12px;padding:12px 18px calc(14px + env(safe-area-inset-bottom));background:white;border-top:1px solid var(--border);flex-shrink:0;}
  .asset-detail-footer>.btn {min-width:0;min-height:46px;flex:1;border-radius:8px;white-space:nowrap;font-size:13px;}
  .asset-detail-footer>[data-action="w3-edit"] {background:var(--primary);border-color:var(--primary);color:white;}
  .asset-detail-footer .asset-stepper {height:46px;}
  .asset-detail-scope .w3-sheet-mask {position:fixed;}
  .asset-detail-scope .w3-sheet {height:var(--app-h,100dvh);max-height:100%;border-radius:0;}
  .asset-detail-scope .w3-sheet-head {padding:12px 18px;flex-shrink:0;}
  .asset-detail-scope .w3-sheet-body {min-height:0;overflow:auto;padding:18px;}
  .asset-detail-scope .w3-sheet-foot {padding:12px 18px calc(14px + env(safe-area-inset-bottom));flex-shrink:0;}
  .asset-detail-scope .w3-sheet-foot .btn {min-height:44px;}
  .asset-detail-scope .w3-edit-form {grid-template-columns:1fr;}
}
@media(prefers-reduced-motion:reduce) {
  .ledger-stage *,.ledger-mobile *,.asset-detail-scope * {animation:none!important;transition:none!important;scroll-behavior:auto!important;}
}
/* Semantic state colors are local to the approved workspace. */
.ledger-stage .status-badge,.ledger-mobile .status-badge,.asset-detail-scope .status-badge {padding:4px 7px;border-radius:4px;font-size:11px;background:#f1f4f6;color:#536677;white-space:nowrap;}
:is(.ledger-stage,.ledger-mobile,.asset-detail-scope) .status-badge[data-status="在用"] {background:#e8f4f0;color:#095b54;}
:is(.ledger-stage,.ledger-mobile,.asset-detail-scope) .status-badge[data-status="闲置"] {background:#ecf2fc;color:#3464a4;}
:is(.ledger-stage,.ledger-mobile,.asset-detail-scope) .status-badge[data-status^="维修"] {background:#fff5df;color:#956010;}
:is(.ledger-stage,.ledger-mobile,.asset-detail-scope) .status-badge .dot {background:currentColor;width:4px;height:4px;}
.asset-detail-mobile .m-detail-hero {text-align:left;}
.asset-detail-mobile .m-detail-hero-head {justify-content:flex-start;}
.ledger-stage .sidebar-item.active {background:var(--brand-weak);color:var(--primary-hover);}
.asset-detail-scope .detail-plan-actions {display:flex;justify-content:flex-end;padding:12px 24px;background:white;border-bottom:1px solid var(--border);}
.asset-detail-mobile .m-detail-hero {align-items:stretch;gap:0;}
.asset-detail-mobile .detail-category {display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary);margin-bottom:10px;}
.asset-detail-mobile .detail-category svg {width:17px;height:17px;}

/* Initial static shell matches the compact workspace rather than flashing old KPI cards. */
.startup-workspace {height:100dvh;display:flex;background:#f4f6f8;color:#192b3b;font-family:-apple-system,BlinkMacSystemFont,"Microsoft YaHei",sans-serif;}
.startup-sidebar {width:184px;flex-shrink:0;background:white;border-right:1px solid #e2e8ed;padding:18px;display:flex;flex-direction:column;gap:12px;}
.startup-sidebar>span {font-size:12px;color:#536677;}
.startup-sidebar .sk {height:40px;margin-top:12px;}
.startup-main {padding:24px 28px;min-width:0;flex:1;display:flex;flex-direction:column;}
.startup-main>header {display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;}
.startup-main>header strong {font-size:26px;}
.startup-main>header .sk {width:110px;height:36px;}
.startup-panel {background:white;border:1px solid #e2e8ed;border-radius:12px;overflow:hidden;min-height:0;flex:1;padding:16px;}
.startup-filters {display:flex;gap:12px;margin-bottom:18px;}
.startup-filters .sk {width:100px;height:40px;}
.startup-search {height:44px;margin-bottom:20px;}
.startup-row {height:70px;display:flex;align-items:center;gap:14px;border-bottom:1px solid #edf1f4;}
.startup-thumb {width:36px;height:36px;flex-shrink:0;border-radius:10px;}
.startup-name {width:180px;height:14px;}
.startup-meta {width:100px;height:12px;margin-left:auto;}
.startup-panel .sk-loading-note {margin-top:16px;}
@media(max-width:768px) {
  .startup-sidebar {display:none;}
  .startup-main {padding:18px;}
  .startup-main>header strong {font-size:18px;}
  .startup-main>header .sk {width:70px;height:30px;}
  .startup-panel {border:0;border-radius:0;background:transparent;padding:0;}
  .startup-filters .sk {width:76px;height:36px;}
  .startup-row {height:98px;}
  .startup-name {width:40%;}
  .startup-meta {width:42px;}
}

/* Long mobile ledgers keep at most 32 cards mounted; spacers preserve scroll/return position. */
@media (max-width:768px) {
  .ledger-cards.ledger-virtual {gap:0;overflow-anchor:none;}
  .ledger-virtual .ledger-mobile-card {height:108px;min-height:108px;max-height:108px;box-sizing:border-box;margin:0 0 12px;flex-shrink:0;overflow:hidden;}
  .ledger-virtual .ledger-card-meta {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
  .ledger-virtual-spacer {flex-shrink:0;pointer-events:none;}
}
