:root {
  --bg: #edf2f7;
  --card: #ffffff;
  --line: #dde5ef;
  --muted: #728195;
  --text: #1f2a38;
  --blue: #4d8dff;
  --blue-dark: #2b6ddd;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.auth-page { min-height: 100vh; padding: 36px; background: linear-gradient(180deg, #eef6ff, #edf2f7 40%); }
.auth-brand { max-width: 1180px; margin: 0 auto 24px; display: flex; align-items: center; gap: 16px; }
.auth-brand img { width: 72px; height: 72px; border-radius: 18px; }
.auth-brand h1 { margin: 0; font-size: 34px; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); }
.auth-layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(36, 51, 81, 0.07);
}
.hero-panel { background: linear-gradient(135deg, #ddedff, #ffffff 50%, #f0e6ff); }
.hero-panel ul { line-height: 1.9; padding-left: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn, .icon-btn, .primary-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
}
.tab-btn { background: #eef4fb; }
.tab-btn.active, .primary-btn { background: var(--blue); color: white; }
.small-btn { padding: 10px 14px; }
.form-col { display: flex; flex-direction: column; gap: 12px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px 15px;
}
textarea { min-height: 120px; resize: vertical; }
.global-status { min-height: 20px; margin-bottom: 12px; color: #17764b; }
.global-status.error { color: #b13030; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  background: #f8fbff;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 12px 18px; font-size: 26px; font-weight: 800; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 4px;
  border: none;
  border-radius: 14px;
  color: #405065;
  background: transparent;
}
.nav-item.active, .nav-item:hover { background: #eaf1fb; color: #17335f; }
.main-area { display: flex; flex-direction: column; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.search { max-width: 520px; background: #f5f8fc; }
.top-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { background: #eef4fb; color: #31517d; }
.text-btn { padding-inline: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.banner {
  margin: 18px 24px 0;
  background: linear-gradient(135deg, #fff7dc, #ffefb6);
  border: 1px solid #f0db8d;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.content { padding: 24px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cover { height: 220px; border-radius: 20px; background: linear-gradient(135deg, #dfefff, #bfe2ff 45%, #d9cbff); }
.profile-head { display: flex; gap: 18px; align-items: flex-end; margin-top: -52px; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #4e8fff, #7c64ff);
}
.avatar.small { width: 36px; height: 36px; font-size: 14px; }
.avatar.xl {
  width: 112px;
  height: 112px;
  font-size: 40px;
  border: 5px solid white;
  box-shadow: 0 8px 24px rgba(48, 68, 107, 0.16);
}
.mini-cards, .cards-grid { display: grid; gap: 14px; }
.mini-cards { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 22px; }
.mini-card, .demo-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #f7faff;
}
.mini-card { text-align: left; }
.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.kv:last-child { border-bottom: none; }
.feed-layout { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 20px; }
.row { display: flex; align-items: center; }
.row-end { display: flex; justify-content: flex-end; margin-top: 12px; }
.gap-12 { gap: 12px; }
.top-gap { margin-top: 16px; }
.post-card { display: flex; flex-direction: column; gap: 14px; }
.post-head { display: flex; gap: 12px; align-items: center; }
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #edf1f5;
}
.list-item:last-child { border-bottom: none; }
.pill {
  background: #edf5ff;
  color: #2b61b6;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.messenger-panel { display: grid; grid-template-columns: 300px 1fr; padding: 0; overflow: hidden; min-height: 72vh; }
.chat-list { background: #fbfcff; border-right: 1px solid var(--line); padding: 18px; }
.chat-user {
  width: 100%; border: none; background: transparent; padding: 12px; border-radius: 16px; display: flex; gap: 12px; text-align: left; margin-bottom: 6px;
}
.chat-user.active, .chat-user:hover { background: #eef4ff; }
.chat-panel { display: flex; flex-direction: column; }
.chat-header { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-messages { flex: 1; min-height: 420px; background: linear-gradient(180deg, #f9fbfe, #f3f7fd); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 70%; background: white; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 14px; display: inline-flex; flex-direction: column; gap: 6px; }
.bubble.me { align-self: flex-end; background: #dcebff; border-radius: 18px 18px 6px 18px; }
.bubble span { color: var(--muted); font-size: 12px; }
.chat-send { display: flex; gap: 12px; padding: 18px; border-top: 1px solid var(--line); }
.center-box { text-align: center; }
.fake-qr {
  width: 180px; height: 180px; margin: 18px auto; border-radius: 24px; display: grid; place-items: center; font-size: 42px; font-weight: 900; color: white;
  background: repeating-linear-gradient(45deg, #3a73ff 0, #3a73ff 14px, #1e2d4f 14px, #1e2d4f 28px);
}
.nice-list { line-height: 1.9; padding-left: 18px; }
.cards-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.demo-card { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.demo-preview { width: 100%; height: 140px; border-radius: 18px; background: linear-gradient(135deg, #dbe8ff, #f0ddff); display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #3057a7; }
.emoji-big { font-size: 56px; }
.tall-box { min-height: 70vh; display: grid; place-items: center; }
.empty-state { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.settings-panel { max-width: 780px; }
.settings-panel label { display: block; margin-top: 16px; font-weight: 600; }

@media (max-width: 1100px) {
  .auth-layout, .shell, .grid-2, .feed-layout, .messenger-panel, .cards-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}

@media (max-width: 760px) {
  .auth-page, .content { padding: 16px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .banner { margin: 12px 16px 0; flex-direction: column; align-items: flex-start; }
  .mini-cards, .cards-grid { grid-template-columns: 1fr 1fr; }
  .row, .chat-send { flex-direction: column; }
}
