:root {
  --bg: #f8fafc;
  --surface: #fff;
  --surface-soft: #f9fbff;
  --ink: #1e293b;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #10b981;
  --primary-soft: #ecfdf5;
  --secondary: #3b82f6;
  --purple: #8b5cf6;
  --orange: #f59e0b;
  --red: #ef4444;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --nav: #0b1220;
  --nav-muted: #7d89a5;
  --radius: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: "LXGW WenKai", Inter, "SF Pro Display", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; color: var(--text); background: var(--bg); }
.mdi { line-height: 1; vertical-align: middle; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(16,185,129,.20); outline-offset: 2px; }

.eyebrow { color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 4px; color: var(--ink); font-size: 24px; line-height: 1.25; font-weight: 700; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,24,40,.08); }
.btn:active, .mini-btn:active, .chip:active, .nav-btn:active { transform: scale(.97); }
.btn.primary { border-color: transparent; background: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(51,92,255,.22); }
.btn.success { border-color: transparent; background: var(--success); color: #fff; }
.btn.danger { border-color: rgba(180,35,24,.18); background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; }

.badge { display: inline-flex; min-height: 26px; align-items: center; padding: 4px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 780; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.panel {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  transition: box-shadow 160ms var(--ease);
}
.panel:hover { box-shadow: 0 4px 10px rgba(15,23,42,.08); }

.mini-btn { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); font-size: 12px; font-weight: 750; }

@keyframes grow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.message-list-enter-active, .message-list-leave-active { transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.message-list-enter-from { opacity: 0; transform: translateY(8px) scale(.98); }
.message-list-leave-to { opacity: 0; transform: translateY(-6px) scale(.98); }

@media (max-width: 1180px) {
  .metric-strip, .overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { flex-direction: column; padding: 18px 16px; }
  .top-actions, .search, .btn { width: 100%; }
  .filters, .metric-strip, .overview-grid, .donut-layout, .dialog-body, .dialog-foot, .review-summary, .chat-hero { grid-template-columns: 1fr; }
  .filters, .workarea { padding-inline: 16px; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-row strong { text-align: left; }
  .case-panel { border-left: 0; border-top: 1px solid var(--line); }
  .review-summary { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
