/* drillDownPanel.css — Slide-out transaction detail panel */

.drilldown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drilldown-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drilldown-panel {
    position: fixed;
    top: 0;
    right: -440px;
    width: 420px;
    height: 100vh;
    background: var(--liq-surface);
    border-left: 3px solid var(--liq-text);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    font-family: var(--liq-font-body);
}
.drilldown-panel.active {
    right: 0;
}

/* Header */
.drilldown-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--liq-border-light);
    background: var(--liq-bg);
}
.drilldown-header-text { flex: 1; min-width: 0; }
.drilldown-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--liq-text);
    line-height: 1.3;
    font-family: var(--liq-font-display);
}
.drilldown-meta {
    display: block;
    font-size: 12px;
    color: var(--liq-text-muted);
    margin-top: 4px;
}
.drilldown-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--liq-text-muted);
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.drilldown-close:hover { color: var(--liq-loss); }

/* Toolbar */
.drilldown-toolbar {
    display: flex;
    gap: 6px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--liq-border-light);
}
.drilldown-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--liq-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.drilldown-search:focus { border-color: var(--liq-accent); }
.drilldown-export-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--liq-bg);
    border: 1px solid var(--liq-border);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--liq-text);
    transition: background 0.15s;
}
.drilldown-export-btn:hover { background: var(--liq-border-light); }

/* Summary strip */
.drilldown-summary {
    display: flex;
    gap: 4px;
    padding: 7px 14px;
    background: var(--liq-bg);
    border-bottom: 1px solid var(--liq-border-light);
}
.drilldown-stat {
    flex: 1;
    text-align: center;
}
.drilldown-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--liq-text-muted);
    margin-bottom: 2px;
}
.drilldown-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--liq-text);
    font-family: var(--liq-font-mono);
}
.drilldown-stat-value.positive { color: var(--liq-profit); }
.drilldown-stat-value.negative { color: var(--liq-loss); }

/* Table */
.drilldown-table-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.drilldown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.drilldown-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.drilldown-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--liq-text-muted);
    background: var(--liq-bg);
    border-bottom: 2px solid var(--liq-border);
    user-select: none;
    white-space: nowrap;
}
.drilldown-table th.num { text-align: right; }
.drilldown-table th.sortable { cursor: pointer; }
.drilldown-table th.sortable:hover { color: #1a1a1a; }
.drilldown-table th.sort-asc::after { content: ' \25B2'; font-size: 9px; }
.drilldown-table th.sort-desc::after { content: ' \25BC'; font-size: 9px; }

.drilldown-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--liq-border-lighter);
    color: var(--liq-text);
}
.drilldown-table tr:hover td { background: var(--liq-accent-light); }

.dd-date {
    white-space: nowrap;
    font-family: var(--liq-font-mono);
    font-size: 11px;
    color: var(--liq-text-muted);
}
.dd-desc {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dd-num {
    text-align: right;
    font-family: var(--liq-font-mono);
    white-space: nowrap;
}
.dd-num.hl {
    font-weight: 700;
    color: var(--liq-accent);
}
.dd-running {
    color: var(--liq-text-muted);
    font-size: 11px;
}
.drilldown-empty {
    text-align: center;
    padding: 24px 14px !important;
    color: var(--liq-text-muted);
    font-style: italic;
}

/* Responsive */
@media (max-width: 500px) {
    .drilldown-panel {
        width: 100vw;
        right: -100vw;
    }
}

/* Clickable amount styling for modules that wire up drill-down */
.clickable-amount {
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}
.clickable-amount:hover {
    color: var(--liq-accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
