/* PAM-PASS Portal: customer account, console and shared form components. Tokens match the pampass theme. */
:root {
  --night: #0C1420; --steel: #182433; --steel-2: #223144; --line: #2C3D52; --brushed: #8A9AAE; --frost: #DCE4EE;
  --brass: #C8A355; --brass-deep: #9C7B35; --paper: #EEF1F5; --ink: #142030; --ink-muted: #56657A; --rule: #CCD5E0;
  --mint: #4FD1A5; --ok: #146B4E; --ok-bg: #E1F4EC; --warn: #8A5413; --warn-bg: #FBEFD9; --bad: #9A3520; --bad-bg: #FBE5E0;
  --radius-s: 6px; --radius-m: 12px; --radius-l: 22px;
}

/* ---------- shared: buttons, forms, alerts (used by panels and public pages) */
:where(.btn) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-s); font: 600 15px/1.2 "Plex", system-ui, sans-serif; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
:where(.btn-sm) { min-height: 36px; padding: 0 14px; font-size: 14px; }
:where(.btn-brass) { background: linear-gradient(180deg, #D8B66A, var(--brass) 55%, var(--brass-deep)); color: #1A1407; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px -12px rgba(200,163,85,.7); }
:where(.btn-ink) { background: var(--ink); color: #fff; }
:where(.btn-ink:hover) { background: #1F2F45; }
:where(.btn-outline-ink) { background: #fff; color: var(--ink); border-color: var(--rule); }
:where(.btn-outline-ink:hover) { border-color: var(--ink-muted); }
:where(.btn-danger) { background: #fff; color: var(--bad); border-color: #E7B7AC; }
:where(.btn-danger:hover) { background: var(--bad-bg); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

.pp-form .field { margin: 0 0 16px; }
.pp-form label, .pp-form legend { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pp-form .opt { font-weight: 400; color: var(--ink-muted); }
.pp-form input[type=text], .pp-form input[type=email], .pp-form input[type=tel], .pp-form input[type=number], .pp-form input[type=password],
.pp-form input[type=url], .pp-form input[type=date], .pp-form input[type=search], .pp-form select, .pp-form textarea,
.inline input[type=text], .inline input[type=number], .inline select, .search input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-s); background: #fff; color: var(--ink); font: 15px/1.4 "Plex", system-ui, sans-serif;
}
.pp-form textarea { min-height: 96px; resize: vertical; }
.pp-form .hint, .hint { font-size: 13px; color: var(--ink-muted); margin: 6px 0 0; }
.pp-form .err { color: var(--bad); font-size: 13px; margin: 6px 0 0; font-weight: 600; }
.pp-form .has-error input, .pp-form .has-error select, .pp-form .has-error textarea { border-color: var(--bad); }
.pp-form .static { margin: 0; padding: 10px 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 4px 0 16px; font-size: 15px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.seg { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { width: 100%; }
.seg label { display: inline-flex !important; gap: 8px; align-items: center; font-weight: 500 !important; border: 1px solid var(--rule); border-radius: 99px; padding: 8px 14px; margin: 0; cursor: pointer; background: #fff; }
.seg label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg input:disabled + * , .seg label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-links { font-size: 14px; color: var(--ink-muted); margin-top: 14px; }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline input[type=text] { width: auto; min-width: 160px; }
.inline input.num, .num { width: 90px !important; min-width: 0 !important; }
.inline select { width: auto; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.mt { margin-top: 18px; }

.pp-alert { border-radius: var(--radius-m); padding: 14px 18px; margin: 0 0 20px; font-weight: 500; border: 1px solid; }
.pp-alert ul { margin: 8px 0 0; padding-left: 20px; font-weight: 400; }
.pp-alert.is-ok { background: var(--ok-bg); color: var(--ok); border-color: #BFE3D2; }
.pp-alert.is-warn { background: var(--warn-bg); color: var(--warn); border-color: #F0D5A8; }
.pp-alert.is-error { background: var(--bad-bg); color: var(--bad); border-color: #F0C2B7; }
.pp-note { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 14px 18px; color: var(--ink); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.off { background: #EDEFF3; color: #5A6678; } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.mono { font-family: "Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; }

/* ---------- currency switch and plan visibility */
[data-pp-currency-root] [data-cur] { display: none; }
[data-pp-currency-root]:not([data-cur-active]) [data-cur="INR"],
[data-pp-currency-root][data-cur-active="INR"] [data-cur="INR"],
[data-pp-currency-root][data-cur-active="USD"] [data-cur="USD"] { display: inline; }
.cur-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 99px; padding: 4px; background: #fff; margin: 0 0 28px; }
.cur-toggle button { border: 0; background: transparent; font: 600 14px "Plex", sans-serif; padding: 8px 16px; border-radius: 99px; color: var(--ink-muted); cursor: pointer; }
.cur-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.plan-alt { display: block; text-align: center; margin-top: 12px; font-size: 14px; color: inherit; opacity: .8; }

/* ---------- public downloads list */
.pp-downloads { display: grid; gap: 14px; margin: 24px 0; }
.dl-row { display: flex; gap: 24px; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 20px 22px; color: var(--ink); }
.dl-row h3 { margin: 0 0 4px; font-size: 19px; }
.dl-row .ver { font-family: "Plex Mono", monospace; font-size: 14px; color: var(--ink-muted); font-weight: 400; }
.dl-row p { margin: 4px 0 0; }
.dl-row .meta { font-size: 13px; color: var(--ink-muted); word-break: break-all; }
.dl-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.dl-act .lock { font-size: 12.5px; color: var(--ink-muted); }
.pp-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.pp-two h3 { margin: 0 0 14px; }

/* ---------- panel shell */
body.pp-panel { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 "Plex", system-ui, -apple-system, "Segoe UI", sans-serif; }
:where(.pp-panel) a { color: inherit; }
.pp-panel .btn-ink, .pp-panel .btn-ink:hover { color: #fff; }
.pp-panel .btn-brass { color: #1A1407; }
.pp-skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.pp-skip:focus { left: 8px; }
.pp-panel .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--ink) 260px, var(--paper) 260px); }
.pp-panel .app-top { display: none; }
.pp-panel .side { background: var(--ink); color: var(--frost); padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.pp-panel .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--frost); }
.pp-panel .brand b { font: 700 20px/1 "Plex Cond", "Plex", sans-serif; letter-spacing: .01em; display: block; }
.pp-panel .brand small { display: block; font-size: 12px; color: var(--brushed); margin-top: 3px; }
.pp-panel .side-brand { padding: 4px 10px 18px; }
.pp-panel .side .group { margin: 18px 10px 6px; font-size: 12.5px; color: var(--brushed); letter-spacing: .02em; }
.pp-panel .side a.item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #C3CFDC; text-decoration: none; font-size: 15px; }
.pp-panel .side a.item:hover { background: #1C2B3F; color: #fff; }
.pp-panel .side a.item svg { flex: none; }
.pp-panel .side a.item span { flex: 1; }
.pp-panel .side a.item[aria-current] { background: #22344A; color: #fff; box-shadow: inset 3px 0 0 var(--brass); }
.pp-panel .side .badge { font-style: normal; font-size: 12px; font-weight: 700; background: var(--brass); color: #1A1407; border-radius: 99px; padding: 1px 8px; }
.pp-panel .side .badge:empty { display: none; }
.pp-panel .me { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid #24364C; font-size: 14px; }
.pp-panel .me-name { display: block; font-weight: 600; }
.pp-panel .me-sub { display: block; color: var(--brushed); font-size: 13px; margin-bottom: 10px; }
.pp-panel .me-links { display: grid; gap: 2px; }
.pp-panel .me-links a { display: flex; gap: 8px; align-items: center; color: #C3CFDC; text-decoration: none; padding: 5px 0; font-size: 14px; }
.pp-panel .me-links a:hover { color: #fff; }
.pp-panel .main { padding: 30px 40px 56px; min-width: 0; }
.pp-panel .bar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pp-panel .bar h1 { font: 600 32px/1.15 "Plex Cond", "Plex", sans-serif; letter-spacing: -.01em; margin: 0; }
.pp-panel .bar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp-panel .sub { color: var(--ink-muted); margin: -12px 0 24px; }
.pp-panel .sub a { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 18px 20px; }
.kpi .v { font: 700 30px/1.1 "Plex Cond", "Plex", sans-serif; overflow-wrap: anywhere; }
.kpi .l { color: var(--ink-muted); font-size: 14px; }
.kpi .d { font-size: 13px; margin-top: 6px; color: var(--ok); }
.kpi .d.warn { color: #A0611C; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid2 > div > .card + .card { margin-top: 18px; }
.card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid2 > .card + .card { margin-top: 0; }
.card h2 { font: 600 20px/1.2 "Plex Cond", "Plex", sans-serif; margin: 0 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card.narrow { max-width: 760px; }
.card.empty { text-align: center; color: var(--ink-muted); padding: 40px; }
.muted { color: var(--ink-muted); }
.note { background: var(--paper); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.link { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--ink); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-muted); padding: 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.t td { padding: 11px 10px; border-bottom: 1px solid #E6EBF1; vertical-align: middle; }
.t td .hint { margin: 2px 0 0; }
.t.sum td.num { text-align: right; white-space: nowrap; }
.t.sum tr.total td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--ink); border-bottom: 0; }
.keyline { font-family: "Plex Mono", monospace; font-size: 14px; background: var(--paper); border: 1px dashed var(--rule); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.keyline span.mono { word-break: break-all; }
.keyline-actions { display: flex; gap: 8px; }
.facts-list { margin: 0; }
.facts-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid #E6EBF1; }
.facts-list dt { color: var(--ink-muted); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #E6EBF1; align-items: center; }
.list li:first-child { border-top: 0; }
.list li a { text-decoration: none; }
.list li a:hover { text-decoration: underline; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #E6EBF1; font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed small { color: var(--ink-muted); text-align: right; }
.spark { width: 100%; height: auto; display: block; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.filters a { padding: 7px 14px; border: 1px solid var(--rule); border-radius: 99px; background: #fff; text-decoration: none; font-size: 14px; font-weight: 500; }
.filters a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters.small { margin: 0; } .filters.small a { padding: 4px 10px; font-size: 13px; }
.search { display: flex; gap: 8px; margin: 0 0 16px; max-width: 520px; }
.pp-pages { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pp-pages a, .pp-pages span { padding: 5px 11px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; font-size: 14px; }
.pp-pages span { background: var(--ink); color: #fff; border-color: var(--ink); }
.thread { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.msg { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 14px 16px; background: #fff; max-width: 820px; }
.msg.is-staff { background: #F6F8FB; border-color: #D6DEE8; margin-left: 40px; }
.msg-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.msg-head span:last-child { margin-left: auto; color: var(--ink-muted); font-size: 13px; }
.msg-body { white-space: normal; overflow-wrap: anywhere; }
.pay-box { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; font-family: "Plex Mono", monospace; font-size: 14px; margin: 10px 0; }
.estimate { background: var(--paper); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; }
.estimate:empty { display: none; }
.estimate dl { margin: 0; }
.estimate dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.estimate dd { margin: 0; font-weight: 600; white-space: nowrap; }
.estimate .total { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 8px; font-size: 16px; }
.steps-list { padding-left: 20px; margin: 0 0 12px; } .steps-list li { margin: 6px 0; }
.trial-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.trial-head h2 { margin-bottom: 2px; }
.trial-actions { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.trial-actions label { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.action-grid { display: grid; gap: 12px; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .grid2 > .card + .card { margin-top: 0; }
}
@media (max-width: 860px) {
  .pp-panel .app { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  .pp-panel .app-top { display: flex; align-items: center; justify-content: space-between; background: var(--ink); padding: 12px 16px; position: sticky; top: 0; z-index: 5; }
  .pp-panel .app-menu-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--frost); border: 1px solid #2E4157; border-radius: 6px; padding: 8px 12px; font: 600 14px "Plex", sans-serif; }
  .pp-panel .side { display: none; position: static; height: auto; }
  .pp-panel .side.is-open { display: flex; }
  .pp-panel .side-brand { display: none; }
  .pp-panel .main { padding: 22px 16px 48px; }
  .pp-panel .bar h1 { font-size: 26px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; } .kpi .v { font-size: 24px; }
  .facts-list > div { grid-template-columns: 110px 1fr; }
  .msg.is-staff { margin-left: 0; }
  .dl-row { flex-direction: column; align-items: flex-start; }
  .dl-act { align-items: flex-start; }
  .pp-two { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } }
