.admin-badge { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--green); font: 700 10px Consolas, monospace; letter-spacing: .08em; }
.admin-app { display: block; }
.admin-app[hidden] { display: none; }
.tickets-panel-header { flex-wrap: wrap; gap: 14px; }
.admin-search { width: 260px; }

.ticket-row-item.has-purchase { border-left: 2px solid var(--green); }
.ticket-purchase-tag { padding: 2px 8px; border-radius: 999px; font: 700 9px Consolas, monospace; text-transform: uppercase; letter-spacing: .05em; }
.ticket-purchase-tag.is-found { color: var(--green); background: rgba(69,239,139,.12); }
.ticket-purchase-tag.is-missing { color: #f2a33c; background: rgba(242,163,60,.12); }

.admin-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.admin-detail-meta span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.05); color: #b6bbc3; font-size: 11px; }


.admin-nav { display: flex; gap: 8px; margin-bottom: 18px; }
.admin-nav-tab { position: relative; overflow: hidden; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); color: #9a9fa6; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
/* Five pills ("Staff Access" alone is a mouthful) never fit one row on a
   phone - shrinking the text just made it unreadable, so this scrolls
   sideways instead of squeezing/clipping labels. */
@media (max-width: 640px) {
  .admin-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: -24px; padding-inline: 24px; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav-tab { flex-shrink: 0; }
}
.admin-nav-tab:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.admin-nav-tab.is-active { color: #fff; border-color: rgba(88,101,242,.55); background: rgba(88,101,242,.1); box-shadow: 0 8px 30px rgba(88,101,242,.18); }
.admin-nav-tab[hidden] { display: none; }

.admin-settings-panel[hidden] { display: none; }
.role-toggle-list { display: grid; gap: 8px; margin: 18px 0 22px; }
.role-toggle-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); cursor: pointer; transition: border-color .2s, background .2s; }
.role-toggle-item:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.045); }
.role-toggle-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: #5865f2; flex: none; }
.role-toggle-item:has(input:checked) { border-color: rgba(88,101,242,.5); background: rgba(88,101,242,.08); }
.role-toggle-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.role-toggle-name { font-size: 13px; font-weight: 600; }
.role-save-note { margin-top: 12px; color: var(--green); font-size: 12px; }

.ban-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 18px 0; }
.ban-form-field { display: flex; flex-direction: column; gap: 7px; flex: 1 1 160px; }
.ban-form-field-wide { flex: 2 1 200px; }
.ban-form-field label { color: #7f858e; font: 8px Consolas, monospace; text-transform: uppercase; letter-spacing: .1em; }
.ban-form-field .fake-input { margin: 0; }
.ban-list { display: grid; gap: 8px; }
.ban-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.ban-item-kind { padding: 2px 8px; border-radius: 999px; background: rgba(239,106,106,.12); color: #ef6a6a; font: 700 9px Consolas, monospace; text-transform: uppercase; letter-spacing: .05em; flex: none; }
.ban-item-value { font-weight: 650; font-size: 13px; flex: 1 1 auto; word-break: break-all; }
.ban-item-reason { color: #9a9fa6; font-size: 12px; }
.ban-item-remove { flex: none; }

.ban-confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.ban-confirm-row .ticket-closed-note { flex: 1 1 100%; margin: 0; }
.ban-confirm-row #admin-ban-reason { flex: 1 1 200px; }
.ban-confirm-row[hidden] { display: none; }

.overview-top { margin-bottom: 18px; }
.overview-live { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); color: #d7d9dc; font-size: 12.5px; font-weight: 600; }
.overview-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(69,239,139,.6); animation: overview-live-pulse 2s infinite; }
@keyframes overview-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(69,239,139,.55); }
  70% { box-shadow: 0 0 0 8px rgba(69,239,139,0); }
  100% { box-shadow: 0 0 0 0 rgba(69,239,139,0); }
}

.overview-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.overview-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #08090b; }
.overview-card-label { margin: 0 0 8px; color: #7f858e; font-size: 12px; }
.overview-card-value { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

.overview-page-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--soft-line); }
.overview-page-row:first-child { border-top: 0; }
.overview-page-info { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.overview-page-label { font-size: 13px; font-weight: 600; }
.overview-page-path { flex: none; color: #5a5f66; font: 11px Consolas, monospace; }
.overview-page-views { flex: none; color: #7f858e; font-size: 12px; }
.overview-orders-panel { margin-top: 20px; }
.overview-orders-head, .overview-order-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(100px, .65fr) minmax(95px, .55fr) minmax(190px, 1fr); gap: 18px; align-items: center; }
.overview-orders-head { padding: 0 2px 10px; color: #626871; font: 700 8px Consolas, monospace; letter-spacing: .11em; text-transform: uppercase; }
.overview-order-row { min-height: 68px; padding: 12px 2px; border-top: 1px solid var(--soft-line); }
.overview-order-customer, .overview-order-discord > span { min-width: 0; }
.overview-order-customer strong, .overview-order-discord strong { display: block; overflow: hidden; color: #e8e9eb; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.overview-order-customer small, .overview-order-discord small { display: block; margin-top: 4px; color: #656b74; font: 9px Consolas, monospace; text-transform: uppercase; }
.overview-order-plan { color: #b8bcc3; font-size: 12px; }
.overview-order-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #a8adb5; background: rgba(255,255,255,.06); font: 700 8px Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.overview-order-status.status-completed { color: #8df1b6; background: rgba(69,239,139,.1); }
.overview-order-status.status-pending { color: #f2c27e; background: rgba(242,163,60,.1); }
.overview-order-status.status-disputed, .overview-order-status.status-refunded, .overview-order-status.status-voided, .overview-order-status.status-reversed { color: #efa0a0; background: rgba(239,106,106,.1); }
.overview-order-discord { display: flex; min-width: 0; align-items: center; gap: 9px; }
.overview-order-discord > img, .overview-order-discord > i { width: 28px; height: 28px; flex: none; border-radius: 50%; }
.overview-order-discord > img { object-fit: cover; }
.overview-order-discord > i { border: 1px dashed rgba(255,255,255,.16); background: rgba(255,255,255,.025); }
.overview-order-discord.is-linked > span strong { color: #c9cdff; }

@media (max-width: 860px) {
  .overview-cards { grid-template-columns: 1fr 1fr; }
  .overview-orders-head { display: none; }
  .overview-order-row { grid-template-columns: 1fr 1fr; gap: 12px 18px; }
}

@media (max-width: 520px) {
  .overview-order-row { grid-template-columns: 1fr; }
}

.ticket-reply-actions-left, .ticket-reply-actions-right { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-clear-closed-btn { margin-left: auto; }
@media (max-width: 640px) {
  /* Full-width instead of floating in the corner with a lot of dead space
     next to it - reads as a deliberate action row instead of debris. */
  .tickets-tabs-row { flex-direction: column; align-items: stretch; }
  .admin-clear-closed-btn { margin-left: 0; width: 100%; }
}

.help-list { display: grid; min-width: 0; gap: 10px; margin-top: 18px; }
.help-item { min-width: 0; max-width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); overflow: hidden; }
.help-item-head { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 7px; }
.help-item-badge { flex: 0 1 auto; display: inline-flex; align-items: center; max-width: 100%; padding: 4px 9px; border-radius: 999px; font: 700 9px Consolas, monospace; text-transform: uppercase; letter-spacing: .05em; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.help-item-badge-site { color: var(--green); background: rgba(69,239,139,.12); }
.help-item-badge-staff { color: #8791ff; background: rgba(88,101,242,.14); }
.help-item-title { min-width: 0; max-width: 100%; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.help-item-title code { padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.08); font-size: 13px; }
.help-item-sub { max-width: 100%; margin: 0; color: #9298a1; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }

@media (max-width: 640px) {
  .admin-app, .admin-settings-panel, .overview-cards, .overview-card, .ban-list, .ban-item { min-width: 0; max-width: 100%; }
  .admin-nav { margin-inline: -10px; padding-inline: 10px; }
  .admin-search { width: 100%; }
  .overview-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .overview-card { padding: 15px 13px; }
  .overview-card-label, .overview-card-value, .overview-page-label, .overview-page-path { overflow-wrap: anywhere; }
  .overview-page-info { flex-wrap: wrap; }
  .ban-form { align-items: stretch; }
  .ban-form-field, .ban-form-field-wide { flex-basis: 100%; }
  .ban-item { flex-wrap: wrap; }
  .ban-item-value, .ban-item-reason { min-width: 0; overflow-wrap: anywhere; }
  .help-item { padding: 15px 14px; }
  .help-item-head { align-items: flex-start; }
  .help-item-badge { border-radius: 8px; }
}
