:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    /* Keep for now, as it's not explicitly removed and might be used */
    --secondary-color: #ec4899;
    /* Keep for now, as it's not explicitly removed and might be used */
    --background-color: #0f172a;
    --surface-color: #1e293b;
    /* Keep for now, as it's not explicitly removed and might be used */
    --surface-hover: #334155;
    /* Keep for now, as it's not explicitly removed and might be used */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* New/Updated variables based on the instruction's intent */
    --card-background: var(--surface-color);
    /* Map to existing surface-color */
    --text-color: var(--text-primary);
    /* Map to existing text-primary */
    --border-color: #334155;
    /* New variable */
    --hover-color: var(--surface-hover);
    /* Map to existing surface-hover */
}

.light-theme {
    --primary-color: #4f46e5;
    --primary-hover: #3730a3;
    /* Adjusted for light theme */
    --secondary-color: #9333ea;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    /* Light theme surface */
    --surface-hover: #f1f5f9;
    /* Light theme surface hover */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --danger-color: #dc2626;
    --success-color: #16a34a;

    /* Mapped variables for light theme */
    --card-background: var(--surface-color);
    --text-color: var(--text-primary);
    --border-color: #e2e8f0;
    --hover-color: var(--surface-hover);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    width: 100%;
    overflow-x: hidden;
}

html {
    width: 100%;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

p {
    margin: 0;
    color: var(--text-secondary);
}

/* Layout - Full Width */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem;
    box-sizing: border-box;
}

/* Navigation */
nav {
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

nav a:hover {
    color: var(--text-primary);
    background-color: var(--hover-color);
}

nav a.active {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.nav-timer {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(99, 102, 241, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-timer-name {
    font-weight: 500;
    color: var(--primary-color);
}

.nav-timer-time {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    white-space: nowrap;
}

/* Dashboard - Full Width */
.dashboard {
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.dashboard-card {
    background-color: var(--surface-color);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 0;
    flex: 1;
    width: 100%;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.full-width {
    width: 100% !important;
    max-width: 100% !important;
}

.dashboard-card h2,
.dashboard-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Items List - Modern Card Style */
.habit-item,
.task-item,
.timer-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.habit-item:hover,
.task-item:hover,
.timer-list-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.habit-item.completed .habit-name,
.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.habit-name,
.task-name {
    flex: 1;
    font-weight: 500;
}

/* Forms & Inputs - Modern Style */
input[type="text"],
input[type="number"],
textarea,
select {
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: var(--hover-color);
}

input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
    border-color: var(--primary-color);
}

input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Buttons - Modern Style */
button {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

button.primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

button.primary:active {
    transform: translateY(0);
}

button.secondary {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

button.secondary:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

button.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

button.danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

button.icon-btn {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.icon-btn:hover {
    color: var(--text-primary);
    background-color: var(--hover-color);
    transform: scale(1.05);
}

button.icon-btn.danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Active Timer */
.active-timer {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.timer-display {
    margin-bottom: 1rem;
}

.timer-time {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Utilities - Modern Style */
.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading::before {
    content: "";
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    background-color: var(--surface-color);
    border: 1px dashed var(--border-color);
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Modal/Dialog - Modern Style */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Split View Layout - Stretched */
.split-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    width: 100%;
}

.split-layout>.list-container {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.split-layout>.detail-view {
    flex: 0 0 400px;
    max-width: 400px;
    min-width: 350px;
}

@media (max-width: 1024px) {
    .split-layout {
        flex-direction: column;
    }

    .split-layout>.detail-view {
        flex: 1 1 auto;
        max-width: 100%;
        position: relative;
        top: 0;
    }
}

/* List Container - Stretched */
.list-container {
    min-width: 0;
    width: 100%;
    overflow: hidden;
    flex: 1;
}

/* Detail View - Stretched */
.detail-view {
    background-color: var(--card-background);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 1rem;
    height: fit-content;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    flex-shrink: 0;
}

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

.detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.detail-row {
    margin-bottom: 1rem;
}

.label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.status-done {
    color: var(--success-color);
}

.status-pending {
    color: var(--text-secondary);
}

.mr-2 {
    margin-right: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pagination-button {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.pagination-button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-button.active:hover {
    background-color: var(--primary-hover);
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
}

.grid-item-row {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
}

/* Grid Layout for Full Pages - Modern Card Grid - Stretched */
.tasks-grid,
.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.tasks-grid .task-item,
.habits-grid .habit-item {
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.tasks-grid .task-item:hover,
.habits-grid .habit-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Overdue Section */
.overdue-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
}

.overdue-title {
    color: var(--danger-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.task-item.overdue,
.habit-item.overdue {
    border-left: 3px solid var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Streak Badge */
.streak-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Frequency Badge */
.frequency-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    text-transform: uppercase;
}

/* Task/Habit Info */
.task-info,
.habit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-note,
.habit-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

.task-content,
.habit-content {
    flex: 1;
    gap: 0.75rem;
}

/* Connection Indicator */
.connection-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1;
}

.connection-indicator.connected {
    color: var(--success-color);
}

.connection-indicator.connecting {
    color: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

.connection-indicator.disconnected {
    color: var(--text-secondary);
}

.connection-indicator.error {
    color: var(--danger-color);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Timer List Improvements */
.timer-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.timer-list-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timer-list-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

/* Gap utilities */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.align-center {
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* Finance Module - Modern Header with Tabs and Tools */
.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    gap: 1.5rem;
    flex-wrap: wrap;
}

.finance-tabs-container {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.finance-tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.finance-tab-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-color);
    border-color: var(--border-color);
}

.finance-tab-button.active {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
}

.tab-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.tab-label {
    font-weight: 500;
}

.finance-tools {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.tool-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-button:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.tool-label {
    font-weight: 500;
}

.tab-content {
    padding: 1rem 0;
    width: 100%;
}

/* Legacy tab-button for backward compatibility */
.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

/* Responsive Finance Header */
@media (max-width: 768px) {
    .finance-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .finance-tabs-container {
        width: 100%;
        overflow-x: auto;
    }
    
    .finance-tools {
        width: 100%;
        justify-content: flex-end;
    }
    
    .finance-tab-button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .tool-button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Accounts - Modern Card Style */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.account-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.account-item.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.account-info {
    flex: 1;
}

.account-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.account-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
    text-transform: capitalize;
}

.account-balance {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0 0 0;
}

/* Transactions - Modern Card Style */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.transaction-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.transaction-item .transaction-amount.income {
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.transaction-item .transaction-amount.expense {
    color: var(--danger-color);
    border-left-color: var(--danger-color);
}

.transaction-item .transaction-amount.transfer {
    color: var(--text-secondary);
    border-left-color: var(--text-secondary);
}

.transaction-info {
    flex: 1;
}

.transaction-description {
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.transaction-category {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.transaction-amount {
    font-size: 1.125rem;
    font-weight: 600;
    margin-right: 1rem;
}

/* Scheduled Transactions - Modern Card Style */
.scheduled-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scheduled-item {
    padding: 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.scheduled-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.scheduled-description {
    font-weight: 500;
    margin: 0 0 0.5rem 0;
}

.scheduled-amount {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.scheduled-frequency {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Budgets - Modern Card Grid */
.budgets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.budget-item {
    padding: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.budget-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.budget-item h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
}

.budget-category {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    text-transform: capitalize;
}

.budget-amount {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0;
}

.budget-period {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
}

.info {
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.tasks-grid .task-item .flex-row,
.habits-grid .habit-item .flex-row {
    width: 100%;
    justify-content: space-between;
    margin-top: auto;
}

/* Ensure list view remains column-based - Modern Style */
.tasks-list,
.habits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.tasks-list .task-item,
.habits-list .habit-item {
    margin-bottom: 0;
}

/* Login & Register Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background-color) 0%, #1e1b4b 100%);
    padding: 1rem;
}

.login-container {
    background-color: var(--surface-color);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.full-width {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.link {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Ensure inputs in form-group have consistent spacing */
.form-group input {
    margin-top: 0.25rem;
}

/* Improved Login Input Styling */
.login-container .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-container .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-container .form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.login-container .form-group input:hover {
    border-color: var(--primary-color);
}

/* Date Picker Button */
.date-picker-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.date-picker-button:hover {
    border-color: var(--primary-color);
    background-color: var(--hover-color);
}

.date-picker-button:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Date Picker Modal */
.date-picker-modal {
    max-width: 500px;
}

.date-picker-modal .date-input,
.date-picker-modal .time-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.date-picker-modal .date-input:focus,
.date-picker-modal .time-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* File Upload Section */
.file-upload-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.file-name {
    color: var(--success-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.import-textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: monospace;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.import-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.import-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Hidden file input */
.hidden-file-input {
    display: none;
}

/* Alert/Toast Notification System */
.alert-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    transition: all 0.2s ease;
    min-width: 300px;
    max-width: 400px;
}

.alert:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-lg);
}

.alert-icon {
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.alert-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.alert-close:hover {
    background-color: var(--hover-color);
    color: var(--text-primary);
}

/* Alert Types */
.alert-error {
    border-left: 4px solid var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.alert-error .alert-icon {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    border-left: 4px solid var(--success-color);
    background-color: rgba(34, 197, 94, 0.1);
}

.alert-success .alert-icon {
    color: var(--success-color);
    background-color: rgba(34, 197, 94, 0.2);
}

.alert-warning {
    border-left: 4px solid #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.alert-warning .alert-icon {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.alert-info .alert-icon {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.2);
}

/* Light Theme Alerts */
.light-theme .alert-error {
    background-color: rgba(239, 68, 68, 0.05);
}

.light-theme .alert-success {
    background-color: rgba(34, 197, 94, 0.05);
}

.light-theme .alert-warning {
    background-color: rgba(245, 158, 11, 0.05);
}

.light-theme .alert-info {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.alert.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .alert-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }
    
    .alert {
        min-width: auto;
        max-width: 100%;
    }
}