* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: white;
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.logo span {
    font-size: 14px;
    font-weight: normal;
    color: #999;
    margin-left: 5px;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: #667eea;
    color: white;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-card .amount {
    font-size: 32px;
    font-weight: bold;
}

.income .amount { color: #28a745; }
.expense .amount { color: #dc3545; }
.balance .amount { color: #667eea; }

/* Summary Cards */
.summary-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.summary-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* Report Filter */
.report-filter {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filter-title {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.filter-group select, .filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-filter {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.quick-filters {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.quick-btn {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #5a67d8;
}

/* Tables */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

.income-badge {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.expense-badge {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.actions {
    display: flex;
    gap: 10px;
}

.actions a {
    text-decoration: none;
    color: #667eea;
}

.actions a:hover {
    text-decoration: underline;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.category-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-name {
    font-weight: 500;
    font-size: 14px;
}

.category-amount {
    font-weight: bold;
    color: #667eea;
}

/* Progress Bar */
.progress-container {
    background-color: #e0e0e0;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    padding: 8px 12px;
    text-align: right;
    border-radius: 10px;
    transition: width 0.3s ease;
    font-size: 12px;
    font-weight: bold;
}

/* Trend Indicators */
.trend-up { color: #dc3545; font-size: 12px; }
.trend-down { color: #28a745; font-size: 12px; }
.trend-positive { color: #28a745; }
.trend-negative { color: #dc3545; }

/* Alert Messages */
.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #721c24;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    margin-top: 30px;
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.currency-symbol {
    font-size: 14px;
    margin-right: 2px;
}

/* Report period badge */
.period-badge {
    background: #e7f3ff;
    color: #0066cc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    .nav-links {
        justify-content: center;
    }
    .stats-grid, .stats-grid-2 {
        grid-template-columns: 1fr;
    }
    .filter-form {
        flex-direction: column;
    }
    .filter-group {
        width: 100%;
    }
}

/* Additional styles for subcategories */
.detail-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    background: #e9ecef;
    color: #495057;
    margin: 2px;
}

.subcategory-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.info-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.category-with-sub {
    border-left: 3px solid #667eea;
    padding-left: 10px;
}

/* Child and teacher specific styles */
.child-tag {
    background: #d1ecf1;
    color: #0c5460;
}

.teacher-tag {
    background: #fff3cd;
    color: #856404;
}