body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: #fff;
    color: #333;
}

.page-header {
    background: #ffffff;
    border-bottom: 1px solid #e7e9eb;
    padding: 8px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 45px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.page-header-brand span {
    font-size: 16px;
    font-weight: 600;
    color: #14387f;
}

.page-header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-header-nav a {
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.12s;
}

.page-header-nav a:hover,
.page-header-nav a.active {
    color: #14387f;
    background: rgba(20, 56, 127, 0.06);
}

/* Single-column layout */
.content.single-col {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e7e9eb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.card-header {
    padding: 12px 20px;
    border-bottom: 1px solid #e7e9eb;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.res-text {
    font-size: 11px;
    color: #6c757d;
}

.res-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}

.res-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #14387f;
    transition: width 0.5s ease, background 0.5s ease;
    width: 0;
}

.res-bar-fill.warn {
    background: #f59e0b;
}

.res-bar-fill.crit {
    background: #dc2626;
}

.info-value code {
    background: #f6f6f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

/* Card header with a right-aligned summary */
.card-header-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-meta {
    font-size: 11px;
    font-weight: 500;
    color: #9ba6b7;
    text-transform: none;
    letter-spacing: 0;
}

/* AI Models */
.ai-model-group {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ai-model-group:last-child {
    border-bottom: none;
}

.ai-model-group-header {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.ai-model {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

/* Sits on the model name line */
.ai-model-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ai-model-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.ai-model-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    word-break: break-all;
}

.ai-model-org {
    color: #9ba6b7;
    font-weight: 400;
}

.ai-model-url {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #9ba6b7;
    word-break: break-all;
}

.ai-model-status {
    align-self: center;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: help;
}

.ai-model-dot.up {
    color: #2e7d32;
}

.ai-model-dot.down {
    color: #c62828;
}

.ai-model-status.fast {
    color: #2e7d32;
}

.ai-model-status.ok {
    color: #e65100;
}

.ai-model-status.slow {
    color: #c62828;
}

/* The red dot already says it; the label stays quiet */
.ai-model-status.error,
.ai-model-status.none {
    color: #9ba6b7;
}

.text-muted {
    color: #9ba6b7;
}

.backend-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.backend-badge.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.backend-badge.disconnected {
    background: #ffeaea;
    color: #c62828;
}

.env-tag {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    color: #6c757d;
    background: #eef1f6;
}

/* Latencies: name, then Ø / p95 / count in fixed columns */
.lat-row {
    display: grid;
    grid-template-columns: 1fr 76px 76px 56px;
    align-items: baseline;
    column-gap: 8px;
    padding: 3px 0;
    font-size: 13px;
}

.lat-head {
    padding: 10px 20px 0;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lat-group {
    padding: 8px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.lat-group:last-child {
    border-bottom: none;
}

.lat-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.lat-total {
    font-weight: 600;
    color: #333;
}

.lat-model {
    color: #6c757d;
    font-size: 12px;
}

.lat-model .lat-name {
    padding-left: 12px;
    word-break: break-all;
}

.lat-count {
    color: #9ba6b7;
}

.lat-empty {
    grid-column: 2 / -1;
    text-align: right;
    font-weight: 400;
    color: #9ba6b7;
}

/* Bot list */
.bot-group {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.bot-group:last-child {
    border-bottom: none;
}

.bot-group-header {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.bot-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.bot-entry-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bot-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.bot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bot-tag {
    font-size: 11px;
    color: #6c757d;
    background: #eef1f6;
    padding: 1px 7px;
    border-radius: 4px;
}

.bot-key {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #9ba6b7;
    background: #f6f6f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.bot-impl {
    font-size: 11px;
    color: #6c757d;
    background: #eef1f6;
    padding: 2px 8px;
    border-radius: 4px;
}
