* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: #0f1420;
  color: #e6e9ef;
}
.view { min-height: 100vh; }
.login-box {
  max-width: 360px;
  margin: 10vh auto;
  background: #1a2233;
  padding: 32px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.login-box h1 { font-size: 20px; margin-bottom: 4px; }
.muted { color: #9aa4b8; font-size: 13px; }
input, select, textarea, button {
  font-family: inherit;
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #2b3550;
  background: #10182a;
  color: #e6e9ef;
  font-size: 14px;
}
button {
  background: #3d6bff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: #2f56d6; }
.error { color: #ff6b6b; font-size: 13px; }
.highlight { background: #24361f; border: 1px solid #4caf50; padding: 10px; border-radius: 8px; word-break: break-all; }

#appView { display: flex; }
.sidebar {
  width: 220px;
  background: #141c2c;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar h2 { font-size: 16px; margin-bottom: 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-btn {
  background: transparent;
  border: none;
  text-align: right;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c3cadd;
}
.nav-btn.active, .nav-btn:hover { background: #263252; color: #fff; }
.logout-btn { background: #3a2233; }

.content { flex: 1; padding: 28px 32px; max-width: 1000px; }
.tab { display: none; }
.tab.active { display: block; }
.tab h2 { margin-top: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #141c2c;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.form-grid textarea { grid-column: 1 / -1; min-height: 60px; }
.form-grid button { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #232d45; font-size: 13px; }
th { color: #9aa4b8; font-weight: 500; }

.row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.row input { flex: 1; }
.row button { width: auto; padding: 10px 20px; }

.chat-box {
  height: 400px;
  overflow-y: auto;
  background: #141c2c;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { padding: 10px 14px; border-radius: 10px; max-width: 80%; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.msg.user { background: #3d6bff; align-self: flex-start; }
.msg.assistant { background: #232d45; align-self: flex-end; }
.msg.tool { background: #2a2416; align-self: flex-end; font-size: 12px; color: #d8c98a; }

small.del { color: #ff6b6b; cursor: pointer; }
