/* Asset Management. Ports the inline <style> block from v3's AssetManagement.razor and the small
   set of inline styles its edit tabs use, so cmms-enterprise.css keeps doing everything else. */

.asset-mgmt-page-title {
    word-break: break-word;
}

.asset-warranty-alert-title {
    word-break: break-word;
    line-height: 1.35;
}

.asset-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.asset-toolbar-title {
    flex: 1 1 auto;
    min-width: 0;
}

.asset-toolbar-buttons {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 600px) {
    .asset-toolbar-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .asset-toolbar-buttons > * {
        width: 100%;
    }
}

/* v3 paints the Code cell pink when no warranty expiry date is set, with the legend below. */
.asset-no-warranty-cell {
    background-color: #f8bbd9 !important;
}

.asset-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 0;
    color: var(--cmms-muted, #64748b);
    font-size: 0.75rem;
}

.asset-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    background-color: #f8bbd9;
}

/* "Linked To" pill on the Work Orders and Preventive Plan tabs. */
.asset-linked-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Downtime banner pills. */
.asset-downtime-pill {
    display: inline-block;
    margin: 2px 6px 2px 0;
    padding: 3px 10px;
    border-radius: 12px;
    background: #fff3e0;
    color: #e65100;
    font-size: 0.75rem;
    font-weight: 600;
}

.asset-downtime-alert {
    border-left: 4px solid #f57c00;
}

/* Downtimes tab keeps v3's blue header row on its simple table. */
.asset-downtime-table thead th {
    background: #a7dcfe;
    font-weight: 700;
}

.asset-downtime-table {
    font-size: 0.85rem;
}

/* Cost Summary card. */
.asset-cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.asset-cost-kpi {
    padding: 12px 14px;
    border: 1px solid var(--cmms-line-soft, #e2e8f0);
    border-radius: 10px;
    background: #f8fafc;
}

.asset-cost-kpi-label {
    color: var(--cmms-muted, #64748b);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.asset-cost-kpi-value {
    margin-top: 4px;
    color: var(--cmms-ink, #1c2434);
    font-size: 1.1rem;
    font-weight: 700;
}

.asset-cost-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--cmms-line-soft, #e2e8f0);
    font-size: 0.875rem;
}

.asset-cost-row:last-of-type {
    border-bottom: none;
}

.asset-cost-row-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.asset-cost-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1565c0, #4a90a4);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.asset-cost-wo-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* Tabs that ship as a visual shell only. */
.asset-shell-note {
    padding: 18px;
    border: 1px dashed var(--cmms-line, #cbd5e1);
    border-radius: 10px;
    background: #fbfcfd;
    color: var(--cmms-muted, #64748b);
    font-size: 0.8125rem;
}

.asset-icon-preview {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
}

.asset-icon-preview-row {
    gap: 8px;
    flex-wrap: wrap;
}

.cmms-asset-identity {
    background: var(--cmms-surface, #fff);
}

.asset-identity-photo {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid #ccc;
    padding: 8px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
}

/* v3 grows the identity card images slightly on hover to show they open enlarged. */
.asset-identity-photo--clickable {
    transition: transform 0.2s;
}

.asset-identity-photo--clickable:hover {
    transform: scale(1.05);
}

.asset-avatar {
    width: 96px !important;
    height: 96px !important;
}

/* Outlined field labels sit above the control; overflow:hidden on tab chrome clips them. */
.cmms-form-page .cmms-long-tabs .mud-tabs-panels,
.cmms-form-page .asset-tab-panel {
    overflow: visible;
}

.cmms-form-page .cmms-long-tabs .mud-tabs-tabbar {
    background: var(--cmms-surface, #fff);
}

.cmms-muted {
    color: var(--cmms-muted, #64748b);
}
