/* Staff side of the dashboard (2026-10-12): the server directory and the staff
   Subscription tab. Uses the dashboard's own tokens (--ink, --rule, --signal,
   --heat, --steel, --white, --panel...), so it follows light/dark like the rest. */

/* ── "Staff view" chip next to the gamemode, under the server name ── */
.staff-chip {
  display: inline-block; margin-left: 10px; vertical-align: 1px;
  font-family: 'IBM Plex Mono', monospace; font-size: .62rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
  border: 1px solid var(--heat); color: var(--heat); background: var(--heat-wash);
}

/* ── The directory (same modal as the server switcher, wider) ── */
.svmodal-box.svmodal-wide { width: min(940px, 100%); }
.dir { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
/* #svpanel-list pins its children (flex-shrink: 0) and scrolls as a whole; the
   directory scrolls ONLY its list, so the search and the filters stay in view. */
.svmodal-wide #svpanel-list { overflow: hidden; }
#svpanel-list > .dir { flex: 1 1 auto; flex-shrink: 1; min-height: 0; }
.dir-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: 34px; }
.dir-head-r { display: flex; align-items: center; gap: 10px; flex: none; }
.dir-new { padding: 6px 13px; font-size: .8rem; white-space: nowrap; }
.dir-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.dir-role {
  font-family: 'IBM Plex Mono', monospace; font-size: .64rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--heat); border: 1px solid var(--heat);
  background: var(--heat-wash); border-radius: 3px; padding: 2px 7px; white-space: nowrap;
}
.dir-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.dir-search {
  width: auto; flex: 1 1 260px; min-width: 0; box-sizing: border-box; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
  font-family: 'IBM Plex Mono', monospace; font-size: .82rem;
}
.dir-search::placeholder { color: var(--steel); }
.dir-search:focus { outline: none; border-color: var(--signal); }
.dir-sort {
  width: auto; flex: none; padding: 9px 10px; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--panel); color: var(--ink); font-family: 'IBM Plex Mono', monospace; font-size: .78rem;
}
.dir-sort:focus { outline: none; border-color: var(--signal); }
.dir-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dir-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-2); font: inherit; font-size: .78rem;
}
.dir-chip b { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: .72rem; color: var(--steel); }
.dir-chip:hover { border-color: var(--steel); }
.dir-chip.on { border-color: var(--signal); background: var(--signal-wash); color: var(--signal-ink); }
.dir-chip.on b { color: var(--signal-ink); }
.dir-list {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 160px; overflow-y: auto; overflow-x: hidden;
  border: 1px solid var(--rule-soft); border-radius: 6px; background: var(--white);
}
.dir-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-top: 1px solid var(--rule-soft); cursor: pointer;
}
.dir-row:first-child { border-top: 0; }
.dir-row:hover, .dir-row:focus-visible { background: rgba(127,127,127,.08); outline: none; }
.dir-row:focus-visible { box-shadow: inset 2px 0 0 var(--signal); }
.dir-row .ord-logo { width: 40px; height: 40px; font-size: 1.05rem; }
.dir-name { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: .98rem; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; }
.dir-name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-mine {
  font-family: 'IBM Plex Mono', monospace; font-size: .58rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--signal-ink); border: 1px solid var(--signal); border-radius: 3px; padding: 1px 5px;
}
.dir-gms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.dir-gm {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font: inherit; font-size: .76rem;
  padding: 2px 8px; border-radius: 4px; border: 1px solid var(--rule-soft); background: var(--panel); color: var(--ink);
}
.dir-gm:hover { border-color: var(--signal); }
.dir-gm-add { border-style: dashed; color: var(--steel); font-size: .72rem; }
.dir-gm-add:hover { color: var(--signal-ink); }
.dir-gm .l { display: inline-flex; align-items: center; }
.dir-gm .p { font-family: 'IBM Plex Mono', monospace; font-size: .62rem; color: var(--steel); }
.dir-gm .p.go { color: var(--signal-ink); }
.dir-gm .p.trial { color: var(--heat); }
.dir-status {
  font-family: 'IBM Plex Mono', monospace; font-size: .6rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--rule); color: var(--steel); white-space: nowrap;
}
.dir-status.paid { border-color: var(--signal); color: var(--signal-ink); background: var(--signal-wash); }
.dir-status.trial { border-color: var(--heat); color: var(--heat); background: var(--heat-wash); }
.dir-status.lapsed { border-style: dashed; }
.dir-empty { padding: 30px 16px; text-align: center; color: var(--steel); font-size: .9rem; }
.dir-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.dir-count { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; color: var(--steel); }
.dir-more {
  border: 1px solid var(--rule); background: var(--white); color: var(--ink); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font: inherit; font-size: .84rem;
}
.dir-more:hover:not(:disabled) { border-color: var(--steel); }
.dir-more:disabled { opacity: .55; cursor: default; }
@media (max-width: 640px) {
  .dir-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .dir-row .ord-mng { display: none; }
  .dir-sort { flex: 1 1 100%; }
}

/* ── Staff Subscription tab ── */
.stf { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.stf-banner {
  border: 1px solid var(--heat); background: var(--heat-wash); border-radius: 6px;
  padding: 10px 14px; font-size: .86rem; color: var(--ink);
}
.stf-banner b { font-weight: 700; }
.stf-banner span { color: var(--ink-2); }
.stf-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stf-meter {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline;
  border: 1px solid var(--rule-soft); border-radius: 6px; background: var(--white); padding: 8px 10px;
}
.stf-meter-k { font-size: .72rem; color: var(--steel); }
.stf-meter-v { font-family: 'IBM Plex Mono', monospace; font-size: .76rem; color: var(--ink); }
.stf-meter-bar { grid-column: 1 / -1; height: 3px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.stf-meter-bar i { display: block; height: 100%; background: var(--signal); }
.stf-meter.warn .stf-meter-bar i { background: var(--heat); }
.stf-meter.full .stf-meter-bar i { background: #C0392B; }
.stf-card { border: 1px solid var(--rule); border-radius: 8px; background: var(--white); padding: 18px 20px; }
.stf-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stf-plan-name { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.stf-sub { font-family: 'IBM Plex Mono', monospace; font-size: .74rem; color: var(--steel); margin-top: 3px; }
.stf-pill {
  font-family: 'IBM Plex Mono', monospace; font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 3px; white-space: nowrap;
  border: 1px solid var(--signal); color: var(--signal-ink); background: var(--signal-wash);
}
.stf-pill.warn { border-color: var(--heat); color: var(--heat); background: var(--heat-wash); }
.stf-pill.bad { border-color: #E4897F; color: #C0392B; background: rgba(228,72,64,.08); }
.stf-pill.mute { border-color: var(--rule); color: var(--steel); background: transparent; }
.stf-line { margin-top: 14px; font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.stf-note { margin-top: 6px; font-size: .8rem; color: var(--steel); }
.stf-lead { font-size: .88rem; color: var(--ink-2); line-height: 1.55; margin: 8px 0 14px; }
.stf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stf-btn {
  border: 1px solid var(--rule); background: var(--white); color: var(--ink); border-radius: 6px;
  padding: 9px 16px; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 600;
}
.stf-btn:hover:not(:disabled) { border-color: var(--steel); }
.stf-btn:disabled { opacity: .5; cursor: not-allowed; }
.stf-btn-solid { background: var(--signal); border-color: var(--signal); color: #fff; }
.stf-btn-solid:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--signal); }
.stf-hint { font-family: 'IBM Plex Mono', monospace; font-size: .7rem; color: var(--steel); }
.stf-err { color: #C0392B; font-size: .84rem; margin: 0; }
.stf-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.stf-opts-h { font-family: 'IBM Plex Mono', monospace; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); margin: 6px 0 2px; }
.stf-opt {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  border: 1px solid var(--rule-soft); border-radius: 6px; padding: 9px 12px; cursor: pointer; background: var(--panel);
}
.stf-opt:hover { border-color: var(--steel); }
.stf-opt:has(input:checked) { border-color: var(--signal); background: var(--signal-wash); }
.stf-opt-name { display: block; font-weight: 700; font-size: .92rem; }
.stf-opt-meta { display: block; font-size: .74rem; color: var(--steel); margin-top: 1px; }
.stf-opt-price { font-family: 'IBM Plex Mono', monospace; font-size: .84rem; font-weight: 600; }
.stf-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.stf-field span { font-size: .8rem; font-weight: 600; }
.stf-field span i { font-weight: 400; font-style: normal; color: var(--steel); }
.stf-field input {
  box-sizing: border-box; width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--panel); color: var(--ink); font: inherit; font-size: .88rem;
}
.stf-field input:focus { outline: none; border-color: var(--signal); }
.stf-check { display: flex; align-items: center; gap: 8px; font-size: .84rem; cursor: pointer; }
.stf-field select {
  box-sizing: border-box; width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--panel); color: var(--ink); font: inherit; font-size: .88rem;
}
.stf-field select:focus { outline: none; border-color: var(--signal); }
.stf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .stf-row2 { grid-template-columns: 1fr; } }
.stf-opt.stf-opt-radio { grid-template-columns: auto 1fr; align-items: flex-start; }
.stf-opt.stf-opt-radio input { margin-top: 3px; }
.stf-actions .stf-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* The staff dialogs reuse the client cancel modal's look; its danger colours
   are keyed on #cancel-modal-confirm, so the staff button repeats them. */
#stf-modal-go.cancel-modal-danger { border-color: #E4897F; color: #C0392B; }
#stf-modal-go.cancel-modal-danger:hover:not(:disabled) { background: rgba(228,72,64,.08); border-color: #C0392B; }
#stf-modal-go.cancel-modal-danger:disabled { opacity: .45; cursor: default; }

/* ── Share access (staff): the header button and its dialog ── */
.stf-share {
  display: inline-flex; align-items: center; gap: 7px; flex: none; align-self: center;
  border: 1px solid var(--rule); background: var(--white); color: var(--ink); border-radius: 6px;
  padding: 8px 13px; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600;
}
.stf-share[hidden] { display: none; }
.stf-share:hover { border-color: var(--signal); color: var(--signal-ink); }
.svmodal-share { width: min(640px, 100%); overflow-y: auto; overflow-x: hidden; }
.stf-linkrow { grid-template-columns: max-content minmax(0, 1fr) 26px; }
.stf-linkrow .stf-person-n { overflow: visible; }
.stf-linkrow .stf-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stf-share-title { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.15rem; margin: 10px 0 14px; letter-spacing: -.02em; }
.stf-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.stf-kind {
  display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--panel); padding: 12px 14px;
}
.stf-kind-t { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: .98rem; }
.stf-kind-d { font-size: .78rem; line-height: 1.45; color: var(--ink-2); flex: 1; }
.stf-kind .stf-btn { align-self: flex-start; margin-top: 4px; padding: 7px 12px; font-size: .8rem; }
.stf-usage { margin: 10px 0 0; }
.stf-sec-h {
  font-family: 'IBM Plex Mono', monospace; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--steel); margin: 18px 0 6px;
}
.stf-people { display: flex; flex-direction: column; border: 1px solid var(--rule-soft); border-radius: 6px; background: var(--white); }
.stf-person {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 26px; align-items: center; gap: 10px;
  padding: 8px 12px; border-top: 1px solid var(--rule-soft); font-size: .85rem;
}
.stf-person:first-child { border-top: 0; }
.stf-person-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stf-people > .stf-hint { padding: 10px 12px; }
.stf-role {
  font-family: 'IBM Plex Mono', monospace; font-size: .6rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--rule); color: var(--steel);
}
.stf-role.owner { border-color: var(--signal); color: var(--signal-ink); background: var(--signal-wash); }
.stf-role.co_owner { border-color: var(--heat); color: var(--heat); background: var(--heat-wash); }
.stf-x {
  width: 24px; height: 24px; border: 0; background: none; color: var(--steel); cursor: pointer; border-radius: 4px;
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
}
.stf-x:hover { background: rgba(228,72,64,.1); color: #C0392B; }
.stf-x-spacer { width: 24px; }
.stf-fresh {
  border: 1px solid var(--signal); background: var(--signal-wash); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
}
.stf-fresh-h { font-weight: 700; font-size: .9rem; margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.stf-copied { font-family: 'IBM Plex Mono', monospace; font-size: .7rem; font-weight: 600; color: var(--signal-ink); }
.stf-fresh-row { display: flex; gap: 8px; margin-bottom: 8px; }
.stf-fresh-row input {
  flex: 1; min-width: 0; box-sizing: border-box; width: auto; padding: 9px 11px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--white); color: var(--ink);
  font-family: 'IBM Plex Mono', monospace; font-size: .74rem;
}
@media (max-width: 560px) { .stf-person { grid-template-columns: minmax(0, 1fr) auto 26px; } .stf-person > .stf-hint:nth-of-type(1) { display: none; } }

/* ── Viewer mode (read-only invitation): nothing about money, nothing that changes things ── */
.viewer-mode #tabs button[data-tab="subscription"],
.viewer-mode #panel-subscription,
.viewer-mode #choose-plan-cta,
.viewer-mode #free-plans-link,
.viewer-mode #setup-server-cta,
.viewer-mode [data-goto-plans],
.viewer-mode [data-goto-tab="subscription"],
.viewer-mode .sp-upsell,
.viewer-mode .msg-fab,
.viewer-mode .sp-choose,
.viewer-mode .svpanel-head .btn-solid,
.viewer-mode #endcard-list .ec-dash-actions,
.viewer-mode #endcard-list .ec-dash-add,
.viewer-mode #endcard-list .ec-row button { display: none !important; }
.viewer-mode #endcard-list input, .viewer-mode #endcard-list select { pointer-events: none; opacity: .85; }

/* ── New server (2026-10-21): one form. Details left; logo drop zone + live end-card preview right ── */
.svmodal-box.svmodal-new { width: min(980px, 100%); }
.stf-new { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 820px) { .stf-new { grid-template-columns: 1fr; gap: 6px; } }
.stf-new-r .stf-opts-h:first-child { margin-top: 0; }
.stf-opts-h i { font-style: normal; text-transform: none; letter-spacing: 0; }
.stf-drop {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; box-sizing: border-box;
  border: 1.5px dashed var(--steel); border-radius: 8px; padding: 12px 14px; background: var(--panel); cursor: pointer;
}
.stf-drop:hover, .stf-drop.over, .stf-drop:focus-within { border-color: var(--signal); background: var(--signal-wash); }
.stf-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.stf-drop-thumb { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #2A2E33; }
.stf-drop-thumb[hidden], .stf-drop-x[hidden] { display: none; }
.stf-drop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stf-drop-t { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stf-drop-s { font-size: .74rem; line-height: 1.4; color: var(--steel); }
.stf-drop-x {
  flex: none; border: 1px solid var(--rule); background: var(--white); color: var(--ink); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 600;
}
.stf-drop-x:hover { border-color: var(--heat); color: var(--heat); }
.stf-new-r .stf-err { margin-top: 6px; }
.stf-new-r .stf-hint { margin: 8px 0 0; }
/* the shared end-card editor, stacked and full width inside the form */
.stf-new #ec-dash-canvas { width: 100%; }
.stf-new .ec-dash { gap: 12px; }
.stf-new .ec-dash-card { width: 100%; }
.stf-new .ec-dash-side { min-width: 0; width: 100%; }
.svmodal-new .stf-share-title { margin: 6px 0 10px; }
.svmodal-new .stf-actions { margin-top: 12px; }
.stf-new .ec-dash-card { position: relative; }
.stf-ec-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 0 24px; text-align: center;
  font-family: 'IBM Plex Mono', monospace; font-size: .74rem; line-height: 1.5; color: rgba(255, 255, 255, .55); pointer-events: none;
}
.stf-ec-empty[hidden] { display: none; }
