/* Platform settings page + card payments, plan breakdown and "log in as" bits. Prefix: pf-.
   Uses the theme variables from brand.css / app.css so dark mode follows automatically. */
:root { --pf-radius: 14px; --pf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px -10px rgba(15, 23, 42, .14); --pf-soft: var(--surface-2, #f8f9fb); }
[data-theme=dark] { --pf-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .55); }

/* ---- layout: vertical tabs + content */
.pf-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.pf-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--panel, #fff); border: 1px solid var(--border); border-radius: var(--pf-radius); box-shadow: var(--pf-shadow); }
.pf-navbtn { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: background .15s; }
.pf-navbtn:hover { background: var(--pf-soft); }
.pf-navbtn.on { background: var(--primary-50, #eaf1ff); }
.pf-navbtn.on b { color: var(--primary); }
.pf-navbtn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pf-navbtn b { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.pf-navbtn small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-tile { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 4px 10px -4px var(--c2); }
.pf-tile svg { width: 18px; height: 18px; }
.pf-tile.sm { width: 30px; height: 30px; border-radius: 9px; }
.pf-tile.sm svg { width: 16px; height: 16px; }
.pf-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pf-main > form { display: flex; flex-direction: column; gap: 16px; }

/* ---- cards */
.pf-card { background: var(--panel, #fff); border: 1px solid var(--border); border-radius: var(--pf-radius); box-shadow: var(--pf-shadow); padding: 18px 20px; min-width: 0; }
.pf-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pf-card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pf-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pf-card .form-grid { gap: 12px 16px; }
.pf-card code, .pf-url code { font-family: var(--gc-mono, monospace); font-size: 12px; background: var(--pf-soft); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.pf-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--panel, #fff); border: 1px solid var(--border); border-radius: var(--pf-radius); box-shadow: 0 -6px 18px -12px rgba(15, 23, 42, .25); }
.pf-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.pf-inline:first-child { margin-top: 0; }
.pf-inline input[type=email] { flex: 1 1 220px; max-width: 360px; }
.pf-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: 10px; background: var(--pf-soft); border: 1px dashed var(--line-strong, var(--border)); font-size: 12.5px; color: var(--muted); }
.pf-note a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.pf-note svg { width: 14px; height: 14px; }
.pf-alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }
.pf-alert.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
[data-theme=dark] .pf-alert.warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
.pf-scroll { max-height: 520px; overflow: auto; }
.pf-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pf-tools input { flex: 1; max-width: 320px; }
.pf-q { max-width: 340px; white-space: normal; word-break: break-word; }

/* ---- inputs */
.pf-secret { display: flex; align-items: center; gap: 8px; }
.pf-secret input { flex: 1; min-width: 0; font-family: var(--gc-mono, monospace); font-size: 12.5px; }
.pf-ok { flex: none; font-size: 11.5px; font-weight: 600; color: var(--green, #12805c); }
.pf-switch { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--pf-soft); }
.pf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-sw { flex: none; position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong, #cfd5dd); transition: background .15s; margin-top: 1px; }
.pf-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.pf-switch input:checked + .pf-sw { background: var(--primary); }
.pf-switch input:checked + .pf-sw::after { transform: translateX(16px); }
.pf-switch input:focus-visible + .pf-sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.pf-sw-t { display: flex; flex-direction: column; gap: 2px; }
.pf-sw-t b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pf-sw-t small { font-size: 12px; color: var(--muted); font-weight: 400; }
.pf-prov[hidden] { display: none !important; }
.pf-file { cursor: pointer; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.pf-file svg { width: 15px; height: 15px; }
.pf-money { display: inline-flex; align-items: center; gap: 6px; }
.pf-money i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.pf-money input { width: 100px; }

/* ---- URLs to copy */
.pf-url { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--pf-soft); border: 1px solid var(--border); }
.pf-url-l { font-size: 12px; font-weight: 600; color: var(--muted); }
.pf-url code { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; background: transparent; border: 0; padding: 0; }
.pf-url .btn svg { width: 14px; height: 14px; }

/* ---- provider status */
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pf-stat { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--pf-soft); }
.pf-stat b { display: block; font-size: 13px; }
.pf-stat small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pf-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .2); }
.pf-stat.ok .pf-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* ---- SMS fixed prices */
.pf-fx-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pf-fx-row:last-child { border-bottom: 0; }
.pf-fx-row [data-fx-iso] { width: 76px; text-transform: uppercase; font-weight: 600; }
.pf-fx-row [data-fx-price] { width: 120px; }
.pf-fx-cur { color: var(--muted); }

/* ---- CRM pricing */
.pf-example { grid-column: 1 / -1; padding: 10px 12px; border-radius: 10px; background: var(--primary-50, #eaf1ff); color: var(--text); font-size: 13px; }
.pf-addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pf-addon { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--pf-soft); }
.pf-addon > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.pf-addon b { font-size: 13px; color: var(--text); }
.pf-addon small { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---- branding */
.pf-color { display: flex; align-items: center; gap: 8px; }
.pf-color input[type=color] { width: 42px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel, #fff); cursor: pointer; flex: none; }
.pf-color input:not([type=color]) { width: 170px; font-family: var(--gc-mono, monospace); }
.pf-logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pf-logo-box { width: 88px; height: 88px; border-radius: 16px; display: grid; place-items: center; background: repeating-conic-gradient(#e2e8f0 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--border); overflow: hidden; }
.pf-logo-box img { max-width: 76px; max-height: 76px; object-fit: contain; }
.pf-logo-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pf-preview { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.pf-prev-side { border-radius: 12px; padding: 14px 10px; background: var(--nav-bg, linear-gradient(180deg, #0b1b46, #11307a)); color: #c9d6f2; min-height: 220px; }
.pf-prev-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 8px; }
.pf-prev-brand img { width: 30px; height: 30px; background: #fff; border-radius: 7px; padding: 3px; object-fit: contain; }
.pf-prev-name { color: #fff; font-weight: 600; font-size: 15px; }
.pf-prev-tag { color: #8fb1ff; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.pf-prev-nav { display: flex; flex-direction: column; gap: 2px; }
.pf-prev-nav span { padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.pf-prev-nav span.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.pf-prev-login { border-radius: 12px; display: grid; place-items: center; padding: 18px; background: radial-gradient(400px 200px at 80% 0, rgba(99, 102, 241, .14), transparent), var(--pf-soft); border: 1px solid var(--border); }
.pf-prev-card { width: 100%; max-width: 260px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; border-radius: 14px; background: #fff; color: #111827; box-shadow: 0 10px 30px -14px rgba(15, 23, 42, .35); }
.pf-prev-card img { width: 44px; height: 44px; object-fit: contain; }
.pf-prev-card b { font-size: 16px; }
.pf-prev-card small { color: #64748b; font-size: 11.5px; margin-top: -4px; }
.pf-prev-input { display: block; width: 100%; height: 30px; border-radius: 8px; border: 1px solid #e3e6eb; background: #f8fafd; }
.pf-prev-input:first-of-type { margin-top: 8px; }
.pf-prev-btn { display: block; width: 100%; text-align: center; padding: 8px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 13px; margin-top: 4px; }

/* ---- card payment block (Add funds) */
.pf-cardpay { margin: 4px 0 14px; padding: 14px; border-radius: var(--pf-radius); border: 1px solid rgba(99, 102, 241, .35); background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(14, 165, 233, .06)); }
.pf-cardpay-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pf-cardpay-head b { font-size: 14px; }
.pf-cardpay-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-cardpay-btns .btn { flex: 1 1 180px; justify-content: center; padding: 10px 14px; font-weight: 600; }
.pf-cardpay-fee { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.pf-or { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pf-or::before, .pf-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pf-badge-instant { display: inline-block; font-size: 11px; font-weight: 600; color: #15803d; background: rgba(34, 197, 94, .14); border-radius: 999px; padding: 2px 8px; }
[data-theme=dark] .pf-badge-instant { color: #86efac; }

/* ---- card payment result banner */
.pf-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--pf-radius); margin-bottom: 16px; border: 1px solid var(--border); background: var(--panel, #fff); box-shadow: var(--pf-shadow); }
.pf-banner .pf-ban-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--pf-soft); }
.pf-banner b { display: block; }
.pf-banner small { color: var(--muted); }
.pf-banner.ok { border-color: rgba(34, 197, 94, .45); background: linear-gradient(135deg, rgba(34, 197, 94, .10), transparent 60%), var(--panel, #fff); }
.pf-banner.wait { border-color: rgba(245, 158, 11, .45); background: linear-gradient(135deg, rgba(245, 158, 11, .10), transparent 60%), var(--panel, #fff); }
.pf-banner.bad { border-color: rgba(239, 68, 68, .45); background: linear-gradient(135deg, rgba(239, 68, 68, .08), transparent 60%), var(--panel, #fff); }
.pf-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: pf-spin .8s linear infinite; display: inline-block; }
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ---- client profile: plan & discount, log in as */
.pf-plan-lines { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pf-plan-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.pf-plan-lines div:last-child { border-bottom: 0; }
.pf-plan-lines .pf-total { background: var(--pf-soft); font-weight: 700; }
.pf-plan-lines .pf-disc { color: var(--green, #12805c); }
.btn.pf-loginas { background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff !important; border-color: transparent; }
.btn.pf-loginas:hover { filter: brightness(1.08); }
.pf-role-hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-radius: 8px; background: var(--pf-soft); }

/* ---- responsive */
@media (max-width: 960px) {
  .pf-layout { grid-template-columns: 1fr; }
  .pf-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: thin; }
  .pf-navbtn { width: auto; flex: none; padding: 7px 10px; }
  .pf-navbtn small { display: none; }
  .pf-preview { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pf-card { padding: 14px; }
  .pf-savebar { flex-direction: column; align-items: stretch; }
  .pf-fx-row { flex-wrap: wrap; }
  .pf-fx-row .hint { display: none; }
  .pf-color input:not([type=color]) { width: 120px; }
}

/* label text + hint on one line */
.pf-lbl { display: block; }
.pf-lbl small { margin-left: 4px; }
.pf-card label { color: var(--text); }
[data-theme=dark] .pf-card label, [data-theme=dark] .pf-card .pf-lbl { color: #c7ccd6; }
[data-theme=dark] .pf-card label small, [data-theme=dark] .pf-card .hint { color: var(--muted); }
