/* EpoxyPlan Pro: account, dashboard, editor and the printable document. Loaded on /pro/ pages only. */

/* ---------- Landing ---------- */
.pro-hero { padding-bottom: 40px; }
.pro-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; margin-top: 8px; }
.pro-hero h1 { max-width: 16ch; }
.pro-sample { margin: 0; }
.pro-sample-sheet { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px 24px 20px; font-size: .9rem; transform: rotate(.6deg); }
.ps-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ps-head strong { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.ps-head span { color: var(--muted); font-size: .8rem; }
.ps-logo { width: 40px; height: 40px; border-radius: 10px; background: #2B3A2F; color: #F3E9D2; display: grid; place-items: center; font-weight: 750; font-size: .85rem; letter-spacing: .04em; flex-shrink: 0; }
.ps-num { margin-left: auto; text-align: right; }
.ps-num span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 700; color: var(--muted); }
.ps-rows { padding: 10px 0; }
.ps-rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ps-rows > div.ps-sub { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--ink); font-weight: 600; }
.ps-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 12px; font-variant-numeric: tabular-nums; }
.ps-total strong { font-family: var(--font-display); font-size: 1.3rem; }
.pro-sample figcaption { margin-top: 14px; text-align: center; }
.pro-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pro-features li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pro-features svg { width: 22px; height: 22px; color: var(--resin); flex-shrink: 0; margin-top: 2px; }
.pro-features strong { display: block; color: var(--ink); margin-bottom: 4px; }
.pro-features span { color: var(--ink-2); font-size: .93rem; line-height: 1.5; }
@media (max-width: 900px) { .pro-hero-grid { grid-template-columns: 1fr; gap: 32px; } .pro-features { grid-template-columns: 1fr 1fr; } .pro-sample-sheet { transform: none; } }
@media (max-width: 600px) { .pro-features { grid-template-columns: 1fr; } }

/* Home and project page CTA (Pro build) */
.pro-start { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; text-align: left; }
.pro-start .price { font-family: var(--font-display); font-size: 2rem; font-weight: 750; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.pro-start .price span { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }

/* ---------- App shell ---------- */
.pro-subnav { background: var(--resin-900); color: #DCEAE7; }
.pro-subnav .container { display: flex; align-items: center; gap: 4px; min-height: 48px; overflow-x: auto; }
.pro-subnav a { color: #DCEAE7; text-decoration: none; font-size: .9rem; font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.pro-subnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.pro-subnav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.pro-subnav-user { margin-left: auto; font-size: .82rem; color: #A9C7C2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; padding: 0 8px; }
.pro-subnav .btn-link { color: #fff; font-size: .88rem; white-space: nowrap; padding: 7px 4px; }
.pro-subnav .btn-link:hover { color: #fff; }
.pro-wrap { padding-bottom: 72px; }
.page-head-tight { padding-bottom: 18px; }
.h-card { font-size: 1.1rem; margin: 0; }
.pro-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pro-grid-2 .card + .card { margin-top: 0; }
@media (max-width: 820px) { .pro-grid-2 { grid-template-columns: 1fr; } .pro-subnav-user { display: none; } .pro-subnav .btn-link { margin-left: auto; } }
.pro-gate { max-width: 640px; }
.pro-gate p { color: var(--ink-2); }
.notice { background: var(--info-bg); border: 1px solid var(--info-line); color: var(--ink-2); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .93rem; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #4A3A1E; }
textarea.textarea { font: inherit; font-size: 1rem; height: auto; min-height: 76px; padding: 11px 14px; line-height: 1.45; resize: vertical; font-variant-numeric: normal; }
select.select-sm { height: 38px; font-size: .9rem; padding: 0 10px; width: auto; }
.visually-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.visually-file:focus-visible + .btn, .logo-actions label.btn:focus-within { outline: 3px solid color-mix(in srgb, var(--resin) 55%, transparent); outline-offset: 2px; }
.logo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 180px; height: 84px; border: 1px dashed var(--line-strong); border-radius: 12px; display: grid; place-items: center; background: #fff; padding: 10px; }
.logo-preview img { max-width: 100%; max-height: 64px; object-fit: contain; }
.logo-actions { display: grid; gap: 8px; justify-items: start; flex: 1 1 220px; }
.auth-card { max-width: 480px; }
.auth-tabs { width: 100%; }
.auth-tabs button { flex: 1; height: 38px; }
.card + .notice { margin-top: 16px; }

/* Documents table */
.table-wrap { overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.doc-table th { text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.doc-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table a { font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.doc-table a:hover { text-decoration: underline; }
.doc-table .r { text-align: right; }
.kind-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.kind-dot.invoice { background: var(--resin); }
.status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #EFE9DD; color: var(--ink-2); }
.status.s-sent { background: #E2EEF3; color: #154A63; }
.status.s-paid { background: #E7F4EC; color: #1C5B3A; }
.empty-state { text-align: center; padding: 24px 12px; }
@media (max-width: 640px) { .hide-sm { display: none; } .doc-table td, .doc-table th { padding-left: 8px; padding-right: 8px; } }

.client-list { list-style: none; margin: 0; padding: 0; }
.client-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.client-list li:first-child { border-top: 0; padding-top: 0; }
.pre { white-space: pre-line; }

/* ---------- Editor ---------- */
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ed-head h1 { margin: 0; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-delete { color: #8A2318; }
.ed-delete:hover { border-color: #C2410C; color: #8A2318; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ed-side { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 980px) { .ed-grid { grid-template-columns: 1fr; } .ed-side { position: static; } }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; }
.pair .select { padding: 0 10px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines-head, .line { display: grid; grid-template-columns: 112px minmax(0, 1fr) 76px 70px 112px 104px 36px; gap: 8px; align-items: center; }
.lines-head { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.lines-head span:nth-child(3), .lines-head span:nth-child(5), .lines-head span:nth-child(6) { text-align: right; }
.line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.line input.text, .line .input input { height: 40px; font-size: .95rem; padding: 0 10px; }
.line .select-sm { width: 100%; }
.line .lf-qty input, .line .lf-price input { text-align: right; }
.input-money .pre { position: absolute; left: 10px; color: var(--muted); font-size: .9rem; pointer-events: none; }
.line .input-money input { padding-left: 22px; padding-right: 10px; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: .95rem; height: 40px; }
.line .input-money input:focus { outline: none; border-color: var(--resin); box-shadow: 0 0 0 3px rgba(14,106,106,.16); }
.lf-amt { text-align: right; font-weight: 650; color: var(--ink); }
.lbl-sm { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 760px) {
  .lines-head { display: none; }
  .line { grid-template-columns: 1fr 1fr 1fr 36px; grid-template-areas: "type type type del" "desc desc desc desc" "qty unit price price" "amt amt amt amt"; row-gap: 8px; padding: 14px 0; }
  .lf-type { grid-area: type; } .lf-desc { grid-area: desc; } .lf-qty { grid-area: qty; } .lf-unit { grid-area: unit; } .lf-price { grid-area: price; } .lf-amt { grid-area: amt; } .lf-del { grid-area: del; }
  .line .select-sm { width: auto; }
  .lbl-sm { position: static !important; width: auto; height: auto; clip: auto; display: block; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
}
.totals { margin: 14px 0 18px; display: grid; gap: 0; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .94rem; color: var(--ink-2); }
.totals dd { margin: 0; }
.totals .sub { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--ink); font-weight: 600; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; color: var(--ink); font-weight: 750; font-size: 1.12rem; font-family: var(--font-display); }
.totals-card .form-msg { margin-bottom: 12px; }

/* ---------- Printable document ---------- */
.doc-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 16px; }
.doc-sheet { --doc-ink: #1d2322; --doc-mute: #5e6664; --doc-line: #dedad2; background: #fff; color: var(--doc-ink); max-width: 8.5in; margin: 0 auto 64px; padding: .7in .75in; box-shadow: var(--shadow-lg); border: 1px solid var(--line); border-radius: 4px; font-size: 10.5pt; line-height: 1.45; font-family: var(--font); }
.doc-sheet table { border-collapse: collapse; }
.doc-head { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--doc-line); }
.doc-brand { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.doc-logo { max-width: 160px; max-height: 72px; object-fit: contain; flex-shrink: 0; }
.doc-biz { color: var(--doc-mute); font-size: 9.5pt; min-width: 0; }
.doc-biz-name { font-family: var(--font-display); font-weight: 700; font-size: 14pt; color: var(--doc-ink); letter-spacing: -0.01em; margin-bottom: 3px; }
.doc-meta { text-align: right; flex-shrink: 0; }
.doc-kind { font-family: var(--font-display); font-size: 22pt; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-bottom: 10px; }
.doc-meta table { margin-left: auto; font-size: 9.5pt; }
.doc-meta th { text-align: left; font-weight: 500; color: var(--doc-mute); padding: 1px 14px 1px 0; }
.doc-meta td { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-paid { display: inline-block; margin-top: 10px; border: 2px solid #1C6A47; color: #1C6A47; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 10pt; padding: 3px 12px; border-radius: 4px; }
.doc-parties { display: flex; gap: 48px; padding: 20px 0; }
.doc-parties > div { min-width: 0; }
.doc-label { font-size: 7.5pt; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--doc-mute); margin-bottom: 4px; }
.doc-client { font-weight: 650; }
.doc-lines { width: 100%; margin-top: 4px; }
.doc-lines th { font-size: 7.5pt; letter-spacing: .12em; text-transform: uppercase; color: var(--doc-mute); font-weight: 700; text-align: left; padding: 8px 8px 8px 0; border-bottom: 1.5px solid var(--doc-ink); }
.doc-lines td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--doc-line); vertical-align: top; }
.doc-lines th.r, .doc-lines td.r { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
.doc-lines tr { break-inside: avoid; }
.doc-bottom { display: flex; justify-content: space-between; gap: 36px; margin-top: 18px; break-inside: avoid; }
.doc-notes { flex: 1; min-width: 0; font-size: 9.5pt; }
.doc-notes p { margin: 0 0 12px; color: var(--doc-ink); }
.doc-totals { min-width: 250px; font-size: 10pt; align-self: flex-start; }
.doc-totals th { text-align: left; font-weight: 500; color: var(--doc-mute); padding: 4px 18px 4px 0; }
.doc-totals td { text-align: right; padding: 4px 0; white-space: nowrap; }
.doc-totals .grand th, .doc-totals .grand td { border-top: 1.5px solid var(--doc-ink); padding-top: 9px; font-weight: 750; font-size: 12pt; color: var(--doc-ink); }
.doc-totals .due th, .doc-totals .due td { font-weight: 700; color: var(--doc-ink); }
.doc-foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--doc-line); text-align: center; color: var(--doc-mute); font-size: 9pt; }
.doc-foot p { margin: 0 0 4px; }
.doc-credit { font-size: 7pt; color: #9aa09e; letter-spacing: .02em; }
@media (max-width: 720px) {
  .doc-sheet { padding: 24px 18px; margin: 0 12px 48px; font-size: 10pt; }
  .doc-head { flex-direction: column; gap: 18px; }
  .doc-meta { text-align: left; } .doc-meta table { margin-left: 0; }
  .doc-brand { flex-direction: column; gap: 10px; }
  .doc-parties { flex-direction: column; gap: 14px; }
  .doc-bottom { flex-direction: column-reverse; gap: 18px; }
  .doc-totals { min-width: 0; width: 100%; }
  .doc-lines th:nth-child(3), .doc-lines td:nth-child(3) { display: none; }
}

@media print {
  @page { margin: 14mm 14mm 16mm; }
  .doc-page .site-header, .doc-page .site-footer, .doc-page .skip-link, .doc-toolbar, .pro-subnav { display: none !important; }
  .doc-page, .doc-page main { background: #fff !important; }
  .doc-sheet { box-shadow: none; border: 0; border-radius: 0; margin: 0; padding: 0; max-width: none; }
  .doc-sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-sheet a { color: inherit; text-decoration: none; }
}
