:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dbe3ef;
  --brand: #2563eb;
  --brand-soft: #e8f0ff;
  --ok: #0f8b5f;
  --warn: #b86b00;
  --bad: #b42318;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #111827;
  color: #e5e7eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  color: #9ca3af;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  background: #1f2937;
  color: #ffffff;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.subtle {
  color: var(--muted);
}

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

button,
.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
.button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.stat-value {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 800;
}

.trend {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ecfdf3;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#ffffff, #f8fafc);
}

.bar {
  flex: 1;
  min-width: 24px;
  border-radius: 6px 6px 0 0;
  background: var(--brand);
}

.bar.alt {
  background: #14b8a6;
}

.feed,
.task-list,
.message-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.feed li,
.task-list li,
.message-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.feed li:last-child,
.task-list li:last-child,
.message-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.badge.warn {
  background: #fff7ed;
  color: var(--warn);
}

.badge.bad {
  background: #fef3f2;
  color: var(--bad);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.toggle:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
}

.switch.on {
  background: var(--brand);
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
}

.switch.on::after {
  left: 24px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed #b8c2d6;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.chat-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.chat-rail {
  border-right: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px;
}

.chat-body {
  padding: 18px;
}

.bubble {
  max-width: 70%;
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 12px;
  background: #f1f5f9;
}

.bubble.me {
  margin-left: auto;
  background: var(--brand-soft);
}

.note {
  border-left: 4px solid var(--brand);
  padding: 12px 14px;
  background: var(--brand-soft);
  color: #1e3a8a;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}
