/* profile.css - the profile page's API keys card. External on purpose: the
 * page's inline <style> block is frozen (house rule); every selector here is
 * new (pf_apikey_*) so nothing collides with the frozen rules. */

.profile_sections .pf_apikey_hint {
  margin: 0 0 14px 0;
  color: #b8c3cf;
  line-height: 1.6;
}

.profile_sections .pf_apikey_hint a {
  color: #1b75bd;
  text-decoration: none;
}

.profile_sections .pf_apikey_hint a:hover {
  text-decoration: underline;
}

.profile_sections .pf_apikey_hint code,
.profile_sections .pf_apikey_tablewrap code {
  background: #101010;
  border: 1px solid #23262d;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .92em;
  word-break: break-all;
}

.profile_sections .pf_apikey_newbtn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
  padding: 8px 12px;
}

.profile_sections .pf_apikey_create {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.profile_sections .pf_apikey_input {
  height: 38px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #323234;
  background: #111;
  color: #fff;
  flex: 1 1 220px;
  min-width: 0;
}

.profile_sections .pf_apikey_input:focus {
  outline: none;
  border-color: #1b75bd;
}

.profile_sections .pf_apikey_input_num {
  flex: 0 1 220px;
}

.profile_sections .pf_apikey_btn {
  border: none;
  padding: 9px 16px;
  border-radius: 4px;
  color: #fff;
  background: #1b75bd;
  cursor: pointer;
}

.profile_sections .pf_apikey_btn_ghost {
  background: #323234;
}

.profile_sections .pf_apikey_btn_danger {
  background: #902828;
}

.profile_sections .pf_apikey_btn_small {
  padding: 5px 10px;
  font-size: 12px;
  margin-right: 6px;
}

.profile_sections .pf_apikey_secret {
  background: #101a10;
  border: 1px solid #2c5b2c;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.profile_sections .pf_apikey_secret_head {
  color: #9fd89f;
  margin-bottom: 8px;
}

.profile_sections .pf_apikey_secret_row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.profile_sections .pf_apikey_secret_row code {
  background: #0a0a0a;
  border: 1px solid #23262d;
  border-radius: 4px;
  padding: 6px 8px;
  word-break: break-all;
  flex: 1 1 260px;
}

.profile_sections .pf_apikey_tablewrap {
  overflow-x: auto;
}

.profile_sections .pf_apikey_revoked td {
  opacity: .45;
  text-decoration: line-through;
}

.profile_sections .pf_apikey_revoked td:last-child {
  text-decoration: none;
}

.profile_sections .pf_apikey_status {
  margin-top: 10px;
  min-height: 1.2em;
  color: #b8c3cf;
}

@media (max-width: 760px) {
  .profile_sections .pf_apikey_create {
    flex-direction: column;
    align-items: stretch;
  }
}

/* #13 collective names: the opt-in switch card */
/* the sharing switch is a prominent control, sized to match the Request Invoice button
   (16px text, ~26px-tall track) rather than the small upload switch */
.profile_sections .pf_share_switch { align-items: center; gap: 12px; margin: 12px 0 6px; font-size: 16px; }
.profile_sections .pf_share_switch .switch_track { width: 46px; height: 26px; border-radius: 13px; }
.profile_sections .pf_share_switch .switch_track::after { top: 3px; left: 3px; width: 20px; height: 20px; }
.profile_sections .pf_share_switch input:checked + .switch_track::after { transform: translateX(20px); }
.profile_sections .pf_share_switch .switch_text { line-height: 1.4; }
.profile_sections .pf_apikey_status.is-error { color: #e0655b; }

/* API key scope (profile.js loadApiKeys / the create row): read-only vs read-write */
.profile_sections .pf_apikey_select { padding-right: 1.6rem; cursor: pointer; }
.profile_sections .pf_apikey_scope { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; letter-spacing: 0.02em; border: 1px solid rgba(255, 255, 255, 0.18); white-space: nowrap; }
.profile_sections .pf_apikey_scope_read { color: #9fd2ff; border-color: rgba(159, 210, 255, 0.4); }
.profile_sections .pf_apikey_scope_write { color: #ffcf8a; border-color: rgba(255, 207, 138, 0.45); }

/* Billing address + invoices cards (server/invoices/). Same rules as the API keys
 * card: every selector is new (pf_inv_*), the page's inline <style> stays frozen. */
.profile_sections .pf_inv_hint {
  margin: 0 0 14px 0;
  color: #b8c3cf;
  line-height: 1.6;
}

.profile_sections .pf_inv_hint a {
  color: #1b75bd;
  text-decoration: none;
}

.profile_sections .pf_inv_hint a:hover {
  text-decoration: underline;
}

.profile_sections .pf_inv_policy {
  margin-top: 14px;
  font-size: .95em;
}

.profile_sections .pf_inv_form {
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.profile_sections .pf_inv_form label {
  display: grid;
  gap: 4px;
  color: #b8c3cf;
  font-size: .95em;
}

.profile_sections .pf_inv_form input {
  background: #101010;
  border: 1px solid #23262d;
  border-radius: 6px;
  color: #eaeaea;
  padding: 8px 10px;
  font: inherit;
}

.profile_sections .pf_inv_form input:focus {
  outline: none;
  border-color: #1b75bd;
}

.profile_sections .pf_inv_row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

.profile_sections .pf_inv_actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.profile_sections .pf_inv_btn {
  border: 1px solid #1b75bd;
  padding: 9px 16px;
  border-radius: 4px;
  color: #fff;
  background: #1b75bd;
  cursor: pointer;
  font: inherit;
}

.profile_sections .pf_inv_btn:disabled {
  opacity: .5;
  cursor: default;
}

.profile_sections .pf_inv_btn_sm {
  padding: 4px 10px;
  font-size: .9em;
}

.profile_sections .pf_inv_btn_ghost {
  background: transparent;
  border-color: #23262d;
  color: #b8c3cf;
}

.profile_sections .pf_inv_btn_ghost:hover {
  border-color: #1b75bd;
  color: #fff;
}

.profile_sections .pf_inv_status {
  margin-top: 10px;
  min-height: 1.2em;
  color: #b8c3cf;
}

.profile_sections .pf_inv_status.is-ok {
  color: #4caf50;
}

.profile_sections .pf_inv_status.is-err {
  color: #e5484d;
}

.profile_sections .pf_inv_tablewrap {
  overflow-x: auto;
}

.profile_sections .pf_inv_docs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile_sections .pf_inv_docs li,
.profile_sections .pf_inv_docact {
  margin: 2px 0;
  white-space: nowrap;
}

.profile_sections .pf_inv_docs li {
  list-style: none;   /* .dark_table li sets disc; the invoice document list carries no bullets */
}

.profile_sections .pf_inv_muted {
  color: #8a94a0;
}

@media (max-width: 760px) {
  .profile_sections .pf_inv_row {
    grid-template-columns: 1fr;
  }
}
