﻿:root {
  --bg-main: #36393f;
  --bg-guilds: #202225;
  --bg-channels: #2f3136;
  --bg-chat: #36393f;
  --bg-members: #2f3136;
  --bg-top: #36393f;
  --text-main: #dcddde;
  --text-soft: #96989d;
  --text-strong: #ffffff;
  --accent: #5865f2;
  --danger: #ed4245;
  --line: #232428;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "gg sans", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

.discord-shell { display: grid; grid-template-columns: 72px 260px 1fr 240px; min-height: 100vh; }
.guilds-bar { background: var(--bg-guilds); border-right: 1px solid #1a1c1f; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.guild { width: 48px; height: 48px; border-radius: 24px; background: #313338; color: #fff; display: grid; place-items: center; font-weight: 700; }
.guild.active { background: var(--accent); border-radius: 16px; }

.channels-bar { background: var(--bg-channels); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.server-title { height: 48px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; font-weight: 700; color: var(--text-strong); }
.channel-group { padding: 16px 10px; }
.group-title { color: var(--text-soft); font-size: 11px; margin: 0 6px 8px; letter-spacing: 0.04em; }
.channel { width: 100%; background: transparent; border: 0; color: var(--text-soft); text-align: left; border-radius: 4px; padding: 6px 8px; font-size: 16px; }
.channel.active { background: #42464d; color: var(--text-main); }

.connect-card { margin-top: auto; border-top: 1px solid var(--line); padding: 12px; }
label { display: block; font-size: 12px; color: var(--text-soft); margin: 8px 0 4px; }
input { width: 100%; background: #1e1f22; border: 1px solid #1a1b1e; color: var(--text-main); border-radius: 6px; padding: 8px; }
.btn-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--accent); }
.btn-danger { background: var(--danger); }
.btn:disabled { opacity: 0.5; }

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.avatar-preview {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #1a1b1e;
  border: 1px solid #2f3136;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  font-size: 12px;
  text-align: center;
  padding: 4px;
}

.avatar-upload {
  flex: 1;
  background: #2f3136;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  border: 1px dashed #484b5a;
  cursor: pointer;
}

.avatar-upload input {
  display: none;
}

.account-panel {
  margin-top: 14px;
  border-top: 1px solid #1f2128;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-status {
  font-size: 12px;
  color: #8690a2;
  margin-top: 8px;
}

.account-field {
  font-size: 12px;
  color: var(--text-soft);
}

.token-field {
  font-size: 11px;
  word-break: break-all;
}

.btn-neutral {
  background: #4f545c;
}

.main-panel { display: flex; flex-direction: column; background: var(--bg-chat); }
.topbar {
  height: 48px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-top);
}
.channel-name { color: var(--text-strong); font-weight: 700; }
.top-controls { display: flex; align-items: center; gap: 10px; }
.top-controls .server-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #a7b0c2; }
.top-status { color: var(--text-soft); font-size: 13px; margin-left: 6px; }
.icon-btn {
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  background: #4f545c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn i { font-size: 13px; }
.icon-btn.active { background: var(--danger); }
.icon-btn:disabled { opacity: 0.45; }

.chat-area { padding: 14px 16px; overflow: auto; height: calc(100vh - 48px); }
.chat-title { color: var(--text-soft); font-size: 12px; margin-bottom: 10px; }
.chat-log { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-size: 13px; line-height: 1.4; color: var(--text-main); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 27, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 24px;
}
.modal-overlay.hidden {
  display: none;
}
.modal-card {
  width: min(460px, 100%);
  background: #181b23;
  border-radius: 20px;
  border: 1px solid #2f3136;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.modal-close {
  background: #2f3136;
  border-radius: 12px;
  border: none;
  padding: 6px 10px;
}
.modal-tabs {
  display: flex;
  gap: 6px;
}
.modal-tabs .tab {
  flex: 1;
  border: 1px solid #2f3136;
  background: transparent;
  color: var(--text-soft);
  border-radius: 12px;
  padding: 8px 0;
  font-weight: 600;
  cursor: pointer;
}
.modal-tabs .tab.active {
  background: #3f444e;
  color: #fff;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-form {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.modal-form.active {
  display: flex;
}
.modal-form label {
  font-size: 12px;
  color: #8e93a2;
}
.modal-form input {
  width: 100%;
  background: #10131a;
  border: 1px solid #2f3136;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
}
.modal-status {
  font-size: 12px;
  color: #9fabbf;
  text-align: center;
}

.members-bar { background: var(--bg-members); border-left: 1px solid var(--line); padding: 14px 10px; }
.members-title { color: var(--text-soft); font-size: 11px; margin-bottom: 10px; letter-spacing: 0.04em; }
.members-list { margin: 0; padding: 0; list-style: none; }
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 4px;
  color: #dbdee1;
}
.member-item.me { background: #3f4248; color: #fff; }
.member-item.speaking { box-shadow: 0 0 0 2px #3fbf7f; border: 1px solid #3fbf7f; }
.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6a7bff, #4fce9d);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
}
.member-avatar.has-image { background-size: cover; background-position: center; }
.member-name {
  font-size: 17px;
  line-height: 1;
  color: #c9ccd1;
}
.me-name { color: #ffffff; }
.member-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-icon {
  opacity: 0.2;
  filter: grayscale(1);
  font-size: 13px;
}
.voice-icon.mic-active,
.voice-icon.sound-active {
  opacity: 1;
  filter: grayscale(0);
}
.voice-icon.active {
  color: #43b581;
  opacity: 1;
}

.admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}
.admin-panel.hidden {
  display: none;
}
.admin-content {
  background: #1f2128;
  border: 1px solid #373b43;
  border-radius: 14px;
  padding: 18px;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #d7dae0;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}
.admin-close {
  background: transparent;
  font-size: 20px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.admin-metrics {
  background: #131316;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 180px;
  overflow: auto;
}
.admin-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 1100px) {
  .discord-shell { grid-template-columns: 72px 220px 1fr; }
  .members-bar { display: none; }
}

@media (max-width: 760px) {
  .discord-shell { grid-template-columns: 1fr; }
  .guilds-bar, .channels-bar, .members-bar { display: none; }
  .topbar { position: sticky; top: 0; z-index: 10; }
  .top-controls { gap: 6px; }
  .icon-btn { padding: 6px 8px; font-size: 11px; }
  .chat-area { height: auto; min-height: calc(100vh - 48px); }
}
