/* Verve Art Client Portal — cream & forest */
:root {
  --paper: #F3EEDF;
  --paper-deep: #E9E1CB;
  --sheet: #FBF8EF;
  --forest: #1E3A2A;
  --forest-soft: #2F5841;
  --forest-tint: #DCE4D3;
  --ink: #1A211C;
  --muted: #5D665A;
  --line: #D6CDB4;
  --line-soft: #E4DCC6;
  --ochre: #94661F;
  --ochre-tint: #F1E2C2;
  --rust: #93442F;
  --rust-tint: #F2D9CF;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --focus: 0 0 0 3px rgba(47, 88, 65, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--forest-soft); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- layout: agency ---------- */
.agency { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--forest);
  color: #E8E6D6;
  padding: 26px 18px;
  display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { font-family: var(--serif); font-size: 22px; color: #F7F2E3; text-decoration: none; padding: 0 10px; line-height: 1.1; }
.side .brand span { display: block; font-family: var(--sans); font-size: 12px; color: #A9B8A3; margin-top: 4px; letter-spacing: .01em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #D9DECF; text-decoration: none; padding: 8px 10px; border-radius: var(--radius); font-size: 14.5px; display: flex; justify-content: space-between; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.on { background: #F3EEDF; color: var(--forest); font-weight: 600; }
.side nav .count { background: var(--ochre-tint); color: #5f420f; border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.side .who { margin-top: auto; font-size: 13px; color: #A9B8A3; padding: 0 10px; }
.side .who form { display: inline; }
.side .who button { background: none; border: 0; color: #E8E6D6; padding: 0; text-decoration: underline; cursor: pointer; font: inherit; }
.main { padding: 34px clamp(18px, 4vw, 48px) 64px; min-width: 0; max-width: 1240px; }

/* ---------- layout: client ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar .in { max-width: 1160px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; }
.topbar .brand { font-family: var(--serif); font-size: 20px; color: var(--forest); text-decoration: none; }
.topbar .for { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 16px; }
.topbar nav { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14px; }
.topbar nav form { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--forest); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.page { max-width: 1160px; margin: 0 auto; padding: 34px 20px 72px; }
.foot { max-width: 1160px; margin: 0 auto; padding: 0 20px 34px; color: var(--muted); font-size: 12.5px; }

/* ---------- layout: bare ---------- */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.bare .box { width: 100%; max-width: 440px; }
.bare .box.wide { max-width: 760px; }
.bare .mark { font-family: var(--serif); font-size: 22px; color: var(--forest); margin-bottom: 26px; display: block; text-decoration: none; }

/* ---------- headings & structure ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.head .crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.head .crumbs a { color: var(--muted); }
.head .sub { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.section { margin-top: 38px; }
.section > h2 { margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.section > h2 .n { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.sheet { background: var(--sheet); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px; }
.sheet + .sheet { margin-top: 18px; }
.sheet h3 { margin-bottom: 10px; }
.empty { color: var(--muted); padding: 18px 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); padding: 14px 2px; display: flex; gap: 16px; align-items: center; }
.list > li .grow { flex: 1; min-width: 0; }
.list > li .title { font-weight: 600; text-decoration: none; color: var(--ink); }
.list > li a.title:hover { color: var(--forest); text-decoration: underline; }
.list > li .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ref { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:hover td { background: rgba(255,255,255,.35); }
.table-wrap { overflow-x: auto; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.badge-draft { background: transparent; color: var(--muted); border-color: var(--line); }
.badge-in_review { background: var(--ochre-tint); color: #6b4a12; }
.badge-changes_requested { background: var(--rust-tint); color: #7a3524; }
.badge-approved { background: var(--forest); color: #F3EEDF; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14.5px/1 var(--sans);
  padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid var(--forest); background: var(--forest); color: #F7F2E3;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--forest-soft); color: #fff; }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.ghost:hover { background: var(--forest-tint); }
.btn.warn { background: transparent; color: var(--rust); border-color: #C99B8C; }
.btn.warn:hover { background: var(--rust-tint); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; font: 15px/1.4 var(--sans); color: var(--ink);
  background: #FFFDF7; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest-soft); box-shadow: var(--focus); }
input[type=file] { font: 14px var(--sans); max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--forest); width: 16px; height: 16px; flex: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1; min-width: 150px; }
details.more summary { cursor: pointer; color: var(--forest); font-weight: 600; font-size: 14px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "– "; }
details.more[open] summary { margin-bottom: 14px; }

/* ---------- alerts ---------- */
.flash { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.flash.success { background: var(--forest-tint); border-color: #B7C7AE; color: #1d3a28; }
.flash.error { background: var(--rust-tint); border-color: #DDB2A3; color: #6d2d1d; }
.flash.info { background: var(--ochre-tint); border-color: #DFC48F; color: #5b3f0e; }
.copybox { display: flex; gap: 8px; margin-top: 8px; }
.copybox input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.timeline li.done .dot { background: var(--forest); border-color: var(--forest); }
.timeline li.done .dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #F3EEDF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.timeline li.in_progress .dot { border-color: var(--forest); background: radial-gradient(var(--forest) 0 3px, var(--paper) 4px); }
.timeline li.done::before { background: var(--forest); }
.timeline .t { font-weight: 600; }
.timeline li.upcoming .t { font-weight: 500; }
.timeline .d { font-size: 13px; color: var(--muted); }
.progress { height: 6px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; background: var(--forest); }

/* ---------- review ---------- */
.viewer { background: #E4DCC5; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--sheet); border-bottom: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.viewer .stage { display: grid; place-items: center; min-height: 420px; padding: 24px; }
.viewer .stage img { max-height: 76vh; box-shadow: 0 1px 2px rgba(30,40,30,.12), 0 8px 30px rgba(30,40,30,.12); background: #fff; }
.viewer iframe { width: 100%; height: 78vh; border: 0; display: block; background: #fff; }
.viewer .linkcard { text-align: center; max-width: 440px; }
.viewer .linkcard .url { font-size: 13px; color: var(--muted); word-break: break-all; margin: 6px 0 16px; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; }
.versions a { font-size: 13px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--sheet); }
.versions a.on { background: var(--forest); color: #F3EEDF; border-color: var(--forest); }
.versions a .ok { color: inherit; }
.notice { border-left: 3px solid var(--ochre); background: var(--ochre-tint); padding: 10px 14px; font-size: 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 14px; }

.comments { list-style: none; margin: 0 0 14px; padding: 0; }
.comments li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.comments li:first-child { padding-top: 0; }
.comments .who { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comments .who .tag { font-weight: 500; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; }
.comments li.staff .who .tag { color: var(--forest); border-color: #B7C7AE; }
.comments .when { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.comments .body { margin-top: 4px; font-size: 14.5px; overflow-wrap: anywhere; }

.decide h3 { margin-bottom: 4px; }
.decide .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }

/* ---------- the seal ---------- */
.seal {
  --c: var(--forest);
  width: 132px; height: 132px; border-radius: 50%;
  border: 2.5px solid var(--c); color: var(--c);
  display: grid; place-items: center; text-align: center;
  position: relative; flex: none;
  transform: rotate(-6deg);
}
.seal::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--c); }
.seal b { display: block; font: 700 11px/1 var(--sans); letter-spacing: .14em; }
.seal .v { display: block; font: 500 38px/1 var(--serif); margin: 4px 0 3px; }
.seal small { display: block; font-size: 11px; color: inherit; }
.seal.changes { --c: var(--rust); }
.seal.sm { width: 84px; height: 84px; border-width: 2px; }
.seal.sm::before { inset: 4px; }
.seal.sm .v { font-size: 24px; margin: 2px 0 1px; }
.seal.sm b { font-size: 8.5px; }
.seal.sm small { font-size: 9px; }
.seal.stamp { animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { from { transform: rotate(-14deg) scale(1.5); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .seal.stamp { animation: none; } }

.record { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.facts { display: grid; grid-template-columns: 150px 1fr; margin: 0; border-top: 1px solid var(--line); }
.facts dt, .facts dd { padding: 10px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { overflow-wrap: anywhere; }
.statement { font-family: var(--serif); font-size: 18px; line-height: 1.5; border-left: 3px solid var(--forest); padding: 4px 0 4px 16px; margin: 0; }
.sigbox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-width: 360px; }
.sigbox img { display: block; width: 100%; }

/* signature pad */
.pad-wrap { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.pad-wrap canvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; border-radius: var(--radius); }
.pad-wrap .baseline { position: absolute; left: 18px; right: 18px; bottom: 38px; border-bottom: 1px solid var(--line); pointer-events: none; }
.pad-wrap .x { position: absolute; left: 18px; bottom: 42px; color: var(--muted); font-family: var(--serif); pointer-events: none; }
.pad-wrap .clear { position: absolute; right: 10px; top: 8px; }
.code-input { font: 500 30px/1 ui-monospace, Menlo, monospace !important; letter-spacing: .35em; text-align: center; max-width: 260px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { border-top: 2px solid var(--forest); padding-top: 10px; }
.stat .n { font-family: var(--serif); font-size: 34px; line-height: 1; }
.stat .l { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.stat.warn { border-color: var(--rust); }
.stat.wait { border-color: var(--ochre); }
.feed { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.feed .when { color: var(--muted); font-size: 12.5px; }

.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover h3 { text-decoration: underline; }

.checks { list-style: none; padding: 0; margin: 0 0 20px; font-size: 14px; }
.checks li { padding: 6px 0 6px 26px; position: relative; border-bottom: 1px solid var(--line-soft); }
.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--forest); font-weight: 700; }
.checks li.bad::before { content: "✕"; color: var(--rust); }
.checks li.opt::before { content: "–"; color: var(--ochre); }
.checks .help { display: block; color: var(--muted); font-size: 12.5px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 4px; margin: 0 0 18px; background: var(--sheet); }
legend { font-family: var(--serif); font-size: 18px; padding: 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .agency { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .side nav a { padding: 6px 10px; font-size: 14px; }
  .side .who { margin: 0 0 0 auto; }
  .main { padding: 24px 16px 56px; }
  .topbar .for { display: none; }
  .page { padding: 24px 16px 56px; }
  .record { grid-template-columns: 1fr; }
  .record .seal { order: -1; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .viewer .stage { min-height: 280px; padding: 12px; }
  .viewer iframe { height: 70vh; }
  .list > li { flex-wrap: wrap; }
}
@media print {
  .side, .topbar, .no-print, .foot { display: none !important; }
  body { background: #fff; }
  .agency { display: block; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* PDF pages rendered with PDF.js so previews work on phones too */
.pdfpages { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 16px; max-height: 80vh; overflow-y: auto; }
.pdfpages canvas { display: block; width: 100%; max-width: 900px; height: auto; background: #fff; box-shadow: 0 1px 2px rgba(30,40,30,.12), 0 6px 24px rgba(30,40,30,.10); }
.pdfpages .pageno { font-size: 12px; color: var(--muted); margin-top: -10px; }
.pdfpages .pdf-fallback { width: 100%; height: 76vh; border: 0; background: #fff; }
@media (max-width: 760px) { .pdfpages { padding: 10px; gap: 10px; max-height: none; } }
.grid2 > .sheet + .sheet { margin-top: 0; }
