/* ui.css – Killbyte (squared + clean spacing everywhere, colored role badges, hide underlines, canvas bg) */

:root {
  --bg: #050507;
  /* Darker black */
  --text: rgba(255, 255, 255, .94);
  --muted: rgba(255, 255, 255, .60);
  --border: rgba(138, 43, 226, .18);
  /* Purple accent */

  --purple: #8a2be2;
  --purple-glow: rgba(138, 43, 226, 0.6);

  --sidebar-w: 240px;
  /* narrowed slightly */
}

* {
  box-sizing: border-box
}

/* FIXED: Allow scrolling */
html, body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: auto; /* Allow vertical scroll */
  height: auto; /* Changed from 100% */
  min-height: 100vh;
}

/* Background Canvas - FIXED positioning */
#bgCanvas {
  position: fixed; /* Keep fixed so it doesn't scroll */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; /* Only cover viewport */
  z-index: -1;
  background: #000;
  pointer-events: none;
}

.nebula-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 30%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(107, 33, 168, 0.15) 0%, transparent 50%);
  filter: blur(80px);
  animation: nebulaMove 20s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes nebulaMove {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.2) translate(20px, 20px);
  }
}



/* New Layout: Topbar Only - FIXED */
.app {
  display: block;
  min-height: 100vh;
  position: relative;
  z-index: 10;
  overflow: visible; /* Allow content to expand */
}

/* Sidebar Removed */

.brand {
  display: none;
  /* Hide brand if it still exists anywhere */
}

.logo {
  font-size: 18px;
  /* Smaller logo */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(138, 43, 226, 0.1);
  border: 1px solid rgba(138, 43, 226, 0.2);
  /* Glowing text logo instead of box */
  text-shadow: 0 0 10px var(--purple);
}

.title {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateX(2px);
}

.nav a.active {
  background: rgba(138, 43, 226, 0.1);
  border-color: rgba(138, 43, 226, 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.08);
}

.ico {
  font-size: 16px;
  opacity: 0.8;
  display: none;
  /* Ensure emojis hidden if persistent classes remain */
}


/* Main Content Area - FIXED */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: visible; /* Changed from hidden */
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  position: relative;
  z-index: 2;
}

.topbar {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(12px);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar .left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pageTitle {
  font-size: 20px;
  font-weight: 800;
}

/* Content area - FIXED */
.content {
  flex: 1;
  overflow-y: visible; /* Changed from auto */
  overflow-x: hidden;
  padding: 24px;
  padding-bottom: 80px; /* Extra bottom padding for breathing room */
}

/* Inputs & Buttons - Fix specific styling */
.btn {
  cursor: pointer;
  border: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  /* alignment fix */
  vertical-align: middle;
}

.btn:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, #8a2be2, #6b21a8);
  border: 1px solid rgba(138, 43, 226, 0.5);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.25);
}

.btn.danger {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

.input {
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  height: 38px;
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

textarea.input {
  height: auto;
  min-height: 100px;
  padding: 12px;
}

/* Product Grid Improvements */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  /* flexible cols */
  gap: 20px;
}

.centered-grid {
  /* If items are few, dont stretch them absurdly, but grid-template-columns handles that. 
     Just limit max width if needed */
  width: 100%;
}

.item {
  background: rgba(20, 20, 25, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.item:hover {
  transform: translateY(-4px);
  border-color: var(--purple);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 10px rgba(138, 43, 226, 0.15);
}

.badge-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fix alignment */
  background: transparent;
  border-color: transparent;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.item-title {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.3px;
  /* make it pretty */
  text-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-pill {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(138, 43, 226, 0.15);
  /* Purple tint bg */
  color: #d8b4fe;
  /* lighter purple text */
  border: 1px solid rgba(138, 43, 226, 0.3);
  margin-left: auto;
  /* Push to end if using flex */
}

.item-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  flex: 1;
  /* Pushes button down */
}

.btn.primary.full {
  width: 100%;
  justify-content: center;
}

/* Helpers */
.row {
  display: flex;
  align-items: center;
}

.space {
  justify-content: space-between;
}

.muted {
  color: var(--muted);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.6), rgba(107, 33, 168, 0.6));
  border-radius: 5px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(107, 33, 168, 0.8));
}

/* Role Badges */
.roleBadge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

.roleBadge.swifty {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.5);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.roleBadge.admin {
  background: linear-gradient(135deg, #8a2be2, #6b21a8);
  color: #f3e8ff;
  border: 1px solid rgba(138, 43, 226, 0.5);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.roleBadge.member {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.roleBadge.booster {
  background: linear-gradient(135deg, #ff73fa, #c026d3);
  color: #fff;
  border: 1px solid rgba(255, 115, 250, 0.5);
  box-shadow: 0 0 10px rgba(255, 115, 250, 0.3);
}

.roleBadge.cracker {
  background: linear-gradient(135deg, #22c55e, #14532d);
  color: #f0fdf4;
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.roleBadge.support {
  background: linear-gradient(135deg, #0ea5e9, #1e40af);
  color: #f0f9ff;
  border: 1px solid rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.roleBadge.overseer {
  background: linear-gradient(135deg, #f59e0b, #78350f);
  color: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.roleBadge.tren {
  background: linear-gradient(135deg, #991b1b, #450a0a);
  color: #fee2e2;
  border: 1px solid rgba(153, 27, 27, 0.5);
  box-shadow: 0 0 10px rgba(153, 27, 27, 0.3);
}

/* Discord Float (Reverted) */
.discordFloatBtn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: auto;
  height: 40px;
  z-index: 500;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  background: #5865F2 !important;
  /* Discord blurple */
  border-color: #5865F2 !important;
}

.discordFloatPanel {
  position: fixed;
  right: 20px;
  bottom: 70px;
  width: 350px;
  height: 500px;
  background: #2b2d31;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  z-index: 501;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.discordFloatPanel.open {
  display: flex;
}

.discordFloatHeader {
  background: #1e1f22;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================================
   Make "bunched" pages look like the programs grid:
   - any repeated rows become separated boxed items
   ========================================================= */

/* Generic "lists" inside cards: add spacing */
.card,
.item {
  border-radius: var(--r-lg);
}

/* If a section has a stack of rows, force separation */
.card>*+*,
.item>*+* {
  margin-top: 12px;
}

/* Create cleaner blocks for common list containers */
.list,
.listItems,
.items,
.purchases,
.purchaseList,
.orders,
.history,
.entries {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Make common "row-ish" elements look like their own card blocks */
.list>div,
.items>div,
.purchases>div,
.purchaseList>div,
.orders>div,
.history>div,
.entries>div {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .03);
  border-radius: var(--r-lg);
  padding: 14px;
}

/* Programs grid (already clean) + also helps marketplace grids */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.col-12 {
  grid-column: span 12;
}

.col-8 {
  grid-column: span 8;
}

.col-6 {
  grid-column: span 6;
}

.col-4 {
  grid-column: span 4;
}

@media (max-width: 1100px) {
  .col-4 {
    grid-column: span 6;
  }
}

@media (max-width: 720px) {

  .col-6,
  .col-4 {
    grid-column: span 12;
  }
}

/* Card for each product/program */
.item {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(0, 0, 0, .72));
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 16px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .38);
}

.item:hover {
  border-color: rgba(168, 85, 247, .16)
}

/* Hide "ID:" if it's in its own little badge box */
.id,
.itemId,
.programId,
.productId {
  display: none !important;
}

/* mobile */
@media(max-width:980px) {
  .app {
    padding: 14px
  }

  .sidebar {
    gap: 12px;
    padding: 14px
  }

  .brand {
    min-width: 140px
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .nav::-webkit-scrollbar {
    height: 10px
  }

  .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .10);
    border-radius: 999px
  }

  .status {
    max-width: 60vw
  }
}

/* Discord floating panel */
.discordFloatBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
}

.discordFloatPanel {
  position: fixed;
  right: 18px;
  bottom: 70px;
  width: 360px;
  height: 520px;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.discordFloatPanel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.discordFloatHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.discordFloatPanel iframe {
  width: 100%;
  height: calc(100% - 48px);
  border: 0;
  display: block;
}

@media (max-width: 520px) {
  .discordFloatPanel {
    width: calc(100vw - 24px);
    right: 12px;
  }

  .discordFloatBtn {
    right: 12px;
  }
}

.discordFloatBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
}

.discordFloatPanel {
  position: fixed;
  right: 18px;
  bottom: 70px;
  width: 360px;
  height: 520px;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.discordFloatPanel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.discordFloatHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.discordFloatPanel iframe {
  width: 100%;
  height: calc(100% - 48px);
  border: 0;
  display: block;
}

@media (max-width: 520px) {
  .discordFloatPanel {
    width: calc(100vw - 24px);
    right: 12px;
  }

  .discordFloatBtn {
    right: 12px;
  }
}

/* Ensure animated canvas stays BEHIND the UI */
#kbfx {
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Ensure your UI layers stay ABOVE the canvas but BELOW cursor */
.app,
.main,
.sidebar,
.topbar,
.content,
.card,
.item,
main,
header,
nav {
  position: relative;
  /* Removed conflicting z-index to fix cursor visibility */
}

/* If your body has overlays, keep them below UI but above background */
body::before,
body::after {
  z-index: 1;
}



/* =========================================================
   Discord panel position fix (bottom-left)
   ========================================================= */
.discordFloatBtn {
  left: 18px !important;
  right: auto !important;
  bottom: 18px !important;
}

.discordFloatPanel {
  left: 18px !important;
  right: auto !important;
  bottom: 70px !important;
}

@media (max-width: 520px) {
  .discordFloatPanel {
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
  }

  .discordFloatBtn {
    left: 12px !important;
    right: auto !important;
  }
}

/* =========================================================
   Programs: uploader + multi buttons + admin actions
   ========================================================= */
.uploaded-by {
  margin-top: 6px;
  font-size: 12px;
  opacity: .85;
}

.multi-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* =========================================================
   Admin Programs list cards (rendered by ui.js)
   ========================================================= */
.admin-program-card {
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}

.admin-program-card .apc-title {
  font-weight: 900;
  font-size: 14px;
}

.admin-program-card .apc-meta {
  margin-top: 4px;
  font-size: 12px;
  opacity: .75;
}

.admin-program-card .apc-uploader {
  margin-top: 6px;
  font-size: 12px;
  opacity: .8;
}

.admin-program-card .apc-desc {
  margin-top: 10px;
  font-size: 13px;
  opacity: .9;
  white-space: pre-wrap;
}

.admin-program-card .apc-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-program-card .apc-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* =========================================================
   Admin pop-out modal
   ========================================================= */
#program-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

#program-modal.open {
  display: block;
}

#program-modal .pm-section {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 10px;
}

#program-modal .pm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#program-modal .pm-subtitle {
  font-weight: 700;
  opacity: .95;
}

#program-modal .pm-btn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#program-modal .pm-btn-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
}

#program-modal .pm-hint {
  font-size: 12px;
  opacity: .75;
  margin-top: 6px;
}

#program-modal .pm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

#program-modal .pm-error {
  color: #ff8a8a;
  font-size: 12px;
  min-height: 14px;
}


/* Animated server icon in brand */
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Disable any cursor glow element if present */
#mouseGlow,
.mouseGlow,
.cursorGlow {
  display: none !important;
}


/* Stronger purple accents */
.btn,
button {
  outline: none
}

.btn:focus,
button:focus {
  box-shadow: var(--ring);
}


/* Admin: hide programs list/cards to reduce scrolling (modal is used instead) */
body.admin-page .program-card,
body.admin-page .product-card,
body.admin-page #adminProgramsList,
body.admin-page #programsList,
body.admin-page .programs-list,
body.admin-page .programs-grid,
body.admin-page .program-list {
  display: none !important;
}

/* Main programs search bar */
.kb-main-search {
  width: min(520px, 100%);
  margin: 10px 0 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(10, 10, 16, 0.55);
  color: #fff;
  outline: none;
}

.kb-main-search:focus {
  border-color: rgba(168, 85, 247, 0.75);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}


/* Programs page search (injected) */
.programSearchWrap {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.programSearchWrap .programSearchInput {
  width: min(420px, 100%);
}

.programSearchWrap .programSearchCount {
  font-size: 12px;
  opacity: 0.75;
}


/* ===== v9 patch: ensure admin program list stays hidden (no extra scrolling) ===== */

body.admin-page #adminProgramsList,
body.admin-page #programsList,
body.admin-page .programs-list,
body.admin-page .programGrid,
body.admin-page .programList,
body.admin-page .program-card,
body.admin-page .programCard {
  display: none !important;
}


/* Toasts */
#toastHost {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid rgba(160, 90, 255, 0.35);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all .18s ease;
  max-width: 320px;
  font-size: 14px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info {
  border-color: rgba(160, 90, 255, 0.55);
}

.toast-error {
  border-color: rgba(255, 80, 80, 0.55);
}

/* Programs sort select */
.programSortSelect {
  margin-left: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(160, 90, 255, 0.35);
  color: #fff;
}

/* Tags + badge + download count */
.badge-new {
  display: inline-block;
  margin: 6px 0 0 0;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(160, 90, 255, 0.6);
  background: rgba(160, 90, 255, 0.18);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-chip {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(160, 90, 255, 0.35);
  background: rgba(0, 0, 0, 0.22);
}

.dl-count {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.85;
}

/* Modal quick edit picker */
.modalPicker {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(160, 90, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
}

.modalPickerList {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}

.modalPickRow {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(160, 90, 255, 0.2);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.modalPickRow:hover {
  border-color: rgba(160, 90, 255, 0.45);
}

/* Mobile filter bar */
@media (max-width: 700px) {
  .programSearchWrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .programSortSelect {
    margin-left: 0;
    width: 100%;
  }
}backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
}

#program-modal .pm-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: rgba(10, 10, 14, .92);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(10px);
}

#program-modal .pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

#program-modal .pm-title {
  font-size: 18px;
  font-weight: 700;
}

#program-modal .pm-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
}

#program-modal .pm-body {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#program-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  opacity: .95;
}

#program-modal input,
#program-modal textarea,
#program-modal select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .25);
  color: inherit;
  outline: none;
}

#program-modal textarea {
  resize: vertical;
  min-height: 110px;
}

#program-modal .pm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  #program-modal .pm-grid {
    grid-template-columns: 1fr;
  }
}

#program-modal .pm-