* {
    margin: 0;
    padding: 0;
}

:root {
    --dark-text-color: #0B204C;
    --light-text-color: #9298A6;
    --default-background-color: #F0F4FD;
    --healthy-color: #2CC09C;
    --degraded-color: #FF9800;
    --unhealthy-color: #DC2725;
    --brown-color: #FBC30A;
    --kidstime-shadow: 0 4px 16px rgba(11, 32, 76, 0.08), 0 1px 4px rgba(11, 32, 76, 0.04);
    --kidstime-shadow-hover: 0 8px 32px rgba(11, 32, 76, 0.12), 0 2px 8px rgba(11, 32, 76, 0.06);
}

body {
    background-color: var(--default-background-color);
    color: var(--dark-text-color);
    font-family: "Poppins", sans-serif;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* Dashboard layout */
.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

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

.header-logo { height: 48px; }

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 0;
}

.loading-text {
    color: var(--light-text-color);
    font-size: 1.1rem;
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2rem;
    box-shadow: var(--kidstime-shadow);
}

.banner-healthy { background-color: var(--healthy-color); }
.banner-degraded { background-color: var(--degraded-color); }
.banner-unhealthy { background-color: var(--unhealthy-color); }
.banner-unknown { background-color: var(--light-text-color); }
.banner-icon { color: #fff !important; }

/* Service Cards - KidsTime style */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-card {
    text-align: center;
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: var(--kidstime-shadow) !important;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.service-card-clickable { cursor: pointer; }

.service-card-clickable:hover {
    box-shadow: var(--kidstime-shadow-hover) !important;
    transform: translateY(-2px);
}

.service-card-selected {
    outline: 2px solid var(--brown-color);
    outline-offset: -2px;
}

.service-card .mud-card-content {
    padding: 1.5rem 1rem;
}

/* Instance count badge */
.instance-count {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.count-healthy { color: var(--healthy-color); }
.count-unhealthy { color: var(--unhealthy-color); }

.expand-icon {
    margin-top: 0.5rem;
    color: var(--light-text-color) !important;
}

/* Instance panel - full width below cards */
.instance-panel {
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: var(--kidstime-shadow) !important;
    margin-bottom: 2rem;
}

.instance-panel .mud-card-content {
    padding: 1.25rem;
}

.instance-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.instance-panel-header h3 {
    margin: 0;
    color: var(--dark-text-color);
}

.instance-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.instance-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.instance-card:hover {
    background-color: rgba(11, 32, 76, 0.03);
}

.instance-card + .instance-card {
    border-top: 1px solid rgba(11, 32, 76, 0.06);
}

.instance-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.instance-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-text-color);
    min-width: 80px;
}

.instance-response {
    font-size: 0.85rem;
    color: var(--light-text-color);
    flex: 1;
    text-align: right;
}

.instance-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    flex-shrink: 0;
}

/* Status dots */
.service-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
}

.dot-healthy { background-color: var(--healthy-color); box-shadow: 0 0 8px var(--healthy-color); }
.dot-degraded { background-color: var(--degraded-color); box-shadow: 0 0 8px var(--degraded-color); }
.dot-unhealthy { background-color: var(--unhealthy-color); box-shadow: 0 0 8px var(--unhealthy-color); }

.service-name {
    margin-bottom: 1rem;
    color: var(--dark-text-color);
}

.service-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-text-color);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--light-text-color);
}

.uptime-good { color: var(--healthy-color) !important; }
.uptime-warning { color: var(--degraded-color) !important; }
.uptime-critical { color: var(--unhealthy-color) !important; }

/* Status labels */
.service-status-label {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.label-healthy { background-color: var(--healthy-color); }
.label-degraded { background-color: var(--degraded-color); }
.label-unhealthy { background-color: var(--unhealthy-color); }

/* Chart Card */
.chart-card {
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: var(--kidstime-shadow) !important;
    margin-bottom: 2rem;
}

.chart-card .mud-card-content { padding: 1.5rem; }

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h2 { margin-bottom: 0; }

.no-data-text {
    text-align: center;
    color: var(--light-text-color);
    padding: 3rem 0;
    font-size: 1.1rem;
}

/* Incidents Card */
.incidents-card {
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: var(--kidstime-shadow) !important;
    margin-bottom: 2rem;
}

.incidents-card .mud-card-content { padding: 1.5rem; }

.incidents-table th {
    font-weight: 600 !important;
    color: var(--dark-text-color) !important;
}

.incident-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.incident-ongoing { background-color: var(--unhealthy-color); }
.incident-resolved { background-color: var(--light-text-color); }

.no-incidents-text {
    text-align: center;
    color: var(--healthy-color);
    padding: 2rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    color: var(--light-text-color);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Responsive */
@media screen and (max-width: 700px) {
    h1 { font-size: 1.5rem; }
    .header-content { flex-direction: column; gap: 0.5rem; }
    .header-logo { height: 36px; }
    .status-banner { font-size: 1rem; padding: 0.75rem 1rem; }
    .service-cards { grid-template-columns: repeat(2, 1fr); }
    .dashboard-footer { flex-direction: column; align-items: center; gap: 0.25rem; }
}

@media screen and (max-width: 400px) {
    .service-cards { grid-template-columns: 1fr; }
    .metric-value { font-size: 0.9rem; }
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
