:root {
  --ink: #1a1f2b;
  --muted: #6b7280;
  --line: #e5e1db;
  --surface: #ffffff;
  --canvas: #f5f1ec;
  --navy: #111827;
  --blue: #5e6ad2;
  --sky: #eef0ff;
  --orange: #e85d2a;
  --orange-soft: #fff0e8;
  --green: #168a58;
  --red: #c94c42;
  --shadow: 0 12px 32px rgba(27, 31, 35, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.text-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; color: var(--ink); background: var(--canvas); }
.text-input:focus { outline: 3px solid rgba(94, 106, 210, .16); border-color: var(--blue); }
.field-help { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 10px 0 16px; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--canvas); padding: 2px 5px; border-radius: 5px; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 10% 0%, #ebe6df, transparent 38%), var(--canvas); }
.login-card { width: min(460px, 100%); background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; padding: 38px; box-shadow: var(--shadow); }
.brand-mark { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: 800; font-size: 22px; }
.brand-mark .logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: white; background: linear-gradient(140deg, var(--navy), var(--blue)); box-shadow: 0 8px 18px rgba(18,59,93,.22); }
.login-card h1 { margin: 38px 0 10px; font-size: 32px; letter-spacing: -.04em; }
.login-card p { color: var(--muted); line-height: 1.7; margin: 0 0 28px; }
.demo-accounts { display: grid; gap: 10px; margin-top: 18px; }
.demo-account { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fbfdff; color: var(--ink); text-align: left; }
.demo-account:hover { border-color: var(--blue); background: var(--sky); }
.demo-account small { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding: 24px 16px; background: #10141d; color: white; display: flex; flex-direction: column; gap: 24px; }
.sidebar .brand-mark { color: white; padding: 0 10px; }
.sidebar .brand-mark .logo { background: rgba(255,255,255,.15); box-shadow: none; }
.role-pill { margin: 0 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.1); color: #d8e8f4; font-size: 13px; }
.nav-group { display: grid; gap: 5px; }
.nav-label { color: #8ca9bd; font-size: 11px; letter-spacing: .12em; padding: 0 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; color: #c4d7e4; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.12); color: white; }
.sidebar-footer { margin-top: auto; color: #92afc1; font-size: 12px; padding: 8px 10px; line-height: 1.6; }

.main { min-width: 0; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.project-select, .role-switch { background: #f4f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink); }
.role-switch { display: flex; padding: 3px; gap: 2px; }
.role-switch button { padding: 7px 10px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.role-switch button.active { background: white; color: var(--navy); box-shadow: 0 2px 8px rgba(30,61,87,.08); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--orange-soft); color: #b85820; font-weight: 800; }
.content { padding: 30px 32px 52px; max-width: 1500px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.05em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border-radius: 8px; background: var(--navy); color: white; font-weight: 700; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--sky); color: var(--navy); }
.btn.orange { background: var(--orange); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }

.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(27,31,35,.035); }
.kpi { padding: 20px; position: relative; overflow: hidden; }
.kpi:after { content: ""; width: 80px; height: 80px; position: absolute; right: -28px; bottom: -32px; border-radius: 50%; background: var(--sky); }
.kpi.orange:after { background: var(--orange-soft); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { margin: 10px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.delta { font-size: 12px; color: var(--green); }
.split-grid { grid-template-columns: minmax(0, 1.4fr) minmax(310px, .8fr); margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; }
.card-head h3 { margin: 0; font-size: 16px; }
.card-head small { color: var(--muted); }
.card-body { padding: 0 22px 22px; }
.metric-row { display: grid; grid-template-columns: 1fr 70px; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eff3f6; }
.metric-row:last-child { border-bottom: 0; }
.metric-label { font-size: 13px; }
.bar { height: 7px; margin-top: 8px; border-radius: 99px; background: #edf2f5; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #54b1d5); }
.metric-value { text-align: right; font-weight: 800; }
.alert-list { display: grid; gap: 10px; }
.alert { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #fffaf6; }
.alert.high { background: #fff4f2; }
.alert-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--orange-soft); color: var(--orange); }
.alert.high .alert-icon { background: #ffe3df; color: var(--red); }
.alert strong { display: block; font-size: 13px; }
.alert span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 99px; background: var(--sky); color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.orange { background: var(--orange-soft); color: #bb5b20; }
.tag.green { background: #e7f6ef; color: var(--green); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { color: var(--muted); font-weight: 600; text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 0; border-bottom: 1px solid #eff3f6; }
.table tr:last-child td { border-bottom: 0; }

.trainee-hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.welcome-card { min-height: 230px; padding: 28px; border-radius: 16px; color: white; background: linear-gradient(135deg, #111827 0%, #263b60 100%); position: relative; overflow: hidden; }
.welcome-card:after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -80px; top: -80px; background: rgba(255,255,255,.08); }
.welcome-card h1 { margin: 10px 0 8px; font-size: 30px; letter-spacing: -.05em; }
.welcome-card p { color: #d7e8f3; max-width: 440px; line-height: 1.65; }
.welcome-card .btn { margin-top: 14px; background: white; color: var(--navy); }
.level-card { padding: 24px; }
.level-ring { width: 112px; height: 112px; margin: 5px auto 16px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--orange) 0 72%, #edf2f5 72% 100%); position: relative; }
.level-ring:after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: white; }
.level-ring strong { z-index: 1; font-size: 24px; }
.level-card h3, .level-card p { text-align: center; margin: 0; }
.level-card p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.task-card { padding: 22px; }
.task-card h3 { margin: 8px 0; font-size: 18px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.progress { height: 8px; border-radius: 99px; background: #edf2f5; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #f6b77e); }
.mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 16px; margin-top: 16px; }
.mobile-nav button { padding: 9px 5px; background: transparent; color: var(--muted); border-radius: 11px; font-size: 11px; }
.mobile-nav button.active { color: var(--navy); background: var(--sky); font-weight: 800; }

.chat-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 16px; }
.chat-card { min-height: 660px; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.owner { display: flex; align-items: center; gap: 12px; }
.owner-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--orange-soft); color: #b4571f; font-weight: 800; }
.owner strong { display: block; }
.owner span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.chat-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; }
.chat-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chat-messages { flex: 1; padding: 22px; display: grid; align-content: start; gap: 16px; background: #fbfdff; }
.message { max-width: 78%; display: grid; gap: 6px; }
.message.owner-msg { justify-self: start; }
.message.trainee-msg { justify-self: end; }
.bubble { padding: 13px 15px; border-radius: 15px; line-height: 1.65; font-size: 14px; }
.owner-msg .bubble { background: white; border: 1px solid var(--line); border-top-left-radius: 5px; }
.trainee-msg .bubble { color: white; background: var(--navy); border-top-right-radius: 5px; }
.message-meta { color: var(--muted); font-size: 11px; }
.message.trainee-msg .message-meta { text-align: right; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; background: white; border: 1px solid var(--line); }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: #9cb0bf; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.chat-input { padding: 16px; border-top: 1px solid var(--line); background: white; }
.chat-input textarea { width: 100%; min-height: 76px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--ink); }
.chat-input textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,123,181,.1); }
.chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.chat-actions small { color: var(--muted); }
.prompt-panel { display: grid; align-content: start; gap: 12px; }
.jev-capsule { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #cfe7d9; border-radius: 999px; color: #206c4e; background: linear-gradient(135deg, #f2fbf6, #e5f6ed); text-align: left; box-shadow: 0 8px 20px rgba(46,155,118,.11); }
.jev-capsule:hover { border-color: #9bd1b5; transform: translateY(-1px); }
.capsule-spark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #d2efdf; color: var(--green); }
.jev-capsule strong, .jev-capsule small { display: block; }
.jev-capsule strong { font-size: 12px; }
.jev-capsule small { margin-top: 2px; color: #5b8974; font-size: 11px; }
.capsule-arrow { margin-left: auto; font-size: 16px; }
.capsule-close { width: 26px; height: 26px; border-radius: 50%; color: var(--muted); background: #f5f8fa; font-size: 18px; line-height: 1; }
.capsule-close:hover { background: var(--sky); color: var(--navy); }
.prompt-card { padding: 18px; }
.prompt-card h3 { margin: 0 0 12px; font-size: 15px; }
.prompt-list { display: grid; gap: 10px; }
.prompt-item { padding: 11px 12px; border-radius: 11px; background: #f7fafc; color: #496074; font-size: 13px; line-height: 1.55; }
.prompt-item strong { display: block; color: var(--navy); font-size: 11px; margin-bottom: 4px; letter-spacing: .04em; }
.confidence { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; background: #e8f6ef; border-radius: 11px; color: var(--green); font-size: 12px; }
.report-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; }
.score-card { padding: 26px; text-align: center; background: linear-gradient(145deg, #143d5e, #245f8b); color: white; border-radius: 20px; }
.score-card .score { font-size: 64px; font-weight: 900; letter-spacing: -.08em; margin: 12px 0 0; }
.score-card small { color: #c7e0ef; }
.trend { display: flex; align-items: end; gap: 9px; height: 140px; padding: 20px 12px 0; }
.trend span { flex: 1; display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.trend i { width: 100%; max-width: 32px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, var(--orange), #f6c28f); min-height: 18px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; padding: 13px 16px; border-radius: 13px; color: white; background: var(--navy); box-shadow: var(--shadow); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1050px) { .app-shell { grid-template-columns: 78px minmax(0,1fr); } .sidebar { padding: 20px 10px; } .sidebar .brand-mark span, .nav-label, .nav-item span, .role-pill, .sidebar-footer { display: none; } .sidebar .brand-mark { justify-content: center; padding: 0; } .nav-item { justify-content: center; } .content { padding: 24px; } .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .app-shell { display: block; } .sidebar { display: none; } .topbar { padding: 13px 16px; min-height: 66px; } .topbar h2 { font-size: 17px; } .topbar-left { min-width: 0; } .project-select { max-width: 130px; } .role-switch button { padding: 7px 8px; } .content { padding: 18px 14px 34px; } .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; } .kpi-grid, .split-grid, .trainee-hero, .chat-layout, .report-grid { grid-template-columns: 1fr; } .chat-card { min-height: 620px; } .message { max-width: 88%; } .mobile-nav { position: sticky; bottom: 10px; z-index: 8; box-shadow: 0 8px 28px rgba(30,61,87,.12); } }
.jev-capsule { position: sticky; top: 90px; z-index: 4; }
@media (max-width: 760px) { .jev-capsule { position: sticky; top: auto; bottom: 16px; } }
@media (max-width: 420px) { .role-switch button { font-size: 10px; padding: 6px; } .topbar-right .project-select { display: none; } .welcome-card h1 { font-size: 26px; } }

