:root {
  color-scheme: light;
  --vcs-primary: #2a78d6; --vcs-on-primary: #fff;
  --vcs-surface: #ffffff; --vcs-surface-muted: #f4f4f1; --vcs-border: #e4e3dd;
  --vcs-text: #0b0b0b; --vcs-text-muted: #52514e; --vcs-danger: #d03b3b;
  --vcs-font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --pc-page: #f9f9f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --vcs-primary: #3987e5; --vcs-surface: #1a1a19; --vcs-surface-muted: #232321; --vcs-border: #2f2f2c;
    --vcs-text: #f0efec; --vcs-text-muted: #c3c2b7; --pc-page: #0d0d0d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --vcs-primary: #3987e5; --vcs-surface: #1a1a19; --vcs-surface-muted: #232321; --vcs-border: #2f2f2c;
  --vcs-text: #f0efec; --vcs-text-muted: #c3c2b7; --pc-page: #0d0d0d;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--pc-page); color: var(--vcs-text); font-family: var(--vcs-font); }
.pc { max-width: 1440px; margin: 0 auto; padding: 16px; }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pc-top-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-top .vcs-livebadge { margin-top: 0; }
.pc-brand { display: flex; align-items: center; gap: 10px; }
.pc-brand h1 { font-size: 18px; margin: 0; }
.pc-brand span:not(.pc-logo) { font-size: 12px; color: var(--vcs-text-muted); }
.pc-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--vcs-primary); color: #fff; display: grid; place-items: center; font-size: 18px; }
.pc-btn { border: 1px solid var(--vcs-border); background: var(--vcs-surface); color: var(--vcs-text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pc-btn:hover { border-color: var(--vcs-primary); }
.pc-btn:disabled { opacity: .5; cursor: default; }
.pc-primary { background: var(--vcs-primary); border-color: transparent; color: #fff; }
.pc-sm { padding: 4px 10px; font-size: 12px; }
.pc-search { border: 1px solid var(--vcs-border); background: var(--vcs-surface); color: var(--vcs-text); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; min-width: 220px; margin-left: auto; }
.pc-cust { display: flex; flex-direction: column; }
.pc-cust span { font-size: 12px; color: var(--vcs-text-muted); }
.pc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pc-status i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; background: #898781; }
.pc-status.is-good i { background: #0ca30c; }
.pc-status.is-warn i { background: #c98500; }
.pc-status.is-crit i { background: #d03b3b; }
.pc-live { color: #0ca30c; font-weight: 700; }
.pc-wait { color: #d03b3b; font-weight: 700; }
.pc-muted { color: var(--vcs-text-muted); font-size: 12px; }
.pc-row-actions { display: inline-flex; gap: 6px; }
.vcs-dash .vcs-dt td .pc-row-actions { justify-content: flex-end; }
.pc-modal-bg { position: fixed; inset: 0; background: rgba(10,10,10,.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.pc-modal { background: var(--vcs-surface); color: var(--vcs-text); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.pc-modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--vcs-border); }
.pc-modal header h3 { margin: 0; font-size: 16px; }
.pc-x { border: 0; background: none; color: var(--vcs-text-muted); font-size: 16px; cursor: pointer; }
.pc-modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.pc-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.pc-field input { border: 1px solid var(--vcs-border); background: var(--vcs-surface); color: var(--vcs-text); border-radius: 8px; padding: 8px 10px; font: inherit; font-weight: 400; }
.pc-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pc-chip { border: 1px solid var(--vcs-border); background: var(--vcs-surface-muted); color: var(--vcs-text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.pc-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; font-size: 13px; margin-top: 4px; }
.pc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pc-ok { background: #dcfce7; color: #166534; border-radius: 10px; padding: 10px 12px; margin: 0; font-size: 13px; }
.pc-warn { background: #fff4eb; color: #b55312; border-radius: 10px; padding: 8px 12px; margin: 0; font-size: 13px; }
.pc-error { color: #d03b3b; font-size: 13px; margin: 0; }
.pc-copy { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--vcs-text-muted); }
.pc-copy code { display: block; background: var(--vcs-surface-muted); border: 1px solid var(--vcs-border); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--vcs-text); word-break: break-all; max-height: 96px; overflow: auto; }
.pc-copy .pc-btn { align-self: flex-start; }
.pc-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.pc-login form { background: var(--vcs-surface); border: 1px solid var(--vcs-border); border-radius: 16px; padding: 24px; width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 640px) { .pc-search { margin-left: 0; width: 100%; min-width: 0; } }

/* ------------------------------------------------------------- billing */
.pc-tabs { margin-right: auto; }
.pc-tabs button[aria-selected="true"] { background: var(--vcs-surface); color: var(--vcs-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pc-month select, .pc-field select { border: 1px solid var(--vcs-border); background: var(--vcs-surface); color: var(--vcs-text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 400; }
.pc-month select { border-radius: 999px; padding: 7px 12px; font-weight: 600; }
.pc-month .pc-btn { padding: 6px 12px; }
.pc-billing .vcs-dash-filters { align-items: center; }
.pc-strong { font-weight: 700; }
.pc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pc-fieldset { border: 0; padding: 0; margin: 0; }
.pc-field input[aria-invalid="true"] { border-color: var(--vcs-danger); }
.pc-hist { font-size: 12px; color: var(--vcs-text-muted); display: flex; flex-direction: column; gap: 4px; }
.pc-hist ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pc-hist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--vcs-surface-muted); border-radius: 8px; padding: 6px 8px; color: var(--vcs-text); }
.pc-invoice { width: min(980px, 100%); }
.pc-invoice > header { gap: 12px; flex-wrap: wrap; }
.pc-invoice > header > div { display: flex; flex-direction: column; gap: 2px; }
.pc-inv-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; }
.pc-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.pc-lines td { padding: 8px 4px; border-bottom: 1px solid var(--vcs-border); }
.pc-lines td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-lines-total td { font-weight: 800; font-size: 16px; border-bottom: 0; border-top: 2px solid var(--vcs-text); }
@media (max-width: 640px) { .pc-grid2 { grid-template-columns: 1fr; } .pc-tabs { order: 3; width: 100%; } }
@media print {
  body:has(> .pc-print-root) > #root { display: none !important; }
  body { background: #fff; }
  .pc-print-root { position: static; background: none; padding: 0; display: block; }
  .pc-print-root .pc-modal { box-shadow: none; max-height: none; overflow: visible; width: 100%; border-radius: 0; }
  .pc-noprint, .pc-print-root .vcs-card-tools { display: none !important; }
  .pc-print-root .vcs-card { break-inside: avoid; }
}
