/* Utility Classes */

/* Visibility */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* For table cells, use table-cell display when visible */
th.hidden,
td.hidden {
    display: none !important;
}

th:not(.hidden),
td:not(.hidden) {
    display: table-cell;
}

/* Visually hidden but still in DOM (e.g. file input triggered by button) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Custom Fields */
.custom-fields-container {
    margin-top: 0;
    margin-bottom: 0;
}

.custom-field-wrapper {
    margin-bottom: 0.375rem;
}

.custom-field-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: var(--space-1);
    align-items: center;
    margin-bottom: var(--space-1);
    will-change: auto; /* Hint browser about potential DOM changes */
    contain: layout; /* Isolate layout calculations */
}

.custom-field-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-muted);
}

.custom-field-value {
    font-size: var(--font-size-base);
}

/* Info Modal Content */
.info-section {
    margin-bottom: var(--spacing-lg);
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-xs);
}

.info-section p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.5;
    margin: var(--spacing-sm) 0;
}

.info-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

.info-list li {
    margin-bottom: var(--space-1);
}

.info-link {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.info-link:hover {
    text-decoration: underline;
}

.btn-donate-group {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.btn-donate {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: #e57373;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: background-color 0.15s, transform 0.15s;
}

.btn-donate:hover {
    background: #ef5350;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Saved Invoices List */
#savedInvoicesList {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.saved-invoice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s; /* Specific properties only */
}

.saved-invoice-item:hover {
    background: var(--bg-muted);
    border-color: var(--primary);
}

.saved-invoice-item.selected {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.saved-invoice-name {
    font-weight: 500;
    color: var(--text);
}

.saved-invoice-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Format Button */
.btn-format {
    font-size: var(--font-size-sm);
    padding: var(--space-3) var(--space-2);
}

/* Input with Format */
.input-with-format {
    display: flex;
    gap: var(--space-1);
    align-items: center;
}

.input-with-format input {
    flex: 1;
    min-width: 0;
}

