/* Vue 3 + Element Plus optimized style - maintain the original layout style */
[v-cloak] {
    display: none !important;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

:root {
    /* Design System - codex.packycode.com aligned */
    --background: #fff;
    --foreground: #000;
    --primary: #000;
    --primary-foreground: #fff;
    --primary-hover: #1a1a1a;
    --primary-active: #333;
    --secondary: #f7f7f7;
    --muted: #f7f7f7;
    --muted-foreground: #666;
    --accent: #f7f7f7;
    --destructive: #ef4444;
    --border: #e6e6e6;
    --input: #fafafa;
    --ring: #000;
    --card: #fff;
    --popover: #fff;

    /* Sidebar */
    --sidebar: #fff;
    --sidebar-foreground: #000;
    --sidebar-hover: #f2f2f2;
    --sidebar-border: #e6e6e6;
    --sidebar-active-bg: #f2f2f2;
    --sidebar-active-color: #000;

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Monaco, monospace;

    /* Spacing & Radius */
    --radius: 0.5rem;
    --transition: cubic-bezier(.4, 0, .2, 1) 0.15s;

    /* Text hierarchy */
    --text-primary: #000;
    --text-secondary: #333;
    --text-tertiary: #666;
    --text-muted: #999;

    /* Preserve drawer variables */
    --drawer-padding: clamp(16px, 2.5vw, 28px);
    --drawer-bg: #f7f7f7;
    --drawer-card-bg: #ffffff;
    --drawer-transition: cubic-bezier(0.22, 1, 0.36, 1);

    /* Element Plus overrides */
    --el-color-primary: #000;
    --el-color-primary-light-3: #333;
    --el-color-primary-light-5: #666;
    --el-color-primary-light-7: #999;
    --el-color-primary-light-8: #e6e6e6;
    --el-color-primary-light-9: #f7f7f7;
    --el-color-primary-dark-2: #000;
    --el-border-color: #e6e6e6;
    --el-border-color-light: #e6e6e6;
    --el-fill-color-light: #f7f7f7;
    --el-bg-color: #fff;
    --el-font-family: var(--font-sans);
    --el-border-radius-base: 8px;
}

.el-overlay {
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    transition: background-color 0.32s var(--drawer-transition), backdrop-filter 0.32s var(--drawer-transition);
}

.el-drawer__body {
    animation: drawer-body-fade 0.32s var(--drawer-transition) both;
}

@keyframes drawer-body-fade {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

/* Sidebar Navigation */
.sidebar {
    width: 200px;
    min-width: 200px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--sidebar-foreground);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
}

.sidebar-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 12px 12px 4px;
    margin-top: 4px;
}

.sidebar-group-label:first-child {
    margin-top: 0;
    padding-top: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.sidebar-item:hover {
    color: var(--sidebar-foreground);
    background: var(--sidebar-hover);
}

.sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    font-weight: 600;
}

.sidebar-item svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-item.active svg {
    opacity: 1;
}

.sidebar-badge {
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius);
    margin-left: auto;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99;
    min-height: 44px;
}

.el-dropdown-menu__item.active {
    color: var(--el-color-primary);
    font-weight: 500;
    background-color: var(--el-color-primary-light-9);
}

.el-dropdown-menu__item.active::before {
    content: "✓ ";
}

.last-update {
    font-size: 13px;
    color: var(--text-muted);
}

/* Page Content */
.page-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

/* Settings Page - Full Width */
.page-content.settings-page {
    max-width: none;
    padding: 24px 32px;
}

/* Responsive: collapse sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 56px;
        min-width: 56px;
    }
    .sidebar-brand h1,
    .sidebar-item span,
    .sidebar-badge,
    .sidebar-footer .last-update {
        display: none;
    }
    .sidebar-item {
        justify-content: center;
        padding: 10px;
    }
}

/* =============================================
   Monitor Page - Professional Design
   ============================================= */

/* Overview Stats Bar */
.overview-bar {
    display: flex;
    justify-content: space-between;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.overview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.overview-item:hover {
    transform: translateY(-2px);
}

.overview-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.overview-label {
    font-size: 13px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Service Cards - Compact Grid */
.service-cards-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.service-card-mini {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.service-card-mini.online {
    border-color: var(--border);
}

.service-card-mini:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.service-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.service-icon.claude {
    background: linear-gradient(135deg, #333, #555);
}

.service-icon.codex {
    background: linear-gradient(135deg, #444, #666);
}

.service-icon.gemini {
    background: linear-gradient(135deg, #555, #777);
}

.service-meta {
    display: flex;
    flex-direction: column;
}

.service-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.service-port {
    font-size: 12px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.offline {
    background: var(--secondary);
    color: var(--text-tertiary);
}

.card-metrics {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

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

.metric-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Client Section */
.client-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header-simple h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-count {
    font-size: 13px;
    color: var(--text-muted);
}

.client-table-simple table {
    width: 100%;
    border-collapse: collapse;
}

.client-table-simple th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.client-table-simple td {
    padding: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.client-table-simple tbody tr:last-child td {
    border-bottom: none;
}

.client-table-simple tbody tr:hover {
    background: var(--secondary);
}

.client-cell {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 13px;
}

.num-cell {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.error-cell {
    color: #dc2626;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--secondary);
    border-color: var(--border);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.action-btn svg {
    stroke: currentColor;
}

/* Legacy container support */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Settings Page */
.settings-page {
    background: var(--secondary);
}

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.section-header p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0;
}

.settings-service-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--secondary);
    width: min(720px, 100%);
    max-width: 100%;
}

.settings-service-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(17, 24, 39, 0.04);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.settings-service-tab:hover {
    color: var(--text-primary);
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.settings-service-tab.active {
    color: #ffffff;
    background: #111214;
    border-color: #111214;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.tab-service-name {
    font-size: 14px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tab-service-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7cbd1;
    box-shadow: 0 0 0 3px rgba(199, 203, 209, 0.18);
}
.tab-service-dot.active {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.settings-service-tab.active .tab-service-dot {
    background: rgba(255, 255, 255, 0.46);
    box-shadow: none;
}

.settings-service-tab.active .tab-service-dot.active {
    background: #7bf1a8;
    box-shadow: 0 0 0 3px rgba(123, 241, 168, 0.16);
}

.tab-service-count {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    margin-left: auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(17, 24, 39, 0.08);
    border: 1px solid rgba(17, 24, 39, 0.06);
    font-variant-numeric: tabular-nums;
}

.settings-service-tab.active .tab-service-count {
    color: #111214;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.92);
}

.settings-page {
    background: transparent;
}

.settings-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0 2px;
}

.settings-hero-actions,
.settings-toolbar-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-toolbar-summary {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.settings-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-empty-state {
    padding: 8px 0;
}

.settings-config-table {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-config-table-head {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) 80px 170px 260px 220px 110px;
    gap: 16px;
    padding: 0 4px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-config-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
}

.settings-config-row.disabled {
    opacity: 0.72;
}

.settings-config-main {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) 80px 170px 260px 220px 110px;
    gap: 16px;
    align-items: start;
}

.settings-config-cell {
    min-width: 0;
}

.settings-config-cell-primary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-weight-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 2px;
}

.settings-weight-cell .weight-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-weight-cell .weight-percent {
    font-size: 11px;
    color: var(--text-tertiary);
}

.settings-config-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.settings-config-name {
    font-size: 15px;
    line-height: 1.2;
    color: #0f172a;
}

.settings-config-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-inline-weight {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.settings-inline-weight.adjusted {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.settings-config-endpoint {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.settings-health-cell,
.settings-plan-cell,
.settings-activity-cell,
.settings-actions-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-health-foot,
.settings-activity-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
}

.settings-plan-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-plan-refresh:hover {
    border-color: rgba(15, 23, 42, 0.16);
    color: #0f172a;
    background: rgba(248, 250, 252, 0.96);
}

.settings-plan-refresh:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-plan-subline {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    word-break: break-all;
}

.settings-plan-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.settings-plan-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-plan-card-headline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.settings-plan-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.settings-plan-pill-secondary {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}

.settings-plan-window-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.settings-plan-window {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    border: none;
    background: transparent;
}

.settings-plan-window + .settings-plan-window {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.settings-plan-window-head,
.settings-plan-window-foot,
.settings-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.settings-plan-window-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.settings-plan-window-head strong,
.settings-activity-head {
    color: #0f172a;
    font-size: 12px;
}

.settings-plan-window-meta {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.settings-plan-window-head span,
.settings-plan-window-foot span,
.settings-activity-head span {
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}

.settings-plan-bar-track {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f3;
}

.settings-plan-bar-fill {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background: #111827;
}

.settings-plan-bar-fill.warning {
    background: #4b5563;
}

.settings-plan-bar-fill.danger {
    background: #000000;
}

.settings-plan-muted {
    color: #94a3b8;
    font-size: 12px;
}

.settings-plan-error {
    color: #dc2626;
    font-size: 12px;
    line-height: 1.5;
}

.settings-actions-cell {
    align-items: stretch;
}

.settings-activity-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    background: rgba(248, 250, 252, 0.42);
}

.settings-row-toggle {
    align-self: flex-start;
}

.settings-weight-inline {
    width: 100%;
}

.settings-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-icon-button:hover {
    border-color: rgba(15, 23, 42, 0.18);
    color: #0f172a;
    background: rgba(248, 250, 252, 0.96);
}

.settings-icon-button.destructive:hover {
    border-color: rgba(220, 38, 38, 0.18);
    color: #dc2626;
    background: rgba(254, 242, 242, 0.92);
}

.settings-config-details {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 14px;
}

.settings-config-details-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.settings-config-details-summary::marker,
.settings-config-details-summary::-webkit-details-marker {
    display: none;
}

.settings-config-details-summary::before {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.92);
}

.settings-config-details[open] .settings-config-details-summary::before {
    content: '−';
}

.settings-config-details-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.settings-summary-strip {
    margin-bottom: 0;
}

.settings-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 14px;
}

.settings-detail-card {
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.settings-detail-card-wide {
    min-width: 0;
}

.settings-detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.settings-detail-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.settings-detail-card-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}

.settings-latency-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (max-width: 1280px) {
    .settings-config-table-head,
    .settings-config-main {
        grid-template-columns: minmax(220px, 1.15fr) 70px 160px 1fr 200px 110px;
    }
}

@media (max-width: 1100px) {
    .settings-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-config-table-head {
        display: none;
    }

    .settings-config-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-content.settings-page {
        padding: 16px;
    }

    .settings-toolbar,
    .settings-toolbar-side {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .settings-service-tabs,
    .settings-hero-toolbar,
    .settings-toolbar-side {
        width: 100%;
    }

    .settings-toolbar-summary {
        white-space: normal;
    }

    .settings-service-tabs {
        flex-direction: column;
    }

    .settings-metric-grid,
    .settings-config-main {
        grid-template-columns: 1fr;
    }

    .settings-config-row {
        padding: 14px;
    }

    .settings-health-foot,
    .settings-activity-foot,
    .settings-plan-window-head,
    .settings-plan-window-foot,
    .settings-activity-head,
    .settings-config-title-row {
        flex-wrap: wrap;
    }

    .settings-actions-cell {
        align-items: flex-start;
    }
}

/* Credentials List - Horizontal Layout */
.credential-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    grid-row: 1 / span 2;
}

.credential-icon.claude {
    background: linear-gradient(135deg, #333 0%, #555 100%);
}

.credential-icon.codex {
    background: linear-gradient(135deg, #444 0%, #666 100%);
}

.credential-icon.gemini {
    background: linear-gradient(135deg, #000 0%, #333 100%);
}

/* Config Activity Timeline */
.config-activity-timeline {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.config-activity-timeline.timeline-primary {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.config-activity-timeline.timeline-compact {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.timeline-title {
    color: #7a7a7a;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-activity-timeline.timeline-primary .timeline-title {
    color: var(--text-primary);
    font-weight: 600;
}

.timeline-info {
    color: #4b4b4b;
    font-weight: 600;
    font-size: 11px;
}

.config-activity-timeline.timeline-primary .timeline-info {
    color: var(--text-secondary);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10px;
    color: #8d8d8d;
}

.timeline-labels.compact {
    margin-top: 3px;
    font-size: 9px;
    color: var(--text-tertiary);
}

/* Timeline Line Chart */
.timeline-line-chart {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 6px;
    overflow: hidden;
}

.timeline-compact .timeline-line-chart {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.timeline-mini-bars {
    display: grid;
    grid-template-columns: repeat(60, minmax(0, 1fr));
    gap: 2px;
    align-items: end;
    min-height: 22px;
}

.timeline-mini-slot {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1px;
    height: 22px;
    background: #e6e6e6;
    border-radius: 2px;
    overflow: hidden;
}

.timeline-mini-segment {
    display: block;
    width: 100%;
    min-height: 0;
}

.timeline-mini-segment.success {
    background: #22c55e;
}

.timeline-mini-segment.failure {
    background: #ef4444;
}

.timeline-mini-bars.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    border-radius: 8px;
    border: 1px dashed #94a3b8;
    background: var(--secondary);
}

.timeline-mini-empty {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.timeline-line-chart svg {
    display: block;
}

.timeline-line-chart path {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.timeline-line-chart text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 9px !important;
    font-weight: 500;
    fill: #8c8c8c;
    font-variant-numeric: tabular-nums;
}

.timeline-line-chart text.no-data {
    font-size: 11px !important;
    font-weight: 400;
    fill: #999;
}

.chart-value-label {
    font-size: 10px;
    font-weight: 600;
    fill: var(--text-secondary);
    pointer-events: none;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 2px;
}

/* Config Details (secondary stats) */
.config-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(100, 116, 139, 0.24);
}

.config-details .config-activity-timeline {
    margin-top: 0;
    padding: 8px 9px 7px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--secondary);
}

.config-details .timeline-line-chart {
    border-color: #dbe5ef;
    background: #ffffff;
}

.config-details-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    cursor: pointer;
    list-style: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.config-details[open] .config-details-summary {
    margin-bottom: 10px;
}

.config-details-summary::marker,
.config-details-summary::-webkit-details-marker {
    display: none;
}

.config-details-summary::before {
    content: "+";
    font-size: 12px;
    color: var(--text-muted);
}

.config-details[open] .config-details-summary::before {
    content: "-";
}

/* Hover point styles */
.chart-hover-point {
    cursor: pointer;
    transition: opacity 0.2s ease, r 0.2s ease;
}

.chart-hover-point:hover {
    r: 5;
    opacity: 1 !important;
}

/* Activity Indicator Dot */
@keyframes pulse-active {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(53, 199, 89, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(53, 199, 89, 0);
    }
}

/* Latency Statistics - Dual View (Compact) */
.latency-stats-dual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
}

.latency-stats-compact {
    min-width: 0;
    padding: 7px 9px;
    background: var(--secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.latency-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.latency-title-compact {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.latency-count-compact {
    font-size: 10px;
    color: #8d8d8d;
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 6px;
    border-radius: 8px;
}

.latency-metric-compact {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #007aff;
    font-variant-numeric: tabular-nums;
}

.metric-label-small {
    font-size: 9px;
    color: #999;
    font-weight: 500;
}

.latency-line-chart {
    margin-top: 6px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 6px;
}

.latency-line-chart svg {
    display: block;
}

.latency-line-chart path {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.latency-line-chart text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 9px !important;
    font-weight: 500;
    fill: #8c8c8c;
    font-variant-numeric: tabular-nums;
}

.metric-percentile {
    font-size: 10px;
    color: #8d8d8d;
    font-variant-numeric: tabular-nums;
}

/* Activity Text Colors */
.activity-text-active {
    color: #35c759 !important;
    font-weight: 700 !important;
}

.activity-text-recent {
    color: #35c759 !important;
}

.activity-text-moderate {
    color: #ffc107 !important;
}

.activity-text-idle {
    color: #c7c7cc !important;
}

.activity-text-none {
    color: #e5e5ea !important;
}

/* Config Cards - New detailed layout */
.config-card {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: default;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.config-card.config-card-list {
    position: relative;
    overflow: hidden;
    padding: 9px 11px;
    border-radius: var(--radius);
}

.config-card:hover {
    background: #ffffff;
    border-color: var(--text-muted);
    transform: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.config-card.active {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
    border-color: #86efac;
}

.config-card.disabled {
    opacity: 0.72;
}

.config-card.config-card-list::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #94a3b8;
}

.config-card.config-card-list.active::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.card-id {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--secondary);
    padding: 2px 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-family: monospace;
}

.card-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-status-chip.active {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.legend-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    margin-right: 3px;
}

.legend-dot.success {
    background: #22c55e;
}

.legend-dot.failure {
    background: #ef4444;
}

.card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-badge.passthrough {
    background: var(--border);
    color: var(--text-secondary);
}

.card-badge.auth_json,
.card-badge.auth_token {
    background: #fef3c7;
    color: #92400e;
}

.card-badge.bedrock {
    background: var(--secondary);
    color: var(--text-secondary);
}

.card-badge.kiro {
    background: var(--secondary);
    color: var(--text-secondary);
}

/* Kiro Balance Section */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Inline kiro usage in config list row */
.card-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.card-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.card-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e6e6e6;
    transition: 0.3s;
    border-radius: 20px;
}

.card-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.card-toggle input:checked + .toggle-slider {
    background-color: #10b981;
}

.card-toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Card Stats Section - Simplified */
.config-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 8px;
}

.config-summary-strip.config-summary-strip-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    align-self: stretch;
    gap: 5px;
}

.config-summary-strip.config-summary-strip-secondary {
    margin: 0;
    gap: 6px;
}

.config-summary-strip-secondary .summary-pill {
    min-height: 46px;
    padding: 6px 7px;
    border-radius: 7px;
    justify-content: center;
}

.summary-pill {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.summary-pill-label {
    font-size: 9px;
    line-height: 1.2;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.summary-pill-value {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.summary-pill-ok {
    border-color: #bbf7d0;
    background: var(--secondary);
}

.summary-pill-ok .summary-pill-value {
    color: #15803d;
}

.summary-pill-bad {
    border-color: #fecaca;
    background: #fef2f2;
}

.summary-pill-bad .summary-pill-value {
    color: #b91c1c;
}

.summary-pill-neutral {
    border-color: var(--border);
    background: var(--secondary);
}

/* Health Row */
.health-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.health-percent {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.health-percent.health-green {
    color: #16a34a;
}

.health-percent.health-yellow {
    color: #ca8a04;
}

.health-percent.health-red {
    color: #dc2626;
}

.health-percent.health-gray {
    color: var(--text-muted);
}

.health-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.health-count {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* Health Bar */
.health-bar {
    width: 100%;
    height: 5px;
    background: #e6e6e6;
    border-radius: 3px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.health-fill.health-green {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.health-fill.health-yellow {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.health-fill.health-red {
    background: linear-gradient(90deg, #f87171, #dc2626);
}

.health-fill.health-gray {
    background: #e6e6e6;
}

/* Weight Badge Container */
.weight-badge-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.weight-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-tertiary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.weight-btn:hover {
    background: var(--secondary);
    border-color: var(--text-muted);
    color: var(--text-tertiary);
    transform: scale(1.05);
}

.weight-btn:active {
    transform: scale(0.95);
}

.weight-btn-minus:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.weight-btn-plus:hover {
    background: var(--secondary);
    border-color: #86efac;
    color: #16a34a;
}

/* Weight Badge */
.weight-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 48px;
    padding: 4px 8px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    gap: 2px;
}

.weight-badge.adjusted {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.weight-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}

.weight-percent {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    line-height: 1;
    text-transform: uppercase;
}

.weight-badge.adjusted .weight-num {
    color: #b45309;
}

.weight-badge.adjusted .weight-percent {
    color: #92400e;
}

.weight-badge.adjusted .routing-count {
    color: #059669;
}

/* Auth Mode Toggle */
/* Credential Form */
/* Service Config List */
.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.service-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.config-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

/* Compact Config List (for card view) */
.config-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.config-badge.passthrough {
    background: var(--secondary);
    color: var(--text-secondary);
}

.config-badge.auth_json,
.config-badge.auth_token,
.config-badge.api_key {
    background: #fef3c7;
    color: #b45309;
}

.config-badge.bedrock {
    background: var(--secondary);
    color: #be185d;
}

/* Config toggle switch */
.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e6e6e6;
    border-radius: 18px;
    transition: 0.2s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

/* Disabled config item */
/* Config success rate */
/* Access Key Card */
/* Access Keys List (Multi-key) */
.key-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* New Key Created Dialog */
/* Client Configuration Section */
/* Logs Page */
.logs-page {
    padding: 24px;
}

.logs-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logs-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.logs-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.logs-section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.realtime-status-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    gap: 8px;
}

.history-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-count {
    font-size: 13px;
    color: var(--text-tertiary);
}

.history-summary-tags {
    display: flex;
    gap: 8px;
}

.history-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ui-page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ui-page-hero-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ui-page-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.ui-page-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.ui-page-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ui-page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
    color: #0f172a;
}

.ui-page-description {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.ui-metric-grid,
.insights-shell {
    display: flex;
    gap: 18px;
}

.insights-shell {
    flex-direction: column;
}

.insights-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.insights-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.insights-range-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.insights-range-chip {
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.insights-range-chip:hover {
    border-color: rgba(37, 99, 235, 0.35);
    color: #1d4ed8;
}

.insights-range-chip.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
    box-shadow: none;
}

.insights-overview-layout,
.insights-model-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.insights-layout-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insights-layout-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.insights-layout-label {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.insights-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.insights-secondary-grid-single {
    grid-template-columns: 1fr;
}

.insights-card-primary,
.insights-card-models {
    min-height: 280px;
}

.insights-model-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insights-model-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.insights-model-row:hover {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(248, 250, 252, 0.96);
}

.insights-model-stack {
    margin-bottom: 0;
}

.insights-model-row-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.insights-model-row-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.9);
}

.insights-model-row-section strong {
    font-size: 13px;
    line-height: 1.2;
    color: #0f172a;
}

.insights-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.insights-back-button {
    padding: 0;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.insights-back-button:hover {
    color: #1d4ed8;
}

.insights-turn-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.insights-turn-grid.compact {
    margin-top: 14px;
}

.insights-turn-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.insights-turn-stat span {
    font-size: 12px;
    color: #64748b;
}

.insights-turn-stat strong {
    font-size: 22px;
    line-height: 1;
    color: #0f172a;
}

.ui-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.insights-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.ui-metric-card,
.ui-surface-card,
.request-insights-stat-card,
.request-insights-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: none;
}

.ui-metric-card,
.ui-surface-card {
    padding: 16px;
}

.ui-metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ui-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ui-metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ui-metric-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.request-insights-card {
    padding: 18px;
}

.request-insights-card-wide {
    min-height: 240px;
}

.ui-surface-card-header,
.request-insights-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ui-surface-card-heading,
.request-insights-card-header > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ui-surface-card-heading h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.ui-surface-card-heading p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.request-insights-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.request-insights-card-header span {
    font-size: 12px;
    color: #64748b;
}

.request-insights-stack {
    display: flex;
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
}

.request-insights-stack-segment {
    display: block;
    height: 100%;
    min-width: 2px;
}

.request-insights-section-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-insights-section-row {
    display: grid;
    grid-template-columns: minmax(110px, 160px) minmax(120px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #475569;
}

.insights-section-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.insights-section-bar-fill {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: 999px;
}

.request-insights-section-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

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

/* ── Composition Trend ── */

.composition-trend-card {
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
}

.composition-trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.composition-trend-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.composition-trend-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.composition-trend-header span {
    font-size: 12px;
    color: #64748b;
}

.composition-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.composition-trend-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.composition-trend-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.composition-trend-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.composition-trend-bar-row {
    display: grid;
    grid-template-columns: 68px 1fr 72px;
    gap: 10px;
    align-items: center;
}

.composition-trend-bar-date {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: right;
    white-space: nowrap;
}

.composition-trend-bar-track {
    height: 18px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.04);
    overflow: hidden;
    display: flex;
    position: relative;
}

.composition-trend-bar-segment {
    display: block;
    height: 100%;
    min-width: 1px;
    transition: width 0.3s ease;
}

.composition-trend-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.composition-trend-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    margin-top: 6px;
}

.composition-trend-divider {
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin: 16px 0;
}

/* Detail table */
.composition-trend-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.composition-trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
}

.composition-trend-table th {
    padding: 8px 10px;
    font-weight: 700;
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: right;
    position: sticky;
    top: 0;
}

.composition-trend-table th:first-child {
    text-align: left;
}

.composition-trend-table td {
    padding: 7px 10px;
    color: #334155;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.composition-trend-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #475569;
}

.composition-trend-table tr:last-child td {
    border-bottom: none;
}

.composition-trend-table .trend-table-totals td {
    font-weight: 700;
    color: #0f172a;
    background: rgba(248, 250, 252, 0.95);
    border-top: 2px solid rgba(15, 23, 42, 0.10);
    border-bottom: none;
}

.composition-trend-table .trend-table-pct {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.composition-trend-table .trend-table-bar-cell {
    padding: 7px 10px;
    text-align: left;
}

.composition-trend-mini-stack {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
    min-width: 60px;
}

.composition-trend-mini-segment {
    display: block;
    height: 100%;
    min-width: 1px;
}

.composition-trend-toggle {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.composition-trend-toggle button {
    padding: 5px 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.composition-trend-toggle button:hover {
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563eb;
}

.request-insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-insights-list-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.request-insights-list-row:first-child {
    padding-top: 0;
    border-top: none;
}

.request-insights-list-row.compact {
    gap: 6px;
}

.request-insights-list-topline,
.request-insights-list-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.request-insights-list-topline strong {
    color: #0f172a;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-insights-list-topline span,
.request-insights-list-meta span {
    font-size: 12px;
    color: #64748b;
}

.request-insights-share-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
}

.request-insights-share-track.subtle {
    height: 8px;
}

.request-insights-share-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: 999px;
}

.insights-token-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.insights-token-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insights-token-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.92);
}

.insights-token-item span {
    font-size: 12px;
    color: #64748b;
}

.insights-token-item strong {
    font-size: 18px;
    line-height: 1.05;
    color: #0f172a;
}

.insights-token-note {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 1200px) {
}

.request-insights-empty,
.ui-empty-state {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
    background: rgba(248, 250, 252, 0.85);
    color: #64748b;
    border: 1px dashed rgba(148, 163, 184, 0.4);
}

.request-insights-empty {
    background: rgba(248, 250, 252, 0.85);
    color: #64748b;
    border: 1px dashed rgba(148, 163, 184, 0.4);
}

.log-toggle-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.log-toggle-label {
    font-size: 13px;
    color: var(--text-tertiary);
}

.log-toggle-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.logs-table-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}

/* ── Card-based log layout ── */
/* Logs Table */
.logs-table {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.logs-table-header {
    display: grid;
    grid-template-columns: 80px 70px minmax(180px, 1fr) 140px 116px 80px 100px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}
.logs-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.logs-sort-button.active {
    color: var(--text-primary);
}
.logs-sort-indicator {
    font-size: 11px;
    color: var(--text-muted);
}
.logs-sort-button.active .logs-sort-indicator {
    color: var(--accent);
}
.logs-table-row {
    display: grid;
    grid-template-columns: 80px 70px minmax(180px, 1fr) 140px 116px 80px 100px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    align-items: center;
    transition: background 0.15s;
}
.logs-table-row:last-child { border-bottom: none; }
.logs-table-row:hover { background: var(--secondary); }
.logs-table-empty {
    text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px;
}
.logs-col-status { display: flex; align-items: center; gap: 6px; }
.logs-col-model {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px; color: var(--text-secondary);
}
.logs-col-config {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px; color: var(--text-tertiary);
}
.logs-size-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.logs-col-size { font-family: monospace; font-size: 12px; color: var(--text-tertiary); line-height: 1; }
.logs-body-breakdown {
    display: flex;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}
.logs-body-breakdown-segment {
    display: block;
    height: 100%;
    min-width: 2px;
}
.logs-col-duration { font-family: monospace; font-size: 12px; color: var(--text-tertiary); }
.logs-col-time { font-size: 12px; color: var(--text-muted); }

/* Keep shared log styles */
.log-status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.log-status-dot.s-ok  { background: #22c55e; }
.log-status-dot.s-warn { background: #f59e0b; }
.log-status-dot.s-err  { background: #ef4444; }
.log-status-code { font-family: monospace; font-weight: 600; font-size: 12px; min-width: 28px; }
.log-status-code.c-ok  { color: #16a34a; }
.log-status-code.c-warn { color: #d97706; }
.log-status-code.c-err  { color: #dc2626; }
.log-svc-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #fff;
}
.log-svc-badge.svc-claude  { background: #d97706; }
.log-svc-badge.svc-codex   { background: #16a34a; }
.log-svc-badge.svc-openai  { background: #666; }
.log-svc-badge.svc-gemini  { background: #555; }

@media (max-width: 900px) {
    .logs-table-header, .logs-table-row {
        grid-template-columns: 70px 60px minmax(140px, 1fr) 90px 96px 60px 80px;
        font-size: 12px; padding: 8px 12px;
    }

    .ui-page-hero,
    .ui-page-hero-actions,
    .insights-controls {
        align-items: stretch;
    }

    .insights-range-chips {
        justify-content: flex-start;
    }

    .insights-layout-grid,
    .insights-layout-grid-model,
    .insights-dashboard-grid,
    .insights-secondary-grid,
    .insights-turn-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights-token-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .request-insights-section-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}

.logs-page .log-header {
    display: grid;
    grid-template-columns: 140px 1fr 80px 80px 70px;
    padding: 12px 16px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.history-logs-section .log-header {
    grid-template-columns: 140px 90px 75px 130px 150px 120px 200px 60px 70px 150px 60px !important;
    min-width: 1300px;
}

.log-entries-scrollable {
    max-height: 300px;
    overflow-y: auto;
}

.log-entries-scrollable.history-entries {
    max-height: 500px;
}

.logs-page .log-entry {
    display: grid;
    grid-template-columns: 140px 1fr 80px 80px 70px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.history-logs-section .log-entry {
    grid-template-columns: 140px 90px 75px 130px 150px 120px 200px 60px 70px 150px 60px !important;
    min-width: 1300px;
}

.logs-page .log-entry:hover {
    background: var(--secondary);
}

.logs-page .log-entry:last-child {
    border-bottom: none;
}

.logs-page .log-entry.empty {
    grid-template-columns: 1fr;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    cursor: default;
}

.logs-page .log-entry.empty:hover {
    background: transparent;
}

.logs-page .url-column {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logs-page .usage-cell {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: pre-line;
    line-height: 1.4;
}

.history-pagination {
    display: flex;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .last-update {
        display: none;
    }

    .page-content {
        padding: 16px;
    }

    .page-content.settings-page {
        padding: 16px;
    }

    /* Monitor page responsive */
    .overview-bar {
        padding: 16px;
        gap: 8px;
    }

    .overview-item {
        padding: 0 12px;
    }

    .overview-value {
        font-size: 22px;
    }

    .overview-label {
        font-size: 11px;
    }

    .service-cards-compact {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        justify-content: center;
    }

    .client-table-simple {
        overflow-x: auto;
    }

    .config-card {
        padding: 12px;
    }

    .config-details-controls,
    .latency-stats-dual {
        grid-template-columns: 1fr;
    }

    .settings-service-tabs {
        flex-wrap: wrap;
    }

    .settings-service-tab {
        flex: 1 1 calc(50% - 3px);
        min-width: 136px;
        padding: 8px 14px;
    }

    .config-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 8px 0 10px;
    }

    .summary-pill {
        padding: 7px 8px;
    }

    .summary-pill-value {
        font-size: 13px;
    }

    .health-percent {
        font-size: 18px;
    }

    .weight-badge-container {
        gap: 4px;
    }

    .weight-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .weight-badge {
        min-width: 44px;
        height: 42px;
        padding: 3px 6px;
    }

    .weight-num {
        font-size: 15px;
    }

    .weight-percent {
        font-size: 9px;
    }

}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}

.auth-card {
    width: min(420px, 90vw);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-card h2 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    font-size: 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form .el-button {
    width: 100%;
}

.auth-error {
    color: #f56c6c;
    font-size: 13px;
    margin: 0;
}

.auth-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #303133;
    font-size: 14px;
}

.logs-overlay-drawer .el-drawer__body {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logs-overlay-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f7f8fa;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.logs-summary {
    font-size: 14px;
    color: #606266;
}

.logs-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logs-table {
    flex: 1;
    background: #fff;
    margin: 0 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.logs-table .el-table__row {
    cursor: pointer;
}

.logs-table .el-table__inner-wrapper::before {
    background: transparent;
}

.logs-path {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logs-pagination {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #ebeef5;
}

/* Header */
header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    font-size: 28px;
}

/* Services Section */
.service-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.service-card h3 {
    margin-bottom: 12px;
    color: #2c3e50;
}

/* Service status indicator */
/* Status point style */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #95a5a6;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.running {
    background: #27ae60;
    animation: pulse 2s infinite;
}

.status-dot.stopped {
    background: #e74c3c;
}

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

/* Stats Section */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-header h2 {
    margin: 0;
}

/* Clickable stat card */
/* Logs Section */
.logs-section {
    margin-bottom: 24px;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.logs-header h2 {
    color: #2c3e50;
    margin: 0;
}

.logs-actions {
    display: flex;
    gap: 8px;
}

.logs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.logs-table {
    min-height: 200px;
}

.log-header {
    display: grid;
    grid-template-columns: 140px 120px minmax(200px, 1fr) 80px 80px 200px 80px;
    gap: 10px;
    padding: 12px 16px;
    background: #ecf0f1;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
    align-items: center;
}

.log-entries {
    min-height: 100px;
}

.log-entry {
    display: grid;
    grid-template-columns: 140px 120px minmax(200px, 1fr) 80px 80px 200px 80px;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid #ecf0f1;
    align-items: start;
}

/* Service column wrapping style */
.log-entry span:nth-child(2) {
    white-space: pre-line;
    line-height: 1.4;
}

/* URL column wrapping style */
.log-entry span:nth-child(3),
.all-log-entries .log-entry span:nth-child(3),
.url-column {
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
}

.usage-cell {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    color: #34495e;
    white-space: pre-line;
    word-break: break-word;
    line-height: 1.4;
}

/* Detail button column is centered */
.log-entry > span:last-child {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2px;
}

.log-entry:hover {
    background: #f8f9fa;
}

.log-entry.loading {
    display: block;
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    grid-column: 1 / -1;
}

/* Configure drawer style */
.config-drawer .el-drawer__header {
    padding: 20px 24px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.config-drawer .el-drawer__body {
    padding: 0;
    background: var(--secondary);
}

.config-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    padding: 24px;
    overflow-y: auto;
}

.config-content {
    padding: 20px;
}

.config-tabs-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.config-tabs-pane .el-tabs__header {
    margin-bottom: 0;
    background: #fff;
    border-radius: var(--radius) 12px 0 0;
    padding: 8px 8px 0;
}

.config-tabs-pane .el-tabs__content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.config-tabs-pane .el-tab-pane {
    height: 100%;
    padding: 24px 28px;
}

/* Simple config card - cleaner design */
.simple-config-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    width: 100%;
}

.simple-config-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.simple-config-card p {
    margin: 0 0 20px;
    color: var(--text-tertiary);
    line-height: 1.6;
    font-size: 14px;
}

/* Auth mode selector - improved design */
.auth-mode-selector {
    margin-bottom: 24px;
    background: var(--secondary);
    border-radius: var(--radius);
    padding: 6px;
}

.auth-mode-selector .el-radio-group {
    display: flex;
    width: 100%;
    gap: 6px;
}

.auth-mode-selector .el-radio-button {
    flex: 1;
}

.auth-mode-selector .el-radio-button__inner {
    width: 100%;
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.2s ease;
}

.auth-mode-selector .el-radio-button__inner:hover {
    background: rgba(255, 255, 255, 0.6) !important;
}

.auth-mode-selector .el-radio-button.is-active .el-radio-button__inner {
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.auth-mode-selector .el-radio-button:first-child .el-radio-button__inner,
.auth-mode-selector .el-radio-button:last-child .el-radio-button__inner {
    border-radius: 8px !important;
}

/* Mode description - info box */
.mode-description {
    margin: 0 0 24px !important;
    padding: 14px 18px;
    background: var(--secondary);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
    color: #0369a1 !important;
}

/* Form fields - improved spacing */
.simple-config-card .config-field {
    margin-bottom: 20px;
}

.simple-config-card .config-field .field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.simple-config-card .config-field .el-input,
.simple-config-card .config-field .el-textarea {
    width: 100%;
}

.simple-config-card .config-field .el-input__wrapper,
.simple-config-card .config-field .el-textarea__inner {
    border-radius: var(--radius);
    padding: 10px 14px;
}

.simple-config-card .config-field .el-textarea__inner {
    min-height: 140px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Config actions - better button layout */
.simple-config-card .config-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.simple-config-card .config-actions .el-button {
    padding: 10px 20px;
    font-weight: 500;
}

.editor-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* Filter editor style */
.filter-drawer .filter-editor {
    display: flex;
    flex-direction: column;
}

.filter-drawer .filter-rules-container {
    padding: 15px;
    background: var(--secondary);
    border-radius: 6px;
    margin: 10px 0;
    max-height: min(60vh, 420px);
    min-height: 0;
    overflow-y: auto;
}

.filter-drawer .filter-rule-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    gap: 10px;
}

.filter-drawer .filter-rule-row:last-of-type {
    margin-bottom: 0;
}

.filter-drawer .filter-rule-row .el-input {
    flex: 1;
}

.filter-drawer .filter-rule-row .el-select {
    min-width: 100px;
}

.filter-drawer .filter-rule-row .el-button.is-circle {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .filter-drawer .filter-rule-row .el-input,
    .filter-drawer .filter-rule-row .el-select {
        width: 100% !important;
    }

    .filter-drawer .filter-rule-row .el-button.is-circle {
        margin-left: auto;
    }
}

/* Filter/Configuration Help Instructions */
.filter-help,
.filter-help p,
.filter-help code,
/* Drawer container style optimization */
.config-drawer .el-drawer__body,
.filter-drawer .el-drawer__body,
.usage-drawer .el-drawer__body,
.realtime-detail-drawer .el-drawer__body,
.mapping-drawer .el-drawer__body,
.log-detail-drawer .el-drawer__body,
.all-logs-drawer .el-drawer__body {
    padding: var(--drawer-padding);
    background: var(--drawer-bg);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

.config-drawer .config-content,
.filter-drawer .config-content,
.usage-drawer .usage-drawer-content,
.realtime-detail-drawer .realtime-detail-content,
.mapping-drawer .mapping-drawer-content,
.log-detail-drawer .log-detail-content,
.all-logs-drawer .all-logs-content {
    flex: 1;
    overflow-y: auto;
    background: var(--drawer-card-bg);
    border-radius: var(--radius);
    padding: clamp(16px, 2vw, 24px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.config-drawer .config-content,
.filter-drawer .config-content,
.usage-drawer .usage-drawer-content,
.realtime-detail-drawer .realtime-detail-content,
.mapping-drawer .mapping-drawer-content,
.log-detail-drawer .log-detail-content,
.all-logs-drawer .all-logs-content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
}

.config-content .tab-panel,
.filter-drawer .tab-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 20px);
}

/* Log details sidebar style */
.log-detail-drawer .log-detail-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

/* Log Detail - Flow Based Layout */
/* Flow Diagram */
/* Request Timeline */
.request-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.header-row {
    display: flex;
    gap: 12px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
}

.header-key {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
    flex-shrink: 0;
}

.header-value {
    color: var(--text-tertiary);
    word-break: break-all;
}

.metric-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.muted {
    color: #909399;
    font-size: 13px;
}

.usage-label {
    font-size: 12px;
    color: #7f8c8d;
}

.usage-value {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.usage-drawer-content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
}

.usage-summary-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.usage-summary-card h3 {
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 18px;
}

.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    justify-items: start;
}

.usage-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.usage-service-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e6ecf2;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.usage-service-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.usage-service-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.usage-total {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #34495e;
}

.usage-summary-grid.service-overall {
    background: #f8faff;
    padding: 12px;
    border-radius: 6px;
}

.usage-channel-table {
    border: 1px solid #e6ecf2;
    border-radius: 6px;
    overflow: hidden;
    overflow-x: auto;
}

.usage-channel-header,
.usage-channel-row {
    display: grid;
    grid-template-columns: 140px repeat(6, minmax(100px, 1fr));
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    align-items: center;
    min-width: 760px;
}

.usage-channel-header {
    background: #eef2f7;
    font-weight: 600;
    color: #2c3e50;
}

.usage-channel-row {
    border-top: 1px solid #e6ecf2;
}

.usage-channel-row .channel-name {
    font-weight: 500;
    color: #34495e;
}

.usage-channel-row span {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
}

.usage-channel-empty {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.usage-drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Request header style - tiling mode (remove bounding box) */
.headers-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-key {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.header-value {
    color: #606266;
    font-size: 14px;
    word-break: break-all;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
}

/* Request body style - true full screen mode */

/* All blog sidebar styles */
.all-logs-drawer .el-drawer__body {
    gap: clamp(12px, 2vw, 20px);
}

.all-logs-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: clamp(12px, 1.6vw, 18px);
}

.history-requests-section {
    margin-bottom: 16px;
}

.history-requests-section h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.all-logs-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-count-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 0 12px 0;
}

.history-filter-row .el-select {
    min-width: 150px;
}

.log-toggle-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.log-toggle-label {
    font-weight: 500;
    color: #333;
}

.log-toggle-hint {
    font-size: 12px;
    color: #666;
}

.stats-actions {
    display: flex;
    gap: 8px;
}

.all-logs-table {
    flex: 1;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.all-log-entries {
    flex: 1;
    overflow-y: auto;
}

/* Log details dialog style - maintain backwards compatibility */
.headers-content {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.header-key {
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    margin-right: 8px;
    word-break: break-all;
}

.header-value {
    color: #495057;
    word-break: break-all;
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* All log dialog styles */
.all-logs-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

/* Log table container */
.all-logs-table-container {
    position: relative;
    flex: 1;
    height: calc(100vh - 300px);
    min-height: 400px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
}

/* fixed header */
.log-header-fixed {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--secondary);
    border-bottom: 2px solid #dcdfe6;
}

/* scroll content area */
.all-log-entries-scrollable {
    overflow-y: auto;
    height: calc(100% - 42px);
}

.history-pagination-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Compatible with old styles - reserved for use elsewhere */
.all-logs-table {
    flex: 1;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.all-log-entries {
    max-height: 50vh;
    overflow-y: auto;
}

/* Element Plus custom styles */
.el-select {
    max-width: 150px;
}

/* Drop-down box style in model selection pop-up window */
.model-selector-content .el-select {
    max-width: none;
    width: 100%;
}

.el-input__inner {
    font-family: inherit;
}

.el-textarea__inner {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    line-height: 1.4;
}

.el-button {
    border-radius: 4px;
}

.el-tag {
    border-radius: 3px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .log-header,
    .log-entry {
        grid-template-columns: 100px 100px 1fr 70px;
        font-size: 12px;
        gap: 8px;
    }

    /* Hide the time-consuming, Usage, and operation columns on small screens */
    .log-header span:nth-child(5),
    .log-header span:nth-child(6),
    .log-header span:nth-child(7),
    .log-entry span:nth-child(5),
    .log-entry span:nth-child(6),
    .log-entry span:nth-child(7) {
        display: none;
    }
    
}

@media (max-width: 480px) {
    .log-header,
    .log-entry {
        grid-template-columns: 1fr 1fr 2fr;
        gap: 8px;
    }

    /* Only display time, service, and URL columns on an ultra-small screen */
    .log-header span:nth-child(n+4),
    .log-entry span:nth-child(n+4) {
        display: none;
    }
}

/* Configuration editor new style */

/* Mode switch label */
/* Interactive mode container */
/* JSON Schema Container */
/* Configure form header */
.config-actions {
    display: flex;
    gap: 12px;
}

/* Configure site container */
/* Configure site card */
/* New site editor */
/* Active site card */
.hint-text {
    display: block;
    margin-top: 4px;
    color: #909399;
    font-size: 12px;
}

/* Configure field layout */
.config-field {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.field-label {
    min-width: 100px;
    font-weight: 500;
    color: #2c3e50;
    text-align: right;
    flex-shrink: 0;
}

/* Inline action button */
/* Configuration help information */
/* Responsive layout */
@media (max-width: 1200px) {
    .config-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .field-label {
        min-width: auto;
        text-align: left;
    }

}

@media (max-width: 768px) {
    .config-field {
        gap: 12px;
    }

}

/* Test result display area */
/* Real-time request area styles */
.realtime-section {
    margin-bottom: 24px;
}

.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.realtime-header h2 {
    color: #2c3e50;
    margin: 0;
}

.realtime-status-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.realtime-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.realtime-table-header {
    display: grid;
    grid-template-columns: 100px 180px 100px 80px 80px;
    gap: 12px;
    padding: 12px 16px;
    background: #ecf0f1;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
}

.realtime-entries {
    max-height: 180px; /* About 4 rows high */
    overflow-y: auto;
}

.realtime-entry {
    display: grid;
    grid-template-columns: 100px 180px 100px 80px 80px;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid #ecf0f1;
    align-items: center;
    cursor: pointer;
}

/* Real-time request path column wrapping style */
.realtime-entry span:nth-child(2) {
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
}

.realtime-entry:hover {
    background: #f8f9fa;
}

.no-realtime-requests {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
    font-style: italic;
}

/* Details Drawer Style */
.realtime-detail-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

.detail-basic-info {
    flex-shrink: 0;
}

.detail-response-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.detail-response-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
}

.response-stream-container {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    min-height: 300px;
}

.response-stream-content {
    height: 100%;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.response-stream-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.no-response {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.detail-headers-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
}

.headers-content {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
}

.headers-content pre {
    margin: 0;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #2c3e50;
}

/* Scroll bar style */
.realtime-entries::-webkit-scrollbar,
.response-stream-content::-webkit-scrollbar {
    width: 6px;
}

.realtime-entries::-webkit-scrollbar-track,
.response-stream-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.realtime-entries::-webkit-scrollbar-thumb,
.response-stream-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.realtime-entries::-webkit-scrollbar-thumb:hover,
.response-stream-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design - real-time request area */
@media (max-width: 768px) {
    .realtime-table-header,
    .realtime-entry {
        grid-template-columns: 80px 150px 80px 60px 60px;
        font-size: 12px;
    }

    .realtime-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .connection-status {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .realtime-table-header,
    .realtime-entry {
        grid-template-columns: 70px 120px 70px 50px;
        gap: 8px;
    }

    /* Hide action bar on extra small screens */
    .realtime-table-header span:nth-child(5),
    .realtime-entry span:nth-child(5) {
        display: none;
    }
}

/* Model routing management style */
.api-key-section {
    margin: 0 0 24px;
}

.codex-api-key-inline {
    margin: 0 0 24px 0;
}

.api-key-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.api-key-header h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.api-key-subtitle {
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.api-key-input {
    margin-top: 0;
}

.api-key-input .el-input__wrapper {
    border-radius: var(--radius);
    padding: 8px 12px;
}

.api-key-visibility {
    margin-top: 12px;
}

.api-key-visibility .el-checkbox__label {
    font-size: 13px;
    color: var(--text-tertiary);
}

.api-key-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.api-key-actions .el-button {
    border-radius: 8px;
}

.api-key-hint {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--secondary);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
}

.api-key-hint code {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Responsive Design - Route Management */
@media (max-width: 768px) {
}

/* Model route mapping drawer style */
.mapping-drawer-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mapping-tabs {
    flex: 1;
    overflow: hidden;
}

.mapping-section {
    padding: 20px;
}

.mapping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.mapping-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mapping-item {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.mapping-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 16px;
    align-items: end;
}

.mapping-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mapping-field label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.mapping-arrow {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.mapping-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.empty-mapping {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-mapping p {
    margin: 0;
    font-size: 14px;
}

.mapping-footer {
    padding: 20px;
    border-top: 1px solid #e4e7ed;
    background: var(--input);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive Design - Map Drawer */
@media (max-width: 768px) {
    .mapping-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mapping-arrow {
        display: none;
    }

    .mapping-section {
        padding: 16px;
    }

    .mapping-footer {
        padding: 16px;
    }
}

/* tight horizontal layout style */
.mapping-form-horizontal {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.mapping-field-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mapping-field-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mapping-field-compact label {
    font-size: 12px;
    color: #606266;
    font-weight: 500;
    white-space: nowrap;
}

.mapping-arrow-compact {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: bold;
    margin: 0 8px;
    align-self: flex-end;
    margin-bottom: 24px;
}

.mapping-actions-compact {
    align-self: flex-end;
    margin-bottom: 24px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mapping-field-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .mapping-field-compact {
        width: 100%;
    }

    .mapping-field-compact .el-input,
    .mapping-field-compact .el-select {
        width: 100% !important;
    }

    .mapping-arrow-compact {
        align-self: center;
        margin: 0;
        transform: rotate(90deg);
    }

    .mapping-actions-compact {
        align-self: stretch;
        margin-bottom: 0;
    }
}

/* ==================== Merge Mode Style ==================== */

/* Mode switch button uniform width */
/* merge mode container */
/* Group cards */
/* packet header */
/* grouping subject */
/* key line */
/* Add key line */
/* group bottom */
/* group container */
/* Empty state */
/* Key list in pop-up window */
.dialog-entries-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: var(--secondary);
    border-radius: 4px;
}

.merged-dialog-form {
    padding-top: 4px;
}

.merged-dialog-top-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    align-items: start;
    margin-bottom: 6px;
}

.merged-dialog-top-main,
.merged-dialog-top-side {
    min-width: 0;
}

.merged-dialog-top-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.merged-weight-group .el-input-number {
    width: 100%;
}

.merged-dialog-form .el-form-item {
    margin-bottom: 14px;
}

.merged-dialog-form .el-form-item__label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
    padding-bottom: 6px;
}

.merged-mode-group .el-form-item__content {
    display: block;
}

.merged-mode-radio-group {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
}

.merged-mode-radio-group .el-radio-button {
    flex: 1 1 0;
    min-width: 0;
}

.merged-mode-radio-group .el-radio-button__inner {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merged-mode-hint {
    margin-top: 8px;
}

.merged-dialog-form .dialog-entries-container {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f9fafb;
}

.merged-dialog-form .dialog-entries-container .el-form-item__label {
    padding-bottom: 4px;
}

.merged-dialog-footer {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.merged-dialog-form .dialog-entries-container .el-form-item:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .merged-dialog-top-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .merged-dialog-footer {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .merged-dialog-footer .el-button {
        flex: 1 1 calc(50% - 6px);
    }

    .merged-mode-radio-group {
        flex-wrap: wrap;
    }

    .merged-mode-radio-group .el-radio-button {
        flex: 1 1 calc(50% - 4px);
    }

}

@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .all-logs-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stats-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}

@media (max-width: 600px) {
    .config-tabs {
        flex-wrap: wrap;
    }

    .config-tabs .el-button {
        flex: 1 1 45%;
    }

    .usage-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

/* ==================== Interactive Flow Diagram ==================== */

/* Flow Stage - Clickable Wrapper */
/* Stage Node */
/* Status-based styling */
/* Stage Status Badge */
/* Flow Connection - Arrows */
/* Flow Stage Hint */
/* Stage Detail Panel */
.detail-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Responsive Design - Interactive Flow */
@media (max-width: 768px) {
}

@media (max-width: 480px) {
}

/* ==================== Log Detail Comprehensive Sections ==================== */

/* =============================================
   Edge-based Log Detail Tabs
   ============================================= */

/* Compact Header */
.log-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    margin: -20px -20px 0;
}

.header-status {
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
}

.header-status.success { background: #dcfce7; color: #15803d; }
.header-status.danger { background: #fee2e2; color: #dc2626; }
.header-status.warning { background: #fef3c7; color: #d97706; }
.header-status.info { background: var(--secondary); color: var(--text-secondary); }

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 13px;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.share-url-display {
    max-width: 360px;
}

.share-url-display .el-input {
    font-size: 12px;
}

.user-message-section {
    margin: 0 -20px;
    padding: 10px 16px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}
.user-message-label {
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}
.user-message-content {
    font-size: 13px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}

.header-info .info-sep { opacity: 0.4; }
.header-info .info-service { font-weight: 600; color: var(--text-secondary); }

/* Edge Flow Tabs - Two Edges Design */
.edge-flow-tabs {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.edge-flow-tabs.two-edges .edge-tab {
    flex: 1;
}

.edge-tab {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edge-tab:hover {
    background: var(--secondary);
    border-color: var(--border);
}

.edge-tab.active {
    background: #fff;
    border-color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.edge-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.edge-tab-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.edge-tab-urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edge-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.edge-url-row .url-label {
    color: var(--text-muted);
    min-width: 36px;
}

.edge-url-row code {
    color: var(--text-secondary);
    font-family: ui-monospace, SFMono-Regular, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edge-tab-urls .empty-text {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* Edge Tab Panels */
.edge-tab-panels {
    padding: 16px 0;
}

.edge-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-panel {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Edge Sections (Request/Response) */
.edge-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.edge-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.edge-section-title.request {
    color: var(--text-secondary);
}

.edge-section-title.request svg {
    color: var(--text-secondary);
}

.edge-section-title.response {
    color: #059669;
}

.edge-section-title.response svg {
    color: #059669;
}

.edge-section-title .el-tag {
    margin-left: auto;
}

.edge-section-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* URL Display */
.url-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--secondary);
    border-radius: 8px;
}

.url-display code {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* Meta Line */
.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.meta-line strong {
    color: var(--text-secondary);
}

.meta-line code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Collapsible Sections */
.collapsible-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: background 0.15s ease;
}

.collapsible-header:hover {
    background: var(--secondary);
}

.collapsible-header .count {
    color: var(--text-muted);
    font-weight: 400;
}

.collapsible-header .truncation-tag {
    margin-left: 4px;
}

.collapsible-header .el-button {
    margin-left: auto;
}

.collapsible-header .el-button + .el-button {
    margin-left: 0;
}

.collapsible-body {
    border-top: 1px solid var(--border);
}

.collapsible-body .headers-table {
    padding: 8px 14px;
}

.collapsible-body .code-textarea {
    border: none;
    border-radius: 0;
}

.code-block {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    background: #0f172a;
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #e2e8f0;
    max-height: 500px;
    overflow-y: auto;
}

.code-block.empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.json-key { color: var(--text-secondary); }
.json-string { color: #aaa; }
.json-number { color: #888; }
.json-boolean { color: #999; }
.json-null { color: var(--text-muted); }

.collapsible-body .empty-hint {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.truncation-hint {
    margin: 10px 14px 0;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
}

.request-body-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 0;
}

.request-body-analysis {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 0;
}

.request-body-analysis-summary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.request-body-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.request-body-analysis-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.request-body-analysis-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.request-body-analysis-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.request-body-analysis-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.request-body-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.request-body-tab:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.request-body-tab.active {
    border-color: #94a3b8;
    background: #f8fafc;
    color: var(--text-secondary);
}

.request-body-tab-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.request-body-tab-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.request-body-tab-panel {
    margin: 12px 14px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.request-body-tab-panel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.request-body-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.request-body-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.request-body-section-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.request-body-tab-panel .code-block {
    border-radius: 0;
    max-height: 420px;
}

.request-body-tabs + .code-block {
    margin: 12px 14px 0;
    max-height: 420px;
}

/* Usage Row */
.usage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    background: var(--secondary);
    border-radius: 8px;
}

.usage-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.usage-chip .usage-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-chip .usage-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.panel-meta .meta-item strong {
    color: var(--text-tertiary);
}

.usage-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.usage-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.failover-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
}

.headers-table.compact {
    padding: 8px 14px;
}

/* Request URL Block */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Meta Row */
/* Subsection */
/* Headers Table */
.headers-table {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.headers-table .header-row {
    display: flex;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.headers-table .header-row:last-child {
    border-bottom: none;
}

.headers-table .header-row:nth-child(odd) {
    background: white;
}

.headers-table .header-key {
    flex: 0 0 180px;
    font-weight: 600;
    color: var(--text-tertiary);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    word-break: break-all;
}

.headers-table .header-value {
    flex: 1;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    word-break: break-all;
}

.empty-hint {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 12px;
    text-align: center;
    background: var(--secondary);
    border-radius: 8px;
}

/* Code Textarea */
/* Info Grid Compact */
/* Failover Info */
/* Timing Breakdown */
/* Metrics Grid */
.metrics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-meta {
        flex-wrap: wrap;
    }

    .headers-table .header-key {
        flex: 0 0 120px;
    }

}

/* Failover Tag */
.failover-tag {
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.failover-tag svg {
    vertical-align: middle;
}

/* ============== Keys Page ============== */
.keys-page {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.keys-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.keys-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-filter {
    display: flex;
    align-items: center;
}

.keys-date-filter .el-input__wrapper {
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.quick-days-bar {
    display: flex;
    gap: 4px;
}
.quick-days-bar .el-button {
    min-width: 36px;
    padding: 4px 8px;
}

.ui-date-range-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ui-date-range-bar .el-input__wrapper {
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

/* Keys Table */
.keys-table-wrap {
    overflow-x: auto;
}

.keys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: transparent;
}

.keys-table colgroup col,
.keys-table-header tr,
.keys-table-row {
    width: 100%;
}

.keys-table-header th {
    font-size: 11px;
    color: #64748b;
    background: transparent;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0 6px 12px;
}

.keys-table-header th:last-child {
    text-align: right;
}

.keys-table-row {
    font-size: 13px;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.keys-table-row td {
    padding: 16px 6px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

.keys-table tbody tr:last-child td {
    border-bottom: none;
}

.keys-table-row:hover {
    background: rgba(248, 250, 252, 0.78);
}

.keys-table-row.inactive {
    opacity: 0.56;
}

.keys-col-primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.keys-col-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keys-col-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

.keys-col-traffic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 12px;
    color: #64748b;
}

.keys-col-traffic strong {
    color: #0f172a;
    font-weight: 600;
}

.keys-col-time {
    font-size: 12px;
    color: #64748b;
}

.keys-col-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    white-space: nowrap;
}

.keys-col-actions .el-button {
    min-height: 30px;
    padding: 0 10px;
    color: #475569;
}

.keys-col-actions .el-button:hover {
    color: #111827;
}

.key-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.05);
    color: #64748b;
}

.key-status-badge.active {
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
}

/* Empty State */
.keys-empty-state {
    text-align: center;
    padding: 72px 24px;
}

/* Key Dialogs */
.key-form-dialog .el-dialog {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
}

.key-form-dialog .el-dialog__header {
    margin-right: 0;
    padding: 20px 22px 0;
}

.key-form-dialog .el-dialog__body {
    padding: 0 22px 22px;
}

.key-form-dialog .el-dialog__footer {
    padding: 0 22px 22px;
}

.key-form-dialog .el-input__wrapper,
.key-form-dialog .el-select__wrapper,
.key-form-dialog .el-textarea__inner,
.key-form-dialog .el-date-editor.el-input__wrapper,
.key-form-dialog .el-date-editor .el-input__wrapper {
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.key-form-dialog .el-input__wrapper.is-focus,
.key-form-dialog .el-select__wrapper.is-focused,
.key-form-dialog .el-date-editor.el-input__wrapper.is-focus,
.key-form-dialog .el-date-editor .el-input__wrapper.is-focus {
    box-shadow: inset 0 0 0 1px #111827;
    border-color: #111827;
}

.key-form-dialog .el-input-number {
    width: 100%;
}

.key-form-dialog .el-input-number .el-input__wrapper {
    width: 100%;
}

.key-edit-dialog .el-dialog__body {
    padding-top: 0;
}

.ked-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ked-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.ked-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ked-section-label {
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ked-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ked-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ked-field > label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.ked-field-switch {
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
}

.ked-sites {
    margin-top: 12px;
}

.ked-sites,
.site-selection-container {
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
}

.ked-site-group,
.service-group {
    margin-bottom: 14px;
}

.ked-site-group:last-child,
.service-group:last-child {
    margin-bottom: 0;
}

.ked-site-group-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.ked-site-group .el-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 4px;
}

.service-group-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.service-group .el-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 4px;
}

.service-group .el-checkbox,
.ked-site-group .el-checkbox {
    margin-right: 0;
}

.ked-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.ked-footer-right {
    display: flex;
    gap: 8px;
}

.keys-empty-state .empty-icon {
    color: #94a3b8;
    margin-bottom: 18px;
}

.keys-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.keys-empty-state p {
    color: #64748b;
    font-size: 14px;
    margin: 0 auto 24px;
    max-width: 440px;
}

.key-created-success {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.success-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-header .success-icon {
    font-size: 30px;
    color: #111827;
}

.success-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.created-key-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
}

.created-key-box label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.key-display code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    word-break: break-all;
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .keys-table {
        min-width: 840px;
    }

    .keys-table-header {
        display: none;
    }
}

@media (max-width: 640px) {
    .keys-hero-actions {
        align-items: stretch;
    }

    .keys-date-filter,
    .keys-date-filter .el-date-editor {
        width: 100%;
    }

    .ked-field-row {
        grid-template-columns: 1fr;
    }

    .key-display,
    .ked-footer,
    .ked-footer-right {
        flex-direction: column;
        align-items: stretch;
    }

    .ked-field-switch {
        padding-top: 0;
    }

    .ked-footer-right .el-button,
    .ked-footer > .el-button,
    .key-display .el-button {
        width: 100%;
    }
}

/* Setup Guide in Keys Page */
/* Key Created Success Dialog */
.key-created-success {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.success-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-header .success-icon {
    font-size: 30px;
    color: #111827;
}

.success-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.created-key-box {
    padding: 16px;
    background: #fafafa;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
}

.created-key-box label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.key-display code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    word-break: break-all;
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* Key count badge in nav */
/* Responsive */
@media (max-width: 768px) {
    .ui-page-hero,
    .keys-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .keys-table {
        font-size: 13px;
    }

    .key-display,
    .ked-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ked-footer-right {
        display: flex;
        flex-direction: column;
    }
}

/* ============== Costs Page ============== */
.costs-page {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.costs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.costs-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.costs-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.costs-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.summary-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}

.summary-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.costs-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.costs-section h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 12px;
    color: var(--text-tertiary);
}

.text-danger {
    color: #dc2626;
}

.costs-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.snapshot-detail h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.snapshot-detail h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0 8px;
    color: var(--text-secondary);
}

/* ============== Key Detail Page ============== */
.key-detail-page { padding: 24px; max-width: 1200px; margin: 0 auto; }
.key-detail-container { min-height: 400px; }
.key-detail-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.key-detail-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.92);
    color: #64748b;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}
.key-detail-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.key-detail-hero-actions .el-input__wrapper {
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.key-detail-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.key-detail-metrics-grid .ui-metric-card:last-child .ui-metric-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.01em;
    word-break: break-all;
}

.key-detail-grid {
    display: grid;
    grid-template-columns: 65% 1fr;
    gap: 16px;
}

/* Trend chart */
.kd-trend-chart { width: 100%; height: auto; }
.kd-trend-legend {
    display: flex; gap: 16px; justify-content: center;
    margin-top: 8px; font-size: 11px; color: var(--text-muted);
}
.kd-trend-legend span { display: flex; align-items: center; gap: 5px; }
.kd-trend-legend-bar { width: 12px; height: 8px; border-radius: 2px; background: rgba(17,24,39,0.18); }
.kd-trend-legend-line { width: 14px; height: 2px; border-radius: 1px; background: #111827; }

/* Donut */
.kd-donut-wrap { display: flex; flex-direction: column; align-items: center; }
.kd-donut-legend { width: 100%; margin-top: 12px; }
.kd-donut-legend-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
    font-size: 12px;
    color: #334155;
    cursor: default;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.kd-donut-legend-item:first-child { border-top: none; padding-top: 0; }
.kd-donut-legend-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.kd-donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kd-donut-legend-model {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-weight: 600;
}
.kd-donut-legend-share {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}
.kd-donut-legend-bar {
    width: 100%;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}
.kd-donut-legend-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #111827 0%, #6b7280 100%);
}
.kd-donut-legend-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 11px;
}
.kd-donut-legend-cost {
    margin-left: auto;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
}

/* Log card */
.key-detail-log-card { grid-column: 1 / -1; }
.kd-log-table { width: 100%; }
.kd-log-header-row {
    display: grid;
    grid-template-columns: 30px 160px 1fr 130px 150px;
    padding: 8px 12px;
    font-size: 12px;
    color: #64748b;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.kd-log-row {
    display: grid;
    grid-template-columns: 30px 160px 1fr 130px 150px;
    padding: 12px;
    font-size: 13px;
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: background 0.15s;
    align-items: center;
}
.kd-log-row:hover { background: rgba(248, 250, 252, 0.96); }
.kd-log-row .kd-log-model {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600;
}
.kd-log-chevron {
    font-size: 10px; color: #94a3b8;
    transition: transform 0.2s; display: inline-block;
}
.kd-log-chevron.expanded { transform: rotate(90deg); }
.kd-log-time,
.kd-log-io {
    color: #475569;
}
.kd-log-total {
    color: #0f172a;
    font-weight: 600;
}
.kd-log-expand {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 42px 16px;
    font-size: 12px;
    color: #64748b;
    background: rgba(248, 250, 252, 0.72);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.kd-log-expand-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
}
.kd-log-expand-item strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.1;
}
.kd-tag-service {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    margin-right: 8px;
    background: rgba(15,23,42,0.06);
    color: #0f172a;
    font-weight: 700;
    vertical-align: middle;
}
/* Pagination */
.key-detail-log-card .el-pagination {
    margin-top: 12px; justify-content: center; display: flex;
    --el-pagination-bg-color: transparent;
    --el-pagination-text-color: #64748b;
    --el-pagination-button-disabled-color: #94a3b8;
    --el-pagination-hover-color: #111827;
}
.key-detail-log-card .el-pagination button,
.key-detail-log-card .el-pagination .el-pager li {
    background: transparent !important; color: #64748b !important;
}
.key-detail-log-card .el-pagination .el-pager li.is-active {
    color: #111827 !important;
}

/* Responsive */
@media (max-width: 900px) {
    .key-detail-grid { grid-template-columns: 1fr; }
    .kd-log-header-row, .kd-log-row {
        grid-template-columns: 24px 120px 1fr 100px 120px;
        font-size: 12px;
    }
    .kd-log-expand {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-left: 32px;
        padding-right: 12px;
    }
}

@media (max-width: 640px) {
    .key-detail-hero-actions {
        width: 100%;
        justify-content: space-between;
    }
    .kd-donut-legend-meta {
        gap: 8px;
    }
    .kd-donut-legend-cost {
        margin-left: 0;
    }
    .kd-log-header-row {
        display: none;
    }
    .kd-log-row {
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 6px 10px;
    }
    .kd-log-row > :nth-child(2),
    .kd-log-row > :nth-child(3),
    .kd-log-row > :nth-child(4),
    .kd-log-row > :nth-child(5) {
        grid-column: 2;
    }
    .kd-log-expand {
        grid-template-columns: 1fr;
        padding: 12px 12px 14px 32px;
    }
}

/* Playground Page */
.playground-container {
    max-width: 900px;
}

.playground-config {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.playground-field {
    flex: 1;
    min-width: 160px;
}

.playground-field label,
.playground-input label,
.playground-response label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.playground-input {
    margin-top: 16px;
}

.playground-response {
    margin-top: 20px;
}

.playground-response-box {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.typing-cursor {
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}
