body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background: #fafafa;
    color: #333;
}

body:not(.login-page) {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007bff;
}

.header-subtitle {
    color: #666;
    font-size: 14px;
}

h1 {
    color: #333;
    margin: 0;
}

h2 {
    color: #555;
    margin-top: 30px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-wrap: wrap;
}

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.chart-controls input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.chart-controls input[type="range"] {
    width: 150px;
    cursor: pointer;
}

#frequencyValue {
    font-weight: bold;
    color: #007bff;
    min-width: 35px;
}

#chart {
    margin-top: 10px;
    min-height: 450px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

button {
    padding: 10px 20px;
    margin-right: 10px;
    font-size: 16px;
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background 0.3s;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        margin: 20px auto;
        padding: 0 15px;
    }

    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .chart-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #fafafa;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: system-ui, -apple-system, sans-serif;
}

.login-button:hover {
    background: #0056b3;
}

.login-button:active {
    background: #004494;
}

.error-message {
    color: #dc3545;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.success-message {
    color: #28a745;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.logout-link {
    display: inline-block;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-link:hover {
    background: #c82333;
}
