/* Asset workspace: scoped styles leave the shared dialogs and other modules unchanged. */
#assets-view { min-width: 0; padding: 1rem; background: #f8fafc; color: #334155; box-shadow: 0 2px 8px #0f172a0a; }
#assets-view .view-header { margin-bottom: .875rem; }
#assets-view .view-header h2 { font-size: 1.2rem; color: #0f172a; }
#assets-view .assets-tabs { width: fit-content; max-width: 100%; padding: .25rem; gap: .25rem; margin: 0 0 .75rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #eef2f6; overflow-x: auto; flex-shrink: 0; }
#assets-view .asset-tab { flex-shrink: 0; padding: .4rem .875rem; border: none; border-radius: 5px; margin: 0; color: #64748b; font-size: .85rem; line-height: 1.5; background: transparent; }
#assets-view .asset-tab.active { background: white; color: #4338ca; box-shadow: 0 1px 4px #0f172a14; font-weight: 600; }
#assets-view .asset-tab:hover:not(.active) { background: #e2e8f0; color: #334155; }
#assets-view .assets-content { min-width: 0; min-height: 0; padding-right: .125rem; }
#assets-view .asset-tab-content { padding: 0 0 .5rem; }
#assets-view .primary-btn, #assets-view .secondary-btn, #assets-view .danger-btn { padding: .3rem .625rem; min-height: 30px; border-radius: 5px; font-size: .8rem; line-height: 1.4; box-shadow: none; }
#assets-view .primary-btn { background: #4f46e5; color: white; }
#assets-view .primary-btn:hover { background: #4338ca; transform: none; }
#assets-view .secondary-btn { background: white; color: #475569; border-color: #e2e8f0; }
#assets-view .secondary-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
#assets-view .danger-btn { background: white; border-color: #fecaca; color: #dc2626; }
#assets-view .danger-btn:hover { background: #fef2f2; }
#assets-view button:focus-visible, #assets-view .asset-table-scroll:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
#assets-view .assets-overview { display: grid; grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(105px, 1fr)); align-items: stretch; gap: .625rem; margin-bottom: 1rem; }
#assets-view .overview-card { display: grid; grid-template-columns: 1fr auto; align-content: start; align-items: baseline; gap: .25rem .5rem; padding: .75rem .875rem; border: 1px solid #e2e8f0; border-radius: 8px; background: white; color: #0f172a; box-shadow: none; min-width: 0; }
#assets-view .overview-card-title { grid-column: 1 / -1; color: #64748b; font-size: .75rem; opacity: 1; }
#assets-view .overview-card-value { font-size: 1.4rem; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#assets-view .overview-card-subtitle { font-size: .7rem; color: #94a3b8; opacity: 1; }
#assets-view .asset-metric-primary { background: #eef2ff; border-color: #dbe3ff; }
#assets-view .asset-metric-primary .overview-card-value { color: #3730a3; font-size: 1.2rem; }
#assets-view .asset-metric-primary .overview-card-subtitle { color: #6366f1; }
#assets-view .asset-metric-currency { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: 1rem; line-height: 1.5; }
#assets-view .asset-metric-currency-code { font-size: .7rem; font-weight: 500; color: #6366f1; }
#assets-view .asset-holdings-section { margin-top: 0; }
#assets-view .asset-section-heading, #assets-view .asset-list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .625rem; }
#assets-view .asset-section-heading h3, #assets-view .asset-list-toolbar h3 { font-size: .95rem; font-weight: 600; color: #1e293b; margin: 0; }
#assets-view .asset-section-heading > span, #assets-view .asset-list-toolbar p { font-size: .75rem; color: #94a3b8; margin: .2rem 0 0; }
#assets-view #holdings-category-filter, #assets-view #assets-category-filter { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .625rem; }
#assets-view .category-filter-btn { padding: .25rem .75rem; border-radius: 6px; font-size: .8rem; color: #64748b; background: white; border-color: #e2e8f0; }
#assets-view .category-filter-btn.active { color: #4338ca; background: #e0e7ff; border-color: #c7d2fe; font-weight: 600; }
#assets-view #holdings-list { border: 1px solid #e2e8f0; border-radius: 8px; background: white; overflow: hidden; }
#assets-view .asset-table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
#assets-view .asset-table-hint { display: none; }
#assets-view .asset-table-scroll table { min-width: 850px; }
/* Legacy cells set spacing/colors inline; keep the overrides limited to this data table. */
#assets-view #holdings-list th, #assets-view #holdings-list td { padding: .45rem .625rem !important; font-size: .8rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
#assets-view #holdings-list th { color: #64748b !important; font-weight: 500 !important; white-space: nowrap; background: #f8fafc; }
#assets-view #holdings-list tbody tr:hover { background: #f8fafc !important; }
#assets-view #holdings-list tbody td:nth-child(n+3) { white-space: nowrap; }
#assets-view #holdings-list tbody td:first-child { min-width: 130px; }
#assets-view #holdings-list tbody td:nth-child(3), #assets-view #holdings-list tbody td:nth-child(4) { color: #475569 !important; }
#assets-view #holdings-list tfoot td { font-weight: 600; }
#assets-view .assets-list, #assets-view .accounts-list, #assets-view .transactions-list, #assets-view .categories-list { gap: .5rem; }
#assets-view .account-bank-group { border: 1px solid #e2e8f0; border-radius: 8px; background: white; }
#assets-view .account-bank-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .75rem; padding: .5rem .75rem; background: #f1f5f9; border-bottom-color: #e2e8f0; }
#assets-view .account-bank-name { font-size: .875rem; color: #1e293b; line-height: 1.4; }
#assets-view .account-bank-meta { margin: 0; color: #94a3b8; font-size: .7rem; }
#assets-view .account-currency-row { padding: .4rem .75rem; gap: 1rem; }
#assets-view .account-currency-row:hover { background: #fafbfe; }
#assets-view .account-currency-info { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: .5rem 1.25rem; align-items: baseline; }
#assets-view .account-currency-summary { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
#assets-view .account-currency-code { min-width: 42px; text-align: center; padding: .125rem .375rem; font-size: .7rem; color: #475569; background: #f1f5f9; }
#assets-view .account-currency-balance { font-size: .875rem; text-align: right; }
#assets-view .account-currency-balance-label { font-size: .7rem; color: #94a3b8; }
#assets-view .account-currency-description { margin: 0; font-size: .75rem; color: #94a3b8; }
#assets-view .account-currency-actions, #assets-view .category-actions { flex-shrink: 0; gap: .375rem; }
#assets-view .category-item { padding: .5rem .75rem; margin: 0; gap: .75rem; border: 1px solid #e2e8f0; border-radius: 6px; background: white; }
#assets-view .category-item:hover { box-shadow: none; background: #fafbfe; border-color: #cbd5e1; }
#assets-view .category-info { min-width: 0; overflow-wrap: anywhere; }
#assets-view .category-name { margin-bottom: .125rem; font-size: .875rem; line-height: 1.4; color: #334155; }
#assets-view .category-description { font-size: .8rem; line-height: 1.45; color: #94a3b8; }
#assets-view .transaction-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
#assets-view .transaction-filters input, #assets-view .transaction-filters select { min-height: 32px; padding: .35rem .625rem; border: 1px solid #dbe2ec; border-radius: 6px; background: white; color: #475569; font: inherit; font-size: .8rem; }
#assets-view .transaction-filters input { width: 280px; max-width: 100%; }
#assets-view #transaction-result-count { margin-left: auto; font-size: .75rem; color: #64748b; }
#assets-view #transactions-list { display: block; border: 1px solid #e2e8f0; border-radius: 8px; background: white; overflow: hidden; }
#assets-view .transaction-table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
#assets-view .transaction-table-scroll:focus-visible { outline: 2px solid #818cf8; outline-offset: -2px; }
#assets-view .transaction-table { width: 100%; min-width: 930px; border-collapse: collapse; table-layout: fixed; font-size: .8rem; }
#assets-view .transaction-table th { padding: .625rem .75rem; background: #f1f5f9; color: #64748b; font-size: .75rem; font-weight: 500; text-align: left; white-space: nowrap; }
#assets-view .transaction-table th:nth-child(1) { width: 112px; }
#assets-view .transaction-table th:nth-child(2) { width: 98px; }
#assets-view .transaction-table th:nth-child(3) { width: 110px; }
#assets-view .transaction-table th:nth-child(4) { width: 18%; }
#assets-view .transaction-table th:nth-child(5) { width: 145px; }
#assets-view .transaction-table th:nth-child(7) { width: 128px; }
#assets-view .transaction-table th.transaction-amount-heading { text-align: right; }
#assets-view .transaction-table th.transaction-actions-heading { text-align: center; }
#assets-view .transaction-table td { padding: .5rem .75rem; border-top: 1px solid #edf1f7; vertical-align: middle; line-height: 1.4; overflow-wrap: anywhere; }
#assets-view .asset-transaction:nth-child(even) { background: #fcfdff; }
#assets-view .asset-transaction:hover { background: #f5f7ff; }
#assets-view .transaction-date { display: block; color: #475569; font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
#assets-view .transaction-clock, #assets-view .transaction-cell-secondary { display: block; margin-top: .125rem; font-size: .7rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
#assets-view .transaction-type-badge { display: inline-block; border-radius: 5px; padding: .2rem .45rem; font-size: .7rem; font-weight: 500; white-space: nowrap; }
#assets-view .transaction-type-badge.buy { background: #eef2ff; color: #4f46e5; }
#assets-view .transaction-type-badge.sell { background: #fff7ed; color: #b45309; }
#assets-view .transaction-type-badge.in { background: #ecfdf5; color: #047857; }
#assets-view .transaction-type-badge.out { background: #fff1f2; color: #be123c; }
#assets-view .transaction-type-badge.neutral { background: #f1f5f9; color: #64748b; }
#assets-view .transaction-cell-primary { display: block; color: #475569; }
#assets-view .transaction-account-cell .transaction-cell-primary { font-weight: 500; color: #334155; }
#assets-view .transaction-cell-label { display: none; }
#assets-view .transaction-cash { text-align: right; font-variant-numeric: tabular-nums; }
#assets-view .transaction-cash strong { font-size: .875rem; font-weight: 600; white-space: nowrap; }
#assets-view .transaction-actions-cell .category-actions { justify-content: flex-end; }
#assets-view .transaction-actions-cell button { flex-shrink: 0; white-space: nowrap; }
#assets-view .transaction-note { color: #64748b; }
#assets-view .loading-message { background: white; border-radius: 8px; padding: 2rem; color: #94a3b8; font-size: .875rem; }
@media (max-width: 1100px) {
    #assets-view .assets-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #assets-view .asset-metric-primary { grid-column: 1 / -1; }
    #assets-view #total-assets-value { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
}
@media (max-width: 768px) {
    #assets-view { padding: .75rem; }
    #assets-view .view-header { margin-bottom: .625rem; }
    #assets-view .assets-tabs { width: 100%; }
    #assets-view .asset-tab { flex: 1 0 auto; padding: .4rem .625rem; font-size: .8rem; }
    #assets-view .overview-card { padding: .625rem; }
    #assets-view .overview-card-value { font-size: 1.15rem; }
    #assets-view .overview-card-subtitle { grid-column: 1 / -1; }
    #assets-view .assets-overview { gap: .375rem; }
    #assets-view .account-currency-row { flex-direction: row; align-items: center; gap: .5rem; }
    #assets-view .account-currency-info { grid-template-columns: 1fr; gap: .25rem; }
    #assets-view .account-currency-summary { justify-content: flex-start; flex-wrap: wrap; }
    #assets-view .account-currency-actions { align-self: center; }
    #assets-view .asset-section-heading > span { display: none; }
    #assets-view .asset-table-hint { display: block; margin: 0 0 .5rem; font-size: .7rem; color: #94a3b8; }
}
@media (max-width: 768px) {
    #assets-view .transaction-filters input { flex: 1 1 100%; width: 100%; }
    #assets-view .transaction-table { min-width: 0; display: block; }
    #assets-view .transaction-table thead { display: none; }
    #assets-view .transaction-table tbody { display: block; }
    #assets-view .transaction-table .asset-transaction { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .375rem .75rem; padding: .75rem; border-top: 1px solid #e2e8f0; }
    #assets-view .transaction-table .asset-transaction:first-child { border-top: 0; }
    #assets-view .transaction-table td { display: block; border: 0; padding: 0; min-width: 0; }
    #assets-view .transaction-type-cell { grid-column: 1; grid-row: 1; }
    #assets-view .transaction-date-cell { grid-column: 1; grid-row: 2; display: flex !important; flex-wrap: wrap; gap: .25rem .5rem; }
    #assets-view .transaction-clock { margin-top: 0; }
    #assets-view .transaction-cash { grid-column: 2; grid-row: 1 / 3; align-self: center; }
    #assets-view .transaction-account-cell { grid-column: 1 / -1; grid-row: 3; }
    #assets-view .transaction-asset-cell { grid-column: 1 / -1; grid-row: 4; }
    #assets-view .transaction-note-cell { grid-column: 1 / -1; grid-row: 5; }
    #assets-view .transaction-actions-cell { grid-column: 1 / -1; grid-row: 6; margin-top: .25rem; }
    #assets-view .transaction-cell-label { display: inline; font-size: .7rem; color: #94a3b8; margin-right: .5rem; }
    #assets-view .transaction-account-cell .transaction-cell-primary, #assets-view .transaction-asset-cell .transaction-cell-primary, #assets-view .transaction-note-cell .transaction-cell-primary { display: inline; }
    #assets-view .transaction-account-cell .transaction-cell-secondary, #assets-view .transaction-asset-cell .transaction-cell-secondary { display: inline; margin-left: .5rem; }
}

/* Trade form also serves assets entered from the holdings dialog. */
#transaction-modal .form-group { min-width: 0; }
#transaction-modal input, #transaction-modal select, #transaction-modal textarea { min-width: 0; max-width: 100%; }
#transaction-modal #transaction-cash-delta { width: 0; }
@media (max-width: 600px) {
    #transaction-modal .transaction-form-row { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
}

#assets-view .asset-symbol-code { margin-left: .375rem; color: #64748b; font-size: .75rem; font-weight: 400; }
