* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #111827;
}

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 270px;
  background: #111827;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  margin-bottom: 25px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  color: #9ca3af;
  font-size: 13px;
}

.sidebar label {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 10px;
}

.modules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.module {
  border: 0;
  background: transparent;
  color: #d1d5db;
  text-align: left;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.module:hover,
.module.active {
  background: #374151;
  color: white;
}

.clear {
  margin-top: auto;
  padding: 11px;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: transparent;
  color: white;
  cursor: pointer;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  height: 75px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h1 {
  margin: 0;
  font-size: 20px;
}

.chat-header p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

#status {
  color: #16a34a;
  font-size: 13px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.message {
  max-width: 850px;
  margin: 0 auto 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.user {
  background: #e5e7eb;
  padding: 12px 15px;
  border-radius: 12px;
}

.message.ai {
  padding: 5px;
}

.sender {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #6b7280;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 15px 25px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

textarea {
  flex: 1;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  outline: none;
}

textarea:focus {
  border-color: #6366f1;
}

#send {
  width: 48px;
  border: 0;
  border-radius: 10px;
  background: #111827;
  color: white;
  cursor: pointer;
}

@media (max-width: 700px) {
  .sidebar {
    width: 190px;
  }

  .messages {
    padding: 15px;
  }

  .chat-header {
    padding: 12px 15px;
  }

  .composer {
    padding: 10px;
  }
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: #111827;
  color: white;
  font-size: 21px;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 700px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,.45);
  }

  .chat-header {
    padding-left: 70px;
  }
}
