/* Robbs Construction PM: mobile-first styles. No inline styles anywhere (CSP). */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5d6877;
  --border: #dde1e7;
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-soft: #fff1e8;
  --blue: #2563eb;
  --green: #15803d;
  --red: #dc2626;
  --amber: #b45309;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --label-w: 230px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--brand-dark); }
h1 { font-size: 1.5rem; margin: 0 0 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.prewrap { white-space: pre-wrap; }
.mt { margin-top: 1rem; }
[hidden] { display: none !important; }
code { background: #f1f3f6; padding: 0.1rem 0.35rem; border-radius: 4px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  background: #1f2937; color: #fff; padding: 0.5rem 1rem;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-weight: 700; }
.mainnav { display: flex; gap: 0.25rem; overflow-x: auto; order: 3; width: 100%; -webkit-overflow-scrolling: touch; }
.mainnav a { color: #d1d5db; text-decoration: none; padding: 0.55rem 0.8rem; border-radius: 8px; white-space: nowrap; }
.mainnav a[aria-current='page'], .mainnav a:hover { background: #374151; color: #fff; }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.usermenu a { color: #e5e7eb; text-decoration: none; }
.usermenu form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.topbar .linkbtn { color: #d1d5db; }
@media (min-width: 800px) {
  .mainnav { order: 0; width: auto; }
}

.container { max-width: 1280px; margin: 0 auto; padding: 1rem; }
body.bare .container { max-width: 440px; padding-top: 8vh; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 44px; padding: 0.5rem 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #b8c0cc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: #fff; color: var(--red); border-color: #f3b4b4; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role='button']:focus-visible {
  outline: 3px solid #fb923c; outline-offset: 2px;
}

label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
label.check small { flex-basis: 100%; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text);
  min-height: 44px; padding: 0.5rem 0.65rem; border: 1px solid #c9d0d9; border-radius: 8px; background: #fff; width: 100%;
}
input[type='checkbox'] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #f6f7f9; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.form-grid { display: flex; flex-direction: column; gap: 1rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0; display: grid; gap: 0.9rem; }
legend { font-weight: 700; padding: 0 0.35rem; }
@media (min-width: 700px) {
  fieldset { grid-template-columns: 1fr 1fr; }
  fieldset .full { grid-column: 1 / -1; }
}
.checkbox-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.checkbox-list .label { flex-basis: 100%; font-weight: 600; font-size: 0.9rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-top: 0.75rem; }
.inline-form label { flex: 1 1 180px; }
form.inline { display: inline; margin: 0; }

.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 0.9rem; }
.notice { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; }
.hint { background: var(--brand-soft); border-radius: 8px; padding: 0.6rem 0.8rem; margin-top: 0.75rem; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 640px; }
.auth-card { text-align: left; }
.auth-card h1 { margin-top: 0.5rem; }
.auth-logo { display: block; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.section-title { margin: 1.5rem 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.count { background: #e5e7eb; border-radius: 99px; padding: 0 0.55rem; font-size: 0.85rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.dash-grid, .overview-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 2fr 1fr; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}
.dash-grid .card, .overview-grid .card { margin-bottom: 0; }
.overview-grid { margin-bottom: 1rem; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.kpi-num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.kpi-bad { border-color: #fca5a5; background: #fff5f5; }
.kpi-bad .kpi-num { color: var(--red); }
.kpi-warn { border-color: #fcd34d; background: #fffbeb; }
.kpi-warn .kpi-num { color: var(--amber); }

.project-card { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.card-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.card-title:hover { text-decoration: underline; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1rem; margin: 0; }
.facts.single { grid-template-columns: 1fr; }
.facts dt { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: break-word; }
.progress-row { display: flex; align-items: center; gap: 0.5rem; }
progress { flex: 1; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: #e5e7eb; overflow: hidden; min-width: 80px; }
progress::-webkit-progress-bar { background: #e5e7eb; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.25rem 0; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.65rem; border-radius: 99px; background: #eef1f5; font-size: 0.85rem; text-decoration: none; color: var(--text); }
.chip-danger { background: #fee2e2; color: #991b1b; font-weight: 600; }
.chip-warn { background: #fef3c7; color: #92400e; font-weight: 600; }
.chip-x { background: none; border: 0; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; color: var(--muted); min-width: 28px; min-height: 28px; }

.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 99px; font-size: 0.8rem; font-weight: 700; background: #eef1f5; color: #374151; white-space: nowrap; }
.status-planning { background: #eef1f5; color: #374151; }
.status-scheduled { background: #e0f2fe; color: #075985; }
.status-in-progress { background: #e0e7ff; color: #3730a3; }
.status-delayed { background: #fee2e2; color: #991b1b; }
.status-on-hold { background: #ede9fe; color: #5b21b6; }
.status-punch-list { background: #ccfbf1; color: #115e59; }
.status-complete { background: #e5e7eb; color: #111827; }
.var-behind { background: #fee2e2; color: #991b1b; }
.var-ahead { background: #dbeafe; color: #1e40af; }
.var-ok { background: #dcfce7; color: #166534; }
.var-none { background: #f3f4f6; color: #4b5563; }
.item-not-started { background: #e2e8f0; color: #334155; }
.item-in-progress { background: #dbeafe; color: #1e40af; }
.item-complete { background: #dcfce7; color: #166534; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 4px; background: #1f2937; color: #fff; vertical-align: middle; margin-left: 0.35rem; }
.diamond { display: inline-block; width: 10px; height: 10px; background: #1f2937; transform: rotate(45deg); margin-right: 0.45rem; vertical-align: middle; }

ul.plain, ul.items, ul.attention, ul.history, ul.project-rows, ul.user-rows { list-style: none; margin: 0; padding: 0; }
ul.plain li, ul.items li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid #eef0f3; }
ul.items li:last-child, ul.plain li:last-child { border-bottom: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
ul.attention li { padding: 0.55rem 0.7rem; border-radius: 8px; margin-bottom: 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; }
.att-danger { background: #fef2f2; border-left: 4px solid var(--red); }
.att-warn { background: #fffbeb; border-left: 4px solid #f59e0b; }
.att-info { background: #f0f7ff; border-left: 4px solid var(--blue); }
ul.history li { display: flex; flex-direction: column; padding: 0.5rem 0; border-bottom: 1px solid #eef0f3; }

.project-rows li { border-bottom: 1px solid var(--border); }
.row-link { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.8rem 0.25rem; text-decoration: none; color: var(--text); }
.row-link:hover { background: #fafafa; }
.row-main { display: flex; flex-direction: column; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.user-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.65rem 0; border-bottom: 1px solid #eef0f3; }
.user-rows li.inactive { opacity: 0.6; }

.tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: 0.65rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a[aria-current='page'] { color: var(--brand-dark); border-bottom-color: var(--brand); }

.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.25rem; }
@media (min-width: 900px) { .health-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.health-grid .label, .label { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem; }

.banner { border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.banner ul { margin: 0 0 0.6rem; padding-left: 1.1rem; }
.banner-danger { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.banner-warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.banner-ok { background: #ecfdf5; border-color: #6ee7b7; color: #064e3b; }
.temp-pass { font-size: 1.3rem; letter-spacing: 0.05em; user-select: all; }
.danger-zone { border-color: #fecaca; }
.empty { text-align: center; padding: 2rem 1rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 100;
  background: #1f2937; color: #fff; padding: 0.8rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: min(560px, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: 0.3rem;
}
.toast .btn { align-self: flex-start; margin-top: 0.35rem; }
.toast-error { background: #991b1b; }

/* ---------- schedule / gantt ---------- */
.gantt-app.is-busy { opacity: 0.7; pointer-events: none; }
.gantt-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.tb-group { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button, .seg a { border: 0; background: none; padding: 0.5rem 0.8rem; min-height: 40px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg button[aria-pressed='true'], .seg a[aria-current='page'] { background: #1f2937; color: #fff; }
.gantt-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }

.gantt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.gantt-scroll.is-tall { max-height: calc(100vh - 100px); }
.gantt-scroll { overflow: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.gantt-inner { display: flex; position: relative; width: max-content; }
.gantt-names { position: sticky; left: 0; z-index: 20; background: #fff; width: var(--label-w); flex: none; border-right: 1px solid var(--border); }
.gn-head { height: 48px; position: sticky; top: 0; background: #f8fafc; border-bottom: 1px solid var(--border); display: flex; align-items: flex-end; padding: 0 0.75rem 0.4rem; font-weight: 700; font-size: 0.85rem; z-index: 2; }
.gn-row { display: flex; flex-direction: column; justify-content: center; width: 100%; height: 40px; padding: 0 0.75rem; border: 0; border-bottom: 1px solid #f0f2f5; background: none; text-align: left; font: inherit; cursor: pointer; }
.gn-row:hover { background: #fff7ed; }
.gn-row.is-conflict .gn-name { color: var(--red); }
.gn-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-dates { font-size: 0.72rem; color: var(--muted); }
.gantt-canvas { position: relative; flex: none; }
.gantt-header { position: sticky; top: 0; height: 48px; background: #f8fafc; border-bottom: 1px solid var(--border); z-index: 10; }
.gh-month { position: absolute; top: 4px; font-size: 0.78rem; font-weight: 700; padding-left: 4px; white-space: nowrap; border-left: 1px solid #cbd5e1; }
.gh-day { position: absolute; top: 26px; font-size: 0.7rem; text-align: center; color: #475569; }
.gh-day.off { color: #94a3b8; }
.gh-week { position: absolute; top: 26px; font-size: 0.7rem; color: #475569; padding-left: 3px; border-left: 1px solid #cbd5e1; }
.gantt-grid { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.off-day { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #f1f3f6, #f1f3f6 4px, #f8f9fb 4px, #f8f9fb 8px); }
.week-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #eef0f3; }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); opacity: 0.8; }
.gantt-rowbg { position: absolute; left: 0; right: 0; border-bottom: 1px solid #f0f2f5; pointer-events: none; }
.gantt-rowbg.odd { background: rgba(248, 250, 252, 0.5); }
.bar {
  position: absolute; height: 24px; border-radius: 6px; background: #64748b; cursor: grab; z-index: 3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); overflow: visible; touch-action: none;
}
@media (pointer: coarse) { .bar, .milestone { touch-action: auto; } }
.bar.item-in-progress { background: var(--blue); }
.bar.item-complete { background: var(--green); }
.bar-progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.28); border-radius: 6px 0 0 6px; pointer-events: none; }
.bar.item-complete .bar-progress { background: transparent; }
.bar.is-fixed { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18) 4px, transparent 4px, transparent 8px); outline: 2px solid #111827; }
.bar.is-conflict { outline: 3px solid var(--red); outline-offset: 1px; }
.bar.dragging { opacity: 0.85; cursor: grabbing; z-index: 30; }
.bar-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 10px; cursor: ew-resize; border-radius: 0 6px 6px 0; }
.bar-handle:hover { background: rgba(0, 0, 0, 0.2); }
.bar-text { position: absolute; font-size: 0.78rem; white-space: nowrap; color: #334155; pointer-events: none; z-index: 2; }
.milestone { position: absolute; width: 18px; height: 18px; background: #1f2937; transform: rotate(45deg); cursor: pointer; z-index: 3; border-radius: 2px; }
.milestone.is-done { background: var(--green); }
.milestone.is-conflict { background: var(--red); }
.baseline-bar { position: absolute; height: 5px; background: #a3b1c2; border-radius: 3px; z-index: 1; pointer-events: none; }
.gantt-arrows { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.gantt-arrows .arrow { fill: none; stroke: #94a3b8; stroke-width: 1.5; }
.gantt-arrows .arrow.is-conflict { stroke: var(--red); }
.gantt-arrows marker path { fill: #94a3b8; }
.drag-tip { position: absolute; bottom: 30px; left: 0; background: #111827; color: #fff; font-size: 0.75rem; padding: 0.2rem 0.45rem; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.gantt-hint { padding: 0.5rem 0.9rem; margin: 0; border-top: 1px solid var(--border); }
@media (max-width: 700px) { :root { --label-w: 140px; } }

.sched-list { list-style: none; padding: 0; margin: 0 0 1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.sched-list li + li { border-top: 1px solid #eef0f3; }
.sched-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; padding: 0.75rem 0.9rem; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; align-items: center; }
.sched-row:hover { background: #fff7ed; }
.sched-row.is-conflict { border-left: 4px solid var(--red); }
.sched-main { display: flex; flex-direction: column; min-width: 0; }
.sched-dates { display: flex; flex-direction: column; font-size: 0.9rem; grid-column: 1; }
.sched-row .pill { grid-column: 2; grid-row: 1; justify-self: end; }
@media (min-width: 700px) {
  .sched-row { grid-template-columns: 2fr 1.4fr auto; }
  .sched-dates { grid-column: 2; grid-row: 1; }
  .sched-row .pill { grid-column: 3; }
}

dialog.editor { border: 0; border-radius: 14px; padding: 0; width: min(720px, calc(100vw - 1rem)); max-height: calc(100vh - 1rem); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
dialog.editor::backdrop { background: rgba(15, 23, 42, 0.55); }
.editor-form { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.fixed-check { flex-wrap: wrap; align-self: end; }
.deps-field { display: block; }
.dep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.dep-row select { flex: 1 1 180px; width: auto; }
.dep-row .lag { width: 80px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; position: sticky; bottom: 0; background: #fff; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.push-right { margin-left: auto; }
@media (max-width: 640px) {
  dialog.editor { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
}

/* ---------- company calendar ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.cal-title { margin-left: 0.5rem; font-size: 1.05rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filters label { flex: 1 1 160px; }
.cal-entry { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: #eef2ff; border-left: 4px solid var(--blue); border-radius: 6px; padding: 0.3rem 0.45rem; margin-top: 0.35rem; font-size: 0.8rem; }
.cal-entry:hover { background: #e0e7ff; }
.cal-entry.is-milestone { background: #f3f4f6; border-left-color: #1f2937; }
.cal-entry.is-conflict { background: #fef2f2; border-left-color: var(--red); }
.cal-entry.is-double { box-shadow: inset 0 0 0 2px #f59e0b; }
.cal-entry.is-done { opacity: 0.6; border-left-color: var(--green); }
.cal-project { font-size: 0.7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cal-item { font-weight: 600; }
.cal-who { color: var(--muted); }
.cal-day { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; min-height: 90px; }
.cal-day.is-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-day.out-month { background: #fafafa; }
.today-tag { background: var(--brand); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 0.05rem 0.35rem; border-radius: 3px; vertical-align: middle; }
.editor-form { padding-bottom: 1.25rem; }
.cal-date a { font-weight: 700; font-size: 0.85rem; text-decoration: none; color: var(--text); }
.cal-week { display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
.cal-dayview { display: grid; gap: 0.25rem; max-width: 640px; }
.cal-weekdays { display: none; }
.cal-grid { display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
@media (max-width: 899px) {
  .cal-grid .cal-day.is-empty, .cal-grid .cal-day.out-month { display: none; }
  .cal-week .cal-day.is-empty { min-height: 0; }
}
@media (min-width: 900px) {
  .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; font-weight: 700; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; text-align: center; }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-grid .cal-day { min-height: 110px; }
}

.workdays .chips { margin-bottom: 0.5rem; }
details.workdays > summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
details.workdays[open] > summary { margin-bottom: 0.6rem; }
.summary-note { font-weight: 400; color: var(--muted); }

.gantt-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: -0.25rem 0 0.6rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 0.35rem; }
.lg-sw { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.lg-not-started { background: #64748b; }
.lg-in-progress { background: var(--blue); }
.lg-complete { background: var(--green); }
.lg-fixed { background: #64748b repeating-linear-gradient(45deg, rgba(255,255,255,.35), rgba(255,255,255,.35) 3px, transparent 3px, transparent 6px); outline: 2px solid #111827; }
.lg-conflict { background: #fff; outline: 3px solid var(--red); }
.lg-baseline { background: #a3b1c2; height: 5px; }
.lg-milestone { width: 10px; height: 10px; background: #1f2937; transform: rotate(45deg); border-radius: 1px; }
.lg-today { width: 2px; height: 14px; background: var(--brand); border-radius: 0; }
.gh-today { position: absolute; top: 26px; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 0 0.3rem; border-radius: 3px; z-index: 1; }
.gantt-arrows .lag-label { font-size: 10px; fill: #64748b; }

/* Quote requests from the website */
.mainnav .count { display: inline-block; min-width: 1.4em; padding: 0 0.4em; margin-left: 0.25rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1.4; text-align: center; }
.request-banner { margin: 0 0 1rem; }
.request-banner a { display: block; background: var(--brand-soft); border: 1px solid #fed7aa; color: var(--brand-dark); padding: 0.65rem 0.85rem; border-radius: 8px; text-decoration: none; }
.request-banner a:hover { text-decoration: underline; }
.request-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.request-head h2 { margin: 0; font-size: 1.15rem; }
.request-contact { margin: 0.35rem 0 0.75rem; }
.request-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 0.75rem; }
.request-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.request-facts dd { margin: 0; font-weight: 600; }
.request-message { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 8px; padding: 0.65rem 0.8rem; margin: 0 0 0.75rem; }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.request-done { opacity: 0.85; }
.handled-list { margin-top: 1.5rem; }
.handled-list summary { cursor: pointer; font-weight: 600; margin-bottom: 0.75rem; }

/* ------------------------------------------------------------------ leads */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.pipe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.pipe-num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.pipe-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.pipe-new { border-color: #fed7aa; background: var(--brand-soft); }
.pipe-won .pipe-num { color: #166534; }
.pipe-rate { border-style: dashed; }
.ai-line { margin: 0 0 1rem; }
.stage-new { background: var(--brand-soft); color: var(--brand-dark); }
.stage-contacted { background: #e0f2fe; color: #075985; }
.stage-walkthrough { background: #e0e7ff; color: #3730a3; }
.stage-estimate { background: #fef3c7; color: #92400e; }
.stage-won { background: #dcfce7; color: #166534; }
.stage-lost { background: #e5e7eb; color: #374151; }
.pill-ai { background: #1c1e1a; color: #fff; }
.pill-hot { background: #fee2e2; color: #991b1b; }
.cold-banner { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: 0.6rem 0.85rem; border-radius: 8px; margin: 0 0 1rem; }
.lead-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.lead-row > a { display: flex; align-items: center; gap: 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.lead-row > a:hover { border-color: #b8c0cc; }
.lead-cold > a { border-left: 4px solid #f59e0b; }
.lead-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; background: #eef1f5; }
.lead-thumb-none { display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--muted); }
.lead-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lead-name { font-weight: 700; font-size: 1.05rem; }
.lead-what { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.lead-cold-text { color: #92400e; font-size: 0.85rem; font-weight: 600; }
.lead-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.35rem; max-width: 45%; }
@media (max-width: 640px) { .lead-row > a { flex-wrap: wrap; } .lead-meta { max-width: none; justify-content: flex-start; width: 100%; } .lead-thumb { width: 72px; height: 54px; } }
.crumbs { margin: 0 0 0.5rem; }
.lead-grid { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 900px) { .lead-grid { grid-template-columns: 3fr 2fr; } }
.lead-contact { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.next-card h2 { margin-top: 0; font-size: 1.1rem; }
.lost-box { margin-top: 1rem; }
.lost-box summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.lead-photos { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.lead-photos figure { margin: 0; width: 240px; max-width: 100%; }
.lead-photos img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.lead-photos figcaption { font-size: 0.85rem; margin-top: 0.25rem; display: flex; gap: 0.35rem; align-items: center; }
.history { list-style: none; margin: 1rem 0; padding: 0; }
.history li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.history-note { flex-basis: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.form-actions:has(.inline-actions) { align-items: center; }
.warn-text { color: #92400e; }
