/* oaf ai — plans, credits, customer dashboard and super admin additions */

/* ---------- plan cards ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 28px; }
.plan-grid.in-sheet { margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 18px 18px; border-radius: 22px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)), var(--panel, #0F0F12); min-width: 0; }
.plan-card.has-badge { border-color: var(--gold-a35, rgba(255,122,89,.35)); background: linear-gradient(180deg, rgba(255,122,89,.10), rgba(255,122,89,.02) 45%), var(--panel, #0F0F12); }
.plan-card.is-current { outline: 1px solid var(--gold-hi); outline-offset: 2px; }
.plan-badge { position: absolute; top: -10px; left: 16px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #1a1408; background: var(--gold-hi); }
.plan-card h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-price strong { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-price span { color: var(--muted); font-size: 13px; }
.plan-for { margin: 0; color: var(--muted); font-size: 13px; min-height: 2.6em; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; flex: 1; }
.plan-feats li { position: relative; padding-left: 20px; line-height: 1.35; }
.plan-feats li::before { content: ""; position: absolute; left: 2px; top: .38em; width: 9px; height: 5px; border-left: 2px solid var(--gold-hi); border-bottom: 2px solid var(--gold-hi); transform: rotate(-45deg); }
.plan-feats li:first-child { font-weight: 600; color: var(--text); }
.plan-rough { margin: 0; font-size: 12px; color: var(--muted); }
.plan-card > button { width: 100%; justify-content: center; margin-top: 4px; }
.pack-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px; padding: 14px 18px; border-radius: 16px; border: 1px dashed var(--line-2); font-size: 14px; color: var(--muted); }
.pack-row b { color: var(--text); font-weight: 600; }
.plan-small { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- plans sheet (inside the top-up dialog) ---------- */
.topup:has(.plans-sheet) { width: min(1120px, calc(100% - 24px)); }
.topup .pay.plans-sheet { max-height: calc(100dvh - 32px); overflow: auto; }
.plans-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-right: 44px; }
.plans-head h2 { margin: 4px 0 0; font-size: 24px; }
.plans-head h2 small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.plans-bal { text-align: right; }
.plans-bal span { display: block; font-size: 12px; color: var(--muted); }
.plans-bal strong { font-size: 28px; font-weight: 700; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.plans-tabs { display: inline-flex; gap: 4px; margin-top: 18px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.plans-tabs button { padding: 8px 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.plans-tabs button.is-on { background: rgba(255,255,255,.08); color: var(--text); }
.pending-card.slim { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; text-align: left; }
.pending-card.slim p { margin: 0; font-size: 14px; }
.pending-card.slim .orb { width: 14px; height: 14px; flex: none; margin: 0; }
.pay-back { position: absolute; top: 20px; left: 22px; font-size: 13px; }
.pay:has(.pay-back) .pay-steps { margin-top: 18px; }

/* ---------- wallet bits ---------- */
.wallet-chip strong::after, .rail-wallet strong::after { content: " cr"; font-weight: 500; font-size: .8em; opacity: .7; }
.acct-wallet strong::after { content: " credits"; font-weight: 500; font-size: .6em; opacity: .7; }
.acct-plan { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rail-wallet.is-low strong, .wallet-chip.is-low strong { color: var(--danger, #e5484d); }

/* ---------- customer dashboard ---------- */
.cust-welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--gold-a20, rgba(255,122,89,.2)); background: linear-gradient(120deg, rgba(255,122,89,.10), rgba(255,122,89,.02) 60%), rgba(255,255,255,.02); }
.cust-welcome h3 { margin: 4px 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cust-welcome h3 b { color: var(--gold-hi); }
.cust-welcome p { margin: 0; color: var(--muted); font-size: 13.5px; }
.cw-act { display: flex; align-items: center; gap: 12px; }
.tpl-strip { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tpl-strip::-webkit-scrollbar { display: none; }
.tpl-lbl { flex: none; font-size: 12px; color: var(--muted); }
.tpl-strip button { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s; }
.tpl-strip button:hover { background: rgba(255,122,89,.12); border-color: var(--gold-a35, rgba(255,122,89,.35)); }
#su-biz { width: 100%; }

/* ---------- console additions ---------- */
.c-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.c-filter .c-search { flex: 1; min-width: 200px; margin: 0; }
.plan-admin { display: grid; gap: 12px; }
.pa-row { padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.pa-row.is-off { opacity: .6; }
.pa-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pa-margin { margin-left: auto; font-size: 13px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.pa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 10px; }
.pa-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pa-grid label.wide { grid-column: span 2; }
.pa-grid label.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.pa-grid input:not([type=checkbox]), .pa-grid select { width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font: inherit; font-size: 14px; }
.pa-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.c-settings textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.md-item { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.md-item img, .md-item video, .md-ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #111; }
.md-ph { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.md-item figcaption { display: grid; gap: 2px; padding: 8px 10px; font-size: 12px; }
.md-item figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.md-item figcaption span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.md-item figcaption small { color: var(--muted); }

.price-table { margin: 22px auto 0; max-width: 720px; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); }
.price-table h4 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.pt-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.pt-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pt-rows span { color: var(--muted); }
.pt-rows b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-rows small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.price-table p { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-grid.in-sheet { grid-template-columns: 1fr; }
  .plans-head { padding-right: 40px; }
  .plans-bal { text-align: left; }
  .pa-grid label.wide { grid-column: auto; }
  .cust-welcome { padding: 14px 16px; }
}

/* customer media: bigger, uncropped tiles + full-size viewer */
.media-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.md-open { display: block; position: relative; width: 100%; padding: 0; border: 0; background: #0b0a14; cursor: zoom-in; }
.md-item img, .md-item video { aspect-ratio: 4 / 5; object-fit: contain; background: #0b0a14; image-rendering: auto; }
.md-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; pointer-events: none; }
.md-item figcaption { font-size: 12.5px; }
dialog.md-view { width: min(1280px, calc(100vw - 20px)); height: min(860px, calc(100dvh - 20px)); max-width: none; max-height: none; padding: 0; border: 1px solid rgba(153,144,221,.22); border-radius: 22px; background: #08070f; color: #fff; overflow: hidden; }
dialog.md-view[open] { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); }
dialog.md-view::backdrop { background: rgba(5,4,14,.8); backdrop-filter: blur(6px); }
.mv-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 16px 56px; }
.mv-media { width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }
.mv-media img, .mv-media video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.mv-nav { position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.mv-nav:disabled { opacity: .25; cursor: default; }
.mv-prev { left: 8px; } .mv-next { right: 8px; }
.mv-side { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-left: 1px solid rgba(153,144,221,.15); background: #100E22; overflow: auto; }
.mv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mv-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-prompt { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; color: rgba(255,255,255,.88); }
.mv-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.mv-acts > * { flex: 1; text-align: center; text-decoration: none; }
@media (max-width: 760px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  dialog.md-view { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  dialog.md-view[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 62dvh) minmax(0, 1fr); }
  .mv-stage { padding: 8px 44px; }
  .mv-side { border-left: 0; border-top: 1px solid rgba(153,144,221,.15); }
}

.md-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.md-pick { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.md-pick select { background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 13.5px; max-width: 100%; }
.md-pick:first-child { flex: 1 1 260px; }
.md-pick:first-child select { width: 100%; }
.md-sum { flex: 1 1 100%; }
.md-group { margin-bottom: 22px; }
.md-group > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.md-group > header .link-btn { font-weight: 600; color: var(--text); font-size: 15px; }
