.dash-drill-drawer {
    position: fixed;
    inset: 0;
    z-index: 1080;
}
.dash-drill-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.dash-drill-drawer-panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(760px, 100%);
    background: var(--surface-card, #fff);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}
.dash-drill-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border, #e5e7eb);
}
.dash-drill-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 4px; }
.dash-drill-meta { margin: 0; color: var(--text-muted, #6b7280); font-size: 0.85rem; }
.dash-drill-close {
    border: 0;
    background: transparent;
    width: 36px;
    height: 36px;
}
.dash-drill-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.il-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.il-kpi-card {
    border: 1px solid var(--surface-border, #e5e7eb);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: var(--surface-card, #fff);
    cursor: pointer;
    text-align: start;
}

.il-kpi-card.is-active,
.il-kpi-card:hover {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.il-kpi-card .lbl {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    display: block;
}

.il-kpi-card .val {
    font-size: 1.25rem;
    font-weight: 700;
}

.il-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.il-op-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.il-op-badge.sync-failed,
.il-op-badge.failed { background: var(--danger-light); color: var(--danger); }
.il-op-badge.stock-issue,
.il-op-badge.warning { background: var(--warning-light); color: #B45309; }
.il-op-badge.pending-approval,
.il-op-badge.info { background: var(--info-light); color: var(--info); }
.il-op-badge.needs-review { background: var(--primary-light); color: var(--primary); }
.il-op-badge.ready,
.il-op-badge.success { background: var(--success-light); color: #059669; }
.il-op-badge.critical { background: var(--danger-light); color: var(--danger); }

.il-op-meta {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    margin-top: 0.2rem;
}

.il-drawer[hidden] { display: none !important; }

.il-payload {
    max-height: 240px;
    overflow: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.il-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.il-timeline li {
    position: relative;
    padding: 0 0 1rem 1.15rem;
    border-inline-start: 2px solid var(--surface-border, #e5e7eb);
    cursor: pointer;
}

.il-timeline li:last-child { border-inline-start-color: transparent; }
.il-timeline li.is-selected { background: rgba(13, 110, 253, 0.06); border-radius: 6px; }
.il-timeline li::before {
    content: '';
    position: absolute;
    inset-inline-start: -5px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}
.il-timeline li.status-Success::before { background: #16a34a; }
.il-timeline li.status-Failed::before { background: #dc2626; }
.il-timeline li.status-Warning::before { background: #d97706; }

.il-corr-group {
    margin-bottom: 1rem;
}

.il-corr-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
    .dash-drill-drawer-panel {
        width: 100%;
    }
}
