/* Excluded Items offcanvas drawer — theme-aware (lives in base.html) */

#peExcludedItemsDrawer.pe-excluded-drawer {
    width: min(900px, 96vw);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color) !important;
}

#peExcludedItemsDrawer .pe-excluded-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color) !important;
}

#peExcludedItemsDrawer .pe-excluded-drawer__title-block {
    flex: 1;
    min-width: 0;
}

#peExcludedItemsDrawer .pe-excluded-drawer__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

#peExcludedItemsDrawer .pe-excluded-drawer__subtitle {
    font-size: 11px;
    color: var(--bs-secondary-color);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

#peExcludedItemsDrawer .pe-excluded-drawer-close {
    flex-shrink: 0;
    align-self: flex-start;
    margin: 0;
    opacity: 1;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 8px;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bs-body-color);
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#peExcludedItemsDrawer .pe-excluded-drawer-close svg {
    display: block;
    stroke: currentColor;
}

#peExcludedItemsDrawer .pe-excluded-drawer-close:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

#peExcludedItemsDrawer .pe-excluded-drawer-close:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

#peExcludedItemsDrawer .pe-excluded-drawer__toolbar,
#peExcludedItemsDrawer .pe-excluded-drawer__footer {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color) !important;
}

#peExcludedItemsDrawer .pe-excluded-drawer__count {
    font-size: 11px;
}

#peExcludedItemsDrawer .pe-excluded-scope-btn {
    font-size: 11px;
}

#peExcludedItemsDrawer .pe-excluded-drawer__footer-link {
    font-size: 11px;
    color: #6366f1;
}

#peExcludedItemsDrawer .pe-excluded-drawer__empty {
    color: var(--bs-secondary-color);
}

#peExcludedItemsDrawer .pe-excluded-drawer__empty-title {
    font-size: 14px;
}

#peExcludedItemsDrawer .pe-excluded-drawer__empty-hint {
    font-size: 12px;
    margin: 0;
}

/* Table */
#peExcludedItemsDrawer .pe-excluded-items-table {
    font-size: 12px;
    --bs-table-bg: var(--bs-body-bg);
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--bs-border-color);
}

#peExcludedItemsDrawer .pe-excluded-items-table th {
    white-space: nowrap;
    font-weight: 600;
}

#peExcludedItemsDrawer .pe-excluded-desc {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#peExcludedItemsDrawer .pe-excluded-meta {
    font-size: 10px;
    color: var(--bs-secondary-color);
    margin-top: 2px;
}

#peExcludedItemsDrawer .pe-excluded-date {
    white-space: nowrap;
    font-family: monospace;
    color: var(--bs-secondary-color);
}

#peExcludedItemsDrawer .pe-excluded-amount {
    font-family: monospace;
}

#peExcludedItemsDrawer .pe-excluded-line-code {
    font-family: monospace;
    color: var(--bs-secondary-color);
}

#peExcludedItemsDrawer .pe-excluded-line-label {
    font-size: 10px;
    color: var(--bs-secondary-color);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#peExcludedItemsDrawer .pe-excluded-reason {
    font-size: 11px;
    color: #334155;
    white-space: normal;
    line-height: 1.35;
    min-width: 140px;
    max-width: 200px;
}

#peExcludedItemsDrawer .pe-excluded-warning {
    font-size: 10px;
    color: #b45309;
    margin-top: 3px;
    line-height: 1.2;
}

#peExcludedItemsDrawer .pe-excluded-by {
    white-space: nowrap;
    font-size: 10px;
    color: var(--bs-secondary-color);
    min-width: 110px;
}

#peExcludedItemsDrawer .pe-excluded-restore-col {
    white-space: nowrap;
    width: 1%;
}

#peExcludedItemsDrawer .pe-excluded-type-badge {
    font-size: 0.65em;
}

/* Dark mode */
html[data-bs-theme="dark"] #peExcludedItemsDrawer.pe-excluded-drawer {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155 !important;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer__header,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer__toolbar,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer__footer {
    background: #0f172a;
    border-color: #334155 !important;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer__subtitle {
    color: #94a3b8;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer-close {
    background: #334155;
    border-color: #94a3b8;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-drawer-close:hover {
    background: #475569;
    border-color: #e2e8f0;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-items-table {
    --bs-table-bg: #0f172a;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: #334155;
    --bs-table-hover-bg: #1e293b;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-reason {
    color: #cbd5e1;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-warning {
    color: #f59e0b;
}

html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-meta,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-date,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-line-code,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-line-label,
html[data-bs-theme="dark"] #peExcludedItemsDrawer .pe-excluded-by {
    color: #94a3b8;
}
