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

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

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #262730;
    padding: 40px;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-box h2 {
    margin-bottom: 30px;
    font-size: 1rem;
    color: #808495;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #808495;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #464b5e;
    border-radius: 5px;
    background: #0e1117;
    color: #fafafa;
    font-size: 1rem;
}

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

.btn-login {
    width: 100%;
    padding: 12px;
    background: #ff4b4b;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #ff6b6b;
}

.error-message {
    background: #ff4b4b33;
    border: 1px solid #ff4b4b;
    color: #ff4b4b;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #262730;
}

.header h1 {
    font-size: 1.8rem;
}

.header p {
    color: #808495;
    margin-top: 5px;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    color: #ff4b4b;
    border: 1px solid #ff4b4b;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ff4b4b;
    color: white;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #262730;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    color: #808495;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #fafafa;
    background: #262730;
}

.tab-btn.active {
    color: #fafafa;
    background: #262730;
    border-bottom: 2px solid #ff4b4b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: #262730;
    padding: 20px;
    border-radius: 8px;
}

.metric-label {
    color: #808495;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.chart-container {
    background: #262730;
    padding: 20px;
    border-radius: 8px;
}

.chart-container h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #262730;
    border-radius: 8px;
}

.toggle-container label {
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #464b5e;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #ff4b4b;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-caption {
    color: #808495;
    font-size: 0.85rem;
}

.data-table-container {
    background: #262730;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.data-table-container h3 {
    margin-bottom: 15px;
}

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

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #464b5e;
}

.data-table th {
    background: #1a1c24;
    color: #808495;
    font-weight: 600;
    cursor: pointer;
}

.data-table th:hover {
    color: #fafafa;
}

.data-table tr:hover {
    background: #1a1c24;
}

.search-container {
    background: #262730;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #464b5e;
    border-radius: 5px;
    background: #0e1117;
    color: #fafafa;
    font-size: 1rem;
    margin-bottom: 15px;
}

.search-input:focus {
    outline: none;
    border-color: #ff4b4b;
}

.slider-container {
    margin-bottom: 20px;
}

.slider-container label {
    display: block;
    margin-bottom: 8px;
    color: #808495;
}

.slider-container input[type="range"] {
    width: 100%;
    accent-color: #ff4b4b;
}

.slider-value {
    color: #fafafa;
    font-weight: bold;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #464b5e;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

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

.stats-table th,
.stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #464b5e;
}

.stats-table th {
    color: #808495;
    font-weight: normal;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #808495;
}

.loading-spinner {
    border: 4px solid #262730;
    border-top: 4px solid #ff4b4b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
