/* ============================================ */
/* ENHANCED HISTORY TABLE - SPREADSHEET STYLE */
/* ============================================ */

/* Table Base Styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
}

table th {
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 10;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Spreadsheet-like History Table */
#historyTable {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

#historyTable tbody tr {
    transition: all 0.2s ease;
    background: var(--card-bg);
}

#historyTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

#historyTable tbody tr:hover {
    background: var(--accent-glow);
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Type Indicator */
.type-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.type-indicator.entrada {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.type-indicator.despesa,
.type-indicator.saida {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.type-indicator svg,
.type-indicator i {
    width: 16px !important;
    height: 16px !important;
    color: inherit !important;
}

/* Sender Info */
.sender-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sender-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sender-name {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

/* DateTime */
.datetime-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-text {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.time-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Category Badge - Premium Green */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(35, 134, 54, 0.18);
    color: #3fb950;
    border: 1px solid rgba(35, 134, 54, 0.35);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Profile Badge - Green background, white text */
.profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(35, 134, 54, 0.15);
    color: #ffffff;
    border: 1px solid rgba(35, 134, 54, 0.3);
    white-space: nowrap;
}

/* Description */
.description-col {
    max-width: 300px;
}

.description-col strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Payment Icon */
.payment-icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: help;
}

.payment-icon:hover {
    color: var(--accent);
    transform: scale(1.3);
}