* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.page {
    width: 100%;
    min-height: 100vh;
}

.hidden {
    display: none;
}

/* Login and Registration Pages */
#login-page, #register-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5a6fd8;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
}

/* Dashboard Page */
header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.last-update-info {
    background: #e3f2fd;
    padding: 0.5rem 2rem;
    text-align: right;
    font-size: 0.9rem;
    color: #1976d2;
    border-bottom: 1px solid #ddd;
}

.last-update-info #last-update-timestamp {
    font-weight: bold;
}

header h1 {
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#logout-btn {
    width: auto;
    padding: 0.5rem 1rem;
    background: #e74c3c;
}

#logout-btn:hover {
    background: #c0392b;
}

.filters {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filters .form-group {
    margin-bottom: 0;
}

#apply-filters {
    width: auto;
    padding: 0.5rem 1rem;
    height: fit-content;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 0 2rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #333;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.report-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

canvas {
    width: 100% !important;
    height: 300px !important;
}

.success-message {
    color: #27ae60;
    text-align: center;
    margin-top: 1rem;
}

/* Info Icon */
.info-icon {
    cursor: pointer;
    font-size: 1rem;
    color: #667eea;
    margin-left: 0.5rem;
    position: relative;
    display: inline-block;
}

.info-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    white-space: pre-line;
    font-size: 0.875rem;
    width: max-content;
    max-width: 300px;
    z-index: 1000;
    text-align: left;
}

.info-icon:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
}

/* Responsive */
@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    #apply-filters {
        width: 100%;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1;
        text-align: center;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 1rem 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
}

.modal-actions button {
    width: auto;
    padding: 0.5rem 1rem;
}