@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-strong: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #ecfeff 50%, #fef3c7 100%);
  color: var(--text);
}

.wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.wrap.admin {
  place-items: stretch;
  padding: 20px;
}

.card {
  width: min(780px, 100%);
  background: var(--panel);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.card.admin-card {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 40px);
  padding: 0;
  background: transparent;
  box-shadow: none;
}

h1 {
  margin: 0 0 12px;
  font-size: 30px;
}

p {
  margin: 0 0 16px;
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

label {
  font-weight: 600;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

button,
a.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  min-height: 36px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
a.button:hover {
  background: var(--accent-strong);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 14px;
  color: #334155;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  background: #f8fafc;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  min-height: calc(100vh - 40px);
}

.admin-sidebar {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  height: calc(100vh - 40px);
  position: sticky;
  top: 20px;
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  display: grid;
  gap: 10px;
}

.sidebar-footer .button {
  width: 100%;
  justify-content: center;
}

.admin-sidebar h2 {
  margin: 0;
  font-size: 20px;
  color: #f8fafc;
}

.nav-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  justify-content: flex-start;
}

.nav-item.active {
  background: #38bdf8;
  color: #0f172a;
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 40px);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  position: sticky;
  top: 20px;
  z-index: 2;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 20px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
}

.stat-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #64748b;
}

.stat-card div {
  font-size: 20px;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.table th {
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
}

.suite-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 40px);
}

.suite-sidebar {
  background: #111827;
  color: #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  height: calc(100vh - 40px);
  position: sticky;
  top: 20px;
}

.suite-sidebar h2 {
  margin: 0;
  font-size: 18px;
  color: #f9fafb;
}

.suite-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  position: sticky;
  top: 20px;
  z-index: 2;
}

.suite-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.suite-section {
  display: none;
}

.suite-section.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .suite-shell {
    grid-template-columns: 1fr;
  }
}

.chat {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.chat-log {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
}

.msg {
  padding: 12px 14px;
  border-radius: 14px;
  width: fit-content;
  max-width: 80%;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.user {
  background: #0f766e;
  color: #fff;
  margin-left: auto;
}

.msg.assistant {
  background: #e2e8f0;
  color: #0f172a;
}

.chat-input {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 1.2em;
  margin-bottom: 1.2em;
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  resize: vertical;
}

.chat-input button {
  align-self: flex-start;
  height: 44px;
}

.small {
  font-size: 12px;
  color: #64748b;
}

.report-fields {
  display: grid;
  gap: 14px;
}

.report-category {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 14px;
}

.report-category summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}

.report-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
}

.report-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.report-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.report-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #334155;
}

.report-radio-item input {
  width: auto;
}
