/* ============================================================
 * Lions Tooth — GLC Schedule module styles
 * ============================================================
 *
 * Phase 5 of the mobile-first refactor (ADR 0004).
 *
 * This file is the canonical home for new mobile-first classes used
 * by the GLC Schedule sub-view's home-item card v2 (the redesigned
 * home cards behind LT_FEATURE_SCHEDULE_CARDS_V2 flag).
 *
 * Scope:
 *   .mf-home, .mf-home-*       — new home-card markup (vertical layout,
 *                                 hero address, status pill, meta row,
 *                                 status note, action bar)
 *   .mf-home-settings, .mf-setting-* — collapsible settings drawer (gear icon)
 *   .mf-action-primary, .mf-action-icon — action bar buttons
 *   .mf-week-card, .mf-week-* — hero week-setup card (Phase 5.2 stretch goal)
 *
 * NOT in this file:
 *   Legacy .day-card, .home-item, .home-bar, .week-bar, .pipeline-*,
 *   .warranty-card and their @media rules — those still live in inline
 *   <style> in index.html (legacy markup, used by default). When/if we
 *   retire the legacy renderer in Phase 5.4+, the legacy classes can be
 *   cleaned up.
 *
 * Flag-gated rollout:
 *   When LT_FEATURE_SCHEDULE_CARDS_V2='on' in localStorage, the home-item
 *   renderer in 05-deliveries.js emits .mf-home markup. Default OFF —
 *   no user sees a change until they opt in via:
 *     LT_SCHEDULE_CARDS_ENABLE(true)   // turn on (DevTools console)
 *     LT_SCHEDULE_CARDS_ENABLE(false)  // turn off
 *
 * PDF compatibility:
 *   The printPdf() flow (05-deliveries.js:958+) adds class 'pdf-mode' to
 *   the print clone so CSS rules below scope to .pdf-mode .mf-home* and
 *   tighten the spacing for printed output. Result: similar page count
 *   to today's PDF without sacrificing on-screen readability.
 *
 * Tokens (--brand, --text, etc.) are inherited from :root in index.html.
 * ============================================================ */


/* ─────────────────────────────────────────────────────────────
 * HOME-ITEM V2 — new mobile-first card layout
 * ───────────────────────────────────────────────────────────── */
.mf-home{
  background:var(--white,#fff);
  border:1px solid var(--border);
  border-left:4px solid var(--green);
  border-radius:8px;
  margin-bottom:8px;
  overflow:hidden;
}
.mf-home.dbl{border-left-color:var(--brand);}
.mf-home.rework{border-left-color:var(--orange);}
.mf-home.continued{border-left-color:var(--yellow);}
.mf-home.is-completed{opacity:.65;}

.mf-home-top{padding:12px 14px;cursor:pointer;}
.mf-home-row1{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.mf-home-id{flex:1;min-width:0;}
.mf-home-comm{
  font-size:11px;font-weight:700;color:var(--text3);
  text-transform:uppercase;letter-spacing:.06em;
}
.mf-home-comm .builder{
  text-transform:none;font-weight:600;color:var(--text3);
  letter-spacing:0;margin-left:4px;
}
.mf-home-addr{
  font-family:'Inter Tight',sans-serif;
  font-size:16px;font-weight:700;
  color:var(--text);
  letter-spacing:-0.01em;line-height:1.25;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.mf-home-addr a{color:inherit;text-decoration:none;border-bottom:1px dotted currentColor;}

/* Status pill — color tints map to schedule task statuses (status-sel
 * options): Not Started / Scheduled / In Progress / Complete / On Hold /
 * Missed Start. */
.mf-home-status{
  display:inline-flex;align-items:center;gap:4px;
  padding:5px 10px;
  border-radius:14px;
  font-size:11px;font-weight:700;white-space:nowrap;
  border:1px solid transparent;
}
.mf-home-status .lt-icon{width:12px;height:12px;}
.mf-home-status[data-state="not-started"]{background:#eceff3;color:#475569;border-color:#cbd5e1;}
.mf-home-status[data-state="scheduled"]   {background:#dde7ff;color:#1e40af;border-color:#bfdbfe;}
.mf-home-status[data-state="in-progress"] {background:#fff5d6;color:#92400e;border-color:#fde68a;}
.mf-home-status[data-state="complete"]    {background:#daefe0;color:#2c6740;border-color:#bbf7d0;}
.mf-home-status[data-state="on-hold"]     {background:#ffe9d6;color:#c2410c;border-color:#fdba74;}
.mf-home-status[data-state="missed-start"]{background:#ffe1e1;color:#8c2828;border-color:#fca5a5;}

/* Meta row — bore badge + crew + loop + glycol info */
.mf-home-meta{
  margin-top:6px;
  display:flex;flex-wrap:wrap;align-items:center;
  gap:4px 12px;
  font-size:12px;color:var(--text2);
}
.mf-home-meta span{display:inline-flex;align-items:center;gap:4px;}
.mf-home-meta .lt-icon{width:12px;height:12px;color:var(--text3);}
.mf-home-meta .bore-badge{
  background:var(--bg2);border:1px solid var(--border);
  border-radius:10px;
  padding:1px 7px;
  font-weight:700;color:var(--text);font-size:10px;letter-spacing:.04em;
}
.mf-home-meta .bore-badge.dbl{
  background:#dde7ff;border-color:#bfdbfe;color:#1e40af;
}

/* Swing badge (L / R) — orientation indicator that PMs scan at-a-glance.
 * Subtle outline so it doesn't compete with the bore-count badge. */
.mf-home-meta .swing-badge{
  background:var(--white,#fff);
  border:1px solid var(--border);
  border-radius:10px;
  padding:1px 7px;
  font-weight:700;color:var(--text);font-size:10px;letter-spacing:.04em;
  font-family:'Inter Tight',sans-serif;
}

/* Series / Parallel / N/A badge — header-config indicator for double-bore
 * homes (and N/A for single-bore). data-state drives color tint. */
.mf-home-meta .sp-badge{
  border:1px solid;
  border-radius:10px;
  padding:1px 7px;
  font-weight:700;font-size:10px;letter-spacing:.04em;
  font-family:'Inter Tight',sans-serif;
}
.mf-home-meta .sp-badge[data-state="series"]  { background:#ecfdf5; color:#166534; border-color:#86efac; }
.mf-home-meta .sp-badge[data-state="parallel"]{ background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.mf-home-meta .sp-badge[data-state="na"]      { background:var(--bg2); color:var(--text3); border-color:var(--border); }

/* Inline status badges (REWORK / CONTINUED) — stay in meta row */
.mf-home-meta .badge-rework{
  background:#fff7ed;border:1px solid #fed7aa;color:#c2410c;
  font-size:10px;font-weight:700;letter-spacing:.5px;
  padding:1px 5px;border-radius:3px;
  display:inline-flex;align-items:center;gap:3px;
}
.mf-home-meta .badge-continued{
  background:#fffbeb;border:1px solid #fde68a;color:#b45309;
  font-size:10px;font-weight:700;letter-spacing:.5px;
  padding:1px 5px;border-radius:3px;
  display:inline-flex;align-items:center;gap:3px;
}

/* Status note block (job site update or custom note) */
.mf-home-note{
  margin-top:8px;
  font-size:12px;color:var(--text);line-height:1.4;
  background:var(--bg2);
  padding:8px 10px;
  border-radius:6px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden;
}
.mf-home-note .lt-icon{color:var(--text2);width:13px;height:13px;}
.mf-home-note strong{font-weight:700;color:var(--text);}


/* ─────────────────────────────────────────────────────────────
 * SETTINGS DRAWER — collapsible 2×2 grid of selects
 * Toggled by the gear button in the action bar.
 * ───────────────────────────────────────────────────────────── */
.mf-home-settings{
  padding:12px 14px;
  background:var(--bg2);
  border-top:1px solid var(--border);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.mf-home-settings.full{grid-column:1 / -1;}
.mf-setting-label{
  display:block;
  font-size:10px;font-weight:700;color:var(--text3);
  text-transform:uppercase;letter-spacing:.06em;
  margin-bottom:4px;
}
.mf-setting-sel{
  width:100%;
  padding:9px 10px;font-size:13px;
  border:1.5px solid var(--border);
  border-radius:6px;
  background:var(--bg1);color:var(--text);
  font-family:inherit;
  -webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;padding-right:26px;
}


/* ─────────────────────────────────────────────────────────────
 * FIELD REPORT QUICK-ACCESS — one-tap path from schedule to FR
 *
 * Renders above the action bar. State + progress visible at-a-glance:
 *   not-started  → gray
 *   in-progress  → brand blue
 *   draft        → brand blue
 *   pm-review    → purple
 *   rework       → orange
 *   rejected     → orange
 *   approved     → green
 *
 * EC homes (Mid-Atlantic / Northeast) get TWO buttons stacked:
 * Headering + Commissioning. MW homes get one (GLC).
 * ───────────────────────────────────────────────────────────── */
.mf-fr-row{
  display:flex;flex-direction:column;gap:4px;
  padding:8px 10px 0;
}
.mf-fr-btn{
  display:flex;flex-direction:column;
  align-items:flex-start;gap:4px;
  width:100%;
  padding:8px 12px;
  border-radius:6px;
  border:1px solid;
  font-size:12px;font-weight:700;
  font-family:inherit;
  cursor:pointer;
  transition:transform .08s,box-shadow .12s;
}
.mf-fr-btn:active{transform:scale(.98);}
.mf-fr-btn-label{
  display:inline-flex;align-items:center;gap:6px;
}
.mf-fr-btn-progress{
  display:flex;align-items:center;gap:4px;width:100%;
}
.mf-fr-btn-bar{
  flex:1;height:3px;
  background:rgba(0,0,0,.1);
  border-radius:2px;overflow:hidden;
}
.mf-fr-btn-bar > span{
  display:block;height:100%;
  background:currentColor;border-radius:2px;
}
.mf-fr-btn-pct{font-size:9px;opacity:.7;}

.mf-fr-btn[data-state="not-started"]{background:#f9fafb;color:#6b7280;border-color:#e5e7eb;}
.mf-fr-btn[data-state="in-progress"]{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
.mf-fr-btn[data-state="draft"]      {background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
.mf-fr-btn[data-state="pm-review"]  {background:#faf5ff;color:#7c3aed;border-color:#ddd6fe;}
.mf-fr-btn[data-state="rework"]     {background:#fff7ed;color:#c2410c;border-color:#fed7aa;}
.mf-fr-btn[data-state="rejected"]   {background:#fff7ed;color:#c2410c;border-color:#fed7aa;}
.mf-fr-btn[data-state="approved"]   {background:#f0fdf4;color:#15803d;border-color:#bbf7d0;}


/* ─────────────────────────────────────────────────────────────
 * ACTION BAR — primary CTA + 3 icon buttons at card bottom
 * .no-print at the JS level (PDF excludes this entire row).
 * ───────────────────────────────────────────────────────────── */
.mf-home-actions{
  display:flex;gap:6px;
  padding:8px 10px;
  border-top:1px solid var(--border);
  background:var(--bg2);
}
.mf-action-primary{
  flex:1;
  padding:9px 12px;
  font-size:13px;font-weight:700;
  border:none;border-radius:6px;
  background:var(--brand);color:#fff;
  cursor:pointer;font-family:inherit;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:38px;
}
.mf-action-primary:hover{background:var(--brand-dark);}
.mf-action-primary:active{transform:scale(.98);}

.mf-action-icon{
  width:38px;height:38px;
  border:1px solid var(--border);
  background:var(--bg1);color:var(--text2);
  border-radius:6px;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;font-family:inherit;
}
.mf-action-icon:hover{border-color:var(--brand);color:var(--brand);}
.mf-action-icon.active{
  background:var(--brand-light);color:var(--brand);border-color:var(--brand);
}
.mf-action-icon .lt-icon{width:16px;height:16px;}


/* ─────────────────────────────────────────────────────────────
 * HOME-LIST RESPONSIVE GRID — within each day-body
 *
 * Days remain stacked vertically (Mon-Fri top-to-bottom). At wider
 * widths each day's home-list arranges into a multi-column grid so PMs
 * can see more homes per day at a glance without losing the day-by-day
 * scan pattern.
 *
 * Targets the modern .home-list class with .v2 marker (set when the
 * V2 renderer is active) so legacy renders are unaffected.
 * ───────────────────────────────────────────────────────────── */
.home-list.v2{
  display:flex;
  flex-direction:column;
  gap:8px;
}

@media (min-width:768px){
  .home-list.v2{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
  }
}

@media (min-width:1280px){
  .home-list.v2{
    grid-template-columns:repeat(3,1fr);
  }
}


/* ─────────────────────────────────────────────────────────────
 * PDF COMPACT MODE — applied via .pdf-mode class on the print clone
 * by printPdf() in 05-deliveries.js. Tightens the V2 layout for
 * printed output so page count stays similar to the legacy PDF.
 * ───────────────────────────────────────────────────────────── */
.pdf-mode .mf-home{
  margin-bottom:4px;
  border-radius:5px;
  border-left-width:3px;
}
.pdf-mode .mf-home-top{padding:6px 10px;}
.pdf-mode .mf-home-addr{font-size:13px;}
.pdf-mode .mf-home-comm{font-size:10px;}
.pdf-mode .mf-home-meta{
  margin-top:3px;
  font-size:10px;gap:2px 10px;
}
.pdf-mode .mf-home-meta .bore-badge{font-size:9px;padding:0 5px;}
.pdf-mode .mf-home-status{font-size:10px;padding:2px 7px;}
.pdf-mode .mf-home-note{
  margin-top:4px;
  font-size:10px;padding:5px 8px;
  -webkit-line-clamp:2;
}
/* Hide interactive chrome in PDF — the gear/settings/action bar is .no-print
 * but pdf-mode also force-hides them as belt-and-suspenders */
.pdf-mode .mf-home-actions,
.pdf-mode .mf-home-settings,
.pdf-mode .mf-fr-row{display:none!important;}
/* Force a 2-col layout in the PDF clone to match legacy density */
.pdf-mode .home-list.v2{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:6px;
}


/* ─────────────────────────────────────────────────────────────
 * HERO WEEK-SETUP CARD — Phase 5 stretch goal (V2 only)
 * Replaces the legacy compact week-setup with a hero strip:
 * big readable date range + 44px prev/next + summary line.
 * ───────────────────────────────────────────────────────────── */
.mf-week-card{
  background:var(--white,#fff);
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px;
  margin-bottom:14px;
}
.mf-week-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.mf-week-nav{
  width:44px;height:44px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--bg1);color:var(--brand);
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.mf-week-nav:hover{border-color:var(--brand);background:var(--brand-light);}
.mf-week-nav .lt-icon{width:20px;height:20px;}

.mf-week-range{flex:1;text-align:center;font-family:'Inter Tight',sans-serif;}
.mf-week-range .month{
  font-size:11px;font-weight:700;color:var(--text3);
  text-transform:uppercase;letter-spacing:.06em;
}
.mf-week-range .dates{
  font-size:18px;font-weight:700;color:var(--text);
  letter-spacing:-0.01em;
}
.mf-week-range .summary{
  font-size:12px;color:var(--text2);margin-top:2px;
}


/* ─────────────────────────────────────────────────────────────
 * DRILLING-SPECIFIC: 3 status check chips (Phase 6)
 *
 * Drilling lots have three statuses that all need to be visible at a
 * glance: QA (Pass/Fail), DigSafe (Cleared/Requested), Bore Stakes
 * (Staking Complete / Not Complete / Re-Stake Needed). Each becomes a
 * small color-coded chip below the meta row.
 *
 * GLC homes don't have these checks — this section is drilling-only.
 * ───────────────────────────────────────────────────────────── */
.mf-lot-checks{
  display:flex;flex-wrap:wrap;gap:4px;
  margin-top:8px;
}
.mf-lot-check{
  display:inline-flex;align-items:center;gap:3px;
  padding:3px 8px;
  border-radius:6px;
  font-size:10px;font-weight:700;
  border:1px solid transparent;letter-spacing:.02em;
}
.mf-lot-check .lt-icon{width:11px;height:11px;}
.mf-lot-check.ok     {background:#daefe0;color:#2c6740;border-color:#bbf7d0;}
.mf-lot-check.pending{background:#fff5d6;color:#92400e;border-color:#fde68a;}
.mf-lot-check.fail   {background:#ffe1e1;color:#8c2828;border-color:#fca5a5;}
.mf-lot-check.gray   {background:var(--bg2);color:var(--text3);border-color:var(--border);}

/* Pdf-mode compact override for drilling check chips */
.pdf-mode .mf-lot-checks{margin-top:3px;gap:2px;}
.pdf-mode .mf-lot-check{font-size:9px;padding:1px 5px;}


/* ─────────────────────────────────────────────────────────────
 * "MORE" OVERFLOW MENU — for action-bar icons that need a dropdown
 *
 * Drilling action bar uses this for the Links menu (SiteCapture +
 * Design Plans + Community Map + Google Maps). Maps moved out of the
 * main action bar (per design feedback) into this overflow menu.
 * ───────────────────────────────────────────────────────────── */
.mf-action-more-wrap{position:relative;}
.mf-action-more-menu{
  display:none;
  position:absolute;bottom:calc(100% + 6px);right:0;
  background:var(--white,#fff);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 8px 32px rgba(0,0,0,.12);
  min-width:200px;
  padding:4px;
  z-index:100;
  font-family:inherit;
}
.mf-action-more-menu.open{display:block;}
.mf-action-more-menu a,
.mf-action-more-menu button{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;
  font-size:13px;font-weight:600;
  color:var(--text);
  background:none;border:none;cursor:pointer;
  text-decoration:none;
  border-radius:6px;
  width:100%;
  font-family:inherit;
  text-align:left;
}
.mf-action-more-menu a:hover,
.mf-action-more-menu button:hover{background:var(--bg2);}
.mf-action-more-menu .lt-icon{width:15px;height:15px;color:var(--text2);flex-shrink:0;}
.pdf-mode .mf-action-more-menu{display:none!important;}
