:root {
  --bg-main: #0e0e10;
  --bg-sidebar: #121214;
  --bg-card: #18181b;
  --bg-card-hover: #222226;
  --bg-card-active: #28282e;
  --spotify-green: #1db954;
  --spotify-green-hover: #1ed760;
  --bordo-primary: #831843;
  --bordo-hover: #9d174d;
  --bordo-glow: rgba(131, 24, 67, 0.35);
  --text-main: #ffffff;
  --text-sub: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(29, 185, 84, 0.5);
  --code-bg: #09090b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Circular", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Navigation */
.console-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px var(--bordo-glow);
}

.brand-info h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.brand-info span {
  font-size: 11px;
  color: var(--spotify-green);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(29, 185, 84, 0.12);
  border-left: 3px solid var(--spotify-green);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.console-main {
  margin-left: 260px;
  flex: 1;
  padding: 32px 40px;
  max-width: 1400px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-title h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--spotify-green);
  color: #000;
}
.btn-primary:hover {
  background: var(--spotify-green-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 14px;
}

/* Card Boxes */
.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 17px;
  font-weight: 700;
}

/* Tabs */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* App Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.app-card.selected {
  border-color: var(--spotify-green);
  background: var(--bg-card-active);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.app-icon-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #831843, #1db954);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.app-name-title {
  font-size: 15px;
  font-weight: 700;
}

.app-meta-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  margin-top: 4px;
}

/* Badges */
.badge-dev {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-counter {
  background: rgba(29, 185, 84, 0.15);
  color: var(--spotify-green);
  border: 1px solid rgba(29, 185, 84, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* App Details View */
.detail-meta-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

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

.meta-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.meta-input {
  flex: 1;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  outline: none;
}
.meta-input:focus {
  border-color: var(--spotify-green);
}

/* Test Accounts Table (Spotify Exact) */
.test-accounts-section {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.test-user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.test-user-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.test-user-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* OAuth Scope Selector Matrix */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.scope-checkbox-card {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.scope-checkbox-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.scope-checkbox-card input[type="checkbox"] {
  accent-color: var(--spotify-green);
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.scope-label-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.scope-label-desc {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* API Explorer Console */
.api-explorer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .api-explorer-layout {
    grid-template-columns: 1fr;
  }
}

.method-select-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.endpoint-dropdown {
  flex: 1;
  background: var(--code-bg);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}
.endpoint-dropdown:focus {
  border-color: var(--spotify-green);
}

.response-viewer {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: "Fira Code", Consolas, Monaco, monospace;
  font-size: 12px;
  color: #e4e4e7;
  overflow-x: auto;
  max-height: 520px;
  white-space: pre-wrap;
  word-break: break-all;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}
.status-200 { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-400 { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.form-control:focus {
  border-color: var(--spotify-green);
}
