/* Base styles */
* {
    box-sizing: border-box;
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

/* Table styles */
#transaction-table tr {
    border-bottom: 1px solid #e5e5e5;
}

#transaction-table tr:last-child {
    border-bottom: none;
}

#transaction-table tr:hover {
    background-color: #fafafa;
}

#transaction-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Amount colors */
.amount-positive {
    color: #22c55e;
}

.amount-negative {
    color: #171717;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    ring: 2px;
    ring-color: #171717;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d4d4d4;
    border-radius: 0.25rem;
    cursor: pointer;
    accent-color: #171717;
}

/* Row selection */
.row-selected {
    background-color: #f5f5f5 !important;
}

/* Summary section styles */
.summary-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

.summary-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.summary-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #171717;
    margin-bottom: 0.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.summary-item-label {
    color: #737373;
}

.summary-item-value {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e5e5e5;
}

/* Category item in modal */
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: #fafafa;
    border-radius: 0.375rem;
}

.category-item button {
    color: #a3a3a3;
    transition: color 0.15s;
}

.category-item button:hover {
    color: #ef4444;
}

/* History item */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: #fafafa;
    border-radius: 0.375rem;
}

.history-item-info {
    font-size: 0.875rem;
}

.history-item-date {
    font-weight: 500;
}

.history-item-message {
    color: #737373;
    font-size: 0.75rem;
}

/* Sync status */
.sync-saving {
    color: #f59e0b;
}

.sync-saved {
    color: #22c55e;
}

.sync-error {
    color: #ef4444;
}

/* Inline select for table */
.inline-select {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
    background-color: white;
    min-width: 80px;
}

.inline-select:focus {
    border-color: #171717;
}

/* Empty state */
#empty-state {
    display: none;
}

#transaction-table:empty + #empty-state {
    display: block;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #171717;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    z-index: 100;
    animation: slideIn 0.2s ease-out;
}

.toast-success {
    background-color: #22c55e;
}

.toast-error {
    background-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
