/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Responsive: 1 card per row on smaller screens */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr; 
    }
}

/* Card base */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

/* Header */
.card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #677486;
    text-transform: uppercase;
    text-align: left;
}
.card-header hr {
    margin: 8px 0 12px;
    border: 0;
    border-top: 1px solid #eee;
}

/* Body */
.card-body p {
    margin: 6px 0;
    font-size: 14px;
    color: #444;
    text-align: left;
}
.card-body strong {
    color: #222;
}

/* Footer */
.card-footer {
    text-align: right;
}
.detail-link {
    font-size: 13px;
    color: #0073e6;
    font-weight: 500;
    text-decoration: none;
}
.detail-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    /* padding: 4px 10px; */
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.badge.success {
    background: #d4edda;
    color: #155724;
}
.badge.error {
    background: #f8d7da;
    color: #721c24;
}
.badge.warning {
    background: #fff3cd;
    color: #856404;
}

/* Skeleton */
.skeleton {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    min-height: 140px;
}
.skeleton-header, .skeleton-line {
    background: #e0e0e0;
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.skeleton-header { width: 50%; height: 22px; }
.skeleton-line { width: 80%; }


.status-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.dashboard-wrapper {
    display: flex;
    width: 100%;
    gap: 40px;
}

/* Left side */
.dashboard-left {
    width: 70%;
    display: flex;
    flex-direction: column;
    gap: 25px; /* space between rows */
    padding-top: 10px;
}

.dashboard-left h1 {
    font-size: 28px;
    font-weight: 700;
}

/* Right side (Healthcheck cards) */
.dashboard-right {
    width: 30%;
    display: flex;
    justify-content: flex-end;
}

.dashboard-cards {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}



/* -----------------------------------------
   Monitor Card Layout
----------------------------------------- */
.response-time-chart {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 53rem;
}
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}


.monitor-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 2.5rem;
}

.monitor-card .card-header {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.monitor-card .card-body {
    font-size: 1rem;
    font-weight: 600;
}

.monitor-card .card-body.green  { color: #16a34a; }
.monitor-card .card-body.red    { color: #dc2626; }
.monitor-card .card-body.gray   { color: #9ca3af; }
.monitor-card .card-body.yellow { color: #d97706; }

.monitor-card .card-body small,
.monitor-card .card-body span,
.monitor-card .card-body p {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
}



/* ============================================================
   Histogram Container
============================================================ */
.histogram {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-top: 6px;
    height: 32px;
}

/* Wrapper so tooltip can position */
.histogram-bar-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

/* Bar */
.histogram-bar {
    width: 6px;
    height: 28px;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.histogram-bar:hover {
    transform: scale(1.15);
}

/* Colors */
.bar-gray {
    background-color: #9ca3af;
}
.bar-red {
    background-color: #dc2626;
}
.bar-yellow {
    background-color: #facc15;
}
.bar-green {
    background-color: #16a34a;
}

/* ============================================================
   Tooltip
============================================================ */
.tooltip-box {
    display: block;
    position: absolute;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    width: max-content;
    max-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 200;
    pointer-events: none;
}

/* tooltip arrow */
.tooltip-box::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

/* show tooltip */
.tooltip-box.visible {
    opacity: 1;
    visibility: visible;
}

/* Tooltip text colors */
.tooltip-date {
    font-size: 10px;
    color: #d1d5db;
    margin-bottom: 2px;
}

.tooltip-text.green {
    color: #4ade80;
}

.tooltip-text.red {
    color: #f87171;
}

.tooltip-text.gray {
    color: #9ca3af;
}


/* ================================================
   Response Time Chart Card
================================================== */
.response-chart-container {
    width: 100%;
    height: 220px;
    padding: 5px 5px 10px 5px;
}

.response-stats {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.response-stat-box {
    flex: 1;
    padding: 18px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.response-stat-box .stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.response-stat-box .stat-label {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 1024px) {

    /* Wrapper becomes stacked vertically */
    .dashboard-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    /* Left + Right take full width */
    .dashboard-left,
    .dashboard-right {
        width: 100%;
    }

    /* Right side cards take full available width */
    .dashboard-right {
        justify-content: flex-start;
    }

    /* Monitor grid becomes single column */
    .monitor-grid {
        grid-template-columns: 1fr !important;
    }

    /* Response time chart also full width */
    .response-time-chart {
        width: 100% !important;
    }

    /* Cards get full width */
    .monitor-card,
    .stat-card {
        width: 100%;
    }

    /* Response stats (3 small boxes under chart) stack vertically */
    .response-stats {
        flex-direction: column;
    }

    .response-stat-box {
        width: 100%;
    }
}