* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Login */
.login-card {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-card h1 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 30px;
}

.login-card h1 i {
    margin-right: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #e5e7eb;
    color: #333;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: #6b7280;
}

.btn-icon:hover {
    color: #2563eb;
}

.error-message {
    color: #dc2626;
    margin-top: 12px;
    text-align: center;
}

/* Header */
.app-header {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.header-content h2 {
    color: #2563eb;
}

.header-content h2 i {
    margin-right: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Navigation */
.app-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 8px 0;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 8px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    min-width: 60px;
}

.nav-btn i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-btn.active {
    background: #2563eb;
    color: white;
}

.nav-btn:hover:not(.active) {
    background: #f3f4f6;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card i {
    font-size: 28px;
    color: #2563eb;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px;
    margin-top: 16px;
}

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

th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
}

td {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
}

tr:hover {
    background: #f9fafb;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Messages */
#messages-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.message-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

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

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.message-item .message-body {
    font-size: 16px;
}

.message-item.unread {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}

/* Notification warning */
.notification-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 10px;
        min-width: 50px;
    }
    
    .nav-btn i {
        font-size: 16px;
    }
}

/* Utility */
.admin-only {
    display: none !important;
}

.hidden {
    display: none !important;
}

.message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.monthly-summary {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.monthly-summary h4 {
    margin-bottom: 12px;
}



/* Form container */
.form-container {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    border: 1px solid #e5e7eb;
}

.form-container h4 {
    margin-bottom: 16px;
    color: #1f2937;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.form-actions .btn {
    flex: 1;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-sm i {
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.recent-entries {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.recent-entries h4 {
    margin-bottom: 12px;
}

.message-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

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

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.message-item .message-body {
    font-size: 16px;
}

.message-item.unread {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}

.message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.notification-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .table-container {
        padding: 8px;
        font-size: 14px;
        overflow-x: auto;
    }
    
    .table-container th,
    .table-container td {
        padding: 8px;
        font-size: 12px;
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 10px;
        min-width: 44px;
    }
    
    .nav-btn i {
        font-size: 16px;
    }
    
    .nav-btn span {
        font-size: 9px;
    }
}