.detail-backdrop { position: fixed; inset: 0; z-index: 1070; background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.detail-modal { --line:#e2e8f0; --navy:#172554; --slate:#64748b; position: fixed; z-index: 1080; top: 50%; left: 50%; display: flex; flex-direction: column; width: min(960px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); transform: translate(-50%, -50%); overflow: hidden; background: white; border-radius: .8rem; box-shadow: 0 24px 80px rgba(15, 23, 42, .3); }
.detail-modal.annul-modal { width: min(620px, calc(100vw - 2rem)); }
.detail-header, .detail-footer { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-color: var(--line); }
.detail-header { border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: .1rem 0 0; color: var(--navy); font-size: 1.25rem; font-weight: 750; }
.detail-body { padding: 1rem 1.2rem; overflow-y: auto; }
.detail-loading { min-height: 260px; display: grid; place-content: center; gap: .5rem; text-align: center; color: var(--slate); }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1rem; }
.detail-summary > div { min-width: 0; padding: .65rem .75rem; background: #f8fafc; border: 1px solid var(--line); border-radius: .5rem; }
.detail-summary span:not(.status-pill), .detail-summary strong { display: block; }
.detail-summary span:not(.status-pill) { margin-bottom: .2rem; color: var(--slate); font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.detail-summary strong { overflow: hidden; color: #1e293b; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.detail-items-wrap { max-height: 290px; border: 1px solid var(--line); border-radius: .55rem; }
.detail-items { min-width: 760px; }
.detail-items th { color: #475569; background: #f8fafc; font-size: .7rem; text-transform: uppercase; }
.detail-items td { color: #334155; font-size: .78rem; }
.detail-lower { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; margin-top: 1rem; }
.comment-panel { min-height: 112px; padding: .85rem; color: #475569; background: #f8fafc; border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: .5rem; }
.comment-panel.has-comment { color: #78350f; background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; }
.comment-panel > span { display: block; margin-bottom: .45rem; font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.comment-panel p { margin: 0; white-space: pre-wrap; font-size: .82rem; }
.totals-panel { padding: .7rem .8rem; background: #f8fafc; border: 1px solid var(--line); border-radius: .5rem; }
.totals-panel > div { display: flex; justify-content: space-between; gap: 1rem; padding: .27rem 0; color: #475569; font-size: .8rem; }
.totals-panel strong { min-width: 100px; color: #1e293b; text-align: right; font-variant-numeric: tabular-nums; }
.totals-panel .grand-total { margin-top: .4rem; padding-top: .55rem; color: var(--navy); border-top: 1px solid #cbd5e1; font-size: 1rem; font-weight: 800; }
.detail-footer { justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--line); }
.invoice-images { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.invoice-images h3 { margin: 0 0 .75rem; color: #1e293b; font-size: .92rem; font-weight: 700; }
.invoice-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.invoice-image-card { display: flex; min-height: 135px; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: .45rem; overflow: hidden; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .6rem; color: #475569; }
.invoice-image-card img { width: 100%; height: 105px; object-fit: cover; border-radius: .35rem; }
.invoice-image-card small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 2rem; background: rgba(2, 6, 23, .92); }
.image-viewer > .btn-close { position: absolute; top: 1rem; right: 1rem; }
.image-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: .4rem; }
@media (max-width: 767.98px) { .detail-summary, .detail-lower { grid-template-columns: 1fr; } .detail-modal { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); } }
