:root {
  --a-bg: #100b07;
  --a-panel: #1c140d;
  --a-panel-alt: #241a10;
  --a-border: #3a2c1c;
  --a-text: #F5EDE0;
  --a-muted: #C9BBA3;
  --a-primary: #E8A33D;
  --a-secondary: #D95D39;
  --a-success: #22c55e;
  --a-error: #e2574a;
  --a-radius: 14px;
  --a-font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: 'Work Sans', 'Segoe UI', system-ui, sans-serif;
}

h1, h2, h3, .brand span, .app-topbar-brand, .login-card h1 { font-family: var(--a-font-display); }

a { color: inherit; text-decoration: none; }

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--a-panel);
  border-right: 1px solid var(--a-border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 6px 10px 26px;
}
.sidebar .brand .dot {
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--a-muted);
  font-weight: 500;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar nav a:hover { background: var(--a-panel-alt); color: var(--a-text); }
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(232, 163, 61,.22), rgba(217, 93, 57,.18));
  color: var(--a-text);
  border: 1px solid var(--a-border);
}
.sidebar .view-site {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--a-border);
}
.sidebar .view-site a { color: var(--a-muted); font-size: .85rem; }
.sidebar form { margin-top: 4px; }
.sidebar .logout-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--a-muted);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .92rem;
  cursor: pointer;
  font-family: inherit;
}
.sidebar .logout-btn:hover { background: rgba(244,63,94,.12); color: var(--a-error); }

.admin-main { flex: 1; padding: 32px 40px; max-width: 1100px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }
.admin-header h1 { margin: 0; font-size: 1.5rem; }
.admin-header p { margin: 4px 0 0; color: var(--a-muted); font-size: .9rem; }

.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .88rem;
  border: 1px solid var(--a-border);
  cursor: pointer;
  background: var(--a-panel-alt);
  color: var(--a-text);
}
.a-btn-primary {
  background: linear-gradient(135deg, var(--a-primary), var(--a-secondary));
  border: none;
  color: #fff;
}
.a-btn-danger { color: var(--a-error); border-color: rgba(244,63,94,.4); }
.a-btn-danger:hover { background: rgba(244,63,94,.12); }
.a-btn:hover { filter: brightness(1.08); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card {
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  padding: 22px;
}
.stat-card .num { font-size: 2rem; font-weight: 800; }
.stat-card .label { color: var(--a-muted); font-size: .85rem; margin-top: 4px; }

.panel {
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--a-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--a-border);
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--a-border); font-size: .92rem; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--a-panel-alt); }
.row-actions { display: flex; gap: 8px; }
.row-actions form { display: inline; }
.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(232, 163, 61,.16);
  color: #f6c98a;
  font-size: .75rem;
  font-weight: 700;
}
.muted { color: var(--a-muted); }
.empty { padding: 50px; text-align: center; color: var(--a-muted); }

/* forms */
.form-card {
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  padding: 28px;
  max-width: 700px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; color: var(--a-muted); }
.field input[type=text], .field input[type=url], .field input[type=number], .field input[type=password], .field input[type=color], .field textarea, .field select {
  width: 100%;
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--a-text);
  font-family: inherit;
  font-size: .92rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--a-primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-field { display: flex; align-items: center; gap: 10px; }
.checkbox-field input { width: 18px; height: 18px; }
.color-row { display: flex; gap: 16px; align-items: center; }
.color-row input[type=color] { width: 54px; height: 40px; padding: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.hint { font-size: .78rem; color: var(--a-muted); margin-top: 6px; }

.flash {
  padding: 13px 18px;
  border-radius: 10px;
  margin-bottom: 22px;
  font-size: .9rem;
  font-weight: 500;
}
.flash-success { background: rgba(34,197,94,.14); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.flash-error { background: rgba(244,63,94,.14); color: #fb7185; border: 1px solid rgba(244,63,94,.3); }

/* login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: 18px;
  padding: 36px 32px;
}
.login-card .dot {
  width: 48px; height: 48px; border-radius: 50%;
  display: block;
  margin: 0 auto 18px;
}
.login-card h1 { text-align: center; font-size: 1.3rem; margin: 0 0 4px; }
.login-card p.sub { text-align: center; color: var(--a-muted); font-size: .85rem; margin: 0 0 26px; }
.login-card .a-btn-primary { width: 100%; justify-content: center; margin-top: 6px; }

@media (max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .sidebar .view-site { margin-top: 0; border-top: none; }
  .admin-main { padding: 24px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ===================== Painel ao vivo (DJ) ===================== */
.dj-idle { padding: 60px; text-align: center; margin-bottom: 24px; }

.dj-player { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.dj-now-playing {
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: center;
}
.dj-art {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--a-panel-alt);
  flex-shrink: 0;
}
.dj-info { flex: 1; min-width: 0; }
.dj-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--a-muted); }
.dj-info h2 { margin: 4px 0 2px; font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dj-info p { margin: 0; }
.dj-requested { margin-top: 10px !important; font-size: .8rem; }

.dj-progress { margin-top: 16px; }
.dj-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--a-panel-alt);
  overflow: hidden;
}
.dj-progress-bar > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--a-primary), var(--a-secondary));
  transition: width .3s linear;
}
.dj-progress-time {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--a-muted);
  margin-top: 6px;
}

.dj-controls { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.dj-btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dj-volume-label { font-weight: 700; min-width: 44px; text-align: center; }
.a-btn.active { background: linear-gradient(135deg, var(--a-primary), var(--a-secondary)); color: #fff; border: none; }

.dj-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dj-filters-label { font-size: .8rem; margin-right: 4px; }
.filter-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--a-border);
  background: var(--a-panel-alt);
  color: var(--a-muted);
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
}
.filter-chip:hover { color: var(--a-text); }
.filter-chip.active { background: linear-gradient(135deg, var(--a-primary), var(--a-secondary)); color: #fff; border-color: transparent; }
.filter-chip-clear { border-color: rgba(244,63,94,.4); }

.dj-queue { padding: 22px 24px; }
.dj-queue h3 { margin: 0 0 14px; font-size: 1rem; }
.dj-queue-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.dj-queue-empty { color: var(--a-muted); font-size: .88rem; padding: 12px 0; }
.dj-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--a-panel-alt);
  border-radius: 10px;
  font-size: .88rem;
}
.dj-queue-item .dj-queue-index { color: var(--a-muted); width: 20px; flex-shrink: 0; }
.dj-queue-item .dj-queue-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dj-queue-item .dj-queue-duration { color: var(--a-muted); font-size: .8rem; flex-shrink: 0; }
.dj-queue-item .dj-remove-btn {
  background: none;
  border: none;
  color: var(--a-muted);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.dj-queue-item .dj-remove-btn:hover { color: var(--a-error); }

.dj-favorites { padding: 22px 24px; margin-top: 24px; }
.dj-favorites h3 { margin: 0 0 14px; font-size: 1rem; }
.dj-favorite-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--a-panel-alt); border-radius: 10px; font-size: .88rem; cursor: pointer; border: 1px solid transparent; }
.dj-favorite-item:hover { border-color: var(--a-primary); }
.dj-favorite-item .dj-queue-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dj-favorite-item .dj-queue-duration { color: var(--a-muted); font-size: .8rem; flex-shrink: 0; }

.dj-add { padding: 24px; margin-top: 24px; }
.dj-add h3 { margin: 0 0 14px; font-size: 1rem; }
.dj-add-form { display: flex; gap: 10px; }
.dj-add-form input {
  flex: 1;
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--a-text);
  font-family: inherit;
  font-size: .92rem;
}
.dj-add-form input:focus { outline: none; border-color: var(--a-primary); }
.dj-search-results { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.dj-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--a-panel-alt);
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}
.dj-result-item:hover { border-color: var(--a-primary); }
.dj-result-item .dj-queue-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.dj-result-item .dj-queue-duration { color: var(--a-muted); font-size: .8rem; }

@media (max-width: 700px) {
  .dj-now-playing { flex-direction: column; text-align: center; }
  .dj-info h2 { white-space: normal; }
  .dj-add-form { flex-direction: column; }
}

/* ===================== Topbar (páginas de conta/painel) ===================== */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--a-border);
  background: var(--a-panel);
  flex-wrap: wrap;
  gap: 12px;
}
.app-topbar-brand { font-weight: 800; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 8px; }
.app-topbar-logo { width: 24px; height: 24px; border-radius: 50%; }
.app-topbar-nav { display: flex; gap: 20px; }
.app-topbar-nav a { color: var(--a-muted); font-weight: 500; font-size: .92rem; }
.app-topbar-nav a:hover { color: var(--a-text); }
.app-topbar-user { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.app-topbar-user form { margin: 0; }

.app-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

.dj-guild-switcher {
  background: var(--a-panel-alt);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--a-text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
}

@media (max-width: 700px) {
  .app-topbar { padding: 14px 18px; }
  .app-main { padding: 24px 16px; }
}
