/* Headings */
h2 {
    color: #34495e; /* Darker blue-grey */
    border-bottom: 1px solid #e0e0e0; /* Lighter border */
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: '\f0ce'; /* FontAwesome table icon */
    font-family: 'Font Awesome 5 Free'; /* Assuming FontAwesome is available */
    font-weight: 900;
    color: #007bff;
}

/* Toolbar for buttons */
.toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px; /* More space between buttons */
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 10px 20px; /* Larger buttons */
    border: none;
    border-radius: 6px; /* Slightly more rounded */
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: separate; /* For rounded corners on cells */
    border-spacing: 0;
    margin-top: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners are visible */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table th, .table td {
    border: 1px solid #e9ecef; /* Lighter border */
    padding: 12px 15px; /* More padding */
    text-align: left;
    vertical-align: middle;
}

.table thead th {
    background-color: #e9f0f8; /* Light blueish grey for header */
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa; /* Very light grey for even rows */
}

.table tbody tr:hover {
    background-color: #e2f0ff; /* Light blue on hover */
}

/* Specific column styling for financial data */
.table td:nth-child(7), /* 收入 */
.table td:nth-child(8), /* 支出 */
.table td:nth-child(10), /* 税金 */
.table td:nth-child(11), /* 管理费3% */
.table td:nth-child(12), /* 保证金2% */
.table td:nth-child(4) /* 账户余额 (for summary table) */
{
    text-align: left;
    font-weight: 500;
}

.cpn{
    color: #e67e22; /* Orange */
}

.table td:nth-child(7) { /* Income */
    color: #e67e22; /* Orange */
}

.table td:nth-child(8) { /* Expense */
    color: #e74c3c; /* Red */
}

.table td:nth-child(10) { /* Tax Amount */
    color: #e74c3c; /* Red */
}

.table td:nth-child(11) { /* Management Fee */
    color: #e74c3c; /* Red */
}

.table td:nth-child(12) { /* Guarantee Fee */
    color: #e74c3c; /* Red */
}

.table td:nth-child(4) { /* Account Balance */
    color: #e67e22; /* Orange */
}

/* Total row styling */
.table tbody tr:last-child {
    background-color: #dbe9f7; /* Slightly darker blueish grey for total */
    font-weight: 600;
    color: #34495e;
}

.table tbody tr:last-child td {
    border-top: 2px solid #cce0f0;
}

#statisticsTable tfoot tr {
    background-color: transparent !important;
}

/* Links in table for operations */
.table td a {
    margin-right: 8px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.table td a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Dropdown styles */
.table select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 8px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    -webkit-appearance: none; /* Remove default arrow */
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%20197.9l-131.3-131.3c-4.7-4.7-12.3-4.7-17%200L5.4%20197.9c-4.7%204.7-4.7%2012.3%200%2017l13.6%2013.6c4.7%204.7%2012.3%204.7%2017%200l100.7-100.7c4.7-4.7%2012.3-4.7%2017%200l100.7%20100.7c4.7%204.7%2012.3%204.7%2017%200l13.6-13.6c4.7-4.7%204.7-12.3%200-17z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 25px; /* Space for the custom arrow */
}

.table select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Input fields in table */
.table input[type="text"],
.table input[type="number"],
.table input[type="date"] {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* Styles for non-editable inputs and selects */
.table input[readonly],
.table select[disabled] {
    border: none;
    padding-left: 0;
    padding-right: 0;
    background-color: transparent;
}

.table input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Icon for table headers (e.g., sort) */
.table th .sort-icon {
    margin-left: 5px;
    color: #888;
}

/* Specific styling for the "操作" column */
.table td:last-child {
    white-space: nowrap; /* Prevent wrapping of action buttons */
}