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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
}

.subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 2px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meta-text {
    font-size: 0.8rem;
    color: #94a3b8;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { background: #475569; cursor: not-allowed; }

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}
.status-card:hover { border-color: #475569; }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
}
.status-dot.ok { background: #22c55e; box-shadow: 0 0 6px #22c55e80; }
.status-dot.warning { background: #f59e0b; box-shadow: 0 0 6px #f59e0b80; }
.status-dot.critical { background: #ef4444; box-shadow: 0 0 6px #ef444480; animation: pulse-red 1.5s infinite; }
.status-dot.unknown { background: #475569; }

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.card-url {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.6rem;
}

.card-status {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Recommendations */
.recommendations-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.recommendations-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: #475569;
    color: #cbd5e1;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.has-items { background: #f59e0b; color: #1e293b; }
.badge.has-critical { background: #ef4444; color: white; }

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rec-empty {
    color: #64748b;
    font-size: 0.85rem;
    font-style: italic;
}

.rec-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #0f172a;
    border-left: 3px solid #475569;
}
.rec-item.critical { border-left-color: #ef4444; }
.rec-item.warning { border-left-color: #f59e0b; }
.rec-item.info { border-left-color: #3b82f6; }
.rec-item.resolved { opacity: 0.4; }

.rec-icon {
    flex-shrink: 0;
    font-weight: 700;
    width: 20px;
    text-align: center;
}
.rec-icon.critical { color: #ef4444; }
.rec-icon.warning { color: #f59e0b; }
.rec-icon.info { color: #3b82f6; }

.rec-content { flex: 1; }
.rec-title { font-weight: 600; color: #e2e8f0; }
.rec-desc { color: #94a3b8; font-size: 0.8rem; margin-top: 2px; }
.rec-meta { color: #64748b; font-size: 0.7rem; margin-top: 3px; }

.rec-dismiss {
    background: none;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}
.rec-dismiss:hover { border-color: #64748b; color: #e2e8f0; }

/* Detail Panels */
.detail-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
}

.detail-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.railway-link {
    font-size: 0.65rem;
    color: #64748b;
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 500;
}
.railway-link:hover { color: #94a3b8; text-decoration: none; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: #0f172a;
    border-radius: 4px;
    font-size: 0.8rem;
}

.detail-label {
    color: #94a3b8;
}

.detail-value {
    font-weight: 600;
    color: #e2e8f0;
}
.detail-value.ok { color: #22c55e; }
.detail-value.warning { color: #f59e0b; }
.detail-value.critical { color: #ef4444; }

.detail-loading {
    color: #64748b;
    font-size: 0.85rem;
    font-style: italic;
    grid-column: 1 / -1;
}

/* Sparklines */
.sparkline-container {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sparkline-label {
    font-size: 0.75rem;
    color: #64748b;
    min-width: 100px;
}

canvas {
    display: block;
}

/* Response Times */
.response-times-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.response-times-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: #475569;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    .status-cards {
        grid-template-columns: 1fr;
    }
    main {
        padding: 1rem;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
