/* Nova Player 4K - Reseller panel. Builds on /styles.css (nv-* classes). Mobile first. */

[hidden] { display: none !important; }

body { min-height: 100vh; }

.rs-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 12px 40px;
}

/* ---------- Top bar ---------- */
.rs-topbar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid #d5dae2;
}
.rs-topbar-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.rs-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.rs-brand-text { min-width: 0; }
.rs-brand-text .nv-brand-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-credits {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: var(--shadow-card);
}
.rs-credits-num { font-size: 26px; font-weight: 800; color: var(--primary-blue); line-height: 1.1; }
.rs-credits-num.zero { color: var(--status-red); }
.rs-credits-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }

/* ---------- Tabs ---------- */
.rs-tabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 14px;
}
.rs-tabs .nv-tab-pill { flex: 1 1 0; padding: 9px 12px; font-size: 13.5px; }

/* ---------- Login ---------- */
.rs-login {
  max-width: 400px;
  margin: 48px auto;
  padding: 0 16px;
}
.rs-login .nv-card { padding: 24px; }
.rs-login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

/* ---------- Messages ---------- */
.rs-error { color: var(--status-red); font-size: 13px; font-weight: 600; margin-top: 10px; min-height: 1em; }
.rs-error:empty { display: none; }
.rs-ok { color: var(--status-green); font-size: 13px; font-weight: 600; margin-top: 10px; }
.rs-muted { color: var(--text-muted); font-size: 12px; }
.rs-hint { color: var(--text-secondary); font-size: 12.5px; margin-top: 6px; }
.rs-hint.bad { color: var(--status-red); }
.rs-hint.good { color: var(--status-green); }

/* ---------- Add customer ---------- */
.rs-card-title { font-size: 15px; font-weight: 800; color: #0f172a; margin-bottom: 10px; }
.rs-add-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.rs-add-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.rs-cost { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.rs-cost.none { color: var(--status-red); }

/* ---------- Search ---------- */
.rs-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.rs-search-row .nv-search-input { min-width: 0; }
.rs-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ---------- Status badges ---------- */
.rs-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}
.rs-badge-active { background: var(--status-green); }
.rs-badge-trial { background: var(--status-gold); }
.rs-badge-banned { background: var(--status-red); }
.rs-badge-expired { background: #64748b; }
.rs-badge-off { background: #e2e8f0; color: #334155; }
.rs-type { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em; }

.rs-key { font-family: 'JetBrains Mono', monospace; font-weight: 700; letter-spacing: 0.04em; }
.rs-plus { color: var(--status-green); font-weight: 800; }
.rs-minus { color: var(--status-red); font-weight: 800; }
.rs-note-text { color: #334155; word-break: break-word; }
.rs-empty-note { color: var(--text-muted); font-style: italic; }
.rs-url { font-family: 'JetBrains Mono', monospace; font-size: 12px; word-break: break-all; color: #334155; }

/* ---------- Responsive table: cards on phones ---------- */
.rs-table { width: 100%; border-collapse: collapse; }
.rs-table thead { display: none; }
.rs-table tbody tr {
  display: block;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.rs-table td {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 13px;
  text-align: right;
}
.rs-table td:last-child { border-bottom: none; }
.rs-table td::before {
  content: attr(data-label);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  flex-shrink: 0;
}
.rs-table td.rs-td-main { padding-top: 0; }
.rs-table td.rs-td-main::before { display: none; }
.rs-table td.rs-td-main { justify-content: space-between; text-align: left; }
.rs-table td.rs-td-actions::before { display: none; }
.rs-table td.rs-td-actions { padding-top: 10px; justify-content: stretch; }
.rs-table td .rs-cell-right { min-width: 0; text-align: right; }

.rs-row-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.rs-row-actions .nv-btn { flex: 1 1 auto; padding: 9px 10px; }

.rs-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}

/* ---------- Dialogs ---------- */
.rs-dialog-backdrop { align-items: flex-end; padding: 0; }
.rs-dialog {
  max-width: 100%;
  border-radius: 14px 14px 0 0;
  max-height: 92vh;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.rs-dialog .nv-modal-header { margin-bottom: 12px; gap: 10px; }
.rs-dialog-title { font-size: 16.5px; font-weight: 800; color: #0f172a; min-width: 0; word-break: break-word; }
.rs-dialog-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.rs-dialog-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.rs-dialog-foot .nv-btn { flex: 1 1 auto; padding: 10px 14px; }
.rs-dialog p { margin-bottom: 8px; }

.rs-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.rs-choice {
  padding: 11px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.rs-choice:hover { border-color: var(--primary-blue); }
.rs-choice.active { background: var(--primary-blue); color: #ffffff; border-color: var(--primary-blue); }
.rs-choice:disabled { opacity: 0.45; cursor: not-allowed; }
.rs-choice small { display: block; font-size: 11px; font-weight: 600; opacity: 0.85; }

.rs-summary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 13px;
}
.rs-summary div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.rs-summary b { color: #0f172a; }

/* Playlist items inside the playlists dialog */
.rs-pl-list { display: flex; flex-direction: column; gap: 8px; }
.rs-pl {
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--bg-subtle);
}
.rs-pl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rs-pl-name { font-weight: 800; color: #0f172a; word-break: break-word; }
.rs-pl-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; word-break: break-all; }
.rs-pl-actions { display: flex; gap: 6px; margin-top: 8px; }
.rs-pl-actions .nv-btn { flex: 1 1 auto; }

/* Toast */
.rs-toast-box {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}
.rs-toast {
  background: #0f172a;
  color: #ffffff;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  word-break: break-word;
}
.rs-toast.bad { background: #b91c1c; }

.rs-loading { opacity: 0.55; pointer-events: none; }
.nv-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Phones: 16px inputs stop iOS from zooming in on focus */
@media (max-width: 759px) {
  .nv-input, .nv-select, .nv-textarea, .nv-search-input { font-size: 16px; }
  .rs-topbar-in > .nv-btn { order: 2; }
  .rs-credits { order: 3; flex: 1 1 100%; justify-content: center; }
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 760px) {
  .rs-wrap { padding: 22px 24px 48px; }
  .rs-topbar-in { padding: 14px 24px; flex-wrap: nowrap; }
  .rs-tabs { max-width: 420px; }
  .rs-add-grid { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.4fr); }

  .rs-dialog-backdrop { align-items: center; padding: 16px; }
  .rs-dialog { max-width: 500px; border-radius: 12px; padding: 22px 24px; }
  .rs-dialog.wide { max-width: 680px; }
  .rs-dialog-foot .nv-btn { flex: 0 0 auto; }
}

@media (min-width: 1000px) {
  .rs-table-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 10px; box-shadow: var(--shadow-card); overflow-x: auto; }
  .rs-table thead { display: table-header-group; }
  .rs-table th {
    text-align: left;
    padding: 11px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    background: var(--bg-subtle);
  }
  .rs-table tbody tr {
    display: table-row;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
  .rs-table tbody tr:hover { background: #f8fafc; }
  .rs-table td {
    display: table-cell;
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
    font-size: 12.5px;
  }
  .rs-table tbody tr:last-child td { border-bottom: none; }
  .rs-table td::before { display: none; }
  .rs-table td .rs-cell-right { text-align: left; }
  .rs-table td.rs-td-actions { padding-top: 10px; }
  .rs-row-actions { flex-wrap: nowrap; width: auto; }
  .rs-row-actions .nv-btn { flex: 0 0 auto; padding: 5px 9px; font-size: 12px; }
  .rs-note-cell { max-width: 200px; }
  .rs-mobile-only { display: none !important; }
}
@media (max-width: 999px) {
  .rs-desktop-only { display: none !important; }
}
