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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box,
.register-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1,
.register-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Global Header */
.global-header {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.profile-name {
    font-weight: 600;
    font-size: 16px;
}

.separator {
    color: #7f8c8d;
}

.current-date,
.calendar-week {
    font-size: 14px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* Sidebar Navigation */
.sidebar {
    width: 20%;
    background: #34495e;
    color: white;
    padding: 20px 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 5px;
}

.sidebar a {
    display: block;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar a:hover {
    background: #2c3e50;
}

.sidebar a.active {
    background: #667eea;
    border-left: 4px solid #fff;
}

/* Content Area */
.content-area {
    width: 80%;
    padding: 30px;
    background: #f5f5f5;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.title-separator {
    height: 1px;
    background: #ddd;
    margin-bottom: 30px;
}

/* Widgets */
.widget-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.widget {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.widget.full-width {
    grid-column: 1 / -1;
}

.widget.half-width {
    grid-column: span 1;
}

.widget h2 {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.amount-display {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin: 15px 0;
}

.change-display {
    font-size: 16px;
    color: #27ae60;
}

.change-display.negative {
    color: #e74c3c;
}

/* Accounts List */
.accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.account-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.account-card h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
}

.account-balance {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.account-change {
    font-size: 14px;
    color: #27ae60;
    margin-top: 5px;
}

/* Forecast Grid */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.forecast-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.forecast-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.forecast-amount {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

/* List Container */
.list-container {
    max-height: 300px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

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

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-small {
    padding: 8px 15px;
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #bdc3c7;
}

.btn-small.active {
    background: #667eea;
    color: white;
}

/* Calendar */
.projected-balances {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.calendar-controls select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.calendar-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.calendar-header {
    font-weight: 600;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
}

.calendar-week {
    text-align: center;
    padding: 10px;
    background: #ecf0f1;
    font-size: 12px;
}

.calendar-day {
    border: 1px solid #ddd;
    padding: 10px;
    min-height: 80px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.current {
    background: #667eea;
    color: white;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
}

.day-info {
    font-size: 10px;
    line-height: 1.4;
}

.summary-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

/* Controls Bar */
.controls-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.controls-bar input[type="text"],
.controls-bar input[type="date"],
.controls-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Table Container */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f8f9fa;
}

.btn-action {
    padding: 5px 10px;
    margin: 0 2px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-action.delete {
    background: #e74c3c;
}

.btn-action:hover {
    opacity: 0.8;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: #ecf0f1;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.tab-btn:hover {
    background: #bdc3c7;
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-content.active {
    display: block;
}

/* Accounts Grid */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.account-tile {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.account-tile:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.account-tile h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.account-tile .balance {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .content-area {
        width: 100%;
    }
    
    .widget-container {
        grid-template-columns: 1fr;
    }
    
    .forecast-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .controls-bar {
        flex-direction: column;
    }
    
    .controls-bar input,
    .controls-bar select {
        width: 100%;
    }
}
