/* Page UX – layout, toolbar, compact tables, detail modals */

/* Page toolbar: primary action (Add X) + secondary (Manage types, Export, etc.) */
.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.page-toolbar .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Card header with toolbar */
.card-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Compact data table: essential columns only; extra data in detail modal */
.table-compact thead th {
    white-space: nowrap;
}

.table-compact .col-amount {
    text-align: right;
    white-space: nowrap;
}

.table-compact .col-actions {
    white-space: nowrap;
    width: 1%;
}

/* Detail modal: key-value pairs, readable */
.detail-modal .detail-grid {
    display: grid;
    gap: 0.75rem 1.5rem;
    grid-template-columns: minmax(140px, auto) 1fr;
    align-items: start;
}

.detail-modal .detail-label {
    font-weight: 600;
    color: var(--gray, #6c757d);
    font-size: 0.875rem;
}

.detail-modal .detail-value {
    word-break: break-word;
}

.detail-modal .detail-section {
    margin-bottom: 1.25rem;
}

.detail-modal .detail-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--light-gray, #e9ecef);
}

/* Action buttons in tables */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Filters: collapsible when used */
.filters-collapse .collapse-toggle {
    cursor: pointer;
    user-select: none;
}

/* Low-level “add” sections: in modals, not always on screen */
.add-form-modal .modal-body .form-floating,
.add-form-modal .modal-body .form-check {
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-modal .detail-grid {
        grid-template-columns: 1fr;
    }
}
