/* StageCulture AVL Proposals — mobile-first, 0 horizontal overflow at 380px.
   Screen: premium dark worksheet + light client proposal.
   View is toggled by body.mode-worksheet / body.mode-proposal.
   Print: only the client proposal prints. */
:root {
  --bg: #0a0c11;
  --bg-2: #10131b;
  --panel: #151925;
  --panel-2: #1c2130;
  --line: #262c3b;
  --ink: #eef1f7;
  --muted: #99a2b5;
  --brand: #7c5cff;      /* violet */
  --brand-2: #33d1c9;    /* teal */
  --ok: #35c98b;
  --err: #ff5c6c;
  --radius: 14px;
  --maxw: 1000px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(124,92,255,.16), transparent 60%),
    radial-gradient(900px 520px at -12% 8%, rgba(51,209,201,.10), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
a { color: var(--brand-2); }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.grad { background: linear-gradient(92deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── View switching ─────────────────────────────────────── */
.worksheet-only { display: none; }
.proposal-only { display: none; }
body.mode-worksheet .worksheet-only { display: block; }
body.mode-proposal .proposal-only { display: block; }

/* ── Nav ────────────────────────────────────────────────── */
.sc-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.sc-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .3px; }
.sc-logo .spark { filter: saturate(1.2); }
.sc-logo .sc-sub { color: var(--muted); font-weight: 600; font-size: 13px; }
.sc-viewtoggle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
body.mode-worksheet #btn-view-worksheet, body.mode-proposal #btn-view-proposal { color: #0a0c11; border-color: transparent; background: linear-gradient(92deg, var(--brand), var(--brand-2)); }

/* ── Hero ───────────────────────────────────────────────── */
.sc-hero { padding: 20px 0 8px; }
.sc-hero h1 { font-size: clamp(26px, 7vw, 46px); line-height: 1.06; margin: 8px 0 10px; letter-spacing: -0.5px; }
.sc-hero .sub { color: var(--muted); font-size: clamp(14px, 4vw, 18px); max-width: 52ch; }
.sc-kicker { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--brand-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; }

/* ── Cards / forms ──────────────────────────────────────── */
.card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0; }
.card-h { font-size: 15px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-h .hint { font-weight: 500; font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin: 0 0 10px; }
.fld span { font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%; max-width: 100%; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-weight: 700; font-size: 14px; padding: 11px 15px; border-radius: 11px; cursor: pointer; transition: transform .06s ease, border-color .15s ease, opacity .15s; max-width: 100%; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { border: none; color: #0a0c11; background: linear-gradient(92deg, var(--brand), var(--brand-2)); }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 10px; }

/* ── Package picker ─────────────────────────────────────── */
.pkg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pkg-row select { flex: 1 1 200px; }

/* ── Line-item table ────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.items { width: 100%; border-collapse: collapse; min-width: 560px; }
table.items th, table.items td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.items th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
table.items th.num, table.items td.num { text-align: right; }
.cell { padding: 8px 9px; font-size: 14px; }
.cell.cat { min-width: 92px; }
.cell.desc { min-width: 180px; }
.cell.qty { width: 68px; text-align: right; }
.cell.price { width: 96px; text-align: right; }
.line-total { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-del { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 13px; }
.row-del:hover { border-color: var(--err); color: var(--err); }

/* ── Totals (worksheet) ─────────────────────────────────── */
.totals { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.tl { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 5px 0; }
.tl span:first-child { color: var(--muted); }
.tl span:last-child { font-variant-numeric: tabular-nums; }
.tl.grand { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.tl.grand span:first-child { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sc-foot { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: 13px; }

/* ══════════ CLIENT PROPOSAL (light, print-ready) ══════════ */
.proposal { background: #fff; color: #14181f; border-radius: 16px; margin: 16px 0 40px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.p-cover { border-bottom: 3px solid #14181f; padding-bottom: 18px; margin-bottom: 22px; }
.p-brandline { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.p-brandline .p-tag { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #7c5cff; margin-left: 4px; }
.p-title { font-size: clamp(24px, 6vw, 34px); margin: 16px 0 18px; letter-spacing: -.5px; }
.p-meta { display: grid; grid-template-columns: 1fr; gap: 12px; }
.p-meta > div { display: flex; flex-direction: column; }
.p-meta .k { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #7a8394; font-weight: 700; }
.p-meta .v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.p-meta .v2 { font-size: 13px; color: #55606f; }

.p-section { margin: 22px 0; }
.p-h { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #7c5cff; border-bottom: 1px solid #e6e9ef; padding-bottom: 6px; margin: 0 0 12px; }
.p-scope { font-size: 15px; line-height: 1.6; color: #2b323d; white-space: pre-wrap; }

.p-group { margin-bottom: 18px; }
.p-group-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 6px; }
.p-group-h .p-ic { font-size: 15px; }
.p-group-h .p-group-sub { margin-left: auto; font-variant-numeric: tabular-nums; color: #14181f; }
.p-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #8a93a2; padding: 4px 6px; border-bottom: 1px solid #e6e9ef; }
.p-table th:not(:first-child), .p-table td:not(.pd) { text-align: right; }
.p-table td { padding: 6px 6px; border-bottom: 1px solid #f0f2f6; vertical-align: top; }
.p-table .pd { color: #2b323d; }
.p-table .pl { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table .pu, .p-table .pq { font-variant-numeric: tabular-nums; white-space: nowrap; color: #55606f; }

.p-totals { margin-left: auto; max-width: 340px; background: #f7f8fb; border: 1px solid #e6e9ef; border-radius: 12px; padding: 12px 16px; }
.ptl { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 5px 0; }
.ptl span:first-child { color: #55606f; }
.ptl span:last-child { font-variant-numeric: tabular-nums; }
.ptl.grand { font-weight: 800; font-size: 18px; border-top: 2px solid #14181f; margin-top: 6px; padding-top: 10px; }
.ptl.grand span:first-child { color: #14181f; }

.p-terms { margin: 0; padding-left: 18px; }
.p-terms li { font-size: 13px; color: #3a424e; margin: 5px 0; line-height: 1.5; }

.p-accept .p-sign { display: grid; grid-template-columns: 1fr; gap: 22px; margin-top: 20px; }
.sig-line { border-bottom: 1.5px solid #14181f; height: 34px; }
.sig-lbl { font-size: 12px; color: #55606f; margin-top: 4px; }
.p-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid #e6e9ef; font-size: 12px; color: #8a93a2; text-align: center; }

/* ── Tablet / desktop ───────────────────────────────────── */
@media (min-width: 640px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .p-meta { grid-template-columns: 1fr 1fr; }
  .p-accept .p-sign { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Print: only the proposal, on white ─────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #14181f; overflow: visible; }
  .worksheet-only { display: none !important; }
  .proposal-only { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .proposal { box-shadow: none; border-radius: 0; margin: 0; padding: 0; }
  .p-group, .p-accept, .p-section { break-inside: avoid; }
}
