* { box-sizing: border-box; }
body { margin: 0; font-family: Segoe UI, Arial, sans-serif; background: #f4f6f8; color: #1f2933; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 100vh; }
.workspace { padding: 24px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 16px; margin-bottom: 12px; }
button, select, textarea { font: inherit; border: 1px solid #cbd5df; border-radius: 6px; background: white; }
button { padding: 10px 14px; cursor: pointer; background: #1f6feb; color: white; border-color: #1f6feb; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.filters select { padding: 10px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi, .panel { background: white; border: 1px solid #d9e2ec; border-radius: 8px; padding: 14px; }
.kpi span { display: block; color: #607080; font-size: 13px; }
.kpi strong { display: block; font-size: 22px; margin-top: 6px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 160px minmax(0, 1fr) 80px; gap: 8px; align-items: center; font-size: 13px; }
.barTrack { height: 12px; background: #e6edf3; border-radius: 99px; overflow: hidden; }
.barFill { height: 100%; background: #2da44e; }
.tableWrap { overflow: auto; max-height: 320px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px; border-bottom: 1px solid #e6edf3; text-align: left; white-space: nowrap; }
.chat { border-left: 1px solid #d9e2ec; background: #ffffff; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chatHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chatHeader h2 { margin-bottom: 0; }
.chatHeader button { padding: 7px 10px; font-size: 13px; }
.messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px; border-radius: 8px; background: #f4f6f8; white-space: pre-wrap; }
.msg.user { background: #e8f1ff; }
#chatForm { display: grid; gap: 8px; }
textarea { resize: vertical; padding: 10px; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .chat { border-left: 0; border-top: 1px solid #d9e2ec; min-height: 420px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters, .grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
