/* Provecta billing portal. Brand tokens from provecta/website site/src/styles/global.css (docs/BRAND-REFERENCE.md):
   same family as the website, with a dark app bar and a "Billing" label so a client can tell they are signed in. */
:root {
  --brand-900: #072a3e; --brand-800: #0a3550; --brand-700: #0e4462; --brand-600: #165775; --brand-400: #3d8aa8;
  --brand-200: #b9d6e2; --brand-50: #eef5f8; --signal: #2fb9c8; --amber: #f0b23d;
  --ink: #0d1b24; --ink-2: #3b4a55; --ink-3: #5c6b75; --line: #dde5ea; --paper: #ffffff; --paper-2: #f5f8fa;
  --ok: #17694a; --ok-bg: #e8f5ef; --fail: #a8322a; --fail-bg: #fbeceb;
  --r-sm: 6px; --r-md: 12px; --shadow: 0 1px 2px rgba(13, 27, 36, .06), 0 8px 24px rgba(13, 27, 36, .06);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Jost', 'Century Gothic', 'IBM Plex Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper-2); color: var(--ink); font: 17px/1.55 var(--font); }
a { color: var(--brand-600); text-underline-offset: 2px; }
a:hover { color: var(--brand-800); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.narrow main.wrap { max-width: 560px; }

.bar { background: var(--brand-900); color: #fff; border-bottom: 3px solid var(--signal); }
.bar-in { display: flex; align-items: center; gap: 14px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.logo:hover { color: #fff; }
.logo .word { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: .3em; }
.tag { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 2px 10px; color: var(--brand-200); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .9rem; flex-wrap: wrap; }
.me { color: var(--brand-200); word-break: break-all; }
.bar .link { color: #fff; }

main.wrap { padding-top: 28px; padding-bottom: 24px; }
h1 { font: 500 1.7rem/1.2 var(--display); color: var(--brand-800); margin: 0 0 12px; }
h1.acct { margin-bottom: 18px; }
h2 { font-size: 1.12rem; margin: 0 0 8px; color: var(--brand-800); }
p { margin: 0 0 12px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 26px); margin-bottom: 18px; }
.panel > :last-child { margin-bottom: 0; }
.big { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
.fine { font-size: .88rem; color: var(--ink-3); }
.pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.pay-actions { display: grid; gap: 10px; max-width: 260px; }

table { border-collapse: collapse; width: 100%; }
.lines td, .lines th { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lines th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 500; }
.lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 16px; }
.lines tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 600; }
.lines tr:last-child td { border-bottom: 0; }
.inv td.act { text-align: right; white-space: nowrap; padding-left: 16px; }
.inv td:first-child { white-space: nowrap; padding-right: 12px; }

.stack { display: grid; gap: 8px; max-width: 460px; }
label { font-weight: 500; font-size: .95rem; margin-top: 6px; }
input, textarea { font: inherit; padding: 11px 12px; border: 1px solid #9fb0ba; border-radius: var(--r-sm); background: #fff; color: var(--ink); width: 100%; }
.btn { display: inline-block; background: var(--brand-700); color: #fff; border: 1px solid var(--brand-700); border-radius: var(--r-sm); padding: 11px 18px; font: 600 1rem var(--font); cursor: pointer; text-decoration: none; text-align: center; margin-top: 6px; }
.btn:hover { background: var(--brand-800); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand-700); }
.btn.ghost:hover { background: var(--brand-50); color: var(--brand-800); }
.btn.sm { padding: 6px 12px; font-size: .9rem; margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.note { padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.note.ok { background: var(--ok-bg); border-color: #b5dccb; color: var(--ok); }
.note.fail { background: var(--fail-bg); border-color: #efc4c0; color: var(--fail); }

.foot { padding-top: 6px; padding-bottom: 40px; color: var(--ink-2); font-size: .9rem; }
.foot p { margin: 0 0 6px; }

@media (max-width: 640px) {
  .pay { grid-template-columns: 1fr; }
  .pay-actions { max-width: none; }
  .inv th:nth-child(2), .inv td:nth-child(2) { display: none; }
}

/* ---- round three: dark mode, the menu under the user's name, business profile, admin preview ---- */
:root { --heading: var(--brand-800); --link: var(--brand-600); --field: #ffffff; --field-line: #9fb0ba; --btn: var(--brand-700); --btn-ink: #ffffff; color-scheme: light; }
[data-theme="dark"] {
  --ink: #e8eef2; --ink-2: #b9c6cf; --ink-3: #93a3ae; --line: #24343f; --paper: #101c25; --paper-2: #08131a;
  --heading: #d6eaf3; --link: #7cc4de; --field: #0b161d; --field-line: #3a4c58; --btn: #2a86a8; --btn-ink: #ffffff;
  --ok: #7fd6ae; --ok-bg: #10291f; --fail: #f2a39c; --fail-bg: #2e1513; --brand-50: #132733;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --ink: #e8eef2; --ink-2: #b9c6cf; --ink-3: #93a3ae; --line: #24343f; --paper: #101c25; --paper-2: #08131a;
    --heading: #d6eaf3; --link: #7cc4de; --field: #0b161d; --field-line: #3a4c58; --btn: #2a86a8; --btn-ink: #ffffff;
    --ok: #7fd6ae; --ok-bg: #10291f; --fail: #f2a39c; --fail-bg: #2e1513; --brand-50: #132733;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
h1, h2 { color: var(--heading); }
a { color: var(--link); }
a:hover { color: var(--heading); }
input, textarea { background: var(--field); border-color: var(--field-line); }
.btn { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn:hover { background: var(--brand-600); color: #fff; }
.btn.ghost { background: var(--paper); color: var(--link); border-color: var(--field-line); }
.btn.ghost:hover { background: var(--brand-50); color: var(--heading); }
.note.ok { border-color: var(--ok); } .note.fail { border-color: var(--fail); }
.logo, .logo:hover, .bar a.logo { color: #fff; }

.bar-nav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.bar-nav a { color: var(--brand-200); text-decoration: none; padding: 6px 10px; border-radius: var(--r-sm); font-size: .95rem; }
.bar-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.bar-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .14); }
.usermenu { margin-left: auto; position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--r-sm); color: #fff; font-size: .92rem; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: rgba(255, 255, 255, .1); }
.usermenu .uname { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 6px; display: grid; gap: 2px; z-index: 10; }
.usermenu .menu > a, .menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu > a:hover, .menu-item:hover { background: var(--brand-50); color: var(--ink); }
.themes { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.menu-label { flex-basis: 100%; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.themes button { font: inherit; font-size: .86rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--field-line); background: var(--paper); color: var(--ink); cursor: pointer; }
.themes button.on { background: var(--btn); border-color: var(--btn); color: #fff; }
button[disabled] { opacity: .5; cursor: not-allowed; }

.lead { color: var(--ink-2); margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; margin-top: 10px; }
.fields label { grid-column: span 2; display: grid; gap: 5px; margin: 0; }
.fields label.wide { grid-column: 1 / -1; }
.fields label.narrow { grid-column: span 1; }
.hint { font-weight: 400; font-size: .86rem; color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0 2px; }
.check input { width: auto; }
.plain { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }

.previewbar { background: var(--amber); color: #1d1400; padding: 8px clamp(16px, 4vw, 32px); display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: .92rem; }
.previewbar a { color: #1d1400; font-weight: 600; }
.frozen { border: 0; padding: 0; margin: 0; min-width: 0; }

@media (max-width: 640px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields label, .fields label.narrow { grid-column: span 1; }
  .fields label:not(.narrow) { grid-column: 1 / -1; }
  .bar-nav { order: 3; flex-basis: 100%; margin-left: 0; }
}
