@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── TOKENS ──────────────────────────────────────── */
:root {
  --bg:           #070b13;
  --surface:      #0c1120;
  --surface-2:    #101828;
  --surface-3:    #141f31;
  --border:       rgba(255,255,255,.07);
  --border-hover: rgba(255,255,255,.13);
  --gold:         #d4af37;
  --gold-bg:      rgba(212,175,55,.1);
  --gold-border:  rgba(212,175,55,.22);
  --text:         #e8edf5;
  --muted:        #5e6e8a;
  --muted-2:      #8a98b0;
  --green:        #22c55e;
  --red:          #ef4444;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --sidebar-w:    220px;
}

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #000;
  flex-shrink: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gold-border);
}

.logo-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
}
.logo-text span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 8px 6px;
}

.nav-item {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .12s, color .12s;
}
.nav-item svg { flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--gold-bg);
  color: var(--text);
  border: 1px solid var(--gold-border);
}
.nav-item.active svg { opacity: 1; color: var(--gold); }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted-2);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── LAYOUT ──────────────────────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ──────────────────────────────────────── */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: baseline; gap: 12px; }

.page-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--gold);
  text-transform: uppercase;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, transform .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}
.btn-primary:hover { background: #c9a52e; border-color: #c9a52e; }

.btn-ghost {
  background: transparent;
  color: var(--muted-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-hover); }

.btn-danger {
  background: rgba(239,68,68,.12);
  color: #f87171;
  border-color: rgba(239,68,68,.2);
}
.btn-danger:hover { background: rgba(239,68,68,.2); }

/* ── SELECT ──────────────────────────────────────── */
.select-guild {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  min-width: 200px;
  cursor: pointer;
  outline: none;
}
.select-guild:focus { border-color: var(--gold-border); }

/* ── CONTENT ─────────────────────────────────────── */
.content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

.page { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; } }

/* ── HERO BANNER ─────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, rgba(212,175,55,.08) 0%, rgba(255,255,255,.02) 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -60px;
  right: 120px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(212,175,55,.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-banner-left { flex: 1; }

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 24px rgba(212,175,55,.3));
  margin-left: 24px;
}

.hero-banner .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero-banner h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: 6px;
}

.hero-sub { color: var(--muted-2); font-size: 13.5px; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(34,197,94,.1);
  color: #4ade80;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }

/* ── KPI ROW ─────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 4px;
  color: var(--text);
}

.kpi-sub { font-size: 12px; color: var(--muted); }

/* ── SHORTCUTS ───────────────────────────────────── */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.shortcut-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.shortcut-card:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.shortcut-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
  font-size: 18px;
}

.shortcut-card h3 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.shortcut-card p { font-size: 12px; color: var(--muted-2); }

.shortcut-arrow { margin-left: auto; flex-shrink: 0; color: var(--muted); opacity: .5; }
.shortcut-card:hover .shortcut-arrow { opacity: 1; color: var(--gold); }

/* ── SECTION BAR ─────────────────────────────────── */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-bar h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  margin-bottom: 3px;
}

.section-bar p { font-size: 13px; color: var(--muted-2); }

/* ── SERVER HERO ─────────────────────────────────── */
.server-hero {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.server-hero-left { display: flex; align-items: center; gap: 18px; }

.server-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}
.server-avatar img { width: 100%; height: 100%; object-fit: cover; }

.server-hero h2 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin: 3px 0; }
.muted { color: var(--muted-2); font-size: 13px; }

/* ── GUILD LIST ──────────────────────────────────── */
.guild-list { display: flex; flex-direction: column; gap: 8px; }

.guild-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background .15s, border-color .15s;
}
.guild-card:hover { background: var(--surface-3); border-color: var(--border-hover); }

.guild-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

.guild-info { flex: 1; min-width: 0; }
.guild-info h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-info p { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.guild-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.badge-admin {
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(34,197,94,.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.guild-card .btn { flex-shrink: 0; }

/* ── FORMS ───────────────────────────────────────── */
.config-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 12px;
}

.block-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.block-sub {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted-2);
}

input, select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-border); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; }

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ── TICKET CARDS ────────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }

.ticket-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  transition: border-color .15s;
}
.ticket-card:hover { border-color: var(--border-hover); }

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

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

.ticket-emoji-box {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ticket-header h3 { font-size: 14px; font-weight: 700; }
.ticket-header p { font-size: 12px; color: var(--muted-2); margin-top: 1px; }

.ticket-fields {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 10px;
}

.ticket-cat-field { margin-top: 0; }

.ticket-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.discord-preview {
  background: #1a1c21;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discord-preview-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #72767d;
}

.discord-embed {
  background: #2b2d31;
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px;
}
.discord-embed h4 { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.discord-embed p { font-size: 12px; color: #b5bac1; line-height: 1.4; }
.discord-btn {
  display: inline-block;
  margin-top: 10px;
  background: #5865f2;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
}

/* ── VOICE ALERTS ────────────────────────────────── */
.voice-list { display: flex; flex-direction: column; gap: 8px; }

.voice-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.voice-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 120px;
  gap: 10px;
  margin-bottom: 10px;
}
.voice-row .btn-danger { height: 32px; padding: 0 12px; font-size: 12px; }

/* ── KNOWLEDGE ───────────────────────────────────── */
#knowledgeList .ticket-card { grid-template-columns: 1fr; }
#knowledgeList .ticket-fields { grid-template-columns: 1fr 1fr; }

/* ── LOGS ────────────────────────────────────────── */
.log-list { display: flex; flex-direction: column; gap: 8px; }

.log-entry {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: start;
}

.log-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gold);
}

.log-msg { font-size: 13px; color: var(--muted-2); }
.log-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .shortcut-grid { grid-template-columns: repeat(2, 1fr); }
  .ticket-card { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; flex-direction: row; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .nav-label { display: none; }
  .sidebar-footer { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .voice-row-grid { grid-template-columns: 1fr 1fr; }
  .ticket-fields { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
  .hero-banner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-logo { display: none; }
  .topbar-right { gap: 6px; }
  .topbar-right .btn-ghost { display: none; }
}

.kpi-premium{
  border:1px solid rgba(212,175,55,.5);
  box-shadow:0 0 30px rgba(212,175,55,.2);
}

.kpi-premium b{
  color:#D4AF37;
}

.premium-lock{
  background:rgba(212,175,55,.08);
  border:1px solid rgba(212,175,55,.25);
  border-radius:18px;
  padding:34px;
  text-align:center;
}

.premium-lock h2{
  color:#D4AF37;
  margin-bottom:10px;
}

.premium-lock p{
  color:#8a98b0;
  margin-bottom:20px;
}

textarea {
  min-height: 110px;
  resize: vertical;
  overflow: hidden;
  line-height: 1.5;
}

#embedDescription {
  min-height: 140px;
  max-height: 600px;
}