/* Otelite Dashboard Styles */

/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --header-bg: #1a1a2e;
    --header-text: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Dark mode (and default for this developer tool) */
@media (prefers-color-scheme: dark), (prefers-color-scheme: no-preference) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #0d0d0d;
        --bg-tertiary: #1a1a1a;
        --text-primary: #e2e8f0;
        --text-secondary: #64748b;
        --border-color: #222222;
        --accent-color: #818cf8;
        --accent-hover: #6366f1;
        --header-bg: #000000;
        --header-text: #e2e8f0;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--accent-color);
    padding: 0.75rem 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.nav-btn:hover {
    background-color: rgba(129, 140, 248, 0.15);
    color: #c7d2fe;
    border-color: rgba(129, 140, 248, 0.3);
}

.nav-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.status-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background-color 0.15s;
    user-select: none;
}

.status-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.status-indicator.disconnected {
    background-color: var(--error-color);
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Status popover */
.status-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background-color: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    font-size: 0.8125rem;
}

.status-popover.visible {
    display: block;
}

.popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px;
    gap: 1rem;
}

.popover-label {
    color: var(--text-secondary, rgba(255,255,255,0.5));
    white-space: nowrap;
}

.popover-value {
    color: var(--text-primary, #cdd6f4);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.popover-divider {
    height: 1px;
    background-color: var(--border-color, rgba(255,255,255,0.1));
    margin: 6px 0;
}

.popover-error {
    color: var(--error-color, #f38ba8);
    justify-content: center;
}

.popover-action-row {
    justify-content: center;
    padding: 6px 14px;
}

.popover-danger-btn {
    background: transparent;
    border: 1px solid var(--error-color, #f38ba8);
    color: var(--error-color, #f38ba8);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
}

.popover-danger-btn:hover {
    background: var(--error-color, #f38ba8);
    color: var(--bg-primary, #1e1e2e);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    padding: 0.75rem 1.25rem;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    flex-direction: column;
}

.view.active {
    display: flex;
    flex: 1;
    min-height: 0;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.view-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Controls */
.controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 250px;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
}

/* Logs Container */
.logs-container {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Traces Container - first rule (overridden below) */
.traces-container-placeholder { display: none; }

/* Metrics Layout */
.metrics-layout {
    display: flex;
    flex-direction: row;
    height: calc(100% - 60px);
    overflow: hidden;
}

.layout-drag-handle-v {
    flex-shrink: 0;
    width: 6px;
    cursor: ew-resize;
    background-color: var(--bg-tertiary);
    transition: background-color 0.1s;
    margin: 0 2px;
}

.layout-drag-handle-v:hover,
.layout-drag-handle-v.dragging {
    background-color: var(--accent-color);
}

.metrics-list {
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
}

.metrics-graph {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
}
/* Metrics Header */
.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metrics-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.metric-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Metrics Content */
.metrics-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1rem;
    height: calc(100% - 80px);
}

.metrics-chart-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#metrics-chart {
    width: 100%;
    max-width: 100%;
}

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

.metrics-list-container h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Metric Item */
.metric-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

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

.metric-name {
    font-weight: 600;
    color: var(--text-primary);
}

.metric-type {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.metric-type-gauge, .metric-type-badge.metric-type-gauge {
    background-color: #0c2a3e;
    color: #38bdf8;
    border: 1px solid #0369a1;
}

.metric-type-counter, .metric-type-badge.metric-type-counter {
    background-color: #1e0a2e;
    color: #c084fc;
    border: 1px solid #6b21a8;
}

.metric-type-histogram, .metric-type-badge.metric-type-histogram {
    background-color: #2d1a00;
    color: #fbbf24;
    border: 1px solid #92400e;
}

.metric-type-summary, .metric-type-badge.metric-type-summary {
    background-color: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.metric-timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.metric-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.attribute-tag {
    padding: 0.2rem 0.45rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Metrics sidebar/detail redesign */
.metrics-sidebar {
    width: 240px;
    flex-shrink: 0;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
}

.metric-sidebar-item {
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s;
}

.metric-sidebar-item:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.metric-sidebar-item.selected {
    background-color: rgba(129, 140, 248, 0.15);
    border-color: var(--accent-color);
}

.metric-sidebar-name {
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: 4px;
}

.metric-sidebar-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-type-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-sidebar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
}

.metrics-detail {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-detail-header h3 {
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    word-break: break-all;
}

.metric-detail-controls {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.metric-chart-area {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    min-height: 320px;
}

.chart-time-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.chart-time-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.2rem 0.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
    line-height: 1.4;
}

.btn-icon:hover {
    background-color: rgba(129, 140, 248, 0.2);
    border-color: var(--accent-color);
}

.metric-chart-area canvas {
    width: 100%;
    display: block;
}

.metric-data-table h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Data table shared styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover td {
    background-color: var(--bg-tertiary);
}

.data-cell-time {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.75rem;
}

.data-cell-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

.data-cell-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.label-tag {
    padding: 0.15rem 0.4rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.72rem;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    white-space: nowrap;
}

.label-tag strong {
    color: var(--text-primary);
}

.no-labels {
    color: var(--text-secondary);
    opacity: 0.5;
}


/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    padding: 2rem;
    text-align: center;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-state-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}


/* Log-specific styles */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    flex: 1;
    min-width: 200px;
}

.time-range-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tr-datetime {
    width: 14rem;
    flex: none;
    min-width: unset;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.tr-sep {
    color: var(--text-secondary);
}

.tr-preset {
    flex: none;
}

.view-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-primary:disabled {
    background-color: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
}

.log-entry {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
}

.log-entry:hover {
    box-shadow: var(--shadow);
    background-color: var(--bg-tertiary);
}

/* Severity-coloured left border on log entries */
.log-entry.severity-trace  { border-left-color: #64748b; }
.log-entry.severity-debug  { border-left-color: #38bdf8; }
.log-entry.severity-info   { border-left-color: #22c55e; }
.log-entry.severity-warn   { border-left-color: #f59e0b; }
.log-entry.severity-error  { border-left-color: #ef4444; }
.log-entry.severity-fatal  { border-left-color: #a855f7; }

.log-entry.expanded {
    border-color: var(--accent-color);
}

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

.log-timestamp {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 180px;
}

.log-severity {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.log-severity.severity-trace {
    background-color: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.log-severity.severity-debug {
    background-color: #0c2a3e;
    color: #38bdf8;
    border: 1px solid #0369a1;
}

.log-severity.severity-info {
    background-color: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.log-severity.severity-warn {
    background-color: #2d1a00;
    color: #fbbf24;
    border: 1px solid #92400e;
}

.log-severity.severity-error {
    background-color: #2d0a0a;
    color: #f87171;
    border: 1px solid #991b1b;
}

.log-severity.severity-fatal {
    background-color: #1e0a2e;
    color: #c084fc;
    border: 1px solid #6b21a8;
}

.log-body-preview {
    flex: 1;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-trace-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    background-color: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.log-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.log-body {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

.log-field {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.log-field strong {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.log-field pre {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background-color: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 0.25rem;
}

.attribute-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.attribute-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attribute-key {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
}

.attribute-value {
    font-size: 0.875rem;
    word-break: break-word;
}

.attribute-value-json {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.attribute-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
}

.json-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-toggle {
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    user-select: none;
}

.json-toggle::before {
    content: '▶ ';
}

.json-toggle.json-toggle-open::before {
    content: '▼ ';
}

.json-toggle:hover {
    opacity: 0.8;
}

.json-raw-btn {
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    user-select: none;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0 3px;
}

.json-raw-btn:hover {
    color: var(--text-primary);
}

.json-raw-btn.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.raw-block {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background-color: var(--bg-primary);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
}

.json-block {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background-color: var(--bg-primary);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.json-collapsed {
    display: none;
}

.trace-link {
    color: var(--accent-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.trace-link:hover {
    text-decoration: underline;
}

/* LLM usage panel inside a log detail */
.llm-usage-panel {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-color);
    border-radius: 3px;
}
.llm-usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.25rem 1rem;
    margin-top: 0.35rem;
}
.llm-usage-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px dotted var(--border-color);
    padding: 0.15rem 0;
}
.llm-usage-key {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}
.llm-usage-val {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

/* Prompt turn summary banner */
.prompt-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.prompt-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.prompt-summary-header code {
    color: var(--accent-color);
    font-size: 0.85em;
}
.prompt-summary-header button {
    margin-left: auto;
}
.prompt-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.25rem 1rem;
}
.prompt-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    border-bottom: 1px dotted var(--border-color);
}
.prompt-summary-key {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}
.prompt-summary-val {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.json-key {
    color: var(--accent-color);
}

.json-string {
    color: var(--success-color);
}

.json-number {
    color: #9c27b0;
}

.json-boolean {
    color: #ff9800;
}

.json-null {
    color: var(--text-secondary);
}

.json-punctuation {
    color: var(--text-secondary);
}

.json-truncated-badge {
    font-size: 0.65rem;
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    vertical-align: middle;
    user-select: none;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

#page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 200px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--error-color);
    font-size: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--error-color);
    border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .filter-input {
        width: 100%;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-actions {
        flex-direction: column;
        width: 100%;
    }

    .view-actions button {
        width: 100%;
    }
}

/* Trace-specific styles */
.traces-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.traces-list {
    width: 340px;
    flex-shrink: 0;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
}

.trace-entry {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.trace-entry:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.trace-entry.selected {
    border-color: var(--accent-color);
    background-color: rgba(129, 140, 248, 0.08);
}

.trace-entry.trace-error {
    border-left-color: var(--error-color);
}

.trace-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.trace-time {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.trace-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

.trace-duration {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    background-color: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.trace-spans {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.trace-error-badge {
    background-color: var(--error-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.trace-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.trace-id-short {
    font-family: 'Courier New', monospace;
}

.trace-services {
    font-style: italic;
}

.trace-detail {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 0;
    overflow: hidden;
}

.trace-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.trace-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.trace-detail-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.trace-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.trace-info-item {
    font-size: 0.875rem;
}

.trace-info-item strong {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.trace-waterfall {
    margin-top: 1.5rem;
    overflow-x: auto;
}

.waterfall-zoom-content {
    min-width: 100%;
}

.trace-waterfall h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.span-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.span-row {
    cursor: pointer;
}

.span-row:hover {
    background-color: var(--bg-tertiary);
}

.span-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 300px;
    flex-shrink: 0;
}

.span-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.span-name.span-error {
    color: var(--error-color);
}

.span-kind {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.span-duration {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
}

.span-bar-container {
    flex: 1;
    height: 24px;
    background-color: var(--bg-primary);
    border-radius: 3px;
    position: relative;
}

.span-bar {
    position: absolute;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 3px;
    opacity: 0.8;
    transition: opacity 0.2s;
    cursor: pointer;
}

.span-bar:hover {
    opacity: 1;
}

/* Span kind colors */
.span-bar.span-kind-server   { background-color: #3b82f6; }
.span-bar.span-kind-client   { background-color: #a855f7; }
.span-bar.span-kind-internal { background-color: #6366f1; }
.span-bar.span-kind-producer { background-color: #f59e0b; }
.span-bar.span-kind-consumer { background-color: #22c55e; }

.span-bar.span-bar-error {
    background-color: var(--error-color) !important;
}

.span-toggle {
    cursor: pointer;
    user-select: none;
    width: 1rem;
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1;
}

.span-toggle:hover {
    color: var(--accent-color);
}

.span-toggle-spacer {
    width: 1rem;
    display: inline-block;
    flex-shrink: 0;
}

.collapsed-count {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-left: 0.25rem;
}

/* Span kind legend */
.span-kind-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
}

.span-kind-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.span-kind-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.span-attributes {
    margin: 0.5rem 0 0.75rem 1rem;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.waterfall-spans {
    width: 100%;
}

.span-detail-panel {
    flex-shrink: 0;
    height: 360px;
    min-height: 120px;
    max-height: 80vh;
    background-color: var(--bg-primary);
    border-top: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none; /* prevents text selection while dragging */
}

.span-panel-drag-handle {
    flex-shrink: 0;
    height: 6px;
    background-color: var(--bg-tertiary);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.span-panel-drag-handle:hover,
.span-panel-drag-handle.dragging {
    background-color: var(--accent-color);
}

.span-panel-drag-handle::after {
    content: '⠿';
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.span-detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
}

.span-detail-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.span-detail-header-row h4 {
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Two-column attribute grid for wide panels */
.span-attrs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.35rem 1rem;
    margin-top: 0.5rem;
}

.span-attr-row {
    display: flex;
    gap: 0.4rem;
    font-size: 0.82rem;
    min-width: 0;
    align-items: baseline;
}

.span-attr-key {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
    white-space: nowrap;
}

.span-attr-val {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.span-attr-val.long {
    white-space: normal;
    word-break: break-all;
}

.span-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.span-detail-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.btn-sm {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.span-detail-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.span-detail-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.span-detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.span-detail-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.span-detail-item {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.span-detail-item strong {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.span-detail-item code {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background-color: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.status-ok {
    color: var(--success-color);
    font-weight: 600;
}

.status-error {
    color: var(--error-color);
    font-weight: 600;
}

.span-children-list {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.span-children-list li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Span events timeline */
.span-events-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.span-event {
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--accent-color);
    padding: 0.75rem;
    border-radius: 4px;
}

.span-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.span-event-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.span-event-time {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    background-color: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.span-event-attributes {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.metrics-sidebar-search {
    padding: 0.4rem 0.6rem;
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 100%;
}

.metrics-sidebar-search:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Responsive design for traces */
@media (max-width: 900px) {
    .traces-container {
        flex-direction: column;
    }

    .traces-list {
        width: 100% !important;
        height: 280px;
        flex-shrink: 0;
    }

    #traces-h-handle {
        display: none;
    }

    .span-info {
        min-width: 160px;
    }

    .span-detail-panel {
        height: 240px;
    }
}

/* GenAI/LLM Information Card */
.genai-info-card {
    background-color: var(--genai-bg);
    border-left: 4px solid var(--genai-color);
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 4px;
}

.genai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.genai-badge {
    font-weight: 600;
    color: var(--genai-color);
    font-size: 14px;
}

.genai-system {
    background-color: var(--genai-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.genai-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    font-size: 13px;
}

.genai-detail-item {
    display: flex;
    gap: 4px;
}

.genai-detail-item strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.genai-tokens {
    color: var(--warning-color);
    font-weight: 500;
}

/* Compact inline GenAI badge in the span waterfall rows */
.genai-waterfall-badge {
    display: inline-block;
    font-size: 0.75em;
    color: #6b7280;
    margin-left: 0.4em;
    white-space: nowrap;
    flex-shrink: 0;
}

.genai-tool-name {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 500;
}

.genai-debug {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* Setup view */
.setup-container {
    max-width: 860px;
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
}

/* Onboarding styles */
.onboarding-section {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    border-radius: 6px;
}

.onboarding-section h3,
.onboarding-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
}

.onboarding-section p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.onboarding-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.onboarding-section li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.endpoint-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.endpoint-list li {
    padding: 0.6rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.endpoint-list code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #4ade80;
    font-weight: 600;
}

.config-example {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.config-example summary {
    padding: 0.6rem 0.75rem;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    transition: background-color 0.15s;
    color: var(--text-primary);
}

.config-example summary:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.config-example[open] summary {
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-color);
}

.config-example pre {
    margin: 0;
    padding: 1rem;
    background-color: #0a0a15;
    overflow-x: auto;
}

.config-example code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #a5f3fc;
}

.config-doc-link {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-tertiary);
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}
.config-doc-link a {
    color: var(--accent-color);
    text-decoration: none;
}
.config-doc-link a:hover {
    text-decoration: underline;
}

#logs-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

#logs-empty-state > p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Quick filter label in attr-filter-bar */
.quick-filter-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-right: 0.15rem;
}

/* Attribute filter bar */
.attr-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    padding: 0.4rem 0;
}

.attr-filter-key {
    width: 160px;
}

.attr-filter-op {
    width: 90px;
}

.attr-filter-val {
    width: 140px;
}

.attr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.attr-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

.log-col-tokens {
    width: 5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.log-col-model {
    width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Usage view */
.usage-summary-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.usage-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    min-width: 9rem;
}

.usage-card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.usage-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* GenAI organized span-detail sections */
.genai-section {
    margin: 0.4rem 0;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-left: 3px solid #8b5cf6;
    border-radius: 3px;
}
.genai-section h6 {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.genai-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.15rem 1rem;
}
.genai-section-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.1rem 0;
    border-bottom: 1px dotted var(--border-color);
}
.genai-section-key {
    color: var(--text-secondary);
}
.genai-section-val {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    overflow-wrap: anywhere;
    text-align: right;
}

/* Chat bubbles in span events timeline */
.chat-bubble {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
    background: var(--bg-secondary);
}
.chat-bubble-user     { border-left-color: #3b82f6; }
.chat-bubble-assistant{ border-left-color: #10b981; }
.chat-bubble-system   { border-left-color: #6b7280; }
.chat-bubble-tool     { border-left-color: #f59e0b; }
.chat-bubble-choice   { border-left-color: #8b5cf6; }
.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

/* Usage analytics widgets */
.usage-gauge-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    min-width: 180px;
}
.gauge-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 0.4rem 0;
    overflow: hidden;
}
.gauge-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}
.gauge-fill-warning { background: #ef4444; }
.gauge-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cost-chart {
    margin: 1rem 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
}
.cost-chart-svg { width: 100%; height: 140px; }
.cost-chart-bar { fill: var(--accent-color); }
.cost-chart-bar:hover { fill: #8b5cf6; }
.cost-chart-axis { fill: var(--text-secondary); font-size: 10px; }

.top-spans-cost-high { color: #f59e0b; font-weight: 600; }

.finish-reasons-list { margin-top: 0.5rem; }
.finish-reason-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}
.finish-reason-name { width: 140px; font-family: 'Courier New', monospace; }
.finish-reason-bar { flex: 1; height: 12px; background: var(--border-color); border-radius: 2px; overflow: hidden; }
.finish-reason-fill { height: 100%; background: var(--accent-color); }
.finish-reason-fill.warning { background: #ef4444; }
.finish-reason-count { width: 80px; text-align: right; color: var(--text-secondary); }
.chat-bubble-role {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.chat-bubble-time {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}
.chat-bubble-content {
    white-space: pre-wrap;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
}
