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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Apple-like Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    height: 32px;
    width: 32px;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1d1d1f;
}

.nav-right {
    display: flex;
    gap: 24px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    background: rgba(0, 0, 0, 0.08);
}

.nav-icon {
    height: 20px;
    width: 20px;
}

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

.hero {
    text-align: center;
    background: white;
    padding: 60px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #1d1d1f;
    font-weight: 600;
}

.hero p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.login-btn, .logout-btn {
    background: #ff9900;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover, .logout-btn:hover {
    background: #e88b00;
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card h3 {
    font-size: 0.85rem;
    color: #86868b;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #232f3e;
}

.service {
    font-size: 1.2rem;
    color: #ff9900;
    font-weight: 500;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.date-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.toggle-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.toggle-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #ff9900;
}

.controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.refresh-btn {
    padding: 8px 16px;
    background: #ff9900;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: #e88b00;
}

.refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.refresh-btn.spinning .refresh-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.refresh-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.chart-title {
    font-size: 1.1rem;
    color: #1d1d1f;
    margin-bottom: 15px;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 350px;
}

@media (max-width: 768px) {
    .chart-container canvas {
        max-height: 400px;
    }
    
    .chart-container:first-child canvas {
        max-height: 500px;
    }
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1rem;
}

.loading-text {
    color: #999;
    font-size: 0.9rem;
    font-weight: normal;
}

.trend {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.trend.up {
    color: #d32f2f;
}

.trend.down {
    color: #388e3c;
}

.trend.neutral {
    color: #666;
}

@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-right {
        width: 100%;
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 40px 20px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
}

/* Settings Popup */
.settings-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.settings-popup.show {
    display: flex;
}

.settings-popup-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.settings-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1d1d1f;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.settings-body {
    padding: 24px;
}

.settings-item {
    margin-bottom: 20px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 500;
}

.settings-item p {
    font-size: 1.1rem;
    color: #1d1d1f;
    margin: 0;
}

.settings-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.logout-link {
    background: none;
    border: none;
    color: #ff3b30;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 500;
}

.logout-link:hover {
    background: rgba(255, 59, 48, 0.1);
}