* {
  box-sizing: border-box;
  font-family: "Inter", "SF Pro Text", system-ui, sans-serif;
}

body {
  margin: 0;
  background: #0f1115;
  color: #f5f6f7;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #12151b;
  border-bottom: 1px solid #1f2430;
}

.top-actions {
  display: flex;
  gap: 10px;
}

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

.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #2563eb;
}

.title {
  font-size: 16px;
  font-weight: 600;
}

.subtitle {
  font-size: 12px;
  color: #98a2b3;
}

.content {
  flex: 1;
  padding: 20px;
  padding-bottom: 88px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

.muted {
  color: #98a2b3;
  font-size: 13px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: #171a22;
  border: 1px solid #222839;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card.primary {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  font-size: 13px;
  color: #98a2b3;
}

.metric {
  font-size: 20px;
  font-weight: 600;
}

.metric-sub {
  font-size: 12px;
  color: #98a2b3;
}

.primary-button,
.ghost-button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.ghost-button.small {
  padding: 6px 10px;
  font-size: 12px;
  width: fit-content;
}

.primary-button {
  background: #2563eb;
  color: #fff;
}

.ghost-button {
  background: transparent;
  color: #cbd5f5;
  border: 1px solid #2b3347;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  background: #171a22;
  border: 1px solid #222839;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.list-item h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.list-item p {
  margin: 0;
  font-size: 12px;
  color: #a2acc0;
}

.habit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.habit-actions input {
  padding: 8px 10px;
}

.form-card {
  margin-bottom: 16px;
}

.connected-as {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label span {
  display: block;
  font-size: 12px;
  color: #98a2b3;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2b3347;
  background: #10131a;
  color: #f5f6f7;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2b3347;
  background: #10131a;
  color: #f5f6f7;
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #12151b;
  border-top: 1px solid #1f2430;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 12px 12px;
}

.nav-item {
  background: transparent;
  border: none;
  color: #98a2b3;
  padding: 8px 0;
  font-weight: 600;
  cursor: pointer;
}

.nav-item.active {
  color: #f5f6f7;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hidden {
  display: none;
}

.chat-window {
  min-height: 320px;
  background: #171a22;
  border: 1px solid #222839;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #2563eb;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: #202636;
  color: #d7ddef;
}

.chat-input {
  display: flex;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: #202636;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

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