/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 2rem auto;
}

/* Card */
.card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Header / Navbar */
.navbar {
  background: #0f172a;
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar a {
  color: #e2e8f0;
  text-decoration: none;
  margin-left: 1rem;
}
.navbar a:hover {
  color: #fff;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, select, textarea {
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  width: 100%;
}

button {
  background: #2563eb;
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
button:hover {
  background: #1d4ed8;
}

/* Dashboard Table */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

th {
  background: #f1f5f9;
  font-weight: 600;
}

tr:hover {
  background: #f9fafb;
}

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
}
.flash.success { background: #dcfce7; color: #166534; }
.flash.danger  { background: #fee2e2; color: #991b1b; }

/* Chat UI */
.chat-box {
  height: 60vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  background: #fff;
}

.message {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  max-width: 80%;
}

.message.user {
  background: #dbeafe;
  align-self: flex-end;
  text-align: right;
}

.message.assistant {
  background: #f1f5f9;
  align-self: flex-start;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .navbar a {
    margin: 0.25rem 0;
  }
  .chat-box {
    height: 50vh;
  }
}
