/* ============================================================
   WORKPOST — Product mockups (faithful HTML/CSS UI)
   Realistic dummy data: Fieldnote Studio · Marlow Coffee Co.
   ============================================================ */

/* ---------- Generic app shell ---------- */
.app {
  --app-line: #e7e2d9;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  user-select: none;
}
.app-topbar {
  height: 46px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--app-line);
  background: var(--surface);
}
.app-crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.app-crumbs b { color: var(--ink); font-weight: 550; }
.app-crumbs .sep { color: var(--faint); }
.app-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 6px; text-transform: uppercase; font-weight: 500;
}
.app-spacer { flex: 1; }
.app-btn {
  font-size: 12.5px; font-weight: 500; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.app-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.app-avatars { display: flex; }
.app-avatars span {
  width: 24px; height: 24px; border-radius: 50%; margin-left: -7px;
  border: 2px solid var(--surface); display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: #fff;
}

/* ============================================================
   PROPOSAL BUILDER (hero) — split editor / preview
   ============================================================ */
.builder { display: grid; grid-template-columns: 270px 1fr; min-height: 460px; }
.builder-rail { border-right: 1px solid var(--app-line); background: var(--surface-2); padding: 14px; display: flex; flex-direction: column; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rail-head h6 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.rail-add { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-soft); font-size: 14px; line-height: 1; }
.block-list { display: flex; flex-direction: column; gap: 4px; }
.block {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 9px;
  border: 1px solid transparent;
  background: transparent; color: var(--ink-soft);
}
.block .grip { color: var(--faint); font-size: 12px; letter-spacing: -2px; cursor: grab; }
.block .b-ico { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; color: var(--ink-soft); flex: none; }
.block .b-label { font-size: 13px; font-weight: 450; flex: 1; }
.block.active { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.block.active .b-ico { background: var(--accent-soft); color: var(--accent-deep); }
.block.active .b-label { font-weight: 550; }
.rail-ai {
  margin-top: 14px; padding: 12px; border-radius: 11px;
  background: linear-gradient(160deg, var(--accent-tint), var(--surface));
  border: 1px solid var(--accent-soft);
}
.rail-ai .ai-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; color: var(--accent-deep); }
.rail-ai p { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }
.rail-ai .ai-btn { margin-top: 9px; width: 100%; justify-content: center; font-size: 12px; padding: 8px; border-radius: 8px; background: var(--accent); color: #fff; border: none; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }

.builder-preview { background: var(--bg-2); padding: 24px; display: grid; place-items: start center; overflow: hidden; }
.preview-doc {
  width: 100%; max-width: 380px; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--dark);
}

/* Editorial cover (used in builder preview + public view) */
.ed-cover {
  background: var(--dark); color: var(--dark-ink);
  padding: 30px 28px 26px;
  position: relative;
}
.ed-cover .ed-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dark-faint); }
.ed-cover .ed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ed-cover .ed-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-top: 40px; }
.ed-cover .ed-title { font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.08; letter-spacing: -0.01em; margin-top: 12px; color: #fff; }
.ed-cover .ed-title em { font-style: italic; }
.ed-cover .ed-meta { display: flex; gap: 26px; margin-top: 30px; }
.ed-cover .ed-meta div { }
.ed-cover .ed-meta .k { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--dark-faint); }
.ed-cover .ed-meta .v { font-size: 13px; color: var(--dark-ink); margin-top: 3px; font-weight: 450; }

/* ============================================================
   PUBLIC PROPOSAL — full page, theme-able
   ============================================================ */
.proposal {
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.proposal-body { padding: 0; }

/* Cover varies by theme */
.p-cover { padding: 56px 56px 48px; position: relative; }
.p-cover > div:first-child { gap: 18px; }
.p-cover > div:first-child span { white-space: nowrap; }
.p-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin-top: 30px; }
.p-title { line-height: 1.02; margin-top: 16px; }
.p-meta { display: flex; gap: 48px; margin-top: 38px; flex-wrap: wrap; }
.p-meta .k { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.p-meta .v { font-size: 15px; margin-top: 5px; }

/* Investment table + accept (shared light area) */
.p-sheet { padding: 44px 56px 52px; background: var(--surface); color: var(--ink); }
.p-sheet h4 { font-size: 13px; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.inv { margin-top: 20px; border-top: 1px solid var(--line); }
.inv-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.inv-row .desc { font-size: 16px; font-weight: 500; color: var(--ink); }
.inv-row .sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.inv-row .amt { font-family: var(--mono); font-size: 15px; color: var(--ink); white-space: nowrap; }
.inv-total { display: grid; grid-template-columns: 1fr auto; padding: 20px 0 0; align-items: baseline; }
.inv-total .desc { font-size: 16px; font-weight: 600; }
.inv-total .amt { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.p-accept { margin-top: 36px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.p-accept .accept-btn {
  background: var(--accent); color: #fff; border: none; font-weight: 550; font-size: 16px;
  padding: 15px 30px; border-radius: 12px; display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 2px 0 var(--accent-deep), 0 12px 28px -10px var(--accent);
}
.p-accept .accept-note { font-size: 13.5px; color: var(--muted); }
.p-accept .accept-note b { color: var(--ink); font-weight: 550; }

/* --- Theme: Editorial (dark serif cover) --- */
.proposal[data-active-theme="editorial"] .p-cover { background: var(--dark); color: var(--dark-ink); }
.proposal[data-active-theme="editorial"] .p-kicker { color: var(--accent); }
.proposal[data-active-theme="editorial"] .p-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.4vw, 52px); letter-spacing: -0.01em; color: #fff; }
.proposal[data-active-theme="editorial"] .p-title em { font-style: italic; }
.proposal[data-active-theme="editorial"] .p-meta .v { color: var(--dark-ink); }

/* --- Theme: Bold (terracotta cover, big sans) --- */
.proposal[data-active-theme="bold"] .p-cover { background: var(--accent); color: #fff; }
.proposal[data-active-theme="bold"] .p-kicker { color: rgba(255,255,255,.8); }
.proposal[data-active-theme="bold"] .p-title { font-weight: 600; font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -0.035em; color: #fff; }
.proposal[data-active-theme="bold"] .p-meta .v { color: #fff; }
.proposal[data-active-theme="bold"] .p-meta .k { color: rgba(255,255,255,.7); opacity: 1; }

/* --- Theme: Minimal (light, restrained) --- */
.proposal[data-active-theme="minimal"] .p-cover { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.proposal[data-active-theme="minimal"] .p-kicker { color: var(--accent-deep); }
.proposal[data-active-theme="minimal"] .p-title { font-weight: 550; font-size: clamp(32px, 4.2vw, 48px); letter-spacing: -0.03em; color: var(--ink); }
.proposal[data-active-theme="minimal"] .p-meta .k { color: var(--muted); opacity: 1; }
.proposal[data-active-theme="minimal"] .p-meta .v { color: var(--ink); }

/* Theme switcher control */
.theme-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.theme-switch button { border: none; background: transparent; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; padding: 7px 14px; border-radius: 8px; color: var(--ink-soft); font-weight: 500; }
.theme-switch button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ============================================================
   CLIENT PORTAL
   ============================================================ */
.portal { min-height: 420px; }
.portal-hero { padding: 22px 22px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.portal-hero .ph-left { display: flex; gap: 14px; align-items: center; }
.portal-hero .ph-logo { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(150deg, #4a3b30, #2a211b); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 20px; font-style: italic; }
.portal-hero h3 { font-size: 19px; letter-spacing: -0.02em; }
.portal-hero .ph-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.portal-tabs { display: flex; gap: 2px; padding: 14px 22px 0; border-bottom: 1px solid var(--app-line); }
.portal-tabs span { font-size: 13px; padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 450; }
.portal-tabs span.on { color: var(--ink); border-color: var(--accent); font-weight: 550; }
.portal-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; padding: 20px 22px; }
.pcard { border: 1px solid var(--app-line); border-radius: 11px; padding: 15px; background: var(--surface); }
.pcard h6 { font-size: 11px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.milestone { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.milestone + .milestone { border-top: 1px solid var(--surface-2); }
.mstone-check { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10px; }
.mstone-check.done { background: var(--green); color: #fff; }
.mstone-check.now { background: var(--accent); color: #fff; }
.mstone-check.todo { border: 1.5px solid var(--line-2); }
.milestone .ms-label { font-size: 13.5px; flex: 1; }
.milestone .ms-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.milestone.is-todo .ms-label { color: var(--muted); }
.feed-item { display: flex; gap: 10px; padding: 9px 0; font-size: 12.5px; }
.feed-item + .feed-item { border-top: 1px solid var(--surface-2); }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: none; }
.feed-item .ft { color: var(--ink-soft); line-height: 1.4; }
.feed-item .ft b { color: var(--ink); font-weight: 550; }
.feed-item .fd { display: block; font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 2px; }
.inv-mini { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.inv-mini + .inv-mini { border-top: 1px solid var(--surface-2); }
.inv-mini .im-l b { font-size: 13px; }
.inv-mini .im-l span { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.inv-mini .im-amt { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }

/* ============================================================
   DEALS KANBAN
   ============================================================ */
.kanban { padding: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; min-height: 400px; background: var(--surface-2); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kcol-head .kt { font-size: 12px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.kcol-head .kt .kd { width: 7px; height: 7px; border-radius: 50%; }
.kcol-head .kn { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.kcol-sum { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 10px; }
.deal { background: var(--surface); border: 1px solid var(--app-line); border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.deal .dco { display: flex; align-items: center; gap: 8px; }
.deal .dco .dlogo { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; }
.deal .dname { font-size: 13px; font-weight: 550; letter-spacing: -0.01em; }
.deal .dval { font-family: var(--mono); font-size: 13px; font-weight: 500; margin-top: 10px; }
.deal .dmeta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.deal .dwho { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 600; color: #fff; }
.deal .dage { font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* ============================================================
   PROJECT OVERVIEW
   ============================================================ */
.project { display: grid; grid-template-columns: 1fr 240px; min-height: 420px; }
.proj-main { padding: 20px 22px; }
.proj-head { display: flex; align-items: center; justify-content: space-between; }
.proj-head h3 { font-size: 18px; letter-spacing: -0.02em; }
.proj-head .ph-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.proj-progress { margin: 18px 0 22px; }
.proj-progress .pp-bar { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.proj-progress .pp-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.proj-progress .pp-label { display: flex; justify-content: space-between; font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 7px; }
.task { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--surface-2); }
.task .tcheck { width: 17px; height: 17px; border-radius: 5px; flex: none; }
.task .tcheck.done { background: var(--green); display: grid; place-items: center; color: #fff; font-size: 10px; }
.task .tcheck.open { border: 1.5px solid var(--line-2); }
.task .tname { font-size: 13.5px; flex: 1; }
.task.is-done .tname { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.task .tassign { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; }
.task .tdue { font-family: var(--mono); font-size: 10.5px; color: var(--muted); width: 54px; text-align: right; }
.proj-side { border-left: 1px solid var(--app-line); background: var(--surface-2); padding: 20px 18px; }
.proj-side .ps-block + .ps-block { margin-top: 20px; }
.proj-side h6 { font-size: 10.5px; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.ps-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; }
.ps-row .k { color: var(--muted); }
.ps-row .v { font-weight: 500; }

/* ============================================================
   INVOICE
   ============================================================ */
.invoice { padding: 30px 34px 34px; min-height: 420px; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-head .ih-from .ifrom-logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.invoice-head .ih-from .ifrom-logo .m { width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color:#fff; display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 13px; }
.invoice-head .ih-from p { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.invoice-head .ih-no { text-align: right; }
.invoice-head .ih-no .big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.invoice-head .ih-no .small { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.invoice-meta { display: flex; gap: 40px; margin: 26px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.invoice-meta .k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.invoice-meta .v { font-size: 13.5px; margin-top: 5px; font-weight: 500; }
.itable { width: 100%; border-collapse: collapse; }
.itable th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding-bottom: 12px; }
.itable th.r, .itable td.r { text-align: right; }
.itable td { padding: 13px 0; border-top: 1px solid var(--surface-2); font-size: 13.5px; }
.itable td.desc b { font-weight: 550; }
.itable td.desc span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.itable td.amt { font-family: var(--mono); }
.invoice-totals { margin-top: 16px; margin-left: auto; width: 240px; }
.invoice-totals .it-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.invoice-totals .it-row .k { color: var(--muted); }
.invoice-totals .it-row.grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 600; }
.invoice-totals .it-row .v { font-family: var(--mono); }

/* ---------- Mockup responsive ---------- */
@media (max-width: 760px) {
  .builder { grid-template-columns: 1fr; }
  .builder-rail { display: none; }
  .project { grid-template-columns: 1fr; }
  .proj-side { display: none; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .portal-grid { grid-template-columns: 1fr; }
  .p-cover, .p-sheet { padding-left: 28px; padding-right: 28px; }
}
