/* Colors + fonts come from offer/config.js (set as CSS variables at startup). */
:root {
  --bg: #06130d; --surface: #0c1f16; --surface2: #132c20; --border: #21412f;
  --text: #f6f1e3; --muted: #a8ad98; --accent: #d4af5f; --accent2: #f2e3b8;
  --good: #2f8a55; --bad: #e0705a;
  --hfont: 'Playfair Display', Georgia, serif; --bfont: 'Inter', sans-serif; --brandfont: 'Cinzel', serif;
  --gold-grad: linear-gradient(180deg, #f3d98f 0%, #d4af5f 45%, #a8803a 100%);
  --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 520px at 85% -12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(900px 600px at -10% 110%, #1d5a3533, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); font-family: var(--bfont); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--hfont); line-height: 1.15; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.center { min-height: 60vh; display: grid; place-items: center; } .center-t { text-align: center; }

/* ---------- header & tabs ---------- */
.demo-bar { background: var(--gold-grad); color: #10241a; font-size: 13px; padding: 7px 16px; text-align: center; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.demo-bar .link { color: #0b2a1c; text-decoration: underline; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 10px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img.brand-mark { height: 46px; width: auto; filter: drop-shadow(0 2px 6px #0008); }
.brand-name { font-family: var(--brandfont); font-weight: 700; font-size: 24px; letter-spacing: .04em; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name.big { font-size: 34px; text-align: center; }
.brand-sub { font-family: var(--bfont); color: var(--accent); font-weight: 600; letter-spacing: .28em; text-transform: uppercase; font-size: 12px; margin-top: 4px; }
.auth .brand-sub { text-align: center; margin-bottom: 22px; }
.user { display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 6px; padding: 8px 24px 0; max-width: 1180px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; color: var(--muted); padding: 10px 14px 12px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; font-family: var(--hfont); font-size: 16px; letter-spacing: .02em; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 80px; }
.stack { display: grid; gap: 18px; } .stack-s { display: grid; gap: 10px; }
.two { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }

/* ---------- cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; min-width: 0; }
.card.warn { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.label { font-family: var(--hfont); font-weight: 700; font-size: 19px; letter-spacing: .01em; }
.label.sub { font-size: 15px; color: var(--muted); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .12em; }
.stat-v { font-family: var(--hfont); font-weight: 700; font-size: 26px; line-height: 1.1; }
.stat.big .stat-v { font-size: 40px; color: var(--accent); }
.stat-l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.stat-s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.good .stat-v { color: #6fd067; } .stat.bad .stat-v { color: var(--bad); }
.pill { background: var(--surface2); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; font-size: 14px; }

/* ---------- controls ---------- */
.btn { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--gold-grad); color: #10241a; border-color: #b8914a; box-shadow: inset 0 1px 0 #fff6, 0 4px 14px #d4af5f2e; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; font-size: 13px; }
.link.muted { color: var(--muted); }
.select { width: auto; padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--gold-grad); color: #10241a; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.row-gap { display: inline-flex; gap: 8px; align-items: center; } .row-gap.wrap { flex-wrap: wrap; }
.form-msg { background: var(--surface2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: 13.5px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px #0008; z-index: 50; }

/* ---------- goal ---------- */
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.period-nav { display: flex; align-items: center; gap: 8px; }
.goal-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal-chip { font-weight: 700; font-family: var(--hfont); font-size: 17px; }
.goal-chip.editable { cursor: pointer; border-bottom: 1px dashed var(--muted); }
.goal-edit-row { display: inline-flex; gap: 6px; }
.goal-input { width: 140px; padding: 6px 10px; }
.goal-body { margin-top: 10px; }
.goal-pct { font-family: var(--hfont); font-weight: 800; font-size: 64px; line-height: 1; margin: 6px 0 12px; }
.progress { height: 14px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); border-radius: 999px; transition: width .6s; }
.goal-split { display: flex; justify-content: space-between; margin-top: 14px; gap: 12px; }
.goal-split .stat:last-child { text-align: right; }

/* ---------- pace ---------- */
.pace-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.bars { position: relative; width: 100%; overflow: hidden; }
.bars svg { display: block; }
.bars .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.bars .axis { fill: var(--muted); font-size: 11px; font-family: var(--bfont); }
.bars .bar { fill: var(--accent); transition: opacity .15s; }
.bars .bar.future { fill: var(--surface2); }
.bars .bar.hot { fill: color-mix(in srgb, var(--accent) 70%, #fff); }
.tip { position: absolute; top: 4px; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; pointer-events: none; white-space: nowrap; }
.rep-split { margin-top: 18px; display: grid; gap: 8px; }
.rep-split-row { position: relative; display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 12px; border-radius: 8px; background: var(--surface2); overflow: hidden; }
.rep-split-row span { position: relative; z-index: 1; font-weight: 600; }
.rep-split-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- EOD form ---------- */
.eod { display: grid; gap: 16px; }
.eod-top { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.eod-top .field { max-width: 200px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; margin: 0; }
legend { font-family: var(--hfont); font-weight: 700; color: var(--accent); padding: 0 6px; letter-spacing: .04em; }
.grid-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; padding: 8px 0; }
.money-in { position: relative; } .money-in::before { content: "$"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-in input { padding-left: 22px; }
/* Keep inputs on one line across a row even when a label wraps, and keep the $ centred in its box. */
.grid-fields .field { grid-template-rows: 1fr auto; align-items: end; }
.grid-fields .field > span { align-self: end; }
.money-in { align-self: end; height: fit-content; }
.money-in::before { line-height: 1; pointer-events: none; }
.eod input[type=number]::-webkit-outer-spin-button, .eod input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.eod input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; display: inline-flex; gap: 10px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 18px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.mini-grid div { background: var(--surface2); border-radius: 10px; padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mini-grid span { color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface2); white-space: nowrap; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .55; }
.table tr.total td { font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.notes-cell { min-width: 220px; max-width: 380px; white-space: pre-wrap; color: var(--muted); }

/* ---------- leaderboard ---------- */
.lb { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lb li { display: grid; grid-template-columns: 28px 38px minmax(90px, 1fr) 2fr auto; gap: 12px; align-items: center; background: var(--surface2); border-radius: 12px; padding: 10px 14px; }
.lb li.first { outline: 1px solid var(--accent); }
.rank { font-family: var(--hfont); font-weight: 800; font-size: 20px; color: var(--muted); text-align: center; }
.lb li.first .rank { color: var(--accent); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-grad); color: #10241a; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.lb-name { font-weight: 600; } .lb-name em { color: var(--muted); font-weight: 400; }
.lb-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.lb-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lb-val { font-family: var(--hfont); font-weight: 700; font-size: 18px; text-align: right; min-width: 90px; }

/* ---------- sales hub ---------- */
.hub { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.hub-nav { position: sticky; top: 96px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; }
.hub-h { font-family: var(--hfont); font-weight: 700; font-size: 14px; color: var(--accent); padding: 12px 10px 4px; letter-spacing: .03em; }
.hub-link { background: none; border: 0; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.hub-link:hover { background: var(--surface2); }
.hub-link.on { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.hub-mobile { display: none; width: 100%; }
.hub-main { min-width: 0; }
.doc-title { font-size: 24px; }
.pre { white-space: pre-wrap; font-size: 15px; }
.contact { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.contact:last-child { border-bottom: 0; }
.link-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; background: var(--surface2); border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; margin-bottom: 8px; }
.link-row:hover { outline: 1px solid var(--accent); }
.link-row span { color: var(--accent); }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 12px 0 4px; }
.pay { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.pay-amt { font-family: var(--hfont); font-weight: 700; font-size: 26px; color: var(--accent); }
.pay-actions { display: flex; gap: 8px; margin-top: 12px; }
.train-form { display: grid; gap: 12px; background: var(--surface2); border-radius: 12px; padding: 14px; margin-bottom: 14px; }

/* markdown */
.md { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md h1 { font-size: 28px; color: var(--accent); margin: 28px 0 10px; } .md h1:first-child, .md h2:first-child { margin-top: 0; }
.md h2 { font-size: 22px; margin: 24px 0 8px; } .md h3 { font-size: 18px; margin: 18px 0 6px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.md blockquote { margin: 14px 0; padding: 12px 16px; background: var(--surface2); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.md blockquote p { margin: 0; }
.md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.md th { background: var(--surface2); }
.md input[type=checkbox] { margin-right: 6px; }
.md code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; }

/* ---------- admin ---------- */
.person { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; } .person.dim { opacity: .55; }
.list-edit { display: grid; gap: 8px; }
.list-row { display: flex; gap: 8px; align-items: center; }
.list-row input { padding: 8px 10px; font-size: 13.5px; }
.list-row input:last-of-type { flex: 2; }
.full-ta { width: 100%; resize: vertical; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.preview-box { background: var(--surface2); border-radius: 12px; padding: 18px; max-height: 70vh; overflow: auto; margin: 12px 0; }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.sticky-save .btn { box-shadow: 0 8px 24px #0009; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, #06130dcc, #06130df2 70%), var(--cover, none) center / cover no-repeat; }
.auth-card { width: 100%; max-width: 400px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 22px; padding: 30px 28px; box-shadow: 0 30px 80px #000a; }
.auth-logo { display: block; width: 230px; max-width: 80%; margin: 0 auto 6px; filter: drop-shadow(0 4px 10px #000a); }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; gap: 10px; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .hub { grid-template-columns: 1fr; }
  .hub-nav { position: static; padding: 0; background: none; border: 0; }
  .hub-nav > :not(.hub-mobile) { display: none; }
  .hub-mobile { display: block; padding: 11px 12px; font-size: 15px; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top, .tabs, .wrap { padding-left: 16px; padding-right: 16px; }
  .card { padding: 16px; }
  .goal-pct { font-size: 48px; }
  .stat.big .stat-v { font-size: 32px; }
  .lb li { grid-template-columns: 24px 34px 1fr auto; }
  .lb-bar { display: none; }
  .user .small { display: none; }
  .list-row { flex-wrap: wrap; } .list-row input { flex: 1 1 140px; }
}
.danger { color: var(--bad) !important; border-color: var(--bad) !important; }

/* ---------- The Real Advantage touches ---------- */
.card { box-shadow: inset 0 1px 0 #ffffff08; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--accent2); }
.goal-pct, .stat.big .stat-v { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.progress-fill { background: var(--gold-grad); }
.hub-hero { position: relative; border-radius: var(--r); overflow: hidden; min-height: 190px; background-size: cover; background-position: center 30%; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); display: flex; align-items: flex-end; }
.hub-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 15%, #06130df0 92%); }
.hub-hero-in { position: relative; padding: 20px 22px; }
.hub-hero-t { font-family: var(--hfont); font-size: 24px; font-weight: 600; line-height: 1.2; max-width: 560px; margin-top: 6px; }
.link-row.pending { color: var(--muted); font-weight: 500; border: 1px dashed var(--border); background: transparent; }
.link-row.pending:hover { outline: 0; }
legend { font-family: var(--bfont); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.label { font-family: var(--hfont); font-weight: 600; }

/* ---------- sales metrics ---------- */
.metrics-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 6px; min-width: 0; }
.tile-l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.tile-v { font-family: var(--hfont); font-weight: 700; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-f { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: #7fd09a; } .delta.down { color: var(--bad); }
.status, .rate { font-weight: 600; white-space: nowrap; }
.status { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.status.ok, .rate.ok { color: #7fd09a; } .status.miss, .rate.miss { color: #e9a15a; }
.funnel { display: grid; gap: 10px; }
.f-row { display: grid; grid-template-columns: 128px minmax(60px, 1fr) 56px 56px; gap: 10px; align-items: center; font-size: 13.5px; }
.f-label { color: var(--muted); }
.f-track { height: 22px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.f-bar { display: block; height: 100%; background: var(--gold-grad); border-radius: 4px; transition: width .5s; }
.f-row:hover .f-bar { filter: brightness(1.12); }
.f-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.f-conv { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.funnel-note { margin: 14px 0 0; }
.num-table td { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .f-row { grid-template-columns: 96px minmax(40px, 1fr) 48px 48px; font-size: 12.5px; } .tile-v { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .f-bar, .progress-fill { transition: none; } }

/* ---------- roles ---------- */
.roles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 6px; }
.roles p { margin: 8px 0 0; color: var(--muted); }
.role-badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; vertical-align: 2px; border: 1px solid var(--border); color: var(--muted); }
.role-badge.owner { background: var(--gold-grad); color: #10241a; border-color: #b8914a; }
.role-badge.admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }

/* ======================================================================
   HIGH-END LAYER — glow, motion, depth. Emerald leather + polished gold.
   ====================================================================== */
:root {
  --glow: 0 0 0 1px #d4af5f26, 0 10px 40px -12px #d4af5f40;
  --glow-strong: 0 0 0 1px #e8c77a66, 0 0 28px #d4af5f55, 0 18px 50px -14px #d4af5f66;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
html { scrollbar-color: #2c5a42 transparent; }
::selection { background: #d4af5f55; color: #fff; }

/* leather grain over the whole page */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .6 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#root { position: relative; z-index: 1; }

/* drifting gold light */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.ambient span:nth-child(1) { width: 520px; height: 520px; top: -180px; right: -120px; background: radial-gradient(circle, #d4af5f55, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.ambient span:nth-child(2) { width: 640px; height: 640px; bottom: -260px; left: -200px; background: radial-gradient(circle, #1f6b4366, transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.ambient span:nth-child(3) { width: 360px; height: 360px; top: 40%; left: 55%; background: radial-gradient(circle, #f2e3b822, transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-120px, 90px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(140px, -80px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-200px, 60px) scale(.85); } }

/* glass header with a gold hairline */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; max-width: none; padding-left: max(24px, calc((100% - 1132px) / 2)); padding-right: max(24px, calc((100% - 1132px) / 2));
  background: linear-gradient(180deg, #06130df2, #06130dcc); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, #d4af5f88 30%, #f6dd95 50%, #d4af5f88 70%, transparent); background-size: 200% 100%; animation: sweep 9s linear infinite; }
.brand img.brand-mark { height: 50px; filter: drop-shadow(0 0 14px #d4af5f55) drop-shadow(0 2px 4px #000c); animation: markGlow 5s ease-in-out infinite; }
@keyframes markGlow { 50% { filter: drop-shadow(0 0 22px #e8c77a88) drop-shadow(0 2px 4px #000c); } }
.brand-name { background: linear-gradient(100deg, #a8803a 0%, #f6dd95 25%, #d4af5f 45%, #fff3c8 52%, #d4af5f 60%, #a8803a 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: shimmer 7s ease-in-out infinite; text-shadow: none; }
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0 0; } }
@keyframes sweep { to { background-position: -200% 0; } }

/* tabs */
.tabs { border-bottom: 0; position: relative; }
.tabs button { position: relative; transition: color .25s var(--ease); border-bottom: 0; }
.tabs button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--gold-grad); transform: scaleX(0); transition: transform .35s var(--ease); box-shadow: 0 0 12px #d4af5faa; }
.tabs button:hover::after { transform: scaleX(.35); }
.tabs button.on::after { transform: scaleX(1); }
.tabs button.on { color: #fff3d6; text-shadow: 0 0 18px #d4af5f66; }

/* cards: gold-edged glass with lift */
@media (min-width: 821px) { .hub-nav { background: linear-gradient(160deg, #102a1ee6, #0a1c14f2); } }
.card, .tile { position: relative; background: linear-gradient(160deg, #102a1ee6, #0a1c14f2); border-color: #23463466; box-shadow: inset 0 1px 0 #ffffff0d, 0 20px 40px -24px #000; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.card::before, .tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, #e8c77a66, #d4af5f10 35%, transparent 60%, #d4af5f22);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card:hover, .tile:hover { box-shadow: inset 0 1px 0 #ffffff12, var(--glow); border-color: #d4af5f40; }
.tile:hover { transform: translateY(-3px); }
.tile-v { color: #fff6df; text-shadow: 0 0 24px #d4af5f40; }
.tile::after { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: linear-gradient(90deg, transparent, #f6dd95aa, transparent); opacity: .7; }

/* page entrance: each block rises in, staggered */
.wrap > .stack > *, .wrap > .hub > *, .tiles > * { animation: rise .6s var(--ease) both; }
.wrap > .stack > *:nth-child(2), .tiles > *:nth-child(2) { animation-delay: .06s; }
.wrap > .stack > *:nth-child(3), .tiles > *:nth-child(3) { animation-delay: .12s; }
.wrap > .stack > *:nth-child(4), .tiles > *:nth-child(4) { animation-delay: .18s; }
.wrap > .stack > *:nth-child(5), .tiles > *:nth-child(5) { animation-delay: .24s; }
.wrap > .stack > *:nth-child(n+6), .tiles > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes rise { from { opacity: .001; transform: translateY(14px); } }

/* buttons: polished gold with a light sweep */
.btn { transition: border-color .2s, box-shadow .25s var(--ease), transform .15s, background .2s; }
.btn:hover { border-color: #d4af5f66; box-shadow: 0 0 0 1px #d4af5f22, 0 6px 18px -8px #d4af5f55; }
.btn:active { transform: translateY(1px); }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, #ffffffaa, transparent); transform: skewX(-20deg); transition: left .7s var(--ease); }
.btn.primary:hover { box-shadow: var(--glow-strong); filter: none; }
.btn.primary:hover::after { left: 130%; }
.seg { background: #0a1c14cc; }
.seg button { transition: color .2s, background .25s; }
.seg button.on { box-shadow: 0 0 16px #d4af5f55; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #d4af5f99; box-shadow: 0 0 0 3px #d4af5f2e, 0 0 18px #d4af5f22; }
.btn:focus-visible, .tabs button:focus-visible, .seg button:focus-visible, .hub-link:focus-visible { outline: 2px solid #e8c77a; outline-offset: 2px; }

/* goal + progress */
.goal-pct { font-size: 72px; filter: drop-shadow(0 0 22px #d4af5f44); background: linear-gradient(100deg, #a8803a, #f6dd95 35%, #fff3c8 50%, #d4af5f 65%, #a8803a); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: shimmer 7s ease-in-out infinite; }
.stat.big .stat-v { filter: drop-shadow(0 0 18px #d4af5f40); }
.progress { height: 16px; background: #0a1c14; box-shadow: inset 0 1px 3px #000a; border: 1px solid #23463466; }
.progress-fill { position: relative; overflow: hidden; box-shadow: 0 0 18px #d4af5f88; transition: width 1.1s var(--ease); }
.progress-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #fffbe9cc 50%, transparent 70%); background-size: 220% 100%; animation: sweep 2.8s linear infinite; mix-blend-mode: overlay; }

/* charts */
.bars .bar { fill: url(#barGold); transform-box: fill-box; transform-origin: bottom; animation: grow .8s var(--ease) both; }
.bars .bar.future { fill: #132c20; }
.bars .bar.hot { fill: #f6dd95; filter: drop-shadow(0 0 8px #d4af5faa); }
.bars g:nth-of-type(odd) .bar { animation-delay: .04s; }
@keyframes grow { from { transform: scaleY(0); } }
.tip { background: #fff6df; color: #10241a; box-shadow: 0 8px 24px #000a, 0 0 18px #d4af5f55; }
.f-bar { transform-origin: left; animation: growX .9s var(--ease) both; box-shadow: 0 0 14px #d4af5f66; }
.f-row:nth-child(2) .f-bar { animation-delay: .08s; } .f-row:nth-child(3) .f-bar { animation-delay: .16s; }
.f-row:nth-child(4) .f-bar { animation-delay: .24s; } .f-row:nth-child(n+5) .f-bar { animation-delay: .32s; }
@keyframes growX { from { transform: scaleX(0); } }
.rep-split-bar { background: linear-gradient(90deg, #d4af5f40, #d4af5f14); transform-origin: left; animation: growX 1s var(--ease) both; }

/* leaderboard: the leader glows */
.lb li { transition: transform .3s var(--ease), box-shadow .3s; background: linear-gradient(90deg, #132c20, #0f2419); }
.lb li:hover { transform: translateX(4px); box-shadow: var(--glow); }
.lb li.first { outline: 0; box-shadow: 0 0 0 1px #e8c77a99, 0 0 26px -4px #d4af5f88; animation: leaderPulse 3.2s ease-in-out infinite; }
.lb li.first .avatar { box-shadow: 0 0 0 2px #0c1f16, 0 0 0 3px #e8c77a, 0 0 18px #d4af5faa; }
.lb li.first .rank::before { content: "♛"; display: block; font-size: 14px; line-height: 1; color: #f6dd95; text-shadow: 0 0 10px #d4af5f; }
.lb-bar span { background: var(--gold-grad); box-shadow: 0 0 10px #d4af5f88; transform-origin: left; animation: growX 1s var(--ease) both; }
@keyframes leaderPulse { 50% { box-shadow: 0 0 0 1px #f6dd95, 0 0 38px -2px #d4af5fbb; } }

/* hub */
.hub-link { transition: background .2s, box-shadow .25s, color .2s; }
.hub-link.on { background: linear-gradient(90deg, #d4af5f26, transparent); box-shadow: inset 3px 0 0 #e8c77a; color: #fff3d6; }
.link-row { transition: transform .25s var(--ease), box-shadow .25s, background .2s; }
.link-row:not(.pending):hover { outline: 0; transform: translateX(3px); box-shadow: var(--glow); background: #17352a; }
.pay { transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; background: linear-gradient(160deg, #163325, #0e2419); }
.pay:hover { transform: translateY(-3px); box-shadow: var(--glow); border-color: #d4af5f55; }
.pay-amt { text-shadow: 0 0 20px #d4af5f55; }
.hub-hero { min-height: 220px; box-shadow: var(--glow); }
.hub-hero { animation: kenburns 30s ease-in-out infinite alternate, rise .6s var(--ease) both; }
@keyframes kenburns { from { background-size: 100% auto; background-position: center 30%; } to { background-size: 112% auto; background-position: 60% 40%; } }
.hub-hero-t { font-size: 28px; text-shadow: 0 2px 18px #000; }

/* login: cover art slowly zooms behind frosted glass */
.auth { position: relative; overflow: hidden; background: #06130d; isolation: isolate; }
.auth-bg { position: absolute; inset: -4%; z-index: -2; background: linear-gradient(180deg, #06130d99, #06130de6 75%), var(--cover, none) center / cover no-repeat; animation: authZoom 40s ease-in-out infinite alternate; }
@keyframes authZoom { to { transform: scale(1.08) translate(-1%, 1%); } }
.auth-card { animation: rise .8s var(--ease) both; box-shadow: 0 30px 80px #000c, 0 0 60px -20px #d4af5f66; }
.auth-logo { animation: markGlow 5s ease-in-out infinite, rise .9s .1s var(--ease) both; }

/* misc */
.toast { background: var(--gold-grad); color: #10241a; box-shadow: 0 12px 34px #000b, 0 0 30px #d4af5f77; animation: toastIn .45s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } }
.role-badge.owner { box-shadow: 0 0 14px #d4af5f66; }
.demo-bar { position: relative; z-index: 21; }
.status.ok { box-shadow: 0 0 12px #7fd09a33; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Calendar ---- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-range { min-width: 130px; text-align: center; }
.cal-bar label { display: inline-flex; align-items: center; gap: 8px; }
.cal-stats { margin-bottom: 8px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; min-height: 120px; min-width: 0; }
.cal-day.today { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.cal-day-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.cal-none { padding: 6px 2px; }
.cal-call { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 8px 9px; margin-bottom: 8px; font-size: 13px; overflow-wrap: anywhere; }
.cal-call.past { opacity: .7; }
.cal-call.off { opacity: .55; border-left-color: var(--bad); }
.cal-call.off .cal-who b { text-decoration: line-through; }
.cal-time { font-weight: 700; margin-bottom: 2px; }
.cal-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.cal-links a { color: var(--accent); }
.cal-email { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cal-email input { max-width: 230px; padding: 5px 8px; font-size: 12.5px; }
.danger-outline { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)) !important; color: var(--bad); }
@media (max-width: 1000px) { .cal-week { grid-template-columns: 1fr; } .cal-day { min-height: 0; } }

/* Post-call notes: tappable choice chips */
.chip.pick { cursor: pointer; color: var(--text); font: inherit; font-size: 13px; }
.chip.pick:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.chip.pick.on { background: var(--gold-grad, var(--accent)); color: #10241a; border-color: #b8914a; font-weight: 700; }

/* ---- Rep Hub sections + Contracts ---- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px; background: #0a1c14cc; border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%; }
.subnav button { background: none; border: 0; color: var(--muted); padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; font-family: var(--hfont); letter-spacing: .02em; transition: color .2s, background .25s; }
.subnav button:hover { color: var(--text); }
.subnav button.on { background: var(--gold-grad); color: #10241a; box-shadow: 0 0 16px #d4af5f55; }
.subnav button:focus-visible { outline: 2px solid #e8c77a; outline-offset: 2px; }
.review { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.review span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.review b { font-weight: 600; overflow-wrap: anywhere; }
input.readonly { opacity: .75; cursor: default; }
.status.muted { color: var(--muted); } .status.warnish { color: #e8c77a; }
@media (max-width: 520px) { .subnav { width: 100%; } .subnav button { flex: 1; padding: 9px 8px; } }
select.warn-sel { border-color: var(--accent); color: var(--accent2); }
/* Link editors: every field gets real width; the URL (last field) gets the most. */
.list-edit .list-row input { flex: 1 1 0; min-width: 0; width: auto; }
.list-edit .list-row input:last-of-type { flex: 2.4 1 0; }
.list-edit .list-row .btn { flex: 0 0 auto; }
@media (max-width: 700px) { .list-edit .list-row { flex-wrap: wrap; } .list-edit .list-row input, .list-edit .list-row input:last-of-type { flex: 1 1 100%; } }
.contact-ways { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.list-edit .list-row input[placeholder="Email"] { flex: 1.6 1 0; }
/* Owner/admin "View as" role preview */
.view-as { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.view-as .select.sm { padding: 5px 8px; font-size: 12.5px; }
.preview-bar { max-width: 1180px; margin: 8px auto 0; padding: 8px 14px; border-radius: 10px; background: #d4af5f22; border: 1px solid #d4af5f66; color: var(--text); font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) { .view-as span { display: none; } .preview-bar { margin: 8px 16px 0; } }
.user { flex-wrap: wrap; justify-content: flex-end; }
