/* Pinfluence Billing — design system.
   Schibsted Grotesk · red #E60122 / pink #E31371 accents · quiet gray chrome. */

:root {
  --brand: #E60122;
  --brand-dark: #b3001b;
  --pink: #E31371;
  --pink-dark: #b80f5c;
  --pink-light: #fce8f3;
  --blush: #f7f0f4;
  --ink: #17171c;
  --text: #4b4b53;
  --muted: #85858e;
  --faint: #b6b6be;
  --hairline: #ebebee;
  --bg: #f7f7f8;
  --card: #ffffff;
  --hover: #fafafb;
  --radius: 10px;
  --radius-sm: 8px;
  --ok: #157347;
  --warn: #b35c00;
  --err: #b42318;
  --shadow: 0 1px 2px rgba(23, 23, 28, .05), 0 0 0 1px rgba(23, 23, 28, .035);
  --shadow-btn: 0 1px 1.5px rgba(23, 23, 28, .12);
}

* { box-sizing: border-box; }
::selection { background: var(--pink-light); }

body {
  margin: 0;
  font-family: 'Schibsted Grotesk', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.015em; }
h1 { font-size: 23px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
a { color: var(--pink-dark); text-decoration: none; }
a:hover { color: var(--brand); }

/* ---- chrome ------------------------------------------------------------ */

.topnav { background: var(--card); border-bottom: 1px solid var(--hairline); }
.nav-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
  height: 54px;
  display: flex; align-items: center; gap: 28px;
}
.brand { font-weight: 700; font-size: 15.5px; color: var(--ink); letter-spacing: -0.01em; flex-shrink: 0; }
.brand span {
  background: linear-gradient(90deg, var(--brand), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--brand);
  -webkit-text-fill-color: transparent;
}
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-links a {
  color: var(--muted); font-weight: 500; font-size: 13.5px;
  padding: 5px 10px; border-radius: 6px;
}
.nav-links a:hover { color: var(--ink); background: var(--bg); }
.nav-links a.on { color: var(--ink); background: var(--bg); font-weight: 600; }
.nav-side { display: flex; align-items: center; gap: 14px; }
.env-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); background: #fdf3e2; border: 1px solid #f3e0be;
  padding: 2px 9px; border-radius: 999px; cursor: default;
}
.linklike {
  background: none; border: 0; color: var(--muted); font: inherit;
  font-size: 13.5px; font-weight: 500; cursor: pointer; padding: 0;
}
.linklike:hover { color: var(--ink); }

.container { max-width: 1060px; margin: 32px auto 72px; padding: 0 24px; }

/* ---- page & cards ------------------------------------------------------ */

.pagehead {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.pagehead h1 { margin-bottom: 2px; }
.pagehead .muted { font-size: 13.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.card {
  background: var(--card); border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 18px;
}
.card.narrow { max-width: 540px; }
.center-card { margin: 56px auto; }
.consent-card { max-width: 720px; margin: 0 auto; }
.card.table-card { padding: 6px 0 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- stat band --------------------------------------------------------- */

.statband {
  display: flex; align-items: stretch;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.stat { flex: 1; padding: 18px 24px 16px; min-width: 150px; }
.stat + .stat { border-left: 1px solid var(--hairline); }
.stat-label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.stat-sub { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
@media (max-width: 680px) { .statband { flex-direction: column; } .stat + .stat { border-left: 0; border-top: 1px solid var(--hairline); } }

/* ---- tables ------------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--hairline);
}
.table-card th { padding: 12px 16px 10px; }
.table-card th:first-child, .table-card td:first-child { padding-left: 24px; }
.table-card th:last-child, .table-card td:last-child { padding-right: 24px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; font-size: 14px; }
.table-card td { padding: 13px 16px; }
tbody tr:last-child td { border-bottom: 0; }
.table-card tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--hairline); }
tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.row-done td { color: var(--faint); }
tr.row-done td a { color: var(--muted); }
table.mini td { padding: 6px 8px; font-size: 13.5px; border-bottom: 1px solid var(--hairline); }
td strong { color: var(--ink); font-weight: 600; }
.rowactions { white-space: nowrap; text-align: right; }
.rowlink { font-size: 13px; font-weight: 600; color: var(--muted); }
.rowlink:hover { color: var(--brand); }

/* ---- definition lists -------------------------------------------------- */

dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
dd { margin: 0; color: var(--ink); }
.bignum { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.bignum .muted { font-size: 14px; font-weight: 500; letter-spacing: 0; }

/* ---- forms ------------------------------------------------------------- */

label { display: block; margin-bottom: 14px; font-weight: 600; color: var(--ink); font-size: 13px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 8px 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  border: 1px solid #d9d9de; border-radius: var(--radius-sm);
  transition: border-color .1s, box-shadow .1s;
}
input:hover, select:hover, textarea:hover { border-color: #c2c2c9; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-light);
}
label.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-weight: 400; color: var(--text); font-size: 14px;
}
label.check input { width: auto; margin-top: 3px; accent-color: var(--brand); }
::placeholder { color: var(--faint); }

/* ---- buttons ----------------------------------------------------------- */

button, .btn {
  display: inline-block; padding: 8px 15px; font: inherit; font-size: 13.5px;
  font-weight: 600; letter-spacing: 0;
  color: var(--brand); background: #fff;
  border: 1px solid #e2e2e6; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; box-shadow: none;
  transition: background .1s, border-color .1s;
}
button:hover, .btn:hover { background: #fdf4f5; border-color: #ecc9ce; color: var(--brand-dark); }
button:disabled { color: var(--faint); background: #fff; border-color: var(--hairline); cursor: not-allowed; }
.btn-ghost, button.btn-ghost {
  background: #fff; color: var(--ink);
  border: 1px solid #e2e2e6;
}
.btn-ghost:hover, button.btn-ghost:hover { background: var(--hover); color: var(--ink); border-color: #c9c9cf; }
.btn-danger, button.btn-danger { background: #fff; color: var(--err); border-color: #eccfc9; }
.btn-danger:hover, button.btn-danger:hover { background: #fbf1ef; color: #8c1d10; border-color: #ddb0a7; }
.btn-sm { padding: 4px 11px; font-size: 12.5px; }
form.inline { display: inline; }

/* ---- status dots ------------------------------------------------------- */

.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.status i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.st-active { color: var(--ok); }                .st-active i { background: var(--ok); }
.st-pending_start { color: var(--pink-dark); }  .st-pending_start i { background: var(--pink); }
.st-attention_required { color: var(--err); }   .st-attention_required i { background: var(--err); }
.st-canceled { color: var(--muted); }           .st-canceled i { background: var(--faint); }
.st-inactive { color: var(--muted); }           .st-inactive i { background: var(--faint); }

/* legacy badge class still used on terms page */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-active { background: #e6f4ec; color: var(--ok); }
.badge-attention_required { background: #fbeae7; color: var(--err); }

/* ---- flashes ----------------------------------------------------------- */

.flash {
  padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 14px;
  background: #eaf6ef; color: #115c39; font-size: 13.5px; font-weight: 500;
  box-shadow: inset 3px 0 0 var(--ok);
}
.flash-err { background: #fbeae7; color: #8c1d10; box-shadow: inset 3px 0 0 var(--err); }
.flash-warn { background: #fdf3e2; color: #7a4b00; box-shadow: inset 3px 0 0 var(--warn); }
.flash .btn, .flash .btn-sm { margin-left: 8px; }
.flash a { font-weight: 600; }

/* ---- bits -------------------------------------------------------------- */

.muted { color: var(--muted); font-weight: 400; }
.warn-note { color: var(--err); font-size: 13px; font-weight: 500; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--muted); }
.pm-line { font-size: 15.5px; color: var(--ink); font-weight: 500; }

.dealbox {
  background: var(--blush); border: 0; border-radius: var(--radius-sm);
  padding: 18px 20px; margin-bottom: 20px;
}
.dealbox ul { margin: 8px 0 0; padding-left: 20px; }
.termsbox {
  height: 340px; overflow-y: auto; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 16px 20px; background: var(--bg); font-size: 13.5px;
}
.consent-check {
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.previewbox {
  border: 1px dashed #d9d9de; border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 16px; min-height: 48px; font-size: 13.5px;
}
#payment-element { margin-bottom: 16px; min-height: 120px; }

.pkg-edit { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pkg-edit .inline-label { margin: 0; font-size: 12.5px; }
.pkg-edit .inline-label input { width: 140px; }
.pkg-edit .grow { flex: 1; min-width: 220px; }
.pkg-edit .grow input { width: 100%; }
