:root { --brand: #0f172a; --accent: #2563eb; --bg: #f3f4f6; --panel: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #cbd5e1; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.side select { width: 100%; padding: 7px; border-radius: 6px; border: 1px solid #334155; background: #1e293b; color: #fff; margin-bottom: 12px; }
.side a { color: #cbd5e1; padding: 8px 10px; border-radius: 6px; display: block; }
.side a.on, .side a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.side .sep { border-top: 1px solid #334155; margin: 10px 0; }
.side .foot { margin-top: auto; font-size: 12px; color: #94a3b8; }
.side .foot button { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.main { padding: 24px 28px; max-width: 1280px; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 22px 0 10px; }
.flash { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card .k { font-size: 12px; color: var(--muted); } .card .v { font-size: 22px; font-weight: 700; margin-top: 2px; } .card .s { font-size: 12px; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .grid2, .grid3 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
tr:hover td { background: #fafafa; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eef2ff; color: #3730a3; margin: 1px 2px 1px 0; }
.tag.bad { background: #fee2e2; color: #991b1b; } .tag.ok { background: #dcfce7; color: #166534; } .tag.warn { background: #fef3c7; color: #92400e; } .tag.mute { background: #f3f4f6; color: #4b5563; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 90px; } textarea.tall { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; } label .hint { font-weight: 400; color: var(--muted); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn.ghost { background: #fff; color: var(--accent); } .btn.sm { padding: 4px 10px; font-size: 12px; } .btn.danger { background: var(--bad); border-color: var(--bad); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; } .filters > div { min-width: 140px; } .filters label { margin: 0 0 4px; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.m { padding: 10px 14px; border-radius: 10px; max-width: 80%; white-space: pre-wrap; }
.m.user { align-self: flex-end; background: #dbeafe; } .m.assistant { align-self: flex-start; background: #f3f4f6; border: 1px solid var(--line); }
.m .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 8px; }
.bars .b { flex: 1; background: #93c5fd; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .b:hover { background: var(--accent); } .bars .b span { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #111; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.bars .b:hover span { display: block; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f3f4f6; padding: 2px 5px; border-radius: 4px; }
pre.code { padding: 10px; white-space: pre-wrap; word-break: break-all; }
.pager { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.login { max-width: 360px; margin: 10vh auto; background: #fff; padding: 28px; border-radius: 12px; border: 1px solid var(--line); }
.inline { display: inline; }
