/* ============================================================================
   Budget Changelog Styles - Collapsible audit history section
   ============================================================================ */

.budget-changelog {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--white);
    overflow: hidden;
    width: 100%; /* Match other sections in budget layout */
}

/* Header */
.budget-changelog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-light);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.budget-changelog__header:hover {
    background: var(--bg-hover);
}

.budget-changelog__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.budget-changelog__chevron {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.budget-changelog__icon {
    font-size: 14px;
    color: var(--text-secondary);
}

.budget-changelog__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.budget-changelog__refresh {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.budget-changelog__refresh:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.budget-changelog__refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Collapsed State */
.budget-changelog--collapsed .budget-changelog__content {
    display: none;
}

.budget-changelog:not(.budget-changelog--collapsed) .budget-changelog__chevron {
    transform: rotate(90deg);
}

/* Content */
.budget-changelog__content {
    border-top: 1px solid var(--border-color);
    max-height: 300px;
    overflow: auto;
}

/* Table */
.budget-changelog__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.budget-changelog__thead {
    position: sticky;
    top: 0;
    background: var(--bg-light);
    z-index: 1;
}

.budget-changelog__th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Column widths */
.budget-changelog__th--date { width: 80px; }
.budget-changelog__th--time { width: 60px; }
.budget-changelog__th--user { width: 120px; }
.budget-changelog__th--action { width: 100px; }
.budget-changelog__th--notes { flex: 1; min-width: 150px; }

/* Table Body */
.budget-changelog__tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s ease;
}

.budget-changelog__tr:hover {
    background: var(--bg-hover);
}

.budget-changelog__tr:last-child {
    border-bottom: none;
}

/* Row colors by action type */
.budget-changelog__tr--prepared {
    background: rgba(var(--primary-rgb), 0.02);
}

.budget-changelog__tr--reviewed {
    background: rgba(var(--teal-rgb, 0, 128, 128), 0.02);
}

.budget-changelog__tr--signed_off {
    background: rgba(var(--success-rgb), 0.02);
}

.budget-changelog__tr--unlocked {
    background: rgba(var(--warning-rgb), 0.02);
}

.budget-changelog__tr--modified {
    background: transparent;
}

/* Table Cells */
.budget-changelog__td {
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 12px;
    vertical-align: middle;
}

.budget-changelog__td--notes {
    color: var(--text-secondary);
    font-style: italic;
}

/* Action badges */
.budget-changelog__action {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.budget-changelog__action--prepared {
    background: var(--primary-color);
    color: var(--white);
}

.budget-changelog__action--modified {
    background: var(--text-secondary);
    color: var(--white);
}

.budget-changelog__action--reviewed {
    background: var(--color-teal, #20c997);
    color: var(--white);
}

.budget-changelog__action--signed_off {
    background: var(--success-color);
    color: var(--white);
}

.budget-changelog__action--unlocked {
    background: var(--warning-color);
    color: var(--white);
}

/* Loading State */
.budget-changelog__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    gap: 8px;
    font-size: 12px;
}

.budget-changelog__loading i {
    font-size: 16px;
    color: var(--primary-color);
}

/* Empty State */
.budget-changelog__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    gap: 8px;
    font-size: 12px;
}

.budget-changelog__empty i {
    font-size: 20px;
    opacity: 0.5;
}

/* Error State */
.budget-changelog__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--danger-color);
    gap: 8px;
    font-size: 12px;
}

.budget-changelog__error i {
    font-size: 20px;
}

.budget-changelog__retry {
    margin-top: 4px;
    padding: 4px 12px;
    background: var(--white);
    border: 1px solid var(--danger-color);
    border-radius: 4px;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s ease;
}

.budget-changelog__retry:hover {
    background: var(--danger-color);
    color: var(--white);
}

/* Custom scrollbar */
.budget-changelog__content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.budget-changelog__content::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.budget-changelog__content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.budget-changelog__content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
