dashboard-nanobot/frontend/src/App.css

1049 lines
18 KiB
CSS

:root,
.app-shell[data-theme='dark'] {
--bg: #050d1f;
--bg-2: #0b2248;
--panel: #0f203f;
--panel-soft: #142a52;
--line: #3d5685;
--text: #f2f7ff;
--title: #d7e5ff;
--subtitle: #c1d1ee;
--muted: #9ab1db;
--icon: #d9e8ff;
--icon-muted: #b9ccef;
--brand: #5b95ff;
--brand-soft: #284d8f;
--ok: #25c88a;
--warn: #e2b54a;
--err: #eb6a6a;
--shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}
.app-shell[data-theme='light'] {
--bg: #edf2fb;
--bg-2: #d3e1ff;
--panel: #ffffff;
--panel-soft: #f3f7ff;
--line: #b7c7e6;
--text: #10244b;
--title: #0c2149;
--subtitle: #294675;
--muted: #456092;
--icon: #16386f;
--icon-muted: #385b91;
--brand: #2f69e2;
--brand-soft: #d7e6ff;
--ok: #11a56f;
--warn: #c68b14;
--err: #d14b4b;
--shadow: 0 10px 30px rgba(45, 77, 143, 0.12);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
color: var(--text);
background-color: var(--bg);
background:
radial-gradient(1200px 800px at -12% -20%, var(--bg-2) 0%, transparent 60%),
radial-gradient(900px 600px at 110% 8%, var(--bg-2) 0%, transparent 62%),
linear-gradient(165deg, var(--bg) 0%, color-mix(in oklab, var(--bg) 75%, #000 25%) 100%);
font-family: 'Avenir Next', 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
}
.app-shell {
min-height: 100vh;
padding: 18px;
}
.app-frame {
height: calc(100vh - 36px);
display: grid;
grid-template-rows: auto 1fr;
gap: 14px;
}
.app-header {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 16px;
padding: 14px 16px;
box-shadow: var(--shadow);
backdrop-filter: blur(2px);
}
.app-header-top {
align-items: flex-start;
}
.app-title {
display: flex;
align-items: center;
gap: 10px;
}
.app-title-icon {
width: 22px;
height: 22px;
object-fit: contain;
}
.app-title svg {
color: var(--icon);
stroke-width: 2.2;
}
.app-title h1 {
margin: 0;
font-size: 20px;
font-weight: 800;
color: var(--title);
}
.app-title p {
margin: 2px 0 0;
color: var(--subtitle);
font-size: 12px;
}
.global-switches {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: flex-end;
}
.switch-compact {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 5px;
border-radius: 999px;
border: 1px solid var(--line);
background: var(--panel-soft);
}
.switch-label {
font-size: 12px;
color: var(--muted);
margin-left: 6px;
margin-right: 2px;
}
.switch-btn {
border: 1px solid transparent;
border-radius: 999px;
min-width: 34px;
height: 30px;
padding: 0 8px;
background: transparent;
color: var(--icon-muted);
display: inline-flex;
align-items: center;
gap: 4px;
cursor: pointer;
font-size: 11px;
font-weight: 700;
}
.switch-btn svg {
color: currentColor;
stroke-width: 2.2;
}
.switch-btn-lang {
min-width: 40px;
padding: 0 10px;
gap: 0;
font-size: 12px;
}
.switch-btn.active {
border-color: color-mix(in oklab, var(--brand) 60%, var(--line) 40%);
background: color-mix(in oklab, var(--brand) 20%, transparent);
color: var(--icon);
}
.main-stage {
min-height: 0;
height: 100%;
}
.panel {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 16px;
padding: 14px;
box-shadow: var(--shadow);
}
.panel h2 {
margin: 0;
font-size: 19px;
color: var(--title);
}
.panel-desc {
margin: 4px 0 0;
color: var(--subtitle);
font-size: 13px;
font-weight: 600;
}
.grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
height: 100%;
}
.grid-ops {
display: grid;
grid-template-columns: 320px 1fr 360px;
gap: 12px;
height: 100%;
}
.grid-ops.grid-ops-compact {
grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}
.stack {
display: flex;
flex-direction: column;
gap: 10px;
}
.input,
.select,
.textarea {
width: 100%;
border: 1px solid color-mix(in oklab, var(--line) 70%, var(--text) 8%);
background: var(--panel-soft);
color: var(--text);
border-radius: 10px;
padding: 9px 10px;
font-size: 13px;
outline: none;
}
.app-shell[data-theme='light'] .input,
.app-shell[data-theme='light'] .select,
.app-shell[data-theme='light'] .textarea {
background: #f8fbff;
}
.textarea {
resize: vertical;
min-height: 110px;
}
.md-area {
min-height: 160px;
font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.field-label {
color: var(--subtitle);
font-size: 12px;
}
.input:focus,
.select:focus,
.textarea:focus {
border-color: var(--brand);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
background: color-mix(in oklab, var(--panel-soft) 72%, var(--line) 28%);
color: var(--muted);
cursor: not-allowed;
}
.btn {
border: 1px solid transparent;
border-radius: 10px;
padding: 9px 12px;
font-size: 13px;
font-weight: 700;
cursor: pointer;
}
.btn-primary {
background: var(--brand);
color: #fff;
}
.btn-primary svg {
color: #fff;
}
.btn-primary:hover {
filter: brightness(1.08);
}
.btn-secondary {
background: color-mix(in oklab, var(--panel-soft) 78%, var(--brand-soft) 22%);
border-color: var(--line);
color: var(--text);
}
.btn-secondary svg {
color: var(--icon);
stroke-width: 2.1;
}
.btn-success {
background: color-mix(in oklab, var(--ok) 20%, var(--panel-soft) 80%);
border-color: color-mix(in oklab, var(--ok) 46%, var(--line) 54%);
color: color-mix(in oklab, var(--text) 72%, white 28%);
}
.btn-success svg {
color: currentColor;
stroke-width: 2.1;
}
.btn-danger svg {
color: currentColor;
stroke-width: 2.1;
}
.btn-danger {
background: color-mix(in oklab, var(--err) 18%, var(--panel-soft) 82%);
border-color: color-mix(in oklab, var(--err) 44%, var(--line) 56%);
color: color-mix(in oklab, var(--text) 70%, white 30%);
}
.row-between {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.card {
border: 1px solid var(--line);
border-radius: 12px;
background: var(--panel-soft);
padding: 10px;
}
.app-shell[data-theme='light'] .card {
background: #f7faff;
}
.selectable {
transition: border-color 0.2s;
}
.selectable:hover {
border-color: color-mix(in oklab, var(--brand) 50%, var(--line) 50%);
}
.badge {
display: inline-flex;
align-items: center;
padding: 3px 8px;
border-radius: 999px;
font-size: 11px;
font-weight: 700;
border: 1px solid;
}
.badge-ok {
color: color-mix(in oklab, var(--ok) 66%, white 34%);
background: color-mix(in oklab, var(--ok) 22%, transparent);
border-color: color-mix(in oklab, var(--ok) 52%, transparent);
}
.badge-warn {
color: color-mix(in oklab, var(--warn) 60%, white 40%);
background: color-mix(in oklab, var(--warn) 16%, transparent);
border-color: color-mix(in oklab, var(--warn) 42%, transparent);
}
.badge-err {
color: color-mix(in oklab, var(--err) 60%, white 40%);
background: color-mix(in oklab, var(--err) 16%, transparent);
border-color: color-mix(in oklab, var(--err) 42%, transparent);
}
.badge-unknown {
color: var(--muted);
background: color-mix(in oklab, var(--line) 46%, transparent);
border-color: var(--line);
}
.list-scroll {
overflow: auto;
}
.table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.table th,
.table td {
border-bottom: 1px solid var(--line);
text-align: left;
padding: 8px;
}
.table th {
color: var(--subtitle);
font-size: 12px;
font-weight: 700;
}
.mono {
font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.wizard-steps {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
margin-bottom: 12px;
}
.wizard-shell {
background:
linear-gradient(160deg, color-mix(in oklab, var(--panel) 88%, var(--brand-soft) 12%) 0%, var(--panel) 100%);
min-height: 760px;
}
.wizard-head {
padding: 2px 2px 4px;
}
.wizard-steps-enhanced .wizard-step {
border-radius: 12px;
border-color: color-mix(in oklab, var(--line) 72%, transparent);
background: color-mix(in oklab, var(--panel-soft) 82%, transparent);
font-weight: 700;
}
.wizard-steps-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
.wizard-step {
border: 1px solid var(--line);
border-radius: 10px;
padding: 8px;
font-size: 12px;
color: var(--muted);
background: color-mix(in oklab, var(--panel-soft) 80%, black 20%);
}
.wizard-step.active {
color: var(--text);
border-color: color-mix(in oklab, var(--brand) 65%, var(--line) 35%);
background: color-mix(in oklab, var(--brand-soft) 56%, var(--panel-soft) 44%);
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brand) 45%, transparent);
}
.summary-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.log-view {
background: color-mix(in oklab, var(--panel-soft) 82%, black 18%);
border: 1px solid var(--line);
border-radius: 10px;
padding: 8px;
height: 100%;
overflow: auto;
font-size: 12px;
font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.log-line {
padding: 5px 0;
border-bottom: 1px solid color-mix(in oklab, var(--line) 66%, transparent);
color: var(--text);
}
.ops-chat-panel {
min-width: 0;
}
.ops-header-band {
border: 1px solid var(--line);
border-radius: 12px;
padding: 10px;
background: color-mix(in oklab, var(--panel-soft) 88%, var(--brand-soft) 12%);
}
.ops-log-view {
min-height: 420px;
}
.bot-card {
margin-bottom: 8px;
cursor: pointer;
}
.bot-card.selected {
border-color: var(--brand);
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brand) 45%, transparent);
}
.bot-name {
font-weight: 700;
}
.bot-id,
.bot-meta {
color: color-mix(in oklab, var(--text) 70%, var(--muted) 30%);
font-size: 12px;
font-weight: 600;
}
.telemetry-card {
display: grid;
gap: 7px;
font-size: 13px;
}
.section-mini-title {
margin: 0;
font-size: 13px;
color: var(--subtitle);
font-weight: 700;
}
.chat-tabs {
display: flex;
gap: 8px;
}
.chat-view {
min-height: 420px;
max-height: 62vh;
overflow: auto;
border: 1px solid var(--line);
border-radius: 12px;
padding: 10px;
background: var(--panel-soft);
}
.chat-bubble {
margin-bottom: 8px;
padding: 8px 10px;
border-radius: 10px;
line-height: 1.45;
white-space: pre-wrap;
color: var(--text);
font-size: 14px;
font-weight: 600;
}
.chat-bubble.assistant {
border: 1px solid color-mix(in oklab, var(--brand) 45%, var(--line) 55%);
background: color-mix(in oklab, var(--brand-soft) 36%, var(--panel-soft) 64%);
}
.chat-bubble.user {
border: 1px solid color-mix(in oklab, var(--ok) 55%, var(--line) 45%);
background: color-mix(in oklab, var(--ok) 18%, var(--panel-soft) 82%);
}
.chat-bubble.system {
border: 1px dashed color-mix(in oklab, var(--warn) 50%, var(--line) 50%);
color: var(--text);
background: color-mix(in oklab, var(--warn) 18%, var(--panel-soft) 82%);
font-size: 12px;
font-weight: 700;
}
.telemetry-strong {
color: var(--text);
}
.telemetry-strong .mono {
color: var(--text);
}
.event-list {
display: grid;
gap: 8px;
max-height: 220px;
overflow: auto;
}
.event-item {
display: grid;
grid-template-columns: 92px 1fr;
gap: 8px;
align-items: center;
padding: 6px 8px;
border: 1px solid var(--line);
border-radius: 8px;
background: color-mix(in oklab, var(--panel-soft) 90%, var(--panel) 10%);
}
.event-state {
font-size: 11px;
font-weight: 700;
}
.event-thinking .event-state {
color: #6ea5ff;
}
.event-tool_call .event-state {
color: #67d3b1;
}
.event-success .event-state {
color: #53cf95;
}
.event-error .event-state {
color: #ef6666;
}
.dialog-status-strip {
display: grid;
grid-template-columns: auto auto 1fr;
gap: 8px;
align-items: center;
}
.state-chip {
display: inline-flex;
align-items: center;
gap: 6px;
border: 1px solid var(--line);
border-radius: 999px;
padding: 4px 10px;
font-size: 12px;
font-weight: 800;
color: var(--text);
}
.state-running {
border-color: color-mix(in oklab, var(--ok) 60%, var(--line) 40%);
background: color-mix(in oklab, var(--ok) 22%, transparent);
}
.state-active {
border-color: color-mix(in oklab, var(--brand) 65%, var(--line) 35%);
background: color-mix(in oklab, var(--brand) 18%, transparent);
}
.state-last-action {
font-size: 13px;
color: var(--text);
font-weight: 700;
}
.dialog-midstate-strip {
display: flex;
gap: 8px;
overflow: auto;
}
.midstate-pill {
min-width: 240px;
border: 1px solid var(--line);
border-radius: 10px;
padding: 6px 8px;
display: grid;
gap: 4px;
color: var(--text);
background: var(--panel-soft);
}
.midstate-pill .mono {
font-size: 11px;
font-weight: 800;
}
.midstate-pill.state-thinking .mono {
color: #6ea5ff;
}
.midstate-pill.state-tool_call .mono {
color: #67d3b1;
}
.midstate-pill.state-success .mono {
color: #53cf95;
}
.midstate-pill.state-error .mono {
color: #ef6666;
}
.chat-meta-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 4px;
}
.chat-role {
font-size: 11px;
font-weight: 800;
color: color-mix(in oklab, var(--text) 85%, var(--muted) 15%);
}
.chat-time {
font-size: 10px;
color: var(--muted);
}
.agent-tabs {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.agent-tabs-vertical {
display: flex;
flex-direction: column;
gap: 8px;
min-width: 150px;
}
.wizard-agent-layout {
display: grid;
grid-template-columns: 170px 1fr;
gap: 10px;
min-height: 420px;
}
.agent-tab {
border: 1px solid var(--line);
background: var(--panel-soft);
color: var(--text);
border-radius: 8px;
padding: 6px 10px;
cursor: pointer;
font-size: 12px;
}
.agent-tab.active {
border-color: var(--brand);
background: color-mix(in oklab, var(--brand-soft) 54%, var(--panel-soft) 46%);
}
.modal-mask {
position: fixed;
inset: 0;
background: rgba(2, 9, 24, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 90;
}
.modal-card {
width: min(680px, 90vw);
border: 1px solid var(--line);
border-radius: 14px;
background: var(--panel);
color: var(--text);
padding: 14px;
display: flex;
flex-direction: column;
gap: 10px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.modal-wide {
width: min(980px, 94vw);
}
.app-modal-mask {
z-index: 120;
}
.app-modal-card {
width: min(1280px, 96vw);
max-height: 94vh;
}
.app-modal-body {
min-height: 0;
max-height: calc(94vh - 92px);
overflow: auto;
}
.modal-card h3 {
margin: 0;
color: var(--title);
font-size: 22px;
font-weight: 800;
}
.modal-title-row {
display: grid;
gap: 4px;
}
.modal-sub {
color: var(--subtitle);
font-size: 12px;
font-weight: 600;
}
.slider-row {
display: grid;
gap: 6px;
}
.wizard-step2-grid {
gap: 10px;
}
.wizard-step2-card {
gap: 8px;
border-radius: 14px;
padding: 12px;
background: color-mix(in oklab, var(--panel-soft) 86%, var(--panel) 14%);
}
.wizard-note-card {
border-style: dashed;
}
.token-input-row {
align-items: start;
}
.token-number-input {
max-width: 220px;
}
.slider-row input[type='range'] {
width: 100%;
}
.wizard-channel-list {
display: grid;
gap: 8px;
}
.wizard-channel-card {
min-width: 0;
display: grid;
gap: 6px;
}
.wizard-channel-compact {
padding: 10px;
border-radius: 10px;
}
.wizard-dashboard-switches {
display: flex;
flex-wrap: wrap;
gap: 14px;
align-items: center;
}
.wizard-channel-summary {
display: grid;
gap: 8px;
}
.wizard-icon-btn {
display: inline-flex;
align-items: center;
gap: 6px;
}
.icon-btn {
width: 34px;
height: 34px;
padding: 0;
border-radius: 9px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.factory-kpi-grid {
display: grid;
gap: 8px;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpi-card {
border: 1px solid var(--line);
border-radius: 10px;
background: color-mix(in oklab, var(--panel-soft) 88%, transparent);
padding: 9px;
}
.kpi-label {
font-size: 11px;
color: var(--subtitle);
}
.kpi-value {
margin-top: 6px;
font-size: 22px;
font-weight: 800;
}
/* Readability fallback rules (avoid low contrast when color-mix is limited). */
.app-shell[data-theme='dark'] .panel {
background: #0f203f;
border-color: #3d5685;
color: #f2f7ff;
}
.app-shell[data-theme='dark'] .card {
background: #142a52;
border-color: #3d5685;
}
.app-shell[data-theme='dark'] .btn-secondary {
background: #1d3768;
border-color: #44639a;
color: #f2f7ff;
}
.app-shell[data-theme='dark'] .btn-success {
background: #173f33;
border-color: #3ea486;
color: #d8fff2;
}
.app-shell[data-theme='dark'] .btn-danger {
background: #3b1f2a;
border-color: #9d4f65;
color: #ffdce4;
}
.app-shell[data-theme='light'] .panel {
background: #ffffff;
border-color: #b7c7e6;
color: #132a54;
}
.app-shell[data-theme='light'] .card {
background: #f7faff;
border-color: #b7c7e6;
color: #132a54;
}
.app-shell[data-theme='light'] .panel-desc,
.app-shell[data-theme='light'] .field-label,
.app-shell[data-theme='light'] .kicker,
.app-shell[data-theme='light'] .sub,
.app-shell[data-theme='light'] .chat-time,
.app-shell[data-theme='light'] .bot-id,
.app-shell[data-theme='light'] .bot-meta {
color: var(--subtitle);
}
.app-shell[data-theme='light'] .btn-secondary {
background: #e9f1ff;
border-color: #b8cbee;
color: #163265;
}
.app-shell[data-theme='light'] .btn-success {
background: #e6f8f1;
border-color: #9fd5bf;
color: #0f6b4e;
}
.app-shell[data-theme='light'] .btn-danger {
background: #fdeeee;
border-color: #e0b0b0;
color: #8d2439;
}
.app-shell[data-theme='light'] .input,
.app-shell[data-theme='light'] .select,
.app-shell[data-theme='light'] .textarea {
background: #ffffff;
border-color: #bccbe7;
color: #132a54;
}
.app-shell[data-theme='light'] .input:disabled,
.app-shell[data-theme='light'] .select:disabled,
.app-shell[data-theme='light'] .textarea:disabled {
background: #edf2fb;
color: #5b6f97;
}
.app-shell[data-theme='light'] .modal-card {
background: #ffffff;
border-color: #b7c7e6;
color: #132a54;
}
.app-shell[data-theme='light'] .modal-card h3 {
color: var(--title);
}
@media (max-width: 1400px) {
.grid-ops {
grid-template-columns: 280px 1fr 320px;
}
.grid-ops.grid-ops-compact {
grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}
}
@media (max-width: 1160px) {
.grid-2,
.grid-ops,
.wizard-steps,
.wizard-steps-4,
.factory-kpi-grid,
.summary-grid,
.wizard-agent-layout {
grid-template-columns: 1fr;
}
.app-frame {
height: auto;
min-height: calc(100vh - 36px);
}
.app-shell {
padding: 12px;
}
.app-header-top {
flex-direction: column;
align-items: flex-start;
}
.global-switches {
width: 100%;
justify-content: flex-start;
}
.wizard-shell {
min-height: 640px;
}
}
@media (max-width: 980px) {
.grid-ops.grid-ops-compact {
grid-template-columns: 1fr;
grid-template-rows: auto auto;
}
}