/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 30px;
}

header h1 {
    color: #1a365d;
    font-size: 28px;
    font-weight: 600;
}

h2 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #a0aec0;
    margin-bottom: 15px;
}

.upload-area p {
    color: #4a5568;
    font-size: 16px;
}

.upload-hint {
    color: #a0aec0 !important;
    font-size: 14px !important;
    margin-top: 5px;
}

.upload-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.upload-status.success {
    display: block;
    background-color: #c6f6d5;
    color: #276749;
}

.upload-status.error {
    display: block;
    background-color: #fed7d7;
    color: #c53030;
}

.upload-status.loading {
    display: block;
    background-color: #e9d8fd;
    color: #553c9a;
}

/* Statements List */
.statements-section {
    margin-bottom: 30px;
}

.statements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.statement-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.statement-card:hover {
    border-color: #4299e1;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.15);
}

.statement-card.active {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.statement-card .filename {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 5px;
}

.statement-card .meta {
    font-size: 13px;
    color: #718096;
}

/* Transactions Section */
.transactions-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.transactions-header h2 {
    color: #c53030;
    font-size: 20px;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.statement-info {
    font-size: 14px;
    color: #4a5568;
}

/* Transaction Groups */
.transaction-group {
    margin-bottom: 30px;
}

.group-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.group-header.credit-header {
    color: #2b6cb0;
}

.group-header.debit-header {
    color: #c53030;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Total row styling */
.total-row {
    background-color: #f7fafc;
    font-weight: 600;
}

.total-row td {
    padding: 12px 10px;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background-color: #edf2f7;
    color: #4a5568;
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

td {
    padding: 10px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

tr:hover {
    background-color: #f7fafc;
}

/* Amount styling */
.amount {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    text-align: right;
    white-space: nowrap;
}

.amount.debit {
    color: #c53030;
}

.amount.credit {
    color: #276749;
}

/* Description column */
.description {
    max-width: 300px;
    word-wrap: break-word;
}

/* Editable fields */
.editable-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.2s;
}

.editable-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.editable-input.saving {
    background-color: #fefcbf;
}

.editable-input.saved {
    background-color: #c6f6d5;
}

/* Category select */
.category-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.category-select:focus {
    outline: none;
    border-color: #4299e1;
}

/* Receipt checkbox */
.receipt-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Lookup button */
.lookup-btn {
    padding: 4px 10px;
    font-size: 12px;
    background-color: #4299e1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.lookup-btn:hover {
    background-color: #3182ce;
}

.lookup-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.company-info {
    max-width: 250px;
    font-size: 13px;
    color: #4a5568;
}

.company-info .summary {
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #edf2f7;
}

.btn-primary {
    background-color: #4299e1;
    color: #fff;
    border-color: #4299e1;
}

.btn-primary:hover {
    background-color: #3182ce;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 350px;
    max-width: 90%;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.modal-content input:focus {
    outline: none;
    border-color: #4299e1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .transactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    td, th {
        padding: 8px 6px;
    }
}
