#!/usr/bin/env python3
"""Build Joe's Daily Morning Package — Tuesday, March 31, 2026"""

from docx import Document
from docx.shared import Pt, RGBColor, Inches
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn
from docx.oxml import OxmlElement

doc = Document()

# ── Page margins ──────────────────────────────────────────────────────────────
for section in doc.sections:
    section.top_margin    = Inches(0.75)
    section.bottom_margin = Inches(0.75)
    section.left_margin   = Inches(0.85)
    section.right_margin  = Inches(0.85)

# ── Helpers ───────────────────────────────────────────────────────────────────
def add_heading(doc, text, level=1, color=RGBColor(0x1A, 0x37, 0x6C)):
    p = doc.add_heading(text, level=level)
    run = p.runs[0] if p.runs else p.add_run(text)
    run.font.color.rgb = color
    return p

def add_rule(doc):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(2)
    p.paragraph_format.space_after  = Pt(2)
    pPr = p._p.get_or_add_pPr()
    pBdr = OxmlElement('w:pBdr')
    bottom = OxmlElement('w:bottom')
    bottom.set(qn('w:val'), 'single')
    bottom.set(qn('w:sz'), '6')
    bottom.set(qn('w:space'), '1')
    bottom.set(qn('w:color'), '1A376C')
    pBdr.append(bottom)
    pPr.append(pBdr)

def kv(doc, label, value, bold_label=True):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(1)
    p.paragraph_format.space_after  = Pt(1)
    r1 = p.add_run(f"{label}: ")
    r1.bold = bold_label
    r1.font.size = Pt(10.5)
    r2 = p.add_run(value)
    r2.font.size = Pt(10.5)
    return p

def bullet(doc, text, checkbox=False, indent=0):
    prefix = "☐  " if checkbox else "•  "
    p = doc.add_paragraph()
    p.paragraph_format.left_indent   = Inches(0.25 * (indent + 1))
    p.paragraph_format.space_before  = Pt(1)
    p.paragraph_format.space_after   = Pt(1)
    r = p.add_run(prefix + text)
    r.font.size = Pt(10.5)
    return p

def section_header(doc, text):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(6)
    p.paragraph_format.space_after  = Pt(2)
    r = p.add_run(text)
    r.bold = True
    r.font.size = Pt(11)
    r.font.color.rgb = RGBColor(0x1A, 0x37, 0x6C)
    return p


# ══════════════════════════════════════════════════════════════════════════════
#  HEADER
# ══════════════════════════════════════════════════════════════════════════════
title = doc.add_paragraph()
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
r = title.add_run("🦞  ROB LOBSTER  |  DAILY MORNING PACKAGE")
r.bold = True
r.font.size = Pt(16)
r.font.color.rgb = RGBColor(0x1A, 0x37, 0x6C)

sub = doc.add_paragraph()
sub.alignment = WD_ALIGN_PARAGRAPH.CENTER
r2 = sub.add_run("Tuesday, March 31, 2026  •  6:00 AM  |  LBI / Tuckerton, NJ")
r2.font.size = Pt(10)
r2.font.color.rgb = RGBColor(0x55, 0x55, 0x55)

add_rule(doc)

# ══════════════════════════════════════════════════════════════════════════════
#  SECTION 1 — MORNING BRIEF
# ══════════════════════════════════════════════════════════════════════════════
add_heading(doc, "SECTION 1 — MORNING BRIEF", level=1)

# ── Weather ───────────────────────────────────────────────────────────────────
section_header(doc, "☁  WEATHER — LBI / Tuckerton Area")
kv(doc, "Right Now (6 AM)", "61°F, partly cloudy, 62% humidity, SW wind 15 mph (gusts to 29 mph)")
kv(doc, "Today (Tue)", "High 66°F / Low 55°F  |  Partly cloudy, breezy. Patchy rain possible early AM, clearing to sunshine by midday")
kv(doc, "Tonight", "Low 55°F  |  Mostly cloudy, calm")
kv(doc, "Wednesday (Apr 1)", "High 71°F  |  Rain likely after 2 PM (50%), T-storms possible Wed night")
kv(doc, "Thursday (Apr 2)", "High 61°F  |  Chance of AM rain, then clearing — travel day to Charleston")
kv(doc, "Sunrise / Sunset", "6:43 AM / 7:21 PM  |  Moon: Waxing Gibbous (95%)")
p = doc.add_paragraph()
r = p.add_run("⚠  Last day of March. Beautiful spring day ahead — near 70. "
              "Rain moves in Wednesday afternoon. Thursday drive to Charleston may start damp but should clear. "
              "Good day for outdoor errands.")
r.font.size = Pt(10)
r.italic = True

doc.add_paragraph()

# ── Market Snapshot ───────────────────────────────────────────────────────────
section_header(doc, "📈  MARKET SNAPSHOT")

kv(doc, "Last Close (Mon 3/30)", "")
kv(doc, "  S&P 500",   "~6,330    vs. Exit Baseline 3/25: 6,591.90  →  DOWN ~-262  (-3.97%)")
kv(doc, "  Dow Jones",  "45,216.14   vs. Exit Baseline 3/25: 46,429.49  →  DOWN -1,213  (-2.61%)")
kv(doc, "  Nasdaq",     "20,794.64  (-0.73%)")

kv(doc, "Premarket (6 AM Tuesday)", "")
kv(doc, "  S&P 500 Futures",  "+0.8%  — attempting to trim March losses (worst month since 2022)")
kv(doc, "  Oil (Brent)",      "Below $107 — still elevated, inflation pressure persists")

p = doc.add_paragraph()
r = p.add_run(
    "📊  JFL&KL FUND:  Treasury position continues to protect capital. S&P now down ~4% since your March 25 exit — "
    "that's roughly $68K in avoided paper losses on a $1.7M position. March on track to be worst month since 2022. "
    "Oil staying above $100 keeps inflation fears alive. Futures up 0.8% this morning but don't get excited — "
    "end-of-quarter window dressing by fund managers. April 30 is 30 days away. Dry powder intact. "
    "Watch for VIX spikes and capitulation volume as early entry signals."
)
r.font.size = Pt(10)
r.italic = True

doc.add_paragraph()

# ── Schedule / Reminders ──────────────────────────────────────────────────────
section_header(doc, "📅  TODAY'S SCHEDULE & REMINDERS  (Tuesday, March 31)")
bullet(doc, "Last day of March — end-of-month wrap-up")
bullet(doc, "CHARLESTON TRIP: Thursday April 2 → Sunday April 6  (2 DAYS AWAY!)")
bullet(doc, "🤫 PRIVATE: Vow renewal — Friday April 4 on Isle of Palms. OFFICIANT STATUS?")
bullet(doc, "ANNIVERSARY: April 3 — Joe & Keli. NON-NEGOTIABLE. ❤️")
bullet(doc, "New email from Joe (5:38 AM): 'Lobster Press' social media concept for TLC pool chemicals + boom truck")
bullet(doc, "PORTFOLIO DAY: April 30 — 30 days out. Portfolio spreadsheet ready.")
bullet(doc, "Surfbox Social Media: April 30 go-live target — 30 days.")

doc.add_paragraph()

# ── Urgent Items ──────────────────────────────────────────────────────────────
section_header(doc, "🚨  URGENT / TOP OF MIND")
bullet(doc, "Charleston vow renewal — officiant BOOKED? If not, today is the day. 3 days out!")
bullet(doc, "360 King Boutique Suites — BOOK TONIGHT for April 2 if not done yet")
bullet(doc, "Isle of Palms rental contract — signed and returned?")
bullet(doc, "Joe's 'Lobster Press' concept — create TLC pool chemical social media post (boom truck / Bob)")
bullet(doc, "Squirrely video — still need MOV 6136 and MOV 5153 clips from Joe")
bullet(doc, "TLC Coma video — send final version to jlynch@tlcnj.com")
bullet(doc, "Ceremony plan — Rob needs to rewrite minister's words (Joe requested)")
bullet(doc, "Spotify playlist — Jack Johnson, Zac Bryan, Zac Brown Band (top 5 each) for walking home from ceremony")
bullet(doc, "Joey Young spreadsheet — commission/bonus calcs + inventory target (STILL waiting)")

doc.add_paragraph()

# ── Yesterday's Recap ─────────────────────────────────────────────────────────
section_header(doc, "📋  YESTERDAY RECAP (March 30)")
bullet(doc, "✅ April 30 Portfolio Execution Spreadsheet — 29-stock plan, sizing, staggered deployment strategy")
bullet(doc, "✅ NJ Construction & Building Permit Trend Analysis — Ocean County permits +47%, LBI 121 builds")
bullet(doc, "✅ Firehouse Marketing Brief — distribution targets, financial framework, comparable sales")
bullet(doc, "✅ Harbor Freight Business Model Study — 539 building: contractor quick-stop + marine supply hybrid recommended")
bullet(doc, "Market: S&P 500 closed lower (-0.5%), Dow barely green (+0.11%). Oil climbing. Worst month since 2022 continues.")

doc.add_paragraph()

# ── Flagged Emails ────────────────────────────────────────────────────────────
section_header(doc, "📧  EMAIL FLAGS")
bullet(doc, "NEW — 'Lobster Press' concept (5:38 AM) — TLC pool chemical social media post with boom truck driver Bob")
bullet(doc, "NOTE: Joe started a second thought in the email ('on a separate note') but it cut off — ask what's up")
bullet(doc, "Squirrely video — still waiting for 2 missing clips (MOV 6136, MOV 5153)")
bullet(doc, "Ceremony plan — minister words rewrite requested by Joe")

add_rule(doc)
doc.add_paragraph()

# ══════════════════════════════════════════════════════════════════════════════
#  SECTION 2 — ACTION CARD
# ══════════════════════════════════════════════════════════════════════════════
add_heading(doc, "SECTION 2 — ACTION CARD", level=1)

p = doc.add_paragraph()
r = p.add_run("All active tasks organized by track. Check off as you go. 2 days until Charleston — knock out what you can today.")
r.font.size = Pt(10)
r.italic = True

doc.add_paragraph()

# ── TRACK: CHARLESTON PREP ───────────────────────────────────────────────────
section_header(doc, "✈️  CHARLESTON TRIP PREP  (April 2-6 — 2 DAYS!)")
bullet(doc, "🚨 Officiant — Nuptials by Neisha: CONFIRMED & BOOKED?",                   checkbox=True)
bullet(doc, "360 King Boutique Suites: (843) 680-7400 — book April 2 one night",         checkbox=True)
bullet(doc, "Isle of Palms rental contract — signed & returned",                          checkbox=True)
bullet(doc, "Rewrite minister's ceremony words (Rob working on this)",                    checkbox=True)
bullet(doc, "Spotify playlist — top 5 each: Jack Johnson, Zac Bryan, Zac Brown Band",    checkbox=True)
bullet(doc, "Packing list for 4-day trip",                                                checkbox=True)
bullet(doc, "Confirm Ray O'Connor meetup in Charleston (colorant discussion)",            checkbox=True)
bullet(doc, "Danielle flight confirmed: CHS→AUS Mon Apr 6 ($619.23, conf B5FIM6)",       checkbox=False)

doc.add_paragraph()

# ── TRACK: MAC / TECH ─────────────────────────────────────────────────────────
section_header(doc, "💻  MAC / TECH")
bullet(doc, "Gmail send setup: rob.lobster.claw → jlynch@tlcnj.com ONLY",               checkbox=True)
bullet(doc, "Gmail read-only API on josephfl12@gmail.com",                                checkbox=True)
bullet(doc, "Outlook forwarding: Epicor/Surfbox reports → rob.lobster.claw",             checkbox=True)
bullet(doc, "ElevenLabs account + voice plugin on Mac",                                   checkbox=True)
bullet(doc, "Full Microsoft 365 read-only on jlynch@tlcnj.com",                          checkbox=True)
bullet(doc, "M365 Calendar ICS publishing",                                               checkbox=True)

doc.add_paragraph()

# ── TRACK: CALLS ──────────────────────────────────────────────────────────────
section_header(doc, "📞  CALLS TO MAKE")
bullet(doc, "Jersey Appliance: 609-918-1830 — Thermador hood (svc #275188)",              checkbox=True)
bullet(doc, "Mike the plumber (Ship Bottom Code Official) — walk-through plumbing + HVAC",checkbox=True)
bullet(doc, "California Closets Marlton: (609) 655-1899 — Trade Program registration",    checkbox=True)

doc.add_paragraph()

# ── TRACK: TLC / SURFBOX ─────────────────────────────────────────────────────
section_header(doc, "🏗  TLC / SURFBOX")
bullet(doc, "NEW: 'Lobster Press' — create TLC pool chemical social media post (boom truck + Bob)", checkbox=True)
bullet(doc, "Joey Young — chase spreadsheet: commission/bonus calcs + inventory target",  checkbox=True)
bullet(doc, "Amanda — Epicor credit card surcharge automation module status",              checkbox=True)
bullet(doc, "Certificate of Compliance application + $150 fee → Phil Reed",               checkbox=True)
bullet(doc, "Zoning compliance letter — finalize, request borough letterhead",             checkbox=True)
bullet(doc, "Edwin elevation to junior manager — formalize",                               checkbox=True)
bullet(doc, "Neal & Denise — priority call list for declining accounts",                   checkbox=True)
bullet(doc, "Surf City pricing matrix audit in Epicor",                                    checkbox=True)
bullet(doc, "TLC Coma video — send final to jlynch@tlcnj.com",                            checkbox=True)
bullet(doc, "Squirrely video — need MOV 6136 + MOV 5153 from Joe",                        checkbox=True)
bullet(doc, "Surfbox social media — April 30 go-live (one video per store per week)",      checkbox=True)
bullet(doc, "OBX Surfbox new rental pipeline investigation",                               checkbox=True)
bullet(doc, "Equipment 2026: source used diesel dually forklift + low forklift",           checkbox=True)
bullet(doc, "Equipment disposals: Surfbox bus (NC), black box truck, one older forklift",  checkbox=True)
bullet(doc, "Judy — staffing/overhead reduction",                                          checkbox=True)

doc.add_paragraph()

# ── TRACK: FIREHOUSE ─────────────────────────────────────────────────────────
section_header(doc, "🏛  FIREHOUSE  (18 New Street, Crosswicks)")
bullet(doc, "First floor plan — review Joe's markup, iterate",                             checkbox=True)
bullet(doc, "Send finalized plans to structural engineer",                                 checkbox=True)
bullet(doc, "Concrete drain install — target before Easter (Apr 5). Status?",              checkbox=True)
bullet(doc, "Matthew Cassidy — demo / electrical coordination",                            checkbox=True)
bullet(doc, "HVAC plan: furnace (1F) + heat pump (2F) + gas hot water radiator (basement)",checkbox=True)
bullet(doc, "Decision: stay in NJ Redevelopment Plan or convert to single-family luxury",  checkbox=True)

doc.add_paragraph()

# ── TRACK: PROPERTIES ─────────────────────────────────────────────────────────
section_header(doc, "🏠  PROPERTIES")
bullet(doc, "Corner Market — 275 W 9th St, Ship Bottom: 50/50 partnership decision",      checkbox=True)
bullet(doc, "Haastrotters Boatyard (causeway, Ship Bottom) — for sale or sold?",           checkbox=True)
bullet(doc, "539 paint store building — future uses (Harbor Freight study complete)",       checkbox=True)
bullet(doc, "Property tax appeals — Chesterfield Block 301, Lots 10 & 12",                checkbox=True)
bullet(doc, "Brother Matt co-owned property — fair buyout discussion",                     checkbox=True)

doc.add_paragraph()

# ── TRACK: INVESTING ──────────────────────────────────────────────────────────
section_header(doc, "📈  INVESTING  (JFL&KL FUND)")
bullet(doc, "S&P ~6,330 (-4% since exit). Treasuries working. 30 days to April 30.")
bullet(doc, "March = worst month since 2022. Oil >$100. Gold ripping. Stay defensive.")
bullet(doc, "April 30 execution prep — portfolio spreadsheet READY (29 stocks, 3 buckets)", checkbox=False)
bullet(doc, "Watch for capitulation signals (VIX >35, high-volume washout)",                checkbox=False)
bullet(doc, "Roth conversion — coordinate with MacArthur: LLC → W-2 restructure",          checkbox=True)
bullet(doc, "Fidelity account setup — confirm transfer from Wells Fargo",                   checkbox=True)
bullet(doc, "Colorant re-entry — prep strategic questions for Ray O'Connor in Charleston",  checkbox=True)

doc.add_paragraph()

# ── TRACK: FAMILY ─────────────────────────────────────────────────────────────
section_header(doc, "👨‍👩‍👧‍👧  FAMILY")
bullet(doc, "🤫 Vow renewal — see Charleston Prep section above",                          checkbox=False)
bullet(doc, "Anniversary April 3 — Keli gift / special plan finalized?",                   checkbox=True)
bullet(doc, "Juliana — confidence plan + summer waitressing job research",                  checkbox=True)
bullet(doc, "Bella — AI education package + her own OpenClaw setup",                       checkbox=True)
bullet(doc, "Matty (Goodwill Fund) — any investment updates?",                             checkbox=True)
bullet(doc, "Gio — $225 cash check for driveway work at Mom & Dad's",                      checkbox=True)
bullet(doc, "Keli — slow down, give her attention. Little things matter. ❤️",             checkbox=False)

doc.add_paragraph()

# ── TRACK: PROJECTS ──────────────────────────────────────────────────────────
section_header(doc, "🚀  PROJECTS")
bullet(doc, "Lobster World Cup Pool — need: Venmo handle, PayPal.me, domain, player cap",  checkbox=True)
bullet(doc, "ReBolt™ — competitive landscape done. Next: prototype refinement + mfg outreach", checkbox=True)
bullet(doc, "T1D App — competitor landscape done. BIG IDEAs Lab dataset identified",       checkbox=True)
bullet(doc, "Keli social media — 2 weeks content ready. Start posting?",                   checkbox=True)
bullet(doc, "PSI.inc physics AI model — research for Danielle (autonomous submarines)",    checkbox=True)

doc.add_paragraph()

# ── TRACK: ERRANDS ────────────────────────────────────────────────────────────
section_header(doc, "🔧  ERRANDS")
bullet(doc, "Organize truck key rings (5 rings: Firehouse, TD Bank, Truist, Surf City, Tuckerton)", checkbox=True)
bullet(doc, "Rob Lobster voice clone — gather Robby audio/video from Facebook (talk to Renee first)", checkbox=True)

doc.add_paragraph()

# ── TRACK: COMING UP ─────────────────────────────────────────────────────────
section_header(doc, "🗓  COMING UP")
bullet(doc, "Apr 1 (Wed) — 71°F, rain after 2 PM. April Fools' Day. Last day before trip prep.")
bullet(doc, "Apr 2 (Thu) — DRIVE TO CHARLESTON. 360 King check-in. Trip begins!")
bullet(doc, "Apr 3 (Fri) — ANNIVERSARY 🎉 + 🤫 Vow renewal ceremony, Isle of Palms")
bullet(doc, "Apr 4 (Sat) — Family beach day in Charleston")
bullet(doc, "Apr 5 (Sun) — EASTER 🐣 Family in Charleston.")
bullet(doc, "Apr 6 (Mon) — Danielle's flight CHS→AUS. Drive home.")
bullet(doc, "Apr 30 (Wed) — BIG PORTFOLIO EXECUTION DAY + Surfbox social media go-live + Joe's birthday! 🎂")
bullet(doc, "Jun 11 — FIFA World Cup 2026 kicks off (Lobster Pool target: May)")
bullet(doc, "Sep 6 — Mom's birthday  |  Oct 30 — Dad's birthday")

add_rule(doc)
doc.add_paragraph()

# ── Footer ─────────────────────────────────────────────────────────────────────
footer_p = doc.add_paragraph()
footer_p.alignment = WD_ALIGN_PARAGRAPH.CENTER
r_f = footer_p.add_run(
    "Generated by Rob Lobster 🦞 • Tuesday, March 31, 2026 • 6:00 AM ET\n"
    "Last day of March. Charleston in 2 days. Make good decisions. 🤝"
)
r_f.font.size = Pt(9)
r_f.font.color.rgb = RGBColor(0x88, 0x88, 0x88)
r_f.italic = True

# ── Save ──────────────────────────────────────────────────────────────────────
out = "/Users/joemac/.openclaw/workspace/projects/daily/morning-package-2026-03-31.docx"
doc.save(out)
print(f"Saved: {out}")
