body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.screen {
    display: none;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding-top: 0;
}

.screen.active {
    display: block;
}

.account-card, .category-card, .transaction-card {
    padding: 15px;
    margin: 10px 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.account-card:hover, .category-card:hover, .transaction-card:hover {
    background-color: #f0f0f0;
}

.balance {
    float: right;
    font-weight: bold;
}

.drag-handle {
    cursor: grab;
    color: #999;
    font-size: 18px;
    user-select: none;
    padding: 0 4px;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-card {
    transition: background-color 0.2s, transform 0.1s;
}

.category-card.drag-over {
    border: 2px dashed #007bff;
    background-color: #e7f3ff;
    transform: scale(1.02);
}

.back-button {
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.category-selector {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
}
.action-group .category-selector {
    width: 1px;
}

.category-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.transaction-count {
    font-size: 0.8em;
    color: #888;
    margin-top: 3px;
}

.transaction-description {
    font-weight: bold;
    margin-bottom: 5px;
}

.transaction-date {
    font-size: 0.9em;
    color: #666;
}

.transaction-info {
    font-size: 0.8em;
    color: #888;
    margin-top: 3px;
}

.savings-category {
    border-left: 4px solid #4CAF50;
}

.expenses-category {
    border-left: 4px solid #f44336;
}

.account-overview {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.overview-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.overview-balances {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.total-balance, .unreserved-balance {
    font-size: 1.1em;
    font-weight: bold;
}

.unreserved-balance.negative {
    color: #f44336;
}

.unreserved-balance.positive {
    color: #4CAF50;
}

.monthly-summary {
    width: 100%;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin: 10px 0;
}

.monthly-item {
    padding: 5px 0;
    font-size: 1em;
}

.monthly-item.income {
    color: #4CAF50;
}

.monthly-item.expense {
    color: #f44336;
}

.monthly-item.net {
    font-weight: bold;
    font-size: 1.1em;
    border-top: 1px solid #ddd;
    margin-top: 5px;
    padding-top: 10px;
}

.monthly-item.net.positive {
    color: #4CAF50;
}

.monthly-item.net.negative {
    color: #f44336;
}

.refresh-icon {
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.3s ease;
}

.refresh-button:hover .refresh-icon {
    transform: rotate(180deg);
}

.refresh-button:disabled {
    color: #666;
    cursor: wait;
}

.refresh-button:disabled .refresh-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.categories-header {
    display: none;
}

.add-category-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.add-category-form {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.add-category-form.hidden {
    display: none;
}

.add-category-form input,
.add-category-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.form-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.form-buttons button:first-child {
    background-color: #4CAF50;
    color: white;
}

.form-buttons button:last-child {
    background-color: #f44336;
    color: white;
}

#savings-fields.hidden {
    display: none;
}

.transaction-actions {
    margin-top: 10px;
}

.action-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.find-similar-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.find-similar-button:hover {
    background-color: #0056b3;
}

.dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.dialog-scrollable-content {
    overflow-y: auto;
    max-height: calc(80vh - 100px);
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    background-color: white;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
}

.similar-transactions-list {
    margin: 20px 0;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.transaction-item .transaction-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-item .amount {
    font-weight: bold;
}

.transaction-item .amount.positive {
    color: #4CAF50;
}

.transaction-item .amount.negative {
    color: #f44336;
}

.transaction-item .date {
    color: #666;
    font-size: 0.9em;
}

.dialog-actions select {
    flex: 1;
}

.dialog-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.dialog-actions button:first-of-type {
    background-color: #4CAF50;
    color: white;
}

.dialog-actions button:last-of-type {
    background-color: #f44336;
    color: white;
}

.transaction-group {
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.transaction-group h4 {
    margin: 0 0 10px 0;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-group .transaction-item:last-child {
    border-bottom: none;
}

.select-all {
    float: right;
    font-size: 0.9em;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.select-all input {
    margin: 0;
}

.transaction-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-category {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.transaction-details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.transaction-item {
    padding: 12px 10px;
}

.dialog-filters {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: white;
}

.filter-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.filter-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.amount-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.amount-filter input[type="checkbox"] {
    margin: 0;
}

.move-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.balance-dialog {
    max-width: 400px;
}

.balance-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.balance-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.currency {
    font-size: 16px;
    color: #666;
}

.category-header {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.category-header.savings-category {
    border-left: 4px solid #4CAF50;
}

.category-header.expenses-category {
    border-left: 4px solid #f44336;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.category-title h2 {
    margin: 0;
}

.category-type {
    font-size: 0.9em;
    color: #666;
    padding: 4px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.category-balance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.balance-info, .budget-info, .reset-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.label {
    font-size: 0.9em;
    color: #666;
}

.amount {
    font-size: 1.2em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.amount.positive {
    color: #4CAF50;
}

.amount.negative {
    color: #f44336;
}

.date {
    font-size: 1.1em;
}

.balance-actions {
    display: flex;
    align-items: flex-end;
    margin-top: 10px;
}

.reset-balance-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.reset-balance-button:hover {
    background-color: #45a049;
}

.category-statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.chart-container {
    grid-column: 1 / -1;
    margin-top: 20px;
    min-width: 600px;
    margin-left: auto;
}

.chart-container h4 {
    margin-bottom: 10px;
    color: #666;
}

.bar-chart {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    height: 150px;
    gap: 8px;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.bar-item {
    flex: 0 0 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 30px;
    background-color: #4CAF50;
    transition: height 0.3s ease;
}

.bar.negative {
    background-color: #f44336;
}

.bar-label {
    font-size: 0.8em;
    color: #666;
}

.bar-value {
    font-size: 0.8em;
    color: #666;
    transform: rotate(-45deg);
    transform-origin: right top;
    white-space: nowrap;
}

.uncategorized-category {
    border-left: 4px solid #9e9e9e;  /* Grey color for uncategorized */
}

.uncategorized-stats {
    display: flex;
    gap: 30px;
    margin-top: 10px;
}

.uncategorized-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.uncategorized-stats .stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* Updated styles for the login form */
#login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#login-form input,
#login-form button {
    width: 100%;
    box-sizing: border-box;  /* This ensures padding is included in width calculation */
    padding: 10px;
    border-radius: 5px;
}

#login-form input {
    border: 1px solid #ddd;
}

#login-form button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

#login-form button:hover {
    background-color: #45a049;
}

.hidden {
    display: none !important;
}

#login-screen {
    display: block !important;  /* Override the .screen display:none */
}

#login-screen.hidden {
    display: none !important;
}

.category-menu {
    position: static;
    top: auto;
    right: auto;
}

.category-menu {
    position: relative;
}

.menu-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
}

.menu-button:hover {
    color: #333;
}

.menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
    min-width: 150px;
    white-space: nowrap;
}

.menu-dropdown.show {
    display: block;
}

.menu-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.menu-dropdown button:hover {
    background-color: #f5f5f5;
}

.menu-dropdown button.delete {
    color: #dc3545;
}

.menu-dropdown button.delete:hover {
    background-color: #ffebee;
}

.topbar {
    position: sticky;
    top: 0;
    background-color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
    margin: -20px -20px 20px -20px;
    z-index: 100;
}

.topbar h2 {
    margin: 0;
    flex: 1;
}

.back-button {
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #007bff;
}

.back-arrow {
    font-size: 24px;
    line-height: 1;
}

.menu-button {
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px;
    color: #666;
    cursor: pointer;
}

.menu-button:hover {
    color: #333;
}

.menu-dropdown {
    right: 0;
    top: 100%;
}

.category-type-label {
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: normal;
    vertical-align: middle;
}

.category-type-label.savings {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.category-type-label.expenses {
    background-color: #ffebee;
    color: #c62828;
}

.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    transition: all 0.3s;
}

.fab:hover {
    background-color: #45a049;
    box-shadow: 0 6px 12px rgba(0,0,0,0.16), 0 6px 12px rgba(0,0,0,0.23);
    transform: scale(1.05);
}

.settings-button {
    background: none;
    border: none;
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    color: #666;
}

.settings-button:hover {
    color: #333;
}

.dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
    max-width: 500px;
}

.settings-section {
    margin: 20px 0;
}

.settings-section h4 {
    margin-bottom: 15px;
    color: #666;
}

#change-password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#change-password-form input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-buttons button[type="submit"] {
    background-color: #4CAF50;
    color: white;
}

.form-buttons button[type="button"] {
    background-color: #f5f5f5;
    color: #666;
}

.password-requirements {
    font-size: 0.9em;
    color: #666;
    margin: 10px 0;
}

.password-requirements ul {
    margin: 5px 0;
    padding-left: 20px;
}

.password-requirements li {
    margin: 3px 0;
}

.logout-button {
    width: 100%;
    padding: 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.logout-button:hover {
    background-color: #c82333;
}

.split-entries {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.split-entry {
    display: flex;
    gap: 10px;
    align-items: center;
}

.split-entry input {
    width: 120px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.split-entry select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.split-entry button {
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: #dc3545;
    color: white;
    cursor: pointer;
}

.split-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.split-remaining.negative {
    color: #dc3545;
}

.split-remaining.positive {
    color: #28a745;
}

.splits-info {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.splits-header {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.split-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.split-category {
    color: #333;
}

.split-amount {
    font-weight: bold;
}

.split-amount.positive {
    color: #28a745;
}

.split-amount.negative {
    color: #dc3545;
}

.split-button {
    padding: 8px 16px;
    background-color: #4CAF50;  /* Match the app's primary green */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.split-button:hover {
    background-color: #45a049;
}

.split-button.edit {
    background-color: #007bff;  /* Blue for edit */
}

.split-button.edit:hover {
    background-color: #0056b3;
}

.cancel-split {
    background-color: #dc3545 !important;
    color: white !important;
}

.cancel-split:hover {
    background-color: #c82333 !important;
}

.collect-amount-section {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.collect-amount-section select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.collect-amount {
    background-color: #007bff !important;
    color: white !important;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.collect-amount:hover {
    background-color: #0056b3 !important;
}

.transactions-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

#transactions-list {
    position: relative;
    min-height: 200px;  /* Ensure there's always some height */
    transition: min-height 0.3s ease;  /* Smooth height changes */
}

/* Category Header Styles */
.category-header {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--surface-2);
}

.uncategorized-category .uncategorized-stats,
.savings-category .category-balance,
.expenses-category .category-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    flex: 1;
    min-width: 200px;
}

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

.stat-item .amount,
.stat-item .stat-value {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Monthly Chart Styles */
.monthly-chart {
    position: relative;
    margin-top: 20px;
    width: 100%;
}

.monthly-chart h4 {
    margin-bottom: 10px;
    color: #666;
    position: sticky;
    left: 0;
    background: white;
    padding-bottom: 5px;
}

.chart-scroll-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 30px;
}

.chart-container {
    grid-column: 1 / -1;
    min-width: 600px;
    margin-left: auto;
}

.bar-chart {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    height: 150px;
    gap: 8px;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.bar-item {
    flex: 0 0 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar {
    width: 30px;
    background-color: #4CAF50;
    transition: height 0.3s ease;
}

.bar.negative {
    background-color: #f44336;
}

.bar-label {
    font-size: 0.8em;
    color: #666;
}

.bar-value {
    font-size: 0.8em;
    color: #666;
    transform: rotate(-45deg);
    transform-origin: right top;
    white-space: nowrap;
}

.cert-install {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cert-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.cert-button:hover {
    background-color: #e0e0e0;
}

.settings-link {
    background-color: #007AFF;
    color: white;
}

.settings-link:hover {
    background-color: #0056b3;
}

/* Platform specific display */
.ios-only {
    display: none;
}

.android-only {
    display: none;
}

.cert-instructions {
    text-align: left;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 10px;
}

/* Add Bank Screen */
.bank-step {
    padding: 20px;
}

.bank-step.hidden {
    display: none;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
}

.country-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.country-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.country-button img {
    width: 60px;
    height: 40px;
    margin-bottom: 10px;
}

.banks-list {
    padding: 15px;
}

.bank-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bank-logo {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    object-fit: contain;
}

.bank-info h4 {
    margin: 0 0 5px 0;
}

.bank-info small {
    color: #666;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    color: #d32f2f;
    text-align: center;
    padding: 20px;
}

.topbar-buttons {
    display: flex;
    gap: 8px;  /* Space between buttons */
    align-items: center;  /* Vertically center the buttons */
}

.rename-button, .refresh-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rename-icon {
    font-size: 24px;
    line-height: 1;
}

.monthly-chart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
}

.account-card {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.account-card:hover {
    transform: translateY(-2px);
}

.account-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.account-balances {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.total-balance, .unreserved-balance {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.8em;
    color: #666;
}

.balance {
    font-weight: 500;
}

.uncategorized-warning {
    font-size: 0.9em;
    color: #e74c3c;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.account-warning {
    font-size: 0.85em;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.reconnect-bank-btn {
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.reconnect-bank-btn:hover {
    background-color: #d35400;
}

.suggestion-container {
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.suggestion-loading {
    color: #666;
    font-style: italic;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-label {
    color: #666;
    font-size: 0.9em;
}

.accept-suggestion {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    background-color: #e9ecef;
    color: #333;
    transition: background-color 0.2s;
}

.accept-suggestion:hover {
    background-color: #dee2e6;
}

.confidence-indicator {
    font-size: 0.8em;
    letter-spacing: -1px;
}

.suggestion.high .confidence-indicator {
    color: #28a745;
}

.suggestion.medium .confidence-indicator {
    color: #ffc107;
}

.suggestion.low .confidence-indicator {
    color: #dc3545;
}

.suggestion.none {
    color: #666;
    font-style: italic;
}

.suggestion.error {
    color: #dc3545;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.filter-group {
    display: flex;
    flex: 1 1 250px;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.filter-input,
.confidence-filter,
.sort-select,
.sort-direction-button {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.filter-input {
    flex: 1;
    min-width: 0;
}

.sort-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.sort-select {
    min-width: 120px;
}

.sort-direction-button {
    width: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sort-direction-button:hover {
    background-color: #f0f0f0;
}

.confidence-filter {
    min-width: 140px;
}

@media (max-width: 600px) {
    .filter-bar {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group,
    .sort-group {
        flex: 1 1 auto;
        width: 100%;
    }

    .sort-select {
        flex: 1;
    }
}

.filter-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

/* Add these animation-related styles */
.transaction-card {
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease;
    transform-origin: top;
}

.transaction-card.moving {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.transaction-card.collapsing {
    height: 0 !important;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Ensure smooth height transitions */
#transactions-list {
    position: relative;
    min-height: 200px;
    transition: min-height 0.3s ease;
}

/* Animation for new transactions being added */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transaction-card.new {
    animation: slideIn 0.3s ease forwards;
}

.transaction-item {
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease;
    transform-origin: top;
    cursor: pointer;
    user-select: none;
    padding: 12px 10px;
}

.transaction-item:hover {
    background-color: #f5f5f5;
}

.transaction-item:active {
    background-color: #e8e8e8;
}

/* Add a touch-friendly tap state */
@media (hover: none) {
    .transaction-item:active {
        background-color: #e0e0e0;
    }
}

/* Ensure the checkbox stays clickable separately if needed */
.transaction-item input[type="checkbox"] {
    z-index: 2;
}

/* Style the select-all control to match */
.select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    user-select: none;
}

.select-all:hover {
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* Ensure the dialog content maintains its height during animations */
.dialog-scrollable-content {
    min-height: 200px;
    transition: min-height 0.3s ease;
}

.no-results {
    padding: 40px 20px;
    text-align: center;
}

.no-results-message {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-results-message span {
    color: #666;
    font-size: 1.1em;
}

.clear-filters-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.clear-filters-button:hover {
    background-color: #45a049;
}

/* Split dialog styles */
.split-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.split-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.split-actions button:hover {
    background-color: #45a049;
}

.form-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.collect-amount-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.collect-amount-section select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.collect-amount {
    white-space: nowrap;
}

/* Style for the "Add Split" button specifically */
.split-actions button:first-child {
    align-self: flex-start;
    background-color: #2196F3;
}

.split-actions button:first-child:hover {
    background-color: #1976D2;
}

.all-category {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.category-card.all-category {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #6c757d;
}

.all-transactions-stats {
    display: flex;
    gap: 20px;
    padding: 16px;
}

.transaction-category {
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

.transaction-category .category-label {
    font-weight: 500;
    margin-right: 4px;
}

.transaction-category .category-name {
    color: #2196F3;
}

/* Make the transaction card a bit taller in All view to accommodate the extra info */
.all-category .transaction-card {
    min-height: 85px;
}

.recurring-expenses-category {
    border-left: 4px solid #FF9800;  /* Different color to distinguish from regular expenses */
}

.category-card.recurring-expenses-category {
    border-left: 4px solid #FF9800;
}

.auto-calculated {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.recurring-expenses-category .category-details {
    background-color: rgba(255, 152, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Make the recurring expenses card stand out a bit */
.category-card.recurring-expenses-category:hover {
    background-color: rgba(255, 152, 0, 0.1);
}

.bar-group {
    display: flex;
    position: relative;
    align-items: center;
    height: 150px;
}

.bar {
    width: 30px;
    transition: height 0.3s ease;
    position: absolute;
}

.bar.actual {
    background-color: #4CAF50;
    z-index: 2;
}

.bar.expected {
    background-color: #FF9800;
    opacity: 0.5;
    z-index: 1;
}

.bar.actual.negative {
    background-color: #f44336;
}

.bar-values {
    display: flex;
    flex-direction: column;
    font-size: 0.8em;
    gap: 2px;
}

.bar-value.actual {
    color: #2196F3;
}

.bar-value.expected {
    color: #FF9800;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.actual {
    background-color: #2196F3;
}

.legend-color.expected {
    background-color: #FF9800;
    opacity: 0.7;
}

.category-statistics .small-text {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
    margin-top: 2px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.stat-item .label {
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.stat-item .amount {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.app-description {
    text-align: center;
    color: #666;
    margin: 20px auto;
    max-width: 400px;
    line-height: 1.5;
    font-size: 0.9em;
    padding: 0 20px;
}

.login-container h2 {
    color: #2196F3;
    font-size: 2em;
    margin-bottom: 10px;
}

.motd-message {
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    line-height: 1.5;
}

.motd-message.warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffe0b2;
}

.motd-message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.motd-message.error {
    background-color: #fbe9e7;
    color: #d32f2f;
    border: 1px solid #ffccbc;
}

/* Expense Table Styles */
.expense-table-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.expense-table-content {
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.expense-table-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.table-container {
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.expense-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    min-width: 600px;
}

.expense-table thead {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.expense-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.expense-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.expense-table .expense-name-col {
    min-width: 200px;
    max-width: 300px;
    position: sticky;
    left: 0;
    background-color: #f5f5f5;
    z-index: 11;
}

.expense-table .expense-name {
    font-weight: 500;
    text-transform: capitalize;
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
}

.expense-table .month-col {
    text-align: right;
    min-width: 80px;
}

.expense-table .expense-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.expense-table tbody tr:hover {
    background-color: #f9f9f9;
}

.expense-table tbody tr:hover .expense-name {
    background-color: #f9f9f9;
}

.expense-table .total-row {
    font-weight: bold;
    background-color: #f0f0f0;
    border-top: 2px solid #999;
}

.expense-table .total-row .expense-name {
    background-color: #f0f0f0;
}

.expense-table .total-row:hover,
.expense-table .total-row:hover .expense-name {
    background-color: #e8e8e8;
}

.table-view-btn {
    padding: 6px 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s;
}

.table-view-btn:hover {
    background-color: #1976D2;
}

/* Group management controls - new simplified version */
.group-controls-new {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    align-items: center;
}

.group-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.group-controls-new button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.group-controls-new button:hover {
    background-color: #45a049;
}

/* Clickable cells for fake transactions */
.expense-amount.empty-cell {
    cursor: pointer;
    background-color: #fafafa;
}

.expense-amount.empty-cell:hover {
    background-color: #e3f2fd;
}

.expense-amount.has-fake {
    cursor: pointer;
    background-color: #fff3e0;
    position: relative;
}

.expense-amount.has-fake:hover {
    background-color: #ffe0b2;
}

.fake-indicator {
    color: #ff9800;
    font-weight: bold;
    margin-left: 3px;
    font-size: 1.2em;
}

.pattern-count {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

/* Yearly sum column */
.expense-table .yearly-sum-col,
.expense-table .yearly-sum-cell {
    background-color: #e8f4fd;
    border-left: 2px solid #90caf9;
    border-right: 2px solid #90caf9;
    font-style: italic;
}

.expense-table .total-row .yearly-sum-cell {
    background-color: #bbdefb;
}

/* Unpaid expense from last year — shown in red as a reminder */
.expense-amount.unpaid-last-year {
    color: #d32f2f;
    font-weight: 600;
    cursor: pointer;
    background-color: #ffebee;
}

.expense-amount.unpaid-last-year:hover {
    background-color: #ffcdd2;
}

/* Mobile responsive styles for expense table */
@media (max-width: 768px) {
    .expense-table-dialog {
        padding: 10px;
    }
    
    .expense-table-content {
        padding: 15px;
        max-width: 100%;
    }
    
    .expense-table {
        font-size: 0.75em;
        min-width: 500px;
    }
    
    .expense-table th,
    .expense-table td {
        padding: 8px 6px;
    }
    
    .expense-table .expense-name-col {
        min-width: 150px;
    }
    
    .expense-table .month-col {
        min-width: 60px;
    }
}

/* Monthly Category Overview */
.overview-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.overview-month-label {
    font-weight: bold;
    text-align: center;
    flex: 1;
}

.overview-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.type-filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.overview-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 55vh;
    overflow-y: auto;
    margin-bottom: 16px;
}

.overview-row {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    align-items: center;
    gap: 8px;
}

.overview-label {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.type-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.overview-bar-container {
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.overview-bar {
    height: 100%;
    background: #4a90e2;
    border-radius: 4px;
}

.overview-amount {
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}
