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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f3f4f6;
    padding: 20px;
}

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

.header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.nav {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav {
    background: #e5e7eb;
    color: #374151;
}

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

.btn-nav:hover {
    transform: translateY(-2px);
}

.btn-view {
    background: #e5e7eb;
    color: #374151;
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

.btn-download {
    background: #059669;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-download:hover {
    background: #047857;
}

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

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

.date-input {
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    color: #1f2937;
    font-weight: 500;
}

.date-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.8);
    background: white;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.card h2 {
    font-size: 1.75rem;
    margin-bottom: 24px;
    color: #1f2937;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.stat-label {
    font-weight: 500;
    color: #374151;
}

.stat-value {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.1rem;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e5e7eb;
}

th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
}

td {
    color: #6b7280;
}

tr:nth-child(even) {
    background: #f9fafb;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.bg-blue {
    background: #dbeafe !important;
}

.view-content {
    display: none;
}

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

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #6b7280;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 8px;
}

.api-status-row {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 16px;
}

.status-badge {
    font: 500 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef0f2;
    color: #334155;
}

.status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.status-ok {
    background: #e8f7ee;
    color: #14532d;
}

.status-ok::before {
    background: #10b981;
}

.status-error {
    background: #fee2e2;
    color: #7f1d1d;
}

.status-error::before {
    background: #ef4444;
}

.status-checking {
    background: #f1f5f9;
    color: #475569;
}

.status-checking::before {
    background: #94a3b8;
}

@media print {
    .nav, .btn {
        display: none;
    }
}