/* Transaction log and actuals-vs-projected styles */

/* ── Transaction log table ── */
.txn-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.txn-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.txn-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
}

.txn-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.txn-th--amount,
.txn-cell--amount {
    text-align: right;
}

.txn-table tr:hover {
    background: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

.txn-amount--income {
    color: var(--green, #16a34a);
    font-weight: 500;
}

.txn-amount--expense {
    color: var(--red, #dc2626);
    font-weight: 500;
}

/* ── Add transaction form ── */
.txn-form {
    padding: 1rem;
    background: var(--surface-alt, var(--surface));
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.txn-form-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.txn-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
    gap: 0.75rem;
    align-items: end;
}

.txn-form-field--wide {
    grid-column: span 2;
}

.txn-form-field--action {
    display: flex;
    align-items: end;
}


.txn-form .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    display: block;
    margin-bottom: 0.25rem;
}

.txn-form .form-input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--fg);
}

/* ── Variance columns on P&L statement ── */
.stmt-actual {
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 5rem;
}

.stmt-variance {
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 5rem;
    font-weight: 500;
}

.stmt-variance--favorable {
    color: var(--green, #16a34a);
}

.stmt-variance--unfavorable {
    color: var(--red, #dc2626);
}

/* ── Month filter pills ── */
.txn-month-pills {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.txn-month-pill {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    transition: all 0.15s;
}

.txn-month-pill:hover {
    background: var(--surface-hover);
}

.txn-month-pill--active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ── Summary bar ── */
.txn-summary {
    display: flex;
    gap: 2rem;
    padding: 0.75rem 1rem;
    border-top: 2px solid var(--border);
    margin-top: 0.5rem;
}

.txn-summary-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-right: 0.5rem;
}

.txn-summary-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Empty state ── */
.txn-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.txn-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.txn-empty h2 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--fg);
}

.txn-empty p {
    font-size: 0.875rem;
    max-width: 30rem;
    margin: 0 auto;
}

/* ── Portfolio actuals summary ── */
.actuals-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}


.actuals-summary-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.actuals-summary-card__label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.actuals-summary-card__value {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Transaction actions ── */
.txn-actions {
    display: flex;
    gap: 0.25rem;
}

.txn-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    border-radius: 0.25rem;
}

.txn-actions button:hover {
    background: var(--surface-hover);
    color: var(--fg);
}

.txn-actions .txn-delete:hover {
    color: var(--red, #dc2626);
}
