* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100vh;
}

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

.sidebar {
  width: 260px;
  background: #f4f4f5;
  border-right: 1px solid #d9d9dc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar button#new-session-btn {
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

#session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#session-list li {
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#session-list li:hover {
  background: #e8e8ea;
}

#session-list li.active {
  background: #d8e6ff;
  font-weight: 600;
}

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

.connector-panel {
  border-bottom: 1px solid #d9d9dc;
  padding: 12px;
  background: #fafafa;
}

.connector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connector-header h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.connector-header p {
  margin: 0;
  font-size: 12px;
  color: #555;
}

.connector-header button,
.connector-form button {
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.connector-form {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.connector-form input {
  min-width: 0;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 13px;
}

.inventory-table-wrap {
  margin-top: 10px;
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
  color: #333;
}

.inventory-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.inventory-table-wrap th,
.inventory-table-wrap td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: left;
  white-space: nowrap;
}

.inventory-table-wrap th {
  background: #f0f0f1;
  font-weight: 600;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.message.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.message.assistant {
  align-self: flex-start;
  background: #eee;
  color: #111;
}

.message-form {
  display: flex;
  padding: 12px;
  border-top: 1px solid #d9d9dc;
  gap: 8px;
}

#message-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 14px;
}

.message-form button {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #d9d9dc;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.sidebar-footer .user-email {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555;
}

.sidebar-footer button {
  padding: 6px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.login-layout {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f5;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card h1 {
  margin: 0 0 20px;
  font-size: 20px;
}

.login-error {
  color: #c0392b;
  font-size: 13px;
  margin-bottom: 16px;
}

.google-login-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
