* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f1115;
  color: #e8ecf1;
}

body {
  overflow: hidden;
}

#admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

#sidebar {
  background: #171b22;
  border-right: 1px solid #2b313c;
  padding: 20px;
  overflow-y: auto;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.status-box {
  background: #1f2630;
  border: 1px solid #313949;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  font-weight: 600;
}

.sidebar-note {
  color: #aab4c3;
  font-size: 14px;
  line-height: 1.5;
}

#chat-window {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
}

#messages-flow {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px 12px;
  scroll-behavior: smooth;
}

.message {
  display: block;
  max-width: min(900px, 100%);
  width: fit-content;
  min-width: 180px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.message.system {
  background: #1b2330;
  border: 1px solid #324055;
}

.message.user {
  background: #1d2b1f;
  border: 1px solid #35503a;
  margin-left: auto;
}

.message.ai {
  background: #201d2f;
  border: 1px solid #413a63;
}

#input-dock {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-top: 1px solid #2b313c;
  padding: 16px 20px 20px;
  background: #141922;
}

#suggestions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#suggestions button,
#send-btn {
  background: #2a3342;
  color: #e8ecf1;
  border: 1px solid #3c4759;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

#suggestions button:hover,
#send-btn:hover {
  background: #364255;
}

#suggestions button:disabled,
#send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

#user-query {
  width: 100%;
  min-width: 0;
  background: #0f141c;
  color: #e8ecf1;
  border: 1px solid #364255;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
}

#user-query:focus {
  outline: none;
  border-color: #5b6f94;
}

#user-query:disabled {
  opacity: 0.75;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  #admin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
    min-height: 100dvh;
  }

  #sidebar {
    border-right: 0;
    border-bottom: 1px solid #2b313c;
    max-height: 180px;
  }

  #chat-window {
    height: auto;
    min-height: 0;
  }

  #messages-flow {
    max-height: none;
  }
}
.result-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-banner {
  display: inline-block;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.result-banner.success {
  background: #16361f;
  color: #b7f7c8;
  border: 1px solid #2e6b40;
}

.result-banner.warn {
  background: #3d2d12;
  color: #ffd998;
  border: 1px solid #7d5a1d;
}

.result-banner.error {
  background: #3b1818;
  color: #ffb3b3;
  border: 1px solid #7d2d2d;
}

.result-meta-line {
  font-size: 13px;
  line-height: 1.4;
  color: #d7dbe3;
}

.tool-result {
  margin-top: 8px;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  overflow: hidden;
  background: #11151c;
}

.tool-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2f3a;
  background: #161b22;
}

.tool-result-title {
  font-size: 14px;
  font-weight: 700;
  color: #f3f6fb;
}

.tool-result-meta {
  font-size: 12px;
  color: #98a2b3;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #222834;
  vertical-align: top;
}

.result-table th {
  background: #0f1319;
  color: #cfd6e4;
  font-weight: 600;
}

.result-table td {
  color: #e6ebf2;
}

.result-table tr:last-child td {
  border-bottom: none;
}

.message.ai pre,
.tool-result pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
  color: #dce3ee;
  background: #0d1117;
}