:root {
    /* Light theme variables */
    --bg-color:rgb(133, 173, 199);
    --section-bg: rgb(170, 221, 255);
    --card-bg: rgb(190, 229, 255);
    --text-color: #333;
    --border-color: #333;
    --hover-color: lightgrey;
    --nav-bg: #333;
    --nav-text: white;
}

[data-theme="dark"] {
    --bg-color: rgb(44, 62, 80);
    --section-bg: rgb(52, 73, 94);
    --text-color: rgb(236, 240, 241);
    --border-color: rgb(189, 195, 199);
    --hover-color: rgb(44, 62, 80);
    --nav-bg: rgb(44, 62, 80);
    --nav-text: rgb(236, 240, 241);
}

/* Update existing styles to use CSS variables */
.nav {
    background-color: var(--nav-bg);
    position: relative;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav a {
    color: var(--nav-text);
    padding: 8px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    border-radius: 4px;
}
.nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.section {
    background: var(--section-bg);
}
.excel-table th, .excel-table td {
    border-color: var(--border-color);
}
.excel-table tr:hover {
    background-color: var(--hover-color);
}

/* Update dropdown menu styles */
.dropdown {
    float: right;
    position: relative;
    display: inline-block;
    z-index: 1000;
}
.username-link {
    float: right;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--nav-text);
    margin-right: 10px;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--section-bg);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1001;
    margin-top: -1px;
}
.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.dropdown-content a:hover {
    background-color: var(--hover-color);
}

/* Responsive styles */
@media (max-width: 768px) {
    .nav a {
        float: none;
        display: block;
        text-align: left;
    }
    .dropdown {
        float: none;
    }
    .dropdown-content {
        position: static;
    }
}

/* Add z-index to content div to keep it below dropdown */
.content {
    position: relative;
    z-index: 1;
}

/* Add card and common styles */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.section {
    padding: 2rem;
    /* max-width: 1200px; */
    margin: 0 auto;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;  /* White background for Excel look */
    table-layout: auto;  /* Let the browser calculate column widths */
}

.excel-table th {
    background-color: #f3f3f3;  /* Light gray header background */
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 50px;  /* Minimum width for columns */
}

.excel-table td {
    border: 1px solid #ddd;
    padding: 8px;
    background-color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 50px;  /* Minimum width for columns */
}

.excel-table tr:hover td {
    background-color: #f5f5f5;  /* Light hover effect */
}

/* Add horizontal scroll to table wrapper */
.excel-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* Cell type specific styles */
.excel-table td:first-child,
.excel-table th:first-child {
    /* width: 40px;   Fixed narrow width */
    width: min-content;
    min-width: 4px;
    max-width: 80px;
    padding: 4px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}


.excel-table .link-cell {
    text-align: left;
    white-space: nowrap;
}

.excel-table .link-cell-link {
    text-decoration: none;
    color: var(--text-color);
}

.excel-table .link-cell-link:hover {
    text-decoration: underline;
}

.excel-table .number-cell {
    text-align: right;
    white-space: nowrap;
}

.excel-table .date-cell {
    text-align: center;
    white-space: nowrap;
}

.excel-table .text-cell {
    text-align: left;
    white-space: nowrap;
}

/* Selected cell style */
.excel-table td.selected {
    background-color: #e3f2fd !important;  /* Light blue selection */
    outline: 2px solid #2196f3 !important;
    position: relative;
    z-index: 1;
}

/* Input field style */
.excel-table input {
    width: 100%;
    padding: 4px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    box-sizing: border-box;
}

/* Add hover effect for editable cells */
.excel-table td:not(:first-child):hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

.button {
    padding: 0.75rem 1rem;
    background-color: var(--nav-bg);
    color: var(--nav-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    opacity: 0.9;
}

/* Let all other columns expand naturally */
.excel-table td:not(:first-child),
.excel-table th:not(:first-child) {
    width: auto;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.account-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-color);
}

.balance-display {
    text-align: right;
}

.balance-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.balance-amount {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: transform 0.2s;
}

.detail-item:hover {
    transform: translateY(-2px);
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.transactions-header h3 {
    margin: 0;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    text-decoration: none;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pagination .active {
    background: var(--nav-bg);
    color: var(--nav-text);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Summary Cards */
.summary-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-card h4 {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.summary-card .amount {
    margin: 0.5rem 0 0 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Summary Section */
.summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.summary-item span {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Card Spacing */
.mt-4 {
    margin-top: 1.5rem;
}

/* Text Colors */
.text-muted {
    color: var(--text-muted);
}

/* Header Layouts */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-flex h2 {
    margin: 0;
}

/* Grid Layouts */
.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 1rem;
}
