:root {
  --bg: #f6fbff;
  --surface: #ffffff;
  --line: #d8e8f8;
  --text: #17334f;
  --primary: #3b8ed6;
  --secondary: #ff8f62;
  --accent: #4ecdc4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.2rem;
  position: relative;
  overflow-x: hidden;
}

.background-sheen {
  position: fixed;
  inset: -20% -20% auto;
  height: 500px;
  background: radial-gradient(circle at 10% 10%, rgba(78,205,196,.35), transparent 45%),
              radial-gradient(circle at 70% 5%, rgba(255,143,98,.25), transparent 50%);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  gap: 1rem;
  box-shadow: 0 14px 30px rgba(23, 51, 79, 0.08);
}

.topbar h1 { margin: 0; font-size: 1.7rem; }
.topbar p { margin: 0.2rem 0 0; opacity: .8; }

.auth-mini {
  display: flex;
  align-items: center;
}

.auth-mini .logout {
  padding: .45rem .65rem;
  background: #fff2f2;
  color: #8d3b40;
  border: 1px solid #ffc2c2;
  border-radius: 999px;
  text-decoration: none;
  font-size: .85rem;
}

.mascot-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.mascot {
  font-size: 1.8rem;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  background: #fff6e3;
  border-radius: 50%;
  border: 2px solid #ffcf8f;
  animation: bounce 1.8s ease-in-out infinite;
}

.mascot-wrap span {
  font-size: .95rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px dashed #ffd8a8;
}

main {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.panel h2 {
  margin: .2rem 0 0.7rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .8rem;
}

.card {
  border: 1px solid #dce9f8;
  border-radius: 14px;
  padding: .8rem;
  background: linear-gradient(160deg, #fff, #eef8ff);
}

.card p {
  margin: .4rem 0 0;
  font-size: 1.7rem;
  font-weight: 700;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.compact-form {
  display: grid;
  gap: .5rem;
  margin-bottom: 0.8rem;
}

input, textarea, button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .7rem;
  font: inherit;
}

button {
  background: linear-gradient(180deg, #3b8ed6, #2f78b4);
  color: white;
  border: none;
  cursor: pointer;
}

button:hover { filter: brightness(0.98); }

.list {
  display: grid;
  gap: .6rem;
}

.list-item {
  border: 1px solid var(--line);
  background: #f8fcff;
  border-radius: 10px;
  padding: .6rem .7rem;
}

.list-item strong { display: block; margin-bottom: .2rem; }

.chat-window {
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem;
  background: #f8fcff;
  margin-bottom: .6rem;
}

.chat-msg { margin-bottom: .7rem; }

.chat-msg .who {
  font-size: .8rem;
  color: #3a5980;
}

footer {
  border-top: 1px solid var(--line);
  padding-top: .6rem;
  color: #4a6484;
  font-size: .9rem;
}

.muted {
  color: #4e6f93;
}

.login-wrap {
  min-height: calc(100vh - 2.4rem);
  display: grid;
  place-items: center;
}

.login-box {
  width: min(430px, 92%);
  text-align: center;
}

.error {
  color: #a3363d;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
