* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Container & Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #34495e;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px;
    display: block;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar ul li a:hover {
    background: #34495e;
}

.user-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 10px;
    background: #34495e;
    border-radius: 5px;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.card .amount {
    font-size: 24px;
    font-weight: bold;
}

.card.income .amount { color: #27ae60; }
.card.expense .amount { color: #e74c3c; }
.card.balance .amount { color: #2980b9; }

/* Sections */
.section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th {
    background: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 500;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.table tr:hover {
    background: #f8f9fa;
}

.income { color: #27ae60; }
.expense { color: #e74c3c; }

/* Forms */
.form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-small {
    padding: 5px 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-delete {
    color: #e74c3c;
    text-decoration: none;
    font-size: 12px;
}

.btn-edit {
    color: #3498db;
    text-decoration: none;
    font-size: 12px;
    margin-right: 10px;
}

/* Login/Register Pages */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Progress Bars */
.progress-bar {
    background: #ecf0f1;
    border-radius: 10px;
    height: 20px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.progress-bar.large {
    height: 30px;
    margin: 15px 0;
}

.progress-bar .progress {
    background: #27ae60;
    height: 100%;
    transition: width 0.3s;
    position: absolute;
    left: 0;
    top: 0;
}

.progress-bar span {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Goal Cards */
.goal-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.goal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.contribution-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.contribution-history {
    margin-top: 15px;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 5px;
}

.contribution-history ul {
    list-style: none;
    margin-top: 10px;
}

.contribution-history li {
    padding: 5px;
    border-bottom: 1px solid #bdc3c7;
}

/* Note Cards */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #3498db;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.note-header h3 {
    color: #2c3e50;
    font-size: 16px;
}

.note-content {
    margin-bottom: 10px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

.note-footer {
    color: #7f8c8d;
    font-size: 12px;
    border-top: 1px solid #ecf0f1;
    padding-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin-top: 20px;
    }
}